请求参数:
signData: JSON.stringify({
mchid: '1695215910',
out_trade_no: '1849375818996912128',
description: '佛山千屿千寻',
amount: {
order_amount: 1000
},
env: 0
}),
paySig: 'e5499f31889aeb8186091e9419e0753b7dca0a94be1f4dd24144e57da3419243',
signature: 'af849d15de3e2b8f2d0918acd358b8055d530684dddcccc5c12d2a169b9b35b9',
mode: 'retail_pay_goods',
返回错误:
list.js:304 requestCommonPayment:fail webapi_wxa_createmidasorder:fail invalid signature 702002(env: Windows,mp,1.06.2409131; lib: 3.0.2)
麻烦各位大佬看看
你好,paySig和signature参数不对,可以检查下签名算法
let signData = JSON.stringify(res.data.signData2)
({"mchid":"1697549149","out_trade_no":"B2BDD202411061323580000039","description":"order_sn=DSDD202411061323540000032","amount":{"order_amount":20700},"env":0})
const signature = CryptoJS.HmacSHA256(signData,res.data.session_key).toString();
const paySign = CryptoJS.HmacSHA256("requestCommonPayment&"+ signData,'BVCxVT4ntS2oun8yECQNDSy3UrDAu0Dj').toString();
console.log(signature)
console.log(paySign)