-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: webhooks-based approach #16
Conversation
@thorwebdev, is there any chance you'd be able to have a quick look over this? Is this an improvement in design? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall, good stuff! \o/
Regarding the usage of Database webhooks to create stripe customer objects. Definitely a valid approach, but alternatively you might want to consider to create the Stripe customer object on the fly the first time it is needed.
Excellent suggestion! I've gone full circle and reverted webhooks for functionality relating to the PTAL, @thorwebdev. |
I think there'd be fewer moving parts if |
I'll go ahead and merge for now. We can evolve these ideas later. |
Sorry for the delay. Yes, LGTM 👍 just added one note above regarding using |
Previously, newly created OAuth users weren't registered as Stripe customers, so their subscriptions couldn't be managed.
This change adds a webhook endpoint for Stripe. When a user's subscription is renewed or cancelled,
/api/subscription
is called, making a corresponding change to the status of the subscription in thecustomers
table in Supabase.This PR also includes other minor cleanups, fixes and tweaks.
#19 is a prerequisite for this PR.