Skip to content

Commit

Permalink
Fix refunds, (#46)
Browse files Browse the repository at this point in the history
* Fix refunds, no need to check if refund possible, done by WooCommerce already.
  • Loading branch information
ndeet authored Apr 4, 2024
1 parent e723e4e commit 7c9c521
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Gateway/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7c9c521

Please sign in to comment.