DefaultTerminalListener

open class DefaultTerminalListener : TerminalListener, CustomStringConvertible

Default implementation of listener for asynchronous terminal events. Implements methods to call {@link #requestCompleted} and {@link #printReceipts} as convenience call.

Subclasses usually only overwrite {@link #requestCompleted} and {@link #printReceipts}. If you overwrite methods inherited from {@link TerminalListener} make sure to super call to still get {@link #requestCompleted} and {@link #printReceipts} called.

  • Create default terminal listener.

    Declaration

    Swift

    public init()
  • Called if a {@link Terminal#connect()} started request finished. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func connectCompleted(event: TimEvent)
  • Called if a {@link Terminal#disconnect()} started request finished. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func disconnectCompleted(event: TimEvent)
  • Called if an {@link Terminal#activateAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains activation sequence counter and print information for the merchant.

    Declaration

    Swift

    open func activateCompleted(event: TimEvent, data: ActivateResponse?)
  • Called if an {@link Terminal#applicationInformationAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func applicationInformationCompleted(event: TimEvent)
  • Called if an {@link Terminal#balanceAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains counters and print information for the merchant.

    Declaration

    Swift

    open func balanceCompleted(event: TimEvent, data: BalanceResponse?)
  • Called if an {@link Terminal#changeSettingsAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func changeSettingsCompleted(event: TimEvent)
  • Called if an {@link Terminal#commitAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func commitCompleted(event: TimEvent, data: PrintData?)
  • Called if an {@link Terminal#counterRequestAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains counters.

    Declaration

    Swift

    open func counterRequestCompleted(event: TimEvent, data: Counters?)
  • Called if an {@link Terminal#deactivateAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains counters and print information for the merchant.

    Declaration

    Swift

    open func deactivateCompleted(event: TimEvent, data: DeactivateResponse?)
  • Called if an {@link Terminal#dccRatesAsync} started request finished. If not implemented invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains print information for merchant.

    Declaration

    Swift

    open func dccRatesCompleted(event: TimEvent, data: PrintData?)
  • Called if an {@link Terminal#hardwareInformationAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains information about EFT Terminal hardware and EMV kernels and configuration parameters supported by the EFT Terminal.

    Declaration

    Swift

    open func hardwareInformationCompleted(event: TimEvent, data: HardwareInformationResponse?)
  • Called if an {@link Terminal#initTransactionAsync} started request finished. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func initTransactionCompleted(event: TimEvent, data: CardData?)
  • Called if an {@link Terminal#loginAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func loginCompleted(event: TimEvent)
  • Called if an {@link Terminal#logoutAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func logoutCompleted(event: TimEvent)
  • Called if an {@link Terminal#rebootAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func rebootCompleted(event: TimEvent)
  • Called if an {@link Terminal#reconciliationAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains counters and print information for the merchant.

    Declaration

    Swift

    open func reconciliationCompleted(event: TimEvent, data: ReconciliationResponse?)
  • Called if an {@link Terminal#receiptRequestAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains all requested receipts up to a maximum number of receipts the EFT Terminal can send. if HasMoreReceipts is True not all receipts could be send by the EFT Terminal. call ReceiptRequest again to obtain more receipts.

    Declaration

    Swift

    open func receiptRequestCompleted(event: TimEvent, data: ReceiptRequestResponse?)
  • Called if an {@link Terminal#reconfigAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains print information for the merchant.

    Declaration

    Swift

    open func reconfigCompleted(event: TimEvent, data: PrintData?)
  • Called if an {@link Terminal#rollbackAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains print information for the merchant and cardholder.

    Declaration

    Swift

    open func rollbackCompleted(event: TimEvent, data: PrintData?)
  • Called if an {@link Terminal#softwareUpdateAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains update status.

    Declaration

    Swift

    open func softwareUpdateCompleted(event: TimEvent, data: CUpdateStatus?)
  • Called if an {@link Terminal#systemInformationAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains configuration and network information of the terminal.

    Declaration

    Swift

    open func systemInformationCompleted(event: TimEvent, data: SystemInformationResponse?)
  • Called if an {@link Terminal#transactionAsync} started request finished. If not overwritten invokes {@link #requestCompleted}. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains transaction result information and print information for the merchant and cardholder.

    Declaration

    Swift

    open func transactionCompleted(event: TimEvent, data: TransactionResponse?)
  • Called if the state of the terminal changed. Retrieve the state using event.getTerminal().getTerminalState(). @param terminal Terminal sending the notification.

    Declaration

    Swift

    open func terminalStatusChanged(terminal: Terminal)
  • Called by all request specific methods containing print data. Convenience method to print all receipts send by the terminal. Contains final receipts to print. If the print data sent to the request completed methods contains fields only {@link Terminal#getReceiptFormatter()} is used to create final receipts for printing.

    The following request completed methods contain receipts send to this method:

    • {@link #activateCompleted}
    • {@link #balanceCompleted}
    • {@link #deactivateCompleted}
    • {@link #dccRatesCompleted}
    • {@link #receiptRequestCompleted}
    • {@link #reconciliationCompleted}
    • {@link #reconfigCompleted}
    • {@link #rollbackCompleted}
    • {@link #transactionCompleted}

    {@link #printReceipts} is called before {@link #requestCompleted}.

    @param terminal Terminal receiving the receipts. @param printData Print data containing receipts to print.

    Declaration

    Swift

    open func printReceipts(terminal: Terminal, printData: PrintData)
  • Called by all of the other request specific methods unless they are implemented differently. @param event Contains the terminal sending the event and error information if the request failed. @param data Contains additional request specific data. Can be None-Value if the request in question does not support any additional data. Cast to the matching type to use. Use event.getRequestType() to determine the type of request.

    Declaration

    Swift

    open func requestCompleted(event: TimEvent, data: Any?)
  • Process print data if containing fields creating final transaction receipts to {@link #printReceipts}. @param terminal Terminal receiving the receipts. @param printData Print data containing receipts to print.

    Declaration

    Swift

    open func processPrintReceipts(terminal: Terminal, printData: PrintData)
  • Textual representation.

    Declaration

    Swift

    open var description: String { get }
  • Called if an {@link Terminal#closeReaderAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func closeReaderCompleted(event: TimEvent)
  • Called if an {@link Terminal#openReaderAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func openReaderCompleted(event: TimEvent)
  • Called if an {@link Terminal#ejectCardAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func ejectCardCompleted(event: TimEvent)
  • Called if an {@link Terminal#openMaintenanceWindowAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func openMaintenanceWindowCompleted(event: TimEvent)
  • Called if an {@link Terminal#closeMaintenanceWindowAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func closeMaintenanceWindowCompleted(event: TimEvent)
  • Called if an {@link Terminal#activateServiceMenuAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#UNATTENDED} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func activateServiceMenuCompleted(event: TimEvent)
  • Called if an {@link Terminal#openDialogModeAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func openDialogModeCompleted(event: TimEvent)
  • Called if an {@link Terminal#closeDialogModeAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func closeDialogModeCompleted(event: TimEvent)
  • Called if an {@link Terminal#showSignatureCaptureAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func showSignatureCaptureCompleted(event: TimEvent, data: ShowSignatureCaptureResponse?)
  • Called if an {@link Terminal#showDialogAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func showDialogCompleted(event: TimEvent, data: ShowDialogResponse?)
  • Called if an {@link Terminal#sendCardCommandAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func sendCardCommandCompleted(event: TimEvent, data: [CommandResponse]?)
  • Called if an {@link Terminal#balanceInquiryAsync()} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#ADVANCED_RETAIL} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func balanceInquiryCompleted(event: TimEvent, data: BalanceInquiryResponse?)
  • Called if an {@link Terminal#requestAlias()} started request finished.

    @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func requestAliasCompleted(event: TimEvent, data: String?)
  • Called if an {@link Terminal#closeDialogModeAsync} started request finished.

    Supported only if {@link com.six.timapi.constants.Guides#DIALOG} is enabled. @param event Contains the terminal sending the event and error information if the request failed.

    Declaration

    Swift

    open func queryLoyaltyCompleted(event: TimEvent, data: CardData?)