Have buyer choose whether to use “both shipping address + payment method” or “payment method only” in the checkout flow
Flow diagram
Below diagram shows website screen transitioning togehter with merchant and Amazon Pay processes involved. Diagram is horizontal, and flows from left to right. Scroll the diagram to the right to see all flow.
Option1. Have buyer choose on dialog
Button rendering script example for above scenario
<body>
<div id="AmazonPayButton"></div>
<script src="https://static-fe.payments-amazon.com/checkout.js"></script>
<script type="text/javascript" charset="utf-8">
var amazonPayButton = amazon.Pay.renderButton('#AmazonPayButton', {
// set checkout environment
merchantId: 'xxxxxxx',
ledgerCurrency: 'JPY',
sandbox: true,
checkoutLanguage: 'ja_JP',
productType: 'PayAndShip',
placement: 'Cart',
buttonColor: 'Gold',
});
//Set Amazon Pay Button click event
amazonPayButton.onClick(function(){
//1. Add a function to show a dialog
//2. Based on buyer choice on a dialog,
//If buyer chose to use both shipping address and payment instrument from Amazon Pay, you will initiate Checkout Session by executing amazonPayButton.initCheckout
amazonPayButton.initCheckout({
createCheckoutSessionConfig: {
payloadJSON: '{
"webCheckoutDetails": {
"checkoutReviewReturnUrl": "https://a.com/merchant-review-page"
},
"storeId": "amzn1.application-oa2-client.xxxxxxxxx",
"scopes": ["name", "email", "phoneNumber", "billingAddress"],
"deliverySpecifications": {
"addressRestrictions": {
"type": "Allowed",
"restrictions": {
"JP": {
"statesOrRegions" : ["東京都"],
"zipCodes": ["1530064"]
}
}
}
}
}',
signature: 'xxxx',
publicKeyId: 'xxxxxxxxxx'
}
});
//If buyer chose to use only payment instrument from Amazon Pay, you will initiate Checkout Session by amazon.Pay.initCheckout
amazon.Pay.initCheckout({
merchantId: 'xxxxxxx',
ledgerCurrency: 'JPY',
sandbox: true,
checkoutLanguage: 'ja_JP',
productType: 'PayOnly', //Change to "PayOnly"
placement: 'Cart',
buttonColor: 'Gold',
createCheckoutSessionConfig: {
payloadJSON: '{
"webCheckoutDetails": {
"checkoutReviewReturnUrl": "https://a.com/merchant-review-page"
},
"storeId": "amzn1.application-oa2-client.xxxxxxxxx",
"scopes": ["name", "email", "phoneNumber", "billingAddress"],
}',
signature: 'xxxx',
publicKeyId: 'xxxxxxxxxx'
}
});
});
</script>
</body>
caution
If you use different productType for checkout initiation from the one in Amazon Pay rendering script, it is treated as exceptional implementation.
Please contact Amazon Pay team if you want to consider this integration in advance.
Option2. Have buyer choose shipping address on order review page with tabs
- Flow starts as same with Merchant showing Amazon Pay button on their website such as explained in;
- "Merchant site to show Amazon Pay button on cart" or,
- "Merchant site to choose Amazon Pay as payment method".
Checkout Session productType is "PayAndShip".
- Then, when the buyer comes back to order review page after Amazon Pay Hosted page, the buyer sees two types of shipping address (one is from Amazon Pay and another is the one input/saved at merchant site).
Below flow diagram starts from above mentioned #2.
Pros and Cons
# | Option | Pros | Cons |
---|---|---|---|
Option1 | Have buyer choose on dialog | - Even if a buyer saves shipping address on merchant site, the buyer still can choose to use Amazon Pay shipping address as preferred. - Amazon can show only intended information (shipping address and/or payment method)on Amazon page based on the buyer’s choice. | - Merchant’s amount of development effort increases as they need to add conditional branches as needed. - Product type used for rendering Amazon Pay button and actual checkout session differs in some cases, and requires Amazon Pay approval for exceptional integration. |
Option2 | Have buyer choose shipping address on order review page with tabs | Keep Amazon Pay integration scope minimum as merchant can use PayAndShip for both new and existing buyers. | - Merchant’s amount of development effort increases as they need to modify order review page to show both addresses. - Checkout Session object holds Amazon shipping address only, and if the buyer chose to use merchant site’s shipping address, Amazon will not be able to know the real shipping address. - In case of Amazon a-z guarantee is applied, your rebuttal may be disadvantageous. |