- 微信支付报jsapi缺少参数:total_fee?
{ "code": 200, "msg": "success", "data": { "timeStamp": "1676551631", "nonceStr": "6XZG5JD4H1Y79RFQOTI3VEPNSBCAW8MU", "package": "prepay_id=wx16204711623191ebbca668131cddb30000", "signType": "RSA", "paySign": "wEdYtkdvKK+5v1JQDFmAJ5wO6Mb6fEnlglRw75AorkFMiVUILeBitRWFPuj1XfiWblHE25FbB7KohCTQBekVJjAE/CSudq1N2Geo0op1CVIYykF1iRKJjNK2Bi4zYfs7Yeh8B23ijUjsPpDoKkCKbiWCwUunki1+NvRTDjiXyNwCHPMRpHTWkusl3Ee7Y2krAylpcyxI/NwRDuCniuX9HJNMv/KOut6qWMXEonU7rLGUSshMBrYihwbZsxjHRFjpSdohENsQvT73gac3akMTYrjYzpz/1TOoEQTvsCKaQgoG3638Lx36effKawnr6oKS1RDsQB0U8xqhdQ3ke48OOA==" } } prepay_id都获取正常,调起支付的时候,报jsapi缺少参数 total_free的问题。那位大神能给看看 下面是PHP的签名代码。现在不知道是获取prepay_id的问题,还是调起支付签名的问题? //根据prepay_id, //微信小程序调起支付的参数和签名 $prepay_id = $wechatPayMsg; //时间戳 $timeStampMini = time() . ""; //随机串 $nonceStr = Order::rand_code(); $package = "prepay_id=" . $prepay_id; $miniMessage = $config["miniapp_id"] . chr(10) . $timeStampMini. chr(10) .$nonceStr . chr(10) .$package . chr(10); openssl_sign($miniMessage, $mini_sign, $private_key, 'sha256WithRSAEncryption'); $sign = base64_encode($mini_sign); $signType = "RSA"; $data = [ "timeStamp" => $timeStampMini, "nonceStr" => $nonceStr, "package" => $package, "signType" => $signType, "paySign" => $sign ];
2023-02-16 - 调用支付JSAPI缺少参数:total_fee
在JSAPI 统一下单成功拿到prepay_id 后,在JSAPI 调起支付过程中出现错误提示 “调用支付JSAPI缺少参数:total_fee”。根据官方针对这一问题的提示,检查了package 格式,确认package格式正确,同时拿到的prepay_id 也不为空。提问前,也尝试了提供完整的body请求参数信息,都成功拿到prepay_id,但同样问题仍在,错误提示“调用支付JSAPI缺少参数:total_fee”。图(1)是调试过程中每一步的输出情况;图(2)、(3)是调起JSAPI支付出现的错误提示截图;图(4)是前端调起JSAPI的代码。请求帮助、指引,非常感谢! [图片][图片][图片][图片]
2021-09-02