mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
104 stars 53 forks source link

Order switches back to "Pending payment" after being paid & invoiced #802

Closed Stoux closed 2 months ago

Stoux commented 3 months ago

Describe the bug Figured it might have been the same bug as https://github.com/mollie/magento2/issues/791 but it does seem to be different as we don't actually see the status update.

As described in the title: We very occasionally have orders that revert back to the pending payment state after hitting the processing state. They also have a paid invoice. The weird part is that there doesn't seem to be an update of the state/status through the Order model, it looks like it's circumventing the Order model completely. I'm also not sure it's Mollie that's causing this but I'm kinda out of ideas, so any input is welcome.

We've got an order that's progressed to processing:

image

Yet it's state is still pending payment:

image

So I've added a plugin around setData for the Order to maybe find the culprit:

image image

Yet, it isn't called:

system.log:[2024-07-24T09:14:34.858357+00:00] main.INFO: [ECS] Changing state/status of order {"order":null,"increment":"2000066665","before":"payment_review : ","after":"payment_review : payment_review"} []
system.log:[2024-07-24T09:14:34.859281+00:00] main.INFO: [ECS] Changing state/status of order {"order":null,"increment":"2000066665","before":"payment_review : payment_review","after":"pending_payment : payment_review"} []
system.log:[2024-07-24T09:14:34.860500+00:00] main.INFO: [ECS] Changing state/status of order {"order":null,"increment":"2000066665","before":"pending_payment : payment_review","after":"pending_payment : pending_payment"} []
system.log:[2024-07-24T09:15:04.286459+00:00] main.INFO: [ECS] Changing state/status of order {"order":"114627","increment":"2000066665","before":"pending_payment : pending_payment","after":"processing : pending_payment"} []
system.log:[2024-07-24T09:15:04.287438+00:00] main.INFO: [ECS] Changing state/status of order {"order":"114627","increment":"2000066665","before":"processing : pending_payment","after":"processing : processing"} []

The state of the order corrects itself if we re-fetch the status using the "Update Payment Status" button in Mollie (which leads me to believe it has to be something in the plugin, but again: just guessing at this point).

Any idea where I might look and/or what I can log/track/wrap to maybe find the culprit? Or at least: exclude Mollie from being a suspect.

Used versions

Frank-Magmodules commented 2 months ago

Hi @Stoux,

We weren't able to reproduce this issue in a vanilla Magento environment. Could you give it a try on your end? If possible, try reproducing the issue on your staging or development environment and disable any potential overrides or third-party plugins that might be interfering.

If you need assistance with this, I'm happy to help—feel free to contact us directly.