4***@qq.com
4***@qq.com
  • 发布:2020-08-20 11:26
  • 更新:2020-08-20 11:41
  • 阅读:834

安卓手机 app 调用 微信支付 在版本更新后 fail:{"errMsg":"requestPayment:fail errors"}

分类:HBuilderX

产品分类: HbuilderX

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX版本号: 2.8.7

示例代码:

{
"data": {
"appid": "wxc559eade7d0a3bde",
"partnerid": "1554108981",
"prepayid": "wx2011210755225525a3be01fb2b445a0000",
"timestamp": "1597893667",
"noncestr": "vRhih6xpnzCYg5Jd",
"package": "Sign=WXPay",
"sign": "23A03DCAD194E5FBA70A5643BCF93867"
},
"statusCode": 200,
"header": {
"cache-control": "no-cache, private",
"content-type": "application/json",
"x-powered-by": "PHP/7.2.13",
"transfer-encoding": "chunked",
"server": "nginx",
"connection": "keep-alive",
"date": "Thu, 20 Aug 2020 03:21:07 GMT"
},
"errMsg": "request:ok",
"cookies": []
}

操作步骤:

async getWxPayOrderSn() {
let _this = this;
var orderSn = '',
orderInfo = this.orderInfo,
data = await this.$http
.bindwxPay({
orderSn: orderInfo
})
.then(res => res.data);
if (data.code === 0) {
orderSn = data.data;
orderSn = JSON.parse(orderSn);
orderSn = {
appid: orderSn.appid,
partnerid: orderSn.partnerid,
prepayid: orderSn.prepayid,
noncestr: orderSn.noncestr,
timestamp: orderSn.timestamp,
package: orderSn.package,
sign: orderSn.sign
};
}
orderSn = JSON.stringify(orderSn);
console.log(orderSn);
uni.hideLoading();
// #ifdef APP-PLUS
uni.requestPayment({
provider: 'wxpay',
orderInfo: orderSn,
success: function(res) {
_this.handToSuccess();
},
fail: function(err) {
console.log(err);
_this.$msg('支付失败');
uni.setStorageSync('payfail', 1);
// _this.$msg(JSON.stringify(err));
console.log('fail:' + JSON.stringify(err));
setTimeout(function() {
uni.navigateTo({
url: '../order/order?state=0'
});
}, 1500);
}
});
// #endif

预期结果:

可以支付成功

实际结果:

fail:{"errMsg":"requestPayment:fail errors"}

bug描述:

uni.requestPayment({
provider: 'wxpay',
orderInfo: orderSn,
success: function(res) {
_this.handToSuccess();
},
fail: function(err) {
console.log(err);
_this.$msg('支付失败');
uni.setStorageSync('payfail', 1);
// _this.$msg(JSON.stringify(err));
console.log('fail:' + JSON.stringify(err));
setTimeout(function() {
uni.navigateTo({
url: '../order/order?state=0'
});
}, 1500);
}
});

2020-08-20 11:26 负责人:无 分享
已邀请:
4***@qq.com

4***@qq.com (作者)

在 ios 微信可以正常支付。 只有安卓不可以

  • b***@163.com

    跟你遇到了同样的问题,请问解决了吗?

    2020-09-23 11:30

该问题目前已经被锁定, 无法添加新回复