|
weixin.generatePrepayId({
"body" : self.data.productName,
"feeType" : "1",// 1是人民币
"notifyUrl" : notifyUrl,
"totalFee" : Math.round(parseFloat(totalMoney).toFixed(2) * 100),// 总金额,以分为单位,所以要乘以100
"traceId" : traceID,
"tradeNo" : self.orderId
}, function(prepayId) {
justep.Util.hint("220:" + prepayId);
weixin.sendPayReq(prepayId, function(message) {
var responseCode = parseInt(message);
if (responseCode === 0) {
justep.Util.hint("微信支付完成!");
sendData = {
ok : true,
msg : "",
orderId : -1
};
self.comp("windowReceiver1").windowEnsure(sendData);// 关闭当前窗口
} else if (!isNaN(responseCode)) {
justep.Util.hint("微信返回错误码:" + responseCode);
} else {
justep.Util.hint("微信支付请求被拒绝");
}
}, function(message) {
justep.Util.hint("微信支付请求被拒绝");
});
}, function(message) {
justep.Util.hint("234:" + message);
// justep.Util.hint("微信生成预支付订单失败");
});
参数为:
Object {body: "aaa", feeType: "1", notifyUrl: "http://222.173.147.86:29280/baas/test/recharge/weixinNotify", totalFee: 2200, traceId: "201710230939268239"…}
body: "aaa"
feeType: "1"
notifyUrl: "http://222.173.147.86:29280/baas/test/recharge/weixinNotify"
totalFee: 2200
traceId: "201710230939268239"
tradeNo: "C7BAF90151000001BD65C4C01B10BE80"
为什么执行失败?报错“234:Fail” |
|