<?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: Developers with Magento having issues with CIM SOAP API in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49794#M25328</link>
    <description>&lt;DIV class="page-header"&gt;&lt;DIV class="page-header"&gt;Authorize Net CIM Plugin for Magento Fix&lt;/DIV&gt;&lt;P class="meta"&gt;Posted February 26, 2015 by &lt;A href="http://www.goidp.com/blog/author/admin/" rel="author" target="_blank" title="Posts by IDP"&gt;IDP&lt;/A&gt; &lt;SPAN class="amp"&gt;&amp;amp;&lt;/SPAN&gt; filed under &lt;A href="http://www.goidp.com/blog/category/magento-e-commerce/" rel="category tag" target="_blank"&gt;Magento E-Commerce&lt;/A&gt;.&lt;/P&gt;&lt;P class="meta"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lead"&gt;IDP Auth Net CIM Plugin Users:&lt;/P&gt;&lt;P&gt;There was an issue with the &lt;A href="http://www.magentocommerce.com/magento-connect/idp-authorizecim-2-1-5-payment-module.html" target="_blank" title="Auth Net Plugin for Magento"&gt;Authorize.net CIM plugin for Magento&lt;/A&gt;. &amp;nbsp;This was a widespread issue with Magento and developers using the CIM SOAP API integration with Auth Net. &amp;nbsp;The issue was reported here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/td-p/49777" target="_blank" title="Developers with Magento having issues with CIM SOAP API"&gt;http://community.developer.authorize.net/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/td-p/49777&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For paid users of the IDP Auth Net Plugin here is the solution:&lt;/P&gt;&lt;P&gt;file: /app/code/local/IDP/AuthorizeCIM/Model/Authorizecimsoap.php&lt;/P&gt;&lt;P&gt;Simply replace the parseXML() function-&amp;gt;&lt;/P&gt;&lt;P&gt;public function parseXML($start, $end, $xml)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;$xmlbegin = 0;&lt;/P&gt;&lt;P&gt;$xmlbegin = strpos($xml,”?&amp;gt;”);&lt;/P&gt;&lt;P&gt;if($xmlbegin&amp;gt;0) { $xml = substr($xml,$xmlbegin+2); }&lt;/P&gt;&lt;P&gt;return preg_replace(‘|^.*?’.$start.'(.*?)’.$end.’.*?$|i’, ‘$1′, $xml);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;A href="http://www.magentocommerce.com/magento-connect/idp-authorizecim-2-1-5-payment-module.html" target="_blank" title="Auth Net CIM extension for Magento"&gt;newest version of the Auth Net CIM plugin&lt;/A&gt; has other enhancements, but this one change would immediately solve this issue if you choose. The link has the full directory that may affect customizations (though if only the template files were changed the link is safe to use). For standard installation fee I could update your module taking into account any behaviors that were customized. However, replacing the function above would fix this immediate anomaly with no other effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Eric Levine&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:elevine@goidp.com" target="_blank"&gt;elevine@goidp.com&lt;/A&gt;&lt;/P&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;A href="http://www.goidp.com/blog/authorize-net-cim-plugin-magento-fix/" target="_blank"&gt;http://www.goidp.com/blog/authorize-net-cim-plugin-magento-fix/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Feb 2015 16:48:41 GMT</pubDate>
    <dc:creator>elreason4</dc:creator>
    <dc:date>2015-02-26T16:48:41Z</dc:date>
    <item>
      <title>Developers with Magento having issues with CIM SOAP API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49777#M25313</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;So today I came in and we were unable to charge any orders through Authorize.net CIM SOAP API, after talking with their support they said this is a magento wide issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I've found the issue, they're response header has changed lengths from 335 characters to 395 characters. The module we were using has a parseXML function like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public function parseXML($start, $end, $xml)	 {
		return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($xml, 335));
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;What is should really be is:&lt;/P&gt;&lt;PRE&gt;public function parseXML($start, $end, $xml)	 {
		return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($xml, 395));
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Realistically we should probably use strpos($xml, "&amp;lt;?xml ") in place of "substr($xml, 395)" which would prevent future issues if the response header changes, but unfortunately I don't have time to debug this right now, at least it works...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 19:21:14 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49777#M25313</guid>
      <dc:creator>autojunkie05</dc:creator>
      <dc:date>2015-02-25T19:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Developers with Magento having issues with CIM SOAP API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49778#M25314</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/18002"&gt;@autojunkie05&lt;/a&gt;&amp;nbsp;This is great information, thank you. &lt;BR /&gt;&lt;BR /&gt;Could you elaborate on what you mean by "response header"? Do you mean the HTTP headers prior to the XML stream? Or do you mean the root element of the XML?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 19:43:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49778#M25314</guid>
      <dc:creator>Lilith</dc:creator>
      <dc:date>2015-02-25T19:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Developers with Magento having issues with CIM SOAP API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49779#M25315</link>
      <description>&lt;P&gt;yes, I mean the HTTP response header before the XML Response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 501
