demo days

main
alex 2024-02-19 23:27:22 +01:00
parent efa9f46919
commit f12449c66f
1 changed files with 5 additions and 1 deletions

View File

@ -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}`);
}