<?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: Direct Post Method - Switching from test to live? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33835#M18335</link>
    <description>&lt;P&gt;Awesome!! Sorry for not replying earlier - I didn't get an email notification about this response. This is great! Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Heather&lt;/P&gt;</description>
    <pubDate>Fri, 05 Apr 2013 18:14:47 GMT</pubDate>
    <dc:creator>raspberryh</dc:creator>
    <dc:date>2013-04-05T18:14:47Z</dc:date>
    <item>
      <title>Direct Post Method - Switching from test to live?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33745#M18249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the Direct Post Method.&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php
require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK
$url = "&lt;A target="_blank" href="http://www.....com/direct_post.php"&gt;http://www.....com/direct_post.php&lt;/A&gt;";
$api_login_id = '...';
$transaction_key = '...';
$md5_setting = '...'; // Your MD5 Setting
$amount = "5.99";
AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);
?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to be working, but I am not sure what I need to do to switch from test mode to live mode (other than changing the option in my account).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried setting the constant in AuthorizeNet.php:&lt;/P&gt;&lt;PRE&gt;define("AUTHORIZENET_SANDBOX", false);&lt;/PRE&gt;&lt;P&gt;...but this did nothing (it still submitted to test.authorize.net).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried changing the line&lt;/P&gt;&lt;PRE&gt;protected $_sandbox = true;&lt;/PRE&gt;&lt;P&gt;to&lt;/P&gt;&lt;PRE&gt;protected $_sandbox = false;&lt;/PRE&gt;&lt;P&gt;in AuthorizeNetRequest.php, but that also made no difference :(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally I just changed the actual values in AuthorizeNetAIM.php and AuthorizeNetDPM.php:&lt;/P&gt;&lt;PRE&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;&lt;/PRE&gt;&lt;P&gt;to&lt;/P&gt;&lt;PRE&gt;const SANDBOX_URL = '&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll';"&gt;https://secure.authorize.net/gateway/transact.dll';&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...that at least made the URL change ...but I know that is the wrong way of doing it, and also, I don't know if there is something else that also needs to be changed in the code. There must be an easy way of switching this code over to live, but I can't seem to find it in the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Heather&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2013 13:58:27 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33745#M18249</guid>
      <dc:creator>raspberryh</dc:creator>
      <dc:date>2013-03-28T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Post Method - Switching from test to live?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33821#M18321</link>
      <description>&lt;P&gt;Inside AuthorizeNetDPM.php:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static function getCreditCardForm($amount, $fp_sequence, $relay_response_url, $api_login_id, $transaction_key, $test_mode = true, $prefill = true)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;As you can see, $test_mode is passed after the transaction key.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;public static function directPostDemo($url, $api_login_id, $transaction_key, $amount = "0.00", $md5_setting = "")
...
            echo AuthorizeNetDPM::getCreditCardForm($amount, $fp_sequence, $url, $api_login_id, $transaction_key);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Just add yourself a new argument for $test_mode and then pass it. Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static function directPostDemo($url, $api_login_id, $transaction_key, $amount = "0.00", $test_mode = true, $md5_setting = "")
...
            echo AuthorizeNetDPM::getCreditCardForm($amount, $fp_sequence, $url, $api_login_id, $transaction_key, $test_mode);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then call the function like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, false, $md5_setting);&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Apr 2013 03:52:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33821#M18321</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2013-04-04T03:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Direct Post Method - Switching from test to live?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33835#M18335</link>
      <description>&lt;P&gt;Awesome!! Sorry for not replying earlier - I didn't get an email notification about this response. This is great! Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Heather&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2013 18:14:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Direct-Post-Method-Switching-from-test-to-live/m-p/33835#M18335</guid>
      <dc:creator>raspberryh</dc:creator>
      <dc:date>2013-04-05T18:14:47Z</dc:date>
    </item>
  </channel>
</rss>

