收藏
回答

微信支付报错"sub_mch_id与sub_appid不匹配"?

使用微信云函数支付

同主体下的小程序共享云环境

商户和小程序已绑定


{"sign":"3D83BDD1ED2DCF21562D671B5ED3621","payment":{"timeStamp":"1731718644","nonceStr":"9QnqsbtKBFs6GLuD","package":"prepay_id=","signType":"MD5","paySign":"1C25F72FE2FDFB0A2DFEA04F2425511"},"returnCode":"SUCCESS","returnMsg":"OK","nonceStr":"9QnqsbtKBFs6GLuD","resultCode":"FAIL","errCode":0,"errCodeDes":"sub_mch_id与sub_appid不匹配","errMsg":"cloudPay.unifiedOrder:ok"}


支付参数 == { body: 'xxxxx',

outTradeNo: 'SGYJHT6AWXNHBDVUUGY17317183665',

spbillCreateIp: '222.244.107.95',

subMchId: '1682794687',

totalFee: 299,

envId: 'timepostoffice-2g6lm0wl8247f5',

openid: 'oyluK7WEJ6elSI99TtDxYj0rpY',

tradeType: 'JSAPI',

functionName: 'pay' }



调用的时候已经增加了appid

    const fromAppId = wxContext.FROM_APPID;

    console.log({ fromAppId });

    const res = await cloud.cloudPay({ appid: fromAppId }).unifiedOrder(params);


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容