Use gateway supports to check if refunds are allowed

This commit is contained in:
Daniel Hüsken 2024-11-04 12:24:09 +01:00
parent 19fea3c81e
commit cfe61421f3
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8
4 changed files with 15 additions and 53 deletions

View file

@ -185,18 +185,6 @@ class LocalAlternativePaymentMethodsModule implements ServiceModule, ExtendingMo
2
);
add_filter(
'woocommerce_paypal_payments_allowed_refund_payment_methods',
function( array $payment_methods ) use ( $c ): array {
$local_payment_methods = $c->get( 'ppcp-local-apms.payment-methods' );
foreach ( $local_payment_methods as $payment_method ) {
$payment_methods[] = $payment_method['id'];
}
return $payment_methods;
}
);
return true;
}