← All work
01 / 07 · Full-stack project, designed and built

PaySupport: a payment support tool for someone in the middle of a ticket

A full-stack dashboard that compares a company's payment ledger with what the processor actually recorded, then tells a support engineer what went wrong, what to tell the customer, and what to do next.

Role
Product design and full-stack development
Type
Self-initiated project, designed and built
Built with
React, TypeScript, Express, PostgreSQL
Links
Live demo ↗Source code ↗Dashboard README ↗
PaySupport
The PaySupport workspace: headline metrics, a transaction lookup, and the discrepancy queue

Problem

Payments move through two systems that don't always agree: a company's own ledger, and the processor that actually moved the money. When they drift apart, customers write in: "Why does the app say pending when the money already left my account?" Someone has to run a SQL query, call the processor's API, compare the two, and work out which one is stale, usually while the customer waits.

I built PaySupport to explore how a support tool should explain a money problem to the person who has to fix it. I didn't want to stop at screens; I wanted to build the whole thing and see every design decision hold up against real data.

Who it's for

  • Support staff, mid-ticket (primary): they need one answer fast: what happened to this payment, and what can I safely tell the customer?
  • Engineers and admins who own payment health: they need to find drift across many payments before customers notice, which is why they're the ones who can run sweeps.
  • The customer, indirectly: they never see PaySupport, but every screen is judged by whether it leads to a correct, calm reply to them.

The mid-ticket path

This is the path a support engineer takes from the moment a payment question lands. Every screen is there to keep it short.

  1. A customer writes in"Why does it say pending?"
  2. Look up the paymentPaste the transaction ID
  3. PaySupport checks both systemsLedger and processor, with progress announced
  4. Read the verdictWhat's wrong, in one sentence, plus the next step
  5. Check the evidenceSide by side, with IDs ready to copy
  6. Reply or escalateAnswer the customer, or send engineering the diagnosis link

Two branches leave the main path. If the processor can't be reached, the verdict says so and offers a retry, never a failed payment. Engineers and admins start one step earlier: a sweep fills the discrepancy queue, and each row opens the same diagnosis page.

Process

I started with the API: Express and TypeScript with raw SQL (no ORM, so every query is visible and reviewable), plus a mock payment processor that deliberately drifts from the database on a few seeded payments and randomly times out, so the system has real problems to find. One endpoint diagnoses a single payment on demand, a sweep checks recent payments in bulk, and a script can run that sweep on a schedule.

Then I designed the dashboard around one person: not someone calmly exploring, but a support engineer mid-ticket, with a worried customer asking where their money went. That person shaped almost every decision.

Then I checked every screen against real results, not just the tests. That caught the gap below.

What changed after testing

One seeded payment had two problems at once: a $0.50 fee, and a stale status. Our ledger said pending, but the processor said settled. The API reports only the first problem it finds, and it checks the amount first, so the verdict explained the fee and stopped there.

That meant the engineer would talk about fifty cents while the customer's real question, "did my payment go through?", went unanswered.

Before
Amount mismatch

The processor’s amount is $0.50 higher than our ledger.

Next step: Check the fee schedule before replying to the customer. Escalate to engineering if the difference isn’t explained by a known fee.

After
Amount mismatch

The processor’s amount is $0.50 higher than our ledger.

The status also differs: our ledger says pending, but the processor says settled.

Next step: Check the fee schedule before replying to the customer, and tell them the payment is settled. Ask engineering to correct the ledger status, and to review the amount if it isn’t explained by a known fee.

I fixed it in the verdict. When the API reports an amount mismatch, the dashboard compares the statuses too, and adds them to the explanation and the next step only when they differ, so a simple fee stays simple. There's a test for that exact payment, and another that makes sure the extra advice doesn't appear when only the amount is off.

Key decisions

  • The answer comes first. A diagnosis opens with a badge, one sentence saying what's wrong, and a highlighted next step. The side-by-side comparison comes after, and raw developer notes are folded away.
  • Copy written for the person reading it. "Processor unavailable" tells the engineer not to say anything has gone wrong, because a timeout isn't a failed payment, and telling a worried customer the wrong thing is its own incident.
  • Status is never color alone. Every badge has a word and an icon, and rows that differ say so in text: "Differs: processor is $0.50 higher."
  • Red is only for the brand. In a payments tool red means error, so buttons are ink and outages are slate blue, never mistaken for a failure.
  • Expensive actions ask first. A sweep can make 100 processor requests, so it sits behind a confirmation with focus on Cancel. Support staff, who can't run sweeps, get a sentence explaining who can instead of a dead button.
  • IDs are never shortened. A truncated ID can't be pasted into a query, so every ID is shown in full, in monospace, with one-click copy.
A PaySupport diagnosis: an amount mismatch badge, a one-sentence verdict, and a highlighted next step
The verdict and next step come first; the side-by-side comparison follows.

Design decisions in the code

A design decision only counts if it survives into the build. Here's how the diagnosis screen holds up beyond the happy path:

  • Loading: "Checking our ledger and the payment processor…" sits in a polite live region, so a screen reader hears progress without being interrupted.
  • Errors: failures are announced right away in plain language, and "Try again" only appears when retrying could actually help.
  • Processor unavailable: its own verdict with a "Check the processor again" button, never shown as a failed payment.
  • Focus: the sweep confirmation is a native dialog, so focus stays inside it, Escape closes it, Cancel gets focus first, and focus returns to the button that opened it.
  • Responsive: on narrow phones the comparison table scrolls sideways instead of squashing the amounts, and the queue becomes cards.
  • Motion: transitions drop to near zero for anyone who prefers reduced motion.
// One glyph per tone, so badges differ in shape as well as colour.
const TONE_ICONS: Record<BadgeTone, string> = {
  success: "✓", warning: "!", danger: "✕", info: "i", neutral: "•",
};

export interface StatusBadgeProps {
  tone: BadgeTone;
  /** Always required: colour is never the only signal. */
  label: string;
}

export function StatusBadge({ tone, label }: StatusBadgeProps) {
  return (
    <span className={`status-badge status-badge--${tone}`}>
      <span className="status-badge__icon" aria-hidden="true">
        {TONE_ICONS[tone]}
      </span>
      {label}
    </span>
  );
}
web/src/components/StatusBadge.tsx · "Status is never color alone," written so the code can't break it: the label is required, and the icon is hidden from screen readers because the words already say it.

Scope

I ranked features by the moment they serve. The ticket in front of someone right now beats everything else.

  • In v1, diagnosing one payment: it answers the customer who is waiting, so it had to be the strongest part of the product.
  • In v1, the sweep and discrepancy queue: it turns support from reactive to proactive by finding drift before anyone writes in.
  • Next, marking discrepancies resolved: useful for tracking, but it doesn't change what the customer hears, so it waited. The dashboard says it isn't supported yet instead of faking it.
  • Out of scope, a real processor integration: the compliance overhead would cost weeks and teach nothing new about the support workflow. A mock with the same shape, one that drifts and times out on purpose, tests the same decisions.

Security

  • The session token lives in memory only, not in local storage, so it isn't saved after you leave. That alone doesn't eliminate cross-site scripting risk, which is why the strict Content Security Policy and lint rules below matter too. The tradeoff is that refreshing signs you out. For production I'd move the session to an HttpOnly cookie, and I documented that rather than half-building it.
  • The API is treated as untrusted input. Every response is validated at runtime before the interface touches it.
  • A strict Content Security Policy, tested by injecting a script into the production build and confirming the browser refused to run it.
  • Lint rules make unsafe code fail the checks, so patterns like raw HTML injection or reading tokens from storage can't quietly come back.
  • The browser is a convenience; the API is the boundary. Hiding the sweep button is UX. The real check is the API's 403, which the dashboard explains in plain language.

Measuring success

PaySupport is a self-initiated project with no live users, so these are the measures I'd set before a real rollout, against a baseline taken from the current manual process.

  • Primary: time from opening a payment ticket to a correct reply, compared with running the SQL query and processor lookup by hand.
  • Secondary: the share of discrepancies a sweep finds before a customer reports them, and fewer payment tickets escalated to engineering.
  • Guardrail: zero cases of telling a customer a payment failed when the processor was only unreachable. That's why "Processor unavailable" is its own state with its own guidance.

To validate it, I'd shadow a few support engineers on real payment tickets first, then pilot with one team and compare their handling time with a team still working by hand.

Outcome

A working full-stack system: an Express API with JWT auth, validated inputs, an append-only audit log, interactive API docs and Docker Compose setup, plus a React 19 dashboard with just four runtime dependencies, light and dark themes, and a phone layout where the queue becomes cards.

It's backed by more than 150 automated tests across the API and dashboard, including automated accessibility checks on every page state and a deliberately broken "canary" test that must fail, because a check that can't fail proves nothing. Accessibility targets WCAG 2.2 AA, with contrast calculated for every color pair in both themes.

The discrepancy queue shown as stacked cards on a phone
On phones, the queue reads top to bottom as cards.

Honest note

The payment processor is a mock by design, the same shape as a real one without the compliance overhead. The live demo runs entirely in your browser on sample data, so it's free to host and nothing can go down; the full stack (API, database and processor mock) runs locally with Docker Compose. For a public full-stack demo I'd host it on a platform like Render, Railway or Fly.io, and a production setup would move to AWS with a managed database and centralized logging. Discrepancies can't be marked resolved from the dashboard yet, because the API doesn't support it; the interface says so instead of pretending. Next I'd add that endpoint and move the session to a secure cookie.

  • React
  • TypeScript
  • Node.js + Express
  • PostgreSQL
  • Zod
  • Accessibility (WCAG 2.2 AA)
  • Automated testing
  • Docker
~/contact

I design it, build it, and keep improving it after launch.

Send me a message