From f163e4638b4f76c500b53af3631b3e29c3beb25e Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Tue, 22 Apr 2025 10:10:00 +0530 Subject: [PATCH] fix: Convert an error in webhook to info (#20806) * Convert error to info * Convert error to info --- .../features/ee/billing/api/webhook/_invoice.paid.org.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/features/ee/billing/api/webhook/_invoice.paid.org.ts b/packages/features/ee/billing/api/webhook/_invoice.paid.org.ts index 9012d15fcd..a79fa0b901 100644 --- a/packages/features/ee/billing/api/webhook/_invoice.paid.org.ts +++ b/packages/features/ee/billing/api/webhook/_invoice.paid.org.ts @@ -49,14 +49,13 @@ const handler = async (data: SWHMap["invoice.paid"]["data"]) => { ); if (!organizationOnboarding) { - logger.error( - `NonRecoverableError: No onboarding record found for stripe customer id: ${invoice.customer}.` + // Invoice Paid is received for all organizations, even those that were created before Organization Onboarding was introduced. + logger.info( + `No onboarding record found for stripe customer id: ${invoice.customer}, Organization created before Organization Onboarding was introduced, so ignoring the webhook` ); - // Don't throw as we don't want to retry. return { - success: false, - error: `No onboarding record found for stripe customer id: ${invoice.customer}.`, + success: true, }; }