|
支付代码
//微信支付
Model.prototype.payOrderByWeixin = function(orderID,Money,notifyUrl) {
if (!navigator.weixin)
{
justep.Util.hint("没有安装微信,支付失败.");
return;
}
var traceID = justep.UUID.createUUID();
var traceNo = orderID;
var weixin = navigator.weixin;
weixin.generatePrepayId({
"body" : "在线冲值",
"feeType" : "1",
"notifyUrl" : notifyUrl,
"totalFee" : Money*100,
"traceId" : traceID,
"tradeNo" : traceNo
}, function(prepayId) {
weixin.sendPayReq(prepayId, function(message) {
justep.Util.hint("在线冲值成功.");
}, function(message) {
justep.Util.hint("在线冲值失败."+message+"===="+notifyUrl);
});
}, function(message) {
justep.Util.hint("在线冲值失败."+message+"===="+notifyUrl);
});
};
//支付宝支付
Model.prototype.payOrderByAlipay = function(orderID,Money,notifyUrl) {
if (!navigator.alipay) {
justep.Util.hint("没有安装支付宝,支付失败.");
return;
}
var tradeNo = orderID;
var alipay = navigator.alipay;
alipay.pay({
"seller" : "huangyx@justep.com", // 卖家支付宝账号或对应的支付宝唯一用户号
"subject" : "在线冲值", // 商品名称
"body" : "在线冲值", // 商品详情
"price" : Money, // 金额,单位为RMB
"tradeNo" : tradeNo, // 唯一订单号
"timeout" : "30m", // 超时设置
"notifyUrl" : notifyUrl
},
function(message) {
justep.Util.hint("在线冲值成功.");
}, function(msg) {
justep.Util.hint("在线冲值失败."+msg+"===="+notifyUrl);
});
};
两种支付都是提示冲值失败 没有出现支付界面? |
|