Skip to content

Add store order management and Stripe webhook#262

Open
gregv wants to merge 2 commits intodevelopfrom
feature/store-order-management
Open

Add store order management and Stripe webhook#262
gregv wants to merge 2 commits intodevelopfrom
feature/store-order-management

Conversation

@gregv
Copy link
Contributor

@gregv gregv commented Mar 19, 2026

Summary

  • Stripe webhook (/api/store/webhook) processes checkout.session.completed events, extracts line items/shipping/customer details, and POSTs order data to the backend API
  • Success page now fetches and displays order details (items table, total, customer info) by Stripe session ID, with a 2s retry for webhook race conditions
  • Admin store page (/admin/store) with sortable/filterable order table, detail dialog for managing status, tracking numbers, carrier, and admin notes (hidden from nav until ready to launch)
  • Fix: Replace deprecated stripe.redirectToCheckout with session.url redirect
  • Fix: Cart not clearing after Stripe checkout due to localStorage race condition in ShoppingCartContext
  • Improve: FloatingNavigation keyboard shortcuts now work globally (no need to open menu first), added ? key for a discoverable help modal, visual flash feedback on section navigation, mobile-aware shortcut handling

Backend (separate repo: backend-ohack.dev)

Companion backend changes are needed (not in this PR):

  • api/store/store_service.py — Firestore CRUD, Resend emails (confirmation + status updates), Slack notifications to #store-orders
  • api/store/store_views.py — Flask blueprint with webhook-auth and admin-auth endpoints
  • Blueprint registered in api/__init__.py

New env vars needed

  • STRIPE_WEBHOOK_SECRET — Stripe webhook signing secret (frontend only, server-side)
  • STORE_WEBHOOK_SECRET — shared secret between frontend webhook and backend API (both repos)

Test plan

  • Run stripe listen --forward-to localhost:3000/api/store/webhook and complete a test purchase
  • Verify order appears in Firestore store_orders collection
  • Verify confirmation email sent to customer and notification to questions@ohack.org
  • Verify success page shows order details (items, total, customer name)
  • Verify cart clears after successful checkout
  • Navigate to /admin/store, verify orders display with correct status chips
  • Test status update flow: change status → verify status email sent to customer
  • Test tracking number + carrier update
  • On /hack/[event_id], press ? to verify keyboard shortcut help modal
  • Press letter keys (A, P, T, etc.) to verify global section navigation
  • Verify shortcuts don't fire when typing in input fields

🤖 Generated with Claude Code

…ents

- Stripe webhook (pages/api/store/webhook.js) handles checkout.session.completed,
  extracts line items/shipping/customer details, and POSTs to backend
- Success page fetches order details by session ID with retry for webhook race condition
- Admin store page with sortable/filterable order table, detail dialog with
  status/tracking/notes management (hidden from nav until ready)
- Fix deprecated stripe.redirectToCheckout → use session.url redirect
- Fix cart not clearing after checkout (localStorage race condition)
- Improve FloatingNavigation: global keyboard shortcuts (work without opening menu),
  discoverable ? help modal, visual flash feedback on navigation, mobile-aware

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontend-ohack-dev Ready Ready Preview Mar 19, 2026 6:31am

Request Review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant