let data = {
"trade_no": res.data.result.params.out_trade_no,
"type": "wechat",
"method": "miniapp",
"openid": uni.getStorageSync('openid')
}
uni.request({
url: "https://zmkj.pylongxia.com/addons/epay/index/pay",
method: "POST",
header: {
"content-type": "application/x-www-form-urlencoded"
},
data: data,
success: (res) => {
uni.requestPayment({
provider: 'wxPay',
timeStamp: res.data
.timeStamp, //记住,这边的timeStamp一定要是字符串类型的,不然会报错
nonceStr: res.data.nonceStr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.paySign,
success: function(res) {
console.log(res);
that.show = false
that.$u.toast("支付成功")
},
fail: function(err) {
that.show = false
that.$u.toast("支付失败")
console.log(err)
}
});
}
})
接入微信小程序支付
最新推荐文章于 2025-03-12 14:52:42 发布