{ "mchid": "163xxxxs82", "out_trade_no": "L20230217095718000000035278", "appid": "wxbf56ssssc7b337b", "description": "全麦面包黄瓜片梨子麦片健康下午茶搭配设计", "notify_url": "https://shop.letianpai.com/addons/shop/order/epay/type/notify/paytype/wechat", "amount": { "total": 100, "currency": "CNY" }, "payer": { "openid": "opyQ85TvDY0qiwe4uFErMTx_o2FA" } } z这是生成prepay_id的参数,排查了都没有问题 现在请求prepay_id和签名换成了微信官方SDK了。签名应该都没有问题了。但是调起支付还是 jsapi缺少参数 total_free, $params = [ 'appId' => $config["miniapp_id"], 'timeStamp' => (string)Formatter::timestamp(), 'nonceStr' => Formatter::nonce(), 'package' => 'prepay_id='.$prepay_id, ]; $params += ['paySign' => Rsa::sign( Formatter::joinedByLineFeed(...array_values($params)), $merchantPrivateKeyInstance ), 'signType' => 'RSA'];
微信支付报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-17