Class: DefaultTerminalListener

timapi.DefaultTerminalListener()

Default implementation of listener for asynchronous terminal events. Implements methods to call timapi.Terminal#requestCompleted and timapi.Terminal#printReceipts as convenience call.

Subclasses usually only overwrite timapi.Terminal#requestCompleted and timapi.Terminal#printReceipts. If you overwrite methods inherited from timapi.TerminalListener make sure to super call to still get timapi.Terminal#requestCompleted and timapi.Terminal#printReceipts called.

Overview

Methods-Overview

Constructor

new DefaultTerminalListener()

Methods

activateCompleted(event, data)

Called if a request started with activateAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ActivateResponse Contains activation sequence counter and print information for the merchant.

activateServiceMenuCompleted(event)

Called if a request started with activateServiceMenuAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

applicationInformationCompleted(event)

Called if a request started with applicationInformationAsync started request finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

balanceCompleted(event, data)

Called if a request started with balanceAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.BalanceResponse Contains counters and print information for the merchant.

balanceInquiryCompleted(event, data)

Called if a request started with balanceInquiryAsync finished. Supported only if guide advancedRetail is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.BalanceInquiryResponse Contains balance inquiry response data

changeSettingsCompleted(event)

Called if a request started with changeSettingsAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

clientIdentificationCompleted(event, data)

Called if a request started with clientIdentificationAsync finished.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ClientIdentificationResponse Contains response

closeDialogModeCompleted(event)

Called if a request started with closeDialogModeAsync finished. Supported only if guide dialog is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

closeMaintenanceWindowCompleted(event)

Called if a request started with closeMaintenanceWindowAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

closeReaderCompleted(event)

Called if a request started with closeReaderAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

commitCompleted(event, data)

Called if a request started with commitAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.PrintData Contains counters.

connectCompleted(event)

Called if a request started with connectAsync finished.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

counterRequestCompleted(event, data)

Called if a request started with counterRequestAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.Counters Contains counters.

dccRatesCompleted(event, data)

Called if a request started with dccRatesAsync finished. If not implemented invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.PrintData Contains print information for merchant.

deactivateCompleted(event, data)

Called if a request started with deactivateAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.DeactivateResponse Contains counters and print information for the merchant.

deferredAuth(terminal, response)

Called if a deferred authorization information has been received. Supported only if guide unattended is enabled.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the notification.
response timapi.TransactionResponse Transaction response.

deviceMaintenanceCompleted(event)

Called if a request started with deviceMaintenanceAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

disconnected(terminal, exception)

Connection to terminal closed. Called if user disconnected or connection has been lost.
Parameters:
Name Type Description
terminal timapi.Terminal Terminal sending the notification.
exception timapi.TimException TimException

ejectCardCompleted(event)

Called if a request started with ejectCardAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

errorNotification(terminal, response)

Called if a error notification has been received.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the vasInfo-notification.
response timapi.TimError Error.

finishCheckoutCompleted(event, data)

Called if a request started with finishCheckoutAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.VasCheckoutInformation Contains vas checkout information.

hardwareInformationCompleted(event, data)

Called if a request started with hardwareInformationAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.HardwareInformationResponse Contains information about EFT Terminal hardware and EMV kernels and configuration parameters supported by the EFT Terminal.

initTransactionCompleted(event, data)

Called if a request started with initTransactionAsync finished.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.CardData Contains card data

initTransactionWithDialogCompleted(event, data)

Called if a request started with initTransactionWithDialogAsync finished.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.InitTransactionResponse Contains response data

keyPressed(terminal, reason)

Called if a key pressed information has been received. Supported only if guide unattended is enabled.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the notification.
reason timapi.constants.Reason Pressed key.

licenseChanged(terminal)

Called if a license changed notification has been received.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the notification.

loginCompleted(event)

Called if a request started with loginAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

logoutCompleted(event)

Called if a request started with logoutAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

loyaltyDataCompleted(event, data)

Called if a request started with loyaltyDataAsync finished. Supported only if guide valueAddedServices is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.CardData Contains card data

openDialogModeCompleted(event)

Called if a request started with openDialogModeAsync finished. Supported only if guide dialog is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

openMaintenanceWindowCompleted(event)

Called if a request started with openMaintenanceWindowAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

