Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update charge-succeeded.ts

Kiran Kec50f9f4ba34
diff --git a/apps/web/app/api/stripe/webhook/charge-succeeded.ts b/apps/web/app/api/stripe/webhook/charge-succeeded.ts
index c2abe344cc..3f4440e772 100644
--- a/apps/web/app/api/stripe/webhook/charge-succeeded.ts
+++ b/apps/web/app/api/stripe/webhook/charge-succeeded.ts
@@ -35,6 +35,11 @@ export async function chargeSucceeded(event: Stripe.Event) {
return;
}
+ if (invoice.status === "completed") {
+ console.log("Invoice already completed, skipping...");
+ return;
+ }
+
for (const payout of invoice.payouts) {
const transfer = await stripe.transfers.create({
amount: payout.amount,