-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unitprice precision incorrect due ommited numbers in one-time charges #89
Comments
Hi @KumaVolt , Can you share a code sample so we can reproduce this issue? Note that cashier mollie performs all calculations locally. |
I made a demo repository for this as wel. |
@sandervanhooft Did you had the time to look into this yet? |
On further inspection i found an open pull request in the moneyphp/money library which addresses the issues i am currently facing with calculating the precision in this library. |
Hi @KumaVolt, We have this on the radar, but since it's an edge case / related to MoneyPHP it's not high on the backlog. I am happy to accept a PR if you see a way to fix this sooner. |
@sandervanhooft It's not an edge case, we noticed a similar issue and it has nothing to do with MoneyPHP but your helper on line 34 force typecasting every value to integer and thereby hiding the error which the built in MoneyPHP type checking would otherwise throw if you give it something which is not an integer. And how can a servious rounding issue be an edge case in the first place for a payment provider? It's your main purpose that the numbers match. |
@Master-Minder as mentioned, I am happy to accept a PR. |
@sandervanhooft I can offer you a PR which is absolutly untested, or just tested for this scenario, or do you expect me to do full regression testing? Since the money() helper is used all over the place in your code and I have no idea if this will impact anywhere else. |
An incorrect amount is shown in some edge cases when checking out.
For example
A product is €1.00 with 21% tax. Without the tax this will results 0,8264462809917355. When applying the required formula * 100 for cashier results in 82,64462809917355. Adding this result in ChargeItemBuilder will ommit every number after the comma resulting in the price €0,99 when checking out.
Is there a reason why mollie only includes 2 numbers after the comma?
The text was updated successfully, but these errors were encountered: