<?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: Does the PHP test code work? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15164#M8669</link>
    <description>&lt;P&gt;How do I change the server that it's using? I'm starting to wonder if it's even worth using the SDK if I'm going to have to modify their code anyways. Sure would have been nice if the TEST CODE was setup to work in TEST MODE.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jul 2011 16:30:23 GMT</pubDate>
    <dc:creator>Quicksilver</dc:creator>
    <dc:date>2011-07-21T16:30:23Z</dc:date>
    <item>
      <title>Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15146#M8660</link>
      <description>&lt;P&gt;I'm trying to integrate Authorize.net into my system using the AIM method. I'm using the test code -&lt;/P&gt;&lt;P&gt;&amp;lt;?php&lt;BR /&gt;require_once '../../commerce/anet_php_sdk/AuthorizeNet.php'; // Make sure this path is correct.&lt;BR /&gt;$transaction = new AuthorizeNetAIM('xxxxxxxxxxxx, 'xxxxxxxxxxxx');&lt;BR /&gt;$transaction-&amp;gt;amount = '9.99';&lt;BR /&gt;$transaction-&amp;gt;card_num = '4007000000027';&lt;BR /&gt;$transaction-&amp;gt;exp_date = '10/16';&lt;BR /&gt;&lt;BR /&gt;$response = $transaction-&amp;gt;authorizeAndCapture();&lt;BR /&gt;&lt;BR /&gt;if ($response-&amp;gt;approved) {&lt;BR /&gt;&amp;nbsp; echo "&amp;lt;h1&amp;gt;Success! The test credit card has been charged!&amp;lt;/h1&amp;gt;";&lt;BR /&gt;&amp;nbsp; echo "Transaction ID: " . $response-&amp;gt;transaction_id;&lt;BR /&gt;} else {&lt;BR /&gt;&amp;nbsp; echo $response-&amp;gt;error_message;&lt;BR /&gt;}&lt;BR /&gt;?&amp;gt;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read somewhere that this code is bad and doesn't actually work? I'm getting an error "AuthorizeNet Error: 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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a valid ID etc, I just put xxxxx in this example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 21:38:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15146#M8660</guid>
      <dc:creator>Quicksilver</dc:creator>
      <dc:date>2011-07-20T21:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15156#M8665</link>
      <description>The test code perfectly fine. The result you got proves that as that is a valid response. You're probably using the test server with live credentials or vice versa.</description>
      <pubDate>Thu, 21 Jul 2011 11:55:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15156#M8665</guid>
      <dc:creator>stymiee</dc:creator>
      <dc:date>2011-07-21T11:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15164#M8669</link>
      <description>&lt;P&gt;How do I change the server that it's using? I'm starting to wonder if it's even worth using the SDK if I'm going to have to modify their code anyways. Sure would have been nice if the TEST CODE was setup to work in TEST MODE.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2011 16:30:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15164#M8669</guid>
      <dc:creator>Quicksilver</dc:creator>
      <dc:date>2011-07-21T16:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15168#M8671</link>
      <description>&lt;P&gt;It does, at least for me. Consider this ARB example (recurring billing test). I got the following code from the SDK (php) after I created my test aurhorize.net account. It works as it created multiple recurring billing test purchases that I can view by logging into my test merchant account:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;require_once 'anet_php_sdk/AuthorizeNet.php';&lt;BR /&gt;define("AUTHORIZENET_API_LOGIN_ID", "my_login_id_number");&lt;BR /&gt;define("AUTHORIZENET_TRANSACTION_KEY", "my_transaction_key");&lt;BR /&gt;$subscription = new AuthorizeNet_Subscription;&lt;BR /&gt;$subscription-&amp;gt;name = "PHP Monthly Magazine";&lt;BR /&gt;$subscription-&amp;gt;intervalLength = "1";&lt;BR /&gt;$subscription-&amp;gt;intervalUnit = "months";&lt;BR /&gt;$subscription-&amp;gt;startDate = "2011-07-28";&lt;BR /&gt;$subscription-&amp;gt;totalOccurrences = "12";&lt;BR /&gt;$subscription-&amp;gt;amount = "12.99";&lt;BR /&gt;$subscription-&amp;gt;creditCardCardNumber = "6011000000000012";&lt;BR /&gt;$subscription-&amp;gt;creditCardExpirationDate= "2018-10";&lt;BR /&gt;$subscription-&amp;gt;creditCardCardCode = "123";&lt;BR /&gt;$subscription-&amp;gt;billToFirstName = "Rasmus";&lt;BR /&gt;$subscription-&amp;gt;billToLastName = "Doe";&lt;BR /&gt;&lt;BR /&gt;// Create the subscription.&lt;BR /&gt;&lt;BR /&gt;$request = new AuthorizeNetARB;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;$response = $request-&amp;gt;createSubscription($subscription);&lt;BR /&gt;&amp;nbsp;$subscription_id = $response-&amp;gt;getSubscriptionId(); ﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Make sure you properly set things up in the config files. My config.php from the Anet_PHP_SDK which includes this arb example among others: &lt;/STRONG&gt;(below is the code from my config.php) and that you have your test account API log in id and transaction key. They are ready to work instantly once you configure things properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;require_once 'anet_php_sdk/AuthorizeNet.php';&lt;BR /&gt;&lt;BR /&gt;$METHOD_TO_USE = "AIM";&lt;BR /&gt;// $METHOD_TO_USE = "DIRECT_POST";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Uncomment this line to test DPM&lt;BR /&gt;&lt;BR /&gt;define("AUTHORIZENET_API_LOGIN_ID","MY_LOGIN_ID");&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add your API LOGIN ID&lt;BR /&gt;define("AUTHORIZENET_TRANSACTION_KEY","My_API_KEY"); // Add your API transaction key&lt;BR /&gt;&lt;STRONG&gt;define("AUTHORIZENET_SANDBOX",true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set to false to test against production&lt;/STRONG&gt;&lt;BR /&gt;define("TEST_REQUEST", "FALSE");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // You may want to set to true if testing against production&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// You only need to adjust the two variables below if testing DPM&lt;BR /&gt;define("AUTHORIZENET_MD5_SETTING","");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add your MD5 Setting.&lt;BR /&gt;$site_root = "http://YOURDOMAIN/samples/your_store/"; // Add the URL to your site﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This honestly worked 'out of the box' for me during my testing.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2011 17:06:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15168#M8671</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-21T17:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15170#M8672</link>
      <description>&lt;P&gt;The original test code does not in fact work. It doesn't have enough parameters. Why they have it available I don't know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;&amp;lt;?php&lt;BR /&gt;require_once '../../commerce/anet_php_sdk/AuthorizeNet.php';&lt;BR /&gt;define("AUTHORIZENET_API_LOGIN_ID", "xxxxx");&lt;BR /&gt;define("AUTHORIZENET_TRANSACTION_KEY", "xxxxx");&lt;BR /&gt;define("AUTHORIZENET_SANDBOX", false);&lt;BR /&gt;$sale = new AuthorizeNetAIM;&lt;BR /&gt;$sale-&amp;gt;amount = "5.99";&lt;BR /&gt;$sale-&amp;gt;card_num = '6011000000000012';&lt;BR /&gt;$sale-&amp;gt;exp_date = '04/15';&lt;BR /&gt;$response = $sale-&amp;gt;authorizeAndCapture();&lt;BR /&gt;&lt;BR /&gt;if ($response-&amp;gt;approved) {&lt;BR /&gt;&amp;nbsp; echo "&amp;lt;h1&amp;gt;Success! The test credit card has been charged!&amp;lt;/h1&amp;gt;";&lt;BR /&gt;&amp;nbsp; echo "Transaction ID: " . $response-&amp;gt;transaction_id;&lt;BR /&gt;} else {&lt;BR /&gt;&amp;nbsp; echo $response-&amp;gt;error_message;&lt;BR /&gt;}&lt;BR /&gt;?&amp;gt;﻿&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2011 17:11:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15170#M8672</guid>
      <dc:creator>Quicksilver</dc:creator>
      <dc:date>2011-07-21T17:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Does the PHP test code work?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15172#M8673</link>
      <description>&lt;P&gt;The README file makes zero mention of config.php. I don't even see that file in the SDK. The closest I see is AuthorizeNet_Test_Config.php&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2011 18:02:10 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Does-the-PHP-test-code-work/m-p/15172#M8673</guid>
      <dc:creator>Quicksilver</dc:creator>
      <dc:date>2011-07-21T18:02:10Z</dc:date>
    </item>
  </channel>
</rss>

