Constructor
new AmericanExpress(options)
You cannot use this constructor directly. Use braintree.american-express.create instead.
Parameters:
Name | Type | Description |
---|---|---|
options |
object | Options |
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
|
||||||
callback |
callback | The second argument, |
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
|
||||||
callback |
callback | The second argument, |
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);
});
});