Fix order status changes not being applied (#15) - #16
Merged
Conversation
None of the Mollie methods declared a payment_action, so Mage_Sales_Model_Order_Payment::place() skipped the initialize() call that applies the configured pending status. New orders fell back to the default status for STATE_NEW (pending) instead of pending_payment, and because they were stuck in the wrong state the cron (which filters by state=pending_payment) never reconciled them to processing either. Add <payment_action>order</payment_action> to every Mollie method so initialize() runs and the merchant-configured statuses are honoured. Also finalize paid/authorized payments synchronously on customer return instead of relying solely on the webhook, which is frequently unreachable in sandbox/local-dev setups. reconcile() is idempotent, so a later webhook/cron pass is a no-op.
fballiano
force-pushed
the
fix/order-status-changes
branch
from
June 23, 2026 15:49
e7ddfd1 to
b048bcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15.
Root cause
Both symptoms reported in #15 — new orders stuck at
Pendinginstead ofPending Payment, and paid orders never moving toProcessing— trace back to a single missing config value, the same bug previously fixed in the Przelewy24 module (MahoCommerce/module-przelewy24#11).In Maho core (
Mage_Sales_Model_Order_Payment::place()):None of the Mollie methods declared a
<payment_action>, so$actionwas empty and the whole block — including theinitialize()that applies the configured pending status — was skipped. The order fell back to the default status forSTATE_NEW(pending).That also broke recovery: the cron filters orders by
state = pending_payment, so orders sitting in the wrongnew/pendingstate were never reconciled toprocessingeither.Changes
etc/config.xml— added<payment_action>order</payment_action>to all 28 Mollie method blocks. With_isInitializeNeeded = truethis only causesinitialize()to fire (no capture logic is triggered); the existinginitialize()already resolves and applies the configured pending status.controllers/PaymentController.php—returnActionnow calls the idempotentreconcile()synchronously when Mollie reports paid/authorized on customer return, instead of relying solely on the webhook. Mollie's webhook is frequently unreachable in sandbox/local-dev (the reporter's setup), which is why theProcessingtransition wasn't happening. Mirrors the P24 robustness fix (Finalize order on return from Przelewy24 (#12) module-przelewy24#13). A later webhook/cron pass is a safe no-op.Verification
php -lclean;xmllintvalidates the XMLMage::getModel('maho_mollie/cron')+@varpattern already used and passing in CI inWebhookController.php— a local plugin-cache false positive, not a real error.