Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ThomasNegeli opened this issue Oct 24, 2023 · 5 comments
Closed
Assignees
Labels
Fixed and planned for next release Fix will be included in the next release. Investigating We are working on this issue together with the customer.

Comments

@ThomasNegeli
Copy link

   $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

@Frank-Magmodules Frank-Magmodules self-assigned this Oct 24, 2023
@Frank-Magmodules Frank-Magmodules added the Investigating We are working on this issue together with the customer. label Oct 24, 2023
@ThomasNegeli
Copy link
Author

Update: It also happens on orders with Mollie payments

@Frank-Magmodules
Copy link
Collaborator

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.

@Frank-Magmodules Frank-Magmodules changed the title Division by 0 on non Mollie orders in tax helper plugin [ISSUE] Division by 0 on non Mollie orders in tax helper plugin Oct 24, 2023
@ThomasNegeli
Copy link
Author

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
Copy link
Collaborator

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

@Frank-Magmodules Frank-Magmodules added the Fixed and planned for next release Fix will be included in the next release. label Oct 24, 2023
@Frank-Magmodules
Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed and planned for next release Fix will be included in the next release. Investigating We are working on this issue together with the customer.
Projects
None yet
Development

No branches or pull requests

2 participants