Open a Stripe Checkout payment from the server
Coding a payment form yourself exposes you to risks that Stripe has already solved. This lesson teaches you to set up a product and price in a Stripe test environment, to have the agent write the server function that opens the payment for the signed-in user, and to test the journey with test cards without exposing your key.
Lesson objective
By the end of this lesson, you will be able to create a product and price in a Stripe test environment, have the agent write a server function that creates a Checkout session for the signed-in user, and verify the flow with test cards (payment accepted, strong authentication, decline) without the Stripe key leaving the server.
Topics covered
- Stripe Checkout
- online payments
- Stripe test cards
- server function
- SaaS subscription
Where it fits
Take a Stripe payment, in test mode
How do I charge for a subscription, and know for sure who has paid?
Lessons in this module
- Open a Stripe Checkout payment from the server (this lesson)
- Webhooks: payment status is decided on the server
What you will learn in this module
This lesson is part of the course Add a database, authentication and payments to your app
- Integrate Stripe Checkout in test mode (product, price, session created on the server, test cards) without exposing the secret key.
- Hold payment status on the server with signed, deduplicated Stripe webhooks, tested with the Stripe CLI or the Dashboard.
Related courses
- AI & DevelopmentJuniorSome basics are useful: introductory knowledge of the topic.
Build and ship a web app with an AI coding agent
2 hr 45 min
- AI & DevelopmentAdvancedRegular practice: you already use the tools or work on this topic.
Work with Claude Code on a real project: context, planning, review
3 hr
- Product ManagementAdvancedRegular practice: you already use the tools or work on this topic.
Git for PMs: ship as a team without putting production at risk
3 hr 30 min