PayFanout API reference
    Preparing search index...

    Function createEndpointCompletion

    • The ServerCompletionCallback the provider's completionEndpoint derives: POST { sessionRef, clientToken, billingDetails? } to the host route that mounts @payfanout/server's createCompletionHandler, and resolve with the returned PaymentInfo. A non-2xx response is rebuilt into a PayFanoutError so the error code/message/retryable survive the wire and drive the UI (localizeError, retry affordances). Exported so hosts writing a custom transport can reuse the exact contract.

      Parameters

      • endpoint: string
      • sessionRef: string
      • OptionalbillingDetails: {
            address?: {
                city?: string;
                country?: string;
                line1?: string;
                postalCode?: string;
            };
            email?: string;
            name?: string;
        }
      • fetchImpl: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        } = fetch
          • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
          • Parameters

            • input: URL | RequestInfo
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input: string | URL | Request, init?: RequestInit): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

      Returns ServerCompletionCallback