PayFanout API reference
    Preparing search index...

    Implements

    Index
    pspName: "stripe" = STRIPE_PSP_NAME
    • Resolves "canceled" only when the PSP confirms it. Under getCapabilities().modificationOutcome "asynchronous" the PSP merely acknowledges the request and the outcome arrives by webhook, so the returned status is "processing" — never an unconfirmed terminal state.

      Parameters

      • pspPaymentId: string
      • idempotencyKey: string

      Returns Promise<PaymentInfo>

    • Only present if getCapabilities().supportsManualCapture. Capture is the canonical double-charge operation — the idempotency key is REQUIRED, and under supportsMultiCapture each partial capture is its own charge with its own key.

      Parameters

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

      Returns Promise<PaymentInfo>

    • POST /v1/subscriptions against customer + default_payment_method (the vaulted token — it must belong to that customer, so pspCustomerId is required here). planId (when given) is an existing Stripe Price id; without one the adapter builds the price inline via items[].price_data, which requires an existing Product — created on the fly (name merchantRefNum, falling back to "Subscription"; it shows on customer invoices) under a derived idempotency key so replays reuse it. off_session: true + payment_behavior: "error_if_incomplete": a first invoice that cannot be paid rejects with the mapped card error instead of leaving an incomplete subscription behind — server-only creation has no customer present to finish authentication. startAt maps to a future billing_cycle_anchor with proration_behavior: "none", making the span until the anchor free and the first full invoice due at startAt.

      Returns Promise<NativeSubscriptionRecord>

    • 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>