Inspiration

Freelance projects often start with a broad brief, but payment decisions depend on specific questions: What was promised? What was delivered? Is there enough evidence to approve the work?

I built TrustPay AI to bring these decisions into one workspace. The idea is to use AI to help structure and review the work, while keeping approval with the client and payment verification with PayPal.

What it does

TrustPay AI connects project planning, evidence review, and PayPal Sandbox payments.

  • Project planning: A client enters project requirements and a USD budget. Gemini generates three milestones with deliverables, acceptance criteria, and budget allocations.
  • Evidence review: A freelancer submits work evidence. Gemini evaluates it against each acceptance criterion and provides an explained recommendation.
  • Client approval: The client reviews the recommendation and makes a separate approval decision. AI cannot approve or authorize payments.
  • PayPal checkout: The application creates a Sandbox order and directs the buyer to PayPal for approval.
  • Payment verification: After returning to the dashboard, the client requests capture. The backend validates the order, capture status, currency, and amount before marking the milestone paid.
  • Progress tracking: An AG Grid dashboard supports searching, filtering, sorting, and CSV export. An activity timeline records successful payment actions.

This is a Sandbox demonstration using test accounts and simulated money, not a production payment or escrow service.

How I built it

I used Python and FastAPI for the backend, SQLite for persistent records, and HTML, CSS, and JavaScript for the frontend.

Google Gemini handles milestone generation and structured evidence reviews. AG Grid Community powers the milestone table. The PayPal Sandbox Orders API handles checkout creation and payment capture.

The workflow separates AI recommendations, client approval, and payment verification. A Client Demo PIN protects approval, checkout, and capture actions. Automated tests cover payment behavior, authorization, checkout recovery, and failure handling.

Challenges I faced

One challenge was distinguishing buyer approval from completed payment. Returning from PayPal must not automatically mark a milestone paid.

Another was recovering from unavailable checkout orders without deleting previous payment history. I added a recovery flow that preserves the old order.

Sandbox account configuration also affected testing. Using a suitable US Personal buyer account resolved the checkout issue encountered during USD testing.

AI review introduced a different challenge: a claim that work is complete is not sufficient evidence. The review needs to explain missing information rather than produce an unsupported approval.

What I learned

I learned that integrating AI means designing how its recommendations are used—not simply displaying a generated response.

Payment integrations also require careful handling of retries, failures, database transactions, and verification. Clear loading feedback matters just as much: users need to know whether an AI request is processing or has failed.

What’s next

My next priorities are improving AI loading feedback and response handling, making evidence submission clearer, and expanding automated coverage for AI failure cases.

Before considering real payments, the prototype would also need proper user authentication, role-based access, and a broader production security review.

Built With

Share this project:

Updates

Submission history