Beyond Mocked Payloads: End-to-End Stripe Webhook Testing · Daniela Baron
12-Jun-2026 7
How to use Stripe Test Clocks and the Stripe CLI to run a real end-to-end payment failure webhook test locally.I work on a SaaS that uses Stripe to manage subscriptions and recurring payments. When a credit card fails at renewal, Stripe retries the payment up to three times over about two weeks (the exact schedule is configurable in your Stripe dashboard under Settings → Billing → Manage Failed Payments). After the third failure, Stripe cancels the subscription (also configurable).
We wanted to send a different email for each attempt:
First failure: A gentle nudge: "Your payment didn't go through, please update your card"
Second failure: An urgent warning: "This is your last chance before we suspend your account"
Third failure: A closure notice: "Your account has been closed"
On top of that, monthly and yearly subscribers need different wording in the emails. Monthly subscribers' data gets deleted after a grace period. Yearly subscribers' data is preserved indefinitely. That's six distinct emails (3 attempts x 2 billing periods), and getting the wrong one to the wrong person is a bad customer experience.
Beyond Mocked Payloads: End-to-End Stripe Webhook Testing · Daniela Baron #ruby #rubydeveloper #rubyonrails #Beyond #Mocked #Payloads: #End-to-End #Stripe #Webhook #Testing #Daniela #Baron #stripe #testing #webhook https://rubyonrails.ba/link/beyond-mocked-payloads-end-to-end-stripe-webhook-testing-daniela-baron