$param = [
'body' => "商品标题",
'attach' => "附加数据",
'detail' => "商品详细描述",
'out_trade_no' => "TX_" . time() . '_' . rand(10000, 99999),
'total_fee' => 101,
'device_info' =>"WEB",
'spbill_create_ip' => $_SERVER['REMOTE_ADDR'],
'time_start' => date("YmdHis"),
'time_expire' => date("YmdHis", time() + 600),
'product_id' =>"shop001",
'goods_tag' => "系统测试-产品标识",
'notify_url' =>"http://********/wx/payback.php",
'trade_type' =>"JSAPI",
'openid' => $this->openid,
];
都是这组参数,正式微信支付可以通过,但是做沙盒测试的时候能生成prepay_id ,但是前端H5支付的时候提示缺少total_fee
谁遇到相同的问题了吗?
查询的时候能查到订单信息
Array
(
[openid] => wxd930ea5d5a258f4f
[sub_mch_id] =>
[cash_fee_type] => CNY
[settlement_total_fee] => 101
[nonce_str] => 03thdxmk1swe8o92qjr4cbply7g6fzui
[return_code] => SUCCESS
[err_code_des] => SUCCESS
[time_end] => 20180226210502
[mch_id] => 1313663301
[trade_type] => JSAPI
[trade_state_desc] => ok
[trade_state] => SUCCESS
[sign] => 17444A4316064CADD90330C0E4F879F2
[cash_fee] => 101
[is_subscribe] => Y
[return_msg] => OK
[fee_type] => CNY
[bank_type] => CMC
[attach] => sandbox_attach
[device_info] => sandbox
[out_trade_no] => TX_1519649837_92862
[transaction_id] => 20180226210502852911105
[total_fee] => 101
[appid] => wx110ac46ffb0607a6
[result_code] => SUCCESS
[err_code] => SUCCESS
)
虽然没有支付,但是收到了微信的回调信息
<xml>
<openid><![CDATA[oye3bt95f3roiFl_15DDtzN60jJk]]></openid>
<trade_type><![CDATA[JSAPI]]></trade_type>
<cash_fee_type><![CDATA[CNY]]></cash_fee_type>
<nonce_str><![CDATA[o4yrbwlgndsp1fz70mk6uij2c835ax9t]]></nonce_str>
<time_end><![CDATA[20180226210158]]></time_end>
<err_code_des><![CDATA[SUCCESS]]></err_code_des>
<return_code><![CDATA[SUCCESS]]></return_code>
<mch_id><![CDATA[1313663301]]></mch_id>
<settlement_total_fee><![CDATA[101]]></settlement_total_fee>
<sign><![CDATA[AA4000530F14646D117C3B6F588959E6]]></sign>
<cash_fee><![CDATA[101]]></cash_fee>
<is_subscribe><![CDATA[Y]]></is_subscribe>
<return_msg><![CDATA[OK]]></return_msg>
<fee_type><![CDATA[CNY]]></fee_type>
<bank_type><![CDATA[CMC]]></bank_type>
<attach><![CDATA[附加数据]]></attach>
<device_info><![CDATA[WEB]]></device_info>
<out_trade_no><![CDATA[TX_1519649837_92862]]></out_trade_no>
<result_code><![CDATA[SUCCESS]]></result_code>
<total_fee><![CDATA[101]]></total_fee>
<appid><![CDATA[wx110ac46ffb0607a6]]></appid>
<transaction_id><![CDATA[100539073720180226210158177058]]></transaction_id>
<err_code><![CDATA[SUCCESS]]></err_code>
</xml>