/subscribe route presents the Stripe Elements checkout form where the customer enters their card details to complete the subscription payment. The PaymentIntent client secret is passed in as a query parameter from the /prices redirect.
GET /subscribe
Reads theclient_secret query parameter and passes it to the Stripe Elements card form.
Query parameters
The PaymentIntent client secret returned when the subscription was created on
POST /prices. Stripe Elements uses this value to identify and confirm the correct PaymentIntent.Loader source
Rendered components
The route renders a Stripe Elements provider wrapping the card subscription form:stripePromise is initialized with your Stripe publishable key via loadStripe.
Payment confirmation
When the customer submits the card form,CardSubscription calls stripe.confirmCardPayment with the client secret and the entered payment details:
Success
IfconfirmCardPayment resolves without an error, the user is navigated to /account to view their active subscription.
Error
IfconfirmCardPayment returns an error, the error message is displayed inline in the card form. The customer can correct their details and resubmit without navigating away.
Test cards
Use the following Stripe test card numbers to verify payment flows in test mode.| Card number | Behavior |
|---|---|
4242 4242 4242 4242 | Payment succeeds immediately. |
4000 0025 0000 3155 | Requires Strong Customer Authentication (SCA) — triggers a 3D Secure challenge. |
Test cards only work when Stripe is initialized with a test publishable key (
pk_test_...). In live mode, use real card numbers.