Year

2026

Healthcare · Therapy SaaS

Duration

12+

Stripe webhook + payment ledger

Adapter pattern with a Mock twin for local. Signature-verified raw-body Nest route. Payment.eventId unique. Renewal pipeline gates credits on exact-period payment evidence.

TRS overview

Payments are abstracted behind a small adapter interface so the Mock implementation can drive integration tests deterministically. The webhook is its own raw-body Nest route — request body parsing is disabled on that path so signature verification works against the original bytes. Every Payment row carries a unique eventId; the same Stripe event can never be applied twice. Renewals are tied to exact-period payment evidence; missing evidence flips the subscription state to PAST_DUE rather than silently extending access.

Mechanics
  • Adapter pattern (Stripe + Mock).
  • Raw-body route + signature verification.
  • Unique Payment.eventId for idempotency.
  • Renewal credits gated on period-matched payments.
  • Subscription → PAST_DUE on missed renewal payment.
More deep dives

Got something
this size?

Big ambitions, we match the energy. Drop a brief — reply within one working day.