|
|
|
@ -47,6 +47,7 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
$request['price'] = $price;
|
|
|
|
|
$request['pay_order_number'] = 'PF_'.date('Ymd').date('His').sp_random_string(4);
|
|
|
|
|
}
|
|
|
|
|
$price = round($price, 2);
|
|
|
|
|
if($price <= 0){
|
|
|
|
|
redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'充值金额有误', 'user_token' => $this->userToken)));exit;
|
|
|
|
|
}
|
|
|
|
@ -70,16 +71,18 @@ class PayH5Controller extends BaseController{
|
|
|
|
|
// redirect($pay_url['url']);
|
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit;
|
|
|
|
|
} else {/* app */
|
|
|
|
|
$game_set_data = get_game_set_info($request['game_id']);
|
|
|
|
|
$game_set_data = get_game_set_info(I('request.game_id'));
|
|
|
|
|
$request['apitype'] = "alipay";
|
|
|
|
|
$request['config'] = "alipay";
|
|
|
|
|
$request['signtype'] = "MD5";
|
|
|
|
|
$request['server'] = "mobile.securitypay.pay";
|
|
|
|
|
$request['payway'] = C("PAY_WAY.ALIPAY"); // 1 支付宝
|
|
|
|
|
file_put_contents(dirname(__FILE__) .'/alipay.txt',json_encode($request));
|
|
|
|
|
$request['title'] = "平台币充值"; //$request['price'];
|
|
|
|
|
$request['body'] = "平台币充值";
|
|
|
|
|
$data = $this->alipay_app_pay($request);
|
|
|
|
|
$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, "code" => 0);
|
|
|
|
|
|
|
|
|
|
echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>json_encode($data),'wap'=>0]]);exit;
|
|
|
|
|
}
|
|
|
|
|