Coder Social home page Coder Social logo

globalcitizen / php-iban Goto Github PK

View Code? Open in Web Editor NEW
471.0 31.0 106.0 1.43 MB

Generate, parse, validate, error-correct and present IBAN (and IIBAN) bank account information in PHP.

License: GNU Lesser General Public License v3.0

PHP 98.51% Shell 1.49%
iban php php-library checksums mistranscription sepa iso iso3166 iana ecbs

php-iban's People

Contributors

bwurst avatar francescozanoni avatar globalcitizen avatar hannob avatar herndlm avatar humancopy avatar jledrogo avatar johnges avatar julianpollmann avatar llange avatar manuelschmitt avatar nannehuiges avatar nostadt avatar olympic1 avatar ostrolucky avatar sunmar avatar thinkpozzitive avatar triplkrypl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-iban's Issues

Version number

Thank you for this useful library. Please consider to publish the version 
number somewhere in code or in documentation files. It would be helpful for 
integrators using/implementing library managers.

Original issue reported on code.google.com by [email protected] on 18 Mar 2013 at 2:47

New registry field identifying registrar for dependent territories

For example, the new field's value for FO (Faroe Islands) record would be DK in order to identify Denmark (DK) as the relevant parent registrar.

This would be useful at this point primarily for two reasons:

  1. I have come upon some hearsay suggesting that the French territories actually use FR as their in country identifier practice. Such a field would allow for the intelligent fallback to the ascendant parent registrar's country code in cases where, for example, real world IBAN generation from domestic BBAN data was used for systems integration and the parent territory's country code was preferred.
  2. Because we place records relating to a parent registrar immediately thereafter within the registry at present, generating appropriate indentation in documentation would be simplified. (See current hack @ generate-supported-countries-list)

Croatia in registry.txt not a SEPA member

What steps will reproduce the problem?
1. set country_sepa to 1 for 'HR'

What is the expected output? What do you see instead?
iban_country_is_sepa returns false for croatia, should return true

What version of the product are you using? On what operating system?
1.4.3 OS independent

Please provide any additional information below.

keep up the good work ;)

Original issue reported on code.google.com by [email protected] on 9 Jan 2014 at 1:31

New per-country field: date effective

For forward-looking records published prior to the date in which they take effect, this information should be included and possible to query. Historical date-of-effect information may also be of interest.

Error when country not in $_iban_registry

When a completely random string is inputted (not starting with a country code), 
a php error is generated in the function:

function _iban_country_get_info($country,$code) {
     global $_iban_registry;
     return $_iban_registry[strtoupper($country)][strtolower($code)];
}

a simple array_key_exists prevents the error:

function _iban_country_get_info($country,$code) {
     global $_iban_registry;
     if(array_key_exists(strtoupper($country), $_iban_registry))
     {
        return $_iban_registry[strtoupper($country)][strtolower($code)];
     }
     return false;
}

This might be something to implemen, ofcourse unless there's a reason why it's 
not at this point

Very nice validator!

Original issue reported on code.google.com by [email protected] on 29 Jun 2011 at 8:56

Missing string for Portugal

Here it is:
PT|Portugal|0002.0123.12345678901.54|000201231234567890154|4!n4!n11!n2!n|^
(\d{4})(\d{4})(\d{11})(\d{2})$|21|PT50000201231234567890154|PT2!n4!n4!n11!
n2!n|^PT(\d{2})(\d{4})(\d{4})(\d{11})(\d{2})$|25|0|3|4|7|2009-04-13


Original issue reported on code.google.com by [email protected] on 6 May 2009 at 5:04

False negatives for some IBANs using gmp_mod

What steps will reproduce the problem?
1. Call the verify_iban function() with certain IBANs, e.g., 
CH0209000000405529562

What is the expected output? What do you see instead?
I expect it to say that the IBAN is valid, which it is (see 
http://www.ibancalculator.com/iban_validieren.html?tx_valIBAN_pi1%5Biban%5D=CH02
09000000405529562&tx_valIBAN_pi1%5Bfi%5D=fi&no_cache=1&Action=validate+IBAN). 
Instead it returns false.
If I comment out line 139 (basically disabling gmp_mod functionality and 
reverting to the 'old method') it returns true again (as it did in a 
pre-gmp_mod version of php-iban).

