Amazon Pay element
Learn how to use the Amazon Pay element.
Creating an Amazon Pay element
var options = {
style: {
color: 'DarkGray', // one of ['Gold', 'LightGray', 'DarkGray']
height: '100px'
},
classes: {
empty: 'DRElement',
base: 'DRElement',
invalid: 'DRElement',
complete: 'DRElement',
},
sourceData: {
type: 'amazonPay',
sessionId: sessionId,
country: 'US', // If your session does not contain shopper a country, a two-letter country code is required.
amazonPay: {
//Amazon Pay will redirect the shopper to this URL after the shopper signs in.
returnUrl: 'https://return.com',
//After the shopper authorizes Amazon Pay, the shopper will be returned to this URL.
resultReturnUrl: 'https://resultreturn.com',
//Amazon Pay will redirect the shopper to this URL if the shopper cancels sign-in on the Amazon Pay hosted page.
cancelUrl: 'https://cancel.com',
// The placement of the Amazon Pay button on your website. Your options are: ['Home', 'Cart', 'Product', 'Checkout', 'Other']
placement: 'Product',
// Optional. Specify the checkout language. Your options are: ['en_US', 'en_GB', 'de_DE', 'fr_FR', 'it_IT', 'es_ES', 'ja_JP']
checkoutLanguage: 'fr_FR'
// New optional fields that restrict shipping country.
allowShippingCountries: ['US','GB','DE','CA'], //Only US, GB, DE, and CA will be displayed as shipping country options on Amazon Pay
denyShippingCountries: ['TW','BR','FR','IT'] //TW, BR, FR, IT won’t be displayed as shipping country options on Amazon Pay
}
}
};
var amazonpay = digitalriver.createElement('amazonpay', options);
amazonpay.mount('amazonpay');Attribute
Description
amazonPay.mount();
amazonPay.unmount();
amazonPay.destroy();
Amazon Pay events — amazonPay.on('event', handler);
Event
Triggered When
Ready
Source
Last updated