Payment Request with WeChat Pay

For WeChat Pay on PC-Browser

API Request Parameters(HTTP-Request-Body )

Params Name

Description

Required

Notes

action

Action name (Constant Value)

Y

"ACTIVEPAY"

version

Version number

Y

"1.0"

merchant_id

Merchant ID

Y

Provided by OTT Pay

data

Encrypted Transaction Data

Y

See "Data" table below

md5

Message Digest

Y

☑️ Request Example(JSON Data):

{
    "action":"ACTIVEPAY",
    "version":"1.0",
    "merchant_id":"QC00005496",
    "data": "zTadPG0YM4gD1WOFqxg7wn3vmU20NjCnCUOOnE9mTTkxYraQDflljA8W3azYG9MuOvOyl3cZhafH+io6PiWdZCwRmi3HGa19BvT215IIxRy2HvYe0Sqs2lxshm9E4y5F1gJ7HHMTqpY0wIA4DsuWA97UC55adB2G86VbanI7B5a3kErApr5mbAoE7wcNbDJfGh4CBbSoRxQyiGZ48SvYuIW/sclT4yu6okjo6CY3xL4=",
    "md5":"6AFB2E94A70D9A208F101723700EB287"
}

☑️ Data(JSON Data, to be encrypted):

Params Name

Description

Required

Notes

order_id

Order ID

N

OrderID could be generated by client's code, or generated by OTTPay as default

operator_id

Operator ID

Y

Operator ID provided by OTTPay

amount

Transaction Amount

Y

String, "100" for 1.00 dollar.

Tip

Tip

N

String, "100" for 1.00 dollar.

biz_type

Message Digest

Y

"WECHATPAY"

call_back_url

Call back URL

Y

☑️ Data Example(JSON Data):

{
  "amount":"1",
  "biz_type":"WECHATAY",
  "operator_id":"0000020156",
  "order_id":"2020041468976O124O000857",
  "call_back_url":"https://ezshops.ott.ca/WechatQrOTTPAY_callback.php"
}

API Response Parameters(HTTP-Response-Body)

Params Name

Description

Required

Notes

rsp_code

Response code

Y

refer to Appendix B

rsp_msg

Response message

Y

data

Encrypted Data

Y

See "Data" table below

md5

Message Digest

Y

☑️ Response Example(JSON Data):

{
"rsp_code":"SUCCESS",
"rsp_msg":"success",
"data":"41kiLvjVBO8AW4wTOthI92OQu+8fwac5cIDx0DoZpitLvSJU8WKQbk5Bii5ZYrgLz4hepQ865QZFWqj2PRZ1FjxxipxEy2KoOKchWK09e42Se3CMAxt/+8UGrnAHDJLbU/BBlZLJoLpruSNKBeVfwhI7TtGdP4ciwzKPmv5aS2DWoU4Jl26IAPa8PeGhPNLuT99HwBGXa7aUz5adYk3uAR5Ww9HkBlPrqzJlUQ4zdMgjxaM2bROldcKTK8NxPM7X",
"md5":"32310A0DD3D021A7D0CDF6A5909A1A61"
}

☑️ Transaction Data(JSON format, After decrypted)

Params Name

Description

Required

Notes

bizpay_order_id

order id from Acquirer

Y

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

QR code URL

Y

For generating payment QR Code

order_id

Order ID

Y

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

{
 "bizpay_order_id":"WX8436538037893612",
 "code_url":"weixin://wxpay/bizpayurl?pr=8QQeScQhz",
 "order_id":"2020041468976O124O000857"
}

API Call Back (HTTP-POST)

Once API server finished the request process, it will send back process status to specified URL which been set up as field of 'call_back_url' within above API request parameters.

☑️Message Payload Parameters Level (HTTP-Response-Body)

Params Name

Description

Required

Notes

rsp_code

Response code

Y

refer to Appendix B

rsp_msg

Response message

Y

merchant_id

Merchant ID

Y

data

Encrypted Transaction Data

Y

See "Data" table below

md5

Message Digest

Y

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

 {
  "data":"hy0yiXxPH4TDXeY5ET7gqIsUcgY5ykO1vQYOahS5SsbN7/5Ha7+hvcXhgY1hz9kHuf5OxqNfv28kVeiYACrLzngk+hA2o8dVAcifT6h3AquN5micrIi3L9owj6cHT1nJRExC74sNUqF8CDY5fb4jLh9it9tq7r8xFOpcpf19VNWceo/Jt1nHca6HPMvMUEDeX1aUjnxOs7R7B2TUQbAENg\u003d\u003d",
  "rsp_code":"SUCCESS",
  "rsp_msg":"success",
  "merchant_id":"QC00005496",
  "md5":"F70CA0472D1AAA596E720C19A1DD36A0"
 }

☑️ 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

merchant_id

Merchant ID

Y

Provided by OTT Pay

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

{
 "amount":"1",
 "bizpay_order_id":"WX781266859681754",
 "tip":"0",
 "merchant_id":"QC00005496",
 "order_id":"2020041553699O153O0407",
 "finish_time":"20200416050429"
}

Last updated