From 744d84d5f8e42a3c24b54f065160cad68a6a2e07 Mon Sep 17 00:00:00 2001 From: emmenemoi Date: Fri, 4 May 2018 17:50:10 +0200 Subject: [PATCH 1/2] add MG (Madagascar) country --- src/main/java/org/iban4j/bban/BbanStructure.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/iban4j/bban/BbanStructure.java b/src/main/java/org/iban4j/bban/BbanStructure.java index 204ae0d..7612bca 100644 --- a/src/main/java/org/iban4j/bban/BbanStructure.java +++ b/src/main/java/org/iban4j/bban/BbanStructure.java @@ -304,6 +304,13 @@ private BbanStructure(final BbanStructureEntry... entries) { BbanStructureEntry.accountNumber(13, 'n'), BbanStructureEntry.nationalCheckDigit(2, 'n'))); + structures.put(CountryCode.MG, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + structures.put(CountryCode.NL, new BbanStructure( BbanStructureEntry.bankCode(4, 'a'), From ff86b03082addf7c7e456df99b0bb14fec6b38cc Mon Sep 17 00:00:00 2001 From: emmenemoi Date: Fri, 4 May 2018 18:05:42 +0200 Subject: [PATCH 2/2] change to same as French format + add test helper --- src/main/java/org/iban4j/bban/BbanStructure.java | 2 +- src/test/java/org/iban4j/TestDataHelper.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/iban4j/bban/BbanStructure.java b/src/main/java/org/iban4j/bban/BbanStructure.java index 7612bca..d90f82f 100644 --- a/src/main/java/org/iban4j/bban/BbanStructure.java +++ b/src/main/java/org/iban4j/bban/BbanStructure.java @@ -308,7 +308,7 @@ private BbanStructure(final BbanStructureEntry... entries) { new BbanStructure( BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.accountNumber(11, 'c'), BbanStructureEntry.nationalCheckDigit(2, 'n'))); structures.put(CountryCode.NL, diff --git a/src/test/java/org/iban4j/TestDataHelper.java b/src/test/java/org/iban4j/TestDataHelper.java index ad2967d..c004ba8 100644 --- a/src/test/java/org/iban4j/TestDataHelper.java +++ b/src/test/java/org/iban4j/TestDataHelper.java @@ -275,6 +275,13 @@ public static Collection getIbanData() { .accountNumber("0000123456789") .nationalCheckDigit("51") .build(), "ME25505000012345678951"}, + {new Iban.Builder() + .countryCode(CountryCode.MG) + .bankCode("91389") + .branchCode("12738") + .accountNumber("36945544212") + .nationalCheckDigit("12") + .build(), "MG5791389127383694554421212"}, {new Iban.Builder() .countryCode(CountryCode.NL) .bankCode("ABNA")