kewisch / sepa.js

Create and validate SEPA XML transactions
http://kewisch.github.io/sepa.js
Other
88 stars 61 forks source link

False positive while validating IBAN #18

Closed dibi-codes closed 11 months ago

dibi-codes commented 7 years ago

I've encountered a problem where the validateIBAN() function returns a wrong result.

validateIBAN("santander") === true
kewisch commented 7 years ago

I can confirm, interesting behavior. Do you think you could look into why this is happening?

dibi-codes commented 7 years ago

I just investigated the problem and noticed that this is not really a bug but happens due to the simplicity of this library. To overcome this false positive one should do a more precise validation with country specific parameters e.g. IBAN-length for country code and format description. So in general all calculation is correct but not enough to validate an international IBAN.

OtaK commented 7 years ago

Already noticed this problem, which is why I added a function to bypass validations when you're sure of your format: SEPA.enableValidations(false);

kewisch commented 5 years ago

@dabeck do you think you could send a pull request to improve the checks here? I'd appreciate!

lippertto commented 11 months ago

Hello @kewisch , I can have a look into this bug. I would include jest as testing library to reproduce the bug and to fix it for good. Is that fine with you?

kewisch commented 11 months ago

Yep, that works for me. Glad to see the first few tests on this!