Parcourir la source

Merge commit '1feb5bb5468b6b93a663fdf7b53049aff980197b' into usweb

PPPPPPP il y a 1 mois
Parent
commit
8b462e7c87

+ 9 - 0
README.md

@@ -0,0 +1,9 @@
+https://你的落地域名/index.html?pxid=123456789012345&fbclid={{fbclid}}&ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}
+
+	•	页面会用 pxid 初始化 Pixel
+	•	点击按钮时:
+	•	上报 Lead
+	•	跳到:
+https://www.usslot777.com/?c=104&pxid=...&fbclid=...&ad_id=...&adset_id=...&campaign_id=...&pixel=pxid
+
+如果你想再加一些事件(比如 LandingView 后 3 秒自动上报一个 ViewContent,或者你后面接注册 / 充值页面的 Pixel 方案),我可以在这个基础上继续帮你扩展。

+ 1 - 1
app/Game/GlobalUserInfo.php

@@ -155,7 +155,7 @@ class GlobalUserInfo extends Model
         $data = false;
         if ($user) {
             $u = $user->toArray();
-            $existKey = ['UserID', 'GameID', 'GlobalUID','Email', 'Phone','DefaultLanguage', 'NickName', 'FaceID', 'Gender', 'RegisterDate', 'RegisterLocation', 'InsurePass', 'Level', 'Exp', 'UserRight','Channel','Registed'];
+            $existKey = ['UserID', 'GameID', 'GlobalUID','Email', 'Phone','DefaultLanguage', 'NickName', 'FaceID', 'Gender', 'RegisterDate', 'RegisterLocation', 'InsurePass', 'Level', 'Exp', 'UserRight','Channel'];
             $data = [];
             foreach ($existKey as $key) {
                 $data[$key] = $u[$key];

+ 1 - 1
app/Game/Services/AgentService.php

@@ -183,7 +183,7 @@ class AgentService
                 $GlobalUID='';
             }
         }
