This commit is contained in:
Karol Wypchlo 2021-03-04 14:49:52 +01:00
parent f82432f58b
commit b53337c76c
1 changed files with 4 additions and 2 deletions

View File

@ -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({