From e4b3ad6098817a38362870a6bfba9df31891eaef Mon Sep 17 00:00:00 2001 From: Lars <106535819+Lars-icepay@users.noreply.github.com> Date: Tue, 7 May 2024 11:10:08 +0200 Subject: [PATCH] fix float to int convertion (#7) --- src/Gateway.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index 29b60b1..32cd145 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -53,7 +53,7 @@ public function process_payment( $order_id ): array { [ 'reference' => $reference, 'amount' => [ - 'value' => $order->get_total() * 100, + 'value' => (int) round($order->get_total() * 100) , 'currency' => $order->get_currency(), ], 'paymentMethod' => [ @@ -105,7 +105,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ): bool| [ $isSuccessful, $refund ] = $client->refund( $paymentKey, [ 'amount' => [ - 'value' => $amount * 100, + 'value' => (int) round($amount * 100), 'currency' => $order->get_currency(), ], 'reference' => $reason,