mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +02:00
🐛 Ignore completed checkout sessions for one-time payments (#878)
This commit is contained in:
parent
946e1828f4
commit
f7d28d86a2
1 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue