$.ajax({
type: 'GET',
url: url,
dataType: 'json',
async: false,
data: {},
success: function(result) {
if(id == 'alipay') {
if(result.code == 4) {
//plus.runtime.openURL(result.data);
plus.payment.request(pays[id], result.data, function(result) {
console.log(pays[id]);
console.log(result);
}, function(e) {
console.error(JSON.stringify(e));
})
}
} else if(id == 'wxpay') {
if(result.code == 4) {
var wxurl = result.data;
$.ajax({
type: 'GET',
url: wxurl,
dataType: 'json',
data: {},
success: function(rsp) {
var wxxinxi = {
"sign": rsp.result_data.sign,
"timeStamp": rsp.result_data.timestamp,
"nonceStr": rsp.result_data.noncestr,
"partnerId": rsp.result_data.partnerid,
"prepayId": rsp.result_data.prepayid,
"package": rsp.result_data.package,
"appId": rsp.result_data.appid
};
console.log(JSON.stringify(wxxinxi));
plus.payment.request(pays[id], wxxinxi, function(result) {
console.log(pays[id]);
console.log(result);
}, function(e) {
console.error(JSON.stringify(e));
})
}
})
}
} else {
plus.nativeUI.alert(result.message)
}
}
})

何何
- 发布:2018-09-26 14:11
- 更新:2018-09-26 14:11
- 阅读:4286
0 个回复