PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

Errorcode 1610 - probably rounding error in calculation of order amount #534

Closed ms-bm closed 6 months ago

ms-bm commented 7 months ago

Hello all,

we are using this extension for credit card payments. In the API logs I can see Authorization requests with the error code 1610 Article list faulty or incomplete. From analyzing the request data I can see that the parameter amount differs from the sum of the order positions. For example

amount: 22658

it[1]: goods no[1]: 5 pr[1]: 4344

it[2|: shipment no[2]: 1 pr[2]: 940

5 4344 + 1 940 = 22660

So there is a difference of 2 cents which I assume is the cause of the error. My guess is that the difference stems from rounding problems while applying the german VAT of 19 %. Is there a known solution to this problem? Or is it a bug?

janteuber commented 6 months ago

Hello @ms-bm ,

Thank you for your message.

The fact that Magento is unfortunately not good at calculating percentages is a well-known problem.

I actually have two solutions for you:

  1. Switch off the shopping cart transfer in our plugin (in the payment method option). This is possible for the payment method credit card.
  2. For payment methods for which we need the shopping cart, you have to limit the calculation within the magento to 2 decimal places.