Last 12 weeks · 0 commits
2 of 6 standards met
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.
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.
Repository: t3dotgg/stripe-recommendations. Description: How to implement Stripe without going mad Stars: 6407, Forks: 302. License: MIT. Topics: fullstack, nextjs, node, payments, stripe, typescript. Open PRs: 8, open issues: 22. Last activity: 1y ago. Community health: 42%. Top contributors: t3dotgg, sagiereder, tavux-ratkaisut.