Skip to content

Commit b83103b

Browse files
mdevaudmdevaud
andauthored
fix: round price to get correct amount (#17)
Co-authored-by: mdevaud <mdevaud@openstudio.fr>
1 parent 632b029 commit b83103b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Config/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<language>en_US</language>
1818
<language>fr_FR</language>
1919
</languages>
20-
<version>2.0.7</version>
20+
<version>2.0.8</version>
2121
<authors>
2222
<author>
2323
<name>Vincent Lopes-Vicente</name>

Event/PayPlugPaymentEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ public function buildFromOrder(Order $order)
591591

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

0 commit comments

Comments
 (0)