<?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: Keep Getting Transaction Failed E00003 in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Keep-Getting-Transaction-Failed-E00003/m-p/57320#M32046</link>
    <description>&lt;P&gt;What value are you testing with for the card code? If you're trying something like "009", that's going to get sent as "9" because of your intval() call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try dropping the intval() call and just send it as text, and see if that will help.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 20:15:55 GMT</pubDate>
    <dc:creator>Aaron</dc:creator>
    <dc:date>2017-03-20T20:15:55Z</dc:date>
    <item>
      <title>Keep Getting Transaction Failed E00003</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Keep-Getting-Transaction-Failed-E00003/m-p/57116#M32044</link>
      <description>&lt;P&gt;I keep getting the following error message from the API:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ERROR : Transaction Failed E00003: The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardCode' element is invalid - The value XXXX is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardCode' - The actual length is less than the MinL&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error code resources is a bit vague on the description:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"An error occurred while parsing the XML request."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My implementation is as follow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Common setup for API credentials&lt;BR /&gt;$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();&lt;BR /&gt;$merchantAuthentication-&amp;gt;setName($this-&amp;gt;ci-&amp;gt;config-&amp;gt;item('AUTHNETAPILOGINID'));&lt;BR /&gt;$merchantAuthentication-&amp;gt;setTransactionKey($this-&amp;gt;ci-&amp;gt;config-&amp;gt;item('AUTHNETKEY'));&lt;BR /&gt;$refId = 'ref' . time();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Remove potential white spaces&lt;BR /&gt;$ccn = preg_replace( '/\s+/', '', $ccn );&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Format Date&lt;BR /&gt;$exp_date = DateTime::createFromFormat('m / y', $exp);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Create the payment data for a credit card&lt;BR /&gt;$creditCard = new AnetAPI\CreditCardType();&lt;BR /&gt;$creditCard-&amp;gt;setCardNumber( intval( $ccn ) );&lt;BR /&gt;$creditCard-&amp;gt;setExpirationDate( $exp_date-&amp;gt;format('Y-m') );&lt;BR /&gt;$creditCard-&amp;gt;setCardCode( intval( $cvc ) );&lt;/P&gt;&lt;P&gt;$paymentOne = new AnetAPI\PaymentType();&lt;BR /&gt;$paymentOne-&amp;gt;setCreditCard($creditCard);&lt;BR /&gt;$order = new AnetAPI\OrderType();&lt;BR /&gt;$order-&amp;gt;setDescription("Ticket");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Create a transaction&lt;BR /&gt;$transactionRequestType = new AnetAPI\TransactionRequestType();&lt;BR /&gt;$transactionRequestType-&amp;gt;setTransactionType("authCaptureTransaction");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Assign previous info to the transactionRequest field&lt;BR /&gt;$transactionRequestType-&amp;gt;setAmount( $amount );&lt;BR /&gt;$transactionRequestType-&amp;gt;setOrder( $order );&lt;BR /&gt;$transactionRequestType-&amp;gt;setPayment($paymentOne);&lt;BR /&gt;// $transactionRequestType-&amp;gt;setBillTo($billto);&lt;/P&gt;&lt;P&gt;$request = new AnetAPI\CreateTransactionRequest();&lt;BR /&gt;$request-&amp;gt;setMerchantAuthentication($merchantAuthentication);&lt;BR /&gt;$request-&amp;gt;setRefId( $refId );&lt;BR /&gt;$request-&amp;gt;setTransactionRequest($transactionRequestType);&lt;BR /&gt;$controller = new AnetController\CreateTransactionController($request);&lt;BR /&gt;$response_api = $controller-&amp;gt;executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::PRODUCTION);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I doing anything wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 02:49:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Keep-Getting-Transaction-Failed-E00003/m-p/57116#M32044</guid>
      <dc:creator>YohannM</dc:creator>
      <dc:date>2017-03-03T02:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Keep Getting Transaction Failed E00003</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Keep-Getting-Transaction-Failed-E00003/m-p/57320#M32046</link>
      <description>&lt;P&gt;What value are you testing with for the card code? If you're trying something like "009", that's going to get sent as "9" because of your intval() call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try dropping the intval() call and just send it as text, and see if that will help.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 20:15:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Keep-Getting-Transaction-Failed-E00003/m-p/57320#M32046</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-03-20T20:15:55Z</dc:date>
    </item>
  </channel>
</rss>

