<?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: isError seems to always return true in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30396#M15900</link>
    <description>&lt;P&gt;So I need to know:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;2. Is there a problem with AuthnetXML?&lt;/P&gt;&lt;P&gt;3. Should I ignore the isError and isSuccessful values and just test for messages-&amp;gt;resultCode == "OK" ?&lt;/P&gt;&lt;P&gt;4. Is AuthnetXML the official Authorize.Net recommended way to go, or should I go back to using the individual api classes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2012 16:58:03 GMT</pubDate>
    <dc:creator>alanm123</dc:creator>
    <dc:date>2012-10-04T16:58:03Z</dc:date>
    <item>
      <title>isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/29390#M15441</link>
      <description>&lt;P&gt;Switched to using AuthnetXML.class.php for all api calls. &amp;nbsp;When I add a payment profile to a customer profile, I'll get a response like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;createCustomerPaymentProfileResponse&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;customerPaymentProfileId&amp;gt;8227492&amp;lt;/customerPaymentProfileId&amp;gt;
&amp;lt;/createCustomerPaymentProfileResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but even though it's successful, I find that $xml-&amp;gt;isError() always returns 1. &amp;nbsp; Am I missing something?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 03:24:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/29390#M15441</guid>
      <dc:creator>alanm123</dc:creator>
      <dc:date>2012-09-04T03:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/29396#M15444</link>
      <description>&lt;P&gt;Does this happen with any other APIs calls? Or only this one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2012 04:55:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/29396#M15444</guid>
      <dc:creator>stymiee</dc:creator>
      <dc:date>2012-09-04T04:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30390#M15897</link>
      <description>&lt;P&gt;Seems to happen with others as well. &amp;nbsp;I haven't tried all, of course, but here's another example. &amp;nbsp;If I run&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;$xml-&amp;gt;createTransactionRequest($my_request_array);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;per the example in &lt;STRONG&gt;authnetxml\examples\aim\createTransactionRequest_authCapture.php&lt;/STRONG&gt;, I get the following odd result: &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Response&lt;/TD&gt;&lt;TD&gt;Ok&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;code&lt;/TD&gt;&lt;TD&gt;I00001&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Successful?&lt;/TD&gt;&lt;TD&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Error?&lt;/TD&gt;&lt;TD&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;authCode&lt;/TD&gt;&lt;TD&gt;YRZ26K&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;transId&lt;/TD&gt;&lt;TD&gt;2177473315&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The php for the Successful? and Error? values is this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;?php echo ($xml-&amp;gt;isSuccessful()) ? 'yes' : 'no'; ?&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;?php echo ($xml-&amp;gt;isError()) ? 'yes' : 'no'; ?&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the raw $xml Input/Output shows this:&lt;/P&gt;&lt;P&gt;Class ParametersRequest XMLResponse XML&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;API Login ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;--removed--&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Transaction Key&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;--removed--&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Authnet Server URL&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A target="_blank" href="https://apitest.authorize.net/xml/v1/request.api"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XML:&lt;/TD&gt;&lt;TD&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;createTransactionRequest&amp;gt;
  &amp;lt;merchantAuthentication&amp;gt;
    &amp;lt;name&amp;gt;--removed--&amp;lt;/name&amp;gt;
    &amp;lt;transactionKey&amp;gt;--removed--&amp;lt;/transactionKey&amp;gt;
  &amp;lt;/merchantAuthentication&amp;gt;
  &amp;lt;transactionRequest&amp;gt;
    &amp;lt;transactionType&amp;gt;authCaptureTransaction&amp;lt;/transactionType&amp;gt;
    &amp;lt;amount&amp;gt;10&amp;lt;/amount&amp;gt;
    &amp;lt;payment&amp;gt;
      &amp;lt;creditCard&amp;gt;
        &amp;lt;cardNumber&amp;gt;370000000000002&amp;lt;/cardNumber&amp;gt;
        &amp;lt;expirationDate&amp;gt;012014&amp;lt;/expirationDate&amp;gt;
      &amp;lt;/creditCard&amp;gt;
    &amp;lt;/payment&amp;gt;
  &amp;lt;/transactionRequest&amp;gt;
&amp;lt;/createTransactionRequest&amp;gt;

&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XML:&lt;/TD&gt;&lt;TD&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;createTransactionResponse&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;transactionResponse&amp;gt;
    &amp;lt;responseCode&amp;gt;1&amp;lt;/responseCode&amp;gt;
    &amp;lt;authCode&amp;gt;YRZ26K&amp;lt;/authCode&amp;gt;
    &amp;lt;avsResultCode&amp;gt;Y&amp;lt;/avsResultCode&amp;gt;
    &amp;lt;cvvResultCode/&amp;gt;
    &amp;lt;cavvResultCode&amp;gt;2&amp;lt;/cavvResultCode&amp;gt;
    &amp;lt;transId&amp;gt;2177473315&amp;lt;/transId&amp;gt;
    &amp;lt;refTransID/&amp;gt;
    &amp;lt;transHash&amp;gt;E1EEC3AF4D823851243E2810EBFF5E95&amp;lt;/transHash&amp;gt;
    &amp;lt;testRequest&amp;gt;0&amp;lt;/testRequest&amp;gt;
    &amp;lt;accountNumber&amp;gt;XXXX0002&amp;lt;/accountNumber&amp;gt;
    &amp;lt;accountType&amp;gt;AmericanExpress&amp;lt;/accountType&amp;gt;
    &amp;lt;messages&amp;gt;
      &amp;lt;message&amp;gt;
        &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;
        &amp;lt;description&amp;gt;This transaction has been approved.&amp;lt;/description&amp;gt;
      &amp;lt;/message&amp;gt;
    &amp;lt;/messages&amp;gt;
  &amp;lt;/transactionResponse&amp;gt;
&amp;lt;/createTransactionResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Weird, no?&lt;/P&gt;&lt;P&gt;I'm running under a sandbox/test account, of course. &amp;nbsp;Would that matter?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 16:19:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30390#M15897</guid>
      <dc:creator>alanm123</dc:creator>
      <dc:date>2012-10-04T16:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30396#M15900</link>
      <description>&lt;P&gt;So I need to know:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;2. Is there a problem with AuthnetXML?&lt;/P&gt;&lt;P&gt;3. Should I ignore the isError and isSuccessful values and just test for messages-&amp;gt;resultCode == "OK" ?&lt;/P&gt;&lt;P&gt;4. Is AuthnetXML the official Authorize.Net recommended way to go, or should I go back to using the individual api classes?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 16:58:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30396#M15900</guid>
      <dc:creator>alanm123</dc:creator>
      <dc:date>2012-10-04T16:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30422#M15913</link>
      <description>&lt;P&gt;I was able to verify this bug. It's kinda odd since all I did was change comparison operators from === to == and it works properly now. In this case === should work so I'm going to see if i can figure out why it doesn't out of curiousity. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you go to github you can get the updated code or just edit your Authnet.class.php file like so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    public function isSuccessful()
    {
        return $this-&amp;gt;response_xml-&amp;gt;messages-&amp;gt;resultCode === 'Ok';
    }

    public function isError()
    {
        return $this-&amp;gt;response_xml-&amp;gt;messages-&amp;gt;resultCode !== 'Ok';
    }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;becomes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    public function isSuccessful()
    {
        return $this-&amp;gt;response_xml-&amp;gt;messages-&amp;gt;resultCode == 'Ok';
    }

    public function isError()
    {
        return $this-&amp;gt;response_xml-&amp;gt;messages-&amp;gt;resultCode != 'Ok';
    }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 01:07:33 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30422#M15913</guid>
      <dc:creator>stymiee</dc:creator>
      <dc:date>2012-10-05T01:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: isError seems to always return true</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30424#M15914</link>
      <description>&lt;P&gt;Thank you!! &amp;nbsp;I've corrected my copy of the file. &amp;nbsp;Hey, I'd love to know why the === doesn't work, if you ever figure that out!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 01:15:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/isError-seems-to-always-return-true/m-p/30424#M15914</guid>
      <dc:creator>alanm123</dc:creator>
      <dc:date>2012-10-05T01:15:28Z</dc:date>
    </item>
  </channel>
</rss>

