diff --git a/CHANGELOG.md b/CHANGELOG.md index 4faf1368..4555cbfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Prowide Core - CHANGELOG #### 9.5.3 - SNAPSHOT + * (PW-2040) Updated the BBAN validation data file to the IBAN REGISTRY Jul 2024 release * (PW-2006) Fixed `getMUR` and `setMUR` in `SwiftMessage` to prioritize field 108 in block 4 over block 3 for system messages (category 0) * Added new `MtSequenceEnum` with all the available inner sequences of specific MT schemas * Added `isSystemMessage()` to SwiftMessage to check if the message is a category 0 message (010. 011, etc...) diff --git a/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java b/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java index 34c9d92d..47568d7d 100644 --- a/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java +++ b/src/main/java/com/prowidesoftware/swift/model/IbanValidationResult.java @@ -42,7 +42,7 @@ public enum IbanValidationResult { INVALID_CHARACTERS("Invalid character '${found}' found"), MISSING_CHECK_DIGITS("Missing check digits"), INVALID_CHECK_DIGITS_FORMAT("Expected 2 check digits and found ${found}"), - IVALID_CHECK_DIGITS("The expected computed check digit is ${expectedCheckDigit} and ${found} was found"), + INVALID_CHECK_DIGITS("The expected computed check digit is ${expectedCheckDigit} and ${found} was found"), MISSING_BBAN("Missing custom account number (BBAN)"), BBAN_MAX_LENGTH( diff --git a/src/main/java/com/prowidesoftware/swift/model/IbanValidationUtils.java b/src/main/java/com/prowidesoftware/swift/model/IbanValidationUtils.java index 5d67ad43..5e775b0c 100644 --- a/src/main/java/com/prowidesoftware/swift/model/IbanValidationUtils.java +++ b/src/main/java/com/prowidesoftware/swift/model/IbanValidationUtils.java @@ -214,7 +214,7 @@ static IbanValidationResult validateCheckDigit(final String iban) { if (calculateMod(iban) != 1) { final String checkDigit = IBAN.getCheckDigits(iban); final String expectedCheckDigit = calculateCheckDigit(iban); - IbanValidationResult result = IbanValidationResult.IVALID_CHECK_DIGITS; + IbanValidationResult result = IbanValidationResult.INVALID_CHECK_DIGITS; result.setExpectedCheckDigit(expectedCheckDigit); result.setFound(checkDigit); return result; diff --git a/src/main/resources/BbanStructureValidations.json b/src/main/resources/BbanStructureValidations.json index 8dc55754..15ca5dc9 100644 --- a/src/main/resources/BbanStructureValidations.json +++ b/src/main/resources/BbanStructureValidations.json @@ -1,10 +1,10 @@ [ { - "country_code": "AL", + "country_code": "AD", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 4, "character_type": "n" }, { @@ -13,33 +13,38 @@ "character_type": "n" }, { - "entry_type": "national_check_digit", - "length": 16, + "entry_type": "account_number", + "length": 12, "character_type": "c" + } + ] + }, + { + "country_code": "AE", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 3, + "character_type": "n" }, { "entry_type": "account_number", - "length": 1, + "length": 16, "character_type": "n" } ] }, { - "country_code": "AD", + "country_code": "AL", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "n" - }, - { - "entry_type": "branch_code", - "length": 4, + "length": 8, "character_type": "n" }, { "entry_type": "account_number", - "length": 12, + "length": 16, "character_type": "c" } ] @@ -75,16 +80,26 @@ ] }, { - "country_code": "BH", + "country_code": "BA", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "a" + "length": 3, + "character_type": "n" + }, + { + "entry_type": "branch_code", + "length": 3, + "character_type": "n" }, { "entry_type": "account_number", - "length": 14, + "length": 8, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 2, "character_type": "n" } ] @@ -110,21 +125,61 @@ ] }, { - "country_code": "BA", + "country_code": "BG", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, - "character_type": "n" + "length": 4, + "character_type": "a" }, { "entry_type": "branch_code", - "length": 3, + "length": 4, + "character_type": "n" + }, + { + "entry_type": "account_type", + "length": 2, "character_type": "n" }, { "entry_type": "account_number", "length": 8, + "character_type": "c" + } + ] + }, + { + "country_code": "BH", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" + }, + { + "entry_type": "account_number", + "length": 14, + "character_type": "n" + } + ] + }, + { + "country_code": "BI", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 5, + "character_type": "n" + }, + { + "entry_type": "branch_code", + "length": 5, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 11, "character_type": "n" }, { @@ -165,26 +220,31 @@ ] }, { - "country_code": "BG", + "country_code": "BY", "validation_rules": [ { "entry_type": "bank_code", "length": 4, - "character_type": "a" + "character_type": "c" }, { - "entry_type": "branch_code", - "length": 4, - "character_type": "n" - }, + "entry_type": "account_number", + "length": 20, + "character_type": "c" + } + ] + }, + { + "country_code": "CH", + "validation_rules": [ { - "entry_type": "account_type", - "length": 2, + "entry_type": "bank_code", + "length": 5, "character_type": "n" }, { "entry_type": "account_number", - "length": 8, + "length": 12, "character_type": "c" } ] @@ -194,7 +254,7 @@ "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 4, "character_type": "n" }, { @@ -205,46 +265,46 @@ ] }, { - "country_code": "DE", + "country_code": "CY", "validation_rules": [ { "entry_type": "bank_code", - "length": 8, + "length": 3, "character_type": "n" }, { - "entry_type": "account_number", - "length": 10, + "entry_type": "branch_code", + "length": 5, "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 16, + "character_type": "c" } ] }, { - "country_code": "EG", + "country_code": "CZ", "validation_rules": [ { "entry_type": "bank_code", "length": 4, "character_type": "n" }, - { - "entry_type": "branch_code", - "length": 4, - "character_type": "n" - }, { "entry_type": "account_number", - "length": 17, + "length": 16, "character_type": "n" } ] }, { - "country_code": "HR", + "country_code": "DE", "validation_rules": [ { "entry_type": "bank_code", - "length": 7, + "length": 8, "character_type": "n" }, { @@ -255,11 +315,11 @@ ] }, { - "country_code": "CY", + "country_code": "DJ", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 5, "character_type": "n" }, { @@ -269,22 +329,12 @@ }, { "entry_type": "account_number", - "length": 16, + "length": 11, "character_type": "c" - } - ] - }, - { - "country_code": "CZ", - "validation_rules": [ - { - "entry_type": "bank_code", - "length": 4, - "character_type": "n" }, { - "entry_type": "account_number", - "length": 16, + "entry_type": "national_check_digit", + "length": 2, "character_type": "n" } ] @@ -299,7 +349,12 @@ }, { "entry_type": "account_number", - "length": 10, + "length": 9, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 1, "character_type": "n" } ] @@ -345,21 +400,46 @@ ] }, { - "country_code": "FO", + "country_code": "EG", "validation_rules": [ { "entry_type": "bank_code", "length": 4, "character_type": "n" }, + { + "entry_type": "branch_code", + "length": 4, + "character_type": "n" + }, { "entry_type": "account_number", - "length": 9, + "length": 17, + "character_type": "n" + } + ] + }, + { + "country_code": "ES", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "n" + }, + { + "entry_type": "branch_code", + "length": 4, "character_type": "n" }, { "entry_type": "national_check_digit", - "length": 1, + "length": 2, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 10, "character_type": "n" } ] @@ -369,12 +449,42 @@ "validation_rules": [ { "entry_type": "bank_code", - "length": 6, + "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 7, + "length": 11, + "character_type": "n" + } + ] + }, + { + "country_code": "FK", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 2, + "character_type": "a" + }, + { + "entry_type": "account_number", + "length": 12, + "character_type": "n" + } + ] + }, + { + "country_code": "FO", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 9, "character_type": "n" }, { @@ -409,6 +519,26 @@ } ] }, + { + "country_code": "GB", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" + }, + { + "entry_type": "branch_code", + "length": 6, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 8, + "character_type": "n" + } + ] + }, { "country_code": "GE", "validation_rules": [ @@ -490,51 +620,41 @@ ] }, { - "country_code": "HU", + "country_code": "HR", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, - "character_type": "n" - }, - { - "entry_type": "branch_code", - "length": 4, + "length": 7, "character_type": "n" }, { "entry_type": "account_number", - "length": 16, - "character_type": "n" - }, - { - "entry_type": "national_check_digit", - "length": 1, + "length": 10, "character_type": "n" } ] }, { - "country_code": "IS", + "country_code": "HU", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, + "length": 3, "character_type": "n" }, { "entry_type": "branch_code", - "length": 2, + "length": 4, "character_type": "n" }, { "entry_type": "account_number", - "length": 6, + "length": 16, "character_type": "n" }, { - "entry_type": "identification_number", - "length": 10, + "entry_type": "national_check_digit", + "length": 1, "character_type": "n" } ] @@ -580,16 +700,46 @@ ] }, { - "country_code": "IR", + "country_code": "IQ", "validation_rules": [ { "entry_type": "bank_code", + "length": 4, + "character_type": "a" + }, + { + "entry_type": "branch_code", "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 19, + "length": 12, + "character_type": "n" + } + ] + }, + { + "country_code": "IS", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "n" + }, + { + "entry_type": "branch_code", + "length": 2, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 6, + "character_type": "n" + }, + { + "entry_type": "identification_number", + "length": 10, "character_type": "n" } ] @@ -640,61 +790,61 @@ ] }, { - "country_code": "KZ", + "country_code": "KW", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, - "character_type": "n" + "length": 4, + "character_type": "a" }, { "entry_type": "account_number", - "length": 13, + "length": 22, "character_type": "c" } ] }, { - "country_code": "KW", + "country_code": "KZ", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "a" + "length": 3, + "character_type": "n" }, { "entry_type": "account_number", - "length": 22, + "length": 13, "character_type": "c" } ] }, { - "country_code": "LV", + "country_code": "LB", "validation_rules": [ { "entry_type": "bank_code", "length": 4, - "character_type": "a" + "character_type": "n" }, { "entry_type": "account_number", - "length": 13, + "length": 20, "character_type": "c" } ] }, { - "country_code": "LB", + "country_code": "LC", "validation_rules": [ { "entry_type": "bank_code", "length": 4, - "character_type": "n" + "character_type": "a" }, { "entry_type": "account_number", - "length": 20, + "length": 24, "character_type": "c" } ] @@ -745,52 +895,47 @@ ] }, { - "country_code": "MK", + "country_code": "LV", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, - "character_type": "n" + "length": 4, + "character_type": "a" }, { "entry_type": "account_number", - "length": 10, + "length": 13, "character_type": "c" - }, - { - "entry_type": "national_check_digit", - "length": 2, - "character_type": "n" } ] }, { - "country_code": "MT", + "country_code": "LY", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "a" + "length": 3, + "character_type": "n" }, { "entry_type": "branch_code", - "length": 5, + "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 18, - "character_type": "c" + "length": 15, + "character_type": "n" } ] }, { - "country_code": "MR", + "country_code": "MC", "validation_rules": [ { "entry_type": "bank_code", "length": 5, - "character_type": "a" + "character_type": "n" }, { "entry_type": "branch_code", @@ -805,47 +950,82 @@ { "entry_type": "national_check_digit", "length": 2, - "character_type": "c" + "character_type": "n" } ] }, { - "country_code": "MU", + "country_code": "MD", "validation_rules": [ { "entry_type": "bank_code", - "length": 6, + "length": 2, "character_type": "c" }, { - "entry_type": "branch_code", + "entry_type": "account_number", + "length": 18, + "character_type": "c" + } + ] + }, + { + "country_code": "ME", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 3, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 13, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", "length": 2, "character_type": "n" + } + ] + }, + { + "country_code": "MK", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 3, + "character_type": "n" }, { "entry_type": "account_number", - "length": 18, + "length": 10, "character_type": "c" + }, + { + "entry_type": "national_check_digit", + "length": 2, + "character_type": "n" } ] }, { - "country_code": "MD", + "country_code": "MN", "validation_rules": [ { "entry_type": "bank_code", - "length": 2, - "character_type": "c" + "length": 4, + "character_type": "n" }, { "entry_type": "account_number", - "length": 18, - "character_type": "c" + "length": 12, + "character_type": "n" } ] }, { - "country_code": "MC", + "country_code": "MR", "validation_rules": [ { "entry_type": "bank_code", @@ -860,7 +1040,7 @@ { "entry_type": "account_number", "length": 11, - "character_type": "c" + "character_type": "n" }, { "entry_type": "national_check_digit", @@ -870,22 +1050,57 @@ ] }, { - "country_code": "ME", + "country_code": "MT", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 4, + "character_type": "a" + }, + { + "entry_type": "branch_code", + "length": 5, "character_type": "n" }, { "entry_type": "account_number", - "length": 13, - "character_type": "n" + "length": 18, + "character_type": "c" + } + ] + }, + { + "country_code": "MU", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 6, + "character_type": "c" }, { - "entry_type": "national_check_digit", + "entry_type": "branch_code", "length": 2, "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 18, + "character_type": "c" + } + ] + }, + { + "country_code": "NI", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" + }, + { + "entry_type": "account_number", + "length": 20, + "character_type": "n" } ] }, @@ -925,22 +1140,22 @@ ] }, { - "country_code": "PK", + "country_code": "OM", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "c" + "length": 3, + "character_type": "n" }, { "entry_type": "account_number", "length": 16, - "character_type": "n" + "character_type": "c" } ] }, { - "country_code": "PS", + "country_code": "PK", "validation_rules": [ { "entry_type": "bank_code", @@ -949,7 +1164,7 @@ }, { "entry_type": "account_number", - "length": 21, + "length": 16, "character_type": "c" } ] @@ -957,25 +1172,30 @@ { "country_code": "PL", "validation_rules": [ - { - "entry_type": "bank_code", - "length": 3, - "character_type": "n" - }, { "entry_type": "branch_code", - "length": 4, + "length": 8, "character_type": "n" }, { - "entry_type": "national_check_digit", - "length": 1, + "entry_type": "account_number", + "length": 16, "character_type": "n" + } + ] + }, + { + "country_code": "PS", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" }, { "entry_type": "account_number", - "length": 16, - "character_type": "n" + "length": 21, + "character_type": "c" } ] }, @@ -1005,7 +1225,7 @@ ] }, { - "country_code": "RO", + "country_code": "QA", "validation_rules": [ { "entry_type": "bank_code", @@ -1014,13 +1234,13 @@ }, { "entry_type": "account_number", - "length": 16, + "length": 21, "character_type": "c" } ] }, { - "country_code": "QA", + "country_code": "RO", "validation_rules": [ { "entry_type": "bank_code", @@ -1029,22 +1249,37 @@ }, { "entry_type": "account_number", - "length": 21, + "length": 16, "character_type": "c" } ] }, { - "country_code": "SM", + "country_code": "RS", "validation_rules": [ { - "entry_type": "national_check_digit", - "length": 1, - "character_type": "a" + "entry_type": "bank_code", + "length": 3, + "character_type": "n" }, + { + "entry_type": "account_number", + "length": 13, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 2, + "character_type": "n" + } + ] + }, + { + "country_code": "RU", + "validation_rules": [ { "entry_type": "bank_code", - "length": 5, + "length": 9, "character_type": "n" }, { @@ -1054,7 +1289,7 @@ }, { "entry_type": "account_number", - "length": 12, + "length": 15, "character_type": "c" } ] @@ -1075,113 +1310,118 @@ ] }, { - "country_code": "RS", + "country_code": "SC", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 6, + "character_type": "c" + }, + { + "entry_type": "branch_code", + "length": 2, "character_type": "n" }, { "entry_type": "account_number", - "length": 13, + "length": 16, "character_type": "n" }, { - "entry_type": "national_check_digit", - "length": 2, - "character_type": "n" + "entry_type": "currency", + "length": 3, + "character_type": "a" } ] }, { - "country_code": "SK", + "country_code": "SD", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, + "length": 2, "character_type": "n" }, { "entry_type": "account_number", - "length": 16, + "length": 12, "character_type": "n" } ] }, { - "country_code": "SI", + "country_code": "SE", "validation_rules": [ { "entry_type": "bank_code", - "length": 2, - "character_type": "n" - }, - { - "entry_type": "branch_code", "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 8, + "length": 16, "character_type": "n" }, { "entry_type": "national_check_digit", - "length": 2, + "length": 1, "character_type": "n" } ] }, { - "country_code": "ES", + "country_code": "SI", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, + "length": 5, "character_type": "n" }, { - "entry_type": "branch_code", - "length": 4, + "entry_type": "account_number", + "length": 8, "character_type": "n" }, { "entry_type": "national_check_digit", "length": 2, "character_type": "n" - }, - { - "entry_type": "account_number", - "length": 10, - "character_type": "n" } ] }, { - "country_code": "SE", + "country_code": "SK", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 4, "character_type": "n" }, { "entry_type": "account_number", - "length": 17, + "length": 16, "character_type": "n" } ] }, { - "country_code": "CH", + "country_code": "SM", "validation_rules": [ + { + "entry_type": "national_check_digit", + "length": 1, + "character_type": "a" + }, { "entry_type": "bank_code", "length": 5, "character_type": "n" }, + { + "entry_type": "branch_code", + "length": 5, + "character_type": "n" + }, { "entry_type": "account_number", "length": 12, @@ -1190,11 +1430,11 @@ ] }, { - "country_code": "TN", + "country_code": "SO", "validation_rules": [ { "entry_type": "bank_code", - "length": 2, + "length": 4, "character_type": "n" }, { @@ -1204,72 +1444,107 @@ }, { "entry_type": "account_number", - "length": 15, - "character_type": "c" + "length": 12, + "character_type": "n" } ] }, { - "country_code": "TR", + "country_code": "ST", "validation_rules": [ { "entry_type": "bank_code", - "length": 5, + "length": 4, + "character_type": "n" + }, + { + "entry_type": "branch_code", + "length": 4, + "character_type": "n" + }, + { + "entry_type": "account_number", + "length": 11, "character_type": "n" }, { "entry_type": "national_check_digit", - "length": 1, - "character_type": "c" + "length": 2, + "character_type": "n" + } + ] + }, + { + "country_code": "SV", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" }, { "entry_type": "account_number", - "length": 16, - "character_type": "c" + "length": 20, + "character_type": "n" } ] }, { - "country_code": "UA", + "country_code": "TL", "validation_rules": [ { "entry_type": "bank_code", - "length": 6, + "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 19, + "length": 14, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 2, "character_type": "n" } ] }, { - "country_code": "GB", + "country_code": "TN", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "a" + "length": 2, + "character_type": "n" }, { "entry_type": "branch_code", - "length": 6, + "length": 3, "character_type": "n" }, { "entry_type": "account_number", - "length": 8, + "length": 13, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 2, "character_type": "n" } ] }, { - "country_code": "AE", + "country_code": "TR", "validation_rules": [ { "entry_type": "bank_code", - "length": 3, + "length": 5, + "character_type": "n" + }, + { + "entry_type": "national_check_digit", + "length": 1, "character_type": "n" }, { @@ -1280,22 +1555,22 @@ ] }, { - "country_code": "VG", + "country_code": "UA", "validation_rules": [ { "entry_type": "bank_code", - "length": 4, - "character_type": "c" + "length": 6, + "character_type": "n" }, { "entry_type": "account_number", - "length": 16, - "character_type": "n" + "length": 19, + "character_type": "c" } ] }, { - "country_code": "TL", + "country_code": "VA", "validation_rules": [ { "entry_type": "bank_code", @@ -1304,12 +1579,22 @@ }, { "entry_type": "account_number", - "length": 14, + "length": 15, "character_type": "n" + } + ] + }, + { + "country_code": "VG", + "validation_rules": [ + { + "entry_type": "bank_code", + "length": 4, + "character_type": "a" }, { - "entry_type": "national_check_digit", - "length": 2, + "entry_type": "account_number", + "length": 16, "character_type": "n" } ] @@ -1324,7 +1609,7 @@ }, { "entry_type": "branch_code", - "length": 12, + "length": 2, "character_type": "n" }, { @@ -1340,7 +1625,7 @@ ] }, { - "country_code": "SC", + "country_code": "YE", "validation_rules": [ { "entry_type": "bank_code", @@ -1354,13 +1639,8 @@ }, { "entry_type": "account_number", - "length": 16, - "character_type": "n" - }, - { - "entry_type": "currency", - "length": 3, - "character_type": "a" + "length": 18, + "character_type": "c" } ] } diff --git a/src/main/resources/BbanStructureValidations.json.info b/src/main/resources/BbanStructureValidations.json.info new file mode 100644 index 00000000..4b63414d --- /dev/null +++ b/src/main/resources/BbanStructureValidations.json.info @@ -0,0 +1 @@ +Last update of the JSON data structure: IBAN REGISTRY ISO 13616 Release 98 – Jul 2024 \ No newline at end of file diff --git a/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java b/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java index 861e51b3..dc5304ed 100644 --- a/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java +++ b/src/test/java/com/prowidesoftware/swift/constraints/IbanValidatorTest.java @@ -118,12 +118,12 @@ public void testBbanMaxLengthExceeded() { @Test public void testMissingBbanConfiguration() { - String missingBbanConfigIban = "FK64123456789"; + String missingBbanConfigIban = "AX64123456789"; assertEquals(IbanValidationResult.MISSING_BBAN_CONFIGURATION, new IBAN(missingBbanConfigIban).validate()); assertFalse(validator.isValid(missingBbanConfigIban, context)); assertTrue(context.isViolationOccurred()); assertEquals( - "Missing custom account number (BBAN) configuration for country FK", context.getViolationMessage()); + "Missing custom account number (BBAN) configuration for country AX", context.getViolationMessage()); } @Test @@ -181,7 +181,7 @@ public void testInvalidCharacters() { @Test public void testInvalidCheckDigits() { String invalidCheckDigitsIban = "ES0012345678901234567890"; // Invalid computed check digits - assertEquals(IbanValidationResult.IVALID_CHECK_DIGITS, new IBAN(invalidCheckDigitsIban).validate()); + assertEquals(IbanValidationResult.INVALID_CHECK_DIGITS, new IBAN(invalidCheckDigitsIban).validate()); assertFalse(validator.isValid(invalidCheckDigitsIban, context)); assertTrue(context.isViolationOccurred()); assertEquals("The expected computed check digit is 98 and 00 was found", context.getViolationMessage()); diff --git a/src/test/java/com/prowidesoftware/swift/model/IBANTest.java b/src/test/java/com/prowidesoftware/swift/model/IBANTest.java index faa407ad..59b57298 100644 --- a/src/test/java/com/prowidesoftware/swift/model/IBANTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/IBANTest.java @@ -262,12 +262,103 @@ public void testSomeValidCodes() { assertIbanOk(" GB06 LOYD 3097 5104 5702 05."); assertIbanOk("GB26BOFS80200643721002"); assertIbanOk("EG389004000100300074201200001"); + assertIbanOk("IL620108000000099999999"); + + assertIbanOk("AD1200012030200359100100"); // Andorra + assertIbanOk("AE070331234567890123456"); // United Arab Emirates + assertIbanOk("AL7620511021812537CLPRCFUSDP"); // Albania + assertIbanOk("AT611904300234573201"); // Austria + assertIbanOk("AZ21NABZ00000000137010001944"); // Azerbaijan + assertIbanOk("BA391290079401028494"); // Bosnia and Herzegovina + assertIbanOk("BE68539007547034"); // Belgium + assertIbanOk("BG80BNBG96611020345678"); // Bulgaria + assertIbanOk("BH67BMAG00001299123456"); // Bahrain + assertIbanOk("BI4210000100010000332045181"); // Burundi + assertIbanOk("BR1800360305000010009795493C1"); // Brazil + assertIbanOk("BY13NBRB3600900000002Z00AB00"); // Republic of Belarus + assertIbanOk("CH9300762011623852957"); // Switzerland + assertIbanOk("CR05015202001026284066"); // Costa Rica + assertIbanOk("CY17002001280000001200527600"); // Cyprus + assertIbanOk("CZ6508000000192000145399"); // Czech Republic + assertIbanOk("DE89370400440532013000"); // Germany + assertIbanOk("DJ2100010000000154000100186"); // Djibouti + assertIbanOk("DK5000400440116243"); // Denmark + assertIbanOk("DO28BAGR00000001212453611324"); // Dominican Republic + assertIbanOk("EE382200221020145685"); // Estonia + assertIbanOk("EG380019000500000000263180002"); // Egypt + assertIbanOk("ES9121000418450200051332"); // Spain + assertIbanOk("FI2112345600000785"); // Finland + assertIbanOk("FK88SC123456789012"); // Falkland Islands + assertIbanOk("FO6264600001631634"); // Faroe Islands + assertIbanOk("FR1420041010050500013M02606"); // France + assertIbanOk("GB29NWBK60161331926819"); // United Kingdom + assertIbanOk("GE29NB0000000101904917"); // Georgia + assertIbanOk("GI75NWBK000000007099453"); // Gibraltar + assertIbanOk("GL8964710001000206"); // Greenland + assertIbanOk("GR1601101250000000012300695"); // Greece + assertIbanOk("GT82TRAJ01020000001210029690"); // Guatemala + assertIbanOk("HR1210010051863000160"); // Croatia + assertIbanOk("HU42117730161111101800000000"); // Hungary + assertIbanOk("IE29AIBK93115212345678"); // Ireland + assertIbanOk("IL620108000000099999999"); // Israel + assertIbanOk("IQ98NBIQ850123456789012"); // Iraq + assertIbanOk("IS140159260076545510730339"); // Iceland + assertIbanOk("IT60X0542811101000000123456"); // Italy + assertIbanOk("JO94CBJO0010000000000131000302"); // Jordan + assertIbanOk("KW81CBKU0000000000001234560101"); // Kuwait + assertIbanOk("KZ86125KZT5004100100"); // Kazakhstan + assertIbanOk("LB62099900000001001901229114"); // Lebanon + assertIbanOk("LC55HEMM000100010012001200023015"); // Saint Lucia + assertIbanOk("LI21088100002324013AA"); // Liechtenstein + assertIbanOk("LT121000011101001000"); // Lithuania + assertIbanOk("LU280019400644750000"); // Luxembourg + assertIbanOk("LV80BANK0000435195001"); // Latvia + assertIbanOk("LY83002048000020100120361"); // Libya + assertIbanOk("MC5811222000010123456789030"); // Monaco + assertIbanOk("MD24AG000225100013104168"); // Moldova + assertIbanOk("ME25505000012345678951"); // Montenegro + assertIbanOk("MK07200002785123453"); // North Macedonia + assertIbanOk("MR1300020001010000123456753"); // Mauritania + assertIbanOk("MT84MALT011000012345MTLCAST001S"); // Malta + assertIbanOk("MU17BOMM0101101030300200000MUR"); // Mauritius + assertIbanOk("NL91ABNA0417164300"); // Netherlands + assertIbanOk("NO9386011117947"); // Norway + assertIbanOk("PK36SCBL0000001123456702"); // Pakistan + assertIbanOk("PL61109010140000071219812874"); // Poland + assertIbanOk("PS92PALS000000000400123456702"); // Palestine, State of + assertIbanOk("PT50000201231234567890154"); // Portugal + assertIbanOk("QA58DOHB00001234567890ABCDEFG"); // Qatar + assertIbanOk("RO49AAAA1B31007593840000"); // Romania + assertIbanOk("RS35260005601001611379"); // Serbia + assertIbanOk("SA0380000000608010167519"); // Saudi Arabia + assertIbanOk("SC18SSCB11010000000000001497USD"); // Seychelles + assertIbanOk("SE4550000000058398257466"); // Sweden + assertIbanOk("SI56263300012039086"); // Slovenia + assertIbanOk("SK3112000000198742637541"); // Slovakia + assertIbanOk("SM86U0322509800000000270100"); // San Marino + assertIbanOk("ST32000200010192194210112"); // Sao Tome and Principe + assertIbanOk("SV62CENR00000000000000700025"); // El Salvador + assertIbanOk("TL380080012345678910157"); // Timor-Leste + assertIbanOk("TN5914207207100707129648"); // Tunisia + assertIbanOk("TR330006100519786457841326"); // Turkey + assertIbanOk("UA213223130000026007233566001"); // Ukraine + assertIbanOk("VG96VPVG0000012345678901"); // Virgin Islands + assertIbanOk("XK051212012345678906"); // Kosovo + assertIbanOk("YE15CBYE0001018861234567891234"); // Yemen + + assertIbanOk("IQ24TRIQ994005007249002"); + assertIbanOk("IQ24TRIQ994005007249002"); + assertIbanOk("LY57009001000000000003093"); + assertIbanOk("AL7620511021812537CLPRCFUSDP"); + assertIbanOk("AL9220512046016756CLPRCFEURR"); + assertIbanOk("BY41PJCB30120730451000000840"); + assertIbanOk("BY98PJCB30120730451000000978"); } private void assertIbanOk(String string) { IBAN iban = new IBAN(string); IbanValidationResult result = iban.validate(); // System.out.println(result.message()); - assertEquals(result, IbanValidationResult.OK); + assertEquals(IbanValidationResult.OK, result); } }