Payment Request API

Payment Request API

☑️ Request Message Parameters(JSON Format)

Params Name

Description

Required

Notes

userId

APP ID registered in WeChat https://open.weixin.qq.com

Y

e.g. wxcbb0a73d2d5a8888

amount

Transaction amount in cent

Y

String, "100" for 1.00 dollar

bizType

Business type

Y

WECHATPAY

merchant_id

Merchant ID in OTT PAY

Y

Provided by OTTPay

operator_id

Operator ID from OTT PAY

Y

Provided by OTTPay

order_id

you own order id

N

string, your own order id

call_back_url

Call back URL

Y

Call back data from OTT Pay, shown in the payment completion page

☑️ Request Data Example

{
 "userId": "wxcbb0a73d2d5a8888”, 
 "amount": "100", 
 "bizType": "WECHATPAY", 
 "merchant_id": "AB00000004", 
 "shopId": "", 
 "operator_id": "0000000005", 
 "tip": ""
}

Response Message Parameter

The response message contains all the required parameters to activate the client’s WeChat Wallet.

Params Name

Description

Required

Notes

appId

APP ID registered https://open.weixin.qq.com

required by WeChat Pay

Y

wxcbb0a73d2d5a8888

bizType

Business type

Y

WECHATPAY

nonceStr

Random string

required by WeChat Pay

Y

Random string

package_

String, required by WeChat Pay, must be “Sign=WXPay”

Y

Sign=WXPay

partnerId

PartnerId required by WeChat Pay

Y

XXXXXXXXXXX

paySign

Sign Key in OTT Pay request

N

DBC7B6ED46BE81E927CAA1922A83BE91

prepayId

prepayId obtained from WeChat Pay associated with the current transaction, required by WeChat Pay

Y

wx22014816274706c6ad56f2412344704275

reAmount

Available refund amount for this transaction

N

String, "100" for 1.00 dollar

timeStamp

Time Stamp required by WeChat Pay

Y

2018112112

tradeNo

Transaction Id for OTT Pay

N

1542822494862703

wxapikey

API key, required by WeChat Pay

Y

XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

☑️ Response Message Data Example:

通过WeChat SDK jar包调起WeChat Wallet支付, 需要用 appId, partnerId, prepayId, packageValue, timestamp, nonceStr, timestamp and Sign参数。其中Sign需要用WeChat Pay的sign creation logic 产生,示例如下:

To activate WeChat Wallet through WeChat SDK jar package needs following parameters: appId, partnerId, prepayId, packageValue, timestamp, nonceStr, timestamp and Sign. The Sign needs the WeChat Pay’s sign creation logic to generate, for example:

Please note: IWXAP, PayReq are java class defined by WeChat SDK.

☑️ Call-Back Message Data

Params Name

Description

Required

Notes

rsp_code

Response code

Y

Refer to Appendix B

rsp_msg

Response message

Y

merchant_id

Merchant ID

Y

Merchant ID

finish_time

Payment time

Y

YYYYMMDDHHMMSS (Beijing time)

order_id

Order ID

Y

amount

Transaction amount

Y

String, "100" for 1.00 dollar

md5

Message Digest

Y

☑️ Call-Back Message Example(JSON Data):

☑️ Transaction Data (JSON format, after decrypted)

Params Name

Description

Required

Notes

finish_time

Payment time

Y

YYYYMMDDHHMMSS (Beijing time)

order_id

Order ID

Y

amount

Transaction amount

Y

String, "100" for 1.00 dollar

tip

Tip Amount

N

String, "100" for 1.00 dollar

bizpay_order_id

order id from Acquirer

Y

Returned by the Payment Service Provider (e.g. WeChat Pay, Alipay)

merchant_id

Merchant ID

Y

Provided by OTT Pay

☑️ Data Example(JSON Data, after decrypted):

👉 Call back data中的 data是加密过的数据,参考appendix A进行解密处理。

Data in Call back data in encrypted, refer to appendix A for decryption.

👉 Please reference our Android demo code for details.

WebChat Pay for Mobile App Demo Codes

Last updated

Was this helpful?