|
|
@ -294,7 +294,8 @@ class PayH5Controller extends BaseController{
|
|
|
|
$pay_url=$this->pay($request);
|
|
|
|
$pay_url=$this->pay($request);
|
|
|
|
$request['pay_url'] = $pay_url['url'];
|
|
|
|
$request['pay_url'] = $pay_url['url'];
|
|
|
|
$orderno = $pay_url['out_trade_no'];
|
|
|
|
$orderno = $pay_url['out_trade_no'];
|
|
|
|
// echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
|
|
|
|
// pp($request['pay_url']); todo: 又问提 死循环。。。
|
|
|
|
|
|
|
|
//echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
|
|
|
|
} else {/* app */
|
|
|
|
} else {/* app */
|
|
|
|
$game_set_data = get_game_set_info($request['game_id']);
|
|
|
|
$game_set_data = get_game_set_info($request['game_id']);
|
|
|
|
$request['apitype'] = "alipay";
|
|
|
|
$request['apitype'] = "alipay";
|
|
|
@ -302,19 +303,20 @@ class PayH5Controller extends BaseController{
|
|
|
|
$request['signtype'] = "MD5";
|
|
|
|
$request['signtype'] = "MD5";
|
|
|
|
$request['server'] = "mobile.securitypay.pay";
|
|
|
|
$request['server'] = "mobile.securitypay.pay";
|
|
|
|
$request['payway'] = 1;
|
|
|
|
$request['payway'] = 1;
|
|
|
|
file_put_contents(dirname(__FILE__) .'/alipay.txt',json_encode($request));
|
|
|
|
// file_put_contents(dirname(__FILE__) .'/alipay.txt',json_encode($request));
|
|
|
|
$data = $this->alipay_app_pay($request);
|
|
|
|
$data = $this->alipay_app_pay($request);
|
|
|
|
$md5_sign = $this->encrypt_md5(base64_encode($data['arg']), $game_set_data["access_key"]);
|
|
|
|
$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);
|
|
|
|
$data = array("orderInfo" => base64_encode($data['arg']), "out_trade_no" => $data['out_trade_no'], "order_sign" => $data['sign'], "md5_sign" => $md5_sign);
|
|
|
|
$request['pay_url'] = json_encode($data);
|
|
|
|
$request['pay_url'] = json_encode($data);
|
|
|
|
$orderno = $data['out_trade_no'];
|
|
|
|
$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 继续支付
|
|
|
|
// 存入pay_url 继续支付
|
|
|
|
M("spend", "tab_")->where([
|
|
|
|
M("spend", "tab_")->where([
|
|
|
|
'extend' => $request['extend'],
|
|
|
|
'extend' => $request['extend'],
|
|
|
|
'game_id' => $request['game_id'],
|
|
|
|
'game_id' => $request['game_id'],
|
|
|
|
'pay_order_number' => $pay_url['out_trade_no']
|
|
|
|
'pay_order_number' => $orderno
|
|
|
|
])->save([
|
|
|
|
])->save([
|
|
|
|
'pay_url' => $request['pay_url']
|
|
|
|
'pay_url' => $request['pay_url']
|
|
|
|
]);
|
|
|
|
]);
|
|
|
@ -402,14 +404,22 @@ class PayH5Controller extends BaseController{
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['msg'],'wap'=>1]]);exit;
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['msg'],'wap'=>1]]);exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* $url = U('spend/paycallback', array(
|
|
|
|
redirect(U('spend/paycallback', array(
|
|
|
|
'sdk_version' => $request['sdk_version'],
|
|
|
|
'sdk_version' => $request['sdk_version'],
|
|
|
|
|
|
|
|
'paytype' => 'alipay',
|
|
|
|
'paytype' => 'alipay',
|
|
|
|
'orderno' => $orderno,
|
|
|
|
'orderno' => $orderno,
|
|
|
|
'game_id' => $game_id,
|
|
|
|
'game_id' => $game_id,
|
|
|
|
'gopay' => 1 // 立即支付
|
|
|
|
'gopay' => 1 // 立即支付
|
|
|
|
)));
|
|
|
|
));
|
|
|
|
|
|
|
|
redirect($url); */
|
|
|
|
|
|
|
|
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 // 立即支付
|
|
|
|
|
|
|
|
))]);
|
|
|
|
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function alipay_app_pay($param = array())
|
|
|
|
private function alipay_app_pay($param = array())
|
|
|
|