diff --git a/CHANGELOG.md b/CHANGELOG.md index 690c3ec9..108c86cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## unreleased +* Include UsBankAccount Accounts in `Customer#getPaymentMethods` + ## 3.34.0 * Add domains parameter support to `ClientTokenRequest` * Add `isNetworkTokenized` to `PaymentMethodNonceDetails` diff --git a/src/main/java/com/braintreegateway/Customer.java b/src/main/java/com/braintreegateway/Customer.java index 3803811d..3a4b99de 100644 --- a/src/main/java/com/braintreegateway/Customer.java +++ b/src/main/java/com/braintreegateway/Customer.java @@ -213,6 +213,7 @@ public List getPaymentMethods() { paymentMethods.addAll(getSamsungPayCards()); paymentMethods.addAll(getSepaDirectDebitAccounts()); paymentMethods.addAll(getCustomActionsPaymentMethods()); + paymentMethods.addAll(getUsBankAccounts()); return Collections.unmodifiableList(paymentMethods); } diff --git a/src/test/java/com/braintreegateway/integrationtest/CustomerIT.java b/src/test/java/com/braintreegateway/integrationtest/CustomerIT.java index 8a422aa7..0a7eae7d 100644 --- a/src/test/java/com/braintreegateway/integrationtest/CustomerIT.java +++ b/src/test/java/com/braintreegateway/integrationtest/CustomerIT.java @@ -621,7 +621,8 @@ public void createWithUsBankAccountNonce() { Result result = gateway.customer().create(request); assertTrue(result.isSuccess()); - assertEquals(1, result.getTarget().getUsBankAccounts().size()); + Customer customer = result.getTarget(); + assertEquals(1, customer.getUsBankAccounts().size()); UsBankAccount usBankAccount = result.getTarget().getUsBankAccounts().get(0); assertEquals("021000021", usBankAccount.getRoutingNumber()); @@ -629,6 +630,7 @@ public void createWithUsBankAccountNonce() { assertEquals("checking", usBankAccount.getAccountType()); assertEquals("Dan Schulman", usBankAccount.getAccountHolderName()); assertTrue(Pattern.matches(".*CHASE.*", usBankAccount.getBankName())); + assertTrue(customer.getPaymentMethods().contains(usBankAccount)); } @Test @@ -1851,7 +1853,7 @@ public void updateWtihTaxIdentifiers() { Result updateResult = gateway.customer().update(customer.getId(), updateRequest); assertTrue(updateResult.isSuccess()); } - + @Test public void updateWithAndroidPayCardRequest() { CustomerRequest createRequest = new CustomerRequest(). @@ -1946,7 +1948,7 @@ public void updateWithAndroidPayNetworkTokenRequest() { assertNotNull(androidPayCard.getToken()); assertTrue(androidPayCard.isDefault()); } - + @Test public void updateWithApplePayCardRequest() { CustomerRequest createRequest = new CustomerRequest().