Payment Request API

API Request Parameters(HTTP-Request-Body )

Params Name

Description

Required

Notes

action

Action name

Y

"PREPAY_INIT"

version

Version number

Y

"2.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):

{
  "data": "wcpIWJbpAsQmDO5+qdXyjiSqHLo/YXsPpgLDZvNKUCj55IVE81CZUgLRX7t0 JKn5QRh74Plh3x/AyBTsvnhlTr16or1/aTZEeZfhgQaqtiNY4zDU16PCBvZ+ zggxNlLW7h28uXdpFVF9BTqwv1CrWNfNwjov1ZRGBzTXW19grayi9PKzM5so H1RjZR2o/IsYtnYQQ8L+XR+Wlx1kbupDuy8Pvgk63MIhba3ujlkwHL37WRkA RJWQTITqaNHAu3bQn+YH6Nl3i9RFwPoNlGG15vDSOo0yWxSzkayG6o6LxU7Z Af4fUamERkQOK26PQURqSpI7qn9vOAXv2ahgsdD0dvA4MHFK3RyXyO+vGUqB LnuI/oOPAcACzP2gP0BB+HI+yFBGczAsRO0t2OTxrXVPl27tFTBXm4uYfsSx 6UQ1hOqgLy75repl8CML8OKrCODloBRIpEiMDxk8+xjPFvMqv364e3gQXM1Q 0wEgKa7nQofTW1uV6NJjykNjtluawNEbFgDRSza/NChSs5tDklcuBQ==",
  "action": "PREPAY_INIT",
  "merchant_id": "ON00004652",
  "version": "2.0",
  "md5": "0ECB498672C0EAF9805522AFEE5A91BA"
}

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

Params Name

Description

Required

Notes

merchant_id

Merchant ID

Y

shop_id

Shop ID

Y

operator_id

Operator ID

Y

prepay_order_id

Prepay Order ID

Y

sale_num

Sale number

Y

currency_type

Currency

Y

“CAD”/”USD”/”CNY” match with settings of merchant ID

biz_type

Business type

Y

“PREPAY”

redirect_url

Redirect URL

Y

call_back_url

Notify URL

Y

duration

Payment duration

Y

Duration of payment, unit in seconds. Please note, expire time will be calculated by the duration and the time the prepay order is created. The expire time will return in response

email

Client email

N

remarks

Transaction remark

N

☑️ Data Example(JSON Data):

{
  "amount": "5",
  "sale_num": "20220727132626764",
  "operator_id": "0000000696",
  "prepay_order_id": "prepay20220727132626764",
  "biz_type": "PREPAY",
  "merchant_id": "ON00004652",
  "duration": "100",
  "shop_id": "ON00004652001",
  "currency_type": "CAD",
  "email": "inforsa@ott.ca",
  "remarks": "BLA",
  "redirect_url": "http://uatqrpay.ottpay.com/redirectBus",
  "call_back_url": "http://uatqrpay.ottpay.com/back_response"
}

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": "prepay order created",
  "data": "ks1ROTEQ7mkc5L+RPzyv8MVK1ID+s5tXvEh6DHcYD4oryyTd7mDkzNu/cRiR gP/vJoD9eBpa/S6BSTXlUYTEkxV+PULg8e/LRabkkRnm0WIgt9o/N/Gma00N MJGbEI6K7O9wc3c6eqej6zFx2xzFcNX9vCgsoK69lhchrrqCD7vx7GHa7dd6 BGln8QzTBYCxv3JpliV4FFUJJ/hr91aoEj7BilclDwUck+CgKOV9AfU=",
  "md5": "0217F21DB5833A501410501464B05283"
}

☑️ Transaction Data(JSON format, After decrypted)

Params Name

Description

Required

Notes

preypay_order_id

Order ID

Y

payinfo

Payment link

Y

the redirect link to OTT Pay platform

expire_time

Expire time

Y

Expire time of payment

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

{
  "payInfo": "https://uatqrpay.ottpay.com/payment-platform?prepayid=prepay20220727132626764",
  "prepay_order_id": "prepay20220727132626764",
  "expire_time": "2022-07-27 13:28:11"
}

Note:

The payinfo in the response contains the payment link to OTT Pay’s Checkout Platform. Example:

https://qrpay.ottpay.com/payment-platform?prepayid=prepay20220727132626764

Additionally, Merchant can add the selected parameter according to their own settings. Example:

https://qrpay.ottpay.com/payment-platform?prepayid=prepay20220727132626764&selected=NONE

merchant use payinfo to redirect the browser to OTT Pay’s Checkout Platform where the client can finish the payment.

selected can be chosen from the following parameters: NONE, WECHATPAY, ALIPAY, UNIONPAY, GP

This parameter is used to select the payment method that can be activated directly.

For example, if selected=WECHATPAY, the payment method will be activated directly from WeChat wallet. selected=NONE, there is no priority payment method, the user selects the payment method from the payment list.

After payment process finished, the result will be sent back by redirecting to the following payment result Web Page URL link.

http://returnURL/xxx?total_fee=XXXX&trade_no=XXXX&out_trade_no=XXXX&trade_status=XXXX

☑️ Return URL Parameters (need be decoded with Base64)

*️ Prefixed URL

Prefixed URL is a customized page for order processing, /xxx is an additional page for the merchant according to their own business. e.g.

https://ezshops.ott.ca/mobile/callback.php

*️ total_fee

total_fee is the request amount of the order from the merchant. Number, 100 for 1.00 dollar.

*️ trade_no

trade_no is the internal order number.

*️ out_trade_no

out_trade_no is the order number.

*️ trade_status

trade_status shows the result of the payment. Payment succeed returns " Trade_Finished".

https://ezshops.ott.ca/mobile/callback.php?currency=CAD&out_trade_no=AL2192407938683822&total_fee=0.01&trade_no=2020061022001367651432273894&trade_status=TRADE_FINISHED&sign=aTTXuUU8DD4J11vwsu%2Bx%2FonuesJ%2Ba73bIXrDTgbOze1Df35H6x8cSt9Rk9b9hqQksF8QobWU7Zt0%2F0LbPYFSR9kI%2B5rVYQKSP%2Fgad97A89ySV7wi05jLmiRLVHySG131zTwren9XoS81Do13hFUkoTZfEQc745bTxvgDKIMrSRs%3D&sign_type=RSA
resposdwx:Array
(
    [currency] => CAD
    [out_trade_no] => AL2192407938683822
    [total_fee] => 0.01
    [trade_no] => 2020061022001367651432273894
    [trade_status] => TRADE_FINISHED
    [sign] => aTTXuUU8DD4J11vwsu+x/onuesJ+a73bIXrDTgbOze1Df35H6x8cSt9Rk9b9hqQksF8QobWU7Zt0/0LbPYFSR9kI+5rVYQKSP/gad97A89ySV7wi05jLmiRLVHySG131zTwren9XoS81Do13hFUkoTZfEQc745bTxvgDKIMrSRs=
    [sign_type] => RSA
)

API Call Back (HTTP-POST)

After the user completes the payment,, OTTPAY 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

tip

tip

N

bizpay_order_id

order id from Acquirer

Y

remarks

remarks

N

sale_num

merchant sale number

N

convenience_fee

Convenience fee

N

Last updated