提交 3c6689b4 编写于 作者: VK1688's avatar VK1688

update: HBX4.11起支持微信支付

上级 424b838d
...@@ -282,12 +282,14 @@ ...@@ -282,12 +282,14 @@
} }
// #ifdef APP // #ifdef APP
if (options['provider'] == "wxpay") { if (options['provider'] == "wxpay") {
uni.showModal({ // #ifdef uniVersion < 4.11
title: "提示", uni.showModal({
content: "uni-pay 的 uni-app x 版本暂未适配微信支付", title: "提示",
showCancel: false content: "请先升级HBX至4.11",
}) showCancel: false
return; })
return;
// #endif
} }
// #endif // #endif
...@@ -341,13 +343,6 @@ ...@@ -341,13 +343,6 @@
// 调起支付 // 调起支付
orderPayment(res : UTSJSONObject) { orderPayment(res : UTSJSONObject) {
this.orderRes = res; this.orderRes = res;
let _order = res.get('order');
let orderStr = "";
if (typeof _order == "string") {
orderStr = res.get('order') as string;
} else {
//order = res.get('order') as UTSJSONObject;
}
if (res['qr_code'] != null && res['qr_code'] != "") { if (res['qr_code'] != null && res['qr_code'] != "") {
this.$emit("qrcode", res); this.$emit("qrcode", res);
} }
...@@ -379,6 +374,8 @@ ...@@ -379,6 +374,8 @@
} }
// #endif // #endif
// #ifndef H5 // #ifndef H5
let _order = res.get('order');
let orderStr = typeof _order == "string" ? _order as string : JSON.stringify(_order) as string;
uni.requestPayment({ uni.requestPayment({
provider: res['provider'] as string, provider: res['provider'] as string,
orderInfo: orderStr, orderInfo: orderStr,
......
...@@ -119,7 +119,10 @@ module.exports = { ...@@ -119,7 +119,10 @@ module.exports = {
cloudInfo, cloudInfo,
wxpay_virtual, wxpay_virtual,
}); });
// uniappx-特殊处理
if (typeof res.order === "object" && typeof res.order["timestamp"] === "string") {
res.order["timestamp"] = parseFloat(res.order["timestamp"]);
}
return res; return res;
}, },
/** /**
...@@ -256,7 +259,7 @@ module.exports = { ...@@ -256,7 +259,7 @@ module.exports = {
}; };
} }
}, },
/** /**
* 验证iosIap苹果内购支付凭据 * 验证iosIap苹果内购支付凭据
*/ */
...@@ -272,7 +275,7 @@ module.exports = { ...@@ -272,7 +275,7 @@ module.exports = {
transaction_identifier transaction_identifier
}); });
}, },
/** /**
* 接收微信小程序虚拟支付异步通知 * 接收微信小程序虚拟支付异步通知
*/ */
...@@ -286,5 +289,5 @@ module.exports = { ...@@ -286,5 +289,5 @@ module.exports = {
cloudInfo cloudInfo
}); });
}, },
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册