AuthorizedPayment
DeBox provides a payment authorization API based on vBOX to provide a broader application scenario for vBOX.
GEThttps://app.debox.pro/oauth/authorize
The onetime token API is used to generate the order number and token of integral payment, and is combined with the following /payment/transfer API to complete the integral payment function.
Request Example:
https://app.debox.pro/oauth/authorize?
app_id=ohpdAP9W55gyXeJ0&scope=payment&grant_type=onetime_token&amount=0.01&
payer_user_id=ii0k2v5n&receiver_user_id=rqg6g4j1&pay_type=send&pay_info=test&
redirect_uri=https://docs.debox.pro/demo/a.html
Request Example:
https://app.debox.pro/oauth/authorize?
app_id=ohpdAP9W55gyXeJ0&scope=payment&grant_type=onetime_token&amount=0.01&
payer_user_id=ii0k2v5n&receiver_user_id=rqg6g4j1&pay_type=send&pay_info=test&
redirect_uri=https://docs.debox.pro/demo/a.html
Parameters
Query
redirect_uri
: String
Authorization succeeded callback address, need encodeURIComponent,go to config App Domain first
app_id
: String
Application unique identification, DeBox developer community application
scope
: String
Scope of authority(payment)
grant_type
: String
Type of authority(onetime_token)
amount
: Number
Amount, two decimal places at most
payer_user_id
: String
The payer. this param is the user_id of authority
receiver_user_id
: String
The receiver. this param is user_id of developer
pay_type
: String
Must be "send" ,means authority is payer
pay_info
: String
Pay information
Responses
200: OK
{
"code": "xxx", //Authorize token, Valid for 5 minutes
"serial_id": "xxx", // Serial number
"source ": "debox" // From where
}
POSThttps://open.debox.pro/openapi/payment/transfer
The API to transfer fund.
Parameters
Query
app_id
: App ID, apply on platform https://developer.debox.pro/
app_secret
: App Secret, apply on platform https://developer.debox.pro/
Body
access_token
:String
The code from /onetime_token
serial_id
:String
Serial number
verify_amount
:String
When the developer is the payer, verify_amount is required and used to check whether the amount of the developer's payment is correct.If verify_amount is not equal to amount, the transfer will fail
Responses
200: OK
{
"code": "", // error code, 1 means success
"msg": "",
"source ": "debox" // from where
}