Inspiration

An order can be captured once, reported twice, and partially refunded later. A merchant comparing payment events with their books can mistake delivery noise for additional money, or miss a refund entirely. We wanted a small, inspectable investigation tool that keeps arithmetic exact and makes uncertainty visible.

What it does

SettlementProof compares merchant expectations with PayPal payment resources. It identifies capture differences, unrecorded refunds, duplicate event deliveries, pending captures, and currency conflicts. Each case includes resource IDs, amounts, status, evidence fingerprints, and proposed review steps. Currency totals remain separate.

A locally trained intent classifier turns questions into specific investigations. The classifier shows its supporting vocabulary and model support, and can abstain when a request is unclear. It does not calculate balances, fabricate evidence, or trigger money movements.

How we built it

Python's standard library serves a lightweight interface built with HTML, CSS and vanilla JavaScript. The PayPal adapter implements sandbox OAuth and authenticated reads of Orders v2 and Payments v2 resources. A deterministic reconciliation core uses integer minor units and stable payment-resource identities. A small multinomial Naive Bayes model routes investigation intent without external model costs.

The project was newly built on October 17, 2026. The duplicate-event fixtures are invented. The capture/refund demonstration uses actual authenticated PayPal sandbox resources belonging to fictitious test accounts. Neither uses real customer data or real funds.

Challenges

Webhook delivery order is not an accounting order. Capture status can change after a refund while original gross value still matters. We separated delivery identity from resource identity, bounded refunds by each capture, and quarantined conflicting records instead of quietly choosing a convenient value.

Validation completed

An authenticated sandbox test created a USD 100 payment and USD 25 partial refund. The app fetched the order, capture, and refund through PayPal APIs. With no refund in the merchant expectation, it identified a USD 25 discrepancy and the local AI selected the relevant payment evidence. Adding the USD 25 expected refund produced a matched USD 75 net amount before fees with zero difference. Both outcomes were verified in Firefox on October 17, 2026.

Twenty-five automated tests pass, including 100 seeded input permutations and cases for duplicate events, conflicting snapshots, orphan refunds, pending parents, and per-capture refund bounds. A fixed 25-example intent evaluation scored 22 correct including abstentions; the small synthetic evaluation has known ambiguity errors and is not a production-accuracy claim.

What is next

Before a real merchant pilot, the project needs broader held-out intent evaluation, complete account-level ingestion, signed webhook verification, fees and dispute modeling, durable audit storage, and operational security review. No merchant traction or recovered revenue is claimed.

AI assistance and reproducibility

OpenAI Codex assisted development, code review and writing. Firefox was used for browser verification. Python unittest checks the reconciliation and sandbox-fixture invariants. FFmpeg, accessed through imageio-ffmpeg, produced the captioned demonstration from authentic application captures. The runtime classifier is a locally trained multinomial Naive Bayes model. All money arithmetic and evidence checks run in deterministic code. The public source package includes setup instructions, tests, the synthetic examples and a clearly redacted record of the authenticated sandbox verification. Judges can reproduce the API test with their own sandbox account.

Share this project:

Updates

Submission history