|
|
|
@ -67,9 +67,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 +85,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 +128,17 @@ 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']
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
//redirect($json_data['url']);
|
|
|
|
|
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$json_data['url'],'wap'=>1]]);
|
|
|
|
|
//exit;
|
|
|
|
|
} else {
|
|
|
|
|