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, callbackopt) → {Promise|void}
Gets the Express Checkout nonce profile given a nonce from American Express.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
options |
object |
Request options Properties
|
|||||||
callback |
callback |
<optional> |
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, callbackopt) → {Promise|void}
Gets the rewards balance associated with a Braintree nonce.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
options |
object |
Request options Properties
|
|||||||
callback |
callback |
<optional> |
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);
});
});
teardown(callbackopt) → {Promise|void}
Cleanly tear down anything set up by create.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
callback |
<optional> |
Called once teardown is complete. No data is returned if teardown completes successfully. |