尝试了各种方式一直报这个错,各项配置也都检查了
服务端返回:
{
"status": "success",
"code": 200,
"data": {
"appId": "wxf4976f7a54c40125",
"timeStamp": "1709866013",
"nonceStr": "UBN30YQ7AOTy6dPA",
"package": "prepay_id=wx0810465334525774147f1525edab720000",
"signType": "RSA",
"paySign": "Wh+apnt0F0JGCUasUEQ0RuEb8MvcsuHmlZTptmQv+O3/Vu9nGHOp6cD80VRQJIj5M72Nz45KwtzLoARdjnIuqG3K86zjEp9zpTbku52fSqL+DmkuqT15MMOKYiK3+6FTGNuVM6NJrFGrKhhS9gkE5GO7l+BP4GFlgtgQknJEpvuCAfHjapmca5X4A3w23tTsTkWsCXhRzKI4ZGieEn2Z9uetF2qzvxptdH6Y/2zrnjP4jljTDC98D7Y5Mx3NOLcWhTRYpIkJ9uAGvw1zG+IYPz1W6qoGfBGbgdp+hmGOsuLf2Z7OXArLPsA4ccjmyXmr+SUFxRyCfG+NxnldDXuFxw=="
}
}
JS:
WeixinJSBridge.invoke('getBrandWCPayRequest', {
appId: res.appId,
timeStamp: res.timestamp, //<?= $config['timestamp'] ?>,
nonceStr: res.nonceStr, //'<?= $config['nonceStr'] ?>',
package: res.package, //'<?= $config['package'] ?>',
signType: res.signType, //'<?= $config['signType'] ?>',
paySign: res.paySign, //'<?= $config['paySign'] ?>', // 支付签名
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
}
});
已经解决了,在服务端初始化支付实例时,我这边传入了公众号的appid导致这个问题