Payment Event Processor
Project Overview
The Payment Event Processor is a cloud-native payment infrastructure built to support multi-merchant SaaS platforms.
The system provides a centralized payment ledger, webhook processing engine, and merchant dashboard built on Stripe Connect, Google Cloud Run, Firestore, and event-driven architecture. The goal is to simplify the complex payment lifecycle for SaaS platforms.
Problem Statement & Solution
Platforms integrating payments face several challenges.
Payment Lifecycle Complexity
Payments involve multiple states including: authorization, capture, refunds, partial refunds, and disputes. Maintaining accurate financial records requires reliable event processing.
Solution: An event-driven webhook processing engine translates payment events into structured ledger updates in Firestore, maintaining a complete audit trail across the full lifecycle (authorization, capture, refunds, and disputes).
Stripe Webhook Complexity
Stripe generates dozens of event types including
payment_intent events, charge events,
dispute events, and refund events. Without
proper infrastructure, webhook handling can lead to inconsistent
states.
Solution: A centralized webhook endpoint normalizes supported Stripe events into consistent ledger mutations and guarantees idempotent processing, so events are never applied twice.
Multi-Tenant Platform Requirements
SaaS platforms must isolate merchant data while maintaining platform-level visibility. Requirements include: tenant isolation, merchant onboarding, compliance handling, and risk monitoring.
Solution: Stripe Connect keeps sensitive financial data isolated per merchant, while the platform enforces tenant isolation with authentication + RBAC and Firestore data-ownership checks. A risk engine provides exposure and payment-health metrics for both merchants and administrators.
Merchant Dashboard
The system includes a web-based dashboard where merchants can:
- View payments
- Monitor refunds
- Track disputes
- Analyze payment timelines
Administrators have access to a cross-tenant platform view.