arhs / iban.js Goto Github PK
View Code? Open in Web Editor NEWIBAN & BBAN validation, formatting and conversion in Javascript
Home Page: https://arhs.github.io/iban.js/
License: MIT License
IBAN & BBAN validation, formatting and conversion in Javascript
Home Page: https://arhs.github.io/iban.js/
License: MIT License
I've tested it in my own script in IE 8 and it didn't work.
I've tested your website in IE 8 and that didn't work either.
Conclusion: It doesn't work in IE8
SCRIPT438: Object doesn't support property or method 'isValid'
Hi there,
I tried your script with several Dutch bank account numbers, but without success..
These should pass:
123456789 (IBAN should be: NL13TEST0123456789)
167140582 (IBAN should be: NL15RABO0167140582)
2445588 (IBAN should be: NL86INGB0002445588)
The code I tried:
IBAN.fromBBAN('NL','167140582')
and
IBAN.fromBBAN('NL','0167140582')
Best, Dirk
According to https://www.iban.com/testibans the following IBANs are invalid:
GB00HLFX11016111455365
GB01BARC20714583608387
But this library considers these IBANs as valid.
Hello,
VA59001123000012345678 is a valid Vatican City IBAN. Are there any plans to support these new countries?
Could you republish iban to npm? There seems to be some kind of error with it currently, some files seem to be missing and clean install ends with 404.
Just run the following to repush it with the same version number
npm publish -f
Current output of npm install iban
:
npm http GET https://registry.npmjs.org/iban
npm http 200 https://registry.npmjs.org/iban
npm http GET https://registry.npmjs.org/iban/-/iban-0.0.2.tgz
npm http 404 https://registry.npmjs.org/iban/-/iban-0.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/iban/-/iban-0.0.2.tgz
npm ERR! Error: 404 Not Found
npm ERR! at WriteStream.<anonymous> (/Users/andris/.nvm/v0.10.25/lib/node_modules/npm/lib/utils/fetch.js:57:12)
npm ERR! at WriteStream.EventEmitter.emit (events.js:117:20)
npm ERR! at fs.js:1596:14
npm ERR! at /Users/andris/.nvm/v0.10.25/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:103:5
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/andris/.nvm/v0.10.25/bin/node" "/Users/andris/.nvm/v0.10.25/bin/npm" "install" "iban"
npm ERR! cwd /Users/andris/Desktop
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/andris/Desktop/npm-debug.log
npm ERR! not ok code 0
For instance, we are using local gb account number with sort code.
How can I validate it with this library?
iban.isValidBBAN(country name + sort code + account number) not working
I am using iban.js to mark entered IBAN valid or invalid by using function .isValid(IBAN), I find illogical to verify IBAN valid, when you can enter non alphanumeric characters into iban. The IBAN spec does not accept non-alphanumeric charactes, so is it valid IBAN if you have them?
According to SWIFT's IBAN registry (https://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf), the format for moldovan IBAN is MD2!n20!c
but in the lib, we validate on MD2!n18!c
.
This makes it easier to go from github to the node.js package.
As example see:
https://github.com/StefH/string-split-join
Like title, in code I spoted new Specification("PL", 28, "F08F16", "PL61109010140000071219812874")
where in Poland should be F02F08F16
for BBAN:
F02
is control sum
F08
is bank settlement number
F16
is client number
Array.prototype.map polyfill should be removed. It should be done instead by the user (the application that is using iban.js).
And of course bump major version number and add some documentation about it inside README.md (in a section like "Supported browsers", example: https://reactjs.org/docs/react-dom.html#browser-support).
(btw Array.prototype.map is implemented by all browsers and IE >= 9)
This issue tracks the requirements for the rewrite of iban.js
When using npm audit :
/node_modules/iban/demo/bower_components/bootstrap/dist/js/bootstrap.js
↳ bootstrap 3.3.7 has known vulnerabilities: severity: medium; issue: 20184, summary: XSS in data-target attribute; twbs/bootstrap#20184
/node_modules/iban/demo/bower_components/bootstrap/dist/js/bootstrap.min.js
↳ bootstrap 3.3.7 has known vulnerabilities: severity: medium; issue: 20184, summary: XSS in data-target attribute; twbs/bootstrap#20184
Can you consider upgrading the demo bootstrap to a higher, fixed version ?
Hi..!
Library currently supports national IBAN formats of those countries that are compliant with the ISO 13616 standard (Published by SWIFT). But there are some partial IBAN countries (many banks work with them) needs to be added in lib.
For reference please see --> https://www.iban.com/structure.html
I have a valid BBAN but the method isValidBBAN
returns false with it:
iban.toBBAN('CR25010200009074883572');
// '0102 00009074883572'
iban.isValidBBAN('0102 00009074883572');
// false
iban.isValidBBAN(iban.toBBAN('CR25010200009074883572'));
// false
We have a customer with an IBAN number from Ivory Coast, this number is a valid number and renderd as valid by www.iban.com
However this libary (which we use in our software) returns that the specific IBAN number is not valid.
Note that for privacy reasons we cannot post the actual bank account number which has the issue.
On https://www.iban.com/structure.html there is a test number with the same behaviour: CI93CI0080111301134291200589
For me it seems that the validator is too flexible. It says that this is valid:
FI@ +425*000*151=0 == #000$ 0° 23€€€!!!!!
And altho technically it does contain valid numbers for an fictional IBAN number, that gibberish in my mind should not count as a valid IBAN.
It would be nice to be able to get the country code from an IBAN without doing .slice(0, 2)
(which I only learned was true for all IBAN's by reading the source).
It could be implemented in several ways: a parse
method could return an object with properties like countryCode
and methods like toBBAN
.
Could you possibly add the following regular expression to also validate a BIC (because mostly both fields are requested) or is that feature out of scope?
^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$
According to https://www.iban.com/iban-checker the IBAN VG4835Q30660010096333091 'appears to be valid' but according to https://arhs.github.io/iban.js/ it is invalid.
bower not-cached git://github.com/arhs/iban.js.git#*
bower resolve git://github.com/arhs/iban.js.git#*
bower download https://github.com/arhs/iban.js/archive/v0.0.5.tar.gz
bower extract iban#* archive.tar.gz
bower mismatch Version declared in the json (0.0.4) is different than the resolved one (0.0.5)
bower resolved git://github.com/arhs/iban.js.git#0.0.5
bower install iban#0.0.5
iban#0.0.5 bower_components\iban
https://github.com/arhs/iban.js/blob/v0.0.5/bower.json#L4 should be "version": "0.0.5",
This package did not support SEPA countries IBAN. I want to validate Austria IBAN: AT61 1904 3002 3457 3201
but its return false, not validate. I have to check all SEPA county's IBAN.
Please confirm, is it true or me something doing wrong.
Thanks
SK1211115351562002977968
Here, according to https://www.ibancalculator.com/iban_validieren.html (and failed bank transfer), account number has invalid checksum and is invalid. iban.js though returns true in isValid()
Currently, there are no tags yet. This means that installing via bower using semver specifications is impossible.
A workaround is by specifying the dependency directly on a particular commit hash, but that's awkward:
{
"dependencies":
{
"iban": "[email protected]:arhs/iban.js.git#731a407833f7d347a3da8982302c36bd4818c2f0"
}
}
So, please push tags for the released versions.
Support for requireJS module style would be really nice.
Thank you very much for writing this handy module!
My only issue: When updating to new versions, there is no CHANGELOG
file or list of changes in the releases tab on Github. When updating lots of packages at once, looking through commits for each of them is really painful.
Could you please consider adding one? Thank you very much in advance. 😊
Rewriting iban.js
is not that hard, but I fail to migrate the tests...
The following string results in true
:
IT66`M0306905020100000062186
I think the character:
`
should invalidate it. Most online validators show invalidity as well.
I used this service to generate some Morocco IBANs: http://randomiban.com/?country=Morocco
Example: MA49954763443342261855294477
The library consideres them as invalid.
Working with Ethereum I needed to add my own custom specifications. I currently do this by copying an existing entries from IBAN.countries to hijack, and replace all the values within it.
Ideally I would like IBAN.Specification exposed as well as the second parameter to use a passed in Specification instead of a country code for IBAN.fromBBAN.
I can make a pull request if you are interested. It is fully backward compatible. Thanks.
E.g.
const notValidIban = 'DE893704 0044 0532 0130 __00^#&#*#*(#';
IBAN.isValid(notValidIban); // true
Looks like it considers only aphanumeric characters, here I have a valid iban, but polluted with special characters, and it's still treated as valid
According to https://www.iban.com/iban-checker the IBAN SN08SN0100152001608930008516 appears to be valid' but according to https://arhs.github.io/iban.js/ it is invalid.
According the everything, Belarus should be supported as of v0.0.10. But when I test the example provided in the object, invalid is returned.
It seems the issue is with the test page. It doesn't appear to be using the latest version of iban.js
Hey there,
thanks for creating this library,
it is just what I needed.
I have created a wrapper package for the Meteor framework (http://meteor.com),
maybe you could add it to the README so people might find it more easily?
Can be found here: https://atmospherejs.com/theduke/iban
(Also on Github: https://github.com/theduke/meteor-iban)
Cheers.
Can we validate Iban bypassing country code like
const IBAN = require ( 'iban' );
let iban = 'PL61 1090 1014 0000 0712 1981 2874';
let countryCode = 'PK';
if ( IBAN.isValid ( iban , countryCode) ) {
alert( 'Not a valid iban for country code' + countryCode );
return false;
}
return true;
https://npmjs.org/package/iban
Should be as simple as doing an npm publish
from the root directory.
Hey,
This packages is quite mature, and fairly settled as it seems (0.0.1 came out 6 years ago).
The current version is 0.0.14
, which at first glance seems like this is still in early development, and potentially detours adopters.
I would suggest releasing an official 1.0.0
, so the version number more clearly reflects the maturity of the library.
I would also suggest following Semver from that point on, as it's a very established versioning theme in the node community.
Cheers,
Hannes
Hi! It would be nice to tell the users that the NPM package is available with
npm install iban
Hi,
The "IBAN.isValid" method seems to work fine for French specification in general, but i encounter some invalid IBAN when i use the sample from HSBC.
Here the values from their spec:
France | FR | 27 | FR24 2002 0202 2606 0002 4M02 606
It seems that the iso7064Mod97_10 is not equals to 1.
Is this a normal behaviour?
Thanks in advance for your help.
The Readme.md mentions http://www.arhs-group.com/labs/iban-bban-converter/ as the address for demo. This address gives an 404 error.
in php all functionality present like branchname, branchcode, countrycode and etc other but here no functionality other than valid. when it would be updated ?
This repository has been abandoned. For more information read #81.
Ibantools is an alternative that works great!
I think this should be handled more gracefully and just return false
When Calling the isValid
method, this
is the window
element, then it doesn't have an electronicFormat
method.
What is this
supposed to be, and what is theelectronicFormat
method ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.