-
Notifications
You must be signed in to change notification settings - Fork 60
Description
The process_refund() method always returns true, even if the Refund was not processed by Mollie (for example, for Authorized but not Claimed Klarna Payments). According to the WooCommerce Documentation, it should return true/false based on Success. This leads to Orders switching their status to "refunded" in the Woocommerce Backend, but not being refunded in Mollie itself.
To me, it seems like this got broken during the transition from MollieOrder to MolliePayment Interface - the Implementation is different:
MollieOrder returns the Result of the refund if an error happened:
WooCommerce/src/Payment/MollieOrder.php
Line 579 in 19a2d0f
| return $this->orderItemsRefunder->refund( |
MolliePayment throws WP_Error if the refund is not possible:
WooCommerce/src/Payment/MolliePayment.php
Line 465 in 19a2d0f
| return new WP_Error('1', $errorMessage); |
So from the (limited) investigation I did, it would be enough to return the result of the refund Call here
| $payment_object->refund( |
and here
WooCommerce/lib/payment-gateway/src/PaymentGateway.php
Lines 239 to 241 in 5bb820c
| $refundProcessor->refundOrderPayment($order, $amount, $reason); | |
| return true; |
German Support Ticket-ID 2437724 for reference.