System interaction flow
- Users start to check out at the cashier of the merchant.
- Users open Alipay app, and then scan the QR code provided by the partner to visit the page provided by the partner to enter the payment amount.
- The user enters the payment amount on the payment page and then submits it to the partner server.
- When the partner server processes the HTTP request, it discovers the UA is from Alipay Wallet (judging from the User-Agent value enclosed in the http request header). Then the partner server places a pre-order by calling the alipay.acquire.precreate API. After receiving the payment URL (a QR code) enclosed in the response, the parter server redirects the user to visit this payment URL. From the user’s point of view, these transactions and redirection are unnoticeable, and the whole workflow is simply put as san the QR code to pay.
- Alipay Wallet prompts the user to confirm the order and pay. The user enters the password to complete the payment.
- After the payment succeeds, Alipay sends an asynchronous notification to the partner.
- In the meantime, Alipay notify the user of the successful payment by SMS messages.
For the simplified solution, a partner needs to complete the following steps:
- Integrate the alipay.acquire.precreate API to place a pre-order.
- Redirect users to visit the Alipay payment QR code URL.
- Receive the asynchronous notification of the payment result.