globalcitizen/php-iban

Problem with Bulgarian IBAN

ivelindobrev opened this issue · 2 comments

Hello guys,

I've problem with this IBAN not validating: BG75TTBB9400C127729455
It validates if using online validator like https://www.ibancalculator.com/.
I've triple checked with the bank and the account is the same (there are not errors).

Thanks

First of all, there is only one guy, not guys.

Thanks for your report.

Upon quick review it seems...

BG75TTBB9400C127729455 ... FAILED (does not match regex /^BG(\d{2})([A-Z]{4})(\d{4})(\d{2})([A-Za-z0-9]{8})$/ for country BG)

The portion which does not match is the two digit national checksum, ie. (\d{2})

For all of the other example IBANs, this matches. However, for your IBAN this is C1 which is not two digits.

I can confirm that the official PDF release of the SWIFT IBAN registry version 78 (ie. August 2017) as well as Wikipedia both list 4a,6n,8c as the format, ie. similarly considers four numbers followed by two numbers to be the expected format for this part of the BBAN.

Given the above, if your report is correct, it seems the Bulgarian BBAN specification including national checksum is wrong. This is possible, and I suspect that its restriction to numbers is now (ie. after the introduction of IBAN and the phase-out of the previous national system) considered out of date... and alphanumeric characters are now permitted. In any event, if your report is correct banks are issuing these, and some people have begun to accept them, despite being technically wrong.

To further investigate could you please supply the bank name and year of account opening?

Insufficient information.