Previous: PHP Paypal IPN Integration Class
Next: PHP MySQL Database Class

PHP Authorize.net AIM Interfacing Class

April 19th, 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:
Download Authorize.net PHP Script authorizenet-1.0.1.zip

Do you like this code? Rate This Script at Hot Scripts.

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 PHP

Related Posts


Technorati Tags

26 Responses to “PHP Authorize.net AIM Interfacing Class”

RSS Subscription Comments RSS Feed

  1. Uthman Says:

    i believe your .zip file corrupt =X

  2. Micah Says:

    Thank you. It has been re-uploaded.

  3. Anthony Sheetz Says:

    Your class does not appear to calculate or compare the md5 hash the AIM interface provides. Doing so would improve the security of your class and the transactions it handles.

  4. albert Says:

    thanks man...nice job...

  5. redtube Says:

    thansk this script very nice

  6. Mike Says:

    Can this be used for ARB recurring payments? Great job.

  7. Chetan patel Says:

    If my site is http then this class will work? I dont know what is ssl.

    So,like paypal ipn, it will work for my site also?

  8. Micah Says:

    Mike: I don't actually know, though I would assume. I left it basic and simple so that you could use it for anything available so long as you know what variables to pass on.

    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.

  9. Samantha Davis Says:

    I noticed this was posted several years ago, does it still work with the current authorize.net? Thanks!

  10. Haider Says:

    Hi Boss,

    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

  11. Code: Php Authorize.net AIM Class | breaker of stuff, destroyer of things Says:

    [...] Micah Carrick - Authorize.net AIM Interface using CURL [...]

  12. Mike Says:

    i'm using this to communicate with aim and icq http://thinker.rubay.de/archives/20-PHPurple-v0.2-alpha-released.html

  13. Anthony Brown Says:

    Hit here nice class and thanks! just wondering does it support reaacurring billing ? (monthly payments etc..) thanks allot

  14. Joe Lencioni Says:

    @Mike: Wrong AIM, but 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/

  15. Aktar Says:

    Great Job !!!

    This one is the best than other and thanks .

  16. Aktar Says:

    Would you give me any or your ARB recurring payments link ?
    It would be great if ARB code is your .
    Thanks

  17. Kalpesh Gamir Says:

    thansk this script very nice

  18. Tahara Ezell Says:

    After turning off the dump fields, I get a blank screen. Although the script still works. How would I output only the accepted, declined or errored without showing all the rest of the responses.

    Thanks

  19. Rudraraj Says:

    Hi Micah ,

    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

  20. Jason Maletsky Says:

    If you are testing with a self-signed CA cert add the following to the process() function in the CURL block.

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

    This will bypass certificate verification.

  21. Jason Maletsky Says:

    Change $gateway_url in authorize.class.php to the following if you are using a test (development) account.

    https://test.authorize.net/gateway/transact.dll

  22. Girish Says:

    Hi,

    I have used your authorize.net class. I m getting "Error with Transaction:" i.e. Case 3 error. Please help me.

    Thanks

  23. Kenvin Johnson Says:

    Do I just need to change all these information???

    $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

  24. Kenvin Johnson Says:

    This is result which I got:

    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

  25. cphrmky Says:

    nice nice nice, this is a great easy to use class, along with the provided demo file.

    i dropped it in place and got approval on my first test transaction the first time i submitted it.

    many thx Micah

  26. Michael Price Says:

    Authorize.net has adocument named AIM_Guide.pdf that lists all of the required ARB settings.

Leave a Reply