Skip to content

Fix for extraction of German account number #556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/ibantools.js
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ define(["require", "exports"], function (require, exports) {
IBANRegistry: true,
SEPA: true,
bank_identifier: '0-7',
account_indentifier: '13-22',
account_indentifier: '12-22',
},
DJ: {
chars: 27,
Expand Down
2 changes: 1 addition & 1 deletion src/ibantools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ export const countrySpecs: CountryMapInternal = {
IBANRegistry: true,
SEPA: true,
bank_identifier: '0-7',
account_indentifier: '13-22',
account_indentifier: '12-22',
},
DJ: {
chars: 27,
Expand Down
22 changes: 22 additions & 0 deletions test/ibantools_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,28 @@ describe('IBANTools', function() {
});
});

describe('When calling extractIBAN() with valid German IBAN', function () {
var ext = iban.extractIBAN('DE75512108001245126199');
it('valid should be true', function () {
expect(ext.valid).to.be.true;
});
it('IBAN should be DE75512108001245126199', function () {
expect(ext.iban).to.equal('DE75512108001245126199');
});
it('BBAN should be 512108001245126199', function () {
expect(ext.bban).to.equal('512108001245126199');
});
it('countryCode should be DE', function () {
expect(ext.countryCode).to.equal('DE');
});
it('accountNumber should be 1245126199', function () {
expect(ext.accountNumber).to.equal('1245126199');
});
it('bankIdentifier should be 51210800', function () {
expect(ext.bankIdentifier).to.equal('51210800');
});
});

describe('When calling extractIBAN() with invalid IBAN', function() {
var ext = iban.extractIBAN('BR970036030510009795493P1');
it('valid should be false', function() {
Expand Down
Loading