Update: 2026-08-06 18:32:03
This commit is contained in:
@@ -88,12 +88,20 @@ if ($deviceId && !$isReviewer) {
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$whatsappService = new \App\Services\WhatsAppProxyService();
|
||||
$message = "رمز التحقق لتطبيق مُصادَق:\n*{$otp}*\n\nصالح لمدة 5 دقائق.";
|
||||
$result = $whatsappService->sendMessage($phone, $message);
|
||||
$result = \App\Services\OtpSender::sendOtp($phone, $otp);
|
||||
|
||||
if (!$result['success']) {
|
||||
error_log("ERROR: Failed to send OTP WhatsApp to phone: {$phone}");
|
||||
// Log why it failed, not just that it did - the proxy returns the
|
||||
// transport error and the bot's own response body, and without them
|
||||
// a failure here is undiagnosable from the logs alone.
|
||||
error_log(sprintf(
|
||||
'ERROR: Failed to send OTP to phone: %s | provider=%s | url=%s | curl_error=%s | response=%s',
|
||||
$phone,
|
||||
$result['provider'] ?? 'n/a',
|
||||
$result['url'] ?? 'n/a',
|
||||
$result['error'] ?? 'none',
|
||||
substr((string)($result['raw_response'] ?? ''), 0, 500)
|
||||
));
|
||||
json_error('عذراً، فشل في إرسال رمز التحقق. يرجى المحاولة مرة أخرى.', 500);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user