payments
This commit is contained in:
parent
f82432f58b
commit
b53337c76c
|
@ -13,9 +13,13 @@ const getStripeCustomer = async (user, authorization) => {
|
||||||
|
|
||||||
const customer = stripe.customers.create();
|
const customer = stripe.customers.create();
|
||||||
|
|
||||||
|
console.log("created");
|
||||||
|
|
||||||
// update user instance and include the customer id once created
|
// update user instance and include the customer id once created
|
||||||
await got.put(`http://accounts:3000/user`, { headers: { authorization }, json: { stripeCustomerId: customer.id } });
|
await got.put(`http://accounts:3000/user`, { headers: { authorization }, json: { stripeCustomerId: customer.id } });
|
||||||
|
|
||||||
|
console.log("user updated");
|
||||||
|
|
||||||
return customer;
|
return customer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -40,8 +44,6 @@ export default async (req, res) => {
|
||||||
return res.status(StatusCodes.BAD_REQUEST).json({ error: { message } });
|
return res.status(StatusCodes.BAD_REQUEST).json({ error: { message } });
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("ok");
|
|
||||||
|
|
||||||
const customer = await getStripeCustomer(user, authorization);
|
const customer = await getStripeCustomer(user, authorization);
|
||||||
console.log(customer);
|
console.log(customer);
|
||||||
const session = await stripe.checkout.sessions.create({
|
const session = await stripe.checkout.sessions.create({
|
||||||
|
|
Reference in New Issue