@@ -505,6 +505,19 @@ public function testCustomerAvailablePaymentMethodsField() {
505505 last4
506506 }
507507 }
508+ availablePaymentMethodsCC {
509+ id
510+ tokenId
511+ last4
512+ expiryMonth
513+ expiryYear
514+ cardType
515+ }
516+ availablePaymentMethodsEC {
517+ id
518+ tokenId
519+ last4
520+ }
508521 }
509522 }
510523 ' ;
@@ -546,6 +559,28 @@ public function testCustomerAvailablePaymentMethodsField() {
546559 $ this ->expectedField ( 'cardType ' , 'visa ' ),
547560 ]
548561 ),
562+ $ this ->expectedNode (
563+ 'customer.availablePaymentMethodsCC ' ,
564+ [
565+ $ this ->expectedField ( 'id ' , $ this ->toRelayId ( 'token ' , $ token_cc ->get_id () ) ),
566+ $ this ->expectedField ( 'tokenId ' , $ token_cc ->get_id () ),
567+ $ this ->expectedField ( 'last4 ' , 1234 ),
568+ $ this ->expectedField ( 'expiryMonth ' , $ expiry_month ),
569+ $ this ->expectedField ( 'expiryYear ' , $ expiry_year ),
570+ $ this ->expectedField ( 'cardType ' , 'visa ' ),
571+ ]
572+ ),
573+ $ this ->expectedNode (
574+ 'customer.availablePaymentMethodsEC ' ,
575+ [
576+ $ this ->not ()->expectedField ( 'id ' , $ this ->toRelayId ( 'token ' , $ token_cc ->get_id () ) ),
577+ $ this ->not ()->expectedField ( 'tokenId ' , $ token_cc ->get_id () ),
578+ $ this ->not ()->expectedField ( 'last4 ' , 1234 ),
579+ $ this ->not ()->expectedField ( 'expiryMonth ' , $ expiry_month ),
580+ $ this ->not ()->expectedField ( 'expiryYear ' , $ expiry_year ),
581+ $ this ->not ()->expectedField ( 'cardType ' , 'visa ' ),
582+ ]
583+ ),
549584 $ this ->expectedNode (
550585 'customer.availablePaymentMethods ' ,
551586 [
@@ -554,6 +589,22 @@ public function testCustomerAvailablePaymentMethodsField() {
554589 $ this ->expectedField ( 'last4 ' , 4567 ),
555590 ]
556591 ),
592+ $ this ->expectedNode (
593+ 'customer.availablePaymentMethodsCC ' ,
594+ [
595+ $ this ->not ()->expectedField ( 'id ' , $ this ->toRelayId ( 'token ' , $ token_ec ->get_id () ) ),
596+ $ this ->not ()->expectedField ( 'tokenId ' , $ token_ec ->get_id () ),
597+ $ this ->not ()->expectedField ( 'last4 ' , 4567 ),
598+ ]
599+ ),
600+ $ this ->expectedNode (
601+ 'customer.availablePaymentMethodsEC ' ,
602+ [
603+ $ this ->expectedField ( 'id ' , $ this ->toRelayId ( 'token ' , $ token_ec ->get_id () ) ),
604+ $ this ->expectedField ( 'tokenId ' , $ token_ec ->get_id () ),
605+ $ this ->expectedField ( 'last4 ' , 4567 ),
606+ ]
607+ ),
557608 ];
558609
559610 $ this ->assertQuerySuccessful ( $ response , $ expected );
0 commit comments