From 8a5f8333356e173ee81832e2790b3455fd6c7722 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Thu, 17 Oct 2019 17:35:43 +0800 Subject: [PATCH] apple alipay --- .../Sdk/Controller/AppleController.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Application/Sdk/Controller/AppleController.class.php b/Application/Sdk/Controller/AppleController.class.php index 76b9bab76..d9a3a2d9c 100644 --- a/Application/Sdk/Controller/AppleController.class.php +++ b/Application/Sdk/Controller/AppleController.class.php @@ -9,6 +9,7 @@ use Org\GoldPig\GoldPig; use Org\SqpaySDK\Sqpay; use Org\HeepaySDK\Heepay; use Qiniu\json_decode; +use Think\Log; class AppleController extends BaseController{ @@ -88,18 +89,20 @@ class AppleController extends BaseController{ */ public function apple_alipay_pay($user_id,$game_id){ #获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组 + //echo json_encode(['code'=>0,'msg'=> $user_id."game:".$game_id]);exit; $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt"); $request = json_decode(think_decrypt($file),true); C(api('Config/lists')); - /*$request['user_id'] = 1; + /* + $request['user_id'] = 1; $request['game_id'] = 1; $request['price'] = 1.01; - $request['extend'] = 21111183; + $request['extend'] = 21111184; $request['pay_order_number'] = 21111183; $request['sdk_version'] = 2; $request['code'] =1; - */ +*/ if (empty($request)) { echo json_encode(['code'=>0,'msg'=>'登录数据不能为空']);exit; } @@ -125,7 +128,7 @@ class AppleController extends BaseController{ $this->other_price($request); if(get_zfb_type()==0){ // 支付宝官方 - if(C('alipay.way')==1 || ($request['is_create_ordernumer']==1 && C('alipay.way')==0)){/* wap */ + if(C('alipay.way')==1 || ($request['is_create_ordernumer']==1 && C('alipay.way')==0)){ /* wap */ $game_set_data = get_game_set_info($request['game_id']); $request['apitype'] = "alipay"; @@ -324,7 +327,8 @@ class AppleController extends BaseController{ ->setGameId($param['game_id']) ->setGameName(get_game_name($param['game_id'])) ->setGameAppid($param['game_appid']) - ->setServerId(0) + ->setServerId($param['server_id']) + ->setGameplayerId($param['game_player_id']) ->setCallback($param['callback']) ->setNotifyUrl($param['notifyurl']) ->setGameplayerName($param['game_player_name']) @@ -354,6 +358,7 @@ class AppleController extends BaseController{ { $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt"); $request = json_decode(think_decrypt($file),true); +// Log::write("wxpay:".serialize($request)); /*$request['user_id'] = 1; $request['game_id'] = 1; $request['price'] = 157.01;