2
0

⬆️ Upgrade dependencies

This commit is contained in:
Baptiste Arnaud
2022-11-21 19:08:14 +01:00
parent b29f7325ad
commit 34cfd1db30
35 changed files with 674 additions and 739 deletions

View File

@ -27,7 +27,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const session = await stripe.billingPortal.sessions.create({
customer: workspace.stripeId,

View File

@ -22,7 +22,7 @@ const createCheckoutSession = async (userId: string) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const claimableCustomPlan = await prisma.claimableCustomPlan.findFirst({

View File

@ -27,7 +27,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const invoices = await stripe.invoices.list({
customer: workspace.stripeId,

View File

@ -46,7 +46,7 @@ const getSubscriptionDetails =
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const subscriptions = await stripe.subscriptions.list({
customer: workspace.stripeId,
@ -70,7 +70,7 @@ const createCheckoutSession = (req: NextApiRequest) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const {
email,
@ -118,7 +118,7 @@ const updateSubscription = async (req: NextApiRequest) => {
if (!process.env.STRIPE_SECRET_KEY)
throw Error('STRIPE_SECRET_KEY var is missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const { data } = await stripe.subscriptions.list({
customer: stripeId,
@ -203,7 +203,7 @@ const cancelSubscription =
})
if (!workspace?.stripeId) return forbidden(res)
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const existingSubscription = await stripe.subscriptions.list({
customer: workspace.stripeId,

View File

@ -10,7 +10,7 @@ import { Plan } from 'db'
if (!process.env.STRIPE_SECRET_KEY || !process.env.STRIPE_WEBHOOK_SECRET)
throw new Error('STRIPE_SECRET_KEY or STRIPE_WEBHOOK_SECRET missing')
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2022-11-15',
})
const cors = Cors({