Skip to content

Commit 7c9c521

Browse files
authored
Fix refunds, (#46)
* Fix refunds, no need to check if refund possible, done by WooCommerce already.
1 parent e723e4e commit 7c9c521

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Gateway/AbstractGateway.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
194194
}
195195

196196
// Make sure the refund amount is not greater than the invoice amount.
197-
if ($amount > $order->get_remaining_refund_amount()) {
197+
// This is done by WC and no need to do it here, refund is already saved at this stage so below won't work.
198+
// Leaving it here for future reference.
199+
/*if ($amount > $order->get_remaining_refund_amount()) {
198200
$errAmount = __METHOD__ . ': the refund amount can not exceed the order amount, aborting. Remaining amount ' . $order->get_remaining_refund_amount();
199201
Logger::debug($errAmount);
200202
return new \WP_Error('1', $errAmount);
201203
}
204+
*/
202205

203206
// Create the payout on BTCPay Server.
204207
// Handle Sats-mode.

0 commit comments

Comments
 (0)