Skip to content

Commit

Permalink
fix float to int convertion (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars-icepay authored May 7, 2024
1 parent e274ed0 commit e4b3ad6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e4b3ad6

Please sign in to comment.