|
发表于 2016-5-11 11:35:08
|
显示全部楼层
楼主你用wex5提供的参数是怎么完成微信支付的,我的获取不到商品ID,一直都是支付失败,求分享分享心得,急急急
Model.prototype.button5Click = function(event){ //微信支付
if (!navigator.weixin) {
return;
}
var notifyUrl = location.origin;
var traceID = justep.UUID.createUUID(); //订单号
var traceNo = justep.UUID.createUUID();
var weixin = navigator.weixin;
weixin.generatePrepayId({
"body" : "x5外卖", //商品名称
"feeType" : "1", //货币类型,1表示人民币
"notifyUrl" : notifyUrl,
"totalFee" : "1", //总金额,1表示1分钱
"traceId" : traceID,
"tradeNo" : traceNo
}, function(prepayId) {
weixin.sendPayReq(prepayId, function(message) {
var responseCode = parseInt(message);
alert("成功");
}, function(message) {
justep.Util.hint("微信支付失败!!");
});
}, function(message) {
//alert(prepayId);
justep.Util.hint("微信支付失败!0");
});
|
|