Adding Payment Gateways and Processors
Feb 1, 2008
There are literally hundreds of payment processors out there. We support a few out of the box, and have several others available as free downloads to customers, but it is not too difficult to add a new payment processor using an existing gateway/processor as a guide.
Basically there are two types of payment processors: gateway or processor. A gateway communicates behind the scenes (like Authorize.net) and processes the transaction in realtime, and a processor shows a form on a third-party web site, and credit card data is collected there (like Paypal.)
The basic procedure to create a new payment processor file in Cartweaver is to get the API from your payment processor, and use one of our payment processor files as a guide. Modify the form values in the file to use the names specified by your processor (for example, it might use "x-lastname" or "UserLastName" or "LastName"). Once you do this, you should be able to turn on the debugging email functionality, post test transactions to your payment processor, and proceed from there.
The next step is to parse the result, and all payment processors handle this differently. For example, Authorize.Net passes results in comma-delimited form, so this sample line would parse the result, for PHP:
$authNetCodes = explode(",",$authNetResult);
For ColdFusion, use the simple list functions:
Some processors use name/value pairs in a querystring. The following will parse those types of results in PHP:
$resultArray = explode('&', $result);
foreach($resultArray as $val) {
$temp = explode('=', $val);
$response[$temp[0]] = $temp[1];
}
or for ColdFusion:
If you find out about the API and want me to take a look at it, let me know through my contact form. In the past I have converted payment processor files for customers for a fee, but it does not usually fit into my schedule
Posted bySite Admin at 4:33 PM