Inspiration
Scam texts and emails reach people every day: fake job offers with placement fees, "grandchild in trouble" calls, fake delivery fees, requests to send money to an e-wallet right now and keep it secret. The people they target most, like parents, grandparents and workers abroad, often can't tell a fake from a real message, and the existing tools mostly check links. A scam with no link gets through. I wanted one place where someone can check a message before money moves, and get real help after if it already did.
What it does
Free scam check. Paste a message or upload a screenshot. ScamShield Pay gives a clear verdict (like "Stop. Do not pay."), names the scam type, highlights each warning sign in the message itself, explains why it matters, and says what to do next.
Free help for people who already paid. A step-by-step guide with official contacts for the way they paid. Filipino readers see Philippine contacts (CICC hotline 1326, PNP Anti-Cybercrime Group, NBI, BSP).
Paid dispute kit, through PayPal. For $9, the AI writes a dispute letter, a phone script and an evidence checklist for the reader's own case. They can pay with the PayPal button or ask for a PayPal invoice by email. The kit unlocks only after PayPal confirms the payment.
Three languages. English, Spanish and Filipino, and the checker understands Taglish messages.
Emergency help is never behind the paywall.
How I built it
- Next.js, React and TypeScript, deployed on Cloudflare Workers with Cloudflare D1 for storage.
- AI: Google Gemini returns a strict JSON verdict (checked with Zod): scam type, risk level, red flags quoted from the message, and next steps. It also writes the dispute kit. Claude is supported as a second provider. Screenshots go to the model as images.
- Guardrails run after the model. A demand for gift cards, crypto, remote access or secrecy can never get a "low" verdict. Links and phone numbers in the AI's advice are removed, since they could come from the scammer. Quotes that aren't really in the message are not highlighted. If the AI fails, the reader is told not to pay yet.
- PayPal:
- Orders API v2: the server creates and captures each order and sets the price.
- Invoicing API v2: the kit can be bought by invoice email.
- Webhooks with signature verification for completed, refunded and reversed payments and paid or refunded invoices. Invoice state is re-fetched from PayPal.
- The PayPal JavaScript SDK button.
- The kit unlocks only when PayPal's own response matches the check, the amount and the currency. A refunded kit stays locked.
- Security: per-visitor and site-wide rate limits, a strict Content Security Policy, JSON-only API routes, and keys stored as encrypted Cloudflare secrets.
- Tests: 139 automated tests for guardrails, highlighting, payments and webhooks, run on every push with GitHub Actions.
Challenges I ran into
- False reassurance is the worst failure. The message being checked may be written by a criminal, sometimes with text aimed at fooling an AI checker. I had to design so that no verdict is better than a wrong "looks safe".
- Matching the AI's quotes to the message. Highlights only work when the quote is exact, and the numbers had to follow reading order so the page is easy to follow.
- Testing webhooks. PayPal's webhook simulator sends mock events that can't pass signature verification, so I tested with real sandbox payments.
- Free-tier AI limits. I added a fallback model and rate limits so one visitor can't use up the quota.
- Serverless storage. The first version saved to a file, which doesn't work on Workers, so I moved it to D1.
- Taglish. Scam messages mix Tagalog and English, so I added Filipino scam patterns to the prompt and Filipino phrases to the guardrails.
Accomplishments that I'm proud of
- A complete flow that works end to end: check, verdict, help guide, PayPal payment, webhook, and a generated kit.
- Payment logic where the browser never decides whether someone paid.
- A result page that an older reader can understand at a glance.
What I learned
How to verify PayPal payments on the server instead of trusting the browser, how webhook signature verification works, and how to make an AI's output safe to show people by checking it with rules afterward.
What's next
- Encrypt stored messages.
- Native-speaker review of the Spanish and Filipino text.
- More languages and more local scam patterns.
- A number people can forward scam texts to directly.
Built With
- claude
- cloudflare-d1
- cloudflare-workers
- google-gemini
- nextjs
- paypal
- paypal-invoicing-api
- paypal-javascript-sdk
- paypal-orders-api
- paypal-webhooks
- react
- typescript
- vitest
- zod