From 1b9f9c7f8ae39fabb92e99a2e4df4f24ca49a3ad Mon Sep 17 00:00:00 2001 From: Adrian Mikko Asis Date: Fri, 28 Jan 2022 17:05:46 +0100 Subject: [PATCH] Allow cent refunds --- src/Gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gateway.php b/src/Gateway.php index 994b0b2..68235e3 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -345,7 +345,7 @@ public function refund($transaction_id, $amount, $reference, $extra = null) { if (is_null($transaction_id) || strlen($transaction_id) === 0) throw new \InvalidArgumentException("Transaction ID is required"); if (is_null($amount) || strlen($amount) === 0) throw new \InvalidArgumentException("Amount is required"); - if (intval($amount) < 1) throw new \InvalidArgumentException("Amount is invalid - must be a positive value"); + if (floatval($amount) < 0.01) throw new \InvalidArgumentException("Amount is invalid - must be a positive value"); if (is_null($reference) || strlen($reference) === 0) throw new \InvalidArgumentException("Reference is required"); $int_amount = self::floatToInt($amount);