From d46f222fa3f36efa6f6cbade4a64f2e07a1deb19 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Tue, 6 Oct 2026 15:46:50 +0530 Subject: [PATCH] fix(abdm): set default sandbox linking OTP to 654321 and accept both 654321 and 123456 --- app/Controllers/AbdmGateway.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Controllers/AbdmGateway.php b/app/Controllers/AbdmGateway.php index 604e1f9..8128d54 100644 --- a/app/Controllers/AbdmGateway.php +++ b/app/Controllers/AbdmGateway.php @@ -5483,7 +5483,8 @@ class AbdmGateway extends BaseController $maskedHint = substr($cleanPhone, 0, 2) . '******' . substr($cleanPhone, -2); $linkRefNumber = 'LNK-' . date('YmdHis') . '-' . strtoupper(bin2hex(random_bytes(3))); - $otp = (string) random_int(100000, 999999); + // Default static sandbox OTP 654321 when no live SMS gateway is sending real OTP + $otp = '654321'; $expiresAt = date('Y-m-d H:i:s', time() + 600); $now = date('Y-m-d H:i:s'); @@ -5631,7 +5632,7 @@ class AbdmGateway extends BaseController } $storedOtp = (string) ($txn['otp'] ?? ''); - $otpValid = ($token === '123456') + $otpValid = in_array($token, ['654321', '123456'], true) || ($storedOtp !== '' && password_verify($token, $storedOtp)) || ($storedOtp === $token);