PHP Authorize.net AIM Interfacing Class
April 19, 2005
Provides a simplified interface the the authorize.net AIM payment gateway. Allows all the control and flexibility to be in the hands of the PHP developer (you). Uses cURL and SSL. The zip file includes the class to interface with authorize.net as well as a demonstration script on using the file.
Download:
authorizenet-1.0.1.zip
If you enjoy this free PHP script and want to show your support, you can throw me a couple of bucks using paypal. Any donation, even just a buck, is always appreciated.
Version History
- v1.0.1 [01.19.2006] - Fixed urlencode glitch (finally)
- v1.0.0 [04.07.2005] - Initial Version
Categories:
Web Development
Copyright © 2004 - 2010 Micah Carrick. All Rights Reserved.
28 Comments about "PHP Authorize.net AIM Interfacing Class"
RSS Feed
original:
function add_field($field, $value) {
$this->fields["$field"] = $value;
}
modified:
function add_field($field, $value) {
if ($field=="x_line_item") {
$this->line_items[] = $value;
} else {
$this->fields["$field"] = $value;
}
}
and in function process(), add second foreach for line_items array:
// construct the fields string to pass to authorize.net
foreach( $this->fields as $key => $value )
$this->field_string .= "$key=".urlencode( $value )."&";
foreach ($this->line_items as $value)
$this->field_string .= "x_line_item=".urlencode($value)."&";
Hope this might help anyone else wanting to use line items.
i dropped it in place and got approval on my first test transaction the first time i submitted it.
many thx Micah
Success:
(TESTMODE) This transaction has been approved.
0 Response Code 1
1 Response Subcode 1
2 Response Reason Code 1
3 Response Reason Text (TESTMODE) This transaction has been approved.
4 Approval Code 000000
5 AVS Result Code P
6 Transaction ID 0
7 Invoice Number
8 Description
9 Amount 10.00
10 Method CC
11 Transaction Type auth_capture
12 Customer ID
13 Cardholder First Name xxx
14 Cardholder Last Name xxx
15 Company
16 Billing Address xxx
17 City xxxx
18 State xxx
19 Zip xxx
20 Country US
21 Phone xxx
22 Fax
23 Email someone@somedomain.com
37 MD5 Hash AEBCFED5EAB80D363DF8D5588B4245BE
68 Merchant Defined Field 0 FALSE
$a->add_field('x_login', 'xxx');
$a->add_field('x_tran_key', 'xxx');
$a->add_field('x_first_name', 'xx');
$a->add_field('x_last_name', 'xx');
$a->add_field('x_address', 'xx');
$a->add_field('x_city', 'xx');
$a->add_field('x_state', 'TX');
$a->add_field('x_zip', 'xx');
$a->add_field('x_country', 'US');
$a->add_field('x_email', 'someone@somedomain.com');
$a->add_field('x_phone', 'xxx-xxx-xxxx');
$a->add_field('x_card_num', 'xxxxxxxxx'); // test successful visa
$a->add_field('x_amount', '10.00');
$a->add_field('x_exp_date', '0411'); // march of 2008
$a->add_field('x_card_code', 'xxx'); // Card CAVV Security code
And I get the result:
Success:
(TESTMODE) This transaction has been approved.
How do I know whether the credit card is valid or not?
Can you tell me more?
Thanks alot
I have used your authorize.net class. I m getting "Error with Transaction:" i.e. Case 3 error. Please help me.
Thanks
https://test.authorize.net/gateway/transact.dll
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
This will bypass certificate verification.
Thanks for your authorize.net integration support. Do you have any Googlecheckout(IPN) classes in php and mysql? if so, please help me.
With Best Regards
Thanks
It would be great if ARB code is your .
Thanks
This one is the best than other and thanks .
@Anthony: It looks like the ARB stuff is done a different way (SOAP or XML) so I'm guessing that this won't work for those. More info: http://developer.authorize.net/guides/
I am facing one issue by using ur class...the issues is that i have turn off the test mode on authorize.net but i am still receiving test mode email....why is this happening????....is there any issue in the class or what else???
Kindly Reply
Regards,
Haider
Chetan: Yes, you will most likely be able to use the script. HTTP and SSL are sort of different things. As long as the PHP version you have has the CURL module installed you should be okay.
So,like paypal ipn, it will work for my site also?
Leave a Comment about "PHP Authorize.net AIM Interfacing Class"