收藏
回答

/v3/pay/transactions 签名错误,检查充实

参数
 qurry:{
      // 应用ID
      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↵1653314370593BEC0C930BF1AFEB40B4A08C8FB242↵{"appid""
url: "/v3/pay/transactions/jsapi"
message: "签名错误,请检查后再试"
  1. cod


最后一次编辑于  2022-05-23
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容