From 8c5fe25c2bdb3333b7855033e09476c442fdf688 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Thu, 27 Aug 2026 20:42:17 -0400 Subject: [PATCH] fix email trigger --- src/routes/api/the-nook/webhooks/stripe.ts | 6 +++--- src/routes/nook/checkout.tsx | 21 +++++++++++++++------ src/routes/nook/index.tsx | 18 +++++++++++++----- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/routes/api/the-nook/webhooks/stripe.ts b/src/routes/api/the-nook/webhooks/stripe.ts index 01b5d6e..e09929b 100644 --- a/src/routes/api/the-nook/webhooks/stripe.ts +++ b/src/routes/api/the-nook/webhooks/stripe.ts @@ -20,7 +20,7 @@ import { createHmac, timingSafeEqual } from "node:crypto"; interface StripeSessionCompleted { id: string; type: string; - customer_details?: { email?: string }; + data?: { object?: { id?: string; customer_details?: { email?: string } } }; } function verifyStripeSignature(rawBody: string, signatureHeader: string): boolean { @@ -94,8 +94,8 @@ export async function POST(event: APIEvent) { return json({ received: true }); } - const sessionId = body.id; - const email = body.customer_details?.email; + const sessionId = body.data?.object?.id; + const email = body.data?.object?.customer_details?.email; if (!sessionId || !email) { console.error("checkout.session.completed missing id or email:", rawBody); return json({ received: true }); diff --git a/src/routes/nook/checkout.tsx b/src/routes/nook/checkout.tsx index 753a5ca..7aa5c39 100644 --- a/src/routes/nook/checkout.tsx +++ b/src/routes/nook/checkout.tsx @@ -66,18 +66,27 @@ export default function NookCheckout() { <>
-

The Nook

-

Lifetime License — 3 devices

- -
- $10 one-time +
+
+ $10 one-time +
+
+ $15 +
+

+ + Beta pricing — 33% off + +

  • • Activate on up to 3 of your own Macs
  • • No subscription, ever
  • diff --git a/src/routes/nook/index.tsx b/src/routes/nook/index.tsx index 8996beb..58927e2 100644 --- a/src/routes/nook/index.tsx +++ b/src/routes/nook/index.tsx @@ -102,9 +102,16 @@ export default function NookLanding() { Buy
-

- $10 one-time · 3 devices · 14-day free trial -

+
+ + Beta pricing · 33% off + +

+ $15{" "} + $10 one-time · 3 devices · + 14-day free trial +

+
@@ -152,11 +159,12 @@ export default function NookLanding() { class="text-subtext1 my-auto text-sm underline decoration-dotted hover:opacity-80" href="/checkout" > - Buy a license → $10 + Buy a license → $10 $15

- One license covers up to 3 of your own Macs. + Beta pricing — full price will be $15. One license covers up to 3 of + your own Macs.