t3dotgg

stripe-recommendations

How to implement Stripe without going mad

by t3dotgg

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · Last activity 1y ago
See all on GitHub →
drewsephski

This keeps the single approach fully intact and only fixes what Stripe broke or changed. Pin with stripe-node ; explain SDK version pinning and matching the webhook endpoint version (Stripe API versioning). Read billing periods from the subscription item and update to use its timestamp types (Basil breaking change). Complete the hosted subscription Checkout example with , , and ; clarify versus (Checkout parameters). Verify webhooks with and Web Crypto; preserve the raw-body / Pages Router note (signature verification, official SDK async example, SDK Web Crypto provider). Await the sync before acknowledging delivery; return for invalid events and for sync failures so Stripe can retry (webhook delivery and retries). Keep all existing events; add delayed Checkout success/failure and (Checkout payment events, voiding subscription invoices). Ignore customerless PaymentIntents instead of retrying events with nothing to sync (nullable PaymentIntent customer). Tone, headings, structure, customer-before-checkout rule, user/customer KV binding, and the shared + webhook sync philosophy are preserved. Validation: extracted examples pass strict TypeScript and ESLint against stripe-node ; 17 runtime checks pass with both Node and worker SDK exports. Markdown lint respects the existing heading and line-length style; passes. All 21 allowed events were checked against the official event reference. Only changes; validation tooling stays outside the repo.

drewsephski · 1mo ago
mvl22
Package thisOpenIssue

Great video. You've got a pile of useful code there. 90%+ of it is entirely generic and useful for anyone integrating. The remaining 10% is specific to your infrastructure, e.g. the KV, which could be interfaced via a callback. Most of your implementation is internal (private) code in the class, with only a few real public entry points. So it would be useful to package this as an npm package, and provide callbacks for writing to the database.

mvl22 · 2mo ago
camadamsmd

At work I am porting a Laravel App to Nextjs and Nestjs. The existing app cancelled the subscription when the payment failed. The customer had to start a new subscription in this case. Stripe dashboard you can't remove a subscription for legal and historical accuracy reasons. So Theos solution here is a bit flawed - the part where he gets the customers id from the webhook and fetches all their subscriptions limiting to 1. What if we fetch the cancelled subscription? Then you'd sync you local db to the wrong sub. You would need to get the subscription id from the webhook. Not sure how to do that at the moment for all the webhooks that Theo is listening to.

camadamsmd · 1y ago
jaisal1024

I am not sure if this is a new feature from Stripe, but we solved the issue of managing multiple price IDs across different environments using price lookup keys which let you simply set the same lookup key across environments https://docs.stripe.com/products-prices/manage-prices#lookup-keys

jaisal1024 · 1y ago
Structured data for AI agents

Repository: t3dotgg/stripe-recommendations. Description: How to implement Stripe without going mad Stars: 6464, Forks: 307. License: MIT. Topics: fullstack, nextjs, node, payments, stripe, typescript. Open PRs: 9, open issues: 21. Last activity: 1y ago. Community health: 42%. Top contributors: t3dotgg, sagiereder, tavux-ratkaisut.