平台币微信支付 ajax 请求

master
tpingzhang 5 years ago
parent 884a1fc8f1
commit dfade4e0be

@ -604,8 +604,8 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
$game_id = I('request.game_id');
$user_id = $request['user_id'];
if($request['price']*1<=0 || $request['price'] > C('WX_PAY_LIMIT')) {
// $this->set_message(0,"fail","充值金额有误");
redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1, 'msg'=>'充值金额有误', 'game_id' => $game_id, 'user_token' => $this->userToken)));exit;
$this->new_set_message(0,"fail","充值金额有误");
//redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1, 'msg'=>'充值金额有误', 'game_id' => $game_id, 'user_token' => $this->userToken)));exit;
}
$pay_amount = $request['price'];
@ -626,12 +626,13 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
$request['pay_url'] = $json_data['url'];
$this->add_deposit($request, 1);
// .(is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
if (I('request.api_ver') == 1) {
/* if (I('request.api_ver') == 1) {
$json_data['url'] = $is_pay['mweb_url'].'&redirect_url='.(is_ssl()?'https%3A%2F%2F':'http%3A%2F%2F'). $_SERVER ['HTTP_HOST'] . "%2Fsdk.php%2FSpend%2Fpay_success%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$game_id;
redirect($json_data['url']);
}
} */
}else{
redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1,'game_id'=>$game_id,'msg'=>'支付失败', 'user_token' => $this->userToken)));exit;
$this->new_set_message(0,"fail","支付失败");
// redirect(U('Spend/notice',array('user_id'=>$user_id, 'is_platform' => 1,'game_id'=>$game_id,'msg'=>'支付失败', 'user_token' => $this->userToken)));exit;
}
}elseif(get_wx_pay_type() == 1){
$request['pay_way'] = 4; // 威富通wx
@ -753,7 +754,8 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`;
}
echo json_encode(array(
'url' => $json_data['url']
'status' => 1,
'data' => $json_data['url'],
));
exit();
//redirect($json_data['url']);

@ -72,7 +72,11 @@ $(function(){
},
success: function(r) {
window.location.href = r.url;
if (r.status == 2) {
window.location.href = r.data;
} else {
alert(r.info);
}
}
});

Loading…
Cancel
Save