Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Ignore completed checkout sessions for one-time payments (#878)
Luke Vellaf7d28d86a2e5
diff --git a/apps/web/src/pages/api/stripe/webhook.ts b/apps/web/src/pages/api/stripe/webhook.tsindex d1be6bf43..deb71a8c8 100644--- a/apps/web/src/pages/api/stripe/webhook.ts+++ b/apps/web/src/pages/api/stripe/webhook.ts@@ -52,6 +52,12 @@ export default async function handler(switch (event.type) {case "checkout.session.completed":const checkoutSession = event.data.object as Stripe.Checkout.Session;++ if (checkoutSession.subscription === null) {+ // This is a one-time payment (probably for Rallly Self-Hosted)+ break;+ }+const { userId } = metadataSchema.parse(checkoutSession.metadata);if (!userId) {