Better Payment 0.11.1 API
    Preparing search index...

    Interface NotificationsOptions

    interface NotificationsOptions {
        channels: NotificationChannel[];
        fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
        filter?: (event: NotificationEvent) => boolean;
        format?: (event: NotificationEvent) => string;
        locale?: NotificationLocale;
        minAmount?: number;
        onError?: (
            error: unknown,
            channel: string,
            event: NotificationEvent,
        ) => void;
        timeout?: number;
        waitUntil?: (promise: Promise<unknown>) => void;
    }
    Index
    fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

    The fetch used for Slack, Discord and Telegram. Default: global fetch

    Type Declaration

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

        • input: RequestInfo | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

    filter?: (event: NotificationEvent) => boolean

    Return false to skip an event

    format?: (event: NotificationEvent) => string

    Builds the message text instead of the default one

    Language of the default messages. Default: 'en'

    minAmount?: number

    Skip events with an amount below this (compared as a number, in any currency). Events without an amount are always sent.

    onError?: (error: unknown, channel: string, event: NotificationEvent) => void

    Called when a channel fails. Default: the payment logger's error

    timeout?: number

    Gives up on a channel after this many milliseconds. Default: 10000

    waitUntil?: (promise: Promise<unknown>) => void

    Keeps the runtime alive until the messages are sent, on serverless platforms: Vercel's waitUntil, or ctx.waitUntil on Cloudflare Workers.