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.

fix the metadata

Kiran K4f29c9578b9a
diff --git a/apps/web/app/api/campaigns/webhooks/stripe/route.ts b/apps/web/app/api/campaigns/webhooks/stripe/route.ts
index 5f5fd8d8a3..c14ff55878 100644
--- a/apps/web/app/api/campaigns/webhooks/stripe/route.ts
+++ b/apps/web/app/api/campaigns/webhooks/stripe/route.ts
@@ -1,5 +1,6 @@
import { stripe } from "@/lib/stripe";
import { getClickEvent, recordConversion } from "@/lib/tinybird";
+import { nanoid } from "@dub/utils";
import type Stripe from "stripe";
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
@@ -79,10 +80,11 @@ async function handleChargeSucceeded(event: Stripe.Event) {
await recordConversion({
...clickEvent.data[0],
+ event_id: nanoid(16),
+ timestamp: new Date(Date.now()).toISOString(),
event_name: "",
event_type: "sale",
- event_metadata: "",
customer_id: customerId,
- timestamp: new Date(Date.now()).toISOString(),
+ metadata: "",
});
}