Skip to content

Commit

Permalink
fix: round price to get correct amount (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: mdevaud <[email protected]>
  • Loading branch information
mdevaud and mdevaud authored Jun 6, 2024
1 parent 632b029 commit b83103b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.0.7</version>
<version>2.0.8</version>
<authors>
<author>
<name>Vincent Lopes-Vicente</name>
Expand Down
2 changes: 1 addition & 1 deletion Event/PayPlugPaymentEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public function buildFromOrder(Order $order)

if (null !== $order) {
// Avoid php bad int cast https://www.php.net/manual/fr/function.intval.php#60793
$orderAmount = $order->getTotalAmount() * 100;
$orderAmount = round($order->getTotalAmount(),2) * 100;
$this->setAmount(intval("$orderAmount"))
->setCurrency($order->getCurrency()->getCode());

Expand Down

0 comments on commit b83103b

Please sign in to comment.