Before you begin
Before you learn more about how to integrate with Alipay+ Cashier Payment, ensure that you are familiar with the following things:
- The user experience that Alipay+ Cashier Payment can provide to the consumers. For more information, see User experience.
- Different Acquiring Service Providers (ACQPs) provide different service modes, for example:
- some ACQPs provide the payment capability to merchants by packaging the client side and the server side into an integrated service.
- some ACQPs only provide the server side ability, while merchants are required to integrate the Alipay+ client side.
Therefore, for the convenience of developers to read this document, no matter which service mode is used, "your client side" and "your server side" are used uniformly to refer to the corresponding client side and server side in different service mode.
The following figure illustrates the main workflow of Cashier Payment, which focuses on how to accept a payment.
Figure 1. Cashier payment workflow
The payment process consists of the following steps:
- A user places an order on the merchant platform. Then your client side renders the payment method page with the wallet information that is returned in the response of the consultPayment API (Steps 1-7).
- The user selects a payment method to make a payment (Step 8).
- Your client side calls your server side to initiate a payment. Then your server side calls the pay API to place an order with Alipay+. Alipay+ then returns the payment URL to your server side, which then syncs the payment URL to your client side (Steps 9-12).
- If the merchant platform is a desktop website and the selected wallet supports code-scanning, Alipay+ also returns a code value. The merchant can choose to either render the code by themselves or redirect the user to the Alipay+ cashier page where the code is rendered by Alipay+.
- If the merchant platform is an app that integrates the Alipay+ client SDK, Alipay+ also returns the payment data, which can be used by your client side to open the payment confirmation page at the MPP side.
- With the payment URL, your client side redirects the user to the payment confirmation page at the MPP side, where the user confirms the payment (Steps 13-15).
- After the user completes the payment at the MPP side, Alipay+ notifies your server side of the payment result, which is then synced to your client side. At the same time, your server side can initiate an inquiryPayment API request to obtain the payment result asynchronously (Steps 16-22).
- Your client side displays the payment result to the user (Steps 23-24).