跳到主要内容

支付宝预授权扣款

资金授权冻结

支付宝预授权目前仅支持资金授权,暂不支持信用授权;订单默认15分钟失效; 如遇币种校验问题请咨询技术人员或发邮件到technical.support@qfpay.com获取支持;当资金授权发生之后一段时间内,由于买家或者商家等其他原因需要要解冻资金,商家可通过【订单退款】将授权资金进行解冻,收到解冻请求并验证成功后,冻结资金按原路进行解冻. 此外, 商家可以发起本分或全部冻结资金的转账, 以便收取未结客户发票的资金.

备注

目前支付宝预授权扣款支持币种:HKD,USD,AUD,NZD,THB,PHP,MYR

Alipay Pre-Auth process-flow

HTTP请求

POST ../trade/v1/payment

从如下表格中根据您的结算场景选择 pay_type.

支付类型描述
801801Alipay Pre-Authorization in-store QRC Payment - Consumer Present Mode (CPM)
801808Alipay Pre-Authorization in-store QRC Payment - Merchant Present Mode (MPM)
801810Alipay Pre-Authorization in-APP Payment
801814Alipay Pre-Authorization Online Payment

请求参数


Request Body:

{
goods_name=goodcode1&mchid=R1zQrTdJnn&out_trade_no=alipay201909261129164551bcdd40&pay_type=801802&txamt=1&txcurrcd=USD&txdtm=2019-09-26 11:29:16&txzone=+0800
}

The above command returns JSON structured like this:

{
"pay_type": "801802",
"sysdtm": "2019-09-26 11:29:18",
"paydtm": "2019-09-26 11:29:19",
"txdtm": "2019-09-26 11:29:16",
"udid": "qiantai2",
"txcurrcd": "USD",
"txamt": "1",
"resperr": "Network busy, don't worry, we are fixing it (1297)",
"respmsg": "预授权发码参数异常或参数缺失",
"out_trade_no": "alipay201909261129164551bcdd40",
"syssn": "20190926000200020016004244",
"respcd": "1297",
"chnlsn": "",
"cardcd": ""
}
Parameter nameAttributeMandatoryTypeDescription
Public payment parameter
Alipay openidopenidNoString(64)Corresponding to the APP authorization method.
Alipay payment codeauth_codeNoString(128)Specifies the authorization code for scanning a barcode/QR Code. The auth_code returned is unique in each authorization. Each auth_code can only be used once and will automatically expire. For testing CPM with Alipay and WeChat Pay the auth_code can be extracted by any QRC reader or manually found in the consumer wallet below the barcode.

响应参数

AttributeSecond parameter codeTypeParameter nameDescription
Public response parameters

资金授权撤销

Only calls alipay.fund.auth.operation.cancel when the merchant’s system encounters timeout and has to stop the subsequent processes, or when the pre-auth result is unknown. If you want to perform a similar task for normal pre-auth (freezing) transactions, please call alipay.fund.auth.order.unfreeze. After submitting the fund authorization call Order Inquiry, and there is no clear authorization result and then call Fund Authorization Cancellation.

HTTP请求

POST ../trade/v1/reversal

请求参数

Parameter nameAttributeMandatoryTypeDescription
Merchant IDmchidYesStringThe unique merchant ID is created by QFPay during the merchant onboarding process.
QFPay transaction numbersyssnNoStringMultiple entries are separated by English commas
External transaction numberout_trade_noNoStringe.g. Developer platform order number
Transaction amounttxamtNoIntWhether to pass this parameter depends on the payment channel, Alipay and WeChat Pay do not need to submit this information
Transaction request timetxdtmYesStringFormat: YYYY-MM-dd hh:mm:ss
Unique device idudidNoString
Time zonetxzoneNoStringUsed to record the local order time. The default is Beijing time GMT+8 (+0800)

响应参数

AttributeTypeParameter nameDescription
syssnString(40)QFPay transaction number
orig_syssnString(40)External transaction numberDeveloper platform transaction number
txdtmString(20)Time of the transaction requestFormat: YYYY-MM-dd hh:mm:ss
txamtInt(11)Order payment amount
sysdtmString(20)System trading timeFormat: YYYY-MM-dd hh:mm:ss
This parameter value is used as the cut-off time for settlements.
respcdString(4)Return code
respmsgString(128)Information description
resperrString(128)Description error
cardcdStringCard number
txcurrcdString(3)CurrencyTransaction currency. View the Currencies table for a complete list of available currencies

Request Body:

{
mchid=R1zQrTd***&syssn=20190722000300020081074842
}

The above command returns JSON structured like this:

{
"respmsg": "",
"resperr": "请求成功",
"respcd": "0000",
"syssn": "20190722000302320081074842",
"sysdtm": "2019-07-22 15:20:54",
"txamt": "10",
"txdtm": "2019-07-22 15:20:54",
"cardcd": "",
"txcurrcd": "HKD",
"orig_syssn": "20190722000300020081074842",
"respmsg": ""
}

授权冻结转扣款

HTTP请求

POST ../trade/v1/authtrade

请求参数

Parameter nameAttributeMandatoryTypeDescription
Merchant IDmchidNoStringThe unique merchant ID is created by QFPay during the merchant onboarding process.
QFPay transaction numbersyssnYesStringFund authorization number
External transaction numberout_trade_noYesStringDeveloper platform transaction number
Transaction amounttxamtYesintThe actual amount of consumption, the maximum deduction amount cannot exceed the fozen funds
Transaction request timetxdtmYesStringFormat: YYYY-MM-DD hh:mm:ss
Device IDudidNoStringMust be unique
Time zonetxzoneNoStringUsed to record the local order time. The default is Beijing time GMT+8 (+0800)
Redirect URLreturn_urlNoStringRedirect to address after successful payment. Mandatory parameter to submit for GrabPay Online. Alipay WAP restricts the return_url to maximum 200 characters.

Response Parameters

AttributeTypeParameter nameDescription
syssnString(40)QFPay Transaction numberThis number is being used when freezing funds, detucting money from the frozen amount as well as unfreezing funds.
orig_syssnString(40)External transaction numberDeveloper platform transaction number
txdtmString(20)Transaction request timeFormat: YYYY-MM-DD hh:mm:ss
txamtInt(11)Transaction amount
sysdtmString(20)System transaction timeFormat: YYYY-MM-DD hh:mm:ss
respcdString(4)Return code
respmsgString(128)Information description
resperrString(128)Description error
cardcdStringCard number
txcurrcdStringCurrencyTransaction currency. View the Currencies table for a complete list of available currencies

Request Body:

{
mchid=R1zQrTd***&syssn=20190722000300020081074842&out_trade_no=alipay201909271528139576015cbf&txamt=1&txdtm=2019-09-27 15:28:13&txzone=+0800
}

The above command returns JSON structured like this:

{
"respmsg": "",
"resperr": "请求成功",
"respcd": "0000",
"syssn": "20190722000302320081074842",
"sysdtm": "2019-07-22 15:20:54",
"txamt": "10",
"txdtm": "2019-07-22 15:20:54",
"cardcd": "",
"txcurrcd": "HKD",
"orig_syssn": 20190722000300020081074842
}