File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
apps/sim/lib/billing/webhooks Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { createLogger } from '@sim/logger'
44import { eq } from 'drizzle-orm'
55import type Stripe from 'stripe'
66import { getEmailSubject , renderAbandonedCheckoutEmail } from '@/components/emails'
7- import { hasPaidSubscription } from '@/lib/billing/core/subscription'
7+ import { isProPlan } from '@/lib/billing/core/subscription'
88import { sendEmail } from '@/lib/messaging/email/mailer'
99import { getPersonalEmailFrom } from '@/lib/messaging/email/utils'
1010
@@ -38,8 +38,8 @@ export async function handleAbandonedCheckout(event: Stripe.Event): Promise<void
3838 return
3939 }
4040
41- // Skip if the user has since completed a subscription (first session expired after successful second)
42- const alreadySubscribed = await hasPaidSubscription ( userData . id )
41+ // Skip if the user already has a paid plan (direct or via org) — covers session expiring after a successful upgrade
42+ const alreadySubscribed = await isProPlan ( userData . id )
4343 if ( alreadySubscribed ) return
4444
4545 const { from, replyTo } = getPersonalEmailFrom ( )
You can’t perform that action at this time.
0 commit comments