Search across all documentation pages
12 pages in this section.
Install the three Stripe packages, configure environment variables, create server and client Stripe instances, and wrap your app with the Elements provider.
Create a Checkout Session on the server, then redirect the customer to Stripe's hosted checkout page. Stripe handles the entire payment UI, PCI compliance, and
Create a PaymentIntent on the server to get a client secret, pass it to the Elements provider, render a PaymentElement for card input, and confirm the payment c
Use PaymentElement for a unified payment input that supports cards, wallets, and bank transfers. Use CardElement when you only need card payments and want finer
Create subscription products and prices in Stripe, then use Checkout Sessions or PaymentIntents to subscribe customers. Manage subscription lifecycle with the C
Create a Next.js Route Handler that receives Stripe webhook events, verifies the signature, and processes key events like successful payments and subscription c
Create a portal session on the server and redirect the customer to Stripe's hosted billing management page where they can update payment methods, change plans,
Use useStripe and useElements from @stripe/react-stripe-js to access Stripe instances in your components. Build custom hooks to encapsulate common payment patte
Use Next.js Server Actions to handle all Stripe operations server-side. Combine with useActionState for form-based payment flows and Zod for input validation.
Fetch products and prices from Stripe at build time, display pricing tiers with feature comparisons, and let users toggle between monthly and annual billing. Ha
Handle Stripe errors gracefully by categorizing error types, displaying user-friendly messages, managing 3D Secure authentication flows, and implementing retry
Test Stripe integrations in Next.js — test mode keys, mocked webhooks, signed payloads, idempotency, and end-to-end checkout flows with Playwright.