arturmkrtchyan / iban4j

A Java library for generation and validation of the International Bank Account Numbers (IBAN ISO_13616) and Business Identifier Codes (BIC ISO_9362).
http://iban4j.org
Apache License 2.0
271 stars 124 forks source link

Vatican Iban #66

Closed fiaschi closed 3 years ago

fiaschi commented 4 years ago

Library return an error with Vatican iban. Country Code "VA" is not present in BbanStructure.

bvaardal commented 4 years ago

Hi @fiaschi,

Do you have any documentation on the VA IBAN structure?

bvaardal commented 4 years ago

https://en.wikipedia.org/wiki/International_Bank_Account_Number#EEA_and_territories has details with https://www.iban.com/structure ("Holy See") as the source.

mikegr commented 4 years ago

When do you plan to release a 3.3.0?

adnanel commented 3 years ago

Issue still persists on 3.2.3-RELEASE.

Iban.valueOf("VA12345678912345678912");

 Exception in thread "main" org.iban4j.UnsupportedCountryException: Country code is not supported.
    at org.iban4j.IbanUtil.validateCountryCode(IbanUtil.java:331)
    at org.iban4j.IbanUtil.validate(IbanUtil.java:74)
    at org.iban4j.Iban.valueOf(Iban.java:150)

I expected an exception like:

[VA12345678912345678912] has invalid check digit: X, expected check digit is: Y

But it seems that it still fails on the country code validation.

FrankHossfeld commented 3 years ago

@adnanel if you can not wait for the next release, check iban4g. Fix is included in latest release: https://github.com/NaluKit/iban4g