Back to Engineering Notes
Adrenaline SystemsLevel 3

Unifying Razorpay, Cashfree, and Manual Payments Into One Workflow

This note is about operational consistency: different payment methods, one business result.

Main decision

Every payment path creates a transaction first, then converges into one reconciliation and activation workflow. Member activation happens after provider truth is rechecked, not before.

Summary

The challenge was making Razorpay, Cashfree, and manual payments behave the same way operationally.

Core Decision

Every payment path creates a transaction first, then converges into one reconciliation and activation workflow. Member activation happens after provider truth is rechecked, not before.

Problem

Razorpay, Cashfree, and manual proof do not share the same trust model or timing model.

A gym operator still expects the system to answer one business question clearly: has this payment been finalized strongly enough to activate the membership?

Without convergence, each provider path becomes a separate operational rulebook.

Why It Was Difficult

Webhooks can be late, duplicated, or out of order, and manual proofs need human review rather than immediate provider trust.

If membership activation happens too early, the system can grant access before reconciliation is real.

Provider-specific flows are tempting to optimize separately, but that would create fragmented operational behavior.

Solution

Create a transaction before provider launch or manual proof submission so every path begins with the same business artifact.

Collect webhook events or manual review outcomes, then recheck provider truth server-side before finalization.

Run reconciliation in one finalization path that decides whether the payment is accepted, rejected, or still pending.

Activate memberships only after reconciliation succeeds so all input paths produce the same business outcome.

Impact

Staff and operators reason about one payment finalization model instead of three unrelated ones.

Manual proof and gateway flows differ at the trust-input stage, not at the business outcome stage.

Payment completion becomes easier to audit because every path converges on the same finalization artifact.

Tradeoff

The backend accepts more coordination work so the operational surface stays consistent.

Gateway-specific nuance still exists, but it is contained before the finalization boundary.

This approach is heavier than provider-specific shortcuts, but it keeps membership activation trustworthy.

Ownership note

AI-assisted implementation. Architecture, decisions, tradeoffs, and UX ownership were mine.

Related Notes

Adrenaline Systems

Designing Membership Lifecycles Instead of Mutating Subscriptions

A gym subscription is not just a row with a status. It can renew, expire, freeze, resume, refund, and interact with queued coverage, add-ons, and branch rules.

Adrenaline Systems

Why Freeze Requests Are Ledger Entries Instead of Subscription States

Instead of setting subscription status to "frozen," the freeze system represents freezes as policy-bound ledger entries that shift coverage dates and preserve auditability.

Next step

Trace the note back to the system, or continue the conversation.

These notes are part of larger systems work. You can return to the related project context or reach out if you need someone who can reason through workflows, authorization, and operational software without making them harder to operate.