|
|
|
@ -24,6 +24,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$this->error("用户未登入");
|
|
|
|
|
}
|
|
|
|
|
$request['user_id'] = $this->userId;
|
|
|
|
|
$game_id = I('request.game_id');
|
|
|
|
|
|
|
|
|
|
// 支付验证 是否让支付
|
|
|
|
|
$payCheck = pay_check($this->userId);
|
|
|
|
@ -67,9 +68,11 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
//$request['callback'] = 'http://'.$_SERVER['HTTP_HOST']. "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id'];
|
|
|
|
|
//$request['notifyurl'] = 'http://'.$_SERVER['HTTP_HOST']. "/callback.php/Notify/notify/apitype/alipay/method/notify";
|
|
|
|
|
$pay_url=$this->pay($request);
|
|
|
|
|
$request['pay_url'] = $pay_url['url'];
|
|
|
|
|
$orderno = $pay_url['out_trade_no'];
|
|
|
|
|
//echo $pay_url['url'];die;
|
|
|
|
|
// redirect($pay_url['url']);
|
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
|
|
|
|
|
// echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
|
|
|
|
|
} else {/* app */
|
|
|
|
|
$game_set_data = get_game_set_info(I('request.game_id'));
|
|
|
|
|
$request['apitype'] = "alipay";
|
|
|
|
@ -83,10 +86,21 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$md5_sign = $this->encrypt_md5(base64_encode($data['arg']), $game_set_data["access_key"]);
|
|
|
|
|
|
|
|
|
|
$data = array("orderInfo" => base64_encode($data['arg']), "out_trade_no" => $data['out_trade_no'], "order_sign" => $data['sign'], "md5_sign" => $md5_sign, "code" => 0);
|
|
|
|
|
$request['pay_url'] = json_encode($data);
|
|
|
|
|
$orderno = $data['out_trade_no'];
|
|
|
|
|
|
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>json_encode($data),'wap'=>0]]);exit;
|
|
|
|
|
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>json_encode($data),'wap'=>0]]);exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 存入pay_url 继续支付
|
|
|
|
|
M("deposit", "tab_")->where([
|
|
|
|
|
'extend' => $request['extend'],
|
|
|
|
|
'game_id' => $request['game_id'],
|
|
|
|
|
'pay_order_number' => $orderno
|
|
|
|
|
])->save([
|
|
|
|
|
'pay_url' => $request['pay_url']
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
}elseif(get_zfb_type() == 2) { // 双乾
|
|
|
|
|
|
|
|
|
|
$request['pay_way'] = C('PAY_WAY.SQ_ALIPAY');
|
|
|
|
@ -115,7 +129,18 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$ret = json_decode($ret, true);
|
|
|
|
|
$json_data['url']=$ret[0]['payURL'];
|
|
|
|
|
if($ret[0]['respCode'] == '000000'){
|
|
|
|
|
redirect($json_data['url']);
|
|
|
|
|
$json_data['url'] .= "?tx_client=hideopen";
|
|
|
|
|
// 存入pay_url 继续支付
|
|
|
|
|
M("deposit", "tab_")->where([
|
|
|
|
|
'extend' => $request['extend'],
|
|
|
|
|
'game_id' => $request['game_id'],
|
|
|
|
|
'pay_order_number' => $request["pay_order_number"]
|
|
|
|
|
])->save([
|
|
|
|
|
'pay_url' => $json_data['url']
|
|
|
|
|
]);
|
|
|
|
|
$orderno = $request['pay_order_number'];
|
|
|
|
|
|
|
|
|
|
//redirect($json_data['url']);
|
|
|
|
|
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$json_data['url'],'wap'=>1]]);
|
|
|
|
|
//exit;
|
|
|
|
|
} else {
|
|
|
|
@ -164,6 +189,15 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo json_encode(['code' => 200, 'url' => U('spend/paycallback', array(
|
|
|
|
|
'sdk_version' => $request['sdk_version'],
|
|
|
|
|
'paytype' => 'alipay',
|
|
|
|
|
'orderno' => $orderno,
|
|
|
|
|
'game_id' => $game_id,
|
|
|
|
|
'gopay' => 1, // 立即支付
|
|
|
|
|
'user_token' => $this->userToken,
|
|
|
|
|
))]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
*ios移动支付
|
|
|
|
@ -428,7 +462,8 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
'paytype' => 'alipay',
|
|
|
|
|
'orderno' => $orderno,
|
|
|
|
|
'game_id' => $game_id,
|
|
|
|
|
'gopay' => 1 // 立即支付
|
|
|
|
|
'gopay' => 1, // 立即支付
|
|
|
|
|
'tx_client' => 'tx_forbid_return', // android 返回键
|
|
|
|
|
))]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
@ -1341,7 +1376,9 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
|
|
|
|
|
'paytype' => 'weixinpay',
|
|
|
|
|
'orderno' => $request['pay_order_number'],
|
|
|
|
|
'game_id' => $game_id,
|
|
|
|
|
'gopay' => 1 // 立即支付
|
|
|
|
|
'gopay' => 1, // 立即支付
|
|
|
|
|
'user_token' => $this->userToken,
|
|
|
|
|
'tx_client' => 'tx_forbid_return', // android 返回键
|
|
|
|
|
))]);
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|