参数
qurry:{
appid:"******",
mchid:"*****",
description: "不良资产交易",
out_trade_no:"100860",
notify_url:"*****",
amount:{
total:1,
currency:"CNY"
},
payer:{
openid:"**********"
}
签名
let str = JSON.stringify(this.data.qurry);
let autograph='post'+'\n'+'/v3/pay/transactions/jsapi'+'\n'+'1653314370'+'\n'+'593BEC0C930BF1AFEB40B4A08C8FB242'+'\n'+str+'\n';
let SHA=EncryptUtils.SHA256(autograph)
console.log("签名",SHA)
base64加密
let base64=EncryptUtils.Base64EnCode(SHA)
报错
"code: "SIGN_ERROR"
detail: {detail: {issue: "sign not match"}, field: "signature", location: "authorization",…}
detail: {issue: "sign not match"}
issue: "sign not match"
field: "signature"
location: "authorization"
sign_information: {method: "POST", sign_message_length: 320,…}
method: "POST"
sign_message_length: 320
truncated_sign_message: "POST↵/v3/pay/transactions/jsapi↵1653314370↵593BEC0C930BF1AFEB40B4A08C8FB242↵{"appid"↵"
url: "/v3/pay/transactions/jsapi"
message: "签名错误,请检查后再试"
- cod
从APIv3到APIv2再到企业微信,这款微信支付开发包的README你应该来读一读