WeChat Pay is an e-commerce payment system used in China that allows payers to purchase using direct online transfers from their WeChat Pay account. Payers are redirected to their WeChat Pay account where they can initiate an instant payment.
WeChat Pay is a supported browser payment method in the Mastercard Payment Gateway. This page describes integration details specific to WeChat Pay. It's recommended that you read the integration guidelines for browser payments, before building a WeChat Pay integration.
WeChat Pay browser payments are supported for transactions in EUR, USD, GBP, and CHF currencies.
To offer WeChat Pay as a payment method via the Mastercard Payment Gateway:
Note that the gateway only supports WeChat Pay for cross-border merchants, i.e., international merchants entering the Chinese market and Chinese tourists abroad that want to pay with WeChat Pay. The gateway does not allow processing CNY natively for Chinese-domiciled merchants.
In the case of cross-border merchants:
WeChat Pay via Hosted Checkout will be available soon. Please contact your payment service provider for further information.
Direct Payment integration allows you to offer WeChat Pay payment method on your own checkout page.
In addition to the standard fields required in a browser payment request, provide the following fields in the Initiate Browser Payment
request:
sourceOfFunds.type
= WECHAT_PAY
browserPayment.operation
= PAY
(the Authorize operation is not supported by WeChat Pay)sourceOfFunds.provided.weChatPay.accountHolder
: The name of the account holder for the payer's WeChat Pay account.You can set the language that you prefer WeChat Pay to use for pages displayed to the payer by providing the browserPayment.preferredLanguage
field in the Initiate Browser Payment request. However, the language will be used only if WeChat Pay supports it.
{ "apiOperation":"INITIATE_BROWSER_PAYMENT", "browserPayment":{ "operation":"PAY", "returnUrl":"https://<return_url>" }, "order": { "amount": "10.00", "currency": "EUR" }, "sourceOfFunds": { "type": "WECHAT_PAY", "provided": { "weChatPay": { "accountHolder": "John Smith" } } } }
The table below shows the transaction response codes for the possible scenarios you may encounter after initiating a WeChat Pay payment.
Initiate Browser Payment Response |
What This Means... |
---|---|
response.gatewayCode=SUBMITTED result=SUCCESS |
Redirect the payer using the URL provided in the response. |
Retrieve Transaction/Retrieve Order Response |
What This Means... |
response.gatewayCode=APPROVED result=SUCCESS sourceOfFunds.provided.weChatPay.accountHolder
|
The payment is successful. |
response.gatewayCode= PENDING result=PENDING |
The Mastercard Payment Gateway is waiting for a notification from the acquirer about the payment result. Try RETRIEVE_TRANSACTION again later or listen to notifications from the Mastercard Payment Gateway. |
response.gatewayCode= CANCELLED result=FAILURE |
The payer has cancelled the interaction for this payment. Offer the payer the option to try another payment method. |
response.gatewayCode= DECLINED or ACQUIRER_SYSTEM_ERROR result=FAILURE |
The payment was declined. Offer the payer the option to try another payment method. In the case of an ACQUIRER_SYSTEM_ERROR you may want to inquire with the acquirer the reason for payment failure, or you can try RETRIEVE_TRANSACTION again. |
response.gatewayCode=TIMED_OUT result=FAILURE |
Treat this as a declined payment. The Mastercard Payment Gateway will make any attempt to ensure the transaction was not successful or will revert the transaction. |
You can refund WeChat Pay payments in part or in full. You must be configured for refunds on the Mastercard Payment Gateway and on your merchant account at your browser payments service provider.
The Mastercard Payment Gateway provides a browser payments emulator that allows you to test your WeChat Pay integration.
Copyright © 2022 Mastercard