[SEPA_IBAN_VALIDATOR] IBAN validate upgrade the current version

[SEPA_IBAN_VALIDATOR] IBAN validate upgrade the current version

  
Forge Component
(2)
Published on 2014-01-08 by Santiago Suarez
2 votes
Published on 2014-01-08 by Santiago Suarez

Hi!

Can you maybe upgrade the IBAN validator that it also does validation like on this page:

https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN


Would improve the extension!



Can you explain what goes wrong currently? Are there valid IBANs not recognized as valid, or are there invalid IBANs not recognized as invalid?

I now can do a IBAN like: NL33INGB0123456789 and the extension will say its valid.

But its not valid because of this validation is missing:


An IBAN is validated by converting it into an integer and performing a basic mod-97 operation (as described in ISO 7064) on it. If the IBAN is valid, the remainder equals 1.[Note 1] The algorithm of IBAN validation is as follows:[8]

  1. Check that the total IBAN length is correct as per the country. If not, the IBAN is invalid
  2. Move the four initial characters to the end of the string
  3. Replace each letter in the string with two digits, thereby expanding the string, where A = 10, B = 11, ..., Z = 35
  4. Interpret the string as a decimal integer and compute the remainder of that number on division by 97



Solution

You mean this IBAN validator doesn't check the checkdigit? According to the description it does, so it may be a bug.

Solution

Oh maybe I did something wrong! Let me check

Seems to be working indeed! sorry

No problem, glad it isn't a bug :). Happy coding!