Content-Type: application/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Headers: x-requested-with,cache-control,content-type,origin,method
Date: Wed, 25 Feb 2015 20:13:55 GMT

ï»¿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;createCustomerProfileResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Error&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;E00039&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;A duplicate record with ID XXXXXXXX already exists.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;customerPaymentProfileIdList /&amp;gt;&amp;lt;customerShippingAddressIdList /&amp;gt;&amp;lt;validationDirectResponseList /&amp;gt;&amp;lt;/createCustomerProfileResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's 395 characters to the actually XML response, and there's a few weird characters before the response (and some special characters in the HTTP header) that throw off the regex expression and prevent the code in magento from parsing the XML tags for the data. I'm assuming that the previous HTTP response was only 335 characters because that was the value in the orginal function "Substr($xml, 335)" &amp;nbsp;Which worked up until this moring.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you take the original function:&lt;/P&gt;&lt;PRE&gt;public function parseXML($start, $end, $xml)	 {
		return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($xml, 335));
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and run the response I posted above this in this post, you'll see that it incorrectly parses the XML&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 20:18:09 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49779#M25315</guid>
      <dc:creator>autojunkie05</dc:creator>
      <dc:date>2015-02-25T20:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Developers with Magento having issues with CIM SOAP API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49794#M25328</link>
      <description>&lt;DIV class="page-header"&gt;&lt;DIV class="page-header"&gt;Authorize Net CIM Plugin for Magento Fix&lt;/DIV&gt;&lt;P class="meta"&gt;Posted February 26, 2015 by &lt;A href="http://www.goidp.com/blog/author/admin/" rel="author" target="_blank" title="Posts by IDP"&gt;IDP&lt;/A&gt; &lt;SPAN class="amp"&gt;&amp;amp;&lt;/SPAN&gt; filed under &lt;A href="http://www.goidp.com/blog/category/magento-e-commerce/" rel="category tag" target="_blank"&gt;Magento E-Commerce&lt;/A&gt;.&lt;/P&gt;&lt;P class="meta"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lead"&gt;IDP Auth Net CIM Plugin Users:&lt;/P&gt;&lt;P&gt;There was an issue with the &lt;A href="http://www.magentocommerce.com/magento-connect/idp-authorizecim-2-1-5-payment-module.html" target="_blank" title="Auth Net Plugin for Magento"&gt;Authorize.net CIM plugin for Magento&lt;/A&gt;. &amp;nbsp;This was a widespread issue with Magento and developers using the CIM SOAP API integration with Auth Net. &amp;nbsp;The issue was reported here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/td-p/49777" target="_blank" title="Developers with Magento having issues with CIM SOAP API"&gt;http://community.developer.authorize.net/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/td-p/49777&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For paid users of the IDP Auth Net Plugin here is the solution:&lt;/P&gt;&lt;P&gt;file: /app/code/local/IDP/AuthorizeCIM/Model/Authorizecimsoap.php&lt;/P&gt;&lt;P&gt;Simply replace the parseXML() function-&amp;gt;&lt;/P&gt;&lt;P&gt;public function parseXML($start, $end, $xml)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;$xmlbegin = 0;&lt;/P&gt;&lt;P&gt;$xmlbegin = strpos($xml,”?&amp;gt;”);&lt;/P&gt;&lt;P&gt;if($xmlbegin&amp;gt;0) { $xml = substr($xml,$xmlbegin+2); }&lt;/P&gt;&lt;P&gt;return preg_replace(‘|^.*?’.$start.'(.*?)’.$end.’.*?$|i’, ‘$1′, $xml);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;A href="http://www.magentocommerce.com/magento-connect/idp-authorizecim-2-1-5-payment-module.html" target="_blank" title="Auth Net CIM extension for Magento"&gt;newest version of the Auth Net CIM plugin&lt;/A&gt; has other enhancements, but this one change would immediately solve this issue if you choose. The link has the full directory that may affect customizations (though if only the template files were changed the link is safe to use). For standard installation fee I could update your module taking into account any behaviors that were customized. However, replacing the function above would fix this immediate anomaly with no other effects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Eric Levine&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:elevine@goidp.com" target="_blank"&gt;elevine@goidp.com&lt;/A&gt;&lt;/P&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;A href="http://www.goidp.com/blog/authorize-net-cim-plugin-magento-fix/" target="_blank"&gt;http://www.goidp.com/blog/authorize-net-cim-plugin-magento-fix/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2015 16:48:41 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Developers-with-Magento-having-issues-with-CIM-SOAP-API/m-p/49794#M25328</guid>
      <dc:creator>elreason4</dc:creator>
      <dc:date>2015-02-26T16:48:41Z</dc:date>
    </item>
  </channel>
</rss>

