All packsMarketplace Payouts & Connected AccountsSolve
stripe dispute won resume order state race missing pre-dispute
A dispute that's won has to resume the exact state it interrupted -- or guess wrong
An order coming out of a dispute has to resume whatever state it was in before the dispute opened -- guessing RELEASED pays a seller twice, guessing HELD stalls their money, so the pack refuses to guess at all (D13).
This is one of the things Marketplace Payouts & Connected Accounts already handles. Take payment from buyers and pay out sellers, with the onboarding and identity checks Stripe requires.
Is this you?
An order state machine that doesn't record what state an order was in before a dispute opened has no correct answer when the dispute is won: resuming to RELEASED risks paying a seller who was never actually released yet, and resuming to HELD risks stranding a payment that was already correctly released before the dispute started. Guessing either way is wrong in a different, real, money-moving direction.
Why this one is easy to get wrong
DISPUTED reads like a single state that simply resolves back to 'normal' once the dispute closes, and picking one default resume state (usually whichever is simplest to implement) looks like a reasonable, working state machine right up until an order that was RELEASED before a dispute, and one that was still HELD, both hit the same disputed-then-won path and need genuinely different outcomes.
What you get instead
nextOrderState() records stateBeforeDispute explicitly at the moment DISPUTED is entered, from either HELD or RELEASED, and clears it to null once the dispute resolves. A DISPUTED-plus-dispute_won transition with no recorded stateBeforeDispute is rejected outright as missing_pre_dispute_state rather than defaulting to either guess -- the state machine refuses to move money based on an assumption it can't verify.
Source: ARCHITECTURE.md D13 — checkable in the pack you receive
How you actually use this
You don’t install a library or wire up an SDK. Your own coding agent builds the code in your project, and you keep it — no runtime dependency on us.
Step 1
Download and unzip
You get a folder: the docs that tell an agent what to build, a starting skeleton, and the test suite that decides when it's done.
Step 2
Open it in Claude Code or Cursor
Point your coding agent at the folder. Nothing to install, no account with us, no API key.
Step 3
Paste one prompt
The pack contains the exact prompt. Paste it as your first message and leave it alone — it works through the build itself, choosing a cheaper or stronger model per task.
Step 4
Run ./verify.sh
One command. It prints a pass or fail for every check. Green means the build is done — the same script we ran to produce the receipt on this page.
Typical build: about 25 minutes of your agent working, mostly unattended. Then you integrate the working module into your app the way you would any code you’d written yourself.
Why you can believe this
3 of 3 runs passedWe ran this pack from an empty folder 3 times and published exactly what happened — every check, the model, the token cost, the wall time. Not a testimonial, and not our opinion: the same verify.sh you run yourself. Read the full receipt →
Related problems
Marketplace Payouts & Connected Accounts
Stripe doesn't offer escrow. The hold is just the absence of a transfer.
Marketplace Payouts & Connected Accounts
The dispute event that debits money isn't the one that decides the outcome
Marketplace Payouts & Connected Accounts
Winning a dispute still doesn't get the dispute fee back