Skip to content

Commit

Permalink
fix: tweak to subscription update
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Jan 14, 2024
1 parent 9ed5b24 commit 519e24c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/routes/api/stripe/webhooks/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export const POST = async ({ request, locals }) => {

case "customer.subscription.updated":
const subscriptionUpdated = data.object as Stripe.Subscription
if (subscriptionUpdated.status !== "active" && subscriptionUpdated.status !== "canceled")
break

await upsertSubscription({
subscription: subscriptionUpdated.id,
id: subscriptionUpdated.metadata.user_id,
Expand Down

0 comments on commit 519e24c

Please sign in to comment.