使用微信云函数支付
同主体下的小程序共享云环境
商户和小程序已绑定
{"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);
子商户和子商户APPID没有绑定关系导致
还会有其他原因吗
还是报了这个错,我有点不理解了
console.log({ fromAppId });
const res = await cloud.cloudPay({ appid: fromAppId }).unifiedOrder(params);
这里是这样调用的