PayFanout API reference
    Preparing search index...

    Adyen is a PUSH-ONLY provider: its pspReference is a write target, there is no read for a payment or a refund, and every modification answers with a bare acknowledgement whose outcome arrives by webhook. Two consequences shape this adapter:

    • Capabilities declare supportsPaymentRetrieval: false, supportsRefundRetrieval: false and modificationOutcome: "asynchronous"; capture and cancel resolve "processing" and refunds "pending", never a terminal state Adyen has not confirmed.
    • PaymentInfo.pspPaymentId is the composite "{pspReference}:{value}:{currency}". A capture or refund needs the payment's currency (and, when no amount is given, its value); with no read and no persistence, the money facts ride the reference. The part before the first ":" is Adyen's own pspReference — the one webhooks report — and cancels accept it bare.

    Implements

    Index
    pspName: "adyen" = ADYEN_PSP_NAME
    • Requests a capture. Adyen answers { status: "received" }, so the reported status is "processing" and no amountCaptured is invented — the settled amount is knowable only from the CAPTURE webhook.

      Parameters

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

      Returns Promise<PaymentInfo>

    • Tokenize-first completion. clientToken is the JSON the client adapter's confirm() produced:

      • the encrypted paymentMethod blob from Adyen's hosted card fields, which creates the payment (POST /payments), or
      • { details, paymentData } from a resolved action, which finishes it (POST /payments/details).

      The signed context is the only trusted source of amount/currency/capture method. An action in the response surfaces as requires_action with the action preserved on raw; a refusal is raised as a mapped PayFanoutError rather than folded into a "failed" PaymentInfo.

      Parameters

      Returns Promise<PaymentInfo>

    • Webhook handling — same adapter, separate concerns. Both async: future PSPs may need remote key retrieval; the contract stays uniform. MUST operate on the RAW request body bytes/string — re-serializing a parsed body breaks signatures (the conformance suite tests this).

      Parameters

      • rawBody: string
      • headers: Record<string, string>

      Returns Promise<boolean>