Update: 2026-08-06 18:32:03

This commit is contained in:
Hamza-Ayed
2026-08-06 18:32:03 +03:00
parent c759c80c85
commit ca3d456795
8 changed files with 416 additions and 41 deletions
+3 -5
View File
@@ -100,14 +100,12 @@ try {
fclose($fp);
}
// 5. Send OTP via WhatsApp Proxy
$whatsappService = new \App\Services\WhatsAppProxyService();
$message = "رمز التحقق لتطبيق مُصادَق:\n*{$otp}*\n\nصالح لمدة 5 دقائق.";
$result = $whatsappService->sendMessage($phone, $message);
// 5. Send OTP via the configured channel (Nabeh gateway or WhatsApp bots)
$result = \App\Services\OtpSender::sendOtp($phone, $otp);
if (!$result['success']) {
// Internal provider details stay in the log, not in the HTTP response.
error_log("ERROR: Failed to send OTP WhatsApp to phone: {$phone} - " . json_encode($result));
error_log("ERROR: Failed to send OTP to phone: {$phone} - " . json_encode($result));
json_error('عذراً، فشل في إرسال رمز التحقق. الرجاء التأكد من صحة رقم الواتساب الخاص بك والمحاولة مرة أخرى.', 500);
}