Course lesson 54 · Payments with Stripe
Creating Stripe Products
The application’s authentication initialization is updated to accept Stripe configuration, and Node compatibility is enabled after a dependency fails on a Node utility import. A new sign-in verifies automatic Stripe customer creation. The instructor then creates three sandbox subscription products and maps their recurring price IDs to named plans in Better Auth.
Primary source: course video 54 · Supplied English subtitles · 00:11:44.
Understand the idea
- A Stripe product describes what is sold; the price ID identifies the particular recurring charge used in checkout.
- The server maps stable application plan names to Stripe price IDs.
- Cloudflare compatibility settings matter when an imported SDK depends on Node APIs.
- The shared auth helper is simplified to accept an API key and construct the Stripe client internally.
- A user created before the plugin was enabled does not necessarily exercise customer-on-signup behavior.
What the course does
- Pass initial Stripe settings into the expanded authentication helper and load the sandbox secret key from environment configuration.
- Regenerate types and add Node compatibility after the dynamic util dependency error.
- Refactor the helper interface from a Stripe client argument to an API-key argument, then rebuild.
- Sign in with a fresh test user and verify the matching Stripe customer ID in D1 and Stripe.
- Create Basic, Pro, and Enterprise recurring products and copy their price IDs.
- Populate the server plan list with lowercase plan names and the corresponding configured prices.
Watch for
- The $9, $25, and $259 tiers are illustrative course product choices.
- Deleting tutorial user rows creates duplicate Stripe customers during testing; this is not a migration strategy for existing real users.
- The hardcoded plan list is a deliberate teaching simplification; dynamic plans, annual pricing, and trials are discussed as extensions.
Recall before revealing
Which Stripe identifier should the backend plan configuration use for billing?
Reveal the explanation
It uses the recurring price ID associated with the product, not merely the product’s identity or display name.
Try it
Create a paper mapping of application plan name, Stripe product, and recurring price ID for three tiers.
Check your result
Each plan points to a specific recurring price, and you can explain where its billing amount comes from.
Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.
Rewatch only what you need
Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.
- 00:02:04 — Node dependency compatibility error
- 00:03:37 — Simplify the Stripe helper interface
- 00:05:10 — Verify customer creation for a fresh user
- 00:07:11 — Create products and obtain price IDs
Companion primary documentation: Better Auth Stripe plugin. For recorded API names, commands, limits, and prices, check the version you use.