Re: Validate_Finance_IBAN (was: Re: [PEAR-DEV] Mod 10 for Payment package?)

From: Date: Thu, 18 Sep 2003 07:01:53 +0000
Subject: Re: Validate_Finance_IBAN (was: Re: [PEAR-DEV] Mod 10 for Payment package?)
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21686@lists.php.net to get a copy of this message
On Wed, Sep 17, 2003 at 12:15:43PM +0200, Stefan Neufeind wrote: > > - it validates ok IBAN number without country code (no PL) > > Well, I don't see the need for this. Without "PL" this is no valid > IBAN. And if this problem occurs for your special implementation > (e.g. in a form where people from Poland are supposed to enter their > IBAN without the PL) you can easily add the "PL" to the string right > before sending it through the validation-function. As said, without > PL it's *not* a valid IBAN according to the rules. And I'm stricly > against putting this into Validate for the above mentioned reasons. Maybe I tell that another way - I like the Validate_Finance_IBAN idea with several error messages; I do not want my patch to be included into validate AS IS. You can do anything you want with that. I've just implemented some validate functions, and wanted to share it with the others. If it would be discarded, changed, moved - it is ok to me. I am not personally attached to Validate*::iban() and I see no problem in discarding Validate::iban() (especialy if there is other IBAN method already implemented). > > - it validates bank branch control digit (in the middle of > > the IBAN). It uses then Validate::iban() for validating > > the main two control digits. > > Do you have official docs about this? I wanted to add bank-code- > checking for Germany myself and I sure further checks for other According to description of "IBAN per country": http://www.ecbs.org/tr201country.htm 1. Polish IBAN is derived from domestic account number (called NRB) and in this document there is bank-branch check digit algorithm given. In fact since 2004-01-01 each Polish bank account number has to be in IBAN form without PL in the beggining. 2. Germany has complicated domestic account number (because IMHO german bank system is old and solid, while Polish banks were splitted from the National Bank of Poland after year 1989). > countries should be added as well. But please let's stick to > "official docs" so we will never classify an IBAN as invalid although > it is valid. If you have information about the polish IBANs please > send me the docs via private email and I'll be happy to integrate > special checks for PL - no problem. OK. Then http://www.ecbs.org/tr201country.htm -> Poland part, would suffice. But I do not know if checking domestic bank numbers should be part of the Validate_Finance_IBAN? Maybe there should be separate Validate_Finance_BankAccountNo to not pollute IBAN number check with domestic rules (sometimes complicated). > About the problem with German bank-codes / bank-account-numbers: > I've had a conversation with a representative from the Federal German > Bank (hope I got the title right). They told me that it's possible to > validate the bank-codes against a list which is published every 3 > month. I plan to add this feature at some point in the future using a There is a similar list released by the Polish Natinal bank, but the Validate_PL::bank_branch() function simply checks control digit. If there is a need for validating agains a internet-available list, I can write a PL driver for that (similarly to Services_ExchangeRates). > Maybe algo-checks work for *all* bank-account-numbers in some other > country. So I intend to introduce a 3-way-logic in this case. An also > may return valid, invalid and "maybe-invalid". In Poland there are rigid rules - each bank account has to have control number right after the bank number. And Bank number is a fixed part of the account number. > IBAN is an international standard - and we should stick to that > standard with one (!) API-interface. It's possible to add further > country-specific checks in Validate_Finance_IBAN easily based on the > country-code in the IBAN itself. OK. > When I want to check a certain given IBAN I don't want to bother if > it's a PL one or something else. The country is indicated in the IBAN > itself - and that's it! OK. But developer that would use Validate_Finance_IBAN would need to add 'PL' or 'DE' every time. And that should be clearly stated in the docs, because e.g. in Poland there is never PL prefix used in internal account transfers. Best regards, -- Piotr Klaban

« previous php.pear.dev (#21686) next »