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.

revert to dubCustomerId and dubClickId

Steven Teycbe5566fa59f
diff --git a/apps/web/app/api/campaigns/webhooks/stripe/checkout-session-completed.ts b/apps/web/app/api/campaigns/webhooks/stripe/checkout-session-completed.ts
index cfc36b1d22..4695671f03 100644
--- a/apps/web/app/api/campaigns/webhooks/stripe/checkout-session-completed.ts
+++ b/apps/web/app/api/campaigns/webhooks/stripe/checkout-session-completed.ts
@@ -7,7 +7,7 @@ import type Stripe from "stripe";
// Handle event "checkout.session.completed"
export async function checkoutSessionCompleted(event: Stripe.Event) {
const charge = event.data.object as Stripe.Checkout.Session;
- const externalId = charge.metadata?.userId;
+ const externalId = charge.metadata?.dubCustomerId;
const stripeAccountId = event.account as string;
const stripeCustomerId = charge.customer as string;
const invoiceId = charge.invoice as string;
diff --git a/apps/web/app/api/campaigns/webhooks/stripe/customer-created.ts b/apps/web/app/api/campaigns/webhooks/stripe/customer-created.ts
index 2bba91b6a3..85be9135af 100644
--- a/apps/web/app/api/campaigns/webhooks/stripe/customer-created.ts
+++ b/apps/web/app/api/campaigns/webhooks/stripe/customer-created.ts
@@ -8,8 +8,8 @@ import type Stripe from "stripe";
export async function customerCreated(event: Stripe.Event) {
const stripeCustomer = event.data.object as Stripe.Customer;
const stripeAccountId = event.account as string;
- const externalId = stripeCustomer.metadata?.userId;
- const clickId = stripeCustomer.metadata?.dclid;
+ const externalId = stripeCustomer.metadata?.dubCustomerId;
+ const clickId = stripeCustomer.metadata?.dubClickId;
// The client app should always send dclid via metadata
if (!clickId) {