Created
March 18, 2010 19:23
-
-
Save inxilpro/336759 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$options = array( | |
'loginId' => 'Authorize.net Login ID', | |
'transactionKey' => 'Authorize.net Transaction Key', | |
'mode' => 'test' | |
); | |
$gateway = Galahad_Payment::factory('AuthorizeNet', $options); | |
$customer = new Galahad_Payment_Customer(array( | |
'firstName' => 'John', | |
'lastName' => 'Smith', | |
'postalCode' => '19106', | |
)); | |
$card = new Galahad_Payment_Method_CreditCard('4111111111111111', 11, 2012); | |
$transaction = new Galahad_Payment_Transaction(); | |
$transaction->setBillingCustomer($customer); | |
$transaction->setPaymentMethod($card); | |
$transaction->setAmount(3.50); | |
$transaction->setComments("I need about three-fiddy."); | |
$response = $gateway->process($transaction); | |
if ($response->isApproved()) { | |
echo "Your transaction was approved!"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment