<?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: Why is resultCode OK when an error exists? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55022#M29967</link>
    <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1353"&gt;@RaynorC1emen7﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Are there any cases where resultCode = ok but&amp;nbsp;transactionResponse.responseCode would NOT be 1-4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume if resultCode = error that&amp;nbsp;transactionResponse.responseCode will be nothing and I know there must have been some kind of error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current test program has&lt;/P&gt;&lt;PRE&gt;        If response IsNot Nothing AndAlso response.transactionResponse IsNot Nothing AndAlso response.transactionResponse.responseCode = "1" Then
            Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode)
        ElseIf response IsNot Nothing Then
            Console.WriteLine("Error: " + response.messages.message(0).code + "  " + response.messages.message(0).text)
            If response.transactionResponse IsNot Nothing Then
                Console.WriteLine("Transaction Error : " + response.transactionResponse.errors(0).errorCode + " " + response.transactionResponse.errors(0).errorText)
            End If
        Else
            Console.WriteLine("Error: no response from Authorize.Net")
        End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What conditrions if any would that not catch?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2016 19:43:00 GMT</pubDate>
    <dc:creator>topshot</dc:creator>
    <dc:date>2016-06-27T19:43:00Z</dc:date>
    <item>
      <title>Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55019#M29964</link>
      <description>&lt;P&gt;I was rather surprised when I tried your sample code with a transaction that was supposed to fail and it still said&amp;nbsp;Ok for the resultCode, which per your samples indicates a successful transaction, but in reality it fails. How the response should be handled from your C# sample:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            if (response != null &amp;amp;&amp;amp; response.messages.resultCode == messageTypeEnum.Ok)
            {
                if (response.transactionResponse != null)
                {
                    Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);
                }
            }
            else if(response != null)
            {
                Console.WriteLine("Error: " + response.messages.message[0].code + "  " + response.messages.message[0].text);
                if (response.transactionResponse != null)
                {
                    Console.WriteLine("Transaction Error : " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);
                }
            }&lt;/PRE&gt;&lt;P&gt;Thankfully AuthCode does return empty, of course, but it would never hit the error condition.&amp;nbsp;I even tried your "Try It" tab on your website and it does the same thing as shown below (bold mine):&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt; 
&amp;lt;createTransactionResponse 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;refId&amp;gt;
    123456
  &amp;lt;/refId&amp;gt;
  &amp;lt;messages&amp;gt;
&lt;STRONG&gt;    &amp;lt;resultCode&amp;gt;
      Ok
    &amp;lt;/resultCode&amp;gt;&lt;/STRONG&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;
      2
    &amp;lt;/responseCode&amp;gt;
    &amp;lt;authCode /&amp;gt;
    &amp;lt;avsResultCode&amp;gt;
      Y
    &amp;lt;/avsResultCode&amp;gt;
    &amp;lt;cvvResultCode&amp;gt;
      P
    &amp;lt;/cvvResultCode&amp;gt;
    &amp;lt;cavvResultCode&amp;gt;
      2
    &amp;lt;/cavvResultCode&amp;gt;
    &amp;lt;transId&amp;gt;
      2260293952
    &amp;lt;/transId&amp;gt;
    &amp;lt;refTransID /&amp;gt;
    &amp;lt;transHash&amp;gt;
      D0D962E445A0D83B9FAE2FFFBC516D82
    &amp;lt;/transHash&amp;gt;
    &amp;lt;testRequest&amp;gt;
      0
    &amp;lt;/testRequest&amp;gt;
    &amp;lt;accountNumber&amp;gt;
      XXXX0015
    &amp;lt;/accountNumber&amp;gt;
    &amp;lt;accountType&amp;gt;
      MasterCard
    &amp;lt;/accountType&amp;gt;
&lt;STRONG&gt;    &amp;lt;errors&amp;gt;
      &amp;lt;error&amp;gt;
        &amp;lt;errorCode&amp;gt;
          2
        &amp;lt;/errorCode&amp;gt;
        &amp;lt;errorText&amp;gt;
          This transaction has been declined.
        &amp;lt;/errorText&amp;gt;
      &amp;lt;/error&amp;gt;
    &amp;lt;/errors&amp;gt;&lt;/STRONG&gt;
    &amp;lt;userFields&amp;gt;
      &amp;lt;userField&amp;gt;
        &amp;lt;name&amp;gt;
          MerchantDefinedFieldName1
        &amp;lt;/name&amp;gt;
        &amp;lt;value&amp;gt;
          MerchantDefinedFieldValue1
        &amp;lt;/value&amp;gt;
      &amp;lt;/userField&amp;gt;
      &amp;lt;userField&amp;gt;
        &amp;lt;name&amp;gt;
          favorite_color
        &amp;lt;/name&amp;gt;
        &amp;lt;value&amp;gt;
          blue
        &amp;lt;/value&amp;gt;
      &amp;lt;/userField&amp;gt;
    &amp;lt;/userFields&amp;gt;
  &amp;lt;/transactionResponse&amp;gt;
