Inspiration

Traditional e-commerce is highly vulnerable to scams. Once a buyer clicks 'Pay' or enters their card, the funds are instantly transferred, leaving the buyer with no buffer if they later realize they were scammed—such as with "too good to be true" iPhone/PS5 listings, or sellers demanding off-platform communication. Second Look was inspired by the idea of an intelligent, automated safety layer—a pre-settlement firewall that acts before the money actually moves. By placing payments on hold, we give a designated safety layer or trusted contacts a "second look" to verify transaction safety and prevent fraud entirely.

What it does

Second Look integrates with the PayPal Sandbox to securely pause settlement using Authorization Holds. Instead of immediately capturing a payment:

  1. It holds the buyer's funds safely in escrow (status: AUTHORIZED).
  2. Google Gemini AI instantly analyzes the transaction details (price anomalies, item type, and seller context) against known scam tactics.
  3. If low-risk (0–39), it triggers an automated capture without buyer friction.
  4. If medium-risk (40–69), it pauses for a "Trusted Contact" (e.g., family member or admin) to review via a unique link and approve/reject.
  5. If high-risk (70–100), it automatically voids the hold on the spot, keeping the buyer's funds completely safe. The entire transaction audit is visible on our dynamic AG Grid-powered dashboard.

How we built it

We built Second Look using a fast, async stack:

  • Backend: FastAPI (Python) handles the application logic, webhook triggers, and asynchronous endpoint coordination with PayPal and Google Gemini.
  • Payments: PayPal REST APIs v2 (intent: "AUTHORIZE", and respective capture & void processes) are used to handle pre-authorization holds and immediate settlement cancellations.
  • Intelligence: Google Gemini 1.5 Flash evaluates unstructured inputs and provides structured, deterministic JSON risk scoring based on custom heuristic presets.
  • Frontend & Admin Portal: Pure Vanilla HTML5, Tailwind CSS, and AG Grid Community Edition to construct a real-time, fully sortable, and filterable security and merchant ledger.
  • Deployment: Configured and deployed globally on Render.

Challenges we ran into

  • Handling asynchronous PayPal order states required precise state tracking, which we overcame by designing an organized state transition system in our database.
  • Perfecting the prompt for Gemini AI to return strictly valid, structured JSON without extra markdown wrapping or varying score ranges took several iterations of tuning and test inputs.
  • Setting up smooth, seamless polling in JavaScript for AG Grid to fetch and re-render transaction changes in real-time without disrupting user scrolling or filtering settings.

Accomplishments that we're proud of

  • Successfully pausing PayPal checkouts using real sandbox accounts, then automatically releasing or voiding those transactions dynamically based on live, automated decisions.
  • Delivering an extremely robust and visual dashboard using AG Grid that feels enterprise-grade and refreshes live.
  • Creating a solution that makes AI scam detection highly tangible, with real "Trusted Contact" approval flow bypasses.

What we learned

  • How to harness pre-authorization captures in payment rails, realizing they provide a critical "middle ground" before settlement that can prevent billions in fraud.
  • Advanced prompt engineering with Google Gemini for structured, strict, and highly predictable JSON telemetry parsing.
  • Configuring fast Webhooks and dynamic polling systems in frontends using AG Grid's state update capabilities.

What's next for second-look

  • Introduce secondary biometrics (FaceID/SMS) if a trusted contact is not designated.
  • Integrate merchant score database lookups to calculate automated risk based on historical fraud on peer platforms.
  • Establish browser-extension tools to warn users directly on listing pages, before they even click "Buy".

Built With

Share this project:

Updates

Submission history