Problem/Motivation
Currently StripePaymentElement::onReturn throws a redirect exception directly, instead of using CheckoutFlowInterface::redirectToStep().
Because of this it bypasses CheckoutFlowBase::onStepChange() and any logic there. It also makes it harder to have a non-standard checkout route, because the payment element is hardcoding the route as 'commerce_checkout.form'.
I've been bitten by this multiple times: first because my checkout flow's custom onStepChange() logic was being skipped, and then second because the hardcoded route collided with the non-standard route used by commerce_recurring in #3172234: Allow to retry payments after failure, including (re)authentication for offsession payments (SCA).
Proposed resolution
Use CheckoutFlowInterface::redirectToStep().
The fix here is a subset of #3571373: Refine the StripePaymentElement::placeOrder() logic and this isue can be closed if that one is acceptable.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork commerce_stripe-3571320
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jonathanshawComment #4
anybodyLGTM!
Comment #5
tomtech commented