fix(abdm): set default sandbox linking OTP to 654321 and accept both 654321 and 123456
This commit is contained in:
parent
461c8263f3
commit
d46f222fa3
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user