accounts/**
This commit is contained in:
parent
b4eb863dc9
commit
4ed19f6535
|
@ -5,7 +5,8 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
|
|||
|
||||
export default async (req, res) => {
|
||||
try {
|
||||
const stripeCustomerId = "cus_J09ECKPgFEPXoq";
|
||||
const authorization = req.headers.authorization; // authorization header from request
|
||||
const { stripeCustomerId } = await got("http://accounts:3000/user", { headers: { authorization } });
|
||||
const stripeCustomer = await stripe.customers.retrieve(stripeCustomerId);
|
||||
const { subscriptions } = stripeCustomer;
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
|
|||
|
||||
export default async (req, res) => {
|
||||
try {
|
||||
const stripeCustomerId = "cus_J09ECKPgFEPXoq";
|
||||
const authorization = req.headers.authorization; // authorization header from request
|
||||
const { stripeCustomerId } = await got("http://accounts:3000/user", { headers: { authorization } });
|
||||
const session = await stripe.billingPortal.sessions.create({
|
||||
customer: stripeCustomerId,
|
||||
return_url: `${process.env.SKYNET_DASHBOARD_URL}/payments`,
|
||||
|
|
Reference in New Issue