Better Payment 0.11.1 API
    Preparing search index...

    Interface PluginContext

    What plugins get in init, methods and endpoints

    interface PluginContext {
        defaultProvider: string | undefined;
        errorCodes: Readonly<Record<string, string>>;
        logger: BetterPaymentLogger | undefined;
        mode: "sandbox" | "production";
        providerIds: readonly string[];
        use(providerId: string): PaymentProvider;
    }

    Hierarchy (View Summary)

    Index
    defaultProvider: string | undefined

    The default provider, if any

    errorCodes: Readonly<Record<string, string>>

    Error codes declared by the plugins ($ERROR_CODES), with their default messages

    logger: BetterPaymentLogger | undefined
    mode: "sandbox" | "production"
    providerIds: readonly string[]

    Ids of the configured providers

    • A provider by id. Its operations run with hooks and events.

      Parameters

      • providerId: string

      Returns PaymentProvider