Course lesson 56 · Payments with Stripe
Deploying & Live Webhooks
The subscription integration is deployed to the stage application with a publicly reachable Stripe webhook endpoint, while still using sandbox payments. Nonsecret price IDs move into Wrangler variables, and sensitive keys are configured as runtime secrets. The instructor troubleshoots endpoint typos and the mistaken use of a webhook endpoint ID, then fixes a missing Better Auth application secret discovered in logs.
Primary source: course video 56 · Supplied English subtitles · 00:16:25.
Understand the idea
- Nonsecret runtime values can be versioned in Wrangler configuration and deployed with the Worker.
- Stripe API credentials, the webhook signing secret, and the Better Auth application secret serve different purposes.
- A deployed webhook needs a valid public URL and the signing secret belonging to that endpoint.
- Stripe delivery logs and replay controls help distinguish connection failures from application verification failures.
- OAuth origins and callbacks must include the stage domain as well as previously configured local or production hosts.
What the course does
- Move sandbox price IDs into stage variables, regenerate types, and deploy the stage user application.
- Create a Stripe endpoint at the Better Auth webhook path and select checkout completion and subscription update/deletion events discussed in the lesson.
- Configure Stripe and Google runtime credentials and register the stage Google callback.
- Test signup, purchase, and upgrade; inspect failed webhook deliveries when the plan remains unchanged.
- Correct the endpoint URL and replace the endpoint ID with its actual signing secret, then replay events and verify cancellation.
- Add a dedicated Better Auth secret to shared setup and Worker runtime configuration, rebuild, and deploy.
Watch for
- Despite the title’s “Live Webhooks,” this lesson uses deployed stage endpoints with Stripe sandbox payments; real-money production setup is left to the learner.
- The missing Better Auth secret is fixed only late in the recording; added advice: configure a suitable secret before exposing authentication.
- The displayed webhook event set and secret-generation approach should be checked against current official documentation before implementation.
Recall before revealing
What is the difference between a webhook endpoint ID and its signing secret?
Reveal the explanation
The ID identifies the configured endpoint; its signing secret is the value used to verify webhook signatures and is what the integration requires.
Try it
Create a diagnosis sequence for a paid-plan change that is absent from the dashboard.
Check your result
You check Stripe event delivery, exact endpoint URL, response error, signing secret, and resulting local 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.
- 00:00:00 — Separate public price IDs from secrets
- 00:02:31 — Configure deployed webhook endpoint
- 00:08:04 — Diagnose webhook URL typos
- 00:09:04 — Endpoint ID versus signing secret
- 00:12:06 — Fix missing Better Auth secret
Companion primary documentation: Stripe webhooks. For recorded API names, commands, limits, and prices, check the version you use.