Closed fahim1D closed 4 months ago
AFAIK in the UK, the sort code is used to identify the bank and the branch where an account is held. Each bank has a unique set of sort codes for its various branches. If you have the sort code, you can often determine the bank and its specific branch.
There are several methods to find out a bank branch using its sort code:
Iban4j is an offline library and tries to be generic for all the supporting countries. It's so tricky to try to keep up-to-date details that are country-specific and volatile. Maybe it's better to provide some online services in the future which are hardly possible to be free of charge.
@fahim1D Please confirm if I understood your desired requirement
Using the example from the README:
I encounter an IbanFormatException:
[1234] must contain only upper case letters.
In the code above, I'm supplying sort code to the
bankCode
field. After I investigated the the iban4j code a little bit, I was able to get a working example by assigning the sort code to thebranchCode
field instead, and I supplied abankCode
consisting only of letters.I was able to get a bank code using https://www.iban.com/calculate-iban, which only requires a sort code and account number.
Can iban4j calculate IBANs from just sort code and account number? The website was just to test the results of this library, but in production I won't have access to a
bankCode
property.Note: I supplied a dummy bank code and account number but I believe the point still stands.