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

Command icon 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

jonathanshaw created an issue. See original summary.

jonathanshaw’s picture

Issue summary: View changes
anybody’s picture

Status: Active » Reviewed & tested by the community

LGTM!

tomtech’s picture

Assigned: Unassigned » tomtech