Service class for managing deposit related operations.

Hierarchy

  • ApiService
    • DepositService

Methods

  • Requests a deposit status update.

    Parameters

    Returns Promise<CustomerDeposit>

    A promise that resolves to the updated deposit.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.confirm(depositId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error processing deposit.`);
    });
  • Requests a deposit creation.

    Parameters

    Returns Promise<CustomerDeposit>

    A promise that resolves to the updated deposit.

    Throws

    If the HTTP request fails.

    Example

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

    Parameters

    • id: string

      The id of the deposit.

    Returns Promise<CustomerDeposit>

    A promise that resolves to a deposit.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.get(depositId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching deposit.`);
    });
  • Retrieves user deposits with pagination metadata.

    Parameters

    Returns Promise<CustomerDepositList>

    A promise that resolves to a deposit list.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.getAll({ limit: 5 })
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error fetching deposits.`);
    });
  • Retrieves all deposit options.

    Returns Promise<PaymentOptionDetails[]>

    A promise that resolves to a list of deposit options.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.getOptions()
    .then((options) => {
    console.log(options);
    })
    .catch((error) => {
    console.error(`Error fetching deposit options.`);
    });
  • Retrieves all paysafecash locations filtered by the parameters in the request.

    Parameters

    Returns Promise<PaysafecashLocation[]>

    A promise that resolves to a list of deposit options.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.getPaysafecashLocations(paysafecashLocationRequest)
    .then((locations) => {
    console.log(locations);
    })
    .catch((error) => {
    console.error(`Error fetching paysafecash locations.`);
    });
  • Creates a deposit preview.

    Parameters

    Returns Promise<CustomerDeposit>

    A promise that resolves to the newly created deposit preview.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    depositService.preview(depositRequest)
    .then((deposit) => {
    console.log(deposit);
    })
    .catch((error) => {
    console.error(`Error creating deposit.`);
    });
  • Retrieves the singleton instance of the DepositService class.

    Returns DepositService

    The singleton instance of the DepositService class.

    Function

    Static

    Example

    // Usage:
    const depositService = DepositService.getInstance();