Skip to content

Commit

Permalink
update ReepayGateway::refund_payment
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel217D committed Oct 12, 2023
1 parent bf76a9a commit 215da5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/Gateways/ReepayGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ public function refund_payment( $order, $amount = null, $reason = '' ) {
throw new Exception( 'Payment can\'t be refunded.' );
}

if ( .0 === (float) $amount ) {
throw new Exception( 'Refund amount must be greater than 0.' );
}

$result = reepay()->api( $this )->refund( $order, $amount, $reason );

if ( is_wp_error( $result ) ) {
Expand Down

0 comments on commit 215da5f

Please sign in to comment.