<?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: ARB response has changed, causing application to think it wasn't approved in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49876#M25405</link>
    <description>&lt;P&gt;I tried a st_replace, removing the byte code but that didn't change anything, still not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2015 17:52:39 GMT</pubDate>
    <dc:creator>dcdalton</dc:creator>
    <dc:date>2015-03-04T17:52:39Z</dc:date>
    <item>
      <title>ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49872#M25401</link>
      <description>&lt;P&gt;I have an ARB set up that has been working flawlessly for almost 4 years now. Now all of a sudden it is failing each and every time someone signs up. When I say failing it is not returning the correct response text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The subscriptions are being set up correctly at authnet but the returned response no longer triggers the correct block of code in AuthnetARB.class.php. The block of code I am referring to is in the process function:&lt;BR /&gt;&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; if ($this-&amp;gt;resultCode == "Ok")&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;success = true;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;error&amp;nbsp;&amp;nbsp; = false;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&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; }&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; 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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;success = false;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;error&amp;nbsp;&amp;nbsp; = true;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&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; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I echo'd out the response from them like this: echo 'arb response ' . $arb-&amp;gt;getResponse() . ' result code ' . $arb-&amp;gt;getResultCode() . ' code ' . $arb-&amp;gt;get_code();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;arb response ith,cache-control,content-type,origin,method&lt;BR /&gt;Date: Wed, 04 Mar 2015 17:09:38 GMT&lt;BR /&gt;&lt;BR /&gt;ï»¿OkI00001Successful.23660616 result code ith,cache-control,content-type,origin,method&lt;BR /&gt;Date: Wed, 04 Mar 2015 17:09:38 GMT&lt;BR /&gt;&lt;BR /&gt;ï»¿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;ARBCreateSubscriptionResponse xmlns:xsi="&lt;A target="_blank" href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance"&lt;/A&gt; xmlns:xsd="&lt;A target="_blank" href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/A&gt; xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;refId /&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Ok&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;I00001&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;Successful.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;subscriptionId&amp;gt;23660616&amp;lt;/subscriptionId&amp;gt;&amp;lt;/ARBCreateSubscriptionResponse&amp;gt; code ith,cache-control,content-type,origin,method&lt;BR /&gt;Date: Wed, 04 Mar 2015 17:09:38 GMT&lt;BR /&gt;&lt;BR /&gt;ï»¿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;ARBCreateSubscriptionResponse xmlns:xsi="&lt;A target="_blank" href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance"&lt;/A&gt; xmlns:xsd="&lt;A target="_blank" href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/A&gt; xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;refId /&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Ok&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;I00001&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;Successful.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;subscriptionId&amp;gt;23660616&amp;lt;/subscriptionId&amp;gt;&amp;lt;/ARBCreateSubscriptionResponse&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you notice the result code in the echo never happens and neither does the arb-&amp;gt;getCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already spoken to authnet tech support and they were no help whatsoever, client is anxious and I am literally stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The odd part is I have the exact same code running on other sites and have no issue whatsoever AND this code (which has not changed) has been working fine for years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also can't help but notice the odd characters at the beginning of the response&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oh and just for clarity here are the two functions in AuthnetARB.class.php that handle the results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function parseResults()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;resultCode = $this-&amp;gt;parseXML('&amp;lt;resultCode&amp;gt;', '&amp;lt;/resultCode&amp;gt;');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $this-&amp;gt;parseXML('&amp;lt;code&amp;gt;', '&amp;lt;/code&amp;gt;');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = $this-&amp;gt;parseXML('&amp;lt;text&amp;gt;', '&amp;lt;/text&amp;gt;');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;subscrId&amp;nbsp;&amp;nbsp; = $this-&amp;gt;parseXML('&amp;lt;subscriptionId&amp;gt;', '&amp;lt;/subscriptionId&amp;gt;');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function ParseXML($start, $end)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($this-&amp;gt;response, 335));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 17:25:53 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49872#M25401</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2015-03-04T17:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49875#M25404</link>
      <description>&lt;P&gt;ï»¿&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://en.wikipedia.org/wiki/Byte_order_mark"&gt;http://en.wikipedia.org/wiki/Byte_order_mark&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 17:36:10 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49875#M25404</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2015-03-04T17:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49876#M25405</link>
      <description>&lt;P&gt;I tried a st_replace, removing the byte code but that didn't change anything, still not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 17:52:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49876#M25405</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2015-03-04T17:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49878#M25407</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/7132"&gt;@dcdalton&lt;/a&gt;&amp;nbsp;I noticed your ARB response data has this string in it:&lt;BR /&gt;&lt;BR /&gt;ith,cache-control,content-type,origin,method&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's coming from new HTTP headers we recently added.&lt;BR /&gt;&lt;BR /&gt;Are you counting characters to figure out where HTTP headers end? Because that could lead to misparsing the HTTP data, effectively starting in the wrong place.&lt;BR /&gt;&lt;BR /&gt;HTTP headers terminate with a carriage return/line feed (CRLF) on an otherwise blank line.&lt;BR /&gt;&lt;BR /&gt;See this sample, taken from &lt;A href="http://www.jmarshall.com/easy/http/#sample" target="_blank"&gt;http://www.jmarshall.com/easy/http/#sample&lt;/A&gt;--and please note the blank line after the final header, Content-Length:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;HTTP/1.0 200 OK
