From f82432f58b1f26beb574d3a77c2d5c33ac558a7b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Thu, 4 Mar 2021 14:48:17 +0100 Subject: [PATCH] payments --- .../dashboard/src/pages/api/stripe/createCheckoutSession.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js index 6801dd3a..6f8762db 100644 --- a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js +++ b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js @@ -34,14 +34,14 @@ export default async (req, res) => { const authorization = req.headers.authorization; // authorization header from request const user = await got("http://accounts:3000/user", { headers: { authorization } }).json(); - console.log(user); - if (isPaidTier(user.tier)) { const message = `Customer can have only one active subscription at a time, use Stripe Customer Portal to manage active subscription`; return res.status(StatusCodes.BAD_REQUEST).json({ error: { message } }); } + console.log("ok"); + const customer = await getStripeCustomer(user, authorization); console.log(customer); const session = await stripe.checkout.sessions.create({