Re: Mod 10 for Payment package?
| From: | Piotr Klaban | Date: | Wed, 17 Sep 2003 09:49:12 +0000 |
| Subject: | Re: Mod 10 for Payment package? | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21617@lists.php.net to get a copy of this message | ||
On Wed, Sep 17, 2003 at 10:41:29AM +0200, Stefan Neufeind wrote:
> could you send me and Joe the "patch" also, please? Joe volunteered
Here is the patch and patched version of Validate 0.2.0 (patch for 1.2.0
is the same):
http://www.klaban.torun.pl/patches/Validate/
For full patching the required files are:
PL.phps (cd Validate-0.2.0; mv ../PL.phps Validate/PL.php)
Validate-0.2.0.diff (cd Validate-0.2.0; patch -p1 < ../Validate-0.2.0.diff )
(note that in docs/sample_multiple.php there is an old VAL_ALPHA constants,
while it should be VALIDATE_ALPHA, but never mind).
> Validate_Finance_IBAN in CVS please.
I do not know if my patch should be included as is to the Validate package.
I have implemented the functions for validating:
issn() ISSN (International Standard Serial Number)
ismn() ISMN (International Standard Music Number)
ean8() EAN/UCC-8 number
ean13() EAN/UCC-13 number
ean14() EAN/UCC-14 number
ucc12() UCC-12 (U.P.C.) ID number
sscc() SSCC (Serial Shipping Container Code)
iban() IBAN (International Bank Account Number)
Some private functions: _mult_weights, _get_control_number, _check_control_number.
And there are some (Polish only) functions in the Validate/PL.php
(nip, bank_branch, pesel, regon, iban).
All the functions are described in the API docs.
And regarding the IBAN:
-----------------------
For most purposes validating control functions would suffice,
but it is much better to have Validate_Finance_IBAN that
returns specific error (e.g. IBAN_COUNTRY_INVALID).
And the reasons why I wrote Validate_PL::iban():
- it validates ok IBAN number without country code (no PL)
- it validates bank branch control digit (in the middle of
the IBAN). It uses then Validate::iban() for validating
the main two control digits.
Than global Validate::iban() would not be needed any more
if Validate_Finance_IBAN could be used, but Validate_PL::iban()
would be nice to preserve.
Best regards,
--
Piotr Klaban