Klarna Web SDK v2
    Preparing search index...

    Interface KlarnaPaymentButton

    interface KlarnaPaymentButton {
        htmlElement: HTMLElement;
        id?: string;
        mount(containerSelector: string | HTMLElement): this;
        on(event: "render", callback: (button: this) => Promise<void>): this;
        on(event: "click", callback: (button: this) => Promise<void>): this;
        toggleState(state: "disabled" | "loading", value?: boolean): this;
        unmount(): this;
    }

    Hierarchy (View Summary)

    Index

    Properties

    htmlElement: HTMLElement
    id?: string

    Methods

    • Parameters

      • containerSelector: string | HTMLElement

      Returns this

    • The render event is triggered after the button is fully visible.

      Parameters

      • event: "render"

        render

      • callback: (button: this) => Promise<void>

        Render event handler callback, triggered on render.

      Returns this

    • The click event is triggered after the button is clicked.

      Parameters

      • event: "click"

        click

      • callback: (button: this) => Promise<void>

        Render event handler callback, triggered on click.

      Returns this

    • Parameters

      • state: "disabled" | "loading"

        State "disabled" disables/enables the button, e.g. makes it non-interactive/interactive State "loading" displays/hides the loading indicator in the button

      • Optionalvalue: boolean

        can be used to set the state to a specific value instead of toggling

      Returns this