|
发表于 2016-4-14 16:33:41
|
显示全部楼层
本帖最后由 greenTree 于 2016-4-14 16:39 编辑
var notifyUrl = location.origin;
var alipay = navigator.alipay;
alipay.pay({
"seller" : "支付宝账号", //卖家支付宝账号或对应的支付宝唯一用户号
"subject" : payInfoData.val("ordername")+"_"+payInfoData.val("vehicleno"), //商品名称
"body" : ordername, //商品详情
"price" :"0.01", //金额,生产中使用:payvalue
"tradeNo" : "20160414163325", //订单的唯一编号。因为一个订单可以多次支付,用时间作为订单的唯一编号
"timeout" : "30m", //超时设置
"notifyUrl" : notifyUrl
}, // 服务器通知路径
function(message) {
var responseCode = parseInt(message);
if (responseCode === 9000) {
params = {
'account' : account, // 用户账号
'orderId' : orderId, // 订单号
'outTradeNo' : dateTime,
'payfee' : payvalue4, // 支付宝已经支付的金额
'totalfee' : totalfee, // 订单需要的支付金额
'payterrace' : payterrace, // 支付平台
'returntype' : '0', // 类型,0表示支付成功
'data' : newPayData.toJson(true)
};
Baas.sendRequest({
"type" : "get",
"async" : false,
"url" : "/app/pay/pay!payfeeByAlipay.action",
"params" : params,
"dataType" : "text",
"success" : function(result){
if(result==='success') {
}
},
"error" : function(msg){
Baas.showError(msg);
}
});
} else if (!isNaN(responseCode)) {
justep.Util.hint("当前环境不支持支付宝支付!"+responseCode, {
"type" : "warning"
});
return;
} else {
justep.Util.hint("支付宝支付支付请求被拒绝!", {
"type" : "warning"
});
return;
}
}, function(msg) {
justep.Util.hint("支付宝支付支付请求被拒绝!"+msg, {
"type" : "warning"
});
return;
});
|
-
|