AmericanExpress

AmericanExpress

This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields.

Constructor

new AmericanExpress(options)

You cannot use this constructor directly. Use braintree.american-express.create instead.

Parameters:
Name Type Description
options object

Options

Source:

Methods

getExpressCheckoutProfile(options, callback) → {void}

Gets the Express Checkout nonce profile given a nonce from American Express.

Parameters:
Name Type Description
options object

Request options

Properties
Name Type Description
nonce string

An existing nonce from American Express (note that this is not a nonce from Braintree).

callback callback

The second argument, data, is the returned server data.

Source:
Example
var americanExpress = require('braintree-web/american-express');

americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {
  var options = {nonce: existingAmericanExpressNonce};
  americanExpressInstance.getExpressCheckoutProfile(options, function (getErr, payload) {
    if (getErr) {
      // Handle error
      return;
    }

    console.log('Number of cards: ' + payload.amexExpressCheckoutCards.length);
  });
});

getRewardsBalance(options, callback) → {void}

Gets the rewards balance associated with a Braintree nonce.

Parameters:
Name Type Description
options object

Request options

Properties
Name Type Description
nonce string

An existing Braintree nonce.

callback callback

The second argument, data, is the returned server data.

Source:
Example
var americanExpress = require('braintree-web/american-express');

americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {
  var options = {nonce: existingBraintreeNonce};
  americanExpressInstance.getRewardsBalance(options, function (getErr, payload) {
    if (getErr || payload.error) {
      // Handle error
      return;
    }

    console.log('Rewards amount: ' + payload.rewardsAmount);
  });
});