Architecture

System Architecture

The platform is built using an event-driven payment architecture.

Core Components

Payment Lifecycle Tracking

The platform tracks every stage of a payment.

Payment Status

  • requires_capture
  • succeeded
  • canceled
  • refunded
  • partially_refunded
  • disputed
  • disputed_lost

Authorization Lifecycle

  • authorized
  • captured
  • canceled

Refund Lifecycle

  • none
  • partial
  • full

Dispute Lifecycle

  • open
  • in_review
  • won
  • lost

Stripe Webhook Processing

Stripe events are processed through a centralized endpoint.

POST /webhook

Supported events include:

The system ensures idempotent processing so events are never applied twice.

Firestore Ledger Model

The platform maintains a financial ledger in Google Cloud Firestore.

Core collections:

These collections provide a complete financial audit trail.

Authentication & Access

The platform controls access via authentication and authorization boundaries.

Risk & Exposure Engine

The platform includes a merchant exposure analysis engine.

Metrics include:

Example health score:

health_score = net_exposure / original_amount

API reference →   Technical details →