Documentation Index
Fetch the complete documentation index at: https://docs.aspfox.com/llms.txt
Use this file to discover all available pages before exploring further.
Local development
Get test mode API keys
- Log in to dashboard.stripe.com
- Make sure Test mode is toggled on (top right, shows “Test mode” label)
- Go to Developers → API keys
- Copy the Secret key (starts with
sk_test_) - Add to
.env:STRIPE_SECRET_KEY=sk_test_51…
Set up local webhook forwarding
The Stripe CLI forwards webhook events from Stripe to your local API server. Without it, Stripe cannot deliver events tolocalhost.
Install the Stripe CLI:
- macOS:
brew install stripe/stripe-cli/stripe - Windows:
scoop install stripeor download from stripe.com/docs/stripe-cli - Linux: Follow stripe.com/docs/stripe-cli
whsec_. Copy it to .env:
Create test products and prices
- Stripe Dashboard → Products → Add product
- Create the Pro plan:
- Name:
Pro - Pricing: Recurring, $29/month
- Copy the Price ID (starts with
price_) → add to.envasSTRIPE_PRO_PRICE_ID
- Name:
- Create the Business plan:
- Name:
Business - Pricing: Recurring, $79/month
- Copy the Price ID → add to
.envasSTRIPE_BUSINESS_PRICE_ID
- Name:
Test the checkout flow locally
Withstripe listen running and your API started, go to the Billing page in the frontend and click Upgrade. You should be redirected to Stripe’s hosted checkout. Use test card 4242 4242 4242 4242 with any future expiry and any CVC.
Watch the stripe listen terminal — you should see the checkout.session.completed event forwarded and a 200 response from your API.
Production
Switch to live keys
- In Stripe Dashboard, toggle Live mode on
- Go to Developers → API keys
- Copy the Secret key (starts with
sk_live_) - Update your production environment:
STRIPE_SECRET_KEY=sk_live_51…
Register the webhook endpoint
- Stripe Dashboard → Developers → Webhooks → Add endpoint
- Endpoint URL:
https://api.yourdomain.com/api/v1/webhooks/stripe - Select events to listen for:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_failedinvoice.payment_succeeded
- Click Add endpoint
- On the endpoint detail page, click Reveal next to Signing secret
- Copy the signing secret (starts with
whsec_) → add to production env asSTRIPE_WEBHOOK_SECRET
Verify the webhook is working
After deploying, trigger a test event from the Stripe Dashboard:- Developers → Webhooks → click your endpoint
- Send test webhook → select
checkout.session.completed - Check your API logs for the receipt and the
200response
Each registered webhook endpoint has its own signing secret. The secret from the Stripe CLI (
stripe listen) is different from the secret from a registered production endpoint. Make sure you are using the correct one for each environment.