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

Improve Iban.Builder validation #80

Open ccostin93 opened 3 years ago

ccostin93 commented 3 years ago

I extended the Iban.Builder validation to be based on BbanStructure of the passed country. If some entry is missing, the validation will throw an exception with the missing field. This makes sense because the BbanStructure will be used in the next steps formatIban -> formatBban and there is no reason to go to this step if the given data is not enough to generate a valid IBAN.

Changes:

Related issues:

@hajk1 This PR also relates to your proposed fix in: https://github.com/arturmkrtchyan/iban4j/pull/75