-        $h5link = env('H5_LINK', 'https://h5t.usgamewin.com/');
+        $h5link = env('H5_LINK', 'https://www.usslot777.com/');
         if($ActName=='WheelFree100') {
             $link = $h5link .'#/cashwheel?act='. self::encodeAct($GlobalUID, $ActName);
         }else{

+ 5 - 1
app/Http/Controllers/Admin/RechargeController.php

@@ -873,7 +873,11 @@ class RechargeController extends Controller
                 1 => 'cashapp',
                 2 => 'paypal',
                 4 => 'applepay',
-                8 => 'googlepay'
+                8 => 'googlepay',
+                64 => 'usdt-trc20',
+                128 => 'usdt-erc20',
+                256 => 'usdc-trc20',
+                512 => 'usdc-erc20'
             ];
             
             foreach ($payMethodsMap as $value => $name) {

+ 98 - 0
app/Http/Controllers/Api/CoinPayController.php

@@ -0,0 +1,98 @@
+<?php
+
+namespace App\Http\Controllers\Api;
+
+use App\Http\logic\api\CoinPayCashierLogic;
+use App\Http\logic\api\CoinPayLogic;
+use App\Inter\PayMentInterFace;
+use App\Notification\TelegramBot;
+use App\Services\CoinPay;
+use App\Util;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Redis;
+
+class CoinPayController implements PayMentInterFace
+{
+    private $retryTimes = 0;
+
+    public function pay_order($userId, $payAmt, $userName, $userEmail, $userPhone, $GiftsID, $buyIP, $AdId, $eventType, $pay_method = '')
+    {
+        $logic = new CoinPayLogic();
+
+        try {
+            $res = $logic->pay_order($userId, $payAmt, $userPhone, $userEmail, $userName, $GiftsID, $buyIP, $AdId, $eventType, $pay_method);
+        } catch (\Throwable $exception) {
+            Redis::set('PayErro_CoinPay', 1, 'EX', 600);
+            Util::WriteLog('CoinPay_error', $exception->getMessage());
+            TelegramBot::getDefault()->sendProgramNotify('CoinPay pay error', $exception->getMessage(), $exception);
+            return apiReturnFail($logic->getError());
+        }
+
+        if (isset($res['code']) && (int)$res['code'] === 0) {
+            $data = [
+                'content' => $res['data']['url'] ?? '',
+                'money' => $payAmt,
+                'prdOrdNo' => $res['data']['orderNo'] ?? '',
+            ];
+            return apiReturnSuc($data);
+        }
+
+        if ($res === false) {
+            return apiReturnFail($logic->getError());
+        }
+
+        if ($this->retryTimes > 0) {
+            Redis::set('PayErro_CoinPay', 1, 'EX', 600);
+            return apiReturnFail($logic->getError());
+        }
+
+        $this->retryTimes++;
+        return $this->pay_order($userId, $payAmt, $userName, $userEmail, $userPhone, $GiftsID, $buyIP, $AdId, $eventType, $pay_method);
+    }
+
+    public function notify(Request $request)
+    {
+        $post = $request->all();
+        Util::WriteLog('CoinPay', 'pay notify: ' . json_encode($post, JSON_UNESCAPED_UNICODE));
+
+        $service = new CoinPay();
+        if (!$service->verify($post)) {
+            Util::WriteLog('CoinPay', 'pay notify verify failed');
+            return 'fail';
+        }
+
+        $logic = new CoinPayLogic();
+        try {
+            return $logic->notify($post);
+        } catch (\Throwable $exception) {
+            Redis::set('PayErro_CoinPay', 1, 'EX', 600);
+            return '{"success":false,"message":"internal error"}';
+        }
+    }
+
+    public function sync_notify(Request $request)
+    {
+        Util::WriteLog('CoinPay', 'sync callback: ' . json_encode($request->all(), JSON_UNESCAPED_UNICODE));
+        return 'success';
+    }
+
+    public function cash_notify(Request $request)
+    {
+        $post = $request->all();
+        Util::WriteLog('CoinPay', 'cash notify: ' . json_encode($post, JSON_UNESCAPED_UNICODE));
+
+        $service = new CoinPay('CoinPayOut');
+        if (!$service->verify($post)) {
+            Util::WriteLog('CoinPay', 'cash notify verify failed');
+            return 'fail';
+        }
+
+        $logic = new CoinPayCashierLogic();
+        try {
+            return $logic->notify($post);
+        } catch (\Throwable $exception) {
+            return '{"success":false,"message":"internal error"}';
+        }
+    }
+}
+

+ 219 - 5
app/Http/Controllers/Game/LoginController.php

@@ -80,7 +80,7 @@ class LoginController extends Controller
         $verifyCode = GamePhoneVerityCode::verifyCode($Phone, $PhoneCode);
         SetNXLock::release($redisKey);
         //TODO 上线前去掉测试
-        if ($verifyCode != trim($PhoneCode)  && false) {
+        if ($verifyCode != trim($PhoneCode)) {
             Log::info('web.verify.code_incorrect_or_expired LoginByCode $verifyCode',[$Phone,$PhoneCode]);
             return apiReturnFail(['web.verify.code_incorrect_or_expired', 'O código está incorreto ou o tempo passou']);
         }
@@ -150,7 +150,7 @@ class LoginController extends Controller
         $verifyCode = GamePhoneVerityCode::verifyCode($Phone, $PhoneCode);
 
         //TODO 上线前去掉测试
-        if ($verifyCode != trim($PhoneCode) && false) {
+        if ($verifyCode != trim($PhoneCode)) {
             SetNXLock::release($redisKey);
             Log::info("web.verify.code_incorrect_or_expired BindPhone $verifyCode",[$Phone,$PhoneCode]);
             return apiReturnFail(['web.verify.code_incorrect_or_expired', 'O código está incorreto ou o tempo passou']);
@@ -790,7 +790,7 @@ class LoginController extends Controller
         return $Phone;
     }
 
-    public function createGuestAccounts(Request $request)
+    public function createGuestAccounts()
     {
 
         $accs=[];
@@ -808,8 +808,8 @@ class LoginController extends Controller
     {
         $acc=QuickAccountPass::whereNull('UserID')->first();
         if(!$acc){
-            $res=file_get_contents('http://euapi.24680.org/game/create_guest_accs');
-            $accs=json_decode($res,true)['accs'];
+            $res=$this->createGuestAccounts();
+            $accs=$res['accs'];
             if($accs){
                 QuickAccountPass::insert($accs);
             }
@@ -1058,6 +1058,7 @@ class LoginController extends Controller
                 'Exp'              => 0,
                 'FaceID'           => $user['FaceID'],
                 'NickName'         => $user['NickName'],
+                'Registed'         =>1,
                 //            'InsurePass' => Hash::make($request->insurePassword),
                 // Add other fields as needed
             ]);
@@ -1100,6 +1101,219 @@ class LoginController extends Controller
         return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
     }
 
+
+    public function registerUserNew(Request $request, $regByGuest = true)
+    {
+        //type=id,phone,sms,mail,guest
+        $type=$request->input('type',"id");
+        $FPID = $request->input("bfp", "");
+
+        if (empty($FPID)) {
+            return apiReturnFail(['web.reg.fail_phone_exist', 'O número de telefone já existe, altere-o e tente se cadastrar novamente!']);
+        }
+
+        $guestUser=GlobalUserInfo::where('FPID',$FPID)->first();
+        if($guestUser){
+            //存在,直接返回去
+            return $this->guestLogin($guestUser);
+        }
+
+//        $guser = GlobalUserInfo::toWebData($guestUser,true);
+
+
+//        return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
+
+
+        $login_ip = IpLocation::getRealIp();
+        $RegisterLocation = $request->country ?? env('COUNTRY_CODE',1);
+        $ServerRegion = env('REGION_24680','sa-east');
+        $Language = $request->lang ?? $request->getLocale();
+//        $Phone = $request->phone ?? "";
+//
+//        $Phone = $this->checkPhone($Phone, $RegisterLocation,$request);
+//        //有错误返回
+//        if (is_array($Phone)) {
+//            return $Phone;
+//        }else if(is_object($Phone)&&isset($Phone->GlobalUID)){
+//            //原来就存在,直接返回
+//            $guser = GlobalUserInfo::toWebData($Phone,true);
+//            $guser['reg'] = 1;
+//            return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));
+//        }
+
+//        if (isset($request->email) && strstr($request->email, '@')) {
+//            $isExist = GlobalUserInfo::query()->where("Email", $request->email)->exists();
+//            //账户查重
+//            if ($isExist) {
+//                return apiReturnFail(['web.reg.fail_email_exist', 'O e-mail já existe, altere-o e tente se cadastrar novamente!']);
+//            }
+//        }
+
+
+        $redisKey = 'register_' . $FPID;
+        if (!SetNXLock::getExclusiveLock($redisKey)) {
+            return apiReturnFail(['web.withdraw.try_again_later', 'Tente novamente mais tarde']);
+        }
+
+        $Channel = 0;
+
+        //保持邀请和被邀请的渠道序列统一
+        $ActCode = $request->input('act');
+        if(strstr($ActCode,'http')){
+            $ActCode=explode('http',$ActCode)[0];
+        }
+        $Package = 'com.uswin.game777';
+        $ReferrType = 0;
+        if ($ActCode) {
+            //使用邀请的Code来保持邀请被邀请的用户注册渠道一致性
+            $link = AgentLinks::getByCode($ActCode);
+            if ($link) {
+                $inviter = AccountsInfo::where('UserID', $link->UserID)->first();
+                if($inviter&&is_object($inviter)) {
+                    $Channel = $inviter->Channel;
+                    $ReferrType = 2;
+                }
+            }
+        }
+        if(!$Channel){
+
+            //获取默认配置
+            $config = RouteService::getChannelConfig($request);
+            //非游客注册
+//            while($config->isGuestOpen()&&!$regByGuest){
+//                RouteService::clearChannelConfig();
+//                $config = RouteService::getChannelConfig($request);
+//            }
+
+            $Channel = $config->Channel;
+            if($Channel!=env('REGION_24680_DEFAULT_CHANNEL',100))$ReferrType = 1;
+
+        }else{
+
+            //先搜索本地配置
+            $config = WebChannelConfig::getByChannel($Channel);
+
+        }
+        $Package = $config->PackageName;
+
+        if ($config) {
+            //每小时对齐两个表的包名
+            if(!Redis::exists('ChannelPackageName'.$Channel)) {
+                $pack = DB::table('QPPlatformDB.dbo.ChannelPackageName')->where('Channel', $Channel)->select('PackageName')->first();
+                if ($pack) {
+                    Redis::setex('ChannelPackageName' . $Channel, 3600, $Package);
+                    if ($Package != $pack->PackageName) {
+                        DB::table('QPPlatformDB.dbo.ChannelPackageName')->where('Channel', $Channel)->update(['PackageName' => $Package]);
+                    }
+                }
+            }
+        }
+        $account= $request->account??$request->email ?? $request->phone ?? $FPID;
+
+        //注册到游戏服务器
+        $user = $this->registerAccountInfo($request, $Package, $Channel,$account);
+
+        //返回错误
+        if (is_array($user) && !isset($user['UserID'])) {
+            SetNXLock::release($redisKey);
+            return $user;
+        }
+        if (!$user) {
+            SetNXLock::release($redisKey);
+            return apiReturnFail(['web.withdraw.try_again_later', 'Pausa de login']);
+        }
+        //代理注册,保留号段10000-100000
+
+        $UserID = $user['UserID'];
+        $GameID = $user['GameID'];
+
+
+        $password=$request->password;
+
+        $globalUserInfo = GlobalUserInfo::getGameUserInfo('UserID', $UserID);
+        if ($globalUserInfo) {
+            $GlobalUID = $globalUserInfo->GlobalUID;
+        } else {
+
+//            if($type=='guest'){
+//                //改成从中心区获取idpass
+//                $idps=$this->getGustAccount($UserID);
+//                $account=$idps['account'];
+//                $password=$idps['password'];
+//            }
+
+            $GlobalUID = $this->generateUUID($UserID, $RegisterLocation, $ServerRegion,$Channel??99);
+            $ShortHashID = explode('-', $GlobalUID)[0];
+            //先搞定userid
+            $globalUserInfo = new GlobalUserInfo([
+                'UserID'           => $UserID,
+                'GameID'           => $GameID,
+                'FPID'             => $FPID,
+                'LastFPID'         => $FPID,
+                'ShortHashID'      => $ShortHashID,
+                'GlobalUID'        => $GlobalUID,
+                'Accounts'         => $account, // Assuming email is received from request
+                'Email'            => $request->email ?? '', // Assuming email is received from request
+                'Phone'            => '', // Assuming email is received from request
+                'LogonPass'        => Hash::make($password),
+                'LogonIP'          => $login_ip,
+                'Gender'           => 1,
+                'RegisterIP'       => $login_ip,
+                'RegisterLocation' => $RegisterLocation,
+                'ServerRegion'     => $ServerRegion,
+                'DefaultLanguage'  => $Language,
+                'Channel'          => $Channel??99,
+                'ReferrType'       => $ReferrType,
+                'RegisterDate'     => date('Y-m-d H:i:s'),
+                'InsurePass'       => '',
+                'UserRight'        => 0,
+                'Level'            => 0,
+                'Exp'              => 0,
+                'FaceID'           => $user['FaceID'],
+                'NickName'         => $user['NickName'],
+                'Registed'         =>1,
+                //            'InsurePass' => Hash::make($request->insurePassword),
+                // Add other fields as needed
+            ]);
+            try {
+                $globalUserInfo->save();
+            } catch (\Exception $exception) {
+                Log::error($exception->getMessage());
+
+            }
+        }
+        GlobalUserInfo::$me=$globalUserInfo;
+        if($Channel==env('REGION_24680_DEFAULT_CHANNEL',100)){
+            Util::WriteLog('c99',json_encode($_SERVER));
+        }
+        //注册钱数要归0
+//        $newRegGolds=$config->isRegZeroMoneyOpen()?0:$config->BONUS_REG();
+//        GameScoreInfo::query()->where('UserID', $UserID)->update(['Score'=>$newRegGolds]);
+
+        $agentUser = AgentService::SetUserAgent($GlobalUID, $UserID, $ActCode);
+        SetNXLock::release($redisKey);
+
+//        if ($regByGuest) {
+//            return GlobalUserInfo::getGameUserInfo("UserID", $UserID);
+//        }
+
+        $guser = GlobalUserInfo::toWebData($globalUserInfo,true);
+
+//        if($agentUser->Higher1ID){
+//            //获取邀请者信息
+//            $inviter=AccountsInfo::where('UserID',$agentUser->Higher1ID)->first();
+//        }
+        $guser['reg'] = 1;
+//
+//        if($type=='guest'){
+//            $guser['account'] = $account;
+//            $guser['password'] = $password;
+//        }
+
+        Util::WriteLog('register_params',$request);
+        return response()->json(apiReturnSuc($guser, ['reg.success', 'Registro realizado com sucesso!']));//->withCookie($this->setLoginCookie($guser['sign']));
+    }
+
     public function registerAccountInfo(Request $request, $PackageName = 'com.uswin.game777', $Channel = 0,$account=null)
     {
         if (empty($Channel) || !$Channel) $Channel = env('REGION_24680_DEFAULT_CHANNEL',100);

+ 11 - 1
app/Http/Controllers/Game/PayRechargeController.php

@@ -11,6 +11,7 @@ use App\Http\helper\NumConfig;
 use App\Models\Order;
 use App\Services\OrderServices;
 use App\Utility\SetNXLock;
+use App\Util;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Redis;
@@ -85,7 +86,7 @@ class PayRechargeController extends Controller
 
 
 
-        $gear=\GuzzleHttp\json_encode($names);
+        $gear = Util::filterGearByDevice(\GuzzleHttp\json_encode($names));
         foreach ($list as &$val) {
             $val->favorable_price = $val->favorable_price + $val->give;
             $val->gear = $gear;
@@ -136,6 +137,9 @@ class PayRechargeController extends Controller
                 if ($val->money == $giftConfig->recommend) {
                     $val->recommend = 1;
                 }
+                if (!empty($val->gear)) {
+                    $val->gear = Util::filterGearByDevice($val->gear);
+                }
             }
             
             // ========== 处理倒计时逻辑(仅未购买时) ==========
@@ -654,6 +658,9 @@ class PayRechargeController extends Controller
             if ($val->money == $firstPayGift->recommend) {
                 $val->recommend = 1;
             }
+            if (!empty($val->gear)) {
+                $val->gear = Util::filterGearByDevice($val->gear);
+            }
         }
 
         return apiReturnSuc([
@@ -737,6 +744,9 @@ class PayRechargeController extends Controller
                 $gear->gift_id = $gift->gift_id;
                 $gear->total_bonus = $gift->total_bonus;
                 $gear->bonus = $gift->total_bonus - 100;
+                if (!empty($gear->gear)) {
+                    $gear->gear = Util::filterGearByDevice($gear->gear);
+                }
                 $result[] = $gear;
             }
         }

+ 5 - 5
app/Http/Controllers/Game/PaymentEntryController.php

@@ -48,13 +48,13 @@ class PaymentEntryController {
         if ($query === null || $query === false) {
             return apiReturnFail(['web.payment.paytype_error','PayType ERROR']);
         }
-        $channel = $request->globalUser->Channel;
-        $payServiceString = PayMentService::getServiceByPayMethod($query, $payAmt,$pay_method);
+        if($pay_method>=64){
+            $payServiceString = 'CoinPay';
+        }else{
+            $payServiceString = PayMentService::getServiceByPayMethod($query, $payAmt,$pay_method);
+        }
 
 
-        Log::info('channel', [
-            'string' => $payServiceString
-        ]);
         $service = PayMentService::pay_order($payServiceString);
 
         if(isset($AdId)&&!empty($AdId))Redis::set('user_ad_'.$userId,$AdId);

+ 6 - 0
app/Http/Controllers/Game/RechargeController.php

@@ -35,6 +35,12 @@ class RechargeController
             ->select('id','money','favorable_price','give','recommend','gear')
             ->orderBy('money', 'asc')->where('status', 1)->get();
 
+        foreach ($list as $item) {
+            if (!empty($item->gear)) {
+                $item->gear = Util::filterGearByDevice($item->gear);
+            }
+        }
+
         return apiReturnSuc(['list'=>$list,'bonus_show'=>false]);
     }
 

+ 17 - 13
app/Http/Controllers/Game/WebRouteController.php

@@ -113,20 +113,24 @@ class WebRouteController extends Controller
         }else if($guestOpen){
             //游客模式打开,随时可以登录
             $guestUser=GlobalUserInfo::getGameUserInfo('FPID',$FPID);
-            if(!$guestUser){
-//                $guestUser = GlobalUserInfo::getGameUserInfo('FPID', $FPID);
-//                if (!$guestUser) {
-                    $guestUser=(new LoginController())->registerUser($request,true);
-                    if(is_array($guestUser)){
-                        //出现错误
-                    }else{
-                        $user=GlobalUserInfo::toWebData($guestUser);
-//                        $user['Registed'] = 0;
-                    }
-//                }
-            }else{
+            if($guestUser)
                 $user=GlobalUserInfo::toWebData($guestUser);
-            }
+
+
+//            if(!$guestUser){
+////                $guestUser = GlobalUserInfo::getGameUserInfo('FPID', $FPID);
+////                if (!$guestUser) {
+//                    $guestUser=(new LoginController())->registerUser($request,true);
+//                    if(is_array($guestUser)){
+//                        //出现错误
+//                    }else{
+//                        $user=GlobalUserInfo::toWebData($guestUser);
+////                        $user['Registed'] = 0;
+//                    }
+////                }
+//            }else{
+//                $user=GlobalUserInfo::toWebData($guestUser);
+//            }
 
         }
         // 计算VIP等级

+ 10 - 2
app/Http/logic/admin/RechargeLogic.php

@@ -134,7 +134,11 @@ class RechargeLogic extends BaseApiLogic
             'cashapp' => 'CashApp',
             'paypal' => 'PayPal',
             'applepay' => 'ApplePay',
-            'googlepay' => 'GooglePay'
+            'googlepay' => 'GooglePay',
+            'usdt-trc20' => 'USDT-TRC20',
+            'usdt-erc20' => 'USDT-ERC20',
+            'usdc-trc20' => 'USDC-TRC20',
+            'usdc-erc20' => 'USDC-ERC20'
         ];
         
         foreach ($list as &$value) {
@@ -266,7 +270,11 @@ class RechargeLogic extends BaseApiLogic
             1 => 'cashapp',
             2 => 'paypal',
             4 => 'applepay',
-            8 => 'googlepay'
+            8 => 'googlepay',
+            64 => 'usdt-trc20',
+            128 => 'usdt-erc20',
+            256 => 'usdc-trc20',
+            512 => 'usdc-erc20'
         ];
         
         foreach ($payMethodsMap as $value => $name) {

+ 192 - 0
app/Http/logic/api/CoinPayCashierLogic.php

@@ -0,0 +1,192 @@
+<?php
+
+namespace App\Http\logic\api;
+
+use App\dao\Estatisticas\RechargeWithDraw;
+use App\Inter\CashierInterFace;
+use App\Models\PrivateMail;
+use App\Models\RecordUserDataStatistics;
+use App\Services\CoinPay;
+use App\Services\StoredProcedure;
+use App\Util;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
+use Illuminate\Support\Facades\Redis;
+
+class CoinPayCashierLogic implements CashierInterFace
+{
+    const AGENT = 102;
+
+    public function payment($RecordID, $amount, $accountName, $phone, $email, $OrderId, $PixNum, $PixType, $IFSCNumber, $BranchBank, $BankNO)
+    {
+        $query = DB::connection('write')->table('QPAccountsDB.dbo.OrderWithDraw')->where('RecordID', $RecordID)->first();
+        if (!$query) {
+            return 'fail';
+        }
+
+        $service = new CoinPay('CoinPayOut');
+        $config = $service->getConfig();
+
+        $withdrawInfo = DB::table('QPAccountsDB.dbo.AccountWithDrawInfo')->where('UserID', $query->UserID)->first();
+        $address = $PixNum ?: ($withdrawInfo->PixNum ?? $withdrawInfo->BankNO ?? $BankNO);
+        if (!$address) {
+            Util::WriteLog('CoinPay', 'missing wallet address for withdraw: ' . $OrderId);
+            return 'fail';
+        }
+
+        $language = strtoupper($config['language'] ?? 'EN');
+        $coin = strtoupper($config['coin'] ?? 'USDT');
+        $protocol = strtoupper($config['protocol'] ?? 'TRC20');
+        $rateType = (int)($config['rateType'] ?? 2);
+        $currency = strtoupper($config['currency'] ?? 'USD');
+
+        $amountDecimal = number_format($amount / 100, 2, '.', '');
+
+        $params = [
+            'merchantMemberNo' => (string)$query->UserID,
+            'merchantOrderNo' => $OrderId,
+            'language' => $language,
+            'coin' => $coin,
+            'rateType' => $rateType,
+            'protocol' => $protocol,
+            'notifyUrl' => $config['cashNotify'] ?? '',
+            'toAddress' => $address,
+            'timestamp' => time(),
+        ];
+
+        if ($rateType === 1) {
+            $params['amount'] = number_format($amountDecimal, 8, '.', '');
+            $params['rate'] = $config['rate'] ?? '1';
+        } else {
+            $params['currencyAmount'] = $amountDecimal;
+            $params['currency'] = $currency;
+        }
+
+        $signedParams = $service->sign($params);
+        $response = $service->post('/order/withdrawOrderCoinCreate', $signedParams);
+
+        Log::info('CoinPay withdraw request', $signedParams);
+        Log::info('CoinPay withdraw response', [$response]);
+
+        try {
+            $data = \GuzzleHttp\json_decode($response, true);
+        } catch (\Throwable $e) {
+            Util::WriteLog('CoinPay_error', $e->getMessage());
+            return 'fail';
+        }
+
+        if (isset($data['code']) && (int)$data['code'] === 0) {
+            return $data;
+        }
+
+        return 'fail';
+    }
+
+    public function notify($post)
+    {
+        if (!is_array($post)) {
+            $post = \GuzzleHttp\json_decode($post, true);
+        }
+
+        Util::WriteLog('CoinPay', 'withdraw notify: ' . json_encode($post, JSON_UNESCAPED_UNICODE));
+
+        $OrderId = $post['merchantOrderNo'] ?? '';
+        $query = DB::connection('write')->table('QPAccountsDB.dbo.OrderWithDraw')->where('OrderId', $OrderId)->first();
+        if (!$query) {
+            Util::WriteLog('CoinPay', 'withdraw order not found');
+            return '{"success":true,"message":"order not found"}';
+        }
+
+        if (!in_array($query->State, [5, 7])) {
+            Util::WriteLog('CoinPay', 'withdraw already handled: ' . $OrderId);
+            return 'SUCCESS';
+        }
+
+        $status = (int)($post['state'] ?? 0);
+        $now = now();
+        $withdraw_data = [];
+        $msg = $post['msg'] ?? '';
+
+        $TakeMoney = $query->WithDraw + $query->ServiceFee;
+        $UserID = $query->UserID;
+
+        switch ($status) {
+            case 3:
+                $withdraw_data = [
+                    'State' => 2,
+                    'agent' => self::AGENT,
+                    'finishDate' => $now,
+                ];
+                $this->handleSuccess($UserID, $TakeMoney, $OrderId, $query->ServiceFee);
+                break;
+
+            case 4:
+            case 5:
+            case 6:
+            case 7:
+                $msg = $msg ?: 'Withdraw rejected';
+                $bonus = '30000,' . $TakeMoney;
+                PrivateMail::failMail($UserID, $OrderId, $TakeMoney, $msg, $bonus);
+
+                $withdraw_data = [
+                    'State' => 6,
+                    'agent' => self::AGENT,
+                    'remark' => $msg,
+                ];
+                break;
+
+            default:
+                return 'SUCCESS';
+        }
+
+        $recordData = [
+            'before_state' => $query->State,
+            'after_state' => $withdraw_data['State'] ?? $query->State,
+            'RecordID' => $query->RecordID,
+            'update_at' => date('Y-m-d H:i:s'),
+        ];
+
+        DB::connection('write')->table('QPAccountsDB.dbo.AccountsRecord')
+            ->updateOrInsert(['RecordID' => $query->RecordID, 'type' => 1], $recordData);
+        DB::connection('write')->table('QPAccountsDB.dbo.OrderWithDraw')
+            ->where('OrderId', $OrderId)
+            ->update($withdraw_data);
+
+        return 'SUCCESS';
+    }
+
+    protected function handleSuccess($UserID, $TakeMoney, $OrderId, $serviceFee): void
+    {
+        $first = DB::connection('write')->table('QPAccountsDB.dbo.UserTabData')->where('UserID', $UserID)->first();
+        if ($first) {
+            DB::connection('write')->table('QPAccountsDB.dbo.UserTabData')->where('UserID', $UserID)->increment('TakeMoney', $TakeMoney);
+        } else {
+            DB::connection('write')->table('QPAccountsDB.dbo.UserTabData')->insert(['TakeMoney' => $TakeMoney, 'UserID' => $UserID]);
+            try {
+                PrivateMail::praiseSendMail($UserID);
+            } catch (\Throwable $e) {
+            }
+        }
+
+        try {
+            StoredProcedure::addPlatformData($UserID, 4, $TakeMoney);
+        } catch (\Throwable $exception) {
+            Util::WriteLog('StoredProcedure', $exception->getMessage());
+        }
+
+        $withdrawal_position_log = DB::connection('write')->table('agent.dbo.withdrawal_position_log')->where('order_sn', $OrderId)->first();
+        if ($withdrawal_position_log) {
+            DB::connection('write')->table('agent.dbo.withdrawal_position_log')
+                ->where('order_sn', $OrderId)
+                ->update(['take_effect' => 2, 'update_at' => date('Y-m-d H:i:s')]);
+        }
+
+        RecordUserDataStatistics::updateOrAdd($UserID, $TakeMoney, 0, $serviceFee);
+        (new RechargeWithDraw())->withDraw($UserID, $TakeMoney);
+        $redis = Redis::connection();
+        $redis->incr('draw_' . date('Ymd') . $UserID);
+
+        StoredProcedure::user_label($UserID, 2, $TakeMoney);
+    }
+}
+

+ 193 - 0
app/Http/logic/api/CoinPayLogic.php

@@ -0,0 +1,193 @@
+<?php
+
+namespace App\Http\logic\api;
+
+use App\dao\Pay\AccountPayInfo;
+use App\dao\Pay\PayController;
+use App\Http\helper\CreateOrder;
+use App\Http\helper\NumConfig;
+use App\Jobs\Order as OrderJob;
+use App\Notification\TelegramBot;
+use App\Services\CoinPay;
+use App\Services\OrderServices;
+use App\Services\PayConfig;
+use App\Services\CreateLog;
+use App\Util;
+use Illuminate\Support\Facades\DB;
+
+class CoinPayLogic extends BaseApiLogic
+{
+    public function pay_order($userId, $pay_amount, $userPhone, $userEmail, $userName, $GiftsID, $buyIP, $AdId, $eventType, $pay_method = '')
+    {
+        $dao = new AccountPayInfo();
+        [$userPhone, $userName, $userEmail] = $dao->payInfo($userId);
+
+        $PayVerify = new PayController();
+        if ($PayVerify->verify($userId, $GiftsID, $pay_amount) === false) {
+            $this->error = $PayVerify->getError();
+            return false;
+        }
+        if ($pay_amount < 0) {
+            $this->error = 'Payment error_4';
+            return false;
+        }
+
+        $service = new CoinPay();
+        $config = $service->getConfig();
+
+        $order_sn = CreateOrder::order_sn($userId);
+        $orderLogic = new OrderLogic();
+        $amountInt = (int) round($pay_amount * NumConfig::NUM_VALUE);
+        $orderLogic->orderCreate($order_sn, $amountInt, 'CoinPay', $userId, $pay_method, $GiftsID, $AdId, $eventType);
+
+        $language = strtoupper($config['language'] ?? 'en');
+        $coin = strtoupper($config['coin'] ?? 'USDT');
+        $protocol = strtoupper($config['protocol'] ?? 'TRC20');
+        $rateType = (int)($config['rateType'] ?? 2);
+        $currency = strtoupper($config['currency'] ?? 'USD');
+
+        $coinbase = [
+            64 => [
+                'coin' => 'USDT',
+                'protocol' => 'TRC20',
+            ],
+            128 =>[
+                'coin' => 'USDT',
+                'protocol' => 'ERC20',
+            ],
+            256 => [
+                'coin' => 'USDC',
+                'protocol' => 'TRC20',
+            ],
+            512 =>[
+                'coin' => 'USDC',
+                'protocol' => 'ERC20',
+            ]
+        ];
+
+        $select = $coinbase[$pay_method] ?? $coinbase[64];
+
+        $params = [
+            'merchantMemberNo' => (string)$userId,
+            'merchantOrderNo' => $order_sn,
+//            'amount' => $pay_amount,
+            'language' => $language,
+            'coin' => $select['coin'],
+            'rateType' => $rateType,
+            'protocol' => $select['protocol'],
+            'notifyUrl' => $config['notify'] ?? '',
+            'timestamp' => time(),
+        ];
+
+        if ($rateType === 1) {
+            $params['amount'] = number_format($pay_amount, 8, '.', '');
+            $params['rate'] = $config['rate'] ?? '1';
+        } else {
+            $params['currencyAmount'] = number_format($pay_amount, 2, '.', '');
+            $params['currency'] = $currency;
+        }
+
+        if (!empty($config['extra'])) {
+            $params = array_merge($params, $config['extra']);
+        }
+
+        $signedParams = $service->sign($params);
+        CreateLog::pay_request($userPhone, json_encode($signedParams), $order_sn, $userEmail, $userId, $userName);
+
+        $response = $service->post('/order/depositOrderCoinCreate', $signedParams);
+        Util::WriteLog('CoinPay', 'pay request => ' . json_encode($signedParams, JSON_UNESCAPED_UNICODE));
+        Util::WriteLog('CoinPay', 'pay response => ' . $response);
+
+        try {
+            $data = \GuzzleHttp\json_decode($response, true);
+        } catch (\Throwable $e) {
+            Util::WriteLog('CoinPay_error', $e->getMessage());
+            $this->error = 'Payment processing error';
+            return false;
+        }
+
+        if (!isset($data['code']) || (int)$data['code'] !== 0) {
+            $this->error = $data['msg'] ?? 'Payment request failed';
+        }
+
+        return $data;
+    }
+
+    public function notify(array $post)
+    {
+        $order_sn = $post['merchantOrderNo'] ?? '';
+        if (!$order_sn) {
+            return '{"success":false,"message":"missing order"}';
+        }
+
+        $order = DB::connection('write')->table('agent.dbo.order')->where('order_sn', $order_sn)->first();
+        if (!$order) {
+            Util::WriteLog('CoinPay', 'order not found: ' . $order_sn);
+            return '{"success":false,"message":"order not found"}';
+        }
+
+        if (!empty($order->pay_at) && !empty($order->finished_at)) {
+            return 'SUCCESS';
+        }
+
+        $status = (int)($post['state'] ?? 0);
+        $payAmt = (float)($post['currencyAmount'] ?? $post['amount'] ?? 0);
+
+        $body = [
+            'payment_sn' => $post['orderNo'] ?? '',
+            'updated_at' => date('Y-m-d H:i:s'),
+        ];
+
+        $GiftsID = $order->GiftsID ?: '';
+        $userID = $order->user_id ?: '';
+        $AdId = $order->AdId ?: '';
+        $eventType = $order->eventType ?: '';
+
+        switch ($status) {
+            case 3:
+                $body['pay_status'] = 1;
+                $body['pay_at'] = date('Y-m-d H:i:s');
+                $body['finished_at'] = date('Y-m-d H:i:s');
+                $body['amount'] = (int) round($payAmt * NumConfig::NUM_VALUE);
+
+                $config = (new PayConfig())->getConfig('CoinPay');
+                if (!empty($config['payin_fee'])) {
+                    $body['payment_fee'] = $body['amount'] * (float)$config['payin_fee'];
+                }
+
+                try {
+                    $service = new OrderServices();
+                    if ((int)$order->amount !== $body['amount']) {
+                        $body['GiftsID'] = 0;
+                        $Recharge = $payAmt;
+                        $give = 0;
+                        $favorable_price = $Recharge;
+                        $czReason = 1;
+                        $cjReason = 45;
+                    } else {
+                        [$give, $favorable_price, $Recharge, $czReason, $cjReason] = $service->getPayInfo($GiftsID, $userID, $payAmt);
+                    }
+
+                    [$Score] = $service->addRecord($userID, $payAmt, $favorable_price, $order_sn, $GiftsID, $Recharge, $czReason, $give, $cjReason, $AdId, $eventType);
+                    OrderJob::dispatch([$userID, $payAmt, $Score, $favorable_price, $GiftsID, $order_sn]);
+                } catch (\Throwable $exception) {
+                    Util::WriteLog('CoinPay_error', $exception->getMessage());
+                    TelegramBot::getDefault()->sendProgramNotify('CoinPay notify error', $exception->getMessage(), $exception);
+                }
+                break;
+
+            case 4:
+            case 5:
+                $body['pay_status'] = 2;
+                break;
+
+            default:
+                return 'fail';
+        }
+
+        DB::connection('write')->table('agent.dbo.order')->where('order_sn', $order_sn)->update($body);
+
+        return 'SUCCESS';
+    }
+}
+

+ 1 - 1
app/Http/logic/api/OrderLogic.php

@@ -93,7 +93,7 @@ class OrderLogic extends BaseApiLogic
             'user_id' => $userID,
             'order_sn' => $order_sn,
             'amount' => $amount,
-            'order_title' => empty($order_title) ? '用户充值' : $order_title,
+            'order_title' => empty($order_title) ? '1' : $order_title,
             'payment_code' => $payment_code,
             'payment_name' => '创建收款单',
             'remarks' => 'pay_order',

+ 1 - 1
app/Http/logic/api/WDPayLogic.php

@@ -45,7 +45,7 @@ class WDPayLogic extends BaseApiLogic
         // 生成订单信息(WDPay使用元,但数据库存储还是用分)
         $logic = new OrderLogic();
         $amount = (int) round($pay_amount * NumConfig::NUM_VALUE);
-        $logic->orderCreate($order_sn, $amount, 'WDPay', $userId, '', $GiftsID, $AdId, $eventType);
+        $logic->orderCreate($order_sn, $amount, 'WDPay', $userId, $pay_method, $GiftsID, $AdId, $eventType);
 
         $payMethods = [
             1 => 'cashapp',

+ 1 - 1
app/Http/logic/api/WiwiPayLogic.php

@@ -47,7 +47,7 @@ class WiwiPayLogic extends BaseApiLogic
         // 生成订单信息
         $logic = new OrderLogic();
         $amount = (int) round($pay_amount * NumConfig::NUM_VALUE) ;
-        $logic->orderCreate($order_sn, $amount, 'WiwiPay', $userId, '', $GiftsID, $AdId, $eventType);
+        $logic->orderCreate($order_sn, $amount, 'WiwiPay', $userId, $pay_method, $GiftsID, $AdId, $eventType);
 
         $payMethods = [
             1 => 'cashapp',

+ 5 - 3
app/Models/GamePhoneVerityCode.php

@@ -95,9 +95,11 @@ class GamePhoneVerityCode extends Model
             }
 
             // 验证码过期
-            if (time() - strtotime($first->CreateDate) > 600) {
-                return 3;
-            }
+//            if (time() - strtotime($first->CreateDate) > 600) {
+//                return 3;
+//            }
+
+            \Log::info('timeCheck',[time(),date('Y-m-d H:i:s'),strtotime(date('Y-m-d H:i:s')),'ssstime',$first->CreateDate,strtotime($first->CreateDate)]);
 
             return $first->Code;
         }

+ 4 - 0
app/Services/CashService.php

@@ -5,6 +5,7 @@ namespace App\Services;
 
 use App\Http\logic\api\WiwiPayCashierLogic;
 use App\Http\logic\api\WDPayCashierLogic;
+use App\Http\logic\api\CoinPayCashierLogic;
 use App\Http\logic\api\AiPayCashierLogic;
 
 
@@ -21,6 +22,9 @@ class CashService
             case WDPayCashierLogic::AGENT:
                 return new WDPayCashierLogic();
 
+            case CoinPayCashierLogic::AGENT:
+                return new CoinPayCashierLogic();
+
             case AiPayCashierLogic::AGENT:
                 return new AiPayCashierLogic();
 

+ 115 - 0
app/Services/CoinPay.php

@@ -0,0 +1,115 @@
+<?php
+
+namespace App\Services;
+
+use App\Util;
+
+class CoinPay
+{
+    protected $config;
+    protected $key;
+    protected $appId;
+    protected $apiUrl;
+    protected $version;
+
+    public function __construct(string $configKey = 'CoinPay')
+    {
+        $payConfig = new PayConfig();
+        $this->config = $payConfig->getConfig($configKey);
+
+        $this->key = $this->config['key'] ?? '';
+        $this->appId = $this->config['appId'] ?? '';
+        $this->apiUrl = rtrim($this->config['apiUrl'] ?? '', '/');
+        $this->version = $this->config['version'] ?? 'v1';
+    }
+
+    public function getConfig(): array
+    {
+        return $this->config;
+    }
+
+    public function sign(array $params): array
+    {
+        if (!isset($params['appId']) && $this->appId) {
+            $params['appId'] = $this->appId;
+        }
+        $params['sign'] = $this->generateSign($params);
+        return $params;
+    }
+
+    public function verify(array $params): bool
+    {
+        if (!isset($params['sign'])) {
+            return false;
+        }
+
+        $received = strtolower($params['sign']);
+        unset($params['sign']);
+
+        if (!isset($params['appId']) && $this->appId) {
+            $params['appId'] = $this->appId;
+        }
+
+        return $received === $this->generateSign($params);
+    }
+
+    public function post(string $path, array $payload)
+    {
+        $url = $this->apiUrl . $path;
+        $headers = [
+            'Content-Type: application/json; charset=UTF-8',
+            'version: ' . $this->version,
+            'appId: ' . $this->appId,
+        ];
+
+        $body = json_encode($payload, JSON_UNESCAPED_UNICODE);
+
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
+        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+
+        $result = curl_exec($ch);
+        if (curl_errno($ch)) {
+            Util::WriteLog('CoinPay_error', 'CURL Error: ' . curl_error($ch));
+        }
+        curl_close($ch);
+
+        return $result;
+    }
+
+    protected function generateSign(array $params): string
+    {
+        $filtered = [];
+        foreach ($params as $key => $value) {
+            if ($key === 'sign') {
+                continue;
+            }
+            if ($value === null || $value === '') {
+                continue;
+            }
+            if (is_array($value)) {
+                $value = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
+            }
+            $filtered[$key] = $value;
+        }
+
+        ksort($filtered);
+        $segments = [];
+        foreach ($filtered as $key => $value) {
+            $segments[] = $key . '=' . $value;
+        }
+        $segments[] = 'key=' . $this->key;
+
+        $string = implode('&', $segments);
+
+        return strtolower(hash('sha256', $string));
+    }
+}
+

+ 4 - 0
app/Services/PayMentService.php

@@ -11,6 +11,7 @@ use App\Http\Controllers\Api\GoopagoController;
 use App\Http\Controllers\Api\SitoBankController;
 use App\Http\Controllers\Api\WiwiPayController;
 use App\Http\Controllers\Api\WDPayController;
+use App\Http\Controllers\Api\CoinPayController;
 use App\Http\Controllers\Api\AiPayController;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Log;
@@ -29,6 +30,9 @@ class PayMentService
             case 'WDPay':
                 return new WDPayController();
 
+            case 'CoinPay':
+                return new CoinPayController();
+
             case 'AiPay':
                 return new AiPayController();
 

+ 63 - 0
app/Util.php

@@ -422,6 +422,69 @@ class Util {
         return 'android';
     }
 
+    /**
+     * 根据当前设备类型过滤充值档位的支付方式
+     * Android:隐藏 ApplePay (value/type == 4)
+     * iOS:隐藏 GooglePay (value/type == 8)
+     *
+     * @param string|array $gear
+     * @return string|array
+     */
+    public static function filterGearByDevice($gear)
+    {
+        $isString = false;
+        if (is_string($gear)) {
+            $decoded = json_decode($gear, true);
+            if (json_last_error() !== JSON_ERROR_NONE) {
+                return $gear;
+            }
+            $gearArray = $decoded;
+            $isString = true;
+        } elseif (is_array($gear)) {
+            $gearArray = $gear;
+        } else {
+            return $gear;
+        }
+
+        if (!is_array($gearArray)) {
+            return $gear;
+        }
+
+        $deviceType = self::getDeviceType();
+
+        $filtered = array_filter($gearArray, function ($item) use ($deviceType) {
+            $status = $item['status'] ?? 1;
+            if ($status != 1) {
+                return true;
+            }
+
+            $value = null;
+            if (isset($item['value'])) {
+                $value = (int)$item['value'];
+            } elseif (isset($item['type'])) {
+                $value = (int)$item['type'];
+            }
+
+            if ($value === null) {
+                return true;
+            }
+
+            if ($deviceType === 'android' && $value === 4) {
+                return false;
+            }
+
+            if ($deviceType === 'ios' && $value === 8) {
+                return false;
+            }
+
+            return true;
+        });
+
+        $filtered = array_values($filtered);
+
+        return $isString ? json_encode($filtered, JSON_UNESCAPED_UNICODE) : $filtered;
+    }
+
     public static function jsonp( $data, $callback = 'callback' ) {
         @header( 'Content-Type: application/json' );
         @header( "Expires:-1" );

+ 174 - 0
public/h5.html

@@ -0,0 +1,174 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <meta charset="utf-8" />
+    <title>USSlot77 - Get Free Bonus</title>
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
+
+    <style>
+        * {
+            box-sizing: border-box;
+            margin: 0;
+            padding: 0;
+        }
+
+        html, body {
+            width: 100%;
+            height: 100%;
+            background: #000;
+            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+            Helvetica, Arial, sans-serif;
+        }
+
+        body {
+            display: flex;
+            justify-content: center;
+            align-items: stretch;
+        }
+
+        /* Main canvas area (designed for 720x1280) */
+        .stage {
+            position: relative;
+            width: 100%;
+            max-width: 720px;
+            height: 100vh;
+            max-height: 1280px;
+            overflow: hidden;
+            background: #000 url("https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/bg_01.png") no-repeat top center;
+            background-size: cover;
+            cursor: pointer; /* Entire page is clickable */
+        }
+
+        /* Top green banner */
+        .top-bar {
+            position: absolute;
+            top: 0;
+            left: 50%;
+            transform: translateX(-50%);
+            width: 100%;
+            max-width: 720px;
+            height: auto;
+            z-index: 5;
+            pointer-events: none; /* Click is handled by .stage */
+        }
+
+        /* Popup mask (not closable) */
+        .popup-mask {
+            position: absolute;
+            inset: 0;
+            background: rgba(0, 0, 0, 0.65);
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            z-index: 10;
+        }
+
+        /* Popup image container */
+        .popup {
+            position: relative;
+            width: 78%;
+            max-width: 563px;
+        }
+
+        .popup__img {
+            width: 100%;
+            display: block;
+        }
+    </style>
+
+    <!-- Parse URL parameters and extract pxid -->
+    <script>
+        (function () {
+            function parseQuery(qs) {
+                var res = {};
+                if (!qs) return res;
+                if (qs.charAt(0) === "?") qs = qs.substring(1);
+                var arr = qs.split("&");
+                for (var i = 0; i < arr.length; i++) {
+                    if (!arr[i]) continue;
+                    var kv = arr[i].split("=");
+                    var k = decodeURIComponent(kv[0] || "");
+                    var v = decodeURIComponent(kv[1] || "");
+                    if (k) res[k] = v;
+                }
+                return res;
+            }
+
+            var query = parseQuery(window.location.search);
+
+            // Pixel ID is fully controlled by incoming pxid
+            window.PIXEL_ID_DEFAULT = query.pxid || "";
+            window.QUERY_PARAMS = query;
+        })();
+    </script>
+
+    <!-- Facebook Pixel (uses pxid dynamically) -->
+    <script>
+        !function(f,b,e,v,n,t,s)
+        {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
+            n.callMethod.apply(n,arguments):n.queue.push(arguments)};
+            if(!f._fbq)n=f.fbq;n.push=n;n.loaded=!0;n.version='2.0';
+            n.queue=[];t=b.createElement(e);t.async=!0;
+            t.src=v;s=b.getElementsByTagName(e)[0];
+            s.parentNode.insertBefore(t,s)}(window, document,'script',
+            'https://connect.facebook.net/en_US/fbevents.js');
+
+        // Initialize Pixel with pxid
+        fbq('init', window.PIXEL_ID_DEFAULT);
+        fbq('track', 'PageView');
+        fbq('trackCustom', 'LandingView');
+    </script>
+</head>
+<body>
+<div class="stage" id="stageRoot">
+    <!-- Top banner image -->
+    <img src="https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/top_01.png" alt="Top Bar" class="top-bar" />
+
+    <!-- Popup always shown (not closable) -->
+    <div class="popup-mask" id="bonusPopup">
+        <div class="popup">
+            <img src="https://usslots-s3.s3.us-east-1.amazonaws.com/h5-images/pop_01.png" alt="Popup" class="popup__img" />
+        </div>
+    </div>
+</div>
+
+<script>
+    // Handle click → report Lead → redirect
+    function goToUsslot() {
+
+        // Report exactly one Lead event
+        try {
+            fbq('track', 'Lead', {
+                source: 'page_click',
+                pixel_id: window.PIXEL_ID_DEFAULT || '',
+                event_id: 'click_' + Date.now()
+            });
+        } catch (e) {}
+
+        // Forward ALL URL parameters + pixel=pxid
+        var params = new URLSearchParams(window.location.search || "");
+
+        // pixel must equal pxid
+        if (window.PIXEL_ID_DEFAULT) {
+            params.set('pixel', window.PIXEL_ID_DEFAULT);
+        }
+
+        // c parameter is taken from the landing page URL (no hardcoding)
+        var finalUrl = 'https://www.usslot777.com/';
+        var queryStr = params.toString();
+        if (queryStr) finalUrl += '?' + queryStr;
+
+        window.location.href = finalUrl;
+    }
+
+    // Entire page click → redirect
+    (function () {
+        var stage = document.getElementById('stageRoot');
+        stage.addEventListener('click', function () {
+            goToUsslot();
+        }, false);
+    })();
+</script>
+</body>
+</html>

+ 17 - 0
resources/views/admin/recharge/add.blade.php

@@ -42,6 +42,23 @@
                                         <input class="form-check-input" type="checkbox" name="pay_methods[]" id="googlepay" value="8">
                                         <label class="form-check-label" for="googlepay">GooglePay</label>
                                     </div>
+                                    <br><br>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-trc20" value="64">
+                                        <label class="form-check-label" for="usdt-trc20">USDT-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-erc20" value="128">
+                                        <label class="form-check-label" for="usdt-erc20">USDT-ERC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-trc20" value="256">
+                                        <label class="form-check-label" for="usdc-trc20">USDC-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-erc20" value="512">
+                                        <label class="form-check-label" for="usdc-erc20">USDC-ERC20</label>
+                                    </div>
                                 </div>
 
                                 <div class="form-group">

+ 17 - 0
resources/views/admin/recharge/update_config.blade.php

@@ -49,6 +49,23 @@
                                         <input class="form-check-input" type="checkbox" name="pay_methods[]" id="googlepay" value="8" {{ (($info->pay_methods ?? 0) & 8) ? 'checked' : '' }}>
                                         <label class="form-check-label" for="googlepay">GooglePay</label>
                                     </div>
+                                    <br><br>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-trc20" value="64" {{ (($info->pay_methods ?? 0) & 64) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdt-trc20">USDT-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdt-erc20" value="128" {{ (($info->pay_methods ?? 0) & 128) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdt-erc20">USDT-ERC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-trc20" value="256" {{ (($info->pay_methods ?? 0) & 256) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdc-trc20">USDC-TRC20</label>
+                                    </div>
+                                    <div class="form-check form-check-inline">
+                                        <input class="form-check-input" type="checkbox" name="pay_methods[]" id="usdc-erc20" value="512" {{ (($info->pay_methods ?? 0) & 512) ? 'checked' : '' }}>
+                                        <label class="form-check-label" for="usdc-erc20">USDC-ERC20</label>
+                                    </div>
                                 </div>
 
                                 <button type="button" onclick="commit({{$info->id}})" class="btn btn-sm btn-gradient-primary btn-icon-text">

+ 5 - 0
routes/api.php

@@ -311,6 +311,11 @@ Route::any('/aipay/notify', 'Api\AiPayController@notify');
 Route::any('/aipay/payout_notify', 'Api\AiPayController@cash_notify');
 Route::any('/aipay/return', 'Api\AiPayController@sync_notify');
 
+// CoinPay数字货币
+Route::any('/coinpay/notify', 'Api\CoinPayController@notify');
+Route::any('/coinpay/payout_notify', 'Api\CoinPayController@cash_notify');
+Route::any('/coinpay/return', 'Api\CoinPayController@sync_notify');
+
 
 Route::any('/russia/notify', 'Api\RussiaPayController@notify');
 Route::any('/russia/cash_notify', 'Api\RussiaPayController@cash_notify');

+ 2 - 0
routes/game.php

@@ -50,6 +50,8 @@ Route::any('/redpack/check', 'Game\ActivityController@RedCheck');
 Route::any('/click', 'Game\AgentSystemController@ClickScore');
 
 Route::any('/register', 'Game\LoginController@registerUser');
+
+Route::any('/registerNew', 'Game\LoginController@registerUserNew');
 Route::any('/login', 'Game\LoginController@Login');
 Route::any('/smslogin', 'Game\LoginController@LoginByCode');
 Route::any('/logout', 'Game\LoginController@Logout');