Payment Request
Request
API URL: /merchant/payment
Header | Content | Description |
---|---|---|
Content-Type | text/plain | |
Authorization | {token_type} {access_token} | Concat token_type and access_token with whitespace. |
Param | Type | Requied | Signature | Description |
---|---|---|---|---|
user_id | String | ✅ | ✅ | Merchant identification |
order_id | String | ✅ | ✅ | Payment order Id of merchant system. The order id should be unique. |
amount | String | ✅ | ✅ | Transaction amount (Support up to 6 decimal places) |
currency | String | ✅ | ✅ | Please refer to Currencies & Channels |
channel | String | ✅ | ✅ | Please refer to Currencies & Channels |
bank_code | String | Optional | ✅ | If this param is provided, you need to add it to the sign string. |
real_name | String | Optional | ❌ | Required for RMB transactions to comply with China government regulations. |
callback_url | URL | ✅ | ✅ | The url to receive callback request from PTS when transaction complete. |
redirect_url | URL | ✅ | ✅ | When the payment process finished, the client will be redirected to this URL. |
timestamp | Integer | ✅ | ✅ | Request timestamp (10 digits) |
remark | String | ❌ | ❌ | Remark |
sign | String | ✅ | ❌ | Signature string |
Response
There are three types of payment response methods.
tip
You should notify PTS customer service to configure this for you to match actual usage situation.
Redirect
Return a javascript code with redirect_url
, the user will be redirected to actual payment webpage automatically.
HTML
Return a html input form to user with automatically submit javascript. You should forward entire response content to user and make sure html and javascript workable.
JSON
Return request result in JSON format (when response code=1000
)
Param | Type | Required | Sign | Description |
---|---|---|---|---|
user_id | String | ✅ | ✅ | Merchant identification |
order_id | String | ✅ | ✅ | Payment order Id of merchant system. The order id should be unique. |
transaction_id | String | ✅ | ✅ | PTS transaction id |
channel | String | ✅ | ✅ | Please refer to Currencies & Channels |
submit_currency | String | ✅ | ✅ | Submit currency |
submit_amount | Float | ✅ | ✅ | Submit amount (Support up to 6 decimal places) |
accept_currency | String | ✅ | ✅ | The currency real paid |
accept_amount | Float | ✅ | ✅ | Paid amount of accept currency (Support up to 6 decimal places) |
exchange_rate | Float | ✅ | ✅ | Exchange rate |
pay_url | URL | ✅ | ✅ | The webpage which to pay the amount |
wallet_address | String | ❌ | ❌ | Crypto exclusive, if need, please inform customer service staff |
expired_at | Integer | ❌ | ❌ | Crypto exclusive, if need, please inform customer service staff |
sign | String | ✅ | ❌ | Signature string |
// Example
{
"code": "1000",
"message": "Accepted",
"data": {
"user_id": 1,
"order_id": "20210521184906",
"transaction_id": "P12021052118495503889",
"channel": "CNY2TRC",
"submit_currency": "CNY",
"submit_amount": 1000,
"accept_currency": "USDT-TRC",
"accept_amount": 165.9181999999,
"exchange_rate": 0.1659182,
"sign": "jgtOKfV48sOD2NjBZ4WhiAUMwTgux9fTH53jNzNR..."
}
}
Cashier
While payment request channel assigned to cashier
means channel and currency are not specified.
PTS will return cashier_url
and let user make decision on their own.
// Example: response of request with channel="cashier"
{
"cashier_url": "https://example.com/cashier?order_id=TP20210715135507&token=3281DCF1C8A6D7AFA0B96CFDD874F417"
}