fix: Fast text WhatsApp OTP by default, 50s timeout for image mode with auto-fallback
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user