Skip to content

Commit

Permalink
Remove Bosnia (BA) national checksum; v2.4.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Stanish committed Feb 26, 2016
1 parent eeea5c2 commit 5d63f81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Then just add the following to your `composer.json` file:
// composer.json
{
"require": {
"globalcitizen/php-iban": "2.4.19"
"globalcitizen/php-iban": "2.4.20"
}
}
```
Expand Down Expand Up @@ -236,7 +236,7 @@ The following table compares __php-iban__ to other PHP projects offering IBAN-re

| Project | Lic. | Proc | OO | Began | Latest | Star | Watch | Fork | Installs | Home culture | Deps |
| ---------------------------------------------------------- | ---- | ---- | --- | ------ | ------ | ---- | ----- | ---- | -------- | ------------ | ------- |
| __php-iban__ | LGPL ||| 2009 | 2.4.19 | 27 | 11 | 13 | 10k+* | Global* | *none* |
| __php-iban__ | LGPL ||| 2009 | 2.4.20 | 27 | 11 | 13 | 10k+* | Global* | *none* |
| [Iban](https://github.com/jschaedl/Iban) | MIT ||| 2013 | 1.1.6 | 38 | 10 | 14 | 52k | German | lots |
| [IsoCodes](https://github.com/ronanguilloux/IsoCodes) | GPL3 ||| 2012 | 2.0.0 | 241 | 14 | 28 | 36k | French | lots |
| [SepaUtil's](https://github.com/AbcAeffchen/SepaUtilities) | GPL3 ||| 2014 | 1.1.2 | 4 | 3 | 3 | 1.4k | German | phpunit |
Expand Down Expand Up @@ -293,6 +293,10 @@ Your Help Wanted
News: February 2016
-------------------

__[Version 2.4.20](https://github.com/globalcitizen/php-iban/releases/tag/v2.4.20)__ has been released.
* Another bugfix release, based on further real world test IBANs from certain countries:
* Remove Bosnia (BA) national checksum support

__[Version 2.4.19](https://github.com/globalcitizen/php-iban/releases/tag/v2.4.19)__ has been released.
* Another bugfix release, based on further real world test IBANs from certain countries:
* Remove Finland (FI) national checksum support
Expand Down
22 changes: 0 additions & 22 deletions php-iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,28 +654,6 @@ function _iso7064_mod97_10($str) {
return (98-($check%97));
}

# Implement the national checksum for an Bosnia (BA) IBAN
# (NOTE: Reverse engineered, may be incorrect, but seems to work fine on demo IBAN, uses entire BBAN less checksum characters as input)
function _iban_nationalchecksum_implementation_ba($iban,$mode) {
if($mode != 'set' && $mode != 'find' && $mode != 'verify') { return ''; } # blank value on return to distinguish from correct execution
$nationalchecksum = iban_get_nationalchecksum_part($iban);
$bban = iban_get_bban_part($iban);
$bban_less_checksum = substr($bban,strlen($bban)-1);
$bankbranch = iban_get_bank_part($iban) . iban_get_branch_part($iban);
$account = iban_get_account_part($iban);
$account_less_checksum = substr($account,strlen($account)-1);
$expected_nationalchecksum = _iso7064_mod97_10($bban_less_checksum);
if($mode=='find') {
return $expected_nationalchecksum;
}
elseif($mode=='set') {
return _iban_nationalchecksum_set($iban,$expected_nationalchecksum);
}
elseif($mode=='verify') {
return ($nationalchecksum == $expected_nationalchecksum);
}
}

# Implement the national checksum for a Belgium (BE) IBAN
# (Credit: @gaetan-be)
function _iban_nationalchecksum_implementation_be($iban,$mode) {
Expand Down

0 comments on commit 5d63f81

Please sign in to comment.