Login expired. Please log in again.
The Merchant's backend calls the Unified Order API and the WeChat payment system returns code_url to the Merchant's backend to create a QR Code. The Payer scans the QR Code in WeChat to initiate payment.
Note: code_url is valid for up to 2 hours. The Payer can't scan the QR Code to pay again once it has expired.
Figure 7.6 Native Payment API
1. The Merchant's backend creates an order based on the product selected by the Payer.
2. The Payer confirms payment and the Merchant calls the WeChat payment system 【Unified Order API】 to create an advance payment transaction.
3. WeChat payment system creates an advance transaction bill upon receiving this request, and returns code_url.
4. The Merchant’s backend creates a QR Code based on code_url.
5. The Payer opens “Scan QR Code” in WeChat and scans the QR code. The scanned data is sent to the WeChat payment system from the Payer's WeChat.
6. The WeChat payment system receives the request from WeChat and verifies the URL. If the URL is verified to be valid, payment is initiated and requires the Payer's authorization.
7. The Payer enters their payment password and confirms payment in WeChat. The payment authorization is submitted to the WeChat payment system from WeChat.
8. The WeChat payment system completes the transaction based on the Payer's authorization.
9. The WeChat payment system returns the transaction result to the Payer's WeChat via SMS after the payment is done. The Payer can view the payment result in their WeChat.
10. The WeChat payment system sends an asynchronous message to inform the Merchant's backend of the payment result. Then Merchant's backend replies to inform the WeChat payment system the payment is completed.
11. The Merchant’s backend polls the 【Query Order API】 if no payment message is received.
12. The Merchant confirms the order and delivers products to the Payer.