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.

rename dubCustomerId

Kiran K2c3c3c1e8940
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 8a5d02333e..cfc36b1d22 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?.dubCustomerId || null;
+ const externalId = charge.metadata?.userId;
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 da668abdb2..10273f0946 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.dubCustomerId || null;
- const clickId = stripeCustomer.metadata.dubClickId || null;
+ const externalId = stripeCustomer.metadata?.userId;
+ const clickId = stripeCustomer.metadata?.dubClickId;
// The client app should always send dubClickId via metadata
if (!clickId) {