Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advanced bank identifier validation and retrieval methods #185

Conversation

neelesh-patil-4417
Copy link
Contributor

@neelesh-patil-4417 neelesh-patil-4417 commented Nov 26, 2024

Description

This feature adds advanced capabilities to handle bank identifiers, such as enhanced validation for existing identifier types and support for custom identifier formats like SWIFT, Routing Numbers, and IFSC codes. It introduces utility functions to retrieve bank details efficiently and improves error messaging for invalid cases.

Proposed solution

The system will ensure precise validation of input identifiers before processing. The changes modularize validation and retrieval logic into reusable functions. For example, introducing utility methods like IsValidBankIdentifier, GetBankNameFromShortCode, GetDefaultBankIdentifiersFromShortCode, will make the codebase more organized and extensible.

Envison - A consumer of the updated library calls IsValidBankIdentifier("MY", "SWIFT", "PHBMMYKLXXX"), and the function returns true if valid, or a descriptive error if not.
Another use case: GetBankNameFromIdentifier("US", "021000021") retrieves the bank name for the routing number directly, streamlining front-end data presentation in payment forms.

Source of data - https://bank.codes/ (which is widely used for international transfers)

Copy link

changeset-bot bot commented Nov 26, 2024

⚠️ No Changeset found

Latest commit: 0585bfe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@varunkumark1997 varunkumark1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets add UT's as well

@varunkumark1997 varunkumark1997 marked this pull request as ready for review January 10, 2025 05:42
Copy link
Contributor

@varunkumark1997 varunkumark1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@varunkumark1997 varunkumark1997 merged commit 63fca02 into razorpay:master Jan 10, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants