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.

customer.id -> externalId

Kiran K18df5816f96f
diff --git a/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts b/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
index 5d3688397e..09e27b8438 100644
--- a/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
+++ b/apps/web/app/api/stripe/connect/webhook/checkout-session-completed.ts
@@ -127,7 +127,7 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
data: transformSaleEventData({
...saleData,
link,
- customerId: customer.id,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,
diff --git a/apps/web/app/api/stripe/connect/webhook/customer-created.ts b/apps/web/app/api/stripe/connect/webhook/customer-created.ts
index d85b485979..d9583b9d75 100644
--- a/apps/web/app/api/stripe/connect/webhook/customer-created.ts
+++ b/apps/web/app/api/stripe/connect/webhook/customer-created.ts
@@ -110,7 +110,7 @@ export async function customerCreated(event: Stripe.Event) {
data: transformLeadEventData({
...leadData,
link,
- customerId: customer.id,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,
diff --git a/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts b/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
index 7243c12ade..34dbb469f6 100644
--- a/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
+++ b/apps/web/app/api/stripe/connect/webhook/invoice-paid.ts
@@ -110,7 +110,7 @@ export async function invoicePaid(event: Stripe.Event) {
data: transformSaleEventData({
...saleData,
link,
- customerId: customer.id,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,
diff --git a/apps/web/app/api/track/customer/route.ts b/apps/web/app/api/track/customer/route.ts
index 8f7407980d..abfb50c0bd 100644
--- a/apps/web/app/api/track/customer/route.ts
+++ b/apps/web/app/api/track/customer/route.ts
@@ -58,7 +58,7 @@ export const POST = withWorkspaceEdge(
);
const response = trackCustomerResponseSchema.parse({
- customerId: externalId,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,
diff --git a/apps/web/app/api/track/lead/route.ts b/apps/web/app/api/track/lead/route.ts
index f17bb40d5f..ae90ad15a4 100644
--- a/apps/web/app/api/track/lead/route.ts
+++ b/apps/web/app/api/track/lead/route.ts
@@ -131,7 +131,7 @@ export const POST = withWorkspaceEdge(
...clickData,
link,
eventName,
- customerId: customer.id,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,
@@ -149,10 +149,10 @@ export const POST = withWorkspaceEdge(
...lead,
// for backwards compatibility – will remove soon
clickId: lead.click.id,
- customerId: lead.customer.id,
- customerName: lead.customer.name,
- customerEmail: lead.customer.email,
- customerAvatar: lead.customer.avatar,
+ customerId: customer.externalId,
+ customerName: customer.name,
+ customerEmail: customer.email,
+ customerAvatar: customer.avatar,
});
},
{
diff --git a/apps/web/app/api/track/sale/route.ts b/apps/web/app/api/track/sale/route.ts
index 720944052b..e9f6a53711 100644
--- a/apps/web/app/api/track/sale/route.ts
+++ b/apps/web/app/api/track/sale/route.ts
@@ -107,7 +107,7 @@ export const POST = withWorkspaceEdge(
invoiceId,
amount,
currency,
- customerId: customer.id,
+ customerId: customer.externalId,
customerName: customer.name,
customerEmail: customer.email,
customerAvatar: customer.avatar,