Skip to content

Incorrect handling of non-refundable Orders in process_refund() #1152

@fealXX

Description

@fealXX

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:

return $this->orderItemsRefunder->refund(

MolliePayment throws WP_Error if the refund is not possible:

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

$refundProcessor->refundOrderPayment($order, $amount, $reason);
return true;

German Support Ticket-ID 2437724 for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions