Simplify/ibantools

Dutch isValidBBAN result is wrong

brancheview opened this issue · 8 comments

The example on this documentation page is wrong. A Dutch BBAN does not start with 4 letters, it only consists of up to 10 digits. And when the BBAN consists of 9 or 10 digits, the last digit is a check-digit calculated by the so-called "11-test" (or Dutch: "11 proef").

As a result of this wrong implementation, the check gives wrong results as it now:

  • Demands 4 alphabetic start characters, which do not exist in a Dutch BBAN.
  • Demands 10 digits, most are 9, but any length from 1 till 10 (except 8) is fine.
  • It does not test the check-digit in 9 or 10 digit BBAN numbers

This needs to be updated

Details of this check-digit and length requirements can be found here

As described on this page, most accounts contain 9 digits. Saving accounts contain 10 digits. Shorter account numbers have only be used by one bank, but cannot be validated.

@brancheview thanks for reporting this.

According to PDF specification, Dutch BBAN is bank identifier and account number (4!a10!n). If account number is only 9 numbers, it's prefixed with 0. I think that old Postbank accounts are even with 7 numbers and prefixed with 000.

Right now for most countries ibantools only validates format of BBAN. I'm in process of adding custom bban_validation_func for countries where I can find specs on how to validate account number but that process is slow as I'm currently lacking time. Adding elf-proef is on my list for one of future releases, but note that old Postbank accounts do not use it as I can remember.

@brancheview this issue is finally solved. Sorry that took me so long.
I'll make release with this fix tomorrow.

There is a leftover console.log statement in checkDutchBBAN, that probably wasn't intentional?

No, I'll make new release today that fixes this issue.

@Simplify Hi!
Small question about this development, I read that Dutch accounts which were created after the introduction of the IBAN no longer need to pass the "elfproef" test.
So those accounts would not pass this BBAN check? Isn't that an issue if this check is done by default?
Or I'm mistaken ?

Thank you,
Martin

"elfproef"

Officially after 01.01.2020 account numbers no longer need to be 11-proef, as IBAN is used for payments and IBAN has own checksum. However, I'm yet to see one that of those numbers. Once I see one, I'll remove this additional check from code.

However, I'm yet to see one that of those numbers. Once I see one, I'll remove this additional check from code.

Hello @Simplify ! The situation actually was just reported to the company I work for. We use ibantools and one of our customer was suddenly unable to make payments to a Dutch IBAN that was previously reported as valid, and now isn't (WrongAccountBankBranchChecksum). (All other tools say that the IBAN is valid.) Will you push a new version with the fix or should I manually bypass ibantools on our side for the time being?

Anyway, thank you for the good work on this library!

@vmarquet check is removed and version is released.