<?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: Redirect Problems - DPM &amp;amp; PHP in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13314#M7985</link>
    <description>&lt;P&gt;Problem resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact, it happened because I didn't read enough of the manual.&amp;nbsp; I had not set the default URL for redirect in the account setup, so the value I gave it was ignored as not being in that list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides that, I had wrapped my code in relay_response.php in my usual web page wrapper.&amp;nbsp; Since the system was expecting this to be only what is needed to process the response code only, not what creates a pretty web page, it was choking on the extra html.&amp;nbsp; My bad.&amp;nbsp; Perhaps a note somewhere that the processing code is all that is allowed in the relay_response file is in order.&amp;nbsp; Or, if such does exist, a better display (bold caps larger font in color, maybe?) of that information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2011 16:28:28 GMT</pubDate>
    <dc:creator>condonia13</dc:creator>
    <dc:date>2011-06-02T16:28:28Z</dc:date>
    <item>
      <title>Redirect Problems - DPM &amp; PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13130#M7907</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched the boards and not found this exact problem, and I've looked at my code multiple times and not found the errors, so I thought I might ask for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created the files (checkout_form.php, relay_response.php, order_receipt.php &amp;amp; CR_response.php [my receipt display code]) and submitted purchases on the test system and received approved purchase email confirmation of these purchases.&amp;nbsp; But the relay continually sends the browser back to the home page of my directory (index.php) and since it leaves &lt;A href="https://test.authorize.net/gateway/transact.dll" target="_blank" rel="nofollow"&gt;https://test.authorize.net/gateway/transact.dll&lt;/A&gt; in the browser URL I don't know if any arguments are coming through.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I paste the redirect URL as I set it in the code into a browser window it goes to the correct page and lists the expected error (there are no arguments so it has errors).&amp;nbsp; Ditto with the receipt page.&amp;nbsp; So I know these are valid URLs that are passed to Authorize.Net.&amp;nbsp; But there are no diagnostics coming up that I can debug by.&amp;nbsp; I tried replacing the line:&lt;/P&gt;&lt;P&gt;echo AuthorizeNetDPM::getRelayResponseSnippet( $redirect_url );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;echo $redirect_url;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to see what the redirected URL coming back is, but it was never executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Removing the wrappers (page formating) here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;checkout_form.php

                    &amp;lt;?php
                      $relay_response_url = "http://MyHomeURL/relay_response.php"; // Response File
                      $api_login_id = 'xxxx';
                      $transaction_key = 'xxxxxx';
                      $amount = dbldec( $cost );
$transaction_key&amp;lt;br /&amp;gt;";
                      echo AuthorizeNetDPM::getCreditCardForm( $amount, $transaction_number, $relay_response_url, $api_login_id, $transaction_key );
                    ?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;relay_response.php
                    &amp;lt;?php
                      $redirect_url = "http://MyHomeURL/CR_receipt.php"; // Where the user will end up. 
                      $api_login_id = 'xxxx';
                      $md5_setting = ""; // Your MD5 Setting 
                      $response = new AuthorizeNetSIM($api_login_id, $md5_setting); 
                      if ($response-&amp;gt;isAuthorizeNet()) 
                      { 
                        if ($response-&amp;gt;approved) 
                        { 
                          // Do your processing here. 
                          $redirect_url .= '?response_code=1&amp;amp;transaction_id=' . 
                          $response-&amp;gt;transaction_id; 
                        } 
                        else 
                        {
                          $redirect_url .= '?response_code='.$response-&amp;gt;response_code . 
                            '&amp;amp;response_reason_text=' . $response-&amp;gt;response_reason_text; 
                        }
//                        echo $redirect_url;
                        // Send the Javascript back to AuthorizeNet, which will
                        // redirect user back to your site. 
                        echo AuthorizeNetDPM::getRelayResponseSnippet( $redirect_url ); 
                      } 
                      else 
                      { 
                        echo "Error. Check your MD5 Setting."; 
                      }
                    ?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;order_receipt.php

                    &amp;lt;?php
                      if ($_GET['response_code'] == 1)
                      {
                        echo "Thank you for your purchase! Transaction id: " . htmlentities($_GET['transaction_id']);
                      }
                      else
                      {
                        echo "Sorry, an error occurred: " . htmlentities($_GET['response_reason_text']);
                      }
                    ?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CR_receipt.php

                    &amp;lt;?php
                      if ( $_GET['response_code'] == 1 ) 
                      {
                        $trans = $_GET['transaction_id'];
                        echo "Thank you for your purchase! Transaction id: $trans&amp;lt;br /&amp;gt;";
                        // DB processing of transaction &amp;amp; user receipt formatting
                        ...
                        // end processing
                      } 
                      else 
                      {
                        $reason = $_GET['response_reason_text'];
                        echo "Sorry, an error occurred: " . $reason; 
                      }
                    ?&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any insights you can give me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom Condon&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2011 17:50:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13130#M7907</guid>
      <dc:creator>condonia13</dc:creator>
      <dc:date>2011-05-25T17:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect Problems - DPM &amp; PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13156#M7920</link>
      <description>&lt;P&gt;Have you look at the browser page source on your checkout_form.php before you submit the form?&lt;/P&gt;&lt;P&gt;Check to see if x_relay_url is set correctly?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 11:53:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13156#M7920</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2011-05-26T11:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect Problems - DPM &amp; PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13164#M7924</link>
      <description>&lt;P&gt;x_relay_url is set correctly in the checkout_form.php page source.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2011 15:03:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13164#M7924</guid>
      <dc:creator>condonia13</dc:creator>
      <dc:date>2011-05-26T15:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect Problems - DPM &amp; PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13314#M7985</link>
      <description>&lt;P&gt;Problem resolved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact, it happened because I didn't read enough of the manual.&amp;nbsp; I had not set the default URL for redirect in the account setup, so the value I gave it was ignored as not being in that list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Besides that, I had wrapped my code in relay_response.php in my usual web page wrapper.&amp;nbsp; Since the system was expecting this to be only what is needed to process the response code only, not what creates a pretty web page, it was choking on the extra html.&amp;nbsp; My bad.&amp;nbsp; Perhaps a note somewhere that the processing code is all that is allowed in the relay_response file is in order.&amp;nbsp; Or, if such does exist, a better display (bold caps larger font in color, maybe?) of that information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2011 16:28:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Redirect-Problems-DPM-amp-PHP/m-p/13314#M7985</guid>
      <dc:creator>condonia13</dc:creator>
      <dc:date>2011-06-02T16:28:28Z</dc:date>
    </item>
  </channel>
</rss>

