mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 50 forks source link

[ISSUE] Division by 0 on non Mollie orders in tax helper plugin #704

Closed ThomasNegeli closed 8 months ago

ThomasNegeli commented 8 months ago
   $amount = $order->getMolliePaymentFee();

from here https://github.com/mollie/magento2/blob/v2.32.0/Plugin/Tax/Helper/Data.php#L61 will give you a zero result on non Mollie orders. So you will get a "division by zero" PHP Error in the line https://github.com/mollie/magento2/blob/v2.32.0/Plugin/Tax/Helper/Data.php#L64

ThomasNegeli commented 8 months ago

Update: It also happens on orders with Mollie payments

Frank-Magmodules commented 8 months ago

Hello @ThomasNegeli, I appreciate your comment. Could you kindly provide the precise steps for replicating this exact PHP error? We’re having difficulty reproducing it on our end.

ThomasNegeli commented 8 months ago

After Placing an order with Mollie CreditCard or for example an offline payment method like "Purchase Order", when Magento tries to generate the Invoice, this fails due to a division by 0. mollie_payment_fee in the sales_order table is 0 for these orders in our case. So the division by 0 is clear to reproduce.

Frank-Magmodules commented 8 months ago

Got it, we are investigating the issue right now @ThomasNegeli , will be back soon.

Frank-Magmodules commented 8 months ago

Hello @ThomasNegeli,

Finally, we were able to reproduce the exact error you encountered. We’ve addressed this problem within our new release and we appreciate your prompt reporting of this matter. It seems that we found a new scenario for our E2E testing.

We’ll mark this issue as resolved for now, but please don’t hesitate to respond or reopen the ticket whenever necessary. Thank you!