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

    Service class for managing customer data verification operations.

    Hierarchy

    • ApiService
      • CustomerDataVerificationService
    Index

    Methods

    • Initiates a verification process for a specific customer attribute, such as email or phone.

      The verification process is closely linked to a specific customer attribute. Each initiation creates a new process, but if the customer attribute is the same, the currentProcesses will be incremented. A new process can only be initiated a limited number of times, as defined by allowableProcesses. If this limit is exceeded, an error will be returned, and the same customer attribute cannot be verified for a certain period of time. After the cooldown period ends, the currentProcesses are reset, and the verification process can be started again.

      Only the most recent verification process linked to a specific customer attribute is marked as active, while all previous ones are marked as failed. The process status is determined by the latest verification attempt associated with it.

      A verification process may have a predefined expiration time. After this period (if applicable), the process will be automatically marked as expired, and a new one must be started to complete the verification process for the same customer attribute, adhering to the same rules previously described.

      Parameters

      Returns Promise<CustomerDataVerificationResponse>

      A promise that resolves to the newly created verification process.

      If the HTTP request fails.

      // Example usage:
      customerDataVerificationService.initiateDataVerificationProcess(customerDataVerificationRequest)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error initiating verification process.`);
      });
    • Submits a verification attempt for a specific customer attribute tied to an already initiated verification process.

      Once a verification process for a specific customer attribute is initiated and active (not expired or failed), the user has a limited number of attempts to complete it (e.g., enter the OTP code sent via email), as defined by the allowableAttempts. Each new verification attempt increments the currentAttempts count until it reaches the predefined limit. When the limit is reached, no further verification attempts for the same process are accepted and are automatically denied. There is no cooldown period, and the verification process is marked as failed. To retry the verification, a new verification process must be started, and the user can attempt the verification again.

      Parameters

      • verificationId: string

        A unique identifier for the verification process associated with a particular customer attribute.

      • customerDataVerificationAttemptRequest: CustomerDataVerificationAttemptRequest

        The request payload for submitting a verification attempt.

      Returns Promise<CustomerDataVerificationAttemptResponse>

      A promise that resolves to the newly created verification attempt submission.

      If the HTTP request fails.

      // Example usage:
      customerDataVerificationService.submitDataVerificationAttempt(verificationId, customerDataVerificationAttemptRequest)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error submitting verification attempt.`);
      });
    • Function

      Retrieves the singleton instance of the CustomerDataVerificationService class.

      Returns CustomerDataVerificationService

      The singleton instance of the CustomerDataVerificationService class.

      // Usage:
      const customerDataVerificationService = CustomerDataVerificationService.getInstance();