Overview of the integration
The following is an overview of the typical process to set up Amazon Pay on your website for an automatic payment. The steps are grouped into two parts: enabling the purchase flow and processing payments. You will read more about these steps in detail later in the guide.
Enabling the purchase flow
- Add the Login with Amazon button or the Amazon Pay button on the page where the customer starts the checkout flow (for example, the create an account page, the shopping cart, or the product detail page). The Login with Amazon button enables a customer to authenticate with Amazon Pay, and the Amazon Pay button can be used for authentication and payment.
- After the customer has successfully authenticated, Amazon Pay provides you an Access Token. You can optionally use this token to get customer's name, email, and zip code. Note that you get the customer's profile information only if you are using the Login with Amazon or Amazon Pay (Access to full shipping address) button types.
- If the customer has chosen an address from the AddressBook widget, get the shipping address by calling the GetBillingAgreementDetails operation to compute taxes and shipping costs, and show the shipping and tax amount to the customer.
- Optionally, provide details about the payment like a note to the customer about the purchase or an order/subscription identifier to Amazon Pay by calling the SetBillingAgreementDetails operation.
- Show the Authorize Recurring Payments widget to obtain the customer's consent for future payments.
- Optionally, show the read-only version of the AddressBook and Wallet widgets on your order review page.
- After the customer authorizes the payment and confirms the purchase, confirm the purchase to Amazon Pay by calling the ConfirmBillingAgreement operation.
- To ensure that the customer has chosen a valid payment method, you have the option to call the ValidateBillingAgreement operation.
- Thank the customer for placing the order. Send an order confirmation email to the customer.
Note: Amazon Pay sends the "New merchant agreement" email to the customer when you confirm the Billing Agreement with Amazon Pay. This informs the customer that they have set up Amazon Pay as their payment method for future payments and purchases.
The following image shows how to enable a purchase using Amazon Pay and Login with Amazon:
The following image shows how to enable the guest checkout option using Amazon: Pay
- Request Amazon Pay to authorize the customer's payment by calling the AuthorizeOnBillingAgreement operation to ensure that the payment method has sufficient funds for the purchase. You can capture these funds at a later time by using the Capture operation as described in step 3 below. If you do not need to authorize payment before fulfilling the order, you can both authorize and capture funds with this operation. Note: Amazon Pay provides both synchronous and asynchronous modes for the AuthorizeOnBillingAgreement operation. With the synchronous mode, you receive the final processing status of your AuthorizeOnBillingAgreement request at the same time. In asynchronous mode, you first receive a Pending status of the Authorization object. After processing is complete, Amazon Pay notifies you of the final processing status via an Instant Payment Notification (IPN). For more information, see Synchronous and asynchronous modes of the AuthorizeOnBillingAgreement operation.
- For Asynchronous mode, listen for the Authorize Instant Payment Notification (IPN) for the processing status of your authorization request.
- When you want to capture previously authorized payments, call the Capture operation.
- Listen to the Capture IPN for the processing status of your capture request. Amazon Pay sends a "Charge notification" email to the customer when the capture is successfully processed.
- If you need to issue a refund, you can do so by calling the Refund operation.
- Listen to the Refund IPN for the processing status of your refund request. Amazon Pay sends a "Refund notification" email to the customer when the refund is successfully processed.
The following image shows how to process a payment: