diff --git a/Application/Callback/Controller/NotifyController.class.php b/Application/Callback/Controller/NotifyController.class.php index b781407..3caae94 100644 --- a/Application/Callback/Controller/NotifyController.class.php +++ b/Application/Callback/Controller/NotifyController.class.php @@ -11,7 +11,6 @@ use Sdk\Controller\Ipa365Controller; use Base\Tool\Redis; use Org\Kudian\Response as KDResponse; use Org\Kudian\Log as KDLog; -use Org\OuterPay\Log as OuterPayLog; /** * 支付回调控制器 @@ -969,42 +968,4 @@ class NotifyController extends BaseController } echo 'SUCCESS'; } - - - /** - * 外部支付宝回调 - */ - public function out_alipay_callback() { - $params = file_get_contents('php://input'); - - OuterPayLog::write('NOTIFY_INPUT:' . file_get_contents('php://input')); - $params = json_decode($params, true); - - if ($params['trade_status'] != 'TRADE_SUCCESS' || $params['pay_status'] == 'TRADE_FINISHED') { - echo 'success'; - return; - } - - $orderInfo['trade_no'] = $params['trade_no']; - $orderInfo['out_trade_no'] = $params['out_trade_no']; - $orderInfo['money'] = $params['total_amount']; - - $payWhere = substr($params['out_trade_no'], 0, 2); - - switch ($payWhere) { - case 'SP': - $result = $this->set_spend($orderInfo); - break; - case 'PF': - $result = $this->set_deposit($orderInfo); - break; - case 'AG': - $result = $this->set_agent($orderInfo); - break; - default: - exit('accident order data'); - break; - } - echo 'success'; - } } \ No newline at end of file diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index d7576d5..c6f34ec 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -2015,18 +2015,6 @@ function get_payment_config($way=1, $game=0, $user_id=0, $pay_amount = 0, $skipO if (!$baseGameId) { return ['code' => -3, 'msg' => '找不到游戏ID'.$game['id'], 'data' => []]; } - - // $monthBegin = strtotime(date('Y-m-01 00:00:00')); - // $monthEnd = date('Y-m-d', strtotime(date('Y-m-01') . '+1 month -1 day')); - // $payAmountRow = M('spend','tab_')->field('SUM(pay_amount) as sum_amount')->where(array('pay_way'=>41, 'pay_real_status'=>1, 'payed_time' => ['gt', $monthBegin], 'payed_time' => ['lt', $monthEnd]))->find(); - // $payAmount = intval($payAmountRow['sum_amount']); - if (($pay_amount > 2000 && !$skipOuterPay && in_array($game['id'], [7, 8, 9, 10, 11, 12, 13, 14])) || in_array($user_id, [6, 186, 18925])) { - $ip = get_client_ip(); - $result = getIpInfo($ip); - if ($result['code'] == 200 && $result['success'] && $result['data']['city'] != '福州') { - return ['code' => 0, 'msg' => '', 'data' => ['id' => 3, 'channel' => 11, 'config' => '{}']]; - } - } $payment_rule = M('payment_rule', 'tab_')->where($map)->select(); $find_rule = false; diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php index a2ed61e..5d50401 100644 --- a/Application/Sdk/Controller/PayH5Controller.class.php +++ b/Application/Sdk/Controller/PayH5Controller.class.php @@ -15,7 +15,6 @@ use Sdk\Model\PayLimitConfModel; use Sdk\Model\PayChannelInterntionModel; use Sdk\Model\PayChannelIntentionModel; use Org\Kudian\Api as KDApi; -use Org\OuterPay\AlipayApi; class PayH5Controller extends BaseController{ const ALI_PAY = 1; @@ -227,32 +226,6 @@ class PayH5Controller extends BaseController{ } else { echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response->getMsg()}】,请选择其他支付方式或联系客服"]);exit; } - } elseif ($pay_info['channel'] == 11) { // 外部支付宝 - $request['pay_way'] = 41; - $request['pay_status'] = 0; - $request['spend_ip'] = get_client_ip(); - - $this->add_deposit($request, 1); - - $notifyUrl = C('PAY_DOMAIN')."/callback.php/Notify/kd_callback"; - $backUrl = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}"; - - $userInfo = get_user_entity($request['user_id']); - $response = AlipayApi::pay($request, $userInfo, $notifyUrl, $backUrl); - - if($response['code'] == '0000'){ - // 存入pay_url 继续支付 - M("deposit", "tab_")->where([ - 'extend' => $request['extend'], - 'game_id' => $request['game_id'], - 'pay_order_number' => $request["pay_order_number"] - ])->save([ - 'pay_url' => $response['data']['pay_url'] - ]); - $orderno = $request['pay_order_number']; - } else { - echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response['message']}】,请选择其他支付方式或联系客服"]);exit; - } } else{ // 支付宝第三方 if( empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))){ // $this->set_message(1009, "fail", "支付参数未配置"); @@ -615,44 +588,6 @@ class PayH5Controller extends BaseController{ } else { echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response->getMsg()}】,请选择其他支付方式或联系客服"]);exit; - // redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit; - } - } elseif ($pay_info['channel'] == 11) { // 外部支付宝 - $request['pay_way'] = 41; - $request['pay_status'] = 0; - $request['spend_ip'] = get_client_ip(); - $request['merchant_id'] = $pay_info['id']; - $request['merchant_way'] = 1; - $request['main_id'] = $main_id; - $userInfo = get_user_entity($request['user_id']); - $request['game_name'] = $request['game_name'] ?: get_game_name($request["game_id"]); - - $ordercheck = M("spend","tab_")->where(array('pay_order_number'=>$request["pay_order_number"]))->find(); - if ($ordercheck) { - $returl = U('Spend/notice',array('user_id'=>$ordercheck['user_id'],'game_id'=>$ordercheck['game_id'],'msg'=>'订单已经存在,请刷新充值页面重新下单!')); - echo json_encode(['code'=>0,'msg'=>'订单已经存在,请刷新充值页面重新下单!','wap'=>1]); - exit; - } - $this->add_spend($request,1); - - $notifyUrl = C('PAY_DOMAIN')."/callback.php/Notify/out_alipay_callback"; - $backUrl = C('PAY_DOMAIN')."sdk.php/Spend/paycallback/orderno/{$request['pay_order_number']}/user_token/".$this->userToken."/paytype/weixinpay/game_id/{$game_id}"; - $response = AlipayApi::pay($request, $userInfo, $notifyUrl, $backUrl); - - if($response['code'] == '0000'){ - // 存入pay_url 继续支付 - M("spend", "tab_")->where([ - 'extend' => $request['extend'], - 'game_id' => $request['game_id'], - 'pay_order_number' => $request["pay_order_number"] - ])->save([ - 'pay_url' => $response['data']['pay_url'] - ]); - $orderno = $request['pay_order_number']; - - } else { - echo json_encode(['code'=>1001,'msg'=> "请求发起失败【{$response['message']}】,请选择其他支付方式或联系客服"]);exit; - // redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$ret[0]['respMess'], 'user_token' => $this->userToken)));exit; } } else { // 支付宝第三方 diff --git a/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php b/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php deleted file mode 100644 index 206a342..0000000 --- a/ThinkPHP/Library/Org/OuterPay/AlipayApi.class.php +++ /dev/null @@ -1,65 +0,0 @@ -getMessage()); - return [ - 'code' => -999, - 'message' => '网络错误', - ]; - } - } - - - private static function post($url, $params): string - { - Log::write('REQUEST_URL: ' . json_encode($url)); - Log::write('REQUEST_DATA: ' . json_encode($params)); - $curl = curl_init(); - if (stripos($url, 'https://') !== false){ - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); - } - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_POST, true); - $headers = ['Content-type: application/json']; - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params)); - $response = curl_exec($curl); - curl_close($curl); - return $response; - var_dump(urldecode('https://openapi.alipay.com/gateway.do?app_id=2021004129619376&biz_content=%7B%22subject%22%3A%22%E6%B6%88%E8%B4%B9_SP_20231212143602pGYx%22%2C%22out_trade_no%22%3A%22SP_20231212143602pGYx%22%2C%22total_amount%22%3A%226E%2B00%22%2C%22product_code%22%3A%22%22%7D&charset=utf-8&format=JSON&method=alipay.trade.wap.pay¬ify_url=http%3A%2F%2Fpay.hexidongkeji.top%2Fnotify&return_url=http%3A%2F%2Fpay.hexidongkeji.top%2Freturn&sign=H44Ll1KLmiE8ogbypyHb1cw7kHTmefLgN6vOOcTS1yxSRMaKHIpdT8e%2F030Bok2bQQiueVXzymEVeMUFs5NS9bvc7m6%2FoyaWpmmIUwNuqYJDgx8hof6qFVEsifWEhRTBgPbzVU9NPuwzP84FTqsVtahfSEaPVkdIcaBao8RC7pgoXCwcNGCG4JK6J0ZQNgIwWdccpKWWmMlXVNaXCJoAdnYTb3VUucBL3o7osRShFP3Z8UTFBW1Uo1jQ2wIuF%2BREQwj3til3CWCU6PEvkIbq4NPRmMxy4sEJGWE8gdjV0Y5pSsXOp1xwq125YqS%2BcGufgtmx7P5%2FlKL99drZEy%2FC7Q%3D%3D&sign_type=RSA2×tamp=2023-12-12+14%3A36%3A03&version=1.0')); - } -} \ No newline at end of file diff --git a/ThinkPHP/Library/Org/OuterPay/Log.class.php b/ThinkPHP/Library/Org/OuterPay/Log.class.php deleted file mode 100644 index 1af71cc..0000000 --- a/ThinkPHP/Library/Org/OuterPay/Log.class.php +++ /dev/null @@ -1,12 +0,0 @@ -