感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Verify & complete checkout

[Step 4 of 7] When the onCompleteCheckout event handler is invoked, utilize the Finalize Checkout Session API, which enables Amazon Pay to validate payment critical attributes. This API replaces the Complete Checkout Session API of the standard Amazon Pay CV2integration flow. As the API validates critical information, only consider the checkout successful, if you get a successful response from this API. At the end of this step, you will be able to present the buyer with the checkout result.


Finalize Checkout Session

Use Finalize Checkout Session to confirm you have successfully received the onCompleteCheckout event. The chargeAmount in the request must match the Checkout Session object paymentDetails.chargeAmount to verify order amount. You must also specify totalOrderAmount and supplementaryData if one was provided for the Checkout Session. For PayAndShip use cases, the shippingAddress is also required and must match the address shared by Amazon. For PayOnly use cases, the same requirement exists for the billingAddress.

Successful response:

Finalize Checkout Session will return a success response if the transaction was processed successfully. Implement the guidance that corresponds to the Checkout Session paymentIntent:

paymentIntent
Description
AuthorizeWithCapture
Payment has been authorized and captured.

1. Store the ChargeId - You must store the ChargeId to process refunds.

2. Store the ChargePermissionId - If you specified totalOrderAmount and there is uncaptured payment, see manage deferred payments for more information. You can also use the ChargePermissionId to retrieve buyer and transaction info using Get Charge Permission for 30 days, you must store the data to persist the information beyond 30 days. 
Authorize
Payment has been authorized.

1. Store the ChargeId - You must store the ChargeID for deferred payment capture. See deferred transactions for more info.

2. Store the ChargePermissionId - If you specified totalOrderAmount and there is uncaptured payment, see manage deferred payments for more information. You can also use the ChargePermissionId to retrieve buyer and transaction info using Get Charge Permission for 30 days, you must store the data to persist the information beyond 30 days. 
Confirm
Payment has not been authorized or captured.

1. Store the ChargePermissionId - You must store the ChargePermissionId for deferred payment authorization. See deferred transactions for more info. You can also use the ChargePermissionId to retrieve buyer and transaction info after checkout. You will only be able to retrieve the data using Get Charge Permission for 30 days, you must store the data to persist the information beyond 30 days.  

Error response:

Finalize Checkout Session will return an error response for failed transactions. The buyer either canceled checkout or was unable to provide a valid payment instrument. You should:

  1. Redirect the buyer to the start of checkout
  2. Display a message such as: "Your payment was not successful. Please try another payment method.“