What version of the product are you using? On what operating system?
I'm using php-iban 1.3.7 on CentOS 5.8 running php 5.4.11

Please provide any additional information below.
N/A

Original issue reported on code.google.com by [email protected] on 15 Feb 2013 at 4:37

verify_iban accepts special characters as whitespace

What steps will reproduce the problem?
1. verify_iban('FI21 1234-5600 0007?85');

What is the expected output? What do you see instead?

Expect false. Got true.

What version of the product are you using? On what operating system?
1.4.3

Please provide any additional information below.
Is this a feature, as iban_to_machine_format seems to filter that sort of 
things out?

Original issue reported on code.google.com by [email protected] on 11 Sep 2013 at 11:58

IBAN registry for more countries


Please provide any additional information below.

Is there any update of the registry for the following countries :

GP = GUADALOUOPE
GG = GUERNSEY
IM = ISLE OF MAN
JE = JERSEY
KZ = KAZAKISTAN
KW = KUWAIT
LB = LEBANON
MQ = MARTINIQUE
RE = REUNION

Many thanks for your kind attention



Original issue reported on code.google.com by [email protected] on 8 Jun 2011 at 1:06

Country-specific human formatting?

If we can find any evidence people use something more complex than simple XXXX XXXX XXXX XXXX XX or breaking down an IBAN in to smaller units with spaces based upon its legacy components (bank id, branch id if present, account number), then we should include it. Right now I have no evidence.

i18n

Consider adding a library of localised forms and abbreviations for account number portions, for example Austria and Germany seem to have 'Kontonummer' (KTO) for account number, and 'Bankleitzah' (BLZ) for bank identifier. This could assist greatly with deployments requiring international and/or constrained input.

Iban verification - performance

