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

CZ IBAN incorect verify_iban #123

Closed
Triplkrypl opened this issue Jan 9, 2023 · 3 comments
Closed

CZ IBAN incorect verify_iban #123

Triplkrypl opened this issue Jan 9, 2023 · 3 comments

Comments

@Triplkrypl
Copy link
Contributor

IBAN verification incorrectly detect empty CZ IBANs.

Problem and specification is describe here: #40 (comment).

// both verify_iban return true but should return false
var_dump(verify_iban('CZ0401000000000000000000'));
var_dump(verify_iban('CZ2501000000000000000010'));

Last ten digits in CZ IBAN must contains at least 2 non zero digits.

@Olympic1
Copy link
Contributor

Olympic1 commented Jan 9, 2023

According to the calculator that is provided by the Czech National Bank, the first IBAN is valid while the second one is invalid because of a wrong account number.

@Triplkrypl
Copy link
Contributor Author

First account CZ0401000000000000000000 looks OK, but account number is empty, IBAN can not be reconstruct back.
obrazek

@globalcitizen
Copy link
Owner

Without further investigation, only judging from the screenshot, it looks like that national bank checking interface has been implemented such that a special case input of all zeroes for the account number should be considered invalid.

This is not an IBAN (international) limitation, therefore expecting verify_iban() to catch it is not logical.

If you can find an official statement that all zeroes is disallowed from the Czech authorities, then we could perhaps add it to the national check for CZ. However, in terms of adding this special case, currently for countries we only implement iban_verify_nationalchecksum(). This is done by defining a function _iban_nationalchecksum_implementation_cz. However, I do not like the semantic impact (readability / confusion) of adding a special case exclusion to such a function.

Therefore I think this particular case, even if the special case is considered invalid by Czech authorities, they are a little bit strange for adding special cases, and we should safely consider this to be odd and out of scope for verify_iban().

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

No branches or pull requests

3 participants