Gift Card Scam Guard

Interrupts a gift card checkout that looks like a scam payment and asks one question before the order goes through.

StopsHelps stop a buyer paying a scammer in gift cards

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/gift-card-scam-guard.json

The files land in your project. They're yours to edit.

Usage

gift-card-scam-guard-usage.tsx
import { GiftCardScamGuard, type GiftCardLine } from "@/components/ui/gift-card-scam-guard"

<GiftCardScamGuard
  lines={LINES}
  note={NOTE}
  firstPurchase
  currency="INR"
  locale="en-IN"
  helpUrl="https://cybercrime.gov.in"
  onCancel={() => setStatus("Order cancelled. Nothing was charged.")}
  onContinue={() => new Promise<void>((resolve) => setTimeout(() => { setStatus("Going to payment…"); resolve() }, 500))}
/>

What it catches

  • Large total or several cards in one order, scaled to the order currency
  • Notes that mention a boss, tax, police, refunds, tech support or sharing codes
  • Common Hinglish and Hindi scam phrases such as "sir ne bola"
  • First-ever gift card purchase
  • Someone else asking the buyer to pay: routes to a stop screen instead of checkout

Props

GiftCardScamGuard props
PropTypeDefault
lines* (required)

Cards in the order.

GiftCardLine[]—
note

Gift message or note on the order, checked for scam stories.

string—
firstPurchase

True when this customer has never bought a gift card before.

boolean—
currency

ISO 4217 code for amounts.

string"USD"
locale

BCP 47 locale for formatting the total.

string—
largeTotal

Total at or above which the order counts as large: a number, or one per currency. Defaults to about US$500 in `currency` (e.g. ₹20,000).

ScamOptions["largeTotal"]—
severalCards

Card count at or above which the order counts as several. Defaults to 3.

ScamOptions["severalCards"]—
words

Extra or replacement word lists, e.g. in another language.

ScamOptions["words"]—
helpUrl

Where "How to report it" goes, e.g. your country's fraud reporting site.

string—
onAnswer

Called with the user's answer whenever it changes, for your fraud signals.

(answer: ScamAnswer | null) => void—
onContinue

Proceed to payment. Only reachable after a "gift" answer when the order is paused. May return a Promise.

() => void | Promise<void>—
onCancel

Cancel the order.

() => void—
messages

Any visible string; `story` and `answers` may be partial.

Partial<Omit<GiftCardScamMessages, "story" | "answers">> & { story?: Partial<Record<ScamStory, string>>; answers?: Partial<Record<ScamAns…—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Question section is labelled by its heading; the stop screen is role=alert
  • A polite live region announces changes; focus moves to the relevant control after each step
  • Continue button is described by its waiting reason when disabled
  • Decorative icons are aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

This is a UX guard rail. Enforce on the server: Apply your own fraud and velocity rules on gift card orders server-side; the client prompt is advisory.

  • Keyword and threshold heuristics; a scam with an innocent note and small total is not flagged
  • Genuine gifts that match the patterns are asked the question too
  • The buyer can still choose to continue; it does not block payment on its own

What it stops

Helps stop a buyer paying a scammer in gift cards

Also known as

gift card · scam · fraud · checkout · amazon pay gift card · google play card · hinglish · tech support scam

Field type

Dependencies

Pairs well with