Skip to content

Build /register + Stripe Checkout + webhook #4

Description

@quinn-dougherty

Description

Pay-what-you-can registration at /register, hosted Stripe Checkout, webhook that triggers Discord invite issuance. Full spec in PLAYBOOK.md §3.3, §4.

Flow

  1. /register form: name, email, optional Discord username, amount (min $1; suggest $10/$25/$50/custom), CoC checkbox.
  2. POST /api/checkout server action:
    • Validate email + amount.
    • Pre-insert registrants row in pending state with session id.
    • stripe.checkout.sessions.create({ mode: 'payment', line_items: [custom_amount], success_url, cancel_url, customer_email, metadata: { registrant_intent_id } }).
  3. POST /api/stripe/webhook:
    • Verify signature with STRIPE_WEBHOOK_SECRET.
    • checkout.session.completed → mark paid, enqueue Discord invite generation (see Discord bot issue).
    • payment_intent.payment_failed → mark failed.
    • Idempotent via unique index on stripe_session_id.
  4. Receipt email with personal single-use Discord invite link.

Env vars (via vercel env add)

  • STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET.

Policy

  • Refunds: manual via Stripe dashboard; document in /faq. Full refund if requested ≥7 days pre-event, none after.
  • Sales tax: confirm with accountant before opening registration.

Dependencies

  • Data model / registrants table.
  • Discord invite plumbing (new bot issue).
  • Email provider (new email issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions