微信支付返回-100 -1 generalerrors
安卓平台出现的问题 , ios尚未测试.
1.已核对开放平台签名和包名与app打包一致. (使用腾讯 get signature工具获取的)
2.服务端返回的预付订单json格式字符串格式与demo一样 见下图
- 求高手解答. 留下QQ 我加您.
function wxpay(_channel, _amount, _order_no) {
var url = "/api/payment/wxpay/app_index.aspx";
var postdata = "pay_order_amount=" + _amount + "&pay_order_no=" + _order_no;
_toggle_loading(true);
_ajax(url, postdata, function(resultdata) {
console.log(JSON.stringify(resultdata));
if(resultdata.status == 1) {
var paypar = resultdata.paypar;
var varpay = {
"retcode": 0,
"retmsg": "ok",
"appid": paypar.appid,
"noncestr": paypar.noncestr,
"package": "Sign=WXPay",
"partnerid": paypar.partnerid,
"prepayid": paypar.prepayid,
"timestamp": paypar.timestamp,
"sign": paypar.sign
}
alert(JSON.stringify(varpay));
plus.payment.request(_channel, varpay, function(result) {
plus.nativeUI.alert("支付成功!", function() {
back();
});
}, function(e) {
plus.nativeUI.alert("支付失败:" + e.code + "支付失败:" + e.message);
console.log(e.code);
console.log(e.message);
});
} else {
_toggle_loading(false);
plus.nativeUI.toast(resultdata.msg);
}
//to do something
}, function(xhr, type, errorThrown) {
console.log(errorThrown);
_show_ajax_error_toast(type);
_toggle_loading(false);
});
}
```javascript