From f82173ee07b99bd2b59d5f13b2224deb056f7af8 Mon Sep 17 00:00:00 2001 From: adueck Date: Wed, 12 Oct 2022 23:58:46 +0500 Subject: [PATCH] m --- account/src/routers/payment-router.ts | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/account/src/routers/payment-router.ts b/account/src/routers/payment-router.ts index f4a3606..0cd0ea1 100644 --- a/account/src/routers/payment-router.ts +++ b/account/src/routers/payment-router.ts @@ -22,24 +22,24 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => { console.log("with key", env.stripeSecretKey); try { const prices = await stripe.prices.list({ - lookup_keys: [req.body.lookup_key], - expand: ['data.product'], + lookup_keys: [req.body.lookup_key], + expand: ['data.product'], }); console.log(prices); const session = await stripe.checkout.sessions.create({ - billing_address_collection: 'auto', - line_items: [ - { - price: prices.data[0].id, - // For metered billing, do not pass quantity - quantity: 1, - - }, - ], - mode: 'subscription', - // TODO ADD URLS - success_url: `/`, - cancel_url: `/`, + billing_address_collection: 'auto', + line_items: [ + { + price: prices.data[0].id, + // For metered billing, do not pass quantity + quantity: 1, + + }, + ], + mode: 'subscription', + // TODO ADD URLS + success_url: `https://account.lingdocs.com/`, + cancel_url: `https://account.lingdocs.com/`, }); if (!session.url) { return next("error creating session url");