Amin Ale

Production-safe backend & AI engineering

Offer 4 of 5 · Stripe billing & Connect

Billing logic that doesn't double-charge under a replay storm.

Proration, dunning, webhook idempotency, Connect payouts, and Chargebee/Recurly to Stripe migrations. This is the money-touching work AI tools still get wrong on edge cases and lowest-bidders won't touch. It's my deliberate non-AI hedge.

For: SaaS teams with real revenue, webhook bugs, a migration deadline, or a billing edge case that keeps mis-charging.

What I build

  • Webhook layer done right: signature verification, event-level dedup, and a single-writer projection so replayed events can't corrupt state.
  • A database-enforced money guard (one charge row per invoice) that makes double-charging structurally impossible.
  • Correct proration on upgrades/downgrades, trials, dunning sequences, and Stripe Tax, reconciled to the cent.
  • Connect marketplaces: onboarding/KYC, split payouts, refund handling.
  • Chargebee/Recurly to Stripe migrations with a rehearsed cutover window, a reversible rollback plan, and parallel-run invoice parity.
  • Everything strictly test-mode in my code: live keys are refused outright; you deploy with your own.

Numbers from the reference runs

0double charges across 45 webhook deliveries, 5 chaos scenarios
50 of 50subscriptions migrated, invoice parity
450 of 450reconciliation field checks pass

Both reports are generated from real runs against a fake Stripe that refuses non-test keys, never hand-typed.

Proof: three artifacts you can open

Billing reference implementation

Full test-mode SaaS billing: proration, dunning, Tax, portal, Connect, plus a chaos script firing duplicate/out-of-order/dropped webhooks.

Chargebee/Recurly to Stripe migration runbook

Written cutover + rollback runbook and a harness migrating 50 fake subscriptions with a reconciliation report proving invoice parity.

stripe-webhook-kit: OSS library

Drop-in idempotent webhook handler (FastAPI + Express adapters): verify, dedupe, outbox, retry, dead-letter. Under 500 LOC, exhaustively tested.

What's the billing problem?

A webhook that fires twice, proration that's off, or a migration you're afraid to run: describe it and I'll point you at the matching artifact and a scope.

amin.ale.business@gmail.com