微信回调app

支付金额回调验证
master
tpingzhang 5 years ago
parent 3925ffbb83
commit af8a0e3e2d

@ -58,7 +58,7 @@ class BaseController extends Controller {
if(empty($d)){$this->record_logs("数据异常");return false;}
// 支付金额判断 by zgc
if ($d['pay_amount'] != $data['money']) {
if (isset($data['money']) && $d['pay_amount'] != $data['money']) {
$this->record_logs("支付金额不一致".$data['out_trade_no'].":".$data['money']);return false;
}

@ -411,7 +411,7 @@ class AppleController extends BaseController{
$this->add_deposit($request);
}
$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_success2%2Forderno%2F".$request['pay_order_number'].'%2Fgame_id%2F'.$request['game_id'] ;
$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'.$request['game_id'] ;
}else{
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'支付失败')));exit;
}
@ -824,7 +824,10 @@ class AppleController extends BaseController{
$user_play_map['user_id'] = $request['user_id'];
$user_play_map['game_id'] = $request['game_id'];
$user_play_data = $user_play->where($user_play_map)->find();
$balance = $user->where(array('id' => $request['user_id']))->getField("balance");
if ($balance + $user_play_data['bind_balance'] < $request['price']) {
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'您金额不足,请退出重试.')));exit;
}
if ($user_play_data['bind_balance'] < $request['price']) {
$price = $request['price'];
if ($user_play_data['bind_balance'] > 0) {

Loading…
Cancel
Save