Fix capture action retry payment after abandoning checkout - #335
Open
TheMilek wants to merge 13 commits into
Open
Fix capture action retry payment after abandoning checkout#335TheMilek wants to merge 13 commits into
TheMilek wants to merge 13 commits into
Conversation
TheMilek
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
3 times, most recently
from
April 21, 2026 11:54
5fb2883 to
5bc05ce
Compare
TheMilek
commented
Apr 21, 2026
| } | ||
| } | ||
| if (isset($details['payment_mollie_id']) || isset($details['order_mollie_id'])) { | ||
| $handled = $this->handleExistingMolliePayment($request, $details); |
Member
Author
There was a problem hiding this comment.
allows to choose different payment method
TheMilek
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
2 times, most recently
from
April 22, 2026 13:02
c9808de to
5bbb584
Compare
marekrzytki
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
from
August 11, 2026 07:56
5bbb584 to
a5c256f
Compare
TheMilek
marked this pull request as ready for review
August 11, 2026 11:39
TheMilek
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
from
August 17, 2026 11:58
ad6ed99 to
8900d9e
Compare
TheMilek
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
from
August 17, 2026 12:43
8900d9e to
ef04697
Compare
TheMilek
force-pushed
the
fix-capture-action-retry-payment-after-abandoning-checkout
branch
from
August 18, 2026 06:56
5585085 to
bd6574a
Compare
NoResponseMate
approved these changes
Aug 18, 2026
GSadee
approved these changes
Aug 19, 2026
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 #329
How it is fixed
StatusActionmapsopentomarkNew().openmeans nothing happened and the session is still payable, which is whatnewmeans in Sylius.processingis now reached frompending, where the customer has committed on the PSP side. No core change needed, both gates are satisfied by the payment telling the truth.ConvertMolliePaymentActioncarries the tracked ids into its result. Not a separate decision, the price of the one above:Payum\Core\Action\CapturePaymentActionre-runsConverton every capture while the status isnewand replacesPayment::detailswith the result, so without carryingpayment_mollie_idover,CaptureActioncannot recognise the session it created and builds a competing one each round trip.CaptureActiondelegates toExistingMollieSessionResolver, which answers with one of three decisions, in order:redirectUrl. Mollie redirects back to the token that created the session after every attempt, abandoned ones included, so that equality identifies a return rather than a new intent. This is the cut that closes the loop.Payment::detailsonly through a form submission, so equality means nothing new was chosen. We PATCHredirectUrlto the current token and redirect to the existingcheckoutUrl. The PATCH is needed becauseCaptureController::doAction()invalidates the token onceexecute()returns normally, so without it the customer would come back to a dead token after paying.One Mollie payment per order, plus one per deliberate method change.
The orphan log moves to error level so it survives realistic gateway settings, and says that money was collected and needs review.
Once an order is placed, only surcharge neutral methods are offered.
PaymentSurchargeProcessorbails on!$order->canBeProcessed(), which isstate === STATE_CART, so after checkout the total can no longer follow the method: switching from a 5.00 fee to a 4.00 one left the order charging 5.00.MolliePaymentsMethodResolvernow offers only methods whose surcharge equals the one already on the order. The selected method's surcharge is by construction the one that produced the adjustment, so the list never comes back empty, and nothing changes during checkout.To compare surcharges without reimplementing them, the fee calculators gained
PaymentSurchargeAmountCalculatorInterface, reporting an amount instead of applying it, andcalculate()delegates to it so the two cannot drift apart.