参照H5plus的支付示例,我调试微信支付接口,当我的业务服务器返回200后,进行如下操作:
plus.payment.request(pays['wxpay'], obj.data, function(result){
console.log("----- 支付成功 -----");
console.log("result:" +result);
},function(e){
console.log("----- 支付失败 -----");
console.log("["+e.code+"]:"+e.message);
console.error(JSON.stringify(e));
});
结果支付失败,控制台输出如下信息:
----- 支付失败 ----- at app/order/charge.js:165
[-1]:General errors at app/order/charge.js:166
{"code":-1,"message":"General errors"} at app/order/charge.js:167
其中,传给request的第二个参数值是(个别第三数字使用x代替):
{"retcode":0,"retmsg":"ok","appid":"wx62ebxxxx5axx84xx","noncestr":"fkojwhfug0r2llll5bougv5myjnobh96","package":"Sign=WXPay","partnerid":"124xxx0201","prepayid":"wx201507141041559e26c899f80931358612","timestamp":1436841715,"sign":"8F30EF47464C8707D3AA8C2BF140CB74"}
H5plus的支付示例中微信支付传给request的第二个参数值是:
{"retcode":0,"retmsg":"ok","appid":"wx0411fa6a39d61297","noncestr":"f35eefbd4a3f82c5ea36ace4b7699cc6","package":"Sign=WXPay","partnerid":"1230636401","prepayid":"12010000001507147692a48beaeff417", "timestamp":1436840151,"sign":"7fcde50611b1815322dfb9afcd7768680b9244fb"}
两者相比,只有sign和prepayid的长度不同,不知道会不会跟这个有关?
plus.payment.request的参数具体是什么要求?
谁解决过类似的问题,请求提供思路和帮助,谢谢!
mackes
有签名的
2015-12-30 19:06