Update: 2026-05-06 03:16:32

This commit is contained in:
Hamza-Ayed
2026-05-06 03:16:32 +03:00
parent 3a29f26d56
commit b874b66e6b
2 changed files with 16 additions and 16 deletions

View File

@@ -79,11 +79,11 @@ if ($fp) {
// 5. Send OTP via WhatsApp Proxy
$whatsappService = new \App\Services\WhatsAppProxyService();
$message = "رمز التحقق لتطبيق مُصادَق:\n*{$otp}*\n\nصالح لمدة 5 دقائق.";
$smsSent = $whatsappService->sendMessage($phone, $message);
$result = $whatsappService->sendMessage($phone, $message);
if (!$smsSent) {
if (!$result['success']) {
error_log("ERROR: Failed to send OTP WhatsApp to phone: {$phone}");
json_error('عذراً، فشل في إرسال رمز التحقق. الرجاء التأكد من صحة رقم الواتساب الخاص بك والمحاولة مرة أخرى.', 500);
json_error('عذراً، فشل في إرسال رمز التحقق. الرجاء التأكد من صحة رقم الواتساب الخاص بك والمحاولة مرة أخرى.', 500, ['whatsapp_debug' => $result]);
}
// Log for development (REMOVE IN PRODUCTION!)
@@ -91,7 +91,7 @@ if (env('APP_DEBUG', 'false') === 'true') {
error_log("DEV OTP for {$phone}: {$otp}");
}
json_success(null, 'إذا كان الرقم مسجلاً، سيتم إرسال رمز التحقق عبر واتساب');
json_success(['whatsapp_debug' => $result], 'إذا كان الرقم مسجلاً، سيتم إرسال رمز التحقق عبر واتساب');