From f681213114bb245c66821aa6c8538c523bc986d3 Mon Sep 17 00:00:00 2001 From: adueck Date: Sat, 15 Oct 2022 09:34:19 +0500 Subject: [PATCH] n --- account/src/routers/payment-router.ts | 7 ++++++- account/views/user.ejs | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/account/src/routers/payment-router.ts b/account/src/routers/payment-router.ts index 4c178f0..1a24ffb 100644 --- a/account/src/routers/payment-router.ts +++ b/account/src/routers/payment-router.ts @@ -81,7 +81,7 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => { } try { const prices = await stripe.prices.list({ - lookup_keys: [req.body.lookup_key], + lookup_keys: [req.body.productId], expand: ['data.product'], }); const session = await stripe.checkout.sessions.create({ @@ -92,6 +92,11 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => { // For metered billing, do not pass quantity quantity: 1, }, + { + price: prices.data[1].id, + // For metered billing, do not pass quantity + quantity: 1, + }, ], subscription_data: { metadata: { diff --git a/account/views/user.ejs b/account/views/user.ejs index f1c76b5..f5809ed 100644 --- a/account/views/user.ejs +++ b/account/views/user.ejs @@ -63,13 +63,13 @@ <% if (user.tester) { %>

Upgrade to Student account for Wordlist features

- - + +
-
+ <% } %> <% } %> <% if (user.tester && user.level === "student") { %>