Editing: /home/goacom/awcproapi.com/fun.php
<?php // ────────────────────────────────────────── // GamingAPI — Single File Integration // Client: D65C88 (client_d65c88) // ────────────────────────────────────────── // ─── Config ─────────────────────────────── define('API_KEY', 'WlESnBfC2N6zue3S'); define('CLIENT_SECRET', 'K3kFC8d15kM51OpS'); define('BASE_URL', 'https://ultracasinoapi.com'); define('CLIENT_ID', 'D65C88'); define('CLIENT_NAME', 'client_d65c88'); define('DEFAULT_USER_ID', '9982'); define('DEFAULT_GAME_UID', '3978'); define('DEFAULT_BALANCE', '500.00'); define('HMAC_ALGO', 'sha256'); define('API_LAUNCH', BASE_URL . '/v1/launch'); define('API_PROVIDERS', BASE_URL . '/api/v1/providers'); define('API_GAMES', BASE_URL . '/api/v1/games'); error_reporting(E_ALL); ini_set('display_errors', '1'); // ─── Helpers ────────────────────────────── function generateSignature(array $params): string { $data = implode('|', [ $params['api_key'] ?? API_KEY, $params['user_id'] ?? '', $params['game_uid'] ?? '', $params['balance'] ?? '0.00', $params['ts'] ?? time(), ]); return hash_hmac(HMAC_ALGO, $data, CLIENT_SECRET); } function buildLaunchUrl(array $overrides = []): string { $ts = time(); $params = array_merge([ 'api_key' => API_KEY, 'user_id' => DEFAULT_USER_ID, 'game_uid' => DEFAULT_GAME_UID, 'balance' => DEFAULT_BALANCE, 'ts' => $ts, ], $overrides); $params['sig'] = generateSignature($params); return API_LAUNCH . '?' . http_build_query($params); } function jsonResponse(mixed $data, int $code = 200): void { http_response_code($code); header('Content-Type: application/json'); echo json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); exit; } function jsonError(string $message, int $code = 400): void { jsonResponse(['status' => 'error', 'message' => $message], $code); } function httpGet(string $url): array { $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_TIMEOUT => 30, ]); $body = curl_exec($ch); $info = curl_getinfo($ch); $err = curl_error($ch); curl_close($ch); if ($err) return ['success' => false, 'error' => $err]; return [ 'success' => true, 'http_code' => $info['http_code'], 'data' => json_decode($body, true) ?? $body, 'raw' => $body, ]; } // ─── HTML Templates ────────────────────── function renderHeader(string $title = 'GamingAPI'): void { header('Content-Type: text/html; charset=utf-8'); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title><?= htmlspecialchars($title) ?> — GamingAPI</title> <style> *{margin:0;padding:0;box-sizing:border-box} body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#0f1117;color:#e1e4e8;line-height:1.6;min-height:100vh;display:flex;flex-direction:column} .container{max-width:1100px;margin:0 auto;padding:0 20px;width:100%} .navbar{background:#161b22;border-bottom:1px solid #30363d;padding:14px 0;position:sticky;top:0;z-index:100} .navbar .container{display:flex;align-items:center;gap:24px;flex-wrap:wrap} .brand{font-size:20px;font-weight:700;color:#58a6ff;text-decoration:none} .brand span{color:#f0883e} .nav-links{display:flex;gap:16px;flex:1} .nav-links a{color:#8b949e;text-decoration:none;font-size:14px;padding:4px 10px;border-radius:6px;transition:all .2s} .nav-links a:hover{color:#58a6ff;background:#1c2128} .client-badge{background:#1f6feb22;border:1px solid #1f6feb44;color:#58a6ff;font-size:12px;font-weight:600;padding:4px 12px;border-radius:20px} main{flex:1;padding:40px 0} .card{background:#161b22;border:1px solid #30363d;border-radius:12px;padding:28px;margin-bottom:24px} .card h2{color:#f0f6fc;font-size:18px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #21262d} pre{background:#0d1117;border:1px solid #30363d;border-radius:8px;padding:16px;overflow-x:auto;font-size:13px;line-height:1.5;color:#c9d1d9;max-height:500px;overflow-y:auto} code{font-family:'JetBrains Mono','Fira Code',monospace;font-size:13px} table{width:100%;border-collapse:collapse} th,td{padding:10px 14px;text-align:left;border-bottom:1px solid #21262d;font-size:14px} th{color:#8b949e;font-size:12px;text-transform:uppercase;letter-spacing:.5px} tr:hover td{background:#1c2128} .btn{display:inline-block;padding:10px 24px;border-radius:8px;font-size:14px;font-weight:600;text-decoration:none;cursor:pointer;border:none;transition:all .2s} .btn-primary{background:#238636;color:#fff} .btn-primary:hover{background:#2ea043} .btn-secondary{background:#21262d;color:#c9d1d9;border:1px solid #30363d} .btn-secondary:hover{background:#30363d} .btn-danger{background:#da3633;color:#fff} .form-group{margin-bottom:18px} .form-group label{display:block;font-size:13px;font-weight:600;color:#8b949e;margin-bottom:6px} .form-control{width:100%;padding:10px 14px;background:#0d1117;border:1px solid #30363d;border-radius:8px;color:#e1e4e8;font-size:14px;font-family:'JetBrains Mono',monospace} .form-control:focus{outline:none;border-color:#58a6ff;box-shadow:0 0 0 3px #1f6feb33} textarea.form-control{resize:vertical;font-family:'JetBrains Mono',monospace} .form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px} select.form-control{cursor:pointer} .badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:600} .badge-success{background:#23863633;color:#3fb950;border:1px solid #23863666} .badge-error{background:#da363333;color:#f85149;border:1px solid #da363366} .badge-info{background:#1f6feb33;color:#58a6ff;border:1px solid #1f6feb66} .alert{padding:14px 18px;border-radius:8px;font-size:14px;margin-bottom:16px} .alert-success{background:#23863622;border:1px solid #23863644;color:#3fb950} .alert-error{background:#da363322;border:1px solid #da363344;color:#f85149} .alert-info{background:#1f6feb22;border:1px solid #1f6feb44;color:#58a6ff} .hero{text-align:center;padding:40px 0} .hero h1{font-size:36px;font-weight:800;color:#f0f6fc;margin-bottom:8px} .hero .subtitle{color:#8b949e;font-size:16px;max-width:560px;margin:0 auto 24px} .footer{background:#161b22;border-top:1px solid #30363d;padding:16px 0;text-align:center;font-size:13px;color:#484f58} .grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px} .method{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:4px;margin-right:8px;vertical-align:middle} .method-get{background:#1f6feb33;color:#58a6ff} .method-post{background:#23863633;color:#3fb950} .sig-value{color:#f0883e;word-break:break-all} @media(max-width:768px){ .form-row,.grid-2{grid-template-columns:1fr} .nav-links{order:3;width:100%;justify-content:center} } </style> </head> <body> <nav class="navbar"> <div class="container"> <a href="?action=" class="brand">Gaming<span>API</span></a> <div class="nav-links"> <a href="?action=">Dashboard</a> <a href="?action=tester">Tester</a> <a href="?action=providers">Providers</a> <a href="?action=games">Games</a> <a href="?action=callback">Callback</a> <a href="?action=docs">Guide</a> </div> <div class="client-badge"><?= CLIENT_ID ?></div> </div> </nav> <main class="container"> <?php } function renderFooter(): void { ?> </main> <footer class="footer"> <div class="container"> <p>GamingAPI © 2026 — Client <strong><?= CLIENT_NAME ?></strong></p> </div> </footer> </body> </html> <?php } // ─── Pages ──────────────────────────────── function pageDashboard(): void { renderHeader('Dashboard'); $ts = time(); $payload = API_KEY . '|' . DEFAULT_USER_ID . '|' . DEFAULT_GAME_UID . '|' . DEFAULT_BALANCE . '|' . $ts; $sig = hash_hmac(HMAC_ALGO, $payload, CLIENT_SECRET); ?> <?php $launchTestResult = null; $testUserId = $_GET['test_user_id'] ?? ''; if ($testUserId) { $testUrl = buildLaunchUrl(['user_id' => $testUserId]); $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $testUrl, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_TIMEOUT => 15, ]); $resp = curl_exec($ch); $info = curl_getinfo($ch); $err = curl_error($ch); curl_close($ch); $launchTestResult = [ 'url' => $testUrl, 'http_code' => $info['http_code'], 'body' => $resp, 'error' => $err ?: null, 'parsed' => json_decode($resp, true), ]; } ?> <div class="hero"> <h1>Gaming API</h1> <p class="subtitle">Secure, low-latency gaming integration — <strong><?= CLIENT_NAME ?></strong></p> <a href="?action=launch-redirect" class="btn btn-primary">🚀 Launch Redirect</a> <a href="?action=tester" class="btn btn-secondary">🔧 Request Tester</a> </div> <div class="grid-2"> <div class="card"> <h2>System Status</h2> <table> <tr><td>Client</td><td><strong><?= CLIENT_ID ?></strong> (<?= CLIENT_NAME ?>)</td></tr> <tr><td>API Key</td><td><code><?= API_KEY ?></code></td></tr> <tr><td>Gateway</td><td><code><?= API_LAUNCH ?></code></td></tr> <tr><td>Status</td><td><span class="badge badge-success">● Operational</span></td></tr> </table> </div> <div class="card"> <h2>Quick Launch (Redirect)</h2> <p style="color:#8b949e;font-size:14px;margin-bottom:16px;">Generate a signed launch URL and redirect:</p> <form method="get" action="?"><input type="hidden" name="action" value="launch-redirect"> <div class="form-row"> <div class="form-group"><label>User ID (numeric)</label><input type="text" name="user_id" class="form-control" value="<?= DEFAULT_USER_ID ?>"></div> <div class="form-group"><label>Game UID</label><input type="text" name="game_uid" class="form-control" value="<?= DEFAULT_GAME_UID ?>"></div> </div> <div class="form-row"> <div class="form-group"><label>Balance</label><input type="text" name="balance" class="form-control" value="<?= DEFAULT_BALANCE ?>"></div> <div class="form-group"><label> </label><button type="submit" class="btn btn-primary" style="width:100%">Launch Game</button></div> </div> </form> </div> <div class="card"> <h2>Test Launch (Server-Side)</h2> <p style="color:#8b949e;font-size:14px;margin-bottom:16px;">Call the API and see the response here:</p> <form method="get" action="?action="> <div class="form-group"><label>User ID</label> <input type="text" name="test_user_id" class="form-control" value="<?= htmlspecialchars($testUserId ?: DEFAULT_USER_ID) ?>" placeholder="<?= DEFAULT_USER_ID ?>"> </div> <button type="submit" class="btn btn-secondary" style="width:100%">Send Test Request</button> </form> <?php if ($launchTestResult): ?> <div style="margin-top:14px;"> <span class="badge <?= $launchTestResult['http_code'] < 400 ? 'badge-success' : 'badge-error' ?>"> HTTP <?= $launchTestResult['http_code'] ?> </span> <?php if ($launchTestResult['error']): ?> <div class="alert alert-error">cURL: <?= htmlspecialchars($launchTestResult['error']) ?></div> <?php else: ?> <pre style="margin-top:8px;"><?= htmlspecialchars(json_encode($launchTestResult['parsed'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) ?: $launchTestResult['body']) ?></pre> <details style="margin-top:6px;"> <summary style="color:#8b949e;font-size:13px;cursor:pointer;">Full URL</summary> <pre style="margin-top:4px;font-size:11px;word-break:break-all;"><?= htmlspecialchars($launchTestResult['url']) ?></pre> </details> <?php endif; ?> </div> <?php endif; ?> </div> </div> <div class="card"> <h2>Signature Preview (SHA-256)</h2> <div style="margin-bottom:8px;"><span class="method method-get">GET</span><code style="color:#58a6ff;"><?= API_LAUNCH ?></code></div> <div style="margin-bottom:12px;"><span style="color:#8b949e;font-size:13px;">Payload:</span><pre><?= htmlspecialchars($payload) ?></pre></div> <div><span style="color:#8b949e;font-size:13px;">Signature:</span><pre class="sig-value"><?= $sig ?></pre></div> </div> <div class="card"> <h2>Available Endpoints</h2> <table> <tr><th>Method</th><th>Endpoint</th><th>Description</th></tr> <tr><td><span class="method method-get">GET</span> <span class="method method-post">POST</span></td><td><code>/v1/launch</code></td><td>Game session launch</td></tr> <tr><td><span class="method method-get">GET</span></td><td><code>/api/v1/providers</code></td><td>List game providers</td></tr> <tr><td><span class="method method-get">GET</span></td><td><code>/api/v1/games</code></td><td>List games by provider</td></tr> </table> </div> <?php renderFooter(); } function pageTester(): void { renderHeader('Request Tester'); $method = strtoupper($_POST['method'] ?? 'GET'); $endpoint = $_POST['endpoint'] ?? 'launch'; $body_raw = $_POST['body'] ?? ''; $map = [ 'launch' => API_LAUNCH, 'providers' => API_PROVIDERS, 'games' => API_GAMES, ]; $url = $map[$endpoint] ?? API_LAUNCH; $result = null; $fullUrl = $url; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['send'])) { if ($method === 'GET') { $fullUrl = $url . '?api_key=' . API_KEY; if ($endpoint === 'launch') { $fullUrl = buildLaunchUrl(); } $result = httpGet($fullUrl); } else { $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $body_raw ?: '{}', CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_SSL_VERIFYPEER => false, CURLOPT_TIMEOUT => 30, ]); $body = curl_exec($ch); $info = curl_getinfo($ch); $err = curl_error($ch); curl_close($ch); $result = $err ? ['success' => false, 'error' => $err] : ['success' => true, 'http_code' => $info['http_code'], 'raw' => $body, 'data' => json_decode($body, true) ?? $body]; } } $launchSample = json_encode([ 'api_key' => API_KEY, 'user_id' => 'user_9982', 'game_uid' => '3978', 'balance' => '500.00', 'ts' => time(), 'sig' => '{{auto-generated}}', ], JSON_PRETTY_PRINT); ?> <div class="card"> <h2>🔧 Request Tester</h2> <form method="post" action="?action=tester"> <div class="form-row"> <div class="form-group"> <label>Method</label> <select name="method" class="form-control"> <option value="GET" <?= $method === 'GET' ? 'selected' : '' ?>>GET</option> <option value="POST" <?= $method === 'POST' ? 'selected' : '' ?>>POST</option> </select> </div> <div class="form-group"> <label>Endpoint</label> <select name="endpoint" class="form-control"> <option value="launch" <?= $endpoint === 'launch' ? 'selected' : '' ?>>/v1/launch</option> <option value="providers" <?= $endpoint === 'providers' ? 'selected' : '' ?>>/api/v1/providers</option> <option value="games" <?= $endpoint === 'games' ? 'selected' : '' ?>>/api/v1/games</option> </select> </div> </div> <div class="form-group"> <label>Request Body (JSON — for POST)</label> <textarea name="body" class="form-control" rows="6"><?= htmlspecialchars($body_raw ?: $launchSample) ?></textarea> </div> <button type="submit" name="send" value="1" class="btn btn-primary">Send Request</button> </form> </div> <?php if ($result): ?> <div class="card"> <h2>Response</h2> <div class="alert <?= $result['success'] && ($result['http_code'] ?? 0) < 400 ? 'alert-success' : 'alert-error' ?>"> <?php if (!$result['success']): ?> <strong>cURL Error:</strong> <?= htmlspecialchars($result['error']) ?> <?php else: ?> HTTP <strong><?= $result['http_code'] ?></strong> — URL: <code><?= htmlspecialchars($fullUrl) ?></code> <?php endif; ?> </div> <?php if (!empty($result['raw'])): ?> <pre><?= htmlspecialchars(is_string($result['data']) ? $result['raw'] : json_encode($result['data'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)) ?></pre> <?php endif; ?> </div> <?php endif; ?> <div class="card"> <h2>Integration Guide — PHP Sample</h2> <pre><?php $apiKey = '<?= API_KEY ?>'; $clientSecret = '<?= CLIENT_SECRET ?>'; $userId = 'user_9982'; $gameUid = '3978'; $balance = '500.00'; $ts = time(); $payload = "$apiKey|$userId|$gameUid|$balance|$ts"; $sig = hash_hmac('sha256', $payload, $clientSecret); $endpoint = "<?= API_LAUNCH ?>?api_key=$apiKey&user_id=$userId&game_uid=$gameUid&balance=$balance&ts=$ts&sig=$sig"; header("Location: $endpoint"); exit;</pre> </div> <?php renderFooter(); } function pageProviders(): void { renderHeader('Providers'); $url = API_PROVIDERS . '?api_key=' . API_KEY; $result = httpGet($url); ?> <div class="card"> <h2>Game Providers</h2> <p style="color:#8b949e;margin-bottom:16px;">Fetching from: <code><?= htmlspecialchars($url) ?></code></p> <?php if (!$result['success']): ?> <div class="alert alert-error"><strong>Error:</strong> <?= htmlspecialchars($result['error']) ?></div> <?php elseif ($result['http_code'] >= 400): ?> <div class="alert alert-error"><strong>HTTP <?= $result['http_code'] ?></strong></div> <pre><?= htmlspecialchars($result['raw']) ?></pre> <?php else: ?> <div class="alert alert-success">HTTP <?= $result['http_code'] ?></div> <pre><?= htmlspecialchars(json_encode($result['data'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)) ?></pre> <?php endif; ?> </div> <?php renderFooter(); } function pageGames(): void { renderHeader('Games'); $provider = $_GET['provider'] ?? ''; $url = API_GAMES . '?api_key=' . API_KEY . ($provider ? '&provider=' . urlencode($provider) : ''); $result = httpGet($url); ?> <div class="card"> <h2>Game Catalog</h2> <p style="color:#8b949e;margin-bottom:16px;">Fetching from: <code><?= htmlspecialchars($url) ?></code></p> <form method="get" action="?action=games" style="margin-bottom:20px;max-width:400px;"> <div class="form-row"> <div class="form-group"> <label>Provider ID</label> <input type="hidden" name="action" value="games"> <input type="text" name="provider" class="form-control" value="<?= htmlspecialchars($provider) ?>" placeholder="e.g. 1"> </div> <div class="form-group"> <label> </label> <button type="submit" class="btn btn-primary" style="width:100%">Filter</button> </div> </div> </form> <?php if (!$result['success']): ?> <div class="alert alert-error"><strong>Error:</strong> <?= htmlspecialchars($result['error']) ?></div> <?php elseif ($result['http_code'] >= 400): ?> <div class="alert alert-error"><strong>HTTP <?= $result['http_code'] ?></strong></div> <pre><?= htmlspecialchars($result['raw']) ?></pre> <?php else: ?> <div class="alert alert-success">HTTP <?= $result['http_code'] ?></div> <pre><?= htmlspecialchars(json_encode($result['data'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)) ?></pre> <?php endif; ?> </div> <?php renderFooter(); } function pageCallback(): void { if ($_SERVER['REQUEST_METHOD'] === 'POST') { header('Content-Type: application/json'); $raw = file_get_contents('php://input'); if (empty($raw) && isset($_POST['payload'])) $raw = $_POST['payload']; $data = json_decode($raw, true); if (!$data) jsonError('Invalid JSON payload'); $member = $data['member_account'] ?? 'unknown'; $bet = (float)($data['bet_amount'] ?? 0); $win = (float)($data['win_amount'] ?? 0); $net = $win - $bet; $roundId = $data['round_id'] ?? 'N/A'; $ts = $data['ts'] ?? time(); $logDir = __DIR__ . '/logs'; if (!is_dir($logDir)) mkdir($logDir, 0755, true); file_put_contents($logDir . '/callbacks.log', sprintf( "[%s] Member: %s | Round: %s | Bet: %.2f | Win: %.2f | Net: %.2f\n", date('Y-m-d H:i:s', $ts), $member, $roundId, $bet, $win, $net ), FILE_APPEND | LOCK_EX); jsonResponse([ 'status' => 'success', 'protocol' => 'acknowledged', 'timestamp' => time(), 'data' => ['member_account' => $member, 'round_id' => $roundId, 'bet_amount' => $bet, 'win_amount' => $win, 'net_result' => $net, 'processed_at' => date('c')], ]); } renderHeader('Callback Handler'); $sample = json_encode([ 'member_account' => 'user_9982', 'game_code' => '3978', 'bet_amount' => '100.00', 'win_amount' => '150.00', 'round_id' => 'RND123456', 'ts' => time(), ], JSON_PRETTY_PRINT); ?> <div class="card"> <h2>Event Synchronization — Callback Handler</h2> <p style="color:#8b949e;margin-bottom:16px;">Receives game result callbacks via <code>POST</code>. Logs are stored in <code>logs/callbacks.log</code>.</p> <h3 style="color:#f0f6fc;margin-bottom:8px;">Expected Payload</h3> <pre><?= htmlspecialchars($sample) ?></pre> <h3 style="color:#f0f6fc;margin:20px 0 8px;">Simulate Callback</h3> <form method="post" action="?action=callback"> <div class="form-group"> <label>JSON Payload</label> <textarea name="payload" class="form-control" rows="8"><?= htmlspecialchars($sample) ?></textarea> </div> <button type="submit" class="btn btn-primary">Send Callback</button> </form> </div> <?php renderFooter(); } function pageDocs(): void { renderHeader('Integration Guide'); ?> <div class="card"> <h2>Integration Guide</h2> <h3 style="color:#f0f6fc;margin:16px 0 8px;">1. Service Gateway</h3> <p style="color:#8b949e;font-size:14px;margin-bottom:8px;"> <span class="method method-get">GET</span> <span class="method method-post">POST</span> <code><?= API_LAUNCH ?></code> </p> <h3 style="color:#f0f6fc;margin:16px 0 8px;">2. Security & Handshake</h3> <table> <tr><th>Vector</th><th>Description</th></tr> <tr><td>API Key</td><td>Required query parameter in all primary requests</td></tr> <tr><td>HMAC Signature</td><td>SHA-256 HMAC using Client Secret</td></tr> <tr><td>IP Perimeter</td><td>Whitelist-based network restriction</td></tr> </table> <h3 style="color:#f0f6fc;margin:16px 0 8px;">3. Signature Logic (SHA-256)</h3> <pre>data = api_key + "|" + user_id + "|" + game_uid + "|" + balance + "|" + ts sig = hash_hmac('sha256', data, client_secret)</pre> <h3 style="color:#f0f6fc;margin:16px 0 8px;">4. PHP Implementation</h3> <pre><?php $apiKey = '<?= API_KEY ?>'; $clientSecret = '<?= CLIENT_SECRET ?>'; $userId = 'user_9982'; $gameUid = '3978'; $balance = '500.00'; $ts = time(); $payload = "$apiKey|$userId|$gameUid|$balance|$ts"; $sig = hash_hmac('sha256', $payload, $clientSecret); $endpoint = "<?= API_LAUNCH ?>?api_key=$apiKey&user_id=$userId&game_uid=$gameUid&balance=$balance&ts=$ts&sig=$sig"; header("Location: $endpoint"); exit;</pre> <h3 style="color:#f0f6fc;margin:16px 0 8px;">5. Callback Handler</h3> <pre><?php header('Content-Type: application/json'); $payload = file_get_contents('php://input'); $data = json_decode($payload, true); if (!$data) die(json_encode(['status' => 'error', 'protocol' => 'failed'])); $user = $data['member_account']; $netResult = $data['win_amount'] - $data['bet_amount']; echo json_encode(['status' => 'success', 'timestamp' => time()]);</pre> <h3 style="color:#f0f6fc;margin:16px 0 8px;">6. Asset Cataloging</h3> <p style="color:#8b949e;font-size:14px;margin-bottom:4px;">Providers: <code><?= API_PROVIDERS ?>?api_key=YOUR_KEY</code></p> <p style="color:#8b949e;font-size:14px;">Games: <code><?= API_GAMES ?>?api_key=YOUR_KEY&provider=ID</code></p> </div> <?php renderFooter(); } // ─── Router ─────────────────────────────── $action = $_GET['action'] ?? 'dashboard'; switch ($action) { case 'launch-redirect': $url = buildLaunchUrl([ 'user_id' => $_GET['user_id'] ?? 'user_9982', 'game_uid' => $_GET['game_uid'] ?? '3978', 'balance' => $_GET['balance'] ?? '500.00', ]); header("Location: $url"); exit; case 'launch-api': header('Content-Type: application/json'); $sig = generateSignature($_REQUEST); echo json_encode([ 'status' => 'success', 'message' => 'Session initialized', 'data' => ['session_id' => bin2hex(random_bytes(16)), 'signature' => $sig], ]); exit; case 'tester': pageTester(); break; case 'providers': pageProviders(); break; case 'games': pageGames(); break; case 'callback': pageCallback(); break; case 'docs': pageDocs(); break; default: pageDashboard(); break; }
💾 Save