openReaderCompleted(event)

Called if a request started with openReaderAsync finished. Supported only if guideUnattended is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

printOnTerminalCompleted(event)

Called if a request started with printOnTerminalAsync finished. Supported only if guide dialog is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

printReceipts(terminal, printData)

Called by all request methods containing print data. Convenience method to print all receipts sent by the terminal. Contains final receipts to print. If the print data sent to the request completed methods contains fields only timapi.Terminal#getReceiptFormatter() is used to create final receipts for printing. The following request completed methods contain receipts send to this method:
  • activateCompleted
  • balanceCompleted
  • deactivateCompleted
  • dccRatesCompleted
  • receiptRequestCompleted
  • reconciliationCompleted
  • reconfigCompleted
  • rollbackCompleted
  • transactionCompleted
printReceipts is called before requestCompleted.
Parameters:
Name Type Description
terminal timapi.Terminal Terminal receiving the receipts.
printData timapi.PrintData Print data containing receipts to print.

processPrintReceipts(terminal, printData)

Process print data if containing fields creating final transaction receipts to printReceipts.
Parameters:
Name Type Description
terminal timapi.Terminal Terminal receiving the receipts.
printData timapi.PrintData Print data containing receipts to print. If undefined no receipts are printed.

provideLoyaltyBasketCompleted(event, data)

Called if a request started with provideLoyaltyBasketAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data Array.<timapi.LoyaltyItem> Contains returned loyalty basket, as list of LoyaltyItems.

provideVasResultCompleted(event, data)

Called if a request started with provideVasResultAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.VasResult Contains returned vas result.

rebootCompleted(event)

Called if a request started with rebootAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

receiptRequestCompleted(event, data)

Called if a request started with receiptRequestAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ReceiptRequestResponse 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.

reconciliationCompleted(event, data)

Called if a request started with reconciliationAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ReconciliationResponse Contains counters and print information for the merchant.

reconfigCompleted(event, data)

Called if a request started with reconfigAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.PrintData Contains print information for the merchant.

requestCompleted(event, data)

Called by all of the other request specific methods unless they are implemented differently.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data Object Contains additional request specific data. Can be "undefined" if the request in question does not support any additional data. Use event.getRequestType() to determine the type of request.

rollbackCompleted(event, data)

Called if a request started with rollbackAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.PrintData Contains print information for the merchant and cardholder.

screenshot(terminal, info)

Called if a screenshot notification has been received. Supported only if guide unattended is enabled.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the notification.
info timapi.ScreenshotInformation Screenshot information.

sendCardCommandCompleted(event, data)

Called if a request started with sendCardCommand finished. Supported only if guide advancedRetail is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data Array.<timapi.CommandResponse> List of command responses

showDialogCompleted(event, data)

Called if a request started with showDialogAsync finished. Supported only if guide dialog is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ShowDialogResponse Contains response of dialog

showSignatureCaptureCompleted(event, data)

Called if a request started with showSignatureCaptureAsync finished. Supported only if guide dialog is enabled.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.ShowSignatureCaptureResponse Contains reponse data of signature capture

softwareUpdateCompleted(event, data)

Called if a request started with softwareUpdateAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.UpdateStatus Contains update status.

startCheckoutCompleted(event)

Called if a request started with startCheckoutAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.

systemInformationCompleted(event, data)

Called if a request started with systemInformationAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.SystemInformationResponse Contains configuration and network information of the terminal.

terminalStatusChanged(terminal)

Called if the state of the terminal changed. Retrieve the state using terminal.getTerminalState().
Parameters:
Name Type Description
terminal timapi.Terminal Terminal sending the notification.

transactionCompleted(event, data)

Called if a request started with transactionAsync finished. If not overwritten invokes requestCompleted.
Parameters:
Name Type Description
event timapi.TimEvent Contains the terminal sending the event and error information if the request failed.
data timapi.TransactionResponse Contains transaction result information and print information for the merchant and cardholder.

vasInfo(terminal, vasCheckoutInformation)

Called if a VAS Information notification has been received. Supported only if guide valueAddedServices is enabled.
Parameters:
Name Type Description
terminal timapi.TimEvent Terminal sending the notification.
vasCheckoutInformation timapi.VasCheckoutInformation VAS checkout information.