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.

final bug fixes

Steven Teydb09f4869c53
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 4bb0515bad..988f986d77 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
@@ -39,7 +39,10 @@ export async function checkoutSessionCompleted(event: Stripe.Event) {
const stripeCustomerName = charge.customer_details?.name;
const stripeCustomerEmail = charge.customer_details?.email;
const invoiceId = charge.invoice as string;
- const promotionCodeId = charge.discounts?.[0]?.promotion_code as string;
+ const promotionCodeId = charge.discounts?.[0]?.promotion_code as
+ | string
+ | null
+ | undefined;
let customer: Customer | null = null;
let existingCustomer: Customer | null = null;
@@ -596,6 +599,8 @@ async function attributeViaPromoCode({
metadata: "",
};
+ await recordLead(leadEvent);
+
return {
linkId,
customer,