Configuring Amazon Pay
Learn how to configure Amazon Pay for DigitalRiver.js with Elements
Step 1: Create an Amazon Pay source using Digital River.js
Create an Amazon Pay element
var options = {
style: {
color: 'DarkGray', // one of ['Gold', 'LightGray', 'DarkGray']
height: '100px'
},
sourceData: {
type: 'amazonPay',
sessionId: sessionId,
country: 'US', // required if your session does not contain shopper country
futureUse: true, // required if you intend to use for recurring billing
usage: 'subscription', //only required if futureUse is true - should be one of ['subscription', 'convenience', ]
mandate: { // required for recurring/reusable
terms: 'Yes, please save this account and payment information for future purchases.'
},
amazonPay: {
//Amazon Pay will redirect to this URL after the buyer signs in
returnUrl: '<return.com URL>',
//where the shopper will be returned after authorizing at Amazon Pay
resultReturnUrl: '<resultreturn.com URL>',
//Amazon Pay will redirect to this URL if the buyer cancels sign-in on the Amazon Pay hosted page
cancelUrl: '<cancel.com URL>',
// Placement of the Amazon Pay button on your website. One of ['Home', 'Cart', 'Product', 'Checkout', 'Other']
placement: 'Product',
// optional, one of ['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
Step 2: Use the authorized source
Option 1. Attach the source to a cart
Option 2. Attach the source to a shopper
Last updated