Skip to main content

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

FieldValue
Account emailchurchwiseai@gmail.com
Account nameChurchWiseAi Ltd
Live mode IDacct_1SSPz2FaoK5IPzNo
Test mode IDacct_1SSPzDF8WTm3d6SH
Active products15 (mirrored in test and live)
CLI defaultTest mode (reads sk_test_ key)
Pricing source of truthC:\dev\PRICING.md and knowledge/data/pricing.yaml

How Used Per Product

ProductCodebasePurpose
ChurchWiseAI voice + chatbot planschurchwiseai-webSubscription checkout, webhook activation, billing portal
SermonWise Prochurchwiseai-webSubscription checkout, webhook activation
ShareWiseAI planschurchwiseai-webSubscription checkout, webhook activation
AI Starter Kitchurchwiseai-webOne-time payment checkout
PewSearch Premium Pagepewsearch/webPre-checkout + webhook activation for church directory listings
PewSearch Pro Websitepewsearch/webSame as above, higher tier
ITW Premiumsermon-illustrationsSubscription checkout + webhook activation

Key Environment Variables

VariableScopeUsed By
STRIPE_SECRET_KEYServerAll 3 codebases — Stripe SDK init
STRIPE_WEBHOOK_SECRETServerAll 3 webhook handlers — signature verification
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYClientFrontend checkout redirects
STRIPE_PREMIUM_MONTHLY_PRICE_IDServerPewSearch Premium Page ($9.95/mo)
STRIPE_PRO_WEBSITE_MONTHLY_PRICE_IDServerPewSearch Pro Website ($19.95/mo)
STRIPE_PRICE_STARTER_CHATServerChurchWiseAI Starter Chat ($14.95/mo)
STRIPE_PRICE_STARTER_CHAT_ANNUALServerChurchWiseAI Starter Chat annual ($149.50/yr)
STRIPE_PRICE_PRO_CHATServerChurchWiseAI Pro Chat ($34.95/mo)
STRIPE_PRICE_PRO_CHAT_ANNUALServerChurchWiseAI Pro Chat annual ($349.50/yr)
STRIPE_PRICE_SUITE_CHATServerChurchWiseAI Suite Chat ($59.95/mo)
STRIPE_PRICE_SUITE_CHAT_ANNUALServerChurchWiseAI Suite Chat annual ($599.50/yr)
STRIPE_PRICE_STARTER_VOICEServerChurchWiseAI Voice Starter ($39.95/mo)
STRIPE_PRICE_PRO_VOICEServerChurchWiseAI Voice Pro ($69.95/mo)
STRIPE_PRICE_STARTER_BOTHServerChurchWiseAI Starter Bundle ($49.95/mo)
STRIPE_PRICE_PRO_BOTHServerChurchWiseAI Pro Bundle ($79.95/mo)
STRIPE_PRICE_SUITE_BOTHServerChurchWiseAI Suite Bundle ($99.95/mo)
STRIPE_PRICE_AI_STARTER_KITServerAI Starter Kit one-time ($4.95)
STRIPE_SERMON_PRO_MONTHLY_PRICE_IDServerSermonWise Pro monthly ($19.95/mo)
STRIPE_SERMON_PRO_ANNUAL_PRICE_IDServerSermonWise Pro annual ($199.50/yr)
STRIPE_SOCIAL_PRO_PRICE_IDServerShareWiseAI Pro ($19.95/mo)
STRIPE_SOCIAL_BUSINESS_PRICE_IDServerShareWiseAI Business ($49.95/mo)
STRIPE_SOCIAL_AGENCY_PRICE_IDServerShareWiseAI Agency ($99.95/mo)
STRIPE_PREMIUM_ANNUAL_PRICE_IDServerITW 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.created is NOT handled in churchwiseai-web's webhook handler. All CWA subscriptions go through Stripe Checkout, so checkout.session.completed is 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_settings already 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

FailureSymptomRecovery
Webhook signature mismatch400 response, event not processedCheck 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 logsNormal — idempotency guard handles this. No action needed.
Welcome email failed 3 timesCRITICAL: Welcome email failed in Vercel logsAdmin cannot access dashboard. Manually call /api/onboard/resend-link to recover.
Missing church_id in metadata"checkout.session.completed missing required fields" in logsThe checkout session was created without proper metadata. Check the checkout creation route.
customer.subscription.trial_will_end not firingTrial ending emails not sentFA-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 cardinvoice.payment_failed event firesWebhook 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

URLCodebaseEvents
https://churchwiseai.com/api/stripe/webhookchurchwiseai-webcheckout.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/webhookpewsearch/webcheckout.session.completed, customer.subscription.updated, customer.subscription.deleted
https://illustratetheword.com/api/stripe/webhooksermon-illustrationscheckout.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