Comments (13)
IBAN validation for the Czech Republic is not 100% correct, there is a rule "a second part containing at least 2 and at most 10 digits, at least two of which may not be zero, with the initial zeros having no significance.". The second part is the account part, so for example CZ0401000000000000000000 should be an invalid IBAN. I have tried to create a regex that will fulfill this rule, but I am not able to create a negative lookahead that will match one non-zero digit at any position. The non-all zeros regex is simple (?![0]{10})(\d{10}), but for one non-zero character not, the only solution that I figured out is to write all scenarios (where the one digit could be) for example (?![0]{10})(?![0]{1}[1-9]{1}[0]{8})...(?![0]{8}[1-9]{1}[0]{1})(\d{10}) which is terrible regex.
Specification:
https://www.cnb.cz/export/sites/cnb/en/legislation/.galleries/decrees/decree_169_2011.pdf
from php-iban.
at least two of which may not be zero, with the initial zeros having no significance.
Yes our CZ bank account number is pain. I also tried create fix, but with one regex, i was out of idea.
from php-iban.
Re. CZ, thanks for the addition @Triplkrypl. I merged and published a new release as v4.2.1 for now, until time is available for further work. A clear demo script showing failures (expected vs received output) would assist with getting a fix through quickly. Please post as a new CZ-specific issue. Thanks.
from php-iban.
More generally, we could consider building a library of national-level bank or payment institution identifier codes. This would be rather large and an optional extension and would be in competition with SWIFTRef... see https://swiftrefdata.com/ and https://www.swift.com/our-solutions/interfaces-and-integration/swift-apis/swiftref-api and http://www.slideshare.net/SWIFTcommunity/bbf2015swift-refwork-sessionfinal2jul2015
from php-iban.
http://www.betaalvereniging.nl/en/european-transactions/sepa-documentation-for-the-netherlands-2/bic-from-iban/ is an apparently always up to date list of all Dutch bank IDs, for example NL91ABNA0417164300
would be ABNA
which is ABN AMRO BANK
.
from php-iban.
http://www.pangaliit.ee/Estonian_Payment_Service_Provider_codes_and_BICs.xlsx is an apparently always up to date list of all Estonian bank IDs, for example EE382200221020145685
would be 22
which is Swedbank AS
.
from php-iban.
I've started this rather maintenance-headache-inducing project in an exploratory fashion. Currently thinking the fields would be:
- IBAN country: The country in which the bank's identifier belongs.
- Bank identifier: What is present in the appropriate portion of the BBAN for the country in question.
- Bank title: In officious English, eg. 'Hong Kong Shanghai Banking Corporation Netherlands Limited'
- Bank SWIFT BIC: Where known.
- Bank short title: Something like 'HSBC' rather than 'Hong Kong Shanghai Banking Corporation Netherlands Limited'
- Bank URL: With prefixed http:// or https:// removed. In most cases the domain name will suffice.
Currently entries only exist for countries:
- EE: Estonia
- NL: Netherlands
- TL: Timor-Lest (East Timor)
It is probably an option to write a scraper to initially populate the other countries, but then we would be as hearsay and out of date as the rest of them (999 websites with IBAN format and BIC descriptions, some of which extract data from this library). Thus, adding the info manually is probably a reasonable idea, but it will be a longer term job... and the fruit should be shared with those in non-PHP languages, so perhaps I will break this off to a separate project and generate language-specific frontends for the database, similar to how geoip implementations operate. In fact, php-iban could probably be rewritten in such a way with some utility.
I've noticed that in the case of acquisitions, sometimes old SWIFT BICs exist but are not really in use anymore. Since the ultimate arbiter of currency in that arena is SWIFT itself, we should probably not attempt to determine what is 'current', but simply publish everything for which an IBAN institution identifier code is known, SWIFT be damned.
from php-iban.
from php-iban.
List of banks and SWIFT codes in Slovenia and another one.
from php-iban.
from php-iban.
https://snel.it/svn/misc/trunk/au3/BICs-2014-03-07.php seems to be a conversion table from IBAN bankid to SWIFT BIC... rather short though.
from php-iban.
Aha! Thanks for the spec @AlexKratky. I will take a look at fixing it.
From my perspective, one major problem in validating the country-specific code is collecting real test IBANs. Another is finding the official specs. I really don't have time to work on open source recently.
That said, would you and @Triplkrypl be so kind as to create a pull request adding some additional real-world CZ IBANs to assist with testing a new implementation with the new information? I can then allocate some time to work through solving it.
Here is the file to be expanded: https://github.com/globalcitizen/php-iban/blob/master/utils/example-ibans/cz-ibans
Thanks.
from php-iban.
Here are some new examples: #121 with some differences from previous ones.
from php-iban.
Related Issues (20)
- Breaking namespace issue HOT 2
- IBAN secret or not HOT 1
- Strangeness on registry.txt in Timor-Leste HOT 3
- 2.8.x is not compatible HOT 12
- Version 3.0 mentioned in README.md but 2.8.0 is the last one available via composer (at the packageist.org) HOT 7
- compatible with php 7.4 HOT 2
- Missing dot for version 3.0.3 (released as 3.03) HOT 2
- docs/COMEDY-OF-ERRORS: IBAN registry moved again HOT 2
- How to use php-iban?
- PHP 7.4 - Exception message: Warning: array_key_exists() expects parameter 2 to be array HOT 1
- Check for EU/EFTA/Other Countries HOT 2
- Does it really generate IBAN? HOT 1
- Add PHP 8.0 support
- Irland IBAN not working correctly HOT 3
- PHP 8.2 compatibility HOT 1
- bban_bankid_start_offset & bban_bankid_stop_offset for GB & MT ibans not correct HOT 6
- CZ IBAN incorect verify_iban HOT 3
- IBAN validation fails incorrectly HOT 1
- PHP array registry would be more efficient HOT 4
- Add a method to obfuscate IBAN for presentation for relative identification HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-iban.