Payments and Orders
The platform supports multiple checkout paths and routes payment behavior through both Next.js and Convex-backed configuration.
Active providers in the codebase
- Paystack
- Flutterwave
- Stripe
- free-ticket path
- crypto placeholder flow
Checkout entry point
The main Next.js checkout route is app/api/payments/checkout/route.ts.
Its current routing behavior is:
- explicit Paystack selection goes to Paystack
- explicit Flutterwave selection goes to Flutterwave
- explicit Stripe selection goes to Stripe
- otherwise
NGNdefaults to Paystack - non-
NGNdefaults to Stripe
Provider notes
Paystack
- Strong default for
NGN - Expects minor units
- Returns a hosted authorization URL
- Falls back to a mock success URL when the secret key is missing
Stripe
- Used for non-
NGNor explicit Stripe checkouts - Creates hosted checkout sessions directly from the API route
- Falls back to a mock success URL when the secret key is missing
Flutterwave
- Available as an alternate hosted checkout path
- Uses major units when creating the payment session
Provider configuration sources
Checkout reads from Convex payment settings first and then falls back to process environment values. This allows admin-managed provider metadata and per-provider credentials without hardcoding everything in the frontend.
Order lifecycle
At a high level:
- Attendee selects ticket(s)
- Checkout route initializes provider session
- Provider redirect completes
- Webhook or success handler reconciles order state
- Passes, emails, and post-purchase assets are generated
Related files
app/api/payments/checkout/route.tsapp/e/[slugOrId]/checkout/CheckoutContent.tsxconvex/orders.tsconvex/passes.tsconvex/actions.tsconvex/settings.ts
Operational cautions
- Amounts are stored in minor units in the web app layer.
- Provider expectations are not identical; Paystack and Stripe differ from Flutterwave on amount formatting.
- Missing provider secrets may intentionally degrade to mock success paths in development.