5.4 WECHAT
WeChat Pay is a payment feature integrated into the WeChat app, users can complete payment quickly with smartphones. WeChat has Quick Pay, QR Code Payments, In-App Web-Based Payments, and Native In-App Payments, all to fulfill the full range of scenarios your customers expect to fulfill different payment situations.
Scenario | Category | Payment method | Payment product | Integration type | Authentication | Redirect Type | Code Type | Pre-auth | Partial Refund | Cancellation supported |
---|---|---|---|---|---|---|---|---|---|---|
ONLINE/OFFLINE | Ewallet | QR_CODE_PAYMENT | API, POS | - | - | Order code | - | YES | - | |
OFFLINE | Ewallet | QUICK_PAY | API, POS | - | - | Payment code | - | YES | - | |
ONLINE | Ewallet | INAPP_PAYMENT | API | - | In-app | - | - | YES | - | |
ONLINE | Ewallet | OFFICIAL_ACCOUNT_PAYMENT | API,EMVCO_QR | - | In-app | - | - | YES | - | |
ONLINE | Ewallet | MINI_PROGRAM_PAYMENT | API | - | In-app | - | - | YES | - | |
ONLINE | Ewallet | WEB_PAYMENT | API | - | In-app | - | - | YES | - |
Payment Product | Description |
---|---|
QR_CODE_PAYMENT |
Merchant-Presented Mode Payment product. WeChat's Payment product. QR_CODE_PAYMENT is applicable to both online and offline scenarios. One code value can only be used for one transaction. For example, the order code displayed on the merchant's terminal screen or printed on the cashier's receipt. After the user scans the code, the user usually does not need to enter the transaction amount to initiate the payment. |
QUICK_PAY |
User-Presented Mode Payment product.T he WeChat Pay user opens the WeChat client and selects + in the top right corner > Money or Me > Services > Money to show the payment code. The merchant uses a code scanning device to scan the payment code and complete the deduction. |
INAPP_PAYMENT |
Payment product. In-App Payment means that the WeChat Pay user selects goods and places orders in the merchant's App, and selects WeChat Pay at the payment stage. Then the WeChat client will be pulled up from the merchant's App, and the system will automatically redirect back to the merchant's App after the user completes the payment in the WeChat client. |
OFFICIAL_ACCOUNT_PAYMENT |
Payment product. It refers to the payment capability of the user in opening the merchant's H5 page in the WeChat client and pulling up the WeChat Pay cash register on the H5 page to complete the payment. |
MINI_PROGRAM_PAYMENT |
Payment product. Pay by Mini Program means that merchants provide goods or services for users through WeChat Pay mini programs, and users complete payment through WeChat Pay in the WeChat Pay mini programs. |
WEB_PAYMENT |
Payment product. It refers to the payment capability that the merchant displays goods or services on the mobile Web page outside the WeChat client. When the user confirms using WeChat Pay on the above page, the merchant initiates H5 payment to call the WeChat client, and the user completes the payment on the WeChat client. |
Experience and integration process
Capabilities | APIs | Description |
---|---|---|
Initiate a payment | PAY | |
Refund a payment | REFUND | |
Inquiry transaction result | DETAIL | |
Notify transaction result | NOTIFICATION |
Initiate a payment
Field | Description | Required |
---|---|---|
paymentMethod |
Must be "WECHAT" |
M |
product |
For QUICK_PAY, it must be "QUICK_PAY"; |
M |
expireAt |
The format is "yyyy-MM-dd hh:mm:ss", and it must be less than 72 hours after the payment request is sent. |
C |
payCodeValue |
It's required when the product is "QUICK_PAY" |
C |
openId |
It's required when the product is "OFFICIAL_ACCOUNT_PAYMENT", "IN_APP_PAYMENT", "MINI_PROGRAM_PAYMENT" |
C |
goods.description |
It's required when paymentMethod is WECHAT |
M |
Handle the payment result To complete the payment:
- OFFICIAL_ACCOUNT_PAYMENT, MINI_PROGRAM_PAYMENT
- Pass the values prepayid in the(payAction, "type": "REDIRECT", "Url") object to the WeChat Pay SDK. The WeChat Pay SDK launches the WeChat app, where the shopper can proceed to complete the payment. The value is valid for 2 hours.
- Use the data.status from the PAY response to present the payment result to your shopper. You can also wait the NOTIFICATION or submit a DETAIL request for the payment result.
- QR_CODE_PAYMENT
- Present the QR code image(payAction, "type": "QRCODE", "redirectUrl") to the shopper for scanning.
- After the shopper completes the payment, wait the NOTIFICATION or submit a DETAIL request for the payment result.
- PAYMENT_CODE
- Use the data.status from the PAY response to present the payment result to your shopper. You can also wait the NOTIFICATION or submit a DETAIL request for the payment result.
- WEB_PAYMENT
- Redirect shopper(payAction, "type": "REDIRECT", "Url") to call the WeChat Pay cashier. Call the WeChat client by visiting the URL to complete the payment. The validity period of Url is 5 minutes.
Updated 6 days ago