-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAH-4119 | Migrate verification flow to v3 ABDM APIs (#92)
* BAH-4119.Add. ABDM v3 APIs Verify Abha Address Using Mobile number. * BAH-4119. Add. ABDM v3 APIs for verify by Abha Number. * BAH-4119| Add. ABDM v3 APIs for Abha Address Verification flow. * BAH-4119. Add. ABDM v3 API error handling. * BAH-4119 | Add. Validations for user input in verification flow * BAH-4119 | Add. Dropdown based identifier selection for verification flow * BAH-4119 | Add. API Error handling for verification by mobile number * BAH-4119 | Add. Validation for abha address verification input --------- Co-authored-by: arshiyaTW2021 <[email protected]>
- Loading branch information
1 parent
456c075
commit bd4dd08
Showing
11 changed files
with
346 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const validateAbhaNumber = (abhaNumber) => { | ||
return /^\d{14}$/.test(abhaNumber); | ||
}; | ||
export const formatAbhaNumber = (abhaNumber) => { | ||
let ABHA_NUMBER_REGEX = /^(\d{2})(\d{4})(\d{4})(\d{4})$/; | ||
const match = abhaNumber.match(ABHA_NUMBER_REGEX); | ||
if (match) { | ||
return `${match[1]}-${match[2]}-${match[3]}-${match[4]}`; | ||
} | ||
return abhaNumber; | ||
}; | ||
|
||
export const validateOtp = (otp) => { | ||
return /^\d{6}$/.test(otp); | ||
} | ||
|
||
export const validateMobileNumber = (mobileNumber) => { | ||
return /^\d{10}$/.test(mobileNumber); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.