|
@@ -12,6 +12,8 @@ use App\Models\Treasure\GameScoreLocker;
|
|
|
use App\Notification\TelegramBot;
|
|
use App\Notification\TelegramBot;
|
|
|
use App\Util;
|
|
use App\Util;
|
|
|
use App\Utility\SetNXLock;
|
|
use App\Utility\SetNXLock;
|
|
|
|
|
+use GuzzleHttp\Client;
|
|
|
|
|
+use GuzzleHttp\Exception\RequestException;
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Hash;
|
|
@@ -542,7 +544,57 @@ class WithDrawInfoController
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
if ($PixType==1) {
|
|
if ($PixType==1) {
|
|
|
|
|
+ // 验证 cashapp
|
|
|
|
|
+ if (!empty($PixNum)) {
|
|
|
|
|
+ // 如果 PixNum 第一个字符不是 "$",则在前面添加 "$"
|
|
|
|
|
+ if (substr($PixNum, 0, 1) !== '$') {
|
|
|
|
|
+ $PixNum = '$' . $PixNum;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 构建 cash.app URL
|
|
|
|
|
+ $cashAppUrl = 'https://cash.app/' . $PixNum;
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 使用 stream context 来获取 HTTP 响应头
|
|
|
|
|
+ $context = stream_context_create([
|
|
|
|
|
+ 'http' => [
|
|
|
|
|
+ 'method' => 'GET',
|
|
|
|
|
+ 'header' => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36\r\n",
|
|
|
|
|
+ 'ignore_errors' => true
|
|
|
|
|
+ ]
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ $htmlContent = @file_get_contents($cashAppUrl, false, $context);
|
|
|
|
|
+
|
|
|
|
|
+ // 检查 HTTP 响应头中的状态码
|
|
|
|
|
+ if ($htmlContent === false || (isset($http_response_header) && preg_match('/HTTP\/\d\.\d\s+404/', implode("\n", $http_response_header)))) {
|
|
|
|
|
+ Util::WriteLog("withdrawInfo", [5, $request->all(), 'Invalid cashapp: ' . $PixNum]);
|
|
|
|
|
+ SetNXLock::release($redisKey);
|
|
|
|
|
+ return apiReturnFail(['web.withdraw.invalid_cashapp', 'Invalid CashApp account']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($htmlContent !== false) {
|
|
|
|
|
+ // 去除空格换行,转换成一行字符串
|
|
|
|
|
+ $htmlContent = preg_replace('/\s+/', '', $htmlContent);
|
|
|
|
|
+ Util::WriteLog("withdrawInfo", [5, $request->all(), 'CashApp verification response: ' . $htmlContent]);
|
|
|
|
|
+
|
|
|
|
|
+ // 检查响应内容中是否包含 "404 Not Found"
|
|
|
|
|
+ if (stripos($htmlContent, '404NotFound') !== false) {
|
|
|
|
|
+ Util::WriteLog("withdrawInfo", [5, $request->all(), 'Invalid cashapp: ' . $PixNum]);
|
|
|
|
|
+ SetNXLock::release($redisKey);
|
|
|
|
|
+ return apiReturnFail(['web.withdraw.invalid_cashapp', 'Invalid CashApp account']);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (\Exception $e) {
|
|
|
|
|
+ // 其他异常也记录日志但不阻止流程
|
|
|
|
|
+ Util::WriteLog("withdrawInfo", [5, $request->all(), 'CashApp verification error: ' . $e->getMessage()]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$data = compact('PixType', 'BankUserName', 'PixNum');
|
|
$data = compact('PixType', 'BankUserName', 'PixNum');
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
$data = compact('PixType', 'EmailAddress');
|
|
$data = compact('PixType', 'EmailAddress');
|
|
|
}
|
|
}
|