Service class for managing transfers related operations.

Hierarchy

  • ApiService
    • TransferService

Methods

  • Confirms a transfer for execution (processing state).

    Parameters

    Returns Promise<CustomerTransfer>

    A promise that resolve to the updated transfer.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transferService.confirm(transferConfirm)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error processing transfer`);
    });
  • Requests a transfer creation (pending state).

    Parameters

    Returns Promise<CustomerTransfer>

    A promise that resolve to the updated transfer.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transferService.create(transferCreate)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error creating transfer`);
    });
  • Retrieves a transfer by id.

    Parameters

    • id: string

      The id of the transfer.

    Returns Promise<CustomerTransfer>

    A promise that resolves to a transfer.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transferService.get(transferId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching transfer.`);
    });
  • Retrieves user transfers with pagination metadata.

    Parameters

    Returns Promise<CustomerTransferList>

    A promise that resolves to a transfer list.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transferService.getAll({ limit: 5 })
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching transfers.`);
    });
  • Creates a transfer preview.

    Parameters

    Returns Promise<CustomerTransfer>

    A promise that resolves to the newly created transfer preview.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    transferService.preview(transferPreviewRequest)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error creating transfer.`);
    });
  • Retrieves the singleton instance of the TransferService class.

    Returns TransferService

    The singleton instance of the TransferService class.

    Function

    Static

    Example

    // Usage:
    const transferService = TransferService.getInstance();