预授权下单
预授权:商户在用户支付前,先向用户的支付账户发起预授权请求,用户的支付账户会冻结相应的金额,待商户再调用扣款接口,将冻结的金额转为实际的交易金额。
请求参数
POST
名称 | 类型 | 长度 | 必填 | 签名 | 描述 |
---|---|---|---|---|---|
subProductType | String | 16 | Yes | Yes | 预授权 subProductType 使用 DIRECT |
txnType | String | 16 | Yes | Yes | 交易类型 txnType 使用 AUTH |
预授权下单请求参数请参考下单请求中的信用卡支付,需要将 txnType
由 SALE
改为 AUTH
, subProductType
保持 DIRECT
不变。
json
{
// 绑卡支付参数更新,其他参数请参考下单请求中的信用卡支付
"subProductType": "DIRECT",
// ...
"txnType": "AUTH"
}
1
2
3
4
5
6
2
3
4
5
6
预授权请求及响应示例
POST
json
{
"billingInformation": "{\"country\":\"US\",\"email\":\"abel.wang@onerway.com\",\"firstName\":\"CL\",\"lastName\":\"BRW2\",\"phone\":\"17700492982\",\"address\":\"Apt. 870\",\"city\":\"Hayward\",\"postalCode\":\"66977\",\"identityNumber\":\"717.628.937-97\"}",
"merchantCustId": "1721885417000",
"merchantNo": "800209",
"merchantTxnId": "1721885417000",
"orderAmount": "200",
"orderCurrency": "USD",
"productType": "CARD",
"shippingInformation": "{\"country\":\"US\",\"email\":\"abel.wang@onerway.com\",\"firstName\":\"CL\",\"lastName\":\"BRW2\",\"phone\":\"17700492982\",\"address\":\"Apt. 870\",\"city\":\"Hayward\",\"postalCode\":\"66977\",\"identityNumber\":\"717.628.937-97\"}",
"sign": "df7b91265b36035a1700413a04397b338cec8f84bef8b6d640b4fa1d6f9a2dfb",
"subProductType": "DIRECT",
"txnOrderMsg": "{\"returnUrl\":\"https://www.merchant-store-website.com/\",\"appId\":\"1739545982264549376\",\"notifyUrl\":\"https://www.merchant-store-notify.com/\",\"products\":\"[{\\\"name\\\":\\\"Pro1\\\",\\\"price\\\":\\\"50.00\\\",\\\"num\\\":\\\"2\\\",\\\"currency\\\":\\\"USD\\\"},{\\\"name\\\":\\\"Pro2\\\",\\\"price\\\":\\\"100\\\",\\\"num\\\":\\\"1\\\",\\\"currency\\\":\\\"USD\\\"},{\\\"name\\\":\\\"shipping fee\\\",\\\"price\\\":\\\"10\\\",\\\"num\\\":\\\"1\\\",\\\"currency\\\":\\\"USD\\\",\\\"type\\\":\\\"shipping_fee\\\"},{\\\"name\\\":\\\"discount\\\",\\\"price\\\":\\\"-10\\\",\\\"num\\\":\\\"1\\\",\\\"currency\\\":\\\"USD\\\",\\\"type\\\":\\\"discount\\\"}]\",\"transactionIp\":\"127.0.0.1\"}",
"txnType": "AUTH"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
json
{
"respCode": "20000",
"respMsg": "Success",
"data": {
"transactionId": "1816345212864577536",
"responseTime": "2024-07-25 13:30:19",
"txnTime": null,
"txnTimeZone": "+08:00",
"orderAmount": "200.00",
"orderCurrency": "USD",
"txnAmount": null,
"txnCurrency": null,
"status": "U",
"redirectUrl": null,
"contractId": null,
"tokenId": null,
"eci": null,
"periodValue": null,
"codeForm": null,
"presentContext": null,
"actionType": null,
"sign": "7b0f9b099e000b82e72fc98aa3f84c27aef41593cc1ff49053918a708296b1f5"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
预授权扣款
注意
- 预授权支付涉及两个接口,预授权下单和预授权扣款
- 商户预授权下单成功后需保存响应里的
transactionId
,在预授权扣款时使用 - 预授权扣款详情请查看预授权扣款接口