&amp;lt;/createTransactionResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;It seems rather disingenious to provide samples that would act in this manner. We should be looking to see if AuthCode is not nothing to determine a successful transaction or not rather than an OK resultCode,&amp;nbsp;but why is the resultCode&amp;nbsp;OK in the first place when an error exists???&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 16:12:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55019#M29964</guid>
      <dc:creator>topshot</dc:creator>
      <dc:date>2016-06-27T16:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55020#M29965</link>
      <description>&lt;P&gt;The first one is about if authorize.net process the transaction, which it did, that what the OK is for.&lt;/P&gt;&lt;P&gt;The second is the result of the transaction from the processor. Which was rejected with a response code 2.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 18:49:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55020#M29965</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2016-06-27T18:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55021#M29966</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20222"&gt;@topshot﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We do plan to improve our sample code&amp;nbsp;exactly as you describe and agree it is confusing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 19:19:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55021#M29966</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2016-06-27T19:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55022#M29967</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1353"&gt;@RaynorC1emen7﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Are there any cases where resultCode = ok but&amp;nbsp;transactionResponse.responseCode would NOT be 1-4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume if resultCode = error that&amp;nbsp;transactionResponse.responseCode will be nothing and I know there must have been some kind of error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current test program has&lt;/P&gt;&lt;PRE&gt;        If response IsNot Nothing AndAlso response.transactionResponse IsNot Nothing AndAlso response.transactionResponse.responseCode = "1" Then
            Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode)
        ElseIf response IsNot Nothing Then
            Console.WriteLine("Error: " + response.messages.message(0).code + "  " + response.messages.message(0).text)
            If response.transactionResponse IsNot Nothing Then
                Console.WriteLine("Transaction Error : " + response.transactionResponse.errors(0).errorCode + " " + response.transactionResponse.errors(0).errorText)
            End If
        Else
            Console.WriteLine("Error: no response from Authorize.Net")
        End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What conditrions if any would that not catch?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 19:43:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55022#M29967</guid>
      <dc:creator>topshot</dc:creator>
      <dc:date>2016-06-27T19:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55025#M29970</link>
      <description>&lt;P&gt;As far as I know, if it is not&amp;nbsp;I00001, it mean it failed something, which might or might not have any response code.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;it is&amp;nbsp;I00001, it will&amp;nbsp;always have response code 1-4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But to be 100% sure, a mod can double check.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 19:57:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55025#M29970</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2016-06-27T19:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is resultCode OK when an error exists?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55125#M30058</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1353"&gt;@RaynorC1emen7﻿&lt;/a&gt;&amp;nbsp;is correct -- if, for createTransactionResponse,&amp;nbsp;we return a value other than I00001, there may be no value for response.transactionResponse.responseCode at all. &lt;BR /&gt;&lt;BR /&gt;(If you aren't setting this value to NULL before submitting createTransactionRequest, I'd recommend doing so, to avoid the potential of carrying forward previous values.)&lt;BR /&gt;&lt;BR /&gt;But if we return I00001, there should be a value for response.transactionResponse.responseCode.&lt;BR /&gt;&lt;BR /&gt;Technically, this could be a value between 1-4, but in practice, you should only expect three values:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 = successfully authorized;&lt;/LI&gt;
&lt;LI&gt;2 = declined (either by card issuer, or by ANet filters like AVS, CVV,&amp;nbsp;or AFDS);&lt;/LI&gt;
&lt;LI&gt;3 = error (either at processor level, or at ANet level)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;A responseCode of 4 should be very rare, as these are internal to us and are usually transient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 15:26:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Why-is-resultCode-OK-when-an-error-exists/m-p/55125#M30058</guid>
      <dc:creator>Lilith</dc:creator>
      <dc:date>2016-07-07T15:26:34Z</dc:date>
    </item>
  </channel>
</rss>

