Skip to content

Commit

Permalink
Release v1.6 (#34)
Browse files Browse the repository at this point in the history
* Updated release status
* Fix Validator
  • Loading branch information
jschaedl committed May 16, 2020
1 parent 5049543 commit 2dacea8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ MIT License

## Release Status

2020-05-16: [Version 1.6](https://github.com/jschaedl/iban-validation/releases/tag/v1.6) has been released.

* [Maintenance] update iban registry to version 86 (@jschaedl)
* [Improvement] report checksum in `InvalidChecksumException` (@tugrul)

2020-02-05: [Version 1.5](https://github.com/jschaedl/iban-validation/releases/tag/v1.5) has been released.

* [Bugfix] https://github.com/jschaedl/iban-validation/issues/24: properly fail on non-numeric country codes (@xabbuh)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
"dev-master": "1.6-dev"
}
},
"require" : {
Expand Down
6 changes: 3 additions & 3 deletions src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ protected function validateChecksum($iban)
$checksum = $iban->getChecksum();

if (!preg_match('/^\d+$/', $checksum)) {
throw new InvalidChecksumException($iban);
$validChecksumIban = $numericBban . $numericCountryCode . '00';
$validChecksum = 98 - intval($this->local_bcmod($validChecksumIban, '97'));
throw new InvalidChecksumException($iban, $validChecksum);
}

$invertedIban = $numericBban . $numericCountryCode . $checksum;

if ('1' !== $this->local_bcmod($invertedIban, '97')) {

$validChecksumIban = $numericBban . $numericCountryCode . '00';
$validChecksum = 98 - intval($this->local_bcmod($validChecksumIban, '97'));

throw new InvalidChecksumException($iban, $validChecksum);
}
}
Expand Down

0 comments on commit 2dacea8

Please sign in to comment.