请求微信支付接口返回一次的完整请求参数&返回值如下:
发送动作:
1:请求的接口地址:https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack
2:请求参数:
<xml><act_name><![CDATA[固定金额]]></act_name>
<client_ip><![CDATA[127.0.0.1]]></client_ip>
<mch_billno><![CDATA[10201909194318884592]]></mch_billno>
<mch_id><![CDATA[1520530231]]></mch_id>
<nonce_str><![CDATA[a1a0928f25b561ddaf6dbe50791aaf3f]]></nonce_str>
<re_openid><![CDATA[o9FIk1R1r6S0BHgk4B5lSu9yOkU8]]></re_openid>
<remark><![CDATA[12]]></remark>
<send_name><![CDATA[12]]></send_name>
<total_amount><![CDATA[100]]></total_amount>
<total_num><![CDATA[1]]></total_num>
<wishing><![CDATA[12]]></wishing>
<wxappid><![CDATA[wxda591f60c8fd5c47]]></wxappid>
<sign><![CDATA[FFD370ED77FAC451A1E87E6798FF93E7]]></sign>
</xml>
3:请求返回值:
Array
(
[return_code] => SUCCESS
[return_msg] => 请求已受理,请稍后使用原单号查询发放结果
[result_code] => FAIL
[err_code] => PROCESSING
[err_code_des] => 请求已受理,请稍后使用原单号查询发放结果
[mch_billno] => 10201909194318884592
[mch_id] => 1520530231
[wxappid] => wxda591f60c8fd5c47
[re_openid] => o9FIk1R1r6S0BHgk4B5lSu9yOkU8
[total_amount] => 100
)
查询动作:
请求地址:https://api.mch.weixin.qq.com/mmpaymkttransfers/gethbinfo
请求参数:
<xml><appid><![CDATA[wxda591f60c8fd5c47]]></appid>
<bill_type><![CDATA[MCHT]]></bill_type>
<mch_billno><![CDATA[10201909194318884592]]></mch_billno>
<mch_id><![CDATA[1520530231]]></mch_id>
<nonce_str><![CDATA[195f18112d9234669f40e36863ad3af9]]></nonce_str>
<sign><![CDATA[C463D6954B66BF42818524C9BD592F28]]></sign>
</xml>
返回结果:
array(15) {
["return_code"]=>
string(7) "SUCCESS"
["return_msg"]=>
string(2) "OK"
["result_code"]=>
string(7) "SUCCESS"
["err_code"]=>
string(7) "SUCCESS"
["err_code_des"]=>
string(2) "OK"
["mch_billno"]=>
string(20) "10201909194318884592"
["mch_id"]=>
string(10) "1520530231"
["detail_id"]=>
string(31) "1000041701201909193000155290355"
["status"]=>
string(7) "SENDING"
["send_type"]=>
string(3) "API"
["hb_type"]=>
string(6) "NORMAL"
["total_num"]=>
string(1) "1"
["total_amount"]=>
string(3) "100"
["send_time"]=>
string(19) "2019-09-19 20:24:18"
}
您好,这样是对的;注意:当状态为FAIL时,存在业务结果未明确的情况。所以如果状态是FAIL,请务必再请求一次查询接口[请务必关注错误代码(err_code字段),通过查询得到的红包状态确认此次发放的结果。],以确认此次发放的结果。