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.

wip

Kiran Kb9f0cebd504d
diff --git a/apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts b/apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts
index 39dc820ded..9717bbd01e 100644
--- a/apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts
+++ b/apps/web/app/(ee)/api/stripe/integration/webhook/checkout-session-completed.ts
@@ -339,9 +339,7 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
invoiceId,
currency: saleData.currency,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});
diff --git a/apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts b/apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts
index 360c79f4da..ab7fb22597 100644
--- a/apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts
+++ b/apps/web/app/(ee)/api/stripe/integration/webhook/invoice-paid.ts
@@ -190,9 +190,7 @@ export async function invoicePaid(event: Stripe.Event) {
invoiceId,
currency: saleData.currency,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});
diff --git a/apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts b/apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts
index 7bf47157a6..aefdba6627 100644
--- a/apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts
+++ b/apps/web/app/(ee)/api/stripe/integration/webhook/utils.ts
@@ -108,9 +108,7 @@ export async function createNewCustomer(event: Stripe.Event) {
customerId: customer.id,
quantity: 1,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});
}
diff --git a/apps/web/app/(ee)/api/track/lead/route.ts b/apps/web/app/(ee)/api/track/lead/route.ts
index 6c97578c83..085fb5a017 100644
--- a/apps/web/app/(ee)/api/track/lead/route.ts
+++ b/apps/web/app/(ee)/api/track/lead/route.ts
@@ -253,9 +253,7 @@ export const POST = withWorkspace(
customerId: customer.id,
quantity: eventQuantity ?? 1,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});
}
diff --git a/apps/web/app/(ee)/api/track/sale/route.ts b/apps/web/app/(ee)/api/track/sale/route.ts
index b8a2ac2d2c..f4acc69b15 100644
--- a/apps/web/app/(ee)/api/track/sale/route.ts
+++ b/apps/web/app/(ee)/api/track/sale/route.ts
@@ -226,9 +226,7 @@ export const POST = withWorkspace(
invoiceId,
currency,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});
diff --git a/apps/web/lib/actions/partners/create-commission.ts b/apps/web/lib/actions/partners/create-commission.ts
index 2b8ee30e6b..955a308a07 100644
--- a/apps/web/lib/actions/partners/create-commission.ts
+++ b/apps/web/lib/actions/partners/create-commission.ts
@@ -181,6 +181,9 @@ export const createCommissionAction = authActionClient
quantity: 1,
createdAt: finalLeadEventDate,
user,
+ context: {
+ customer,
+ },
}),
]);
}
@@ -217,6 +220,9 @@ export const createCommissionAction = authActionClient
currency: "usd",
createdAt: saleDate,
user,
+ context: {
+ customer,
+ },
}),
]);
}
diff --git a/apps/web/lib/integrations/shopify/create-sale.ts b/apps/web/lib/integrations/shopify/create-sale.ts
index ef9aece567..fd6cecf8f9 100644
--- a/apps/web/lib/integrations/shopify/create-sale.ts
+++ b/apps/web/lib/integrations/shopify/create-sale.ts
@@ -138,9 +138,7 @@ export async function createShopifySale({
invoiceId: saleData.invoice_id,
currency: saleData.currency,
context: {
- customer: {
- country: customer.country,
- },
+ customer,
},
});