Stripe & email debugging

Resolve Stripe Test vs Live mix-ups, missing webhooks, stalled order unlocks, bounced emails, and SPF, DKIM, or DMARC authentication failures fast.

Why payment and email bugs fail silently

Unlike visual layout glitches, payment fulfillment and transactional emails execute asynchronously behind the scenes. A visitor can complete Stripe Checkout, see a cheerful confirmation page, and still find their account stuck on Free because a webhook failed — or wait forever for a receipt blocked by a broken DNS record.

Never debug payments or email from the browser screen alone. Always trace the two authoritative server logs first: Stripe Dashboard → Developers → Webhooks for payments, and Cloud → Email → Logs for outgoing mail.

Fixing Stripe Test vs Live key mix-ups

Stripe maintains two completely separate worlds: Test mode (permanently wired to your ExaSpark Preview environment) and Live mode (used when your published app charges real cards). Nearly half of launch-week checkout errors happen when an artifact from Test mode leaks into Live mode.

Four separate identifiers change between Test and Live — none of them cross environments:

  • API keys: Test keys begin with pk_test_ and sk_test_; Live keys begin with pk_live_ and sk_live_.
  • Product and Price IDs: Every price_... created in Stripe Test mode exists only in Test mode. You must reference matching Live price_... IDs when Live mode runs.
  • Webhook signing secrets: Each webhook endpoint has its own unique whsec_... secret. Using a Test webhook secret against Live traffic fails signature verification on every event.
  • Customer and subscription IDs: A cus_... or sub_... stored in Preview never exists inside your Live Stripe account.

Match the exact error message in Stripe or server logs to fix mix-ups immediately:

Error or symptomExact root causeReliable fix
`No such price: 'price_...'`Live checkout requested a Price ID that only exists in Stripe Test modeCreate the matching product/price in Stripe Live mode and bind the Live Price ID
Real card rejected: "Your card was declined (test mode)"Published app still runs in Stripe Test modeSwitch project payment settings to Live mode and click Publish
`No signatures found matching the expected signature`Wrong whsec_... secret, or middleware parsed JSON before verifying raw bodyConfigure the Live endpoint's exact signing secret and verify against the raw request body
`No such customer: 'cus_...'`Test stripe_customer_id copied or left in a Live user recordClear stale test customer IDs in Live Cloud so Live checkout creates a clean cus_...
Checkout opens with wrong currency or old amountCheckout button still passes a previous Stripe Price IDConfirm active Live Price ID in Stripe Dashboard and update the checkout route

Remember that ExaSpark charges 0% platform fee on every Stripe transaction across all plans (standard Stripe card processing fees still apply). See Payments with Stripe.

Diagnosing missing webhooks and stalled unlocks

When a card succeeds in Stripe Dashboard yet Cloud stays unpaid or Free, trace the webhook delivery end to end rather than rewriting Checkout:

  1. Check the Stripe mode toggle

    Confirm Stripe Dashboard is switched to Test mode (Preview) or Live mode (Live). Looking at the wrong mode hides failed deliveries.

  2. Read the HTTP delivery status

    Open Developers → Webhooks → Recent deliveries. 400 signals a signature mismatch, 404 a wrong route path, 500 a backend crash, and 301/307 a domain redirect trap.

  3. Eliminate apex-to-www redirect traps

    Stripe drops POST webhooks on 301/307 redirects. Always point your Stripe webhook URL straight to your exact canonical Live hostname.

  4. Verify events and session metadata

    Confirm the endpoint subscribes to checkout.session.completed, invoice.paid, invoice.payment_failed, customer.subscription.updated, customer.subscription.deleted, and charge.refunded, and that metadata.user_id or metadata.order_id is populated.

  5. Resend after publishing the fix

    Click Resend inside Stripe's webhook log and confirm Cloud updates to paid or active without duplicating records.

Diagnosing transactional email failures and bounces

Open Cloud → Email → Logs to trace outgoing verification links, receipts, and alerts. First verify your plan's sending allowance:

  • Free ($0): 100 emails/month, authentication only (verification, password resets, magic links), default sender, 7-day logs, pauses at cap.
  • Starter ($4.99/mo or $3.99/mo annual): 1,000 emails/month covering auth and custom app notifications, 1 custom sending domain, 7-day logs, overage allowed.
  • Pro ($25/mo or $20/mo annual): 10,000 emails/month, up to 3 custom sending domains, 30-day logs, overage allowed.

Match what you see in Cloud → Email → Logs to the exact fix:

