Skip to content

Commit 1eefda5

Browse files
authored
Merge pull request #29 from mikkoasis/bugfix/refund-cents
Allow cent refunds
2 parents 22a67ba + 1b9f9c7 commit 1eefda5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Gateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public function refund($transaction_id, $amount, $reference, $extra = null)
345345
{
346346
if (is_null($transaction_id) || strlen($transaction_id) === 0) throw new \InvalidArgumentException("Transaction ID is required");
347347
if (is_null($amount) || strlen($amount) === 0) throw new \InvalidArgumentException("Amount is required");
348-
if (intval($amount) < 1) throw new \InvalidArgumentException("Amount is invalid - must be a positive value");
348+
if (floatval($amount) < 0.01) throw new \InvalidArgumentException("Amount is invalid - must be a positive value");
349349
if (is_null($reference) || strlen($reference) === 0) throw new \InvalidArgumentException("Reference is required");
350350

351351
$int_amount = self::floatToInt($amount);

0 commit comments

Comments
 (0)