收藏
回答

调用mchTransfer.transferBills请求异常还返回有效的支付信息?

// 发起代码如下

try {

const result = await (new Wechatpay({....配置})).v3.fundApp.mchTransfer.transferBills({

appid: 'xxxxx', // 商户AppID,与配置中的appId相同或为空字符串(如果配置中已设置)

out_bill_no: getOrderId('xxxxx'), // 商户转账单号,需唯一

openid: info.data.openid, // 收款用户的OpenID

transfer_amount: info.data.money, // 转账金额,单位为分

transfer_remark: '备注', // 转账备注信息

transfer_scene_id: '1005', // 转账场景ID,目前固定为1001

transfer_scene_report_infos: [{

info_type: "xxx",

info_content: "xxx"

},

{

info_type: "xxx",

info_content: "xxxx"

}

]

}, {

headers: {

'Wechatpay-Serial': 'PUB_KEY_ID_xxxxx'

}

});

console.log('发起成功:', result);

return {

code:0,

data:{

packageinfo:result.data.package_info,

billno:result.data.out_bill_no

}

}

} catch (error) {

console.log('发起失败:', error);

return {

code: -1,

err: error.response.data

}

}


现在看日志mchTransfer.transferBills有错误

START RequestId: 26d7f7e1-4f70-48ba-9876-dfa8870bde2b

Event RequestId: 26d7f7e1-4f70-48ba-9876-dfa8870bde2b

2025-05-16T04:40:59.168Z 26d7f7e1-4f70-48ba-9876-dfa8870bde2b 1111

2025-05-16T04:40:59.214Z 26d7f7e1-4f70-48ba-9876-dfa8870bde2b 35305

TypeError: Converting circular structure to JSON

--> starting at object with constructor 'ClientRequest'

| property 'socket' -> object with constructor 'TLSSocket'

--- property '_httpMessage' closes the circle

at JSON.stringify (<anonymous>)

at /data/scf/frame/node16/wrapLog.js:37:107

at Array.map (<anonymous>)

at commonLog (/data/scf/frame/node16/wrapLog.js:37:45)

at console.log (/data/scf/frame/node16/wrapLog.js:50:7)

at createTransferBills (/var/user/index.js:95:13)

at processTicksAndRejections (node:internal/process/task_queues:96:5)

Response RequestId: 26d7f7e1-4f70-48ba-9876-dfa8870bde2b RetMsg: {"code":0,"data":{"packageinfo":"xxxxxx","billno":"xxxx"}}

END RequestId: 26d7f7e1-4f70-48ba-9876-dfa8870bde2b

Report RequestId: 26d7f7e1-4f70-48ba-9876-dfa8870bde2b Duration: 751ms Memory: 256MB MemUsage: 24.824219MB

而且我这边客户还可以重复进行操作

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

1 个回答

登录 后发表内容