Payment System Architecture for Event Marketplace by Ali ShanPayment System Architecture for Event Marketplace by Ali Shan

Payment System Architecture for Event Marketplace

Ali Shan

Ali Shan

Role: Backend Engineer and Payment Architect
Project Overview
I built the full payment system and backend for a regulated event ticketing marketplace. The platform works as the Merchant of Record, meaning it processes all payments, handles organizer payouts, and manages compliance on behalf of event hosts. Because of the client’s industry restrictions, we integrated with a high risk payment gateway.
Technical Architecture
Stack: Next.js with Supabase using PostgreSQL, Realtime, and Edge Functions.
Payments: All payments were handled server side using tokenization through the gateway API. No raw card data ever touched our application servers.
Webhooks: Built an idempotent webhook handler with signature verification, deduplication keys, and retry safe logic to prevent double charges or missed events.
Ledger: Designed a double entry accounting system in PostgreSQL. It tracks ticket revenue, platform fees, organizer payouts, partial refunds, promo usage, and chargeback reserves.
Core Deliverables
Payout System: Automated organizer payouts with configurable hold periods, reconciliation reports, and chargeback reserve buffers.
Promo Engine: Server validated promo codes supporting percentage discounts, fixed amounts, event specific rules, and usage limits.
Refunds and Chargebacks: Implemented partial refund logic with proper ledger adjustments and a chargeback dispute flow with evidence submission.
Messaging: Built organizer to guest messaging using Supabase Realtime with read receipts and event based push notifications.
Transactional Email: Integrated Resend for order confirmations, refund receipts, payout summaries, and chargeback alerts.
PCI Compliance: Used tokenized card handling, server side only charge execution, encrypted webhook payloads, and immutable audit logs.
Outcome
Processed over 2,000 transactions in the first month with zero payment discrepancies. Reduced organizer payout errors to zero through automated reconciliation. Passed PCI compliance review on the first submission.
Key Skills
Supabase including PostgreSQL, Realtime, and Edge Functions
Payment gateway integration and tokenization
Webhook architecture
Ledger and accounting system design
PCI compliance
Like this project

Posted Feb 19, 2026

Built a payment system and backend for a regulated event ticketing platform.