云开发,微信支付成功后为什么没有触发回调函数?
// 云函数代名称pay
const res = await cloud.cloudPay.unifiedOrder({
"body": goodsInfo,
"outTradeNo": (Math.random() * 10000000000 + new Date().getTime()).toFixed(0),
"spbillCreateIp": "127.0.0.1",
"subMchId": "*****",
"totalFee": totalPrice,
"envId": "*******",
"functionName": "payCallback"
})
// 小程序端调用支付接口
pay(orderId, totalPrice) {
wx.cloud.callFunction({
name: "pay",
data: {
goodsInfo: "微信支付测试",
totalPrice: 1
}
}).then(res => {
const payment = res.result.payment
wx.requestPayment({
...payment,
}).then(res => {
})
}).catch(err => {
console.log(err)
})
},
payCallback回调函数没有被触发,基础库2.14.1