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

    Class PaymentInstrumentService

    Service class for managing payment instrument related operations.

    Hierarchy

    • ApiService
      • PaymentInstrumentService
    Index

    Methods

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

      Parameters

      Returns Promise<PaymentInstrument>

      A Promise that resolves to the deleted payment instrument

      if HTTP request fails

      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

      if HTTP request fails

      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

      if HTTP request fails

      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.

      If the HTTP request fails.

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

      If the HTTP request fails.

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

      If the HTTP request fails.

      // Example usage:
      paymentInstrumentService.getCardVerifications(queryParameters)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error fetching card verification attempts list.');
      });
    • Retrieves localization mapping for a specific field.

      Parameters

      • paymentOption: string

        The payment option (e.g., 'BANK_TRANSFER').

      • instrumentType: string

        The instrument type (e.g., 'PH_BANK_ACCOUNT').

      • fieldName: string

        The field name to localize (e.g., 'bankCodeId').

      Returns Promise<Record<string, Record<string, string>>>

      A promise that resolves to the localization map for all supported locales.

      If the HTTP request fails.

      // Example usage:
      paymentInstrumentService.getLocalization('BANK_TRANSFER', 'PH_BANK_ACCOUNT', 'bankCodeId')
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error('Error fetching localization.');
      });
    • Retrieves card verification attempt information.

      Parameters

      • verificationId: string

        Verification attempt id.

      Returns Promise<CardVerification>

      A promise that resolves to card verification information.

      If the HTTP request fails.

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

      If the HTTP request fails.

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

      If the HTTP request fails.

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

      If the HTTP request fails.

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

      Retrieves the singleton instance of the PaymentInstrumentService class.

      Returns PaymentInstrumentService

      The singleton instance of the PaymentInstrumentService class.

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