PayFanout API reference
    Preparing search index...

    Class PaymentService

    Unified server-side orchestration over a registry of ServerPaymentAdapters.

    Stateless: holds no database and persists nothing. The consuming application owns the internal-id -> pspPaymentId mapping, the webhook dedupe store, and any audit log. Every call names the target PSP explicitly.

    Index
    • Capture is a charge — the idempotency key is required, per-capture under multi-capture.

      Parameters

      • pspName: string
      • pspPaymentId: string
      • amount: number | undefined
      • idempotencyKey: string

      Returns Promise<PaymentInfo>

    • Parameters

      • pspName: string
      • pspCustomerId: string
      • token: string

      Returns Promise<void>

    • Polls a refund to a terminal state (refundPayment can return "pending"). Gated on the refund READ, not on refund support: a PSP can move money out and expose no way to read the refund back.

      Parameters

      • pspName: string
      • refundId: string

      Returns Promise<RefundInfo>