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

    Class CardService

    Service class for cards operations.

    Hierarchy

    • ApiService
      • CardService
    Index

    Methods

    • Activates a prepaid PHYSICAL card

      Parameters

      • cardId: string

        UUID based Card id.

      • Optionalrequest: CardActivationRequest

        The request contains the required fields for activating the card.

      Returns Promise<Card>

      A Promise that resolves to the retrieved card.

      If the HTTP request fails.

      // Example usage:
      cardService.activate()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error activating card.`);
      });
    • Create a prepaid card.

      Parameters

      • request: CardRequest

        The request containing card creation parameters.

      Returns Promise<Card>

      A promise that resolves to the newly added card.

      If the HTTP request fails.

      // Example usage:
      cardService.create()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error creating card.`);
      });
    • This endpoint provides detailed information about specific Card by cardId.

      Parameters

      • cardId: string

        UUID based Card id.

      • Optionalinclude: CardIncludesParam[]

        List of CardIncludesParam properties in the response.

      Returns Promise<Card>

      A Promise that resolves to the retrieved card.

      If the HTTP request fails.

      // Example usage:
      cardService.get()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching card.`);
      });
    • Retrieves a list of all customer cards. The result list can be filtered by card status and card type.

      Parameters

      • Optionalparameters: CardParameters

        The parameters for filtering the customer's cards.

      Returns Promise<CardList>

      A Promise that resolves to the retrieved card list.

      If the HTTP request fails.

      // Example usage:
      cardService.getAll()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching cards.`);
      });
    • Card sensitive information can be retrieved via this endpoint.

      Parameters

      Returns Promise<CardSensitiveDetails>

      A Promise that resolves to the retrieved card sensitive details.

      If the HTTP request fails.

      // Example usage:
      cardService.getDetails()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching card sensitive details.`);
      });
    • Retrieves card details url to show them for non PCI DSS compliant cases.

      Parameters

      • cardId: string

        UUID based Card id.

      • Optionallanguage: string

        Language in which to show details. Default is en_US.

      • OptionalscaDetails: ScaAuthenticationEventRequest

        The SCA details for retrying the wallet operation.

      Returns Promise<string>

      A Promise that resolves to cards details url.

      If the HTTP request fails.

      // Example usage:
      cardService.getDetailsUrl()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error getting card details url.`);
      });
    • Retrieves eligible programs for a customer.

      Returns Promise<ProgramList>

      A Promise that resolves to the retrieved program list.

      If the HTTP request fails.

      // Example usage:
      cardService.getPrograms()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching card eligible programs.`);
      });
    • Retrieves card view pin url for non PCI DSS compliant cases.

      Parameters

      • cardId: string

        UUID based Card id.

      • Optionallanguage: string

        The language in which to show details. Default is en_US.

      • OptionalscaDetails: ScaAuthenticationEventRequest

        The SCA details for retrying the wallet operation.

      Returns Promise<string>

      A Promise that resolves to cards details url.

      If the HTTP request fails.

      // Example usage:
      cardService.getViewPinUrl()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error getting card view pin url.`);
      });
    • Creates a new replacement card to the existing card. Bear in mind that its status will be changed after replacing the original card based on the 'reason' for this request. The status of the new card depends on the current card program.

      Parameters

      • cardId: string

        UUID based Card id.

      • request: CardReplacementRequest

        Contains the needed information for card replacement.

      Returns Promise<Card>

      A Promise that resolves to the newly issued card.

      If the HTTP request fails.

      // Example usage:
      cardService.replace()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error during card replacement call.`);
      });
    • Resets the verification attempt counters for both PIN/CVV on a prepaid card. It clears failed attempts, restoring the card's ability to authorize transactions.

      Parameters

      Returns Promise<CardAttemptResetInfo>

      A Promise that resolves to the retrieved response.

      If the HTTP request fails.

      // Example usage:
      cardService.resetVerificationAttempts()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error resetting card verification attempts.`);
      });
    • The endpoint enables updating a card’s state like status and PIN.

      Parameters

      • cardId: string

        UUID based Card id.

      • request: CardUpdateRequest | null

        The fields submitted in this object will update the existing values for the

      • OptionalscaDetails: ScaAuthenticationEventRequest

        The SCA details for retrying the wallet operation.

      Returns Promise<Card>

      A Promise that resolves to the retrieved card.

      If the HTTP request fails.

      // Example usage:
      cardService.update()
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error updating card.`);
      });
    • Function

      Retrieves the singleton instance of the CardService class.

      Returns CardService

      The singleton instance of the CardService class.

      // Usage:
      const CardService = CardService.getInstance();