During the past two years I’ve constantly been frustrated with the Authorize.net API wrappers that exist, so when I started to rebuild NACHI.TV I decided I would write the one I always hoped for. The code is just a two days old, so I’m sure there are all sorts of gaping holes in it, but I thought I’d release this first version to get some feedback from others who are as frustrated as I am.
Here’s a basic example of how you might use the wrapper:
$gateway = new Galahad_Gateway_AuthorizeNet($login, $tranKey);
$card = new Galahad_CreditCard('4222222222222', 4, 10);
$transaction = new Galahad_Gateway_Transaction(null, 2.00, $card, 'Description of $2 purchase');
$response = $gateway->capture($transaction, true);
if ($response->isApproved()) {
echo '<h1>Approved</h1>';
} else {
echo '<h1>Declined</h1>';
}
Recent Comments