Archicise
Exercise

Design a Payment System

Build a payment processing platform that handles transactions, manages wallets, and integrates with external payment providers.

Functional Requirements

  • Process credit card and bank transfer payments
  • Manage user wallets with balance tracking
  • Handle refunds and chargebacks
  • Support multiple currencies
  • Generate invoices and receipts
  • Subscription and recurring payments

Non-Functional Requirements

  • Exactly-once payment processing (no double charges)
  • PCI DSS compliance
  • 99.99% availability for payment processing
  • Complete audit trail for all transactions

Questions to Consider

  • How do you ensure exactly-once payment semantics?
  • What patterns handle distributed transaction consistency?
  • How do you design for PCI compliance?
Your Solution

Transaction Flow

Design the payment transaction lifecycle. Consider authorization, capture, settlement, and handling pending states.