文档中getOrderInfo描述如下,其中的openid是怎样获取的?
// 云函数 - getOrderInfo
exports.main = async function (event,context) {
let orderInfo = await unipayIns.getOrderInfo({
openid: 'user openid',
subject: '订单标题', // 微信支付时不可填写此项
body: '商品描述',
outTradeNo: '商户订单号',
totalFee: 1, // 金额,单位分
notifyUrl: 'https://xxx.xx' // 支付结果通知地址
})
return {
orderInfo
}
}
1 个回复
3***@qq.com - 342805357@qq.com
方案1:接入uni-id,使用uniID.code2SessionWeixin方法;
方案2:使用uniCloud.httpclient.request,请求微信小程序服务端接口jscode2session