收藏
回答

使用wechatpay-axios-plugin 商家转账报错?

const wxpay = new Wechatpay({
        // 商户号
        mchid: '170*****',
        // 商户证书序列号
        serial: '1454968D14D**********',
        // 商户API私钥 PEM格式的文本字符串或者文件buffer
        privateKey: prikey,
        certs: {
          '1': cert,
        },
        secret: 'l**********',
        merchant: {
          cert: cert,
          key: prikey,
        },
      })

return wxpay.v3.transfer.batches.post({
        // mchid: "1604163157 ",
        appid: 'wx3asdfasdfrid',
        batch_name:"demo",
        batch_remark:'demo',
        total_amount:100,
        total_num:1,
        transfer_detail_list:[
          {
            out_detail_no:'123123412334',
            transfer_amount:100,
            transfer_remark:'demo',
            openid:info.data.openid,
          }
        ]
      }).then(res=>{
        console.log(res.data,1111)
        return res
      })
      .catch(({response: {status, statusText, data}}) => console.error(status, statusText, data))


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

1 个回答

登录 后发表内容