diff --git a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js index 6f8762db..38255e59 100644 --- a/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js +++ b/packages/dashboard/src/pages/api/stripe/createCheckoutSession.js @@ -13,9 +13,13 @@ const getStripeCustomer = async (user, authorization) => { const customer = stripe.customers.create(); + console.log("created"); + // update user instance and include the customer id once created await got.put(`http://accounts:3000/user`, { headers: { authorization }, json: { stripeCustomerId: customer.id } }); + console.log("user updated"); + return customer; }; @@ -40,8 +44,6 @@ export default async (req, res) => { 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({