The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update charge-failed.ts
Kiran K9b8313b4366a
diff --git a/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts b/apps/web/app/(ee)/api/stripe/webhook/charge-failed.tsindex dce73529fa..2251d03de8 100644--- a/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts+++ b/apps/web/app/(ee)/api/stripe/webhook/charge-failed.ts@@ -53,6 +53,18 @@ export async function chargeFailed(event: Stripe.Event) {},});+ // Reduce the payoutsUsage by the invoice amount since the charge failed+ await prisma.project.update({+ where: {+ id: invoice.workspaceId,+ },+ data: {+ payoutsUsage: {+ decrement: invoice.amount,+ },+ },+ });+const workspace = await prisma.project.findUniqueOrThrow({where: {id: invoice.workspaceId,