Re: RFC: Credit card processing

From: Date: Sat, 13 Dec 2003 02:36:50 +0000
Subject: Re: RFC: Credit card processing
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24375@lists.php.net to get a copy of this message
I'm leaning towards a simple success/failure model, and you can call a function to get the exact error (which will vary from processor to processor).
I am writing some classes for Validate at the moment and have found the same, a true/false response is best. To relay information like the status that I set a status property to a constant like PEAR_PAYMENT_DEFERRED which has an integer value. This can then be checked in code easilly using a getStatus method. You will also probably need a transaction id property, which can be set on success. You should also have a look at Validate (still in beta, so its only in cvs http://cvs.php.net/cvs.php/pear/Validate) it has a routine for checking credit card numbers. You might want to incorporate this. Mike

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