Log status or symptomLikely root causeExact fix
No log entry at all after checkout or bookingApp is on Free (auth-only) or server trigger never ran after webhookUpgrade to Starter or Pro for custom app emails, or verify the webhook calls your send helper
Status shows `Soft bounce`Recipient inbox full or temporary throttling by receiving serverWait for automatic retry; no DNS change required unless repeated across all providers
Status shows `Hard bounce` (`550 User Unknown`)Customer mistyped their email address (gmial.com) or mailbox closedStop retrying hard-bounced addresses automatically and prompt users to update their email
Status shows `Delivered`, but email lands in Gmail SpamMissing DMARC, broken SPF/DKIM alignment, or link shorteners in bodyVerify SPF + DKIM + DMARC pass via Gmail "Show original" and remove third-party short links
Custom sending domain stuck in `Pending`DNS host duplicated root domain or Cloudflare proxy enabled on DKIM CNAMERemove duplicate domain suffix in DNS host field and switch email CNAMEs to DNS only
Verification emails stopped mid-month on FreeFree plan reached its 100/month authentication email capUpgrade to Starter (1,000/mo) or Pro (10,000/mo) to restore sending immediately

Fixing SPF, DKIM, and DMARC authentication errors

Modern inbox providers reject or spam-folder unauthenticated custom-domain mail automatically. Four specific DNS configuration mistakes cause almost every branded email failure.

Mistake 1: Duplicate `v=spf1` records (SPF PermError)

DNS allows only one v=spf1 TXT record per hostname. If you already publish a Google Workspace or Microsoft 365 SPF record on your root domain and add a second v=spf1 record, both fail immediately with PermError.

Either merge the include: mechanism into your single existing v=spf1 record, or — much cleaner — send app mail from a dedicated subdomain like mail.yourdomain.com with its own isolated SPF record.

Mistake 2: Cloudflare orange cloud on DKIM CNAMEs

When Cloudflare's orange Proxied switch is turned on for a DKIM CNAME, Cloudflare intercepts the DNS query and serves HTTP proxy records instead of the cryptographic public key. Switch every DKIM CNAME to DNS only (grey cloud) immediately. See DNS for Cloudflare & GoDaddy.

Mistake 3: Doubled domain names in registrar forms

Many registrars (including GoDaddy and Namecheap) automatically append .yourdomain.com to whatever you type in the Host field. Pasting s1._domainkey.mail.yourdomain.com into those panels accidentally creates s1._domainkey.mail.yourdomain.com.yourdomain.com. Enter only the relative host prefix (s1._domainkey.mail) when your registrar auto-appends the root domain.

Mistake 4: Missing DMARC policy or skipped header check

Gmail and Yahoo require a valid _dmarc.yourdomain.com TXT record for bulk and high-trust custom senders. Start with p=none to monitor cleanly, then verify all three records directly from your terminal and inside Gmail's Show original menu:

text
Email DNS Verification Commands
------------------------------------------------------------------
1. Check SPF TXT record (confirm exactly ONE v=spf1 record exists):
   dig +short TXT mail.studionorth.co

2. Check DKIM CNAME target (must resolve to provider key, NOT Cloudflare IP):
   dig +short CNAME s1._domainkey.mail.studionorth.co

3. Check DMARC TXT record on organizational root domain:
   dig +short TXT _dmarc.studionorth.co

4. Inspect test email in Gmail -> Three dots -> "Show original":
   SPF:   PASS
   DKIM:  PASS
   DMARC: PASS

See Branded email & delivery and Email authentication & DNS for complete setup guides.

Copyable repair prompts for Stripe and email

Use this prompt to harden a Stripe webhook that charges cards without updating Cloud:

Starter prompt · App

Stripe Checkout completes in Live mode, but orders in Cloud stay `pending`. Audit `/api/webhooks/stripe`: ensure signature verification reads the exact raw request body using the server-side Stripe webhook secret, pass `user_id` and `order_id` in Checkout Session metadata, store processed Stripe event IDs for idempotency, handle `checkout.session.completed`, `invoice.paid`, `customer.subscription.updated`, `customer.subscription.deleted`, and `charge.refunded`, and log clear server errors without exposing secrets.

Use this prompt to ensure receipt emails send reliably without ever breaking webhook acknowledgment:

Starter prompt · App

When `checkout.session.completed` marks an order `paid` in Cloud, send a branded confirmation email from our verified sending domain with a real `Reply-To` address, clear order summary, and both HTML and plain-text bodies. Wrap the email send in its own error handler and log delivery failures cleanly so a temporary mail error never causes the Stripe webhook to return HTTP 500 or roll back the paid order status.

Next steps

Still have a question?Ask our team and other builders on Discord.

From the blog