Service class for cards operations.

Hierarchy

  • ApiService
    • CardService

Methods

  • Activates a prepaid PHYSICAL card

    Parameters

    • cardId: string

      UUID based Card id.

    • Optional request: CardActivationRequest

      The request contains the required fields for activating the card.

    Returns Promise<Card>

    A Promise that resolves to the retrieved card.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    • Optional include: CardIncludesParam[]

      List of CardIncludesParam properties in the response.

    Returns Promise<Card>

    A Promise that resolves to the retrieved card.

    Throws

    If the HTTP request fails.

    Example

    // 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

    • Optional parameters: CardParameters

      The parameters for filtering the customer's cards.

    Returns Promise<CardList>

    A Promise that resolves to the retrieved card list.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    • Optional language: string

      Language in which to show details. Default is en_US.

    • Optional scaDetails: ScaAuthenticationEventRequest

      The SCA details for retrying the wallet operation.

    Returns Promise<string>

    A Promise that resolves to cards details url.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    Throws

    If the HTTP request fails.

    Example

    // 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.

    • Optional language: string

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

    • Optional scaDetails: ScaAuthenticationEventRequest

      The SCA details for retrying the wallet operation.

    Returns Promise<string>

    A Promise that resolves to cards details url.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    cardService.getViewPinUrl()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error getting card view pin url.`);
    });
  • 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.

    Throws

    If the HTTP request fails.

    Example

    // 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: null | CardUpdateRequest

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

    • Optional scaDetails: ScaAuthenticationEventRequest

      The SCA details for retrying the wallet operation.

    Returns Promise<Card>

    A Promise that resolves to the retrieved card.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    cardService.update()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error(`Error updating card.`);
    });
  • Retrieves the singleton instance of the CardService class.

    Returns CardService

    The singleton instance of the CardService class.

    Function

    Static

    Example

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