Inspiration
A flagged payment creates a difficult decision for a merchant: accept it, investigate it, or cancel it. A risk score alone provides little guidance.
We created FairAML to connect payment review with understandable evidence. Our goal is to help merchants see why an order deserves attention and make an informed decision before accepting funds.
What it does
FairAML combines PayPal payments, explainable AI, and a merchant review dashboard.
Buyers authorize a payment through PayPal sandbox. Merchants then inspect the order, review relevant transaction signals, and receive an AI-generated explanation highlighting observations, missing information, and suggested checks.
The merchant decides whether to capture the payment or cancel its authorization. FairAML records that decision alongside the confirmed PayPal status.
AI provides assistance; it does not independently move money or declare that a customer has committed fraud.
How we built it
We built the backend with Python and FastAPI, integrating PayPal's Orders and Payments APIs for authorization, capture, and cancellation.
The review layer uses Groq to turn structured transaction evidence into readable summaries. The prototype also includes experimental XGBoost scoring and SHAP feature attribution, with synthetic data clearly distinguished from PayPal sandbox transactions.
We used AG Grid Community for the merchant review queue, allowing reviewers to filter orders, inspect payment statuses, and open supporting evidence. The interface uses HTML, CSS, and JavaScript.
Server-side payment records and verified webhook handling keep the dashboard aligned with PayPal's reported state.
Challenges we ran into
The central engineering challenges were coordinating payment states, preventing duplicate actions, and keeping AI recommendations separate from permission to execute payments.
Another challenge was handling incomplete evidence. New buyers and limited merchant history should produce explicit uncertainty, rather than confident accusations.
We also needed graceful failure handling: unavailable AI should leave the evidence accessible, while an uncertain payment response should trigger reconciliation before another action.
Accomplishments that we're proud of
We connected payment authorization, evidence review, AI explanations, and merchant decisions in one workflow. This gives the reviewer a concrete next action alongside the analysis.
We also kept the merchant in control of payment execution and made the distinction between experimental model signals and confirmed payment outcomes visible in the interface.
The result is a focused sandbox prototype that demonstrates how AI can support payment review without presenting its recommendations as proven findings of fraud.
What we learned
Building around payments requires careful treatment of uncertainty. Buyer approval, authorization, and completed capture are different states, and the interface must communicate those differences accurately.
We also learned that explanations need traceable evidence. A polished AI narrative is useful only when its claims match the underlying transaction data.
Synthetic-data performance and model feature attribution are valuable development tools, but neither establishes real-world fraud detection accuracy or fairness.
What's next for FairAML
We want to evaluate the review experience with merchants, improve evidence quality, and test the experimental models on appropriately sourced payment data.
Future development will focus on stronger validation, clearer handling of limited history, and broader testing of payment failures and recovery.
Our goal is to make payment decisions easier to understand, with clear evidence, explicit human control, and a reliable record of what happened.
Built With
- chart.js
- css
- fastapi
- groq
- html
- javascript
- networkx
- numpy
- pandas
- python
- scikit-learn
- shap
- xgboost