diff --git a/app/Services/WhatsAppProxyService.php b/app/Services/WhatsAppProxyService.php index 406ecbd..580fdb8 100644 --- a/app/Services/WhatsAppProxyService.php +++ b/app/Services/WhatsAppProxyService.php @@ -16,7 +16,8 @@ class WhatsAppProxyService //"https://botmasa.intaleq.xyz/send", // mayar //"https://botmasa2.intaleq.xyz/send", // shad //"https://bootride.intaleq.xyz/send", // ramat bus - "https://bot5.intaleq.xyz/send", // shahd + "https://bot3.intaleq.xyz/send", // shahd + "https://bot5.intaleq.xyz/send", // bot5 from postman //"https://whatsapp.tripz-egypt.com/send" // tripz ]; @@ -67,9 +68,8 @@ class WhatsAppProxyService $responseData = json_decode($response, true); - // التحقق من حالة الرد (يمكنك تخصيصه حسب هيكل رد البوت الخاص بك) - if (isset($responseData['error']) && $responseData['error']) { - error_log("[WhatsAppProxyService] API Error on $url: " . json_encode($responseData)); + if (!isset($responseData['success']) || $responseData['success'] !== true) { + error_log("[WhatsAppProxyService] API Error on $url: " . $response); return false; } diff --git a/app/modules_app/auth/mobile_request_otp.php b/app/modules_app/auth/mobile_request_otp.php index ca41dea..1616574 100644 --- a/app/modules_app/auth/mobile_request_otp.php +++ b/app/modules_app/auth/mobile_request_otp.php @@ -82,8 +82,8 @@ $message = "رمز التحقق لتطبيق مُصادَق:\n*{$otp}*\n\nصال $smsSent = $whatsappService->sendMessage($phone, $message); if (!$smsSent) { - error_log("WARN: Failed to send OTP WhatsApp to phone hash: {$phoneHash}"); - // Still return success to not reveal info, but log the issue + error_log("ERROR: Failed to send OTP WhatsApp to phone: {$phone}"); + json_error('عذراً، فشل في إرسال رمز التحقق. الرجاء التأكد من صحة رقم الواتساب الخاص بك والمحاولة مرة أخرى.', 500); } // Log for development (REMOVE IN PRODUCTION!)