Constructors

  • Parameters

    • merchant: string
    • paymentToken: string

    Returns Cryptomus

Methods

  • Generates a signature for the given data and key.

    Parameters

    • data: Record<string, any>

      The data to generate the signature for.

    • key: string

      The key used in the signature generation.

    Returns string

    The generated signature.

  • Sends a request to the specified route using the given HTTP method and token type.

    Type Parameters

    • T

    Parameters

    • method: E_HTTP

      The HTTP method to use for the request.

    • type: PAYMENT

      The type of token to use for authentication.

    • route: string

      The route to send the request to.

    • data: Record<string, any>

      The data to include in the request.

    Returns Promise<T>

    • A promise that resolves with the response data.
  • Verifies the signature of the given data.

    Parameters

    • data: Record<string, any>

      The data to verify the signature for.

    Returns boolean

    Returns true if the signature is valid, false otherwise.