|
外卖微信支付时,订单号生成失败,下面是我的js代码。
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");
});
};
|
|