diff options
| author | Christophe Gesché <[email protected]> | 2021-02-24 07:14:08 +0100 |
|---|---|---|
| committer | Christophe Gesché <[email protected]> | 2021-02-24 07:14:08 +0100 |
| commit | 6eba12687a2e5ecaf72e52f5e13306fc5c07c2ad (patch) | |
| tree | 9a0ef75e8a5d5e9e88c33f0c167002ebd974f36f | |
| parent | 03f735dbc1b2a693f8b73233c49addd4d1362d12 (diff) | |
| download | faker-6eba12687a2e5ecaf72e52f5e13306fc5c07c2ad.tar.xz faker-6eba12687a2e5ecaf72e52f5e13306fc5c07c2ad.zip | |
close #846
fix iban for azerbaijan
| -rw-r--r-- | lib/iban.js | 10 | ||||
| -rw-r--r-- | test/finance_issue.unit.js | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/iban.js b/lib/iban.js index b334d9bb..e9f8318f 100644 --- a/lib/iban.js +++ b/lib/iban.js @@ -67,11 +67,19 @@ module["exports"] = { format: "ATkk bbbb bccc cccc cccc" }, { + // Azerbaijan + // https://transferwise.com/fr/iban/azerbaijan + // Length 28 + // BBAN 2c,16n + // GEkk bbbb cccc cccc cccc cccc cccc + // b = National bank code (alpha) + // c = Account number + // example IBAN AZ21 NABZ 0000 0000 1370 1000 1944 country: "AZ", total: 28, bban: [ { - type: "c", + type: "a", count: 4 }, { diff --git a/test/finance_issue.unit.js b/test/finance_issue.unit.js index 7c59d780..ae30a91c 100644 --- a/test/finance_issue.unit.js +++ b/test/finance_issue.unit.js @@ -137,8 +137,8 @@ describe('finance_issue.js', function () { describe("issue_846 IBAN Azerbaijan", function () { // Azerbaijan // https://transferwise.com/fr/iban/azerbaijan - // Length 21 - // BBAN 2c,16n + // Length 28 + // BBAN 4c,20n // GEkk bbbb cccc cccc cccc cccc cccc // b = National bank code (alpha) // c = Account number @@ -149,7 +149,7 @@ describe('finance_issue.js', function () { it("IBAN for Azerbaijan is correct", function () { - faker.seed(17); + faker.seed(21); var iban = getAnIbanByCountry('AZ'); var ibanFormated = iban.match(/.{1,4}/g).join(" "); var bban = iban.substring(4) + iban.substring(0, 4); @@ -159,7 +159,7 @@ describe('finance_issue.js', function () { assert.ok(iban.substring(0, 2).match(/^[A-Z]{2}$/), iban.substring(0, 2) + ' must contains only characters in AZ IBAN ' + ibanFormated); assert.ok(iban.substring(2, 4).match(/^\d{2}$/), iban.substring(2, 4) + ' must contains only digit in AZ IBAN ' + ibanFormated); assert.ok(iban.substring(4, 8).match(/^[A-Z]{4}$/), iban.substring(4, 8) + ' must contains only characters in AZ IBAN ' + ibanFormated); - assert.ok(iban.substring(8, 24).match(/^\d{20}$/), iban.substring(8, 24) + ' must contains only characters in AZ IBAN ' + ibanFormated); + assert.ok(iban.substring(8, 28).match(/^\d{20}$/), iban.substring(8, 28) + ' must contains 20 characters in AZ IBAN ' + ibanFormated); assert.equal(ibanLib.mod97(ibanLib.toDigitString(bban)), 1, "the result should be equal to 1"); }); |
