Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

senrab's avatar

Login after a Cashier SCA event

I'm trying to use Cashier to take a subscription from users. If I use a standard Stripe test card, I can create the user and log them in. All is well.

If the card requires SCA, we get redirected the SCA/Stripe page. I'm using the default Cashier page to handle the SCA request. Like this https://imgur.com/opViHAz, after completing this I get presented with the Cashier page showing one button "Go Back". When I go back, I am redirected back to the registration page with an empty form, no subscription and no user in the database.

I'm using the example3 from the Cashier examples and the snippet from the main Cashier docs about failed payments

 public function register(Request $request)
    {
        ...
        $this->validator($request->all())->validate();

        DB::beginTransaction();

        event(new Registered($user = $this->create($request->all(), $userType)));

        try {
            $newSubscription = $user->newSubscription('subscription', $stripePlan)->create($request->payment_method, ['email' => $user->email]);
        } catch (IncompletePayment $exception) {
            return redirect()->route(
                'cashier.payment',
                [$exception->payment->id, 'redirect' => route('register')]
            );
        }

        DB::commit();

        $this->guard()->login($user);

        return $this->registered($request, $user)
            ?: redirect($this->redirectPath());

    }

I'm clearly doing something wrong handling the SCA event, but I can't figure out what!

0 likes
0 replies

Please or to participate in this conversation.