From ed6e34cc4b6fe07a94f8feb27785696a2a7143d0 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Tue, 23 Jun 2026 18:36:09 +0300 Subject: [PATCH] Update: 2026-06-23 18:36:09 --- backend/auth/otp/providers.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/auth/otp/providers.php b/backend/auth/otp/providers.php index 501cd17..263ba0d 100644 --- a/backend/auth/otp/providers.php +++ b/backend/auth/otp/providers.php @@ -172,7 +172,7 @@ function sendNabehOtp(string $receiver, string $otp, string $method = 'text'): b * @param string $method whatsapp | sms | voice | flash_call * @return bool True if OTP was sent successfully */ -function sendIntaleqOtp(string $receiver, string $otp, string $method = 'whatsapp'): bool { +function sendIntaleqOtp(string $receiver, string &$otp, string $method = 'whatsapp'): bool { $appKey = getenv('NABEH_OTP_APP_KEY'); if (!$appKey) { @@ -186,19 +186,19 @@ function sendIntaleqOtp(string $receiver, string $otp, string $method = 'whatsap $apiUrl = 'https://otp.intaleqapp.com/api/request-otp.php'; $payload = [ 'phone' => $phoneWithPlus, - 'device_type' => 'android', - 'method' => $method, - 'code' => $otp + 'app_key' => $appKey ]; $response = curlCall("POST", $apiUrl, json_encode($payload), [ - 'Content-Type: application/json', - "X-App-Key: $appKey" + 'Content-Type: application/json' ]); if ($response) { $decoded = json_decode($response, true); if ($decoded && ($decoded['success'] ?? false)) { + if (isset($decoded['otp'])) { + $otp = (string)$decoded['otp']; + } return true; } $msg = "❌ [Intaleq OTP] API returned failure response: " . $response;