<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AIM API method returning errors with no codes in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17554#M9800</link>
    <description>&lt;P&gt;They finally created the file and directory for me.&amp;nbsp; Thanks for staying with me on this.&amp;nbsp; Everything worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last Question:&amp;nbsp; When Authorize.net rejects due to a duplicate transation, do they do so based on e-mail address.&amp;nbsp; We are testing&amp;nbsp; a few of my credit cards.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Oct 2011 14:04:55 GMT</pubDate>
    <dc:creator>mathceleb1</dc:creator>
    <dc:date>2011-10-01T14:04:55Z</dc:date>
    <item>
      <title>AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17312#M9687</link>
      <description>&lt;P&gt;I'm working on the AIM API method.&amp;nbsp; It makes it to the process_sale page, but returns errors with no codes.&amp;nbsp; Any idea where I went wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://www.mathcelebrity.com/checkout_form.php"&gt;www.mathcelebrity.com/checkout_form.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;response code&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;response reason code&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;response reason text&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;﻿&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 15:39:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17312#M9687</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-26T15:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17314#M9688</link>
      <description>&lt;P&gt;Without showing us process_sale.php code, your guess is as good as our.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 16:07:52 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17314#M9688</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2011-09-26T16:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17316#M9689</link>
      <description>&lt;P&gt;&amp;lt;?php&lt;BR /&gt;&lt;BR /&gt;require_once 'coffee_store_settings.php';&lt;BR /&gt;require_once 'AuthorizeNetAIM.php';&lt;BR /&gt;$METHOD_TO_USE = "AIM";&lt;BR /&gt;if ($METHOD_TO_USE == "AIM") {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $transaction = new AuthorizeNetAIM;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $transaction-&amp;gt;setSandbox(AUTHORIZENET_SANDBOX);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $transaction-&amp;gt;setFields(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'amount' =&amp;gt; $amount,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'card_num' =&amp;gt; $_POST['x_card_num'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'exp_date' =&amp;gt; $_POST['exp_month'].$_POST['exp_year'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'first_name' =&amp;gt; $_POST['x_first_name'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'last_name' =&amp;gt; $_POST['x_last_name'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'address' =&amp;gt; $_POST['x_address'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'city' =&amp;gt; $_POST['x_city'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'state' =&amp;gt; $_POST['x_state'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'country' =&amp;gt; $_POST['x_country'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'zip' =&amp;gt; $_POST['x_zip'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'email' =&amp;gt; $_POST['x_email'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'card_code' =&amp;gt; $_POST['x_card_code'],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $response = $transaction-&amp;gt;authorizeAndCapture();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($response-&amp;gt;approved) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Transaction approved! Do your logic here.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // generate passcode&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //$passcode=generate_passcode(9,9);&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; header('Location: thank_you_page.php?transaction_id=' . $response-&amp;gt;transaction_id);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; header('Location: error_page.php?response_reason_code='.$response-&amp;gt;response_reason_code.'&amp;amp;response_code='.$response-&amp;gt;response_code.'&amp;amp;response_reason_text=' .$response-&amp;gt;response_reason_text);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;} elseif (count($_POST)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $response = new AuthorizeNetSIM;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($response-&amp;gt;isAuthorizeNet()) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($response-&amp;gt;approved) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Transaction approved! Do your logic here.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Redirect the user back to your site.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $return_url = $site_root . 'thank_you_page.php?transaction_id=' .$response-&amp;gt;transaction_id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // There was a problem. Do your logic here.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Redirect the user back to your site.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $return_url = $site_root . 'error_page.php?response_reason_code='.$response-&amp;gt;response_reason_code.'&amp;amp;response_code='.$response-&amp;gt;response_code.'&amp;amp;response_reason_text=' .$response-&amp;gt;response_reason_text;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo AuthorizeNetDPM::getRelayResponseSnippet($return_url);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "MD5 Hash failed. Check to make sure your MD5 Setting matches the one in config.php";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}﻿&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 16:09:54 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17316#M9689</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-26T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17324#M9693</link>
      <description>&lt;P&gt;Make a modified version of the page that on error does print_r($response); exit; Then paste us that response. Should tell us what's going on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: Also put any code or output in a code box - see the fifth icon from the left in Rich Text mode.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 21:08:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17324#M9693</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-26T21:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17330#M9696</link>
      <description>&lt;PRE&gt;AuthorizeNetAIM_Response Object ( [_response_array:private] =&amp;gt; Array ( ) [approved] =&amp;gt; [declined] =&amp;gt; [error] =&amp;gt; 1 [held] =&amp;gt; [response_code] =&amp;gt; [response_subcode] =&amp;gt; [response_reason_code] =&amp;gt; [response_reason_text] =&amp;gt; [authorization_code] =&amp;gt; [avs_response] =&amp;gt; [transaction_id] =&amp;gt; [invoice_number] =&amp;gt; [description] =&amp;gt; [amount] =&amp;gt; [method] =&amp;gt; [transaction_type] =&amp;gt; [customer_id] =&amp;gt; [first_name] =&amp;gt; [last_name] =&amp;gt; [company] =&amp;gt; [address] =&amp;gt; [city] =&amp;gt; [state] =&amp;gt; [zip_code] =&amp;gt; [country] =&amp;gt; [phone] =&amp;gt; [fax] =&amp;gt; [email_address] =&amp;gt; [ship_to_first_name] =&amp;gt; [ship_to_last_name] =&amp;gt; [ship_to_company] =&amp;gt; [ship_to_address] =&amp;gt; [ship_to_city] =&amp;gt; [ship_to_state] =&amp;gt; [ship_to_zip_code] =&amp;gt; [ship_to_country] =&amp;gt; [tax] =&amp;gt; [duty] =&amp;gt; [freight] =&amp;gt; [tax_exempt] =&amp;gt; [purchase_order_number] =&amp;gt; [md5_hash] =&amp;gt; [card_code_response] =&amp;gt; [cavv_response] =&amp;gt; [account_number] =&amp;gt; [card_type] =&amp;gt; [split_tender_id] =&amp;gt; [requested_amount] =&amp;gt; [balance_on_card] =&amp;gt; [response] =&amp;gt; [error_message] =&amp;gt; Error connecting to AuthorizeNet ) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to include AuthorizeNet.php as well as other files.&amp;nbsp; Let me add this and repost after re-running this fix.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 21:35:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17330#M9696</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-26T21:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17334#M9698</link>
      <description>&lt;P&gt;Aha! Error connecting to Authorize.net. So yes, it's not the code - either the test server is down at the moment (this occasionally happens), or you're not including the correct file.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2011 21:38:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17334#M9698</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-26T21:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17344#M9703</link>
      <description>&lt;PRE&gt;AuthorizeNetAIM_Response Object ( [_response_array:private] =&amp;gt; Array ( ) [approved] =&amp;gt; [declined] =&amp;gt; [error] =&amp;gt; 1 [held] =&amp;gt; [response_code] =&amp;gt; [response_subcode] =&amp;gt; [response_reason_code] =&amp;gt; [response_reason_text] =&amp;gt; [authorization_code] =&amp;gt; [avs_response] =&amp;gt; [transaction_id] =&amp;gt; [invoice_number] =&amp;gt; [description] =&amp;gt; [amount] =&amp;gt; [method] =&amp;gt; [transaction_type] =&amp;gt; [customer_id] =&amp;gt; [first_name] =&amp;gt; [last_name] =&amp;gt; [company] =&amp;gt; [address] =&amp;gt; [city] =&amp;gt; [state] =&amp;gt; [zip_code] =&amp;gt; [country] =&amp;gt; [phone] =&amp;gt; [fax] =&amp;gt; [email_address] =&amp;gt; [ship_to_first_name] =&amp;gt; [ship_to_last_name] =&amp;gt; [ship_to_company] =&amp;gt; [ship_to_address] =&amp;gt; [ship_to_city] =&amp;gt; [ship_to_state] =&amp;gt; [ship_to_zip_code] =&amp;gt; [ship_to_country] =&amp;gt; [tax] =&amp;gt; [duty] =&amp;gt; [freight] =&amp;gt; [tax_exempt] =&amp;gt; [purchase_order_number] =&amp;gt; [md5_hash] =&amp;gt; [card_code_response] =&amp;gt; [cavv_response] =&amp;gt; [account_number] =&amp;gt; [card_type] =&amp;gt; [split_tender_id] =&amp;gt; [requested_amount] =&amp;gt; [balance_on_card] =&amp;gt; [response] =&amp;gt; [error_message] =&amp;gt; Error connecting to AuthorizeNet ) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My latest response is posted above.&amp;nbsp; I'm not getting any include errors anymore.&amp;nbsp; I see that the variables are coming down from the POST, but I think it may be going wrong on authorizeandCapture().&amp;nbsp; Any thoughts you could provide would be helpful.&amp;nbsp; Below is my code for AuthorizeNetAIM.php&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php

/**
 * Easily interact with the Authorize.Net AIM API.
 *
 * Example Authorize and Capture Transaction against the Sandbox:
 * &amp;lt;code&amp;gt;
 * &amp;lt;?php require_once 'AuthorizeNet.php'
 * $sale = new AuthorizeNetAIM;
 * $sale-&amp;gt;setFields(
 *     array(
 *    'amount' =&amp;gt; '4.99',
 *    'card_num' =&amp;gt; '411111111111111',
 *    'exp_date' =&amp;gt; '0515'
 *    )
 * );
 * $response = $sale-&amp;gt;authorizeAndCapture();
 * if ($response-&amp;gt;approved) {
 *     echo "Sale successful!"; } else {
 *     echo $response-&amp;gt;error_message;
 * }
 * ?&amp;gt;
 * &amp;lt;/code&amp;gt;
 *
 * Note: To send requests to the live gateway, either define this:
 * define("AUTHORIZENET_SANDBOX", false);
 *   -- OR -- 
 * $sale = new AuthorizeNetAIM;
 * $sale-&amp;gt;setSandbox(false);
 *
 * @package    AuthorizeNet
 * @subpackage AuthorizeNetAIM
 * @link       &lt;A target="_blank" href="http://www.authorize.net/support/AIM_guide.pdf"&gt;http://www.authorize.net/support/AIM_guide.pdf&lt;/A&gt; AIM Guide
 */

 
/**
 * Builds and sends an AuthorizeNet AIM Request.
 *
 * @package    AuthorizeNet
 * @subpackage AuthorizeNetAIM
 */
class AuthorizeNetAIM extends AuthorizeNetRequest
{

    const LIVE_URL = '&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll';"&gt;https://secure.authorize.net/gateway/transact.dll';&lt;/A&gt;
    const SANDBOX_URL = '&lt;A target="_blank" href="https://test.authorize.net/gateway/transact.dll';"&gt;https://test.authorize.net/gateway/transact.dll';&lt;/A&gt;
    
    /**
     * Holds all the x_* name/values that will be posted in the request. 
     * Default values are provided for best practice fields.
     */
    protected $_x_post_fields = array(
        "version" =&amp;gt; "3.1", 
        "delim_char" =&amp;gt; ",",
        "delim_data" =&amp;gt; "TRUE",
        "relay_response" =&amp;gt; "FALSE",
        "encap_char" =&amp;gt; "|",
        );
        
    /**
     * Only used if merchant wants to send multiple line items about the charge.
     */
    private $_additional_line_items = array();
    
    /**
     * Only used if merchant wants to send custom fields.
     */
    private $_custom_fields = array();
    
    /**
     * Checks to make sure a field is actually in the API before setting.
     * Set to false to skip this check.
     */
    public $verify_x_fields = true;
    
    /**
     * A list of all fields in the AIM API.
     * Used to warn user if they try to set a field not offered in the API.
     */
    private $_all_aim_fields = array("address","allow_partial_auth","amount",
        "auth_code","authentication_indicator", "bank_aba_code","bank_acct_name",
        "bank_acct_num","bank_acct_type","bank_check_number","bank_name",
        "card_code","card_num","cardholder_authentication_value","city","company",
        "country","cust_id","customer_ip","delim_char","delim_data","description",
        "duplicate_window","duty","echeck_type","email","email_customer",
        "encap_char","exp_date","fax","first_name","footer_email_receipt",
        "freight","header_email_receipt","invoice_num","last_name","line_item",
        "login","method","phone","po_num","recurring_billing","relay_response",
        "ship_to_address","ship_to_city","ship_to_company","ship_to_country",
        "ship_to_first_name","ship_to_last_name","ship_to_state","ship_to_zip",
        "split_tender_id","state","tax","tax_exempt","test_request","tran_key",
        "trans_id","type","version","zip"
        );
    
    /**
     * Do an AUTH_CAPTURE transaction. 
     * 
     * Required "x_" fields: card_num, exp_date, amount
     *
     * @param string $amount   The dollar amount to charge
     * @param string $card_num The credit card number
     * @param string $exp_date CC expiration date
     *
     * @return AuthorizeNetAIM_Response
     */
    public function authorizeAndCapture($amount = false, $card_num = false, $exp_date = false)
    {
//        ($amount ? $this-&amp;gt;amount = $amount : null);
        ($card_num ? $this-&amp;gt;card_num = $card_num : null);
        ($exp_date ? $this-&amp;gt;exp_date = $exp_date : null);
//$this-&amp;gt;amount = $amount;
//$this-&amp;gt;exp_date = $exp_date;
//$this-&amp;gt;card_num = $card_num;
echo "AIM amount = " .$this-&amp;gt;x_amount."&amp;lt;br /&amp;gt;";
        $this-&amp;gt;type = "AUTH_CAPTURE";
        return $this-&amp;gt;_sendRequest();
    }
    
    /**
     * Do a PRIOR_AUTH_CAPTURE transaction.
     *
     * Required "x_" field: trans_id(The transaction id of the prior auth, unless split
     * tender, then set x_split_tender_id manually.)
     * amount (only if lesser than original auth)
     *
     * @param string $trans_id Transaction id to charge
     * @param string $amount   Dollar amount to charge if lesser than auth
     *
     * @return AuthorizeNetAIM_Response
     */
    public function priorAuthCapture($trans_id = false, $amount = false)
    {
        ($trans_id ? $this-&amp;gt;trans_id = $trans_id : null);
        ($amount ? $this-&amp;gt;amount = $amount : null);
        $this-&amp;gt;type = "PRIOR_AUTH_CAPTURE";
        return $this-&amp;gt;_sendRequest();
    }

    /**
     * Do an AUTH_ONLY transaction.
     *
     * Required "x_" fields: card_num, exp_date, amount
     *
     * @param string $amount   The dollar amount to charge
     * @param string $card_num The credit card number
     * @param string $exp_date CC expiration date
     *
     * @return AuthorizeNetAIM_Response
     */
    public function authorizeOnly($amount = false, $card_num = false, $exp_date = false)
    {
        ($amount ? $this-&amp;gt;amount = $amount : null);
        ($card_num ? $this-&amp;gt;card_num = $card_num : null);
        ($exp_date ? $this-&amp;gt;exp_date = $exp_date : null);
        $this-&amp;gt;type = "AUTH_ONLY";
        return $this-&amp;gt;_sendRequest();
    }

    /**
     * Do a VOID transaction.
     *
     * Required "x_" field: trans_id(The transaction id of the prior auth, unless split
     * tender, then set x_split_tender_id manually.)
     *
     * @param string $trans_id Transaction id to void
     *
     * @return AuthorizeNetAIM_Response
     */
    public function void($trans_id = false)
    {
        ($trans_id ? $this-&amp;gt;trans_id = $trans_id : null);
        $this-&amp;gt;type = "VOID";
        return $this-&amp;gt;_sendRequest();
    }
    
    /**
     * Do a CAPTURE_ONLY transaction.
     *
     * Required "x_" fields: auth_code, amount, card_num , exp_date
     *
     * @param string $auth_code The auth code
     * @param string $amount    The dollar amount to charge
     * @param string $card_num  The last 4 of credit card number
     * @param string $exp_date  CC expiration date
     *
     * @return AuthorizeNetAIM_Response
     */
    public function captureOnly($auth_code = false, $amount = false, $card_num = false, $exp_date = false)
    {
        ($auth_code ? $this-&amp;gt;auth_code = $auth_code : null);
        ($amount ? $this-&amp;gt;amount = $amount : null);
        ($card_num ? $this-&amp;gt;card_num = $card_num : null);
        ($exp_date ? $this-&amp;gt;exp_date = $exp_date : null);
        $this-&amp;gt;type = "CAPTURE_ONLY";
        return $this-&amp;gt;_sendRequest();
    }
    
    /**
     * Do a CREDIT transaction.
     *
     * Required "x_" fields: trans_id, amount, card_num (just the last 4)
     *
     * @param string $trans_id Transaction id to credit
     * @param string $amount   The dollar amount to credit
     * @param string $card_num The last 4 of credit card number
     *
     * @return AuthorizeNetAIM_Response
     */
    public function credit($trans_id = false, $amount = false, $card_num = false)
    {
        ($trans_id ? $this-&amp;gt;trans_id = $trans_id : null);
        ($amount ? $this-&amp;gt;amount = $amount : null);
        ($card_num ? $this-&amp;gt;card_num = $card_num : null);
        $this-&amp;gt;type = "CREDIT";
        return $this-&amp;gt;_sendRequest();
    }
    
    /**
     * Alternative syntax for setting x_ fields.
     *
     * Usage: $sale-&amp;gt;method = "echeck";
     *
     * @param string $name
     * @param string $value
     */
    public function __set($name, $value) 
    {
        $this-&amp;gt;setField($name, $value);
    }
    
    /**
     * Quickly set multiple fields.
     *
     * Note: The prefix x_ will be added to all fields. If you want to set a
     * custom field without the x_ prefix, use setCustomField or setCustomFields.
     *
     * @param array $fields Takes an array or object.
     */
    public function setFields($fields)
    {
        $array = (array)$fields;
        foreach ($array as $key =&amp;gt; $value) {
echo "key = " . $key . " and value = ".$value . "&amp;lt;br /&amp;gt;";
            $this-&amp;gt;setField($key, $value);
        }
    }
    
    /**
     * Quickly set multiple custom fields.
     *
     * @param array $fields
     */
    public function setCustomFields($fields)
    {
        $array = (array)$fields;
        foreach ($array as $key =&amp;gt; $value) {
            $this-&amp;gt;setCustomField($key, $value);
        }
    }
    
    /**
     * Add a line item.
     * 
     * @param string $item_id
     * @param string $item_name
     * @param string $item_description
     * @param string $item_quantity
     * @param string $item_unit_price
     * @param string $item_taxable
     */
    public function addLineItem($item_id, $item_name, $item_description, $item_quantity, $item_unit_price, $item_taxable)
    {
        $line_item = "";
        $delimiter = "";
        foreach (func_get_args() as $key =&amp;gt; $value) {
            $line_item .= $delimiter . $value;
            $delimiter = "&amp;lt;|&amp;gt;";
        }
        $this-&amp;gt;_additional_line_items[] = $line_item;
    }
    
    /**
     * Use ECHECK as payment type.
     */
    public function setECheck($bank_aba_code, $bank_acct_num, $bank_acct_type, $bank_name, $bank_acct_name, $echeck_type = 'WEB')
    {
        $this-&amp;gt;setFields(
            array(
            'method' =&amp;gt; 'echeck',
            'bank_aba_code' =&amp;gt; $bank_aba_code,
            'bank_acct_num' =&amp;gt; $bank_acct_num,
            'bank_acct_type' =&amp;gt; $bank_acct_type,
            'bank_name' =&amp;gt; $bank_name,
            'bank_acct_name' =&amp;gt; $bank_acct_type,
            'echeck_type' =&amp;gt; $echeck_type,
            )
        );
    }
    
    /**
     * Set an individual name/value pair. This will append x_ to the name
     * before posting.
     *
     * @param string $name
     * @param string $value
     */
    public function setField($name, $value)
    {
        if ($this-&amp;gt;verify_x_fields) {
            if (in_array($name, $this-&amp;gt;_all_aim_fields)) {
                $this-&amp;gt;_x_post_fields[$name] = $value;
            } else {
                throw new AuthorizeNetException("Error: no field $name exists in the AIM API.
                To set a custom field use setCustomField('field','value') instead.");
            }
        } else {
            $this-&amp;gt;_x_post_fields[$name] = $value;
        }
    }
    
    /**
     * Set a custom field. Note: the x_ prefix will not be added to
     * your custom field if you use this method.
     *
     * @param string $name
     * @param string $value
     */
    public function setCustomField($name, $value)
    {
        $this-&amp;gt;_custom_fields[$name] = $value;
    }
    
    /**
     * Unset an x_ field.
     *
     * @param string $name Field to unset.
     */
    public function unsetField($name)
    {
        unset($this-&amp;gt;_x_post_fields[$name]);
    }
    
    /**
     *
     *
     * @param string $response
     * 
     * @return AuthorizeNetAIM_Response
     */
    protected function _handleResponse($response)
    {
        return new AuthorizeNetAIM_Response($response, $this-&amp;gt;_x_post_fields['delim_char'], $this-&amp;gt;_x_post_fields['encap_char'], $this-&amp;gt;_custom_fields);
    }
    
    /**
     * @return string
     */
    protected function _getPostUrl()
    {
        return ($this-&amp;gt;_sandbox ? self::SANDBOX_URL : self::LIVE_URL);
    }
    
    /**
     * Converts the x_post_fields array into a string suitable for posting.
     */
    protected function _setPostString()
    {
        $this-&amp;gt;_x_post_fields['login'] = $this-&amp;gt;_api_login;
        $this-&amp;gt;_x_post_fields['tran_key'] = $this-&amp;gt;_transaction_key;
        $this-&amp;gt;_post_string = "";
        foreach ($this-&amp;gt;_x_post_fields as $key =&amp;gt; $value) {
            $this-&amp;gt;_post_string .= "x_$key=" . urlencode($value) . "&amp;amp;";
        }
        // Add line items
        foreach ($this-&amp;gt;_additional_line_items as $key =&amp;gt; $value) {
            $this-&amp;gt;_post_string .= "x_line_item=" . urlencode($value) . "&amp;amp;";
        }
        // Add custom fields
        foreach ($this-&amp;gt;_custom_fields as $key =&amp;gt; $value) {
            $this-&amp;gt;_post_string .= "$key=" . urlencode($value) . "&amp;amp;";
        }
        $this-&amp;gt;_post_string = rtrim($this-&amp;gt;_post_string, "&amp;amp; ");
    }
}

/**
 * Parses an AuthorizeNet AIM Response.
 *
 * @package    AuthorizeNet
 * @subpackage AuthorizeNetAIM
 */
class AuthorizeNetAIM_Response extends AuthorizeNetResponse
{
    private $_response_array = array(); // An array with the split response.

    /**
     * Constructor. Parses the AuthorizeNet response string.
     *
     * @param string $response      The response from the AuthNet server.
     * @param string $delimiter     The delimiter used (default is ",")
     * @param string $encap_char    The encap_char used (default is "|")
     * @param array  $custom_fields Any custom fields set in the request.
     */
    public function __construct($response, $delimiter, $encap_char, $custom_fields)
    {
        if ($response) {
            
            // Split Array
            $this-&amp;gt;response = $response;
            if ($encap_char) {
                $this-&amp;gt;_response_array = explode($encap_char.$delimiter.$encap_char, substr($response, 1, -1));
            } else {
                $this-&amp;gt;_response_array = explode($delimiter, $response);
            }
            
            /**
             * If AuthorizeNet doesn't return a delimited response.
             */
            if (count($this-&amp;gt;_response_array) &amp;lt; 10) {
                $this-&amp;gt;approved = false;
                $this-&amp;gt;error = true;
                $this-&amp;gt;error_message = "Unrecognized response from AuthorizeNet: $response";
                return;
            }
            
            
            
            // Set all fields
            $this-&amp;gt;response_code        = $this-&amp;gt;_response_array[0];
            $this-&amp;gt;response_subcode     = $this-&amp;gt;_response_array[1];
            $this-&amp;gt;response_reason_code = $this-&amp;gt;_response_array[2];
            $this-&amp;gt;response_reason_text = $this-&amp;gt;_response_array[3];
            $this-&amp;gt;authorization_code   = $this-&amp;gt;_response_array[4];
            $this-&amp;gt;avs_response         = $this-&amp;gt;_response_array[5];
            $this-&amp;gt;transaction_id       = $this-&amp;gt;_response_array[6];
            $this-&amp;gt;invoice_number       = $this-&amp;gt;_response_array[7];
            $this-&amp;gt;description          = $this-&amp;gt;_response_array[8];
            $this-&amp;gt;amount               = $this-&amp;gt;_response_array[9];
            $this-&amp;gt;method               = $this-&amp;gt;_response_array[10];
            $this-&amp;gt;transaction_type     = $this-&amp;gt;_response_array[11];
            $this-&amp;gt;customer_id          = $this-&amp;gt;_response_array[12];
            $this-&amp;gt;first_name           = $this-&amp;gt;_response_array[13];
            $this-&amp;gt;last_name            = $this-&amp;gt;_response_array[14];
            $this-&amp;gt;company              = $this-&amp;gt;_response_array[15];
            $this-&amp;gt;address              = $this-&amp;gt;_response_array[16];
            $this-&amp;gt;city                 = $this-&amp;gt;_response_array[17];
            $this-&amp;gt;state                = $this-&amp;gt;_response_array[18];
            $this-&amp;gt;zip_code             = $this-&amp;gt;_response_array[19];
            $this-&amp;gt;country              = $this-&amp;gt;_response_array[20];
            $this-&amp;gt;phone                = $this-&amp;gt;_response_array[21];
            $this-&amp;gt;fax                  = $this-&amp;gt;_response_array[22];
            $this-&amp;gt;email_address        = $this-&amp;gt;_response_array[23];
            $this-&amp;gt;ship_to_first_name   = $this-&amp;gt;_response_array[24];
            $this-&amp;gt;ship_to_last_name    = $this-&amp;gt;_response_array[25];
            $this-&amp;gt;ship_to_company      = $this-&amp;gt;_response_array[26];
            $this-&amp;gt;ship_to_address      = $this-&amp;gt;_response_array[27];
            $this-&amp;gt;ship_to_city         = $this-&amp;gt;_response_array[28];
            $this-&amp;gt;ship_to_state        = $this-&amp;gt;_response_array[29];
            $this-&amp;gt;ship_to_zip_code     = $this-&amp;gt;_response_array[30];
            $this-&amp;gt;ship_to_country      = $this-&amp;gt;_response_array[31];
            $this-&amp;gt;tax                  = $this-&amp;gt;_response_array[32];
            $this-&amp;gt;duty                 = $this-&amp;gt;_response_array[33];
            $this-&amp;gt;freight              = $this-&amp;gt;_response_array[34];
            $this-&amp;gt;tax_exempt           = $this-&amp;gt;_response_array[35];
            $this-&amp;gt;purchase_order_number= $this-&amp;gt;_response_array[36];
            $this-&amp;gt;md5_hash             = $this-&amp;gt;_response_array[37];
            $this-&amp;gt;card_code_response   = $this-&amp;gt;_response_array[38];
            $this-&amp;gt;cavv_response        = $this-&amp;gt;_response_array[39];
            $this-&amp;gt;account_number       = $this-&amp;gt;_response_array[50];
            $this-&amp;gt;card_type            = $this-&amp;gt;_response_array[51];
            $this-&amp;gt;split_tender_id      = $this-&amp;gt;_response_array[52];
            $this-&amp;gt;requested_amount     = $this-&amp;gt;_response_array[53];
            $this-&amp;gt;balance_on_card      = $this-&amp;gt;_response_array[54];
            
            $this-&amp;gt;approved = ($this-&amp;gt;response_code == self::APPROVED);
            $this-&amp;gt;declined = ($this-&amp;gt;response_code == self::DECLINED);
            $this-&amp;gt;error    = ($this-&amp;gt;response_code == self::ERROR);
            $this-&amp;gt;held     = ($this-&amp;gt;response_code == self::HELD);
            
            // Set custom fields
            if ($count = count($custom_fields)) {
                $custom_fields_response = array_slice($this-&amp;gt;_response_array, -$count, $count);
                $i = 0;
                foreach ($custom_fields as $key =&amp;gt; $value) {
                    $this-&amp;gt;$key = $custom_fields_response[$i];
                    $i++;
                }
            }
            
            if ($this-&amp;gt;error) {
                $this-&amp;gt;error_message = "AuthorizeNet Error:
                Response Code: ".$this-&amp;gt;response_code."
                Response Subcode: ".$this-&amp;gt;response_subcode."
                Response Reason Code: ".$this-&amp;gt;response_reason_code."
                Response Reason Text: ".$this-&amp;gt;response_reason_text."
                ";
            }
        } else {
            $this-&amp;gt;approved = false;
            $this-&amp;gt;error = true;
            $this-&amp;gt;error_message = "Error connecting to AuthorizeNet";
        }
    }

}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 01:14:50 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17344#M9703</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-27T01:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17348#M9705</link>
      <description>&lt;P&gt;Not going to read the huge wall of code. Here's my implementation for AIM, should work with the SDK right out of the box unless they made some major changes in the last few months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: This is for the production server. If using with sandbox, set sandbox to true and use a CCV of 900.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;require_once($_SERVER['DOCUMENT_ROOT'] . '/library/globals.php');
// Includes my Authorize.net ID and key

require_once($_SERVER['DOCUMENT_ROOT'] . '/library/anet_php_sdk/AuthorizeNet.php');
// Path to main file of Authorize.net PHP SDK&lt;BR /&gt;&lt;BR /&gt;    $authorize = new AuthorizeNetAIM(
        $GLOBALS['_authorize_id'], $GLOBALS['_authorize_key']);
    $authorize-&amp;gt;setSandbox(false);

    $fields = array(
        'first_name' =&amp;gt; $_POST['first'],
        'last_name' =&amp;gt; $_POST['last'],
        'company' =&amp;gt; $_POST['company'],
        'address' =&amp;gt; $_POST['address'],
        'city' =&amp;gt; $_POST['city'],
        'state' =&amp;gt; $_POST['state'],
        'zip' =&amp;gt; $_POST['zip'],
        'country' =&amp;gt; 'US',

        'phone' =&amp;gt; $_POST['phone'],
        'email' =&amp;gt; $_POST['email'],

        'customer_ip' =&amp;gt; $_SERVER['REMOTE_ADDR'],

        'description' =&amp;gt; "{$_POST['type']} initial fee for " . count($_POST['zips']) . " zip codes with {$population} total estimated population",
        'amount' =&amp;gt; $_POST['initial_payment'],

        'card_num' =&amp;gt; $_POST['card_number'],
        'exp_date' =&amp;gt; sprintf('%02d%02d', $_POST['card_exp_month'], ($_POST['card_exp_year'] % 1000)),
        'card_code' =&amp;gt; $_POST['card_ccv']
    );
    $authorize-&amp;gt;setFields($fields); 

    $result = $authorize-&amp;gt;authorizeAndCapture();

    if ($result-&amp;gt;error || $result-&amp;gt;{'response_code'} != 1)
        $errors[] = "Initial charge declined - {$result-&amp;gt;response_reason_text}";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 06:41:22 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17348#M9705</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-27T06:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17360#M9711</link>
      <description>&lt;P&gt;I had to set VERIFY_PEER = false.&amp;nbsp; Do I need an SSL cert when it's time to go live?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I now get this response after doing that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Response Code: 3 Response Subcode: 2 Response Reason Code: 13 Response Reason Text: The merchant login ID or password is invalid or the account is inactive&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 15:19:24 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17360#M9711</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-27T15:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17366#M9714</link>
      <description>&lt;P&gt;I found this documentation for reason code 13:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://developer.authorize.net/tools/responsereasoncode/"&gt;http://developer.authorize.net/tools/responsereasoncode/&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to point to the live url?&amp;nbsp; I have sandbox set to true right now.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 16:20:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17366#M9714</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-27T16:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17414#M9737</link>
      <description>&lt;P&gt;If you're using a production account, you have to set sandbox to false. If you're using a sandbox account, you have to set it to true.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 06:24:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17414#M9737</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-28T06:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17428#M9744</link>
      <description>&lt;P&gt;I read on this thread that I need to change the test URL:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://groups.google.com/group/activemerchant/browse_thread/thread/c31387593ddc6015?pli=1"&gt;http://groups.google.com/group/activemerchant/browse_thread/thread/c31387593ddc6015?pli=1&lt;/A&gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;self.test_url = "&lt;A target="_blank" href="http://www.google.com/url?sa=D&amp;amp;q=https://certification.authorize.net/gateway/&amp;amp;usg=AFQjCNHLU_jKdLUkASIOWnHDxQ41Bg65eA" rel="nofollow"&gt;https://certification.authorize.net/gateway/&lt;/A&gt;&lt;BR /&gt;transact.dll"&lt;BR /&gt;rather than&lt;BR /&gt;self.test_url = "&lt;A target="_blank" href="http://www.google.com/url?sa=D&amp;amp;q=https://test.authorize.net/gateway/transact.dll&amp;amp;usg=AFQjCNHx4qnjvLlEYphUrRE1rF7XU-gcRA" rel="nofollow"&gt;https://test.authorize.net/gateway/transact.dll&lt;/A&gt;" ﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I did this, it returns a 405 HTTP error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The response returned is:&lt;/P&gt;&lt;PRE&gt;AuthorizeNetAIM_Response Object ( [_response_array:private] =&amp;gt; Array ( [0] =&amp;gt; !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "&lt;A target="_blank" href="http://www.w3.org/TR/html4/strict.dtd"&gt;http://www.w3.org/TR/html4/strict.dtd&lt;/A&gt;"&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure from the documentation to copy and paste my api login and transaction key into the code directly.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 14:54:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17428#M9744</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-28T14:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17442#M9748</link>
      <description>&lt;P&gt;The Authorize.net SDK should point to the correct URL right out of the box. Are you using a recent, unedited version of the SDK? If not, I suggest redownloading it and this time not editing anything. All the config options can be set in your transaction code, as in my example (see back a few posts).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 21:05:01 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17442#M9748</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-28T21:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17448#M9751</link>
      <description>&lt;P&gt;I downloaded the AIM PHP SDK from the bottom of this page:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://developer.authorize.net/downloads/"&gt;http://developer.authorize.net/downloads/&lt;/A&gt;﻿&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2011 21:28:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17448#M9751</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-09-28T21:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17454#M9753</link>
      <description>&lt;P&gt;Well, that should contain the correct URL's by default regardless of whether you're in sandbox mode or not. Unless the test server is having problems or something, I would think it would have to be a problem with your server connecting via SSL. What happens if you try to send a POST request to yourself at an https:// URL?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Sep 2011 05:01:41 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17454#M9753</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-09-29T05:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17530#M9788</link>
      <description>&lt;P&gt;&lt;A href="https://certification.authorize.net" target="_blank"&gt;https://certification.authorize.net&lt;/A&gt; used to represent an altenative way of connecting to a production account in test mode, but we retired that URL over 3 years ago and it now just points to our sandbox environment.&amp;nbsp; The only two currently valid URLs are:&lt;/P&gt;
&lt;P&gt;Production: &lt;A href="https://secure.authorize.net/gateway/transact.dll" target="_blank"&gt;https://secure.authorize.net/gateway/transact.dll&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Sandbox: &lt;A href="https://test.authorize.net/gateway/transact.dll" target="_blank"&gt;https://test.authorize.net/gateway/transact.dll&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be using secure.authorize.net for a production account, even if that account is in test mode.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2011 22:19:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17530#M9788</guid>
      <dc:creator>Trevor</dc:creator>
      <dc:date>2011-09-30T22:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17546#M9796</link>
      <description>&lt;P&gt;I was sucessfully able to connect using the production server, and turning off my test account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last question before I go live:&amp;nbsp; I purchased an SSL and got my certificate.&amp;nbsp; however, I need to make a file out of that certificate so the Authorize.net code can find it.&amp;nbsp; Is it simply a matter of making a text file, pasting in the certificate, and saving it as a .pem file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My host is not answering my question on this.&amp;nbsp; This might not be the right thread for this, but nobody else can seem to answer my question with my host.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2011 05:37:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17546#M9796</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-10-01T05:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17552#M9799</link>
      <description>&lt;P&gt;All the hosting I've used has a control panel of some sort for setting up the SSL. Are you saying there's absolutely no control panel for your hosting?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2011 06:03:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17552#M9799</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-10-01T06:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17554#M9800</link>
      <description>&lt;P&gt;They finally created the file and directory for me.&amp;nbsp; Thanks for staying with me on this.&amp;nbsp; Everything worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last Question:&amp;nbsp; When Authorize.net rejects due to a duplicate transation, do they do so based on e-mail address.&amp;nbsp; We are testing&amp;nbsp; a few of my credit cards.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2011 14:04:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17554#M9800</guid>
      <dc:creator>mathceleb1</dc:creator>
      <dc:date>2011-10-01T14:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: AIM API method returning errors with no codes</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17562#M9804</link>
      <description>&lt;P&gt;Interesting question, but one I don't know the answer to. Going to have to wait for a mod to get on here and post.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2011 01:01:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AIM-API-method-returning-errors-with-no-codes/m-p/17562#M9804</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-10-02T01:01:59Z</dc:date>
    </item>
  </channel>
</rss>

