• I used the below hook to check if payment is chargeback “_after_webhook_action”

    ?add_action('mollie-payments-for-woocommerce_after_webhook_action', 'mollie_webhook_handler', 10, 2);

    ?function mollie_webhook_handler($payment, $order)
    ?{
    ? ? ?$orderId = $order->id;
    ? ? ? ? $metaValue = get_post_meta($orderId, '_mollie_processed_chargeback_ids', true);
    ? ? ? ? if ($metaValue) {
    ? ? ? ? ? ?// condition
    ? ? ? ? }else{
    ? ? ? ? ? ? // do stuffs
    ? ? ? ? }
    ?}

    The above code works after redirect from mollie to the website , but during any webhook action it should trigger as per my understanding when looking to the core plugin code.

    But this hook has not triggered after chargeback hook which executed inside mollie account. but webhook has changed the order status to on-hold as per core plugin feature, why this hook is not called ? how to run hook for chargeback webhook actions ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Femi

    (@femiyb)

    Hello @manoharsingh

    It seems that the issue arises because the _after_webhook_action hook is not being triggered when the chargeback webhook is processed. This is likely due to the return; statement in line 161, which prevents the hook from being executed.

    As a workaround, you can try adding the following line of code before the return; in line 161:

    do_action($this->pluginId . '_after_webhook_action', $payment, $order);

    This should ensure that the _after_webhook_action hook is triggered properly when the chargeback webhook is processed.

    Let me know if this resolves the issue!

    Regards,
    Femi

    Thread Starter manoharsingh

    (@manoharsingh)

    Hello @femiyb,

    Thank You for the response,
    If we edit the core code while updating the plugin it will revert back i guess,

    Is there any other way to handle this ?

    I saw there is a do_action in line 518
    do_action($this->pluginId . '_chargebacks_processed',$payment,$order);
    Is this hook will work during chargeback webhook ?

    How to test this chargeback scenario in test mode , Please let me know

    Plugin Support Femi

    (@femiyb)

    Hello @manoharsingh

    If we edit the core code while updating the plugin it will revert back i guess,

    That’s true, but there is no update planned before sometime in early-mid-January.
    We are also trying to improve the behavior for the this update, but I can’t confirm right now if this will be included.

    Is there any other way to handle this ?

    Due to the code structure, this action hook is not executed when a chargeback is processed (due to the early return). We will look into making the action trigger after any Mollie webhook event.

     saw there is a do_action in line 518
    do_action($this->pluginId . '_chargebacks_processed',$payment,$order);
    Is this hook will work during chargeback webhook ?

    You can also try it with this mollie-payments-for-woocommerce_chargebacks_processed action hook. That may work for chargeback-specific scenarios.

    Regards,
    Femi.

    Thread Starter manoharsingh

    (@manoharsingh)

    Hi @femiyb
    Thank you for your detailed response!

    Testing Chargebacks in Sandbox Mode:
    Could you guide me on how to simulate or test chargebacks in Mollie’s sandbox environment? I’d like to ensure my integration handles this process correctly, but I haven’t found documentation or a clear way to test chargebacks specifically. Any tips or steps for testing would be appreciated.

    Thank you

    Plugin Support Femi

    (@femiyb)

    Hello @manoharsingh

    To test chargebacks in Mollie’s sandbox environment, you can follow these steps:

    1. Locate the Mollie Payment URL: Use the same payment URL that was initially used to set the order status to “Paid.”
    2. Revisit the Payment URL: Open the URL again after the status has been set to “Paid.” In test mode, this will display additional options, including the ability to simulate a chargeback.
    3. Simulate the Chargeback: Select the chargeback option from the menu. Note that this feature is only available for credit card payments in the sandbox environment.

    Let me know if you need further assistance!

    Regards,
    Femi.

    Thread Starter manoharsingh

    (@manoharsingh)

    Hello @femiyb ,

    Thank you for sharing the steps! I noticed that the described scenario works for simulating a refund rather than a chargeback in Mollie’s sandbox environment.

    After refund i got this key added in post_meta “_mollie_processed_refund_ids”

    Is there a way to simulate chargeback to create meta_key “_mollie_processed_chargeback_ids”

    Thanks again for contributing!

    Best regards,
    Manohar

    • This reply was modified 2 months, 3 weeks ago by manoharsingh.
    • This reply was modified 2 months, 3 weeks ago by manoharsingh.
    Plugin Support Femi

    (@femiyb)

    Hello

    You’re welcome, and thanks for your feedback!

    From my experience, the _mollie_processed_chargeback_ids meta key is indeed created when performing a chargeback as described. However, it’s important to note that refunds and chargebacks are two distinct processes. The chargeback option specifically appears only for credit card payments in Mollie.

    It’s possible that the chargeback option wasn’t selected during the process, and instead, the refund option was used. To clarify further, the chargeback option is available in the Mollie payment screen for eligible transactions (e.g., credit card payments). You might want to double-check the payment method and ensure that the chargeback option is chosen rather than the refund one.

    Regards,
    Femi.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.