@paysafe/paysafe-wallet-saas-web
    Preparing search index...

    Class ProfileService

    Service class for managing user related operations.

    Hierarchy

    • ApiService
      • ProfileService
    Index

    Methods

    • Adds a new customer account.

      Parameters

      Returns Promise<Account>

      A promise that resolves to the newly added customer account.

      If the HTTP request fails.

      // Example usage:
      profileService.addAccount()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error adding customer account.`);
      });
    • Retrieves customer accounts.

      Returns Promise<Account[]>

      A Promise that resolves to the retrieved customer accounts.

      If the HTTP request fails.

      // Example usage:
      profileService.getAccounts()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching customer accounts.`);
      });
    • Get available currencies for a customer.

      Returns Promise<AvailableCurrencies>

      A promise that resolves to the available currencies.

      If the HTTP request fails.

      // Example usage:
      profileService.getAvailableCurrencies()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching available currencies.`);
      });
    • Retrieves customer information. By default, limited information is returned (include param is empty array).

      Parameters

      • include: ProfileInclude[] = []

        The list of additional information to include in the response.

      Returns Promise<CustomerInfo>

      A Promise that resolves to the retrieved customer information.

      If the HTTP request fails.

      // Example usage:
      profileService.getProfile()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching customer information.`);
      });
    • Retrieves customer account.

      Parameters

      • accountId: string

        The ID of the account to retrieve.

      Returns Promise<Account>

      A Promise that resolves to the retrieved customer account.

      If the HTTP request fails.

      // Example usage:
      profileService.getSingleAccount()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching customer account.`);
      });
    • Updates customer personal information.

      Updating the following customer details might result in customer restriction and require new KYC Verification:

      • firstName, lastName - re-trigger KYC verification
      • address - re-trigger address verification of KYC process

      To update the following details, the customer must be non-KYC verified. If the customer is KYC verified, you cannot update these details:

      • birthDate

      Parameters

      Returns Promise<CustomerInfo>

      A Promise that resolves to the updated customer information.

      // Example usage:
      profileService.updateProfile(updateCustomerRequest)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error updating customer information.`);
      });
    • Function

      Retrieves the singleton instance of the ProfileService class.

      Returns ProfileService

      The singleton instance of the ProfileService class.

      // Usage:
      const profileService = ProfileService.getInstance();