AI-Coded Stripe Handler Double-Charged Customers: Fixing Webhook Bugs with MCP
Common_Dream9420 · reddit · 2026-08-09
A developer shared a cautionary tale of using an AI agent to write Stripe payment handlers. The agent's code passed tests but caused customers to be double-charged on day two.
The Incident
- Stripe delivers webhooks 'at least once'. The agent handled the first delivery correctly but re-provisioned the service on the second delivery of the same event, resulting in duplicate charges.
- The bug only existed on retries, which are notoriously difficult to reliably trigger in standard staging environments.
The Fix
- The developer plugged in FetchSandbox MCP and ran a webhookretries scenario.
- The agent successfully caught the duplicate provision on the simulated second delivery. It then fixed the idempotency key logic and verified the fix in the sandbox, attaching the receipt URL directly to the PR as proof.
More from coding & agent
- LangChain Launches Managed Deep Agents for Production-Grade AI — hwchase17 · 2026-08-10
- Meta's EvoHarness-RL: Agents Learn to Autonomously Manage External Frameworks — omarsar0 · 2026-08-10
- Running AI Agents in the Browser: Reusing Personal Work to Convey Complex Ideas — doodlestein · 2026-08-10
- DeepSeek-V4-Flash Halts Mid-Task During Long Agentic Coding at 100K+ Tokens — dieSpaghettiCarbona · 2026-08-10
- Distilling GLM-5.2 Traces into Qwen3.5-4B via OpenCode Harness — NielsRogge · 2026-08-10
- Full Autonomy Flops: Dev Wins Non-Tech Users Back with a 'Parking Queue' for Agent Workflows — akl773 · 2026-08-10