Skip to content

Commit

Permalink
Update customer-created.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Jan 16, 2025
1 parent ffb1cb3 commit af4cb9e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit af4cb9e

Please sign in to comment.