TransactionHistoryService

public class TransactionHistoryService

The service provides the API to request the transaction history that is performed on card provided.

It can also be used for Transaction Notification as the application needs to pass digitalCardID received from push notification.

Since

7.0.0
  • Data structure containing data related to a transaction.

    Since

    7.0.0
    See more

    Declaration

    Swift

    public struct Record : Sendable
  • Constructor for TransactionHistoryService.

    Declaration

    Swift

    public init()
  • Retrieves the transaction history for a given card.

    Throws:

    • clientError(_:) if transaction records are nil or empty or if the server fails with any unexpected error on fetching Transaction History.
    • serverError(_:) if there is any server error or communication error.
    • networkError if there is a network connectivity error or connection timeout.
    • deviceEnvironmentUnsafe(_:) if device environment is unsafe.
    • Else, unknown(_:) if an unexpected error encountered.

    Declaration

    Swift

    public func records(
        forDigitalCardID digitalCardID: String,
        transactionRecordType: String? = nil
    ) async throws -> [Record]

    Parameters

    digitalCardID

    The digital card ID that is used.

    transactionRecordType

    Pass this parameter when retrieving transaction records after receiving a push notification from TNS when a transaction is complete. Pass the value of transactionRecordType from the notification payload directly into this API.

    Return Value

    The list of transactions in the array of Record. Depending on scheme used, it is bounded by time range (last 30 days) or maximum number of transactions (only the last 10 transactions). If transactionRecordType is supplied, only the transactions from the appropriate card is returned.

  • The transaction statuses.

    Since

    7.0.0
    See more

    Declaration

    Swift

    public enum Status : Sendable
  • The transaction types.

    Since

    7.0.0
    See more

    Declaration

    Swift

    public enum TransactionType : Sendable
  • Errors encountered for TransactionHistoryService.

    Since

    7.0.0
    See more

    Declaration

    Swift

    public enum Error : Swift.Error