Stripe Integration Guide
Complete checklist for development team
Setup Phases
Backend Functions (Already Created ✅)
stripeCheckout.jsCreate checkout sessions for all purchases
stripeWebhook.jsHandle payment events & update entities
stripeConnectOnboard.jsPromoter Stripe Connect onboarding
stripeRefund.jsProcess refund requests
stripeGetBalance.jsCheck balances & payouts
Required Secrets
sk_test_... or sk_live_...whsec_...Webhook Events to Configure
| Event | Action Taken |
|---|---|
checkout.session.completed | Create Registration/Ticket/Camping records |
payment_intent.succeeded | Confirm payment success |
payment_intent.payment_failed | Mark transaction as failed |
charge.refunded | Update refund status |
account.updated | Update promoter Connect status |
transfer.created | Mark payout as initiated |
transfer.reversed | Handle reversed payout |
payout.paid | Mark payout as completed, notify promoter |
payout.failed | Mark payout as failed, notify promoter urgently |
customer.subscription.created | Activate membership, update user |
customer.subscription.updated | Update membership status/tier |
customer.subscription.deleted | Downgrade to free tier |
invoice.payment_succeeded | Handle renewal, update dates |
invoice.payment_failed | Mark past_due, notify user urgently |
Already Built Features
- Free (default)
- Basic ($29/yr)
- Premium ($75/yr)
- Promoter (configurable)
- Race Registrations
- Event Tickets
- Camping Reservations
- Merchandise/Products
- Early bird pricing
- Late fee pricing
- Regular pricing
- Auto-calculates based on dates
- Premium: registration_open_date
- Basic: basic_access_date
- Free: Countdown timer
- Stripe: 2.9% + $0.30
- WHA Platform: 5% + $1.00
- Total: 7.9% + $1.30
- Configurable via WHAFeeConfig
Missing Features (Build Later)
Sales Tax Calculation
Need to add sales_tax_enabled field to Event entity & integrate Stripe Tax or TaxJar API
Recurring Subscriptions
Auto-renewing memberships via Stripe Billing (currently one-time payments)
Stripe Promotion Codes
Native discount codes in Stripe checkout (currently custom implementation)
Stripe Test Cards
4242 4242 4242 4242✅ Successful payment4000 0000 0000 0002❌ Declined4000 0000 0000 9995❌ Insufficient funds4000 0025 0000 3155🔐 Requires 3D SecureAll test cards: Use any future expiry (12/34), any CVC (123), any ZIP (12345)
View all test cardsFee Structure
Example Calculation:
Frontend Files to Update
components/cart/CartCheckout.jsxLine ~48: Replace simulation with stripeCheckout function call
components/checkout/MembershipCheckout.jsxLine ~131: Replace simulation with stripeCheckout function call
pages/StripeOnboarding.jsxLine ~52: Replace simulation with stripeConnectOnboard function call
pages/Refunds.jsxLines 128-264: Replace simulated refunds with stripeRefund function call
pages/CheckoutSuccess.jsxCreate success page for post-checkout redirect
pages/CheckoutCancel.jsxCreate cancel page for abandoned checkouts
