Skip to content

Commit

Permalink
check if sheba code includes IR or not and avoid inavlid sheba error … (
Browse files Browse the repository at this point in the history
#317)

* check if sheba code includes IR or not and avoid inavlid sheba error for it

* first convert sheba code to upper case then validate it

* first convert sheba code to upper case then validate it
  • Loading branch information
sadrahallaj committed Apr 11, 2023
1 parent a3e6cab commit 05d8797
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/sheba/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export function shebaIso7064Mod97(iban: string): number {
* @since 1.7.1
*/
export function isShebaValid(shebaCode: string): boolean {
shebaCode = shebaCode.toUpperCase();

if (!shebaCode.startsWith('IR')) shebaCode = `IR${shebaCode}`

if (shebaCode.length !== 26) {
return false;
}
Expand Down

2 comments on commit 05d8797

@pooooriya
Copy link
Contributor

@pooooriya pooooriya commented on 05d8797 Apr 28, 2023

Choose a reason for hiding this comment

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

wrong implementation bro, I, ve got an error now on this function from this change!
@ali-master

@pooooriya
Copy link
Contributor

Choose a reason for hiding this comment

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

image
i check with these creds:
image

Please sign in to comment.