diff --git a/account/src/routers/payment-router.ts b/account/src/routers/payment-router.ts index 626b211..727191c 100644 --- a/account/src/routers/payment-router.ts +++ b/account/src/routers/payment-router.ts @@ -85,14 +85,16 @@ paymentRouter.post("/create-checkout-session", async (req, res, next) => { billing_address_collection: 'auto', line_items: [ { - price, - quantity: 1, + price, + quantity: 1, }, ], subscription_data: { metadata: { userId: req.user.userId, startTime: Date.now(), + cycle: price === "price_1Lt0XdJnpCQCjf9pM9qqdyt6" + ? "monthly" : "yearly", }, }, mode: 'subscription', diff --git a/account/views/user.ejs b/account/views/user.ejs index 371ce24..6cd9250 100644 --- a/account/views/user.ejs +++ b/account/views/user.ejs @@ -65,20 +65,19 @@
Current subscription: <% if (user.subscription.metadata.cycle === "monthly") { %>$1/month<% } else { %>$10/year<% } %>
Downgrade your account to cancel your subscription
- + <% } %> <% if (user.email) { %>