There are multiple types of payment methods. For the attributes of a specific type of payment method response, see one of the following response objects:

Payment method objects included in other responses (such as Customer) may be any of these types. For example:

gateway.customer.find("theCustomerId", function(err, customer) {
  customer.paymentMethods; // array of PaymentMethod objects
Returned directly or within a successful result object from the following requests:

token String

An alphanumeric value that references a specific payment method stored in your Vault.



To determine if a payment method is the default for its customer:


Determine payment method type

To determine the type of payment method (e.g. credit card, PayPal), you need to inspect the class of the payment method object.

gateway.paymentMethod.find("credit-card-token", (err, paymentMethod) => {
  paymentMethod instanceof braintree.CreditCard
  // true

gateway.paymentMethod.find("paypal-account-token", (err, paymentMethod) => {
  paymentMethod instanceof braintree.PayPalAccount
  // true

gateway.paymentMethod.find("apple-pay-token", (err, paymentMethod) => {
  paymentMethod instanceof braintree.ApplePayCard
  // true

gateway.paymentMethod.find("android-pay-token", (err, paymentMethod) => {
  paymentMethod instanceof braintree.AndroidPayCard
  // true