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

Add missmatch to request lines #917

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

mmaymo
Copy link
Collaborator

@mmaymo mmaymo commented Jun 20, 2024

Handles PIWOO-501

@mmaymo mmaymo marked this pull request as ready for review July 4, 2024 07:53
return $line['totalAmount']['value'];
}, $this->order_lines));
$orderTotalDiff = $orderTotalRounded - $linesTotal;
if (abs($orderTotalDiff) > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmaymo it looks good to me, but I have one question. There is one scenario that could cause problems. Maybe you know what happens. For example:
$orderTotalRounded - $linesTotal = 0.001
$this->order_lines[] = $missmatch;
Mollie may round this to 0.00 and we have a surcharge with 0.00. Can that happen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll check it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, seems if the rounding makes the diff line send a 0 value there is no problem. The transaction went through without error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you :)

@mmaymo mmaymo changed the base branch from develop to release/7.6.0 July 8, 2024 07:26
@mmaymo mmaymo merged commit d9f84e9 into release/7.6.0 Jul 8, 2024
7 checks passed
@mmaymo mmaymo deleted the fix/decimal-missmatch-PIWOO-501 branch July 8, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants