Skip to content

Design a Payment Processor

Published 3 October 2026

System Design — Payment Processor

A merchant sends payment requests to our payment processor, and our service communicates with the appropriate upstream payment network. The system needs to support two primary operations: Hold and Charge.

Part 1 — Hold Request

A merchant sends a hold request containing information such as:

  • account number
  • amount

The payment processor forwards the request to the appropriate payment network. The upstream processor then decides whether to approve or reject the hold. If approved, the requested funds or credit are temporarily reserved for a short period. The response is returned through our payment processor back to the merchant.

Part 2 — Charge Request

After a hold has been approved, the merchant may later submit the final charge. For example, the final amount could be determined after the customer completes the transaction and optionally adds a tip. If no charge request arrives within the hold period, the reserved funds should eventually be released.

Unlike the hold path, charges are not immediately sent upstream one at a time. Instead, charge requests should be accumulated and grouped by payment network. At a scheduled cutoff, such as 10 PM each evening, the processor creates a batch file for each upstream network and submits the corresponding charges together for settlement.