WeChat Pay H5

WeChat Pay H5 is the flow where consumers shopping in a mobile browser are redirected to the WeChat App to make the payment.

Transaction Flow

  1. From the merchant's webpage, the consumer navigates to the merchant's H5 page where they select to pay with WeChat Pay.
  2. The consumer opens the WeChat app.
  3. They enter the payment password and confirm the payment.
  4. If the payment is successful, the consumer and the merchant receive a payment confirmation.

Specific input parameters

Field nameM/OTypeDescription
specin.ipaddressMstringA public-facing IPv4 address of the consumer's device.

For standard input parameters, see Input parameters for the TRANSACTION call.

This payment method supports the dynamic descriptor field (see The dynamic descriptor).

Specific output parameters

Specific output parameters for the TRANSACTION call

This payment method will emit the output parameters outlined below:

Field nameTypeDescription
SPECOUT.SRCAMOUNTasciiThe total amount in the minor unit of the consumer wallet currency (SPECOUT.SRCCURRENCY)
SPECOUT.SETTLEMENTCURRENCYOThe merchant's preferred settlement currency
SPECOUT.SRCCURRENCYasciiThe currency of the consumer's WeChat wallet
SPECOUT.QRCODEURLasciiThe string used for generating the payment QR code image. It contains a unique URL starting with weixin://.
SPECOUT.EXPIRYTIMESTAMPasciiThe expiry time of the transaction. A future time defined as UNIX timestamp (seconds elapsed since 1970-01-01 00:00:00 UTC).

Example:
1574869035 is the UNIX timestamp for Wednesday, 2019-11-19 15:37:15 UTC

For standard output parameters, check Output parameters for the TRANSACTION call.

It also returns the SPECOUT.REDIRECTOPTIONAL parameter.

Specific output parameters for the REFUND call

Field nameTypeDescription
SPECOUT.DSTAMOUNTasciiTotal amount in the minor unit of the consumer wallet currency (see also SPECOUT.DSTCURRENCY)
SPECOUT.DSTCURRENCYasciiThe currency of the consumer’s WeChat wallet (usually CNY)
SPECOUT.REFUNDSETTLEMENTCURRENCYasciiThe settlement currency of the refund

TRANSACTION call input

tag=wechatpayh5  
&txtype=TRANSACTION  
&login=testmerchant  
&password=test123  
&contractid=JOHNDOECONTRACT  
&channel=testchannel  
¤cy=EUR  
&amount=250  
&countrycode=DE  
&accountholdername=john doe  
&merchanttxid=sale-22is02  
&returnmode=urlencodeext

TRANSACTION call output

REQUESTSTATUS=SUCCEEDED  
STATUS=SUCCEEDED  
&TXID=3334  
&ERRMSG=  
&CHANNEL=testchannel  
&TAG=wechatpayh5  
&REDIRECTURL=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Flanding.php  
&rs=xTc5RNlRea2e6xbxfqXaZZnFgtMouDlz  
&cs=2015d40b791d1204911f0bee494525b6acd6e9599d8a4b610f0bfe8e2cb4a0c3  
&REDIRECTSECRET=lhIj5Fzq1B3agj7a8HjeObuAzL0Twglc  
&SPECOUT.EXPIRYTIMESTAMP=1622543270  
&SPECOUT.PAYMENTPURPOSE=27I3WRH Some payment descriptor  
&SPECOUT.QRCODEURL=weixin=//wxpay/bizpayurl?pr=5T4chFBzz  
&SPECOUT.SETTLEMENTCURRENCY=EUR