The problem
Stripe and an application database cannot share a transaction. A request can succeed at Stripe while the application loses the response. Webhooks can repeat, and a worker can stop after claiming a job. The application has to remember what succeeded and which work still needs completion.
My contribution
I designed the reliability contracts and storage architecture, then built the TypeScript engine, PostgreSQL, MongoDB, Firestore and SQLite adapters, and Express and Next.js integrations. I also built process-level failure tests, adapter conformance coverage and the public evaluation sandbox.
Engineering decisions
Give each financial operation a stable identity
The caller supplies an operation ID. SafeStripe stores its scope, parameters and progress, then uses a stable Stripe idempotency key. Changed parameters conflict instead of silently becoming another mutation. Older ambiguous outcomes require review.
Persist verified events before acknowledgment
The receiver verifies the original request bytes and Stripe signature before durable admission. If storage fails, the endpoint does not acknowledge work it has not saved. Workers process admitted jobs separately from the HTTP request.
Fence worker ownership at the commit
Jobs use expiring leases and ownership tokens. Completion checks the current owner in the transaction. The process-level tests kill real workers and verify that another worker can recover committed work without allowing a stale owner to overwrite the result.
Give business effects their own identity
Different webhook events can refer to the same business action. I used a stable effect key to guard supported local record changes, so deduplication follows the business effect as well as the event ID.
Commit state changes and outbox intent atomically
Supported billing-record updates, effect guards and outbox intent commit in one transaction. The dispatcher delivers at least once; receiving services deduplicate repeated delivery. I document that boundary explicitly because a local transaction cannot make an arbitrary external call exactly once.
Define a portable storage contract
PostgreSQL, MongoDB, Firestore and SQLite implement a shared storage contract with documented transaction boundaries. Adapter conformance and contention tests check the contract, while process-level worker tests exercise crash recovery and stale ownership across the supported implementation paths.
What changed
The published 0.3.0 package brings the five reliability contracts to four database adapters and Express/Next.js integrations. Its evidence includes adapter conformance, contention and process-level worker failure tests, reproducible benchmarks and CI. A retained Express + Firestore sandbox run recorded twelve journeys; its duplicate replay added ten admissions while preserving the original receipt and paid time.
Scope and evidence
Version 0.3.0 is an evaluation preview. The linked sandbox run and benchmarks cover their stated scenarios and workloads. Applications supply authorization, stable operation and effect identities, durable storage and a recovery plan. Independent security review and enterprise capacity testing remain outside this preview's evidence.
