Skip to content

Add Stripe store flow for free and paid digital products#28

Merged
devandapaige merged 10 commits intomainfrom
cursor/stripe-store-integration-e67d
Apr 9, 2026
Merged

Add Stripe store flow for free and paid digital products#28
devandapaige merged 10 commits intomainfrom
cursor/stripe-store-integration-e67d

Conversation

@devandapaige
Copy link
Copy Markdown
Owner

@devandapaige devandapaige commented Apr 9, 2026

Summary

  • add a new /store storefront for digital products with a free and paid offer
  • integrate Stripe Checkout for paid product purchase flow
  • add free-claim API flow that unlocks download links and optionally syncs emails to Beehiiv
  • add a paid success/receipt page that verifies checkout session before exposing download links
  • wire global navigation to include the new Store page
  • document required environment variables for Stripe/Beehiiv setup
  • switch Next.js/Netlify config from static export assumptions to runtime-compatible mode so Stripe API routes deploy correctly
  • add Stripe webhook-driven paid fulfillment with transactional email delivery
  • add a lightweight paid download gate requiring both Stripe paid session verification and a short-lived signed token
  • add Stripe CLI local webhook testing docs in README and dedicated store runbook

What was added

  • store product catalog (src/lib/store/products.ts) and pricing formatter
  • Stripe server helper (src/lib/store/stripe.ts) and site URL helper (src/lib/store/site.ts)
  • Beehiiv sync helper (src/lib/store/beehiiv.ts)
  • transactional email helper (src/lib/store/email.ts) using Resend API
  • fulfillment orchestrator (src/lib/store/fulfillment.ts) for webhook side effects
  • signed paid-download token helper (src/lib/store/secureDownload.ts)
  • API routes:
    • POST /api/store/checkout
    • POST /api/store/free-claim
    • GET /api/store/checkout-session
    • GET /api/store/paid-download
    • POST /api/store/webhook
  • pages:
    • /store
    • /store/success
  • docs:
    • README section: Stripe webhook local testing (small CLI flow)
    • src/docs/store-webhook-testing.md
  • navigation links in header and footer

Config required

  • NEXT_PUBLIC_SITE_URL
  • STRIPE_SECRET_KEY
  • STRIPE_WEBHOOK_SECRET
  • BEEHIIV_API_KEY (optional)
  • BEEHIIV_PUBLICATION_ID (optional)
  • RESEND_API_KEY (optional, for transactional delivery emails)
  • STORE_EMAIL_FROM (optional)
  • STORE_DOWNLOAD_TOKEN_SECRET (optional, falls back to STRIPE_WEBHOOK_SECRET)

Validation

  • npm run lint
  • npm run build

Notes

  • Free files remain public by URL (as requested).
  • Paid downloads now require:
    1. completed Stripe payment session
    2. valid short-lived signed token issued by checkout verification or fulfillment email link
  • Paid fulfillment (Beehiiv sync + transactional email) runs from Stripe webhook checkout.session.completed.
  • If transactional email is not configured, checkout and gated download still function.
Open in Web Open in Cursor 

Co-authored-by: Amanda Nelson <jobs@amanda-nelson.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for pythoness-programmer ready!

Name Link
🔨 Latest commit f8ea77d
🔍 Latest deploy log https://app.netlify.com/projects/pythoness-programmer/deploys/69d828acdf735c00080fbd34
😎 Deploy Preview https://deploy-preview-28--pythoness-programmer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@devandapaige devandapaige marked this pull request as ready for review April 9, 2026 22:40
@devandapaige devandapaige merged commit 4e6c287 into main Apr 9, 2026
6 checks passed
@devandapaige devandapaige deleted the cursor/stripe-store-integration-e67d branch April 9, 2026 22:40
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.

2 participants