Skip to content

Commit

Permalink
Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Stanish committed Jan 21, 2016
1 parent cbe0fe0 commit dbb97cf
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Licensed under LGPL, it is free to use in commercial settings.

News: January 2016
------------------
__Version 1.5.1__ has been released. This version features more registry corrections (newly added territories with faulty data, bad checksums in sample IBANs, etc.) as well as enhanced testing routines. All users are advised to upgrade. We now have automated test script execution with Travis CI, to provide additional robustness for all committed code. This took longer than expected as unfortunately I picked the exact time Travis broke their build logs - https://www.traviscistatus.com/incidents/fcllblkclgmb ... proving again that cloud computing is just *great* for breaking things unexpectedly!
__Version 1.6.0__ has been released. This version features more registry corrections (newly added territories with faulty data, bad checksums in sample IBANs, etc.) as well as enhanced testing routines, extended documentation, and corrected documentation. All users are advised to upgrade. We now have automated test script execution with Travis CI, to provide additional robustness for all committed code. This took longer than expected as unfortunately I picked the exact time Travis broke their build logs - https://www.traviscistatus.com/incidents/fcllblkclgmb - to see what all the fuss was about... proving again that cloud computing is just *great* for breaking things unexpectedly. Because they want to hide things, there was literally no debug output whatsoever, and I was led to believe this was my fault. Fellow programmers, behold: it is the dawning of the age of the mystical fail.

__Version 1.5.0__ has been released. There are no code changes, but we now have http://packagist.org/ integration, hopefully this triggers it to start working. If you use packagist, you can now add the library to your project by just running `composer require globalcitizen/php-iban` (thanks to @acoulton for pointing the way)

Expand Down Expand Up @@ -327,10 +327,34 @@ $country_bban_length = iban_country_get_bban_length($iban_country);
# Get the IBAN example for an IBAN country
$country_iban_example = iban_country_get_iban_example($iban_country);
# Get the IBAN length for an IBAN country
$country_iban_length = iban_country_get_iban_length($iban_country);
# Get the IBAN format (in SWIFT format) for an IBAN country
$country_iban_format_as_swift = iban_country_get_iban_format_swift ($iban_country);
# Get the IBAN format (as a regular expression) for an IBAN country
$country_iban_format_as_regex = iban_country_get_iban_format_regex($iban_country);
# Determine whether an IBAN country is a member of SEPA (Single Euro Payments Area)
if(!iban_country_is_sepa($iban_country)) {
# ... do something xenophobic ...
}
# Get the bank ID start offset for an IBAN country
$country_bankid_start_offset = iban_country_get_bankid_start_offset($iban_country);
# Get the bank ID stop offset for an IBAN country
$country_bankid_stop_offset = iban_country_get_bankid_stop_offset($iban_country);
# Get the branch ID start offset for an IBAN country
$country_branchid_start_offset = iban_country_get_branchid_start_offset($iban_country);
# Get the branch ID stop offset for an IBAN country
$country_branchid_stop_offset = iban_country_get_branchid_stop_offset($iban_country);
# Get the registry edition for an IBAN country (note: IIBAN country 'AA' returns 'N/A')
$country_registry_edition = iban_country_get_registry_edition($iban_country);
```


Expand Down Expand Up @@ -453,19 +477,42 @@ $country_bban_example = $myCountry->BBANExample();
$country_bban_format_as_swift = $myCountry->BBANFormatSWIFT();
# Get the BBAN format (as a regular expression) for an IBAN country
$country_bban_format_as_regex = $myCounty->BBANFormatRegex();
$country_bban_format_as_regex = $myCountry->BBANFormatRegex();
# Get the BBAN length for an IBAN country
$country_bban_length = $myCountry->BBANLength();
# Get the IBAN example for an IBAN country
$country_iban_example = $myCountry->IBANExample();
# Get the IBAN length for an IBAN country
$country_iban_length = $myCountry->IBANLength();
# Get the IBAN format (in SWIFT format) for an IBAN country
$country_iban_format_as_swift = $myCountry->IBANFormatSWIFT();
# Get the IBAN format (as a regular expression) for an IBAN country
$country_iban_format_as_regex = $myCountry->IBANFormatRegex();
# Determine whether an IBAN country is a member of SEPA (Single Euro Payments Area)
if(!$myCountry->IsSEPA()) {
# ... do something xenophobic ...
}
# Get the bank ID start offset for an IBAN country
$country_bankid_start_offset = $myCountry->BankIDStartOffset();
# Get the bank ID stop offset for an IBAN country
$country_bankid_stop_offset = $myCountry->BankIDStopOffset();
# Get the branch ID start offset for an IBAN country
$country_branchid_start_offset = $myCountry->BranchIDStartOffset();
# Get the branch ID stop offset for an IBAN country
$country_branchid_stop_offset = $myCountry->BranchIDStopOffset();
# Get the registry edition for an IBAN country (note: IIBAN country 'AA' returns 'N/A')
$country_registry_edition = $myCountry->RegistryEdition();
```


Expand Down
7 changes: 7 additions & 0 deletions docs/COMEDY-OF-ERRORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ matters that cause issue for implementers:
- Lack of validation of information in fields prior to publishing
- Lack of synchronisation between TXT and PDF versions of the registry

2016-01-21
----------
- Correction for broken example IBANs for multiple countries (checksum
failed, length incorrect, etc.)
- Correction for broken IBAN length field for Khazakstan (no specified
length whatsoever)

2011-07-16
----------
- No information for Kuwait past sixth column
Expand Down
5 changes: 4 additions & 1 deletion docs/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ TODO
and the UAE that published data in advance of deployment
- Support for calculating or validating any known national (sub-
BBAN-level) checksum algorithms?
- URLs to national-level BBAN format specifications
- Addition of special case national-level validations, eg. Estonia's
record states that the first digit of the bank code cannot be 0,
and Slovenia's five digit bank ID always begins with 91.
- URLs to national-level BBAN format specifications (if online)
- 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'
Expand Down
4 changes: 2 additions & 2 deletions php-iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ function iban_mistranscription_suggestions($incorrect_iban) {

# abort on ridiculous length input (but be liberal)
$length = strlen($incorrect_iban);
if($length<5 || $length>34) { return array('(length bad)'); }
if($length<5 || $length>34) { return array('(supplied iban length insane)'); }

# abort if mistranscriptions data is unable to load
if(!_iban_load_mistranscriptions()) { return array('(failed to load)'); }
if(!_iban_load_mistranscriptions()) { return array('(failed to load mistranscriptions)'); }

# init
global $_iban_mistranscriptions;
Expand Down

0 comments on commit dbb97cf

Please sign in to comment.