@axonlabs/payments - v0.2.0
    Preparing search index...

    Class PlisioClient<T>

    PlisioClient is a type-safe SDK wrapper for interacting with the Plisio crypto payment API.

    It supports both default and whitelabel modes, and dynamically adjusts the invoice response types based on the selected mode. Whitelabel mode includes additional customization fields in the API response.

    This class handles authentication, query string generation, and API request execution. It ensures that the correct response type is returned for each mode.

    0.1.0

    0.1.0

    // Default client (standard Plisio hosted payment page)
    const client = new PlisioClient("your-secret-key", "default");
    const invoice = await client.createInvoice({ source_currency: "USD", source_amount: 10, order_number: 1, order_name: "order 1" });
    // Whitelabel client (custom hosted checkout experience)
    const client = new PlisioClient("your-secret-key", "whitelabel");
    const invoice = await client.createInvoice({ source_currency: "USD", source_amount: 10, order_number: 1, order_name: "order 1" });

    Type Parameters

    • T extends PlisioMode = "default"

      Mode of the client, either "default" or "whitelabel".

    Index

    Constructors

    Methods

    Constructors

    • Creates an instance of the Plisio client.

      Type Parameters

      Parameters

      • secret_key: string

        The Plisio API secret key used for authenticating requests.

      • mode: T

        The environment mode (e.g., "live" or "sandbox").

      Returns PlisioClient<T>

    Methods

    • Sends a request to Plisio to initiate a new withdrawal.

      Parameters

      • options: WithdrawRequestFields

        Fields required for the withdrawal, conforming to the WithdrawRequestFields type.

      Returns Promise<IWithdrawSuccess>

      A promise resolving to the data object from the successful withdrawal response.

      AxiosError if the API call fails, with additional context if available.