2.7在线支付状态查询

优质
小牛编辑
131浏览
2023-12-01

说明

用于协议2.6付款码支付、协议2.4二维码支付时后续查询支付状态,支持微信支付、支付宝两个通道

请求地址

http://api.dc78.cn/Api/cash_pay_query

请求方式

GET

请求参数

参数参数名称
payid
平台支付流水号
bzid
门店账单号
token用2.9生成的协议用token查询

以上参数三选一

URL样例:

http://api.dc78.cn/Api/cash_pay_query?msid=226&nonce=1903329981&payid=72408&signtype=sha1×tamp=20160725215317&msg_sign=002C9F840ACCF9842E1DED5EF40C48338B0A8DEE

返回

此协议的返回有两种情况:一是成功完成交易。二是需要用户输入密码或是发生错误,请根据state的内容分别进行后续处理。

1.用会员卡支付成功返回:

{

"status":"1",
"payid":"32853827",
"src":"wx",
"type":"wx",
"cate":"qpay",
"doid":"",
"bzid":"1234",
"amt":"0.01",
"discount":"0.00",
"payamt":0.01,
"pay_amount":"0.00",
"buyer_id":"",
"pay_co":0,
"pay_mc":0.01,
"pay_pt":0,
"pay_wx":"0.00",
"pay_ali":0,
"time":"2018-01-1214:45:41",
"trid":"",
"server_timestamp":1515739556,
"server_time":"2018-01-1214:45:56",
"server_name":"wx9",
"msid":"10021"

}

2.用微信、支付宝支付成功返回:

{
"status":"1",
"result":{
"return_code":"01",
"return_msg":"支付成功",
"result_code":"01",
"pay_type":"010",
"trade_state":"SUCCESS",
"merchant_name":"苏州果盘网络技术有限公司雪碧测试",
"merchant_no":"830500277000003",
"terminal_id":"10207650",
"terminal_trace":"32855290",
"terminal_time":"20180112151635",
"pay_trace":"32855290",
"pay_time":"20180112151607",
"total_fee":"1",
"end_time":"20180112151616",
"out_trade_no":"102076507721318011215161101379",
"channel_trade_no":"4200000086201801122813790345",
"channel_order_no":"T2018011215161101000000002476023",
"user_id":"o9gBSxJJlVsT6GZvwPVayMh49OfE",
"attach":"32855290",
"receipt_fee":"",
"key_sign":"9fba475e63ba9809bedd951210313e17",
"typeMsg":""
},
"pay_amount":"0.01",
"buyer_id":"",
"trid":"4200000086201801122813790345",
"type":"wx",
"payid":"32855290",
"src":"wx",
"cate":"qpay",
"doid":"",
"bzid":"1234",
"amt":"0.01",
"discount":"0.00",
"payamt":0.01,
"pay_co":0,
"pay_mc":0,
"pay_pt":0,
"pay_wx":"0.01",
"pay_ali":0,
"time":"2018-01-1215:16:07",
"server_timestamp":1515741395,
"server_time":"2018-01-1215:16:35",
"server_name":"wx10",
"msid":"10021"
}
参数参数名称描述
type
支付通道
wx或ali
trid
微信支付/支付宝交易流水号

payid
平台交易流水号

cate支付方式“cate":"qpay” gpay表示二维码支付
result里面返回的信息是扫呗返回的信息

支付等待返回:

{
"status": "0",
"type": "wx",
"payid": "72408",
"trid": "",
"state": "WAIT",
"info": "等待用户输入密码",
"server_time": "2015-12-06 20:46:20"
}

支付失败返回:

{
"status": "0",
"type": "wx",
"payid": "72408",
"trid": "",
"state": "ERROR",
"info": "用户取消支付",
"server_time": "2015-12-06 20:46:20"
}

参数参数名称描述
payid
平台支付流水号

state
支付状态
有可能为WAIT,RETRY,ERROR

请判断state内容,如果为WAIT表示用户正在输入密码。

如果state为RETRY为服务器未能返回结果,也请继续查询支付状态。建议5秒一次重试,直到返回成功或失败,或是30秒超时后结束。

请求方式

INI

请求参数

[action]描述

action=cash_pay_query
[get]
描述

payid:平台支付流水号

返回

支付成功返回:

1.用会员卡支付成功返回:

[result]

status=1
payid=32853827
src=wx
type=wx
cate=qpay
doid=
bzid=1234
amt=0.01
discount=0.00
payamt=0.01
pay_amount=0.00
buyer_id=
pay_co= 0
pay_mc=0.01
pay_pt=0
pay_wx=0.00
pay_ali=0
time=2018-01-1214:45:41
trid=
server_timestamp=1515739556
server_time=2018-01-1214:45:56
server_name=wx9
msid=10021

2.用微信、支付宝支付成功返回:

[result]

statu=1
result{
return_code=01
return_msg=支付成功
result_code=01
pay_type=010
trade_state=SUCCESS
merchant_name=苏州果盘网络技术有限公司雪碧测试
merchant_no=830500277000003
terminal_id=10207650
terminal_trace=32855290
terminal_time=20180112151635
pay_trace=32855290
pay_time=20180112151607
total_fee=1
end_time=20180112151616
out_trade_no=102076507721318011215161101379
channel_trade_no=4200000086201801122813790345
channel_order_no=T2018011215161101000000002476023
user_id=o9gBSxJJlVsT6GZvwPVayMh49OfE
attach=32855290
receipt_fee=
key_sign=9fba475e63ba9809bedd951210313e17
typeMsg=
}
pay_amount=0.01
buyer_id=
trid=4200000086201801122813790345
type=wx
payid=32855290
src=wx
cate=qpay
doid=
bzid=1234
am=0.01
discoun=0.00
payamt=0.01
pay_co=0
pay_mc=0
pay_pt=0
pay_wx=0.01
pay_ali=0
time=2018-01-1215:16:07
server_timestamp=1515741395
server_time=2018-01-1215:16:35
server_name=wx10
msid=10021

支付等待返回:

[result]
status=0
type=wx
payid=72408
trid=""
state=WAIT
info=等待用户输入密码
server_time=2015-12-06 20:46:20

支付失败返回:

[result]
status=0
type=wx
payid=72408
trid=""
state=ERROR
info=用户取消支付
server_time=2015-12-06 20:46:20