Inspiration
The most expensive payment bug is the one a developer causes while fixing another. A checkout times out, a customer writes "was I charged?", and the fastest thing to do is run the payment again. Sometimes that is right. Sometimes the first one went through and you have just charged them twice. We wanted a tool that makes the careful path the fast path.
What it does
- New: Ask in words and get one sentence plus the trace with the explaining step highlighted. SettleTrace is an incident workbench for PayPal payments, running against the PayPal Sandbox.
- Paste a customer's email or a support ticket and it finds the order, capture or refund references in it.
- One click reads that order straight from PayPal and saves the response as evidence: status, amount, captures, refunds.
- It shows a payment trace: each API read and each webhook event on one timeline, with verified and unverified sources kept apart.
- A deterministic review states what the evidence does and does not establish, for example "buyer approval alone does not establish a completed capture".
- An optional AI step ranks which check to do first. The model only orders checks that were already computed from evidence, and every line cites the saved record it came from.
- After the fix, read the order again and see the new state next to the old one. Share the investigation as a file a teammate can open.
In the demo, a real Sandbox checkout is paid with a test card, the test shop's server fails before capture, and SettleTrace shows "Approved, 0 captures". The order is captured once and the next read shows "Captured, 1 capture, $64.50".
How we built it
Node.js with no runtime dependencies, plain HTML, CSS and JavaScript in the browser. PayPal REST in Sandbox: OAuth, Orders v2 reads, Payments v2 capture and refund reads, and webhook signature verification for received events. The AI step calls any OpenAI-compatible chat endpoint; the demo uses a local Qwen 2.5 7B model through Ollama. Investigations are stored in a local journal file.
Challenges we ran into
Keeping "we don't know" visible. A missing refund record is not a zero refund, and a lost response is not a failure. Every screen had to say what was observed, when, and from which source, without drowning the developer in caveats. Letting a model help without letting it invent findings took a strict contract: it receives finished checks and may only return their order.
Accomplishments that we're proud of
The whole loop works on real Sandbox data: a paid order, a real read, a real capture, a second read. The trace view makes a payment's history readable in a few seconds. The AI output is useful and cannot say anything the evidence does not.
What we learned
Most payment incidents are answered by one or two authoritative reads, and the hard part is making people do them before acting. Models are good at prioritising and bad at being the source of truth, so we gave ours only the first job.
What's next
Hosted team workspaces with sign-in, live webhook intake for a registered Sandbox app, dispute evidence packets, and side-by-side comparison of two reads of the same order.
Built With
- css
- html
- javascript
- node.js
- ollama
- openai-compatible-api
- paypal
- paypal-orders-api
- paypal-sandbox
- paypal-webhooks
- qwen
