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(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 |
Client email | N | ||
remarks | Transaction remark | N |
☑️ Data Example(JSON Data):
✅ 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):
☑️ 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):
Note:
The payinfo
in the response contains the payment link to OTT Pay’s Checkout Platform. Example:
Additionally, Merchant can add the selected parameter according to their own settings. Example:
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.
✅ Payment Return URL Link
After payment process finished, the result will be sent back by redirecting to the following payment result Web Page URL link.
☑️Return URL Link Format
☑️ 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.
*️ 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".
☑️ Return URL Link Example (URL encoded)
✅ 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):
☑️ 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