BrainTree: get all customer payment methods

There is a way to get a list of all the cards:

gateway.creditCard.expiringBetween(year1900, year2100, function (err, result) {...})

and then call paymentMethod.findfor each individual card. But I would like to get all the payment methods related to the client with one call, is this possible?

+4
source share
2 answers

I work at Braintree. If you have more questions, you can always contact our support team .

The client is serialized with all its payment methods.

So, get a customer , and then get a credit card and paypal from it :

gateway.customer.find("theCustomerId", function(err, customer) {
    var payment_methods = customer.creditCards.concat(customer.paypalAccounts);
});
+6
source

. gateway.customer.find creditCards, .

+1

All Articles