WeChat in-APP Payments
HTTP Request
Endpoint : /trade/v1/payment
Method : POST
PayType : 800210
WeChat in-APP payments require a formal application on the WeChat Open Platform. Merchants have to register an account and the APP and then receive an appid
to enable payments. For more information, please refer to the official Wechat documentation.
Optionally merchants can activate real-name authentication with WeChat. Currently real-name identification is only available for Mainland Chinese citizens and include a person's real name and national ID card number. In case identification is provided the payer's wallet information like a connected bank card must be identical with the data provided by merchants. If customers did not yet bind their WeChat account to a bank card the payment will go through regardless.
To download Wechat SDK please refer to this link.
Request Parameters
Request Body:
{
goods_info=test_app&goods_name=qfpay&out_trade_no=O5DNgEgL1XpvbvQSfPhN&pay_type=800210&txamt=10&txcurrcd=HKD&txdtm=2019-09-13 04:53:03&udid=AA
}
The above command returns JSON structured like this:
{
"sysdtm": "2019-09-13 12:53:04",
"paydtm": "2019-09-13 12:53:04",
"txcurrcd": "HKD",
"respmsg": "",
"pay_params":
{
"package": "Sign=WXPay",
"timestamp": 1568350384,
"sign": "XwFjohEKWdkhhT4ueg7BxeDn8tT9LcqoZYdXzifTMYyDGe3/tRchpii6vWgOn21tPSaAtqo766gvifXgDEOwR+ILKN8t97r624IJlrH0EkvSUSLh9E/cga9scXGVy0jPWHM/oVvVzJIvXew79CwZFCNTSJok2KmpSm9X9oPg7PGXbqvNMHltf+YlIOsuiz391qVmFtTE5A/cpA50+06T7iW8GYsOJQTTJed75VY+aSzNo5C6ju6WSgJKpAJJ0ocl+ONtmOp6GLVBSQXaMC4PitQcebcoP2J6fFgQ+YcPwHXasCYEnn4LaFN7zT/AjGg3E3gdCx3ksGNBOazYBRVz+g==",
"partnerid": "316525492",
"appid": "wx3c6896fa9b351f2a",
"prepayid": "wx131253044253463a81dc336e1254149882",
"noncestr": "7786db42d9a245c2b1cfc717ac59376e"
},
"pay_type": "800210",
"cardcd": "",
"udid": "AA",
"txdtm": "2019-09-13 04:53:03",
"txamt": "10",
"resperr": "交易成功",
"out_trade_no": "O5DNgEgL1XpvbvQSfPhN",
"syssn": "20190913152100020001567741",
"respcd": "0000",
"chnlsn": ""
}
Attribute | Mandatory | Type | Description |
---|---|---|---|
mchid | No | String | The unique merchant ID is created by QFPay during the merchant onboarding process. |
out_trade_no | Yes | String | External transaction number |
txamt | Yes | String | The actual amount of consumption, the maximum deduction amount cannot exceed the fozen funds. Suggest value > 200 to avoid risk control |
txcurrcd | Yes | String(3) | Transaction currency. View the Currencies table for a complete list of available currencies |
rmb_tag | No | String(1) | WeChat Pay in Hong Kong uses rmb_tag = Y together with txcurrcd = CNY to indicate that the transaction currency is RMB. |
txdtm | Yes | String | Format: YYYY-MM-DD hh:mm:ss |
udid | No | String | Device ID, must be unique |
txzone | No | String | Time zone, used to record the local order time. The default is Beijing time GMT+8 (+0800) |
return_url | No | String | Redirect URL, redirect to address after successful payment. Mandatory parameter to submit for GrabPay Online. Alipay WAP restricts the return_url to maximum 200 characters. |
extend_info | No | Object | Extended Customer Info, real name customer identification. This parameter is currently only available for Mainland Chinese citizens and needs to be explicitly activated with WeChat for the selected PayType. The consumer's national ID card number is contained in the parameter user_creid and the payer's real name in encoded form or written in Chinese characters must be provided in user_truename . An example looks like this; extend_info = '{"user_creid":"430067798868676871","user_truename":"\\u5c0f\\u6797"}' |
Response Parameters
Attribute | Type | Description |
---|---|---|
syssn | String(40) | QFPay transaction number, returned by the system once payment is completed |
orig_syssn | String(40) | External transaction number |
txdtm | String(20) | Transaction request time, format: YYYY-MM-DD hh:mm:ss |
txamt | Int(11) | Transaction amount |
sysdtm | String(20) | System transaction time, format: YYYY-MM-DD hh:mm:ss This parameter value is used as the cut-off time for settlements. |
respcd | String(4) | Return code |
respmsg | String(128) | Information description |
resperr | String(128) | Description error |
cardcd | String | Card number |
txcurrcd | String | Transaction currency. View the Currencies table for a complete list of available currencies |
pay_params | Object | Payment data to call Wechat SDK |