wechat_pay as the payment method type in all three environments.payment_method_options.wechat_pay and explicitly set client.sub_appid and sub_openid are required.| Capability | Support |
|---|---|
| Transaction flow covered by this guide | One-time Payment |
| Integration covered by this guide | Server to Server |
| Client environments | Desktop web, mobile web, WeChat Mini Program |
| Supported countries and currencies | Confirm for your enabled merchant channel |
payment_method_options.wechat_pay.client to select the payment flow.| Client | Customer environment | Payment flow | Required additional fields | Returned next action |
|---|---|---|---|---|
WEB | Desktop browser | Native QR-code payment | None | wechat_pay_display_qr_code |
WAP | Mobile browser | H5 payment | None | redirect |
MINI_APP | WeChat Mini Program | JSAPI payment | sub_appid, sub_openid | redirect |
wechat_pay. Do not use wechat_native, wechat_h5, or wechat_jsapi as payment_method_data.type.payment_method_data.type to wechat_pay and payment_method_options.wechat_pay.client to WEB.{
"payment_method_data": {
"type": "wechat_pay"
},
"payment_method_options": {
"wechat_pay": {
"client": "WEB"
}
}
}next_action when the payment requires customer action.client=WEBnext_action.wechat_pay_display_qr_code.url to open the hosted QR-code payment page.{
"id": "1012609011050163683",
"status": "requires_customer_action",
"next_action": {
"type": "wechat_pay_display_qr_code",
"wechat_pay_display_qr_code": {
"method": "GET",
"url": "https://checkout.useepay.com/v4/pm-redirects/payment-details?session=pmr_0123456789abcdef0123456789abcdef"
}
}
}WAP for mobile web payments. The following fragment replaces the WeChat options in the creation request:{
"payment_method_options": {
"wechat_pay": {
"client": "WAP"
}
}
}client=WAPnext_action.redirect.url to redirect the customer to the hosted payment page, which continues the WeChat Pay H5 flow.{
"id": "1012609011052163685",
"status": "requires_customer_action",
"next_action": {
"type": "redirect",
"redirect": {
"method": "GET",
"url": "https://checkout.useepay.com/v4/pm-redirects/payment-details?session=pmr_123456789abcdef0123456789abcdef0"
}
}
}app_url for the merchant to construct a separate app-launch flow.MINI_APP and provide both:sub_appid: The AppID of the WeChat Mini Program used for the payment.sub_openid: The customer's OpenID associated with that AppID.{
"payment_method_options": {
"wechat_pay": {
"client": "MINI_APP",
"sub_appid": "wx_example_appid",
"sub_openid": "example_customer_openid"
}
}
}client=MINI_APPredirect next action for this flow.{
"id": "1012609011053163686",
"status": "requires_customer_action",
"next_action": {
"type": "redirect",
"redirect": {
"method": "GET",
"url": "https://checkout.useepay.com/v4/pm-redirects/payment-details?session=pmr_23456789abcdef0123456789abcdef01"
}
}
}wx.requestPayment; do not pass the redirect object to that API. Validate hosted-page navigation and authorization in your Mini Program environment before launch.| Field | Required | Description |
|---|---|---|
payment_method_data.type | Yes | Set to wechat_pay. |
payment_method_options.wechat_pay | Yes | WeChat Pay options object. The JSON key is wechat_pay, not wechatpay. |
payment_method_options.wechat_pay.client | Always provide | WEB, WAP, or MINI_APP. |
payment_method_options.wechat_pay.sub_appid | For MINI_APP | WeChat Mini Program AppID. |
payment_method_options.wechat_pay.sub_openid | For MINI_APP | Customer OpenID associated with the AppID. |
requires_customer_action response means that the customer still needs to authorize the payment. Opening the hosted page or returning to the merchant application does not by itself establish payment success.client_secret as required by that endpoint. Treat it as a credential and never log its value.