Course lesson 55 · Payments with Stripe

Adding Subscriptions in the User Application

One study unit · Read, recall, then practice · Original video 00:20:36

The frontend gains an upgrade page, subscription status sidebar, and cancellation dialog through Better Auth’s Stripe client plugin. The lesson exercises subscription listing, checkout, upgrades, cancellation, and restoration, while forwarding Stripe webhooks to localhost for state synchronization. Several failures show why the browser, local database, Stripe account, and webhook listener must all agree.

Primary source: course video 55 · Supplied English subtitles · 00:20:36.

Understand the idea

What the course does

  1. Enable subscriptions in the React Stripe client plugin and add upgrade, sidebar, and cancellation components.
  2. Load subscriptions on page entry and call upgrade with the selected plan and return destinations.
  3. Register the subscription schema with the Drizzle adapter after listing fails with a missing-table mapping error.
  4. Start the Stripe CLI listener, supply its signing secret, and verify it uses the intended sandbox account.
  5. Complete sandbox checkout and enable plan switching plus eligible products in the Stripe customer portal.
  6. Verify upgrades and prorated examples, then cancel at period end and restore the subscription while observing webhook updates.

Watch for

Recall before revealing

Why can Stripe show an upgraded subscription while the application still shows the old plan?

Reveal the explanation

The application relies on webhook processing to update its local subscription records; an incorrect account, endpoint, or signing secret can prevent that update.

Try it

Outline a sandbox test covering signup, first purchase, upgrade, cancellation, and restoration.

Check your result

For each transition you verify both the Stripe state and the application’s stored and displayed subscription state.

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.

Companion primary documentation: Better Auth Stripe plugin. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →