Knowledge > Integrations > Stripe
Stripe Integration
Stripe is the sole payment processor for the entire ChurchWiseAI portfolio. One Stripe account (churchwiseai@gmail.com) serves all three codebases via separate webhook endpoints. The account runs in both test and live modes — 15 active products mirrored identically between modes.
Account Info
| Field | Value |
|---|---|
| Account email | churchwiseai@gmail.com |
| Account name | ChurchWiseAi Ltd |
| Live mode ID | acct_1SSPz2FaoK5IPzNo |
| Test mode ID | acct_1SSPzDF8WTm3d6SH |
| Active products | 15 (mirrored in test and live) |
| CLI default | Test mode (reads sk_test_ key) |
| Pricing source of truth | C:\dev\PRICING.md and knowledge/data/pricing.yaml |
How Used Per Product
| Product | Codebase | Purpose |
|---|---|---|
| ChurchWiseAI voice + chatbot plans | churchwiseai-web | Subscription checkout, webhook activation, billing portal |
| SermonWise Pro | churchwiseai-web | Subscription checkout, webhook activation |
| ShareWiseAI plans | churchwiseai-web | Subscription checkout, webhook activation |
| AI Starter Kit | churchwiseai-web | One-time payment checkout |
| PewSearch Premium Page | pewsearch/web | Pre-checkout + webhook activation for church directory listings |
| PewSearch Pro Website | pewsearch/web | Same as above, higher tier |
| ITW Premium | sermon-illustrations | Subscription checkout + webhook activation |
Key Environment Variables
| Variable | Scope | Used By |
|---|---|---|
STRIPE_SECRET_KEY | Server | All 3 codebases — Stripe SDK init |
STRIPE_WEBHOOK_SECRET | Server | All 3 webhook handlers — signature verification |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Client | Frontend checkout redirects |
STRIPE_PREMIUM_MONTHLY_PRICE_ID | Server | PewSearch Premium Page ($9.95/mo) |
STRIPE_PRO_WEBSITE_MONTHLY_PRICE_ID | Server | PewSearch Pro Website ($19.95/mo) |
STRIPE_PRICE_STARTER_CHAT | Server | ChurchWiseAI Starter Chat ($14.95/mo) |
STRIPE_PRICE_STARTER_CHAT_ANNUAL | Server | ChurchWiseAI Starter Chat annual ($149.50/yr) |
STRIPE_PRICE_PRO_CHAT | Server | ChurchWiseAI Pro Chat ($34.95/mo) |
STRIPE_PRICE_PRO_CHAT_ANNUAL | Server | ChurchWiseAI Pro Chat annual ($349.50/yr) |
STRIPE_PRICE_SUITE_CHAT | Server | ChurchWiseAI Suite Chat ($59.95/mo) |
STRIPE_PRICE_SUITE_CHAT_ANNUAL | Server | ChurchWiseAI Suite Chat annual ($599.50/yr) |
STRIPE_PRICE_STARTER_VOICE | Server | ChurchWiseAI Voice Starter ($39.95/mo) |
STRIPE_PRICE_PRO_VOICE | Server | ChurchWiseAI Voice Pro ($69.95/mo) |
STRIPE_PRICE_STARTER_BOTH | Server | ChurchWiseAI Starter Bundle ($49.95/mo) |
STRIPE_PRICE_PRO_BOTH | Server | ChurchWiseAI Pro Bundle ($79.95/mo) |
STRIPE_PRICE_SUITE_BOTH | Server | ChurchWiseAI Suite Bundle ($99.95/mo) |
STRIPE_PRICE_AI_STARTER_KIT | Server | AI Starter Kit one-time ($4.95) |
STRIPE_SERMON_PRO_MONTHLY_PRICE_ID | Server | SermonWise Pro monthly ($19.95/mo) |
STRIPE_SERMON_PRO_ANNUAL_PRICE_ID | Server | SermonWise Pro annual ($199.50/yr) |
STRIPE_SOCIAL_PRO_PRICE_ID | Server | ShareWiseAI Pro ($19.95/mo) |
STRIPE_SOCIAL_BUSINESS_PRICE_ID | Server | ShareWiseAI Business ($49.95/mo) |
STRIPE_SOCIAL_AGENCY_PRICE_ID | Server | ShareWiseAI Agency ($99.95/mo) |
STRIPE_PREMIUM_ANNUAL_PRICE_ID | Server | ITW Premium annual ($99.50/yr) |
CLI Patterns & Gotchas
Basic CLI Usage
# Default is test mode — safe to explore
stripe products list
stripe prices list
stripe customers list
# Listen for webhooks (local dev)
stripe listen --forward-to localhost:3002/api/stripe/webhook
# Test card
# 4242 4242 4242 4242 (any future expiry, any CVC)
Live Mode Writes
The Stripe CLI config file stores a read-only rk_live_ key. Live mode writes require the full sk_live_ key passed explicitly:
# sk_live_ key is stored in C:\dev\knowledge\.env as STRIPE_LIVE_SECRET_KEY
stripe products create --name "My Product" --api-key $STRIPE_LIVE_SECRET_KEY
stripe prices create ... --api-key $STRIPE_LIVE_SECRET_KEY
Always confirm with the founder before any live mode create/update. Agents execute, never send the founder to the dashboard.
Webhook Testing
# Forward to local server
stripe listen --forward-to localhost:3002/api/stripe/webhook
# Trigger specific event manually
stripe trigger checkout.session.completed
Important Design Decisions
customer.subscription.createdis NOT handled in churchwiseai-web's webhook handler. All CWA subscriptions go through Stripe Checkout, socheckout.session.completedis the single activation event. Handling both causes duplicate welcome emails.- The webhook handler has idempotency guards: if a church already has the same
stripe_subscription_id, the activation is skipped. - Welcome email is retried 3 times on failure — it contains the magic link, so losing it means the admin cannot access their dashboard.
- Chatbot is auto-provisioned on checkout activation (idempotent — skips if
organization_settingsalready exists). - Voice agent stub row is auto-created on checkout for voice/bundle plans, then the founder receives an alert email to provision the Twilio number.
Failure Modes & Recovery
| Failure | Symptom | Recovery |
|---|---|---|
| Webhook signature mismatch | 400 response, event not processed | Check STRIPE_WEBHOOK_SECRET matches the endpoint's signing secret in Stripe Dashboard. Test/live secrets are different. |
| Duplicate webhook event | "Church already has subscription — skipping" in logs | Normal — idempotency guard handles this. No action needed. |
| Welcome email failed 3 times | CRITICAL: Welcome email failed in Vercel logs | Admin cannot access dashboard. Manually call /api/onboard/resend-link to recover. |
| Missing church_id in metadata | "checkout.session.completed missing required fields" in logs | The checkout session was created without proper metadata. Check the checkout creation route. |
customer.subscription.trial_will_end not firing | Trial ending emails not sent | FA-004 known issue: this event is not yet added to the webhook config in Stripe Dashboard. Add it manually. |
| Payment failed, customer can't update card | invoice.payment_failed event fires | Webhook creates a Billing Portal session and emails the church admin with a direct link. |
Billing Rules Summary
- Chat plans: 14-day free trial, monthly AND annual billing
- Voice plans: monthly only (per-minute Cartesia costs make annual impractical)
- Bundle plans (Voice + Chat): monthly only
- Annual pricing: pay for 10 months, get 12 (~17% savings)
- PewSearch Premium Page: monthly only, no trial
- ITW Premium: monthly and annual, no trial
- SermonWise Pro: monthly and annual, no trial
- AI Starter Kit: one-time payment (not a subscription)
Webhook Endpoints
| URL | Codebase | Events |
|---|---|---|
https://churchwiseai.com/api/stripe/webhook | churchwiseai-web | checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed, customer.subscription.trial_will_end (pending — FA-004: not yet added to Stripe webhook config) |
https://pewsearch.com/api/stripe/webhook | pewsearch/web | checkout.session.completed, customer.subscription.updated, customer.subscription.deleted |
https://illustratetheword.com/api/stripe/webhook | sermon-illustrations | checkout.session.completed, customer.subscription.updated, customer.subscription.deleted |
Cost Model / Usage Limits
- Stripe charges 2.9% + $0.30 per successful card transaction.
- No monthly subscription fee for Stripe.
- Billing Portal sessions are free.
- Webhook events are free.
- No rate limits relevant to current scale (3 Stripe subscriptions as of April 2026).
See Also
- Pricing data — all price IDs, billing rules, Stripe product names
C:\dev\PRICING.md— extended pricing reference with Stripe IDs for both test and live- Supabase — database where subscription state is persisted after webhook
- Vercel — hosts the webhook endpoints