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

    Service class for managing virtual payment instrument-related operations.

    Hierarchy

    • ApiService
      • VirtualPaymentInstrumentService
    Index

    Methods

    • Retrieves the supported virtual instrument types for the specific account.

      Parameters

      • accountId: string

        Id of balance account. (required)

      Returns Promise<VirtualInstrumentTypeList>

      A Promise that resolves to the virtual instrument types list

      if HTTP request fails

      // Example usage:
      virtualPaymentInstrumentService.getAccountVirtualInstrumentTypes(accountId)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error fetching supported virtual payment instrument types for the account.');
      })
    • Retrieves the virtual instrument requests of a customer. The virtual instruments can be obtained using the accounts API.

      Parameters

      Returns Promise<VirtualInstrumentRequestStatusList>

      A Promise that resolves to the retrieved virtual payment instruments

      if HTTP request fails

      // Example usage:
      virtualPaymentInstrumentService.getVirtualInstrumentRequests({ accountId: accountId,
      instrumentType: VirtualInstrumentType.US_BANK_ACCOUNT })
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error retrieving specified virtual payment instrument requests.');
      })
    • Retrieves the virtual instrument request status.

      Parameters

      • virtualInstrumentRequestId: string

        Virtual instrument request id. (required)

      Returns Promise<VirtualInstrumentRequestStatus>

      A Promise that resolves to the retrieved virtual payment instrument request status

      if HTTP request fails

      // Example usage:
      virtualPaymentInstrumentService.getVirtualInstrumentRequestStatus(virtualInstrumentRequestId)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error retrieving specified virtual payment instrument request status.');
      })
    • Request assignment of a new virtual instrument to existing balance account.

      Parameters

      Returns Promise<VirtualInstrumentRequestStatus>

      A promise that resolves to the virtual instrument request status.

      If the HTTP request fails.

      // Example usage:
      virtualPaymentInstrumentService.requestVirtualInstrument(request)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error requesting virtual instrument.');
      });
    • Function

      Retrieves the singleton instance of the VirtualPaymentInstrumentService class.

      Returns VirtualPaymentInstrumentService

      The singleton instance of the VirtualPaymentInstrumentService class.

      // Example usage:
      const virtualPaymentInstrumentService = VirtualPaymentInstrumentService.getInstance();