Business Process:
1. The merchant backend system creates an order for the products purchased by the user.
2. The user confirms to pay and calls the [Order Placement API] of WeChat Pay to generate a prepayment transaction.
3. After receiving the request, the WeChat Pay system generates a prepayment transaction order and returns the code_url of the transaction session.
4. The merchant backend system generates a QR code according to the returned code_url.
5. The user scans the QR code with WeChat, and the WeChat app sends the code information to the WeChat Pay system.
6. The WeChat Pay system receives the request from the WeChat app, and then initiates a payment which requires user authorization when the code URL is verified to be valid.
7. The WeChat Pay system receives the request from the WeChat app, and then initiates a payment which requires user authorization when the code URL is verified to be valid.
8. The WeChat Pay system completes the transaction according to the user's authorization.
9. The WeChat Pay system returns the transaction result to the Wechat app afterwards, and informs the user of it via SMS and WeChat messages. Payment results are shown at the WeChat app.
10. The WeChat Pay system asynchronously sends the message of the payment result to the merchant backend system. The merchant backend system needs to inform the WeChat backend system of its receipt, and the WeChat backend system can stop sending it.
11. In case no payment notification is received, the merchant backend system calls the [Query Order API].
12. The merchant confirms the payment and sends the products to the user.
URL format: weixin: //wxpay/bizpayurl?sr=XXXXX. The merchant calls the third party library to generate the code_url into a QR code. Since this kind of URL is short, the QR code generated has a high recognition rate when printed on the check-out receipt.
For example, generate weixin://wxpay/s/An4baqw into a QR code, as shown in Fig. 6.10.
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证