From f12449c66f8277ec49feeddc2962a4f42b4ce9d4 Mon Sep 17 00:00:00 2001 From: alex Date: Mon, 19 Feb 2024 23:27:22 +0100 Subject: [PATCH] demo days --- src/controllers/paymentController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/paymentController.ts b/src/controllers/paymentController.ts index 740d3ff..7de2ed3 100644 --- a/src/controllers/paymentController.ts +++ b/src/controllers/paymentController.ts @@ -118,7 +118,11 @@ export async function CreateCheckoutSession(priceId: string, userId: string) { quantity: 1, }, ], + billing_address_collection: "required", mode: "subscription", + subscription_data: { + trial_period_days: 7, + }, success_url: `${DASHBOARD_URL}/checkout/success/{CHECKOUT_SESSION_ID}`, cancel_url: `${DASHBOARD_URL}/checkout/canceled/{CHECKOUT_SESSION_ID}`, metadata: { @@ -300,7 +304,7 @@ export async function StripeWebhook(req: Request, res: Response) { } } } else if (event.type === "checkout.session.expired") { - logger.info(`webhook checkout.session.expired: ${event.data.object}`); + logger.info(`webhook checkout.session.expired: ${event.data.object.id}`); } else { logger.warn(`Ignoring unknown event: ${event.type}`); }