Service class for managing payment instrument related operations.

Hierarchy

  • ApiService
    • PaymentInstrumentService

Methods

  • Deletes single payment instrument specified with instrument type and identifier.

    Parameters

    Returns Promise<PaymentInstrument>

    A Promise that resolves to the deleted payment instrument

    Throws

    if HTTP request fails

    Example

    paymentInstrumentService.delete()
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error deleting specified payment instrument.');
    })
  • Returns single payment instrument specified with instrument type and identifier.

    Parameters

    Returns Promise<PaymentInstrument>

    A Promise that resolves to the retrieved payment instrument

    Throws

    if HTTP request fails

    Example

    paymentInstrumentService.get({ instrumentId: '2438764', instrumentType: InstrumentType.US_BANK_ACCOUNT })
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error retrieving specified payment instrument.');
    })
  • Retrieves a list of active payment instruments for the customer. Customer identifier is implicit. It is taken from the authorization token. Instruments can be additionally filtered by instrumentType and paymentOption filters.

    Parameters

    Returns Promise<PaymentInstrument[]>

    A Promise that resolves to the retrieved customer payment instruments

    Throws

    if HTTP request fails

    Example

    paymentInstrumentService.getAll({ instrumentType: InstrumentType.US_BANK_ACCOUNT })
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching payment instruments for the customer.');
    })
  • Retrieves list of user instrument verifications.

    Parameters

    Returns Promise<InstrumentVerificationList>

    A promise that resolves to an instrument verifications list.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.getAllVerifications(parameters)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching instrument verification list.');
    });
  • Retrieves instrument verification details for cards.

    Parameters

    • instrumentId: string

      The ID of the instrument.

    Returns Promise<CardVerificationInfo>

    A promise that resolves to an instrument verification details for cards.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.getCardVerificationInformation(instrumentId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching instrument verification details.');
    });
  • Returns a list of card verification attempts for the customer.

    Parameters

    Returns Promise<CardVerificationList>

    A promise that resolves to an instrument verifications list.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.getCardVerifications(queryParameters)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching card verification attempts list.');
    });
  • Retrieves card verification attempt information.

    Parameters

    • verificationId: string

      Verification attempt id.

    Returns Promise<CardVerification>

    A promise that resolves to card verification information.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.getSingleCardVerification(verificationId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching card verification information.');
    });
  • Retrieves a user specific instrument verification.

    Parameters

    • sessionId: string

      The ID of the verification/session to retrieve.

    Returns Promise<InstrumentVerification>

    A promise that resolves to an instrument verification.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.getVerification(sessionId)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error fetching instrument verification.');
    });
  • Starts instrument verification.

    Parameters

    Returns Promise<InstrumentVerification>

    A promise that resolves to the instrument verification.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.startVerification(request)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error starting instrument verification.');
    });
  • Perform card verification using verification code from previous successful transactions. The verification is required if either forced by risk and compliance or the card lifetime limit is reached.

    Parameters

    Returns Promise<CardVerification>

    A promise that resolves the instrument verification allows tracking the verification outcome.

    Throws

    If the HTTP request fails.

    Example

    // Example usage:
    paymentInstrumentService.verifyCard(request)
    .then((response) => {
    console.log(response);
    })
    .catch((error) => {
    console.error('Error in verifying the card payment instrument.');
    });
  • Retrieves the singleton instance of the PaymentInstrumentService class.

    Returns PaymentInstrumentService

    The singleton instance of the PaymentInstrumentService class.

    Function

    Static

    Example

    // Usage:
    const paymentInstrumentService = PaymentInstrumentService.getInstance();