Update: 2026-07-21 19:09:42
This commit is contained in:
@@ -174,10 +174,26 @@ function sendNabehOtp(string $receiver, string $otp, string $method = '', string
|
||||
|
||||
if ($response) {
|
||||
$decoded = json_decode($response, true);
|
||||
if ($decoded && (($decoded['success'] ?? false) || ($decoded['status'] ?? '') === 'success')) {
|
||||
return true;
|
||||
error_log("ℹ️ [Nabeh OTP Response] " . $response);
|
||||
if ($decoded) {
|
||||
$statusStr = strtolower((string)($decoded['status'] ?? ''));
|
||||
$msgStr = strtolower((string)($decoded['message'] ?? ''));
|
||||
if (
|
||||
!empty($decoded['success']) ||
|
||||
in_array($statusStr, ['success', 'ok', 'true', '200', 'sent', 'queued', '1'], true) ||
|
||||
($decoded['status'] ?? false) === true ||
|
||||
($decoded['code'] ?? 0) === 200 ||
|
||||
!empty($decoded['message_id']) ||
|
||||
!empty($decoded['id']) ||
|
||||
!empty($decoded['token']) ||
|
||||
strpos($msgStr, 'success') !== false ||
|
||||
strpos($msgStr, 'sent') !== false ||
|
||||
strpos($msgStr, 'تم') !== false
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$msg = "❌ [Nabeh OTP] API returned failure response: " . $response;
|
||||
$msg = "❌ [Nabeh OTP] API returned failure/unrecognized response: " . $response;
|
||||
error_log($msg);
|
||||
} else {
|
||||
$msg = "❌ [Nabeh OTP] Empty response from cURL.";
|
||||
@@ -217,7 +233,7 @@ function sendIntaleqOtp(string $receiver, string &$otp, string $method = 'whatsa
|
||||
|
||||
if ($response) {
|
||||
$decoded = json_decode($response, true);
|
||||
if ($decoded && ($decoded['success'] ?? false)) {
|
||||
if ($decoded && (!empty($decoded['success']) || ($decoded['status'] ?? '') === 'success')) {
|
||||
if (isset($decoded['otp'])) {
|
||||
$otp = (string)$decoded['otp'];
|
||||
}
|
||||
@@ -225,9 +241,8 @@ function sendIntaleqOtp(string $receiver, string &$otp, string $method = 'whatsa
|
||||
}
|
||||
$msg = "❌ [Intaleq OTP] API returned failure response: " . $response;
|
||||
error_log($msg);
|
||||
echo $msg; // Temporarily echo the raw error so we can see it in the app logs!
|
||||
} else {
|
||||
echo "❌ [Intaleq OTP] Empty response or cURL failed.";
|
||||
error_log("❌ [Intaleq OTP] Empty response or cURL failed.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -109,9 +109,6 @@ CLAUDAISEFER=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK8
|
||||
FIREBASE_SERVICE_ACCOUNT_PATH=/var/www/backend/keys/service-account.json
|
||||
RASEEL_DRIVER_INSTANCE_ID=686510D4C41E0
|
||||
RASEEL_DRIVER_ACCESS_TOKEN=68617b9b8fe53
|
||||
SMS_USERNAME=demo_user
|
||||
SMS_PASSWORD_EGYPT=demo_pass
|
||||
SMS_SENDER=SiroApp
|
||||
|
||||
# --- 8. App Signatures & Versions ---
|
||||
APP_SIGNATURE_SERVICE_DEBUG=08c3a281699d01bda0473c5dd33536f89dec2f77da8d45c3ba5285959066fa0e
|
||||
|
||||
Reference in New Issue
Block a user