fix: Fast text WhatsApp OTP by default, 50s timeout for image mode with auto-fallback

This commit is contained in:
Hamza-Ayed
2026-08-26 23:04:25 +03:00
parent cee6265930
commit f3c5f4161e
2 changed files with 40 additions and 19 deletions
+4 -2
View File
@@ -93,12 +93,14 @@ class TestController
$cleanPhone = '962' . substr($cleanPhone, 1);
}
$testOtp = (string)random_int(100000, 999999);
$type = $queryParams['type'] ?? 'text'; // Fast text mode by default
try {
$nabeh = new NabehService();
$sendResult = $nabeh->sendOtp($cleanPhone, $testOtp, 'image', 'فحص منصة صَقِل');
$sendResult = $nabeh->sendOtp($cleanPhone, $testOtp, $type, 'فحص منصة صَقِل');
$results['live_otp_test'] = [
'phone' => $cleanPhone,
'code_sent' => $testOtp,
'type_used' => $type,
'send_result' => $sendResult
];
} catch (\Exception $e) {
@@ -108,7 +110,7 @@ class TestController
];
}
} else {
$results['live_otp_test'] = 'To test sending an actual WhatsApp OTP, add ?phone=96279XXXXXXX to this URL';
$results['live_otp_test'] = 'To test sending an actual WhatsApp OTP, add ?phone=96279XXXXXXX&type=text to this URL';
}
$response->json([