微信云支付退款API接口报错
微信调用云支付退款接口,会报错:TypeError: Cannot read property 'refund' of undefined,找不到原因 const cloud = require('wx-server-sdk')
cloud.init()
// 云函数入口函数
exports.main = async (event, context) => {
const res = await cloud.CloudPay.refund({
"out_refund_no":"6021500073819217020204482144", //商户退款单号
"out_trade_no":"6021500073819217020204282144",//商户系统内部订单号
"nonce_str":"5K8264ILTKCH16CQ2502SI8ZNMTM67VS", //随机字符串
"sub_mch_id": "1587492071",
"total_fee": 1,
"refund_fee": 1
})
return res
}
[图片] 在后台已经设置了退款API权限,已经授权。云函数版本2.0.3,开发工具也是最新版本1.03.2005140