Re: RFC: Credit card processing
| From: | Bertrand Mansion | Date: | Sat, 13 Dec 2003 14:45:29 +0000 |
| Subject: | Re: RFC: Credit card processing | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-24387@lists.php.net to get a copy of this message | ||
<lists@blueroot.net> wrote :
> Bertrand Mansion wrote:
>>
>> $ret = CreditCard::validate($ccno);
>> if (CreditCard::isError($ret)) {
>> die ($ret->getMessage());
>> }
>
> this doesnt solve the problem of having a true response + a very
> important message (eg payment deferred)...
That's not the purpose of my suggestion. The suggestion is valid when the
response is false. When it's true, you will have to find another way (my
suggestion for a singleton is valid here I think).
> It also means that CreditCard
> needs to extend PEAR
No. Look at QuickForm. We have an isError() method and a
HTML_QuickForm_Error class that extends PEAR_Error. No need to extend PEAR.
Bertrand Mansion
Mamasam