去掉微信支付
This commit is contained in:
@@ -263,47 +263,57 @@ export const checkBookRight = function(data,callback) {
|
||||
|
||||
// 单独微信支付
|
||||
export const setWXPay = function(payInfo, callback) {
|
||||
console.log('都走这个接口', payInfo)
|
||||
// payInfo = {
|
||||
// "orderSn": "20240524123456789101112131415167",
|
||||
// "buyOrderId": 15,
|
||||
// "totalAmount": "38"
|
||||
// }
|
||||
$http.request({
|
||||
url: "/pay/placeAnOrder/shoppingPay",
|
||||
url: "pay/placeAnOrder/shoppingPay",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data:payInfo,
|
||||
data: {
|
||||
...payInfo,
|
||||
appName: 'medicine'
|
||||
},
|
||||
header: { //默认 无 说明:请求头1
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(res,'resshoppingPay')
|
||||
if(res.code === 0){
|
||||
console.log(res, 'resshoppingPay')
|
||||
if (res.code === 0) {
|
||||
console.log('接下来走微信接口啦')
|
||||
let payData = {
|
||||
provider : 'wxpay',
|
||||
provider: 'wxpay',
|
||||
orderInfo: {
|
||||
"appid": res.paramMap.appid , // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
|
||||
"noncestr": res.Map.noncestr, // 随机字符串
|
||||
"package": res.Map.package, // 固定值
|
||||
"partnerid": res.paramMap.mchid, // 微信支付商户号
|
||||
"prepayid": res.Map.prepayid, // 统一下单订单号
|
||||
"timestamp": res.Map.timestamp, // 时间戳(单位:秒)
|
||||
"signType": "SHA256-RSA",
|
||||
"sign": res.Map.sign
|
||||
},
|
||||
success(res) {
|
||||
callback && callback({
|
||||
success: true,
|
||||
data: res
|
||||
});
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
fail(err) {
|
||||
callback && callback({
|
||||
success: false,
|
||||
data: err
|
||||
});
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
|
||||
}
|
||||
"appid": res.paramMap.appid, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
|
||||
"noncestr": res.Map.noncestr, // 随机字符串
|
||||
"package": res.Map.package, // 固定值
|
||||
"partnerid": res.paramMap.mchid, // 微信支付商户号
|
||||
"prepayid": res.Map.prepayid, // 统一下单订单号
|
||||
"timestamp": res.Map.timestamp, // 时间戳(单位:秒)
|
||||
"signType": "SHA256-RSA",
|
||||
"sign": res.Map.sign
|
||||
},
|
||||
success(res) {
|
||||
callback && callback({
|
||||
success: true,
|
||||
data: res
|
||||
});
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
fail(err) {
|
||||
callback && callback({
|
||||
success: false,
|
||||
data: err
|
||||
});
|
||||
console.log('微信错误fail:' + JSON.stringify(err));
|
||||
|
||||
}
|
||||
}
|
||||
// console.log(payData)
|
||||
if(payData.orderInfo.prepayid != '' && payData.orderInfo.prepayid != undefined){
|
||||
uni.requestPayment(payData);
|
||||
if (payData.orderInfo.prepayid != '' && payData.orderInfo.prepayid != undefined) {
|
||||
uni.requestPayment(payData);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user