diff --git a/packages/features/ee/billing/api/webhook/__handler.test.ts b/packages/features/ee/billing/api/webhook/__handler.test.ts index 598db684c5..c2b151f2a6 100644 --- a/packages/features/ee/billing/api/webhook/__handler.test.ts +++ b/packages/features/ee/billing/api/webhook/__handler.test.ts @@ -19,11 +19,11 @@ vi.mock("@calcom/app-store/stripepayment/lib/server", () => ({ }, })); -const STRIPE_WEBHOOK_SECRET = "whsec_test_secret"; +const STRIPE_WEBHOOK_SECRET_BILLING = "whsec_test_secret"; describe("stripeWebhookHandler", () => { beforeEach(() => { - vi.stubEnv("STRIPE_WEBHOOK_SECRET", STRIPE_WEBHOOK_SECRET); + vi.stubEnv("STRIPE_WEBHOOK_SECRET_BILLING", STRIPE_WEBHOOK_SECRET_BILLING); }); const mockRequest = (headers: Record, body: string): NextApiRequest => @@ -41,8 +41,8 @@ describe("stripeWebhookHandler", () => { await expect(handler(req)).rejects.toThrow(new HttpCode(400, "Missing stripe-signature")); }); - it("should throw an error if STRIPE_WEBHOOK_SECRET is missing", async () => { - vi.stubEnv("STRIPE_WEBHOOK_SECRET", ""); + it("should throw an error if STRIPE_WEBHOOK_SECRET_BILLING is missing", async () => { + vi.stubEnv("STRIPE_WEBHOOK_SECRET_BILLING", ""); const { req } = createMocks({ method: "POST", headers: { diff --git a/packages/features/ee/billing/api/webhook/__handler.ts b/packages/features/ee/billing/api/webhook/__handler.ts index 97a8718519..b4f21aeb85 100644 --- a/packages/features/ee/billing/api/webhook/__handler.ts +++ b/packages/features/ee/billing/api/webhook/__handler.ts @@ -42,7 +42,7 @@ export class HttpCode extends HttpError { * ``` */ export const stripeWebhookHandler = (handlers: SWHandlers) => async (req: NextApiRequest) => { - const STRIPE_WEBHOOK_SECRET = process.env.STRIPE_WEBHOOK_SECRET; + const STRIPE_WEBHOOK_SECRET = process.env.STRIPE_WEBHOOK_SECRET_BILLING; const sig = req.headers["stripe-signature"]; if (!sig) throw new HttpCode(400, "Missing stripe-signature"); if (!STRIPE_WEBHOOK_SECRET) throw new HttpCode(500, "Missing STRIPE_WEBHOOK_SECRET"); diff --git a/turbo.json b/turbo.json index 430d6f0814..83feb1792d 100644 --- a/turbo.json +++ b/turbo.json @@ -407,6 +407,7 @@ "STRIPE_PRODUCT_ID_STARTER", "STRIPE_WEBHOOK_SECRET", "STRIPE_WEBHOOK_SECRET_APPS", + "STRIPE_WEBHOOK_SECRET_BILLING", "TANDEM_BASE_URL", "TANDEM_CLIENT_ID", "TANDEM_CLIENT_SECRET",