mollie / Magento

Mollie Payments for Magento 1.x
https://www.mollie.com/
BSD 2-Clause "Simplified" License
39 stars 30 forks source link

Canceling payment does not throw order_cancel_after event #153

Closed Qronicle closed 4 years ago

Qronicle commented 4 years ago

Hi,

We have an issue with the Mollie_Mpm_Helper_Data::registerCancellation method. (Version 5.5, but present since at least the v4 days in Mollie_Mpm_Model_Api class). When an order is canceled by Mollie, this code is executed: $order->registerCancellation($comment)->save(); Doing this instead of using $order->cancel() prevents the 'order_cancel_after' event from being dispatched.

I don't know why registerCancellation is called directly, possible because cancel might not go through if $order->canCancel() returns false, although this should not be the case.

Right now we're overriding this method ourselves. But it would be great if this could be added to the module, or if you tell us why that isn't a good solution.

PS: The reason I'm asking is because budget modules tend to attach events to this cancel event to refund credits; should you have paid using a combination of budget and a mollie method, but you cancel during payment, this will now fail because of the event not being called.

Frank-Magmodules commented 4 years ago

Hi @Qronicle, we have created a PR for this, can you check if this works as expected in your case? If yes we can merge this into the next release! See; https://github.com/mollie/Magento/pull/157

Thank you! Frank

Qronicle commented 4 years ago

Hi @Frank-Magmodules

This works perfectly for us, release away :)

Thanks! Ruud

Frank-Magmodules commented 4 years ago

Hi @Qronicle, just merged the PR and released a new version that fixes the issue; see v5.5.4. We are closing this issue now but please feel free to reopen the issue if this still occurs.