Inspiration

Small agencies and teams commissioning AI-assisted deliverables need to know what was accepted before they pay. We built a conversational settlement workflow: AI routes the request, independent evidence establishes acceptance, and PayPal handles buyer approval and capture. The intended audience is teams paying for bounded deliverables; customer demand and revenue are not claimed.

What it does

A user asks to settle an accepted work package. A local AI selects one identifier from server-authorized, ready receipts. Deterministic code rechecks the evidence and exact amount, creates a PayPal Sandbox Orders v2 order, and sends the buyer to PayPal for approval. On return, the server validates the order token before capture and displays a receipt with the order and capture identifiers.

How we built it

The app uses TypeScript and Node.js, a local Ollama model, and PayPal Sandbox REST APIs. The verified run used llama3.2. The receipt adapter binds acceptance to artifact identity, digest, version, cleared blocking inputs, and an independent passing review. The AI receives only eligible receipt summaries; its choice cannot change the receipt's amount. The responsive interface makes the work package, evidence, buyer approval, and completed receipt visible. The isolated source is public under the MIT license.

Challenges

We had to keep model routing separate from payment authority and preserve the same settlement identity through approval and capture. Tests cover hallucinated identifiers, mismatched return tokens, cancellation, repeated capture, and escaped output. An installed local model initially failed to load; we verified the fallback model through an actual completion before running the checkout.

Accomplishments

The full sandbox path passed: local AI selection, buyer approval, token validation, and capture. A separate PayPal API readback confirmed both the order and capture as COMPLETED for USD 80.00. All funds were fictitious. The demo work packages and accepted-work evidence are synthetic fixtures; the PayPal Sandbox integration is real. Nine receipt checks, eight settlement checks, seven AI-routing checks, and the HTTP redirect/capture test passed. We also checked the redesigned interface on desktop and mobile.

What we learned

Payment authority is easier to inspect when it is represented by an exact receipt before the model chooses a target. Provider readback gives a stronger completion signal than a success screen alone.

What's next

This bounded demo keeps settlement state in memory. Production work would add durable storage and operational reconciliation, then validate those changes before handling real funds.

Run it

Use Node.js 22.16 or newer and run npm run preflight:judge for the credential-free checks. For the interactive flow, follow the README with your own PayPal Sandbox credentials and local model. The narrated demo uses Kokoro af_heart and clearly labels the recorded October 9 sandbox result.

Built With

Share this project:

Updates

Submission history