<?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 Error Code: 5/Error message: A valid amount is required. in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Error-Code-5-Error-message-A-valid-amount-is-required/m-p/76978#M48157</link>
    <description>&lt;P&gt;I set up a test customer profile in my sandbox and ran a few auth/captures with my python code.&amp;nbsp; When the amount is a multiple of 0.25 the transaction succeeds but any other amounts fail.&amp;nbsp; Is this expected behavior?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;gt;&amp;gt;&amp;gt; charge_customer_profile('500311421', '500535512', Decimal(20.25), 'test000001')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_9'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_8'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}customerProfileIdType&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}transactionResponse&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;('SUCCESS', 'Successfully created transaction with Transaction ID: 40068028999\nTransaction Response Code: 1\nMessage Code: 1\nDescription: This transaction has been approved.')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;gt;&amp;gt;&amp;gt; charge_customer_profile('500311421', '500535512', Decimal(20.20), 'test000001')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_11'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_10'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}transactionResponse&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;('FAILURE', 'Error Code: 5\nError message: A valid amount is required.')&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 20:12:58 GMT</pubDate>
    <dc:creator>timwhalen1</dc:creator>
    <dc:date>2021-06-23T20:12:58Z</dc:date>
    <item>
      <title>Error Code: 5/Error message: A valid amount is required.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Error-Code-5-Error-message-A-valid-amount-is-required/m-p/76978#M48157</link>
      <description>&lt;P&gt;I set up a test customer profile in my sandbox and ran a few auth/captures with my python code.&amp;nbsp; When the amount is a multiple of 0.25 the transaction succeeds but any other amounts fail.&amp;nbsp; Is this expected behavior?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;gt;&amp;gt;&amp;gt; charge_customer_profile('500311421', '500535512', Decimal(20.25), 'test000001')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_9'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_8'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}customerProfileIdType&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}transactionResponse&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;('SUCCESS', 'Successfully created transaction with Transaction ID: 40068028999\nTransaction Response Code: 1\nMessage Code: 1\nDescription: This transaction has been approved.')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;gt;&amp;gt;&amp;gt; charge_customer_profile('500311421', '500535512', Decimal(20.20), 'test000001')&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_11'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for &amp;lt;class 'authorizenet.apicontractsv1.CTD_ANON_10'&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Multiple accepting paths for {AnetApi/xml/v1/schema/AnetApiSchema.xsd}transactionResponse&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;('FAILURE', 'Error Code: 5\nError message: A valid amount is required.')&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 20:12:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Error-Code-5-Error-message-A-valid-amount-is-required/m-p/76978#M48157</guid>
      <dc:creator>timwhalen1</dc:creator>
      <dc:date>2021-06-23T20:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error Code: 5/Error message: A valid amount is required.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Error-Code-5-Error-message-A-valid-amount-is-required/m-p/78888#M49591</link>
      <description>&lt;P&gt;fwiw I dug into this issue later and found it can be due to quirkiness in converting floats to Decimals in python and also in my case authorize.net requiring a Decimal value rounded to the penny when my input was in microdollars.&amp;nbsp; Here's some sample code generating good and bad Decimals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; from decimal import Decimal&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; Decimal(0.25) # good&lt;BR /&gt;Decimal('0.25')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; Decimal(5.11) # bad&lt;BR /&gt;Decimal('5.11000000000000031974423109204508364200592041015625')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; Decimal('5.11') # good&lt;BR /&gt;Decimal('5.11')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; Decimal(str(5.11)) # good&lt;BR /&gt;Decimal('5.11')&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; Decimal('5.115465') # bad&lt;BR /&gt;Decimal('5.115465')&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; Decimal('5.113465').quantize(Decimal('1.00')) # good&lt;BR /&gt;Decimal('5.11')&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; Decimal('5.115465').quantize(Decimal('1.00')) # good&lt;BR /&gt;Decimal('5.12')&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 20:35:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Error-Code-5-Error-message-A-valid-amount-is-required/m-p/78888#M49591</guid>
      <dc:creator>timwhalen1</dc:creator>
      <dc:date>2021-09-29T20:35:07Z</dc:date>
    </item>
  </channel>
</rss>

