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
274 stars 124 forks source link

BIC Bankcode alphanumeric #114

Open nbrass opened 1 year ago

nbrass commented 1 year ago

Hi, I'm currently struggling with BIC validation (BicUtil.validate()) that throws me an error when validating BICs containing numeric values in the first four digits (bank code) of a BIC. I think the bank code can be alphanumeric as stated here: SWIFT BIC Standard

The ISO 9362 standard is available from ISO at www.iso.org.

The BIC is an 8 character code, defined as ‘business party identifier’, consisting of the business party prefix (4 alphanumeric), the country code as defined in ISO 3166-1 (2 alphabetic), and the business party suffix (2 alphanumeric).

The branch identifier is a 3 character optional element that can supplement the 8 character BIC, used to identify specific locations, departments, services or units of the same business party.

Can you please check this? Thanks in advance!

Best regards Norman

hajk1 commented 1 year ago

Hi @nbrass, can you provide me with an example?

nbrass commented 1 year ago

Hi @hajk1, sure. For example BicUtil.validate("1234DEFFXXX")

hajk1 commented 1 year ago

Thanks @nbrass, you are right. I'm curious does this happen in the real world as well?

nbrass commented 1 year ago

I've not seen it so far, but during test data generation we've found this issue.

machajdik commented 9 months ago

Hi, maybe it might be a good idea to make this configurable somehow. I also have not yet seen a BIC with numbers in the bank code. And at least in the SEPA area, there is no such BIC code (source: https://www.europeanpaymentscouncil.eu/sites/default/files/participants_export/sct/sct.csv) and banking software generally seems to validate against chars only (e.g. https://wise.com/gb/swift-codes/bic-swift-code-checker).