客户端支付时报错:调用支付JSAPI缺少参数:total_fee
-------------------调试参数输出-----------
–请求sandbox签名key
DEBUG:getsignkey…
url= None
input=
<xml>
<mch_id>151***2341</mch_id>
<nonce_str>AiG0aRHfkjamL6dfDmiiagjYirNVxoT1</nonce_str>
<sign>F9EA1328EA2D5C93FD1FA5027060C0DE</sign> --用正式mch_key签名
</xml>
output= {
‘return_code’: ‘SUCCESS’,
‘return_msg’: ‘ok’,
‘sandbox_signkey’: ‘056aa71f4da5ad3c98849852d1d66251’}
–获取sandbox_signkey成功,后面用该key代替了mch_key进行签名。
–创建统一订单
DEBUG: unifiedorder…
url= None
input= <xml>
<body>VIP认证费用</body>
<openid>oy47H0ikyqwWxmN838sD_BNskOUY</openid>
<trade_type>JSAPI</trade_type>
<nonce_str>wMbLHFFhScUPRixod4kehl3gkgs33Uij</nonce_str>
<sign>867D49536EF15D689265E0DF73852571</sign>
<mch_id>151***2341</mch_id>
<out_trade_no>3P3XZbuJawRDoWJ5BZllzWkUEz7A2ao1</out_trade_no>
<total_fee>101</total_fee> --这里是有total_fee的
<appid>wx3b4fcd***cbb5286</appid>
<notify_url>https://www.yi*******n.com/pay/notify/</notify_url>
<spbill_create_ip>110.184.*.146</spbill_create_ip>
</xml>
output= {‘trade_type’: ‘JSAPI’,
‘prepay_id’: ‘wx20180928013108667115’,
‘nonce_str’: ‘wMbLHFFhScUPRixod4kehl3gkgs33Uij’,
‘return_code’: ‘SUCCESS’,
‘err_code_des’: ‘ok’,
‘sign’: ‘5509D9388149D26A64BB313A139A8BBC’,
‘mch_id’: ‘151***2341’,
‘return_msg’: ‘OK’,
‘appid’: ‘wx3b4fcd***cbb5286’,
‘device_info’: ‘sandbox’,
‘result_code’: ‘SUCCESS’,
‘err_code’: ‘SUCCESS’}
–创建统一订单是成功的
–生成客户端支付参数
DEBUG: signed arguments for wxChoosePay…
data= {
‘package’: ‘prepay_id=wx20180928013108667115’,
‘timeStamp’: ‘1538069468’,
‘signType’: ‘MD5’,
‘paySign’: ‘3371C7A5149BD32E5E00752FFDAFD15D’,
‘appId’: ‘wx3b4fcd***cbb5286’,
‘nonceStr’: ‘YPLaO02XfgbHb16EyJKPG6BUuLIuP2Vv’}
WeixinJSBridge.invoke(‘getBrandWCPayRequest’, data,function(res){
…
});
详细检查了各个环节未发现问题,APPID也是一致的。请教各位专家问题可能出在哪里?如何进一步分析解决?THX