Inspiration

Payment scams are getting harder to spot, and attackers now use AI to write convincing fake invoices and urgent "pay now" messages. People usually only find out after the money has left. I wanted a safety check that runs before the payment, at the exact moment the user is about to click Pay.

What it does

AI Scam Shield checks any payment request or invoice before you pay:

  • You paste the sender, amount and message text.
  • AI gives a risk score from 0 to 100, a label (Safe, Suspicious or Danger) and plain-language reasons, such as urgent language, gift-card requests or fake login links.
  • Safe requests continue to a real PayPal checkout (sandbox).
  • Dangerous requests are blocked. The server re-checks the request before it creates any PayPal order, so a blocked request cannot be paid even if someone tries to skip the page.

How I built it

  • PayPal Orders API (sandbox): creates the order and captures the payment after the buyer approves it.
  • Google Gemini API: reads the request and returns a score, reasons and advice as JSON.
  • Node.js and Express backend, hosted on Render, with a simple HTML front end.
  • A rule-based fallback scores common scam patterns if the AI service is unavailable, so the app never fails open.

Challenges

This was my first PayPal integration. Setting up the developer account, deploying on a new host and fixing file-path errors under a tight deadline taught me a lot about how a payment flow fits together.

What I learned

Putting the AI check in front of the PayPal step, and enforcing it on the server, makes the risk score meaningful instead of just decoration.

What's next

A "Fraud Hunter" dashboard that watches transaction patterns (such as many tiny payments in a row, a sign of card testing) and flags bot-like behavior.

Try it

The free host sleeps when idle, so the first load can take about a minute. Use the Scam example and Safe example buttons. To test the payment, log in at PayPal with the sandbox buyer account:

  • Email: (paste your sandbox buyer email here)
  • Password: (paste your sandbox buyer password here)

Built With

Share this project:

Updates

Submission history