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 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.');
    });
  • 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();