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.

Update customer-created.ts

Steven Teyaf4cb9e5ff4f
diff --git a/apps/web/app/api/stripe/integration/webhook/customer-created.ts b/apps/web/app/api/stripe/integration/webhook/customer-created.ts
index 59c635bd6b..6dd6c17a1b 100644
--- a/apps/web/app/api/stripe/integration/webhook/customer-created.ts
+++ b/apps/web/app/api/stripe/integration/webhook/customer-created.ts
@@ -54,14 +54,13 @@ export async function customerCreated(event: Stripe.Event) {
let customer: Customer;
if (customerFound) {
- // if customer exists, update it
+ // if customer exists (created via /track/lead)
+ // update it with the Stripe customer ID (for future reference by invoice.paid)
customer = await prisma.customer.update({
where: {
id: customerFound.id,
},
data: {
- name: stripeCustomer.name,
- email: stripeCustomer.email,
stripeCustomerId: stripeCustomer.id,
projectConnectId: stripeAccountId,
},