false, 'error' => 'Campos obrigatórios']); exit; } $phone = preg_replace('/[\s\-\(\)\+]/', '', $phone); $data = [ 'stream_code' => 'REPLACE_WITH_STREAM_CODE', 'name' => $name, 'phone' => $phone, 'country' => 'RS', 'ip' => $_SERVER['REMOTE_ADDR'] ?? '', 'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'sub1' => $_GET['sub1'] ?? '', 'sub2' => $_GET['sub2'] ?? '', 'sub3' => $_GET['sub3'] ?? '', 'sub4' => $_GET['sub4'] ?? '', 'sub5' => $_GET['sub5'] ?? '', ]; $ch = curl_init('https://api.dr.cash/api/v1/sendorder'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query($data), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'], ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); @file_put_contents('orders.log', date('Y-m-d H:i:s')." | $name | $phone | HTTP:$httpCode | $response\n", FILE_APPEND); echo json_encode(['success' => ($httpCode >= 200 && $httpCode < 300)]);