Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2002
    New York

    Need help with AIM PHP code

    I am using the PHP AIM code
    it works fine however I am not able for some reason to get the transaction ID

    I am using the below

    I am doing the below so that I can then put all the info into a mysql database. My issue is all the below hold values except for the $transaction_id no matter if the transaction is approved or not no transaction id is captured. So I am thinking maybe $response_array[7]; is not the correct tag?

                   $responsenum = $response_array[0];
    		$response_text = $response_array[4];
    		$transaction_id = $response_array[7];
    		$lastfour_num = $response_array[50];
    		$cardtype = $response_array[51];
    Also if a transaction is declined is a transaction ID not generated?

    Thanks all
    just a programmer

  2. #2
    Join Date
    Dec 2002
    chennai , tamil nadu , IN
    It is the seventh element so should be $response_array[6] isn't it ?
    Chris, Developer/Programmer,
    Php laravel developers,
    Ruby on Rails developers,

  3. #3
    Join Date
    Feb 2002
    New York
    Thank you for your help!!
    just a programmer

  4. #4
    Join Date
    Oct 2004
    Oakville, ON
    I haven't used the AIM API's before, so I can't say for sure but does have a related transaction id for every attempt. As such it likely will provide a transaction reference even when the charge fails.

    To help insure that you don't accept a declined charge, I would recommend building an if statement around the "responseCode" field. This will allow you to take action dependent on the result of the code. Something like say:

    PHP Code:
    if($response_array['responseCode'] == "1"){ 
    // Transaction Approved / Success
    } else { 
    // Transaction Declined / Error / Held for Review

    You could further segment with the "else if" statement to act dependent on the response value.

    My only other recommendation may be to use the associate value instead of the numeric, I've found this helps greatly when it comes time to debug or review your code after a few months.

    I'm sure you have it but the pdf has some helpful examples as well:
    Josh Dargie
    Developer & Designer Friendly Web Hosting

Similar Threads

  1. AIM Expert
    By HNLV in forum Software & Scripts Requests
    Replies: 0
    Last Post: 01-17-2008, 02:16 AM
  2. AIM Integration - $40.00
    By Salvatore in forum Other Offers & Requests
    Replies: 1
    Last Post: 11-26-2004, 04:52 PM
  3. Authorize.Net Card Code Settings
    By aixagent in forum Ecommerce Hosting & Discussion
    Replies: 2
    Last Post: 08-06-2004, 08:35 AM
  4. AIM inetergration
    By rlynch in forum Hosting Security and Technology
    Replies: 2
    Last Post: 04-16-2003, 04:17 AM
  5. fsockopen and PHP 4.3.0 and
    By cyberlot in forum Programming Discussion
    Replies: 0
    Last Post: 02-15-2003, 09:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts