GSM Payments
A small, focused checkout that keeps card data off our servers and treats payments as their own product surface.
In plain words
GSM is the page where customers pay an invoice by card. It's deliberately small and fast, and card details go straight to Stripe and never touch our servers. It asks the central Accounts service for the invoice and records the payment there.
Interactive preview
How GSM Payments works
Interactive · illustrative sample data
The challenge
Checkout needs a minimal attack surface, fast mobile loads and clear errors. Bolting it onto a heavy admin app hurts security reviews, bundle size and UX.
Our approach
Ship checkout as its own small Next.js app: Stripe Elements for card capture, Accounts as the billing source of truth, Redis for read-heavy invoice data.
Step by step
From first click to finished job
- 1
Customer opens an invoice link
GSM loads the invoice from Accounts (or Redis cache).
- 2
Card is entered in Stripe Elements
Card details never touch our servers.
- 3
Payment is confirmed server-side
Through Accounts, which updates the ledger.
- 4
Cache is invalidated
Payment webhooks clear stale invoice data.
Capabilities
What it does
Stripe Elements
Card data is tokenised by Stripe, reducing PCI scope.
Accounts integration
Invoice details and auth come from the central API.
Redis caching
Short-TTL invoice summaries, scoped by company and invoice.
Structured logging
Winston logs for payment debugging without exposing PII.
Engineering
Key decisions
Don't duplicate billing logic
GSM is the UI and glue; Accounts owns the money.
Fail fast
Declined payments return actionable errors immediately, with no long polling.
Architecture
Tech stack
UI
- Next.js
- TypeScript
- React Query
Payments & infra
- Stripe
- Redis
- Winston
Outcome
What it delivers
- Lightweight, mobile-friendly checkout separate from the admin UI
- Card handling delegated to Stripe, which simplifies security reviews
Deep dives
Read the engineering notes
Stripe Checkout in a Microservices Suite — The GSM Pattern
How GSM delivers a focused Next.js payment UI with Stripe Elements, Redis caching, and the Accounts API as the billing source of truth.
Prime Alley Microservices — One Product, Four Deployable Services
How we split billing, accounts, payments, and live updates into separate services while keeping a single login and navigation shell for end users.
Services behind it