Loading...
FastStaq uses a pluggable payment layer. Stripe is the default provider. This guide sets up Stripe end to end, from keys to products to the webhook.
In server/.env:
PAYMENT_PROVIDER=stripe
The client mirror NEXT_PUBLIC_PAYMENT_PROVIDER=stripe controls checkout copy and the success URL shape.
From the Stripe Dashboard (Developers -> API keys):
STRIPE_SECRET_KEY=sk_test_... # use sk_live_... in production
STRIPE_WEBHOOK_SECRET=whsec_... # from your webhook endpoint (see below)
Start in test mode while you build, then switch to live keys for launch.
In the Stripe Dashboard (Product catalog), create your products and copy each Price ID (it starts with price_...). FastStaq reads them from env:
# Single lifetime package for the sales site
STRIPE_PRICE_LIFETIME=price_...
FASTSTAQ_LIFETIME_PRICE_CENTS=29900
# Subscription tiers (if you sell plans)
STRIPE_PRICE_BASIC=price_...
STRIPE_PRICE_PRO=price_...
# Optional yearly variants enable the Monthly/Yearly toggle
STRIPE_PRICE_BASIC_YEARLY=price_...
STRIPE_PRICE_PRO_YEARLY=price_...
You can also manage plan price IDs from the admin panel at /admin/plans. The database price ID, when set, takes precedence.
Purchases only provision after Stripe confirms the payment via webhook. Set this up before going live: see Setting up Stripe webhooks (live). Locally you can use the Stripe CLI to forward events.
To auto-apply a discount to one-time/lifetime checkout:
SALE_ENABLED=true
STRIPE_SALE_COUPON_ID=your_coupon_id # a Coupon ID, or a promo_... Promotion Code ID
The code branches on the prefix and sends the correct Stripe field. The client NEXT_PUBLIC_SALE_* variables only control the strikethrough and countdown display. Use a coupon with no expiry for an open-ended sale, or checkout will start failing after the redeem-by date.
/pricing with a Stripe test card./dashboard/purchase.Open a support ticket with the Stripe error or event ID.
Sign in to leave feedback on this article.