mollie / mollie-oxid

Mollie Payments for OXID eSales
7 stars 5 forks source link

Error executing API call (422: Unprocessable Entity): Order line 7 is invalid. The 'vatRate' field should have a maximum precision of 2. Field: lines.7.vatRate #17

Open d3mo17dot opened 1 year ago

d3mo17dot commented 1 year ago

This error happens in some cases with setting "VAT calculation of additional services: Calculate VAT proportionately" (The percentage of products in cart with the same VAT rate is used for calculating.). When an order contains products with different VAT rates, there is a big chance the VAT rate for shipping costs will be calculated to a value with higher precision than 2.

Can it be a solution for you to change line https://github.com/mollie/mollie-oxid/blob/master/Application/Model/Request/Base.php#L412 to 'vatRate' => (float)$this->formatPrice($oOrder->oxorder__oxdelvat->value), ?