Date: Fri, 31 Dec 1999 23:59:59 GMT
Content-Type: text/html
Content-Length: 1354

&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Happy New Millennium!&amp;lt;/h1&amp;gt;
(more file contents)
  .
  .
  .
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since all HTTP headers end with CRLF, what you really want to do here is to look for two CRLFs in a row--one to end the final HTTP header line, and one to terminate the header block entirely.&lt;BR /&gt;&lt;BR /&gt;Once you do that, then you only need worry about the Byte Order Mark, as &lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1353"&gt;@RaynorC1emen7&lt;/a&gt;&amp;nbsp;already mentioned.&lt;BR /&gt;&lt;BR /&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 18:21:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49878#M25407</guid>
      <dc:creator>Lilith</dc:creator>
      <dc:date>2015-03-04T18:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49879#M25408</link>
      <description>&lt;P&gt;Yes, the code I have been using all this time had a substr in parseXML function that started at character 335.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANK YOU! Finally someone that knew what was going on, been asking and on the phone with tech support since yesterday&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 18:54:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49879#M25408</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2015-03-04T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: ARB response has changed, causing application to think it wasn't approved</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49881#M25410</link>
      <description>&lt;P&gt;For anyone else using this older code and that might hit this problem, to save you the aggravation I just went through let me post what I did to make it work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the process function I added this after $this-&amp;gt;response = curl_exec($ch);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $start = strpos($this-&amp;gt;response, "&amp;lt;?xml");&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;$this-&amp;gt;response = substr($this-&amp;gt;response, $start);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I noticed the Ok in the resultCode field had whitespace on it so I added a trim to all the variable setting lines in the parseResults function, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private function parseResults()&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;resultCode = trim($this-&amp;gt;parseXML('&amp;lt;resultCode&amp;gt;', '&amp;lt;/resultCode&amp;gt;'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;code = trim($this-&amp;gt;parseXML('&amp;lt;code&amp;gt;', '&amp;lt;/code&amp;gt;'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;text = trim($this-&amp;gt;parseXML('&amp;lt;text&amp;gt;', '&amp;lt;/text&amp;gt;'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;subscrId = trim($this-&amp;gt;parseXML('&amp;lt;subscriptionId&amp;gt;', '&amp;lt;/subscriptionId&amp;gt;'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;And now it runs flawlessly. Again hopefully we will have saved someone else from beating their head on the desk over this!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 19:18:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-response-has-changed-causing-application-to-think-it-wasn-t/m-p/49881#M25410</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2015-03-04T19:18:28Z</dc:date>
    </item>
  </channel>
</rss>