the used algorithm is horribly slow :(

if the iban is converted to the number-only version ($pruefsumme), use one of 
these:
---------------------------
$len = strlen($pruefsumme);
$rest = "";
$pos = 0;
while ($pos < $len) {
    $ziffern = 9-strlen($rest);
    $n = $rest . substr($pruefsumme,$pos,$ziffern);
    $rest = $n % 97;
    $pos = $pos + $ziffern;
}
$valid = $rest === 1;
--------------------------;
or in php 5:

$valid = gmp_intval(gmp_mod($pruefsumme,'97')) === 1;

greetings, Chris

Original issue reported on code.google.com by [email protected] on 6 Feb 2013 at 3:55

split deprecated in php 5.3.0

The native php function split (used twice) is deprecated since php 5.3.0

explode looks like the aplicable alternative

Original issue reported on code.google.com by [email protected] on 29 Jun 2011 at 8:58

Version file shows incorrect version for 1.4.4

What steps will reproduce the problem?
1. Download version 1.4.4 of the library in ZIP format
2. Open the 'VERSION' document (copy of this file from recent download 
(2013-10-29) attached)
3. Note content reflect version 1.4.0, not 1.4.4

What is the expected output? What do you see instead?
Version number in the VERSION document should match current library version.

What version of the product are you using? On what operating system?
1.4.4. Issue is system-independent

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 29 Oct 2013 at 10:07

Attachments:

Wrong BBAN Branch ID start offset for IT and SM

Hello,
first I just want to thank you very much for the great job!
Testing your class to verify / extract data from IBAN codes, I realized that to get the right Branch ID from a correct italian iban, in registry.txt, I had to change the 12th piece of the line (explode by '|' ) from 0 to 1 not to include the National Checksum single char at the beginning of the Branch ID.
This actually works and does not seem to break any other functionality, but I would appreciate you to confirm this is the right way to proceed.

support for country specific check digit

Hello, I'm glad to see that the library is receiving support again.

I don't know if within the new features (or the future ones) is included a new function/method to get the country specific check digit.

In the case of Spain:

The format of the iban is: ESkk bbbb gggg xxcc cccc cccc

where:
k = IBAN control digit
b = National bank code
g = Branch code
x = Check digits
c = Account number

More here:
https://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country

Country-specific checksums

We could support the calculation of known national (BBAN-level) or bank-specific (sub-BBAN-level) checksums against algorithms where known. Please contribute if you know any.

support composer/packagist

would be nice if this cute lib would be available in composer, to make it 
easier to use.

see
https://packagist.org/
http://getcomposer.org/

Original issue reported on code.google.com by [email protected] on 2 Jul 2013 at 3:05

Make it a composer library

Have you think in release php-iban library as a Composer package?

It will make to other add your library to its projects without effort.

It is very easy to make it composer compatible, as simply as adding a json file 
(with little configuration) and submiting an entry to packagist.

You can read more about composer in http://getcomposer.org

Original issue reported on code.google.com by [email protected] on 14 Aug 2014 at 11:13

Further improve mistranscription suggestions

From v2.5.0 code comments:

  • length correction via adding/removing leading zeros from any single component
  • overlength correction via dropping final digit(s)
  • national checksum algorithm checks (apply same testing methodology, abstract to separate function)
  • length correction by removing double digits (xxyzabxybaaz = change aa to a, or xx to x)
  • validate bank codes
  • utilize format knowledge with regards to alphanumeric applicability in that offset in that national BBAN format
  • turkish TL/TK thing
  • norway NO gets dropped due to mis-identification with "No." for number (ie. if no country code try prepending NO)

Code coverage analysis

Figure out a way to make code coverage analysis work with our built-in, non phpunit based testing approach. At the time of writing, I'm unaware of an easy solution here.

Valid Jordan and Qatar IBANs throwing preg_match warning

What steps will reproduce the problem?
1.verify_iban('JO94CBJO0010000000000131000302')

What is the expected output? What do you see instead?
Should be valid IBAN (according to 
http://www.ibancalculator.com/iban_validieren.html). Instead there is a warning 
and IBAN is invalid:

Warning: preg_match(): Compilation failed: unmatched parentheses at offset 10 
in /home/mbukovac/sassiecore/sassiehelpers/lib/php-iban-1.4.5/php-iban.php on 
line 28

What version of the product are you using? On what operating system?
1.4.5 on Linux

Please provide any additional information below.
This is your sample IBAN for Jordan in registry.txt. I have a similar example 
for Qatar (which I would prefer not to post here, but can email to you), which 
is also valid, but throws the same preg_match error.

Thanks.

Original issue reported on code.google.com by [email protected] on 3 Jun 2014 at 2:03

Code review request

When reviewing my code changes, please focus on:
 - Anything at all! 

After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 4 Sep 2011 at 2:42

setChecksum is not working correctly

What steps will reproduce the problem?

iban_set_checksum('CH0009000000405241341')


What is the expected output? What do you see instead?

Expected IBAN: 'CH4709000000405241341'
Generated IBAN: 'CH9809000000405241341'


What version of the product are you using? On what operating system?

current stable


Please provide any additional information below.

iban_find_checksum calls iban_mod97_10 to get the correct "rest" number, but 
this method generates true or false (which is correct when called from 
iban_verify_checksum).


Original issue reported on code.google.com by [email protected] on 22 Mar 2013 at 8:59

SEPA-status for FR

registry.txt has incorrect information on the SEPA-status of France and 
potentially others. The reason: IBAN_Registry.txt has a phrase like "Yes, 
included GP, RE, MQ, GF, PM and YT" instead of a simple 'Yes' in that column 
and thus the parser fails.

Otherwise, this is a very excellent library!!

What version of the product are you using? On what operating system?
1.4.0


Original issue reported on code.google.com by [email protected] on 18 Jun 2013 at 12:10

Registry file mistake

You have an error in the registry file that is provided. It is on Finlands 
config (FI). The error is that the lenght of the bban is set to 257 when it 
should be 14.


Original issue reported on code.google.com by [email protected] on 11 Feb 2011 at 12:12

NL account number is not split off

What steps will reproduce the problem?
 var_export(iban_get_parts('NL91ABNA0417164300'));

What is the expected output?
    array (
      'country' => 'NL',
      'checksum' => '91',
      'bban' => 'ABNA0417164300',
      'bank' => 'ABNA',
      'branch' => '',
      'account' => '0417164300',
    );
What do you see instead?
    array (
      'country' => 'NL',
      'checksum' => '91',
      'bban' => 'ABNA0417164300',
      'bank' => 'ABNA',
      'branch' => '',
      'account' => '',
    );


What version of the product are you using? On what operating system?
 version 1.4.0 on PHP 5.3.2 (Ubuntu)

Please provide any additional information below.
 Possible solution:
    update the NL line in registry.txt with bban_branchid_start_offset=4 and bban_branchid_stop_offset=3

 Example NL line that is working for me:
    NL|The Netherlands|041 71 64 300|ABNA0417164300|4!a10!n|^([A-Z]{4})(\d{10})$|14|NL91ABNA0417164300|NL2!n4!a10!n|^NL(\d{2})([A-Z]{4})(\d{10})$|18|0|3|4|3|2011-06-20|1


Original issue reported on code.google.com by [email protected] on 31 May 2013 at 9:18

iban_find_checksum does not work correctly when checksum < 10

What steps will reproduce the problem?
Call iban_find_checksum() with an iban that has checksum below 10.
For example:
 $num = iban_find_checksum('FI0512003000065276');
 var_dump($num);


What is the expected output? What do you see instead?
expected: string(2) "05"
instead: int(5)


What version of the product are you using? On what operating system?
SVN revision 12
On Windows PHP 5.2.11

Please provide any additional information below.

This issue causes iban_set_checksum() to generate invalid IBAN numbers.

http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_c
heck_digits
 7. Subtract the remainder from 98 and, if necessary, pad with a leading 0 to make a two digit number.

Can be fixed (for example) by changing line 100 from this:
 return (98-$checksum);
to this:
 return str_pad((98-$checksum), 2, '0', STR_PAD_LEFT);

Original issue reported on code.google.com by [email protected] on 2 Nov 2010 at 7:21

IETF top level country domain equivalencies

It would seem useful to assist people with integrations by providing the IETF domain name system equivalent to each country record.

  • AA (IIBAN) would have none.
  • GB (United Kingdom) would have uk
  • SM (San Marino) would have sm

... etc.

registry.txt reading fails when including with Zend_Loader

What steps will reproduce the problem?
1. Zend_Loader::loadFile('php-iban.php', '/path/to/php-iban', TRUE);

What is the expected output? What do you see instead?
In php-iban.php at line 272 the file_get_contents() fails saying it can't
find registry.txt in include_path.

Solved changing line 272 in:
$data = file_get_contents(dirname(__FILE__) . '/registry.txt');


What version of the product are you using? On what operating system?
Various platform.

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 9 Feb 2010 at 12:32

Further expansion of test routines

Issues observed include:
 * Lack of an extended test library (input/output expectations)
 * Lack of environment testing (eg. PHP gmp extension present/missing)
 * No way to test subcomponents (such as differing MOD97 routines)
 * No xdebug-style code coverage analysis for test library

Original issue reported on code.google.com by [email protected] on 16 Feb 2013 at 1:12

Performance issue

php-iban.php, function _iban_country_get_info, $code is double converted to 
lower:

 $code = strtolower($code);
 if(array_key_exists($country,$_iban_registry)) {
  if(array_key_exists($code,$_iban_registry[$country])) {
--   return $_iban_registry[$country][strtolower($code)];
++   return $_iban_registry[$country][$code];
  }

Original issue reported on code.google.com by [email protected] on 3 Oct 2012 at 1:24

Function not found

In file oophp-iban.php on line 47 the class search for " iban_find_checksun " 
but doesn't exist, i've correct with " iban_find_checksum " and it's OK.

Version 1.1.0 file zip.

Sorry 4 my english, i'm italian.

Original issue reported on code.google.com by [email protected] on 17 Aug 2011 at 9:29

Add support for composer

It would be great if this library was published on https://packagist.org

If you need any support with that, I'd be happy to help, but it should be a 
pretty straightforward process. Instructions can be found here: 
https://packagist.org/about

Original issue reported on code.google.com by [email protected] on 30 Jan 2014 at 7:17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.