<?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 Customer Cancellation error subscriptionId not valid data type in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33586#M18095</link>
    <description>&lt;P&gt;Sure can! written by the master himself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public function deleteAccount()&lt;BR /&gt;{&lt;BR /&gt;$this-&amp;gt;xml = "&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;&lt;BR /&gt;&amp;lt;ARBCancelSubscriptionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&amp;gt;&lt;BR /&gt;&amp;lt;merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;" . self::LOGIN . "&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;transactionKey&amp;gt;" . self::TRANSKEY . "&amp;lt;/transactionKey&amp;gt;&lt;BR /&gt;&amp;lt;/merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;refId&amp;gt;" . $this-&amp;gt;params['refID'] ."&amp;lt;/refId&amp;gt;&lt;BR /&gt;&amp;lt;subscriptionId&amp;gt;" . $this-&amp;gt;params['subscrId'] . "&amp;lt;/subscriptionId&amp;gt;&lt;BR /&gt;&amp;lt;/ARBCancelSubscriptionRequest&amp;gt;";&lt;BR /&gt;$this-&amp;gt;process();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private function parseResults()&lt;BR /&gt;{&lt;BR /&gt;$this-&amp;gt;resultCode = $this-&amp;gt;parseXML('&amp;lt;resultCode&amp;gt;', '&amp;lt;/resultCode&amp;gt;');&lt;BR /&gt;$this-&amp;gt;code = $this-&amp;gt;parseXML('&amp;lt;code&amp;gt;', '&amp;lt;/code&amp;gt;');&lt;BR /&gt;$this-&amp;gt;text = $this-&amp;gt;parseXML('&amp;lt;text&amp;gt;', '&amp;lt;/text&amp;gt;');&lt;BR /&gt;$this-&amp;gt;subscrId = $this-&amp;gt;parseXML('&amp;lt;subscriptionId&amp;gt;', '&amp;lt;/subscriptionId&amp;gt;');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private function ParseXML($start, $end)&lt;BR /&gt;{&lt;BR /&gt;return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($this-&amp;gt;response, 335));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public function setParameter($field = "", $value = null)&lt;BR /&gt;{&lt;BR /&gt;$field = (is_string($field)) ? trim($field) : $field;&lt;BR /&gt;$value = (is_string($value)) ? trim($value) : $value;&lt;BR /&gt;if (!is_string($field))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() arg 1 must be a string or integer: " . gettype($field) . " given.");&lt;BR /&gt;}&lt;BR /&gt;if (!is_string($value) &amp;amp;&amp;amp; !is_numeric($value) &amp;amp;&amp;amp; !is_bool($value))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() arg 2 must be a string, integer, or boolean value: " . gettype($value) . " given.");&lt;BR /&gt;}&lt;BR /&gt;if (empty($field))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() requires a parameter field to be named.");&lt;BR /&gt;}&lt;BR /&gt;if ($value === "")&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() requires a parameter value to be assigned: $field");&lt;BR /&gt;}&lt;BR /&gt;$this-&amp;gt;params[$field] = $value;&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2013 03:41:35 GMT</pubDate>
    <dc:creator>dcdalton</dc:creator>
    <dc:date>2013-03-20T03:41:35Z</dc:date>
    <item>
      <title>ARB Customer Cancellation error subscriptionId not valid data type</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33584#M18093</link>
      <description>&lt;P&gt;First time trying this and I an using the old version 1 code (AuthnetARB.class.php) - customer doesn't want to pay to update all the code to the new objects right now so I'm stuck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I am doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;require_once($_SERVER["DOCUMENT_ROOT"] . '/functions/AuthnetARB.class.php');&lt;/P&gt;&lt;P&gt;$arb = new AuthnetARB();&lt;BR /&gt;$arb-&amp;gt;setParameter('subscriptionId', $row['subscription_id']);&lt;/P&gt;&lt;P&gt;$arb-&amp;gt;deleteAccount();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have verified the data coming out of the databse and that it's being set to the object, here a print_r of the object right after setting the subscription id:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AuthnetARB Object ( [test:private] =&amp;gt; [params:private] =&amp;gt; Array ( [interval_length] =&amp;gt; 1 [interval_unit] =&amp;gt; months [startDate] =&amp;gt; 2013-04-19 [totalOccurrences] =&amp;gt; 9999 [trialOccurrences] =&amp;gt; 0 [trialAmount] =&amp;gt; 0 [subscriptionId] =&amp;gt; 16265474 ) [sucess:private] =&amp;gt; [error:private] =&amp;gt; 1 [xml:private] =&amp;gt; [response:private] =&amp;gt; [resultCode:private] =&amp;gt; [code:private] =&amp;gt; [text:private] =&amp;gt; [subscrId:private] =&amp;gt; [url] =&amp;gt; &lt;A target="_blank" href="https://api.authorize.net/xml/v1/request.api"&gt;https://api.authorize.net/xml/v1/request.api&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see the subscriptionId is set (and it is the correct number for the test account)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error back from Authnet:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:subscriptionId' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' - The Pattern constraint failed.&lt;/PRE&gt;&lt;P&gt;I dug around google for over an hour and everything I find says the data is missing, which in this case it isn't&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? I'm stumped&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 21:32:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33584#M18093</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2013-03-19T21:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: ARB Customer Cancellation error subscriptionId not valid data type</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33585#M18094</link>
      <description>&lt;P&gt;Since it is php, could you see what the deleteAccount() is doing?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2013 23:53:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33585#M18094</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2013-03-19T23:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: ARB Customer Cancellation error subscriptionId not valid data type</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33586#M18095</link>
      <description>&lt;P&gt;Sure can! written by the master himself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public function deleteAccount()&lt;BR /&gt;{&lt;BR /&gt;$this-&amp;gt;xml = "&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;&lt;BR /&gt;&amp;lt;ARBCancelSubscriptionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&amp;gt;&lt;BR /&gt;&amp;lt;merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;" . self::LOGIN . "&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;transactionKey&amp;gt;" . self::TRANSKEY . "&amp;lt;/transactionKey&amp;gt;&lt;BR /&gt;&amp;lt;/merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;refId&amp;gt;" . $this-&amp;gt;params['refID'] ."&amp;lt;/refId&amp;gt;&lt;BR /&gt;&amp;lt;subscriptionId&amp;gt;" . $this-&amp;gt;params['subscrId'] . "&amp;lt;/subscriptionId&amp;gt;&lt;BR /&gt;&amp;lt;/ARBCancelSubscriptionRequest&amp;gt;";&lt;BR /&gt;$this-&amp;gt;process();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private function parseResults()&lt;BR /&gt;{&lt;BR /&gt;$this-&amp;gt;resultCode = $this-&amp;gt;parseXML('&amp;lt;resultCode&amp;gt;', '&amp;lt;/resultCode&amp;gt;');&lt;BR /&gt;$this-&amp;gt;code = $this-&amp;gt;parseXML('&amp;lt;code&amp;gt;', '&amp;lt;/code&amp;gt;');&lt;BR /&gt;$this-&amp;gt;text = $this-&amp;gt;parseXML('&amp;lt;text&amp;gt;', '&amp;lt;/text&amp;gt;');&lt;BR /&gt;$this-&amp;gt;subscrId = $this-&amp;gt;parseXML('&amp;lt;subscriptionId&amp;gt;', '&amp;lt;/subscriptionId&amp;gt;');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;private function ParseXML($start, $end)&lt;BR /&gt;{&lt;BR /&gt;return preg_replace('|^.*?'.$start.'(.*?)'.$end.'.*?$|i', '$1', substr($this-&amp;gt;response, 335));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public function setParameter($field = "", $value = null)&lt;BR /&gt;{&lt;BR /&gt;$field = (is_string($field)) ? trim($field) : $field;&lt;BR /&gt;$value = (is_string($value)) ? trim($value) : $value;&lt;BR /&gt;if (!is_string($field))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() arg 1 must be a string or integer: " . gettype($field) . " given.");&lt;BR /&gt;}&lt;BR /&gt;if (!is_string($value) &amp;amp;&amp;amp; !is_numeric($value) &amp;amp;&amp;amp; !is_bool($value))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() arg 2 must be a string, integer, or boolean value: " . gettype($value) . " given.");&lt;BR /&gt;}&lt;BR /&gt;if (empty($field))&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() requires a parameter field to be named.");&lt;BR /&gt;}&lt;BR /&gt;if ($value === "")&lt;BR /&gt;{&lt;BR /&gt;throw new AuthnetARBException("setParameter() requires a parameter value to be assigned: $field");&lt;BR /&gt;}&lt;BR /&gt;$this-&amp;gt;params[$field] = $value;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 03:41:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33586#M18095</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2013-03-20T03:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: ARB Customer Cancellation error subscriptionId not valid data type</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33589#M18098</link>
      <description>&lt;P&gt;I think that the reason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public function deleteAccount()&lt;BR /&gt;{&lt;BR /&gt;$this-&amp;gt;xml = "&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;&lt;BR /&gt;&amp;lt;ARBCancelSubscriptionRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&amp;gt;&lt;BR /&gt;&amp;lt;merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;name&amp;gt;" . self::LOGIN . "&amp;lt;/name&amp;gt;&lt;BR /&gt;&amp;lt;transactionKey&amp;gt;" . self::TRANSKEY . "&amp;lt;/transactionKey&amp;gt;&lt;BR /&gt;&amp;lt;/merchantAuthentication&amp;gt;&lt;BR /&gt;&amp;lt;refId&amp;gt;" . $this-&amp;gt;params['refID'] ."&amp;lt;/refId&amp;gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&amp;lt;subscriptionId&amp;gt;" . $this-&amp;gt;params['subscrId'] . "&amp;lt;/subscriptionId&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;lt;/ARBCancelSubscriptionRequest&amp;gt;";&lt;BR /&gt;$this-&amp;gt;process();&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 11:11:44 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33589#M18098</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2013-03-20T11:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: ARB Customer Cancellation error subscriptionId not valid data type</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33592#M18101</link>
      <description>&lt;P&gt;interesting, I hadn't noticed that and I got the code to call it from John's site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will give that a shot&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 13:52:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/ARB-Customer-Cancellation-error-subscriptionId-not-valid-data/m-p/33592#M18101</guid>
      <dc:creator>dcdalton</dc:creator>
      <dc:date>2013-03-20T13:52:35Z</dc:date>
    </item>
  </channel>
</rss>

