Closed andyrh3 closed 11 months ago
@andyrh3 I found the answer here https://github.com/arturmkrtchyan/iban4j/blob/master/src/main/java/org/iban4j/bban/BbanStructure.java#L416
Oh great thank you for looking into this I will apply the change now and see if it fixes the issue.
Sorry for necro-bumping; was this ever resolved? I passed in an all-numeric sort code for the bankCode
property and I'm getting an IbanFormatException
from here: https://github.com/arturmkrtchyan/iban4j/blob/master/src/main/java/org/iban4j/IbanUtil.java#L420
Further testing: I believe sort code should actually be assigned to branchCode
. But this breaks the validation as bankCode
is required, which I don't have, e.g., you can calculate IBANs from just country, sort code, and account number here: https://www.iban.com/calculate-iban.
Assigning sort code to both bankCode
and branchCode
doesn't work either.
@fahim1D Sorry, I did not get your problem. According to the initial requirements, the branch code of the GB IBAN must be alphabetical(no numeric is acceptable). So this ticket was supposed to be closed at the time. Please provide your issue as a new ticket with complete data to be verified.
Iban iban = new Iban.Builder() .countryCode(CountryCode.GB) .bankCode("090136") .accountNumber("99736889") .build();
org.iban4j.IbanFormatException: [0901] must contain only upper case letters. at org.iban4j.IbanUtil.validateBbanEntryCharacterType(IbanUtil.java:391) at org.iban4j.IbanUtil.validateBbanEntries(IbanUtil.java:379) at org.iban4j.IbanUtil.validate(IbanUtil.java:80) at org.iban4j.Iban$Builder.build(Iban.java:365) at org.iban4j.Iban$Builder.build(Iban.java:337)