diff --git a/src/Gateway/AbstractGateway.php b/src/Gateway/AbstractGateway.php index 5e25253..764b067 100644 --- a/src/Gateway/AbstractGateway.php +++ b/src/Gateway/AbstractGateway.php @@ -194,11 +194,14 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) { } // Make sure the refund amount is not greater than the invoice amount. - if ($amount > $order->get_remaining_refund_amount()) { + // This is done by WC and no need to do it here, refund is already saved at this stage so below won't work. + // Leaving it here for future reference. + /*if ($amount > $order->get_remaining_refund_amount()) { $errAmount = __METHOD__ . ': the refund amount can not exceed the order amount, aborting. Remaining amount ' . $order->get_remaining_refund_amount(); Logger::debug($errAmount); return new \WP_Error('1', $errAmount); } + */ // Create the payout on BTCPay Server. // Handle Sats-mode.