public class Terminal extends Object
Terminal base implementation. Create instance of TerminalApi to connect to payment terminal.
Most simple usage is using synchronous methods like this example:
// Create settings with Terminal-ID of terminal to connect to
com.six.TerminalSettings settings = new com.six.TerminalSettings();
settings.setTerminalId("12345678");
// Create terminal
com.six.Terminal terminal = new com.six.Terminal(settings);
// Run transaction
terminal.transaction(com.six.constants.TransactionType.PURCHASE,
new com.six.Amount(8.5, com.six.constants.Currency.CHF));
// Disconnect from terminal and clean up properly
terminal.dispose();
The above example blocks until the transaction finishes. To create a responsive application use asynchronous methods like this example:
// Asynchronous listener handling terminal events.
class TerminalHandler extends com.six.DefaultTerminalListener {
@Override
public void transactionCompleted(com.six.TimEvent event, final com.six.TransactionResponse data) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// handle transaction finished using data
}
});
}
}
// Create settings with Terminal-ID of terminal to connect to
com.six.TerminalSettings settings = new com.six.TerminalSettings();
settings.setTerminalId("12345678");
// Create terminal
com.six.Terminal terminal = new com.six.Terminal(settings);
// Add listener to handle events
terminal.addListener(new TerminalHandler());
// Run transaction
terminal.transactionAsync(com.six.constants.TransactionType.PURCHASE,
new com.six.Amount(8.5, com.six.constants.Currency.CHF));
// Once the transaction completes TerminalHandler.transactionCompleted will be called
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_NAME
Class name used in entering/exiting logging at FINE loggin level.
|
static String |
COMM_DRIVER_TCPIP
TCP/IP communication driver identifier.
|
static String |
LOGGER_NAME
Logging target.
|
Constructor and Description |
---|
Terminal(TerminalSettings settings)
Create terminal using configuration.
|
Modifier and Type | Method and Description |
---|---|
ActivateResponse |
activate()
Opens a user shift.
|
void |
activateAsync()
Opens a user shift.
|
void |
activateServiceMenu()
Activate service menu.
|
void |
activateServiceMenuAsync()
Activate service menu.
|
void |
addEcrData(EcrInfo ecrInfo)
Add ECR data replacing existing one if present.
|
void |
addListener(TerminalListener listener)
Register listener.
|
void |
applicationInformation()
Requests the list of brands available on the terminal.
|
void |
applicationInformationAsync()
Requests the list of brands available on the terminal.
|
BalanceResponse |
balance()
Forces the EFT Terminal to transmit all transactions to the host system as well
to do the daily closing.
|
void |
balanceAsync()
Forces the EFT Terminal to transmit all transactions to the host system as well
to do the daily closing.
|
BalanceInquiryResponse |
balanceInquiry()
Get information about the current account balance of the inserted card.
|
void |
balanceInquiryAsync()
Get information about the current account balance of the inserted card.
|
void |
cancel()
Aborts an open asynchronous Financial Transaction or Non-Financial Transaction
request, except for a
Terminal.commit() or Terminal.rollbackAsync()
request, which cannot be cancelled. |
void |
cancel(boolean silent,
boolean retainCard)
Aborts an open asynchronous Financial Transaction or Non-Financial Transaction
request, except for a
Terminal.commit() or Terminal.rollbackAsync()
request, which cannot be cancelled. |
boolean |
canDcc()
Returns true if at least one payment protocol and the terminal configuration
offer DCC i.e.
|
boolean |
canDeclinedReceipts()
Support for "Declined Receipts" in at least one payment protocol.
|
boolean |
canMultiAccountSelection()
Support for multiple account selection.
|
void |
changeSettings(Map<SettingType,String> settings)
Changes configuration parameters of the EFT Terminal.
|
void |
changeSettingsAsync(Map<SettingType,String> settings)
Changes configuration parameters of the EFT Terminal.
|
void |
closeDialogMode()
Close dialog mode on the terminal.
|
void |
closeDialogModeAsync()
Close dialog mode on the terminal.
|
void |
closeMaintenanceWindow()
Closes the maintenance window to the terminal so it can perform collected maintenance
requests on its own, without interaction with the ECR.
|
void |
closeMaintenanceWindowAsync()
Closes the maintenance window to the terminal so it can perform collected maintenance
requests on its own, without interaction with the ECR.
|
void |
closeReader()
Close the shutter of the card reader.
|
void |
closeReaderAsync()
Close the shutter of the card reader.
|
void |
commit()
Performs Commit-operation after a successful Transaction call.
|
void |
commit(Amount amount)
Performs Commit-operation after a successful Transaction call.
|
void |
commitAsync()
Performs Commit-operation after a successful call to
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount) or
Terminal.transactionAsync(com.six.timapi.constants.TransactionType, com.six.timapi.Amount) . |
void |
commitAsync(Amount amount)
Performs Commit-operation after a successful call to
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount) or
Terminal.transactionAsync(com.six.timapi.constants.TransactionType, com.six.timapi.Amount) . |
void |
connect()
Initiates a connection to the EFT Terminal.
|
void |
connectAsync()
Initiates a connection to the EFT Terminal.
|
Counters |
counterRequest(CounterType type)
Get counter information's from the EFT Terminal.
|
void |
counterRequestAsync(CounterType type)
Get counter information's from the EFT Terminal.
|
PrintData |
dccRates()
Requests DCC rates from the EFT Terminal.
|
void |
dccRatesAsync()
Requests DCC rates from the EFT Terminal.
|
DeactivateResponse |
deactivate()
Closes a user shift.
|
void |
deactivateAsync()
Closes a user shift.
|
void |
disconnect()
Interrupts the connection to the EFT Terminal.
|
void |
disconnectAsync()
Interrupts the connection to the EFT Terminal.
|
void |
dispose()
Dispose of terminal.
|
void |
ejectCard()
Eject a card from the card reader.
|
void |
ejectCardAsync()
Eject a card from the card reader.
|
int |
getActSeqCounter()
Activation sequence counter.
|
List<Brands> |
getBrands()
Get brands or null if not retrieved yet.
|
ConfigData |
getConfigData()
Get configuration data or null if not retrieved yet.
|
List<EcrInfo> |
getEcrData()
ECR Data.
|
Features |
getFeatures()
Get features or null if not retrieved yet.
|
List<MerchantOption> |
getMerchantOptions()
Merchant options.
|
String |
getPosId()
POS identifier.
|
List<PrintOption> |
getPrintOptions()
Print options.
|
ReceiptFormatter |
getReceiptFormatter()
Receipt formatter.
|
TerminalSettingsImmutable |
getSettings()
Terminal settings.
|
String |
getTerminalId()
Terminal identifier of connected terminal.
|
TerminalStatus |
getTerminalStatus()
Get terminal status.
|
static String |
getTimApiVersion()
Tim Api Build Version.
|
TransactionData |
getTransactionData()
Transaction data to use for transaction requests unless overwritten in
Terminal.transaction(TransactionType, TransactionRequest) or
Terminal.transactionAsync(TransactionType, TransactionRequest) . |
int |
getUserId()
User identifier.
|
HardwareInformationResponse |
hardwareInformation()
Get hardware information from the EFT Terminal.
|
void |
hardwareInformationAsync()
Get hardware information from the EFT Terminal.
|
boolean |
hasSwUpdate()
Software update is available.
|
void |
holdCommit()
Extends the Commit timeout if the terminal needs additional time before the
Commit shall be performed.
|
CardData |
initTransaction(boolean displayAmount,
Amount amount)
Initialize a transaction knowing the amount or the card type.
|
void |
initTransactionAsync(boolean displayAmount,
Amount amount)
Initialize a transaction knowing the amount or the card type.
|
void |
login()
Activate a communication session between the ECR and the terminal.
|
void |
loginAsync()
Activate a communication session between the ECR and the terminal.
|
void |
logout()
Terminates an active communication session between the ECR and the terminal.
|
void |
logoutAsync()
Terminates an active communication session between the ECR and the terminal.
|
void |
openDialogMode()
Open dialog mode on the terminal.
|
void |
openDialogModeAsync()
Open dialog mode on the terminal.
|
void |
openMaintenanceWindow()
Opens the maintenance window to the terminal so it can perform collected maintenance
requests on its own, without interaction with the ECR.
|
void |
openMaintenanceWindowAsync()
Opens the maintenance window to the terminal so it can perform collected maintenance
requests on its own, without interaction with the ECR.
|
void |
openReader()
Open the shutter of the card reader.
|
void |
openReaderAsync()
Open the shutter of the card reader.
|
void |
reboot()
Force the EFT Terminal to reboot.
|
void |
rebootAsync()
Force the EFT Terminal to reboot.
|
ReceiptRequestResponse |
receiptRequest(ReceiptRequestType type)
Receive the latest receipt or a list of silent receipts.
|
void |
receiptRequestAsync(ReceiptRequestType type)
Receive the latest receipt or a list of silent receipts.
|
ReconciliationResponse |
reconciliation()
Force the EFT Terminal to transmit all financial transactions to the
host system.
|
void |
reconciliationAsync()
Force the EFT Terminal to transmit all financial transactions to the
host system.
|
PrintData |
reconfig()
Force the EFT Terminal to get the configuration from the service center.
|
void |
reconfigAsync()
Force the EFT Terminal to get the configuration from the service center.
|
void |
removeListener(TerminalListener listener)
Unregister listener.
|
String |
requestAlias(String sixTransRef)
The RequestAlias-function is used to request a Saferpay Alias for Alias-based
transactions.
|
void |
requestAliasAsync(String sixTransRef)
The RequestAlias-function is used to request a Saferpay Alias for Alias-based
transactions.
|
PrintData |
rollback()
Prevents a transaction from being committed to the transaction log and
generates a technical reversal of the authorization.
|
void |
rollbackAsync()
Prevents a transaction from being committed to the transaction log and
generates a technical reversal of the authorization.
|
List<CommandResponse> |
sendCardCommand(List<CommandRequest> requests)
This function is used for a direct communication with the inserted card using APDUs.
|
void |
sendCardCommandAsync(List<CommandRequest> requests)
This function is used for a direct communication with the inserted card using APDUs.
|
void |
setEcrData(List<EcrInfo> ecrData)
Set ECR data.
|
void |
setMerchantOptions(List<MerchantOption> merchantOptions)
Set merchant options.
|
void |
setPosId(String posId)
Set POS identifier.
|
void |
setPrintOptions(List<PrintOption> printOptions)
Set print options.
|
void |
setReceiptFormatter(ReceiptFormatter formatter)
Set receipt formatter.
|
void |
setTransactionData(TransactionData transactionData)
Transaction data to use for transaction requests unless overwritten in
Terminal.transaction(TransactionType, TransactionRequest) or
Terminal.transactionAsync(TransactionType, TransactionRequest) . |
void |
setUserId(int userId)
Set user identifier.
|
ShowDialogResponse |
showDialog(ShowDialogRequest request)
Show dialog on the terminal.
|
void |
showDialogAsync(ShowDialogRequest request)
Show dialog on the terminal.
|
ShowSignatureCaptureResponse |
showSignatureCapture(ShowSignatureCaptureRequest request)
Show signature capture on the terminal.
|
void |
showSignatureCaptureAsync(ShowSignatureCaptureRequest request)
Show signature capture on the terminal.
|
UpdateStatus |
softwareUpdate()
Force the EFT Terminal to start a Software Update.
|
void |
softwareUpdateAsync()
Force the EFT Terminal to start a Software Update.
|
SystemInformationResponse |
systemInformation()
Request system information from the EFT Terminal.
|
void |
systemInformationAsync()
Request system information from the EFT Terminal.
|
String |
toString()
String representation for debugging purpose.
|
TransactionResponse |
transaction(TransactionType type,
Amount amount)
Starts an EFT Terminal Transaction.
|
TransactionResponse |
transaction(TransactionType type,
TransactionRequest request)
Starts an EFT Terminal Transaction.
|
void |
transactionAsync(TransactionType type,
Amount amount)
Starts an EFT Terminal Transaction.
|
void |
transactionAsync(TransactionType type,
TransactionRequest request)
Starts an EFT Terminal Transaction.
|
TransactionResponse |
transactionCashback(TransactionType type,
Amount amount,
Amount amountOther)
Starts an EFT Terminal Transaction with Cashback amount.
|
void |
transactionCashbackAsync(TransactionType type,
Amount amount,
Amount amountOther)
Starts an EFT Terminal Transaction.
|
TransactionResponse |
transactionTip(TransactionType type,
Amount amount,
Amount tipAmount)
Starts an EFT Terminal Transaction with Tip amount.
|
void |
transactionTipAsync(TransactionType type,
Amount amount,
Amount tipAmount)
Starts an EFT Terminal Transaction.
|
public static final String LOGGER_NAME
public static final String CLASS_NAME
public static final String COMM_DRIVER_TCPIP
public Terminal(TerminalSettings settings)
public void dispose()
public static final String getTimApiVersion()
public TerminalSettingsImmutable getSettings()
public String getTerminalId()
TerminalSettings
. This is especially true if
ConnectionMode.ON_FIX_IP
is used.public String getPosId()
public void setPosId(String posId)
public int getUserId()
public void setUserId(int userId)
public void addEcrData(EcrInfo ecrInfo)
Terminal.setEcrData(java.util.List<com.six.timapi.EcrInfo>)
instead.public List<PrintOption> getPrintOptions()
public void setPrintOptions(List<PrintOption> printOptions)
public List<MerchantOption> getMerchantOptions()
public void setMerchantOptions(List<MerchantOption> merchantOptions)
public TransactionData getTransactionData()
Terminal.transaction(TransactionType, TransactionRequest)
or
Terminal.transactionAsync(TransactionType, TransactionRequest)
.public void setTransactionData(TransactionData transactionData)
Terminal.transaction(TransactionType, TransactionRequest)
or
Terminal.transactionAsync(TransactionType, TransactionRequest)
.public ReceiptFormatter getReceiptFormatter()
public void setReceiptFormatter(ReceiptFormatter formatter)
public TerminalStatus getTerminalStatus()
public Features getFeatures()
public int getActSeqCounter()
public ConfigData getConfigData()
public ActivateResponse activate() throws TimException
TimException
public void activateAsync() throws TimException
Terminal.activate()
. Returns immediately and calls
TerminalListener.activateCompleted(com.six.timapi.TimEvent, com.six.timapi.ActivateResponse)
on all notifiers once finished.TimException
public void applicationInformation() throws TimException
Requests the list of brands available on the terminal.
Side-Effect: Updates Brands member with all brands
available on the terminal. Use Terminal.getBrands()
to
retrieve them.
TimException
public void applicationInformationAsync() throws TimException
Requests the list of brands available on the terminal. Asynchronous version of
Terminal.applicationInformation()
. Returns immediately and calls
TerminalListener.applicationInformationCompleted(com.six.timapi.TimEvent)
on all notifiers once
finished.
Side-Effect: Updates Brands member with all brands available on the terminal. Use Terminal.getBrands() to retrieve them.
TimException
public BalanceResponse balance() throws TimException
TimException
public void balanceAsync() throws TimException
Terminal.balance()
. Returns
immediately and calls TerminalListener.balanceCompleted(com.six.timapi.TimEvent, com.six.timapi.BalanceResponse)
on all notifiers
once finished.TimException
public void cancel() throws TimException
Aborts an open asynchronous Financial Transaction or Non-Financial Transaction
request, except for a Terminal.commit()
or Terminal.rollbackAsync()
request, which cannot be cancelled.
Further information: A Cancel-request is a best effort request. The EFT Terminal can ignore the Cancel-request if the request in progress is in a state it can not be cancelled. A Cancel-request has no effect if there's no open request of a Financial Transaction or Non-financial Transaction. If the EFT Terminal cancels the request in progress an error response is send back for the cancelled request (see chapter Abort Purchase for an example). Cancel-requests can be send multiple times in an attempt to cancel a request in progress but should be spaced by a few seconds. Cancel-requests themselves are never acknowledged by the EFT Terminal.
The Transaction request can only be cancelled before a Commit has been performed. Also the underlying payment protocol can restrict this functionality.
TimException
public void cancel(boolean silent, boolean retainCard) throws TimException
Aborts an open asynchronous Financial Transaction or Non-Financial Transaction
request, except for a Terminal.commit()
or Terminal.rollbackAsync()
request, which cannot be cancelled.
Further information: A Cancel-request is a best effort request. The EFT Terminal can ignore the Cancel-request if the request in progress is in a state it can not be cancelled. A Cancel-request has no effect if there's no open request of a Financial Transaction or Non-financial Transaction. If the EFT Terminal cancels the request in progress an error response is send back for the cancelled request (see chapter Abort Purchase for an example). Cancel-requests can be send multiple times in an attempt to cancel a request in progress but should be spaced by a few seconds. Cancel-requests themselves are never acknowledged by the EFT Terminal.
The Transaction request can only be cancelled before a Commit has been performed. Also the underlying payment protocol can restrict this functionality.
TimException
public void changeSettings(Map<SettingType,String> settings) throws TimException
settings
- Dictionary of values for settings types to change.TimException
public void changeSettingsAsync(Map<SettingType,String> settings) throws TimException
Terminal.changeSettings(java.util.Map<com.six.timapi.constants.SettingType, java.lang.String>)
. Returns immediately and calls
TerminalListener.changeSettingsCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.settings
- Dictionary of values for settings types to change.TimException
public void commit() throws TimException
TimException
public void commitAsync() throws TimException
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
or
Terminal.transactionAsync(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
. Asynchronous version of Terminal.commit()
.
Returns immediately and calls TerminalListener.commitCompleted(com.six.timapi.TimEvent, com.six.timapi.PrintData)
on all
notifiers once finished.TimException
public void commit(Amount amount) throws TimException
TimException
public void commitAsync(Amount amount) throws TimException
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
or
Terminal.transactionAsync(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
. Asynchronous version of Terminal.commit()
.
Returns immediately and calls TerminalListener.commitCompleted(com.six.timapi.TimEvent, com.six.timapi.PrintData)
on all
notifiers once finished.TimException
public void connect() throws TimException
Terminal.connect()
is not needed normally, because all methods make first a connect, if not connected.TimException
public void connectAsync() throws TimException
Terminal.connect()
is not needed normally, because all methods make first a connect, if not connected.TimException
public Counters counterRequest(CounterType type) throws TimException
type
- type of counters to request.TimException
public void counterRequestAsync(CounterType type) throws TimException
Terminal.counterRequest(com.six.timapi.constants.CounterType)
. Returns immediately and calls
TerminalListener.counterRequestCompleted(com.six.timapi.TimEvent, com.six.timapi.Counters)
on all notifiers once finished.TimException
public DeactivateResponse deactivate() throws TimException
TimException
public void deactivateAsync() throws TimException
Terminal.deactivate()
. Returns immediately and
calls TerminalListener.deactivateCompleted(com.six.timapi.TimEvent, com.six.timapi.DeactivateResponse)
on all notifiers once finished.TimException
public void disconnect() throws TimException
TimException
public void disconnectAsync() throws TimException
TimException
public PrintData dccRates() throws TimException
TimException
public void dccRatesAsync() throws TimException
Terminal.dccRates()
. Returns immediately and calls
TerminalListener.dccRatesCompleted(com.six.timapi.TimEvent, com.six.timapi.PrintData)
on all notifiers once finished.TimException
public HardwareInformationResponse hardwareInformation() throws TimException
TimException
public void hardwareInformationAsync() throws TimException
Terminal.hardwareInformation()
. Returns immediately and calls
TerminalListener.hardwareInformationCompleted(com.six.timapi.TimEvent, com.six.timapi.HardwareInformationResponse)
on all notifiers
once finished.TimException
public CardData initTransaction(boolean displayAmount, Amount amount) throws TimException
TimException
public void initTransactionAsync(boolean displayAmount, Amount amount) throws TimException
TimException
public void login() throws TimException
Activate a communication session between the ECR and the terminal.
Note: Before calling set the print options, POS identifier and manufacturer flags set in the terminal instance.
Side-Effect: After completing the request updates the features,
brands and terminal identifier in the terminal instance. Fetching these
information can be disabled if Auto-FetchBrands is disabled in
TerminalSettings
.
TimException
public void loginAsync() throws TimException
Activate a communication session between the ECR and the terminal.
Asynchronous version of Terminal.login()
. Returns immediately and
calls TerminalListener.loginCompleted(com.six.timapi.TimEvent)
on all notifiers once
finished.
Note: Before calling set the print options, POS identifier and manufacturer flags properties in the terminal instance.
Side-Effect: After completing the request updates the features,
brands and terminal identifier is set in the terminal instance. Fetching
these information can be disabled with Auto-FetchBrands in
TerminalSettings
.
TimException
public void logout() throws TimException
TimException
public void logoutAsync() throws TimException
Terminal.logout()
. Returns immediately and
calls TerminalListener.logoutCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.TimException
public void reboot() throws TimException
TimException
public void rebootAsync() throws TimException
Terminal.reboot()
. Returns immediately and calls
TerminalListener.rebootCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.TimException
public ReconciliationResponse reconciliation() throws TimException
TimException
public void reconciliationAsync() throws TimException
Terminal.reconciliation()
.
Returns immediately and calls TerminalListener.reconciliationCompleted(com.six.timapi.TimEvent, com.six.timapi.ReconciliationResponse)
on all notifiers once finished.TimException
public ReceiptRequestResponse receiptRequest(ReceiptRequestType type) throws TimException
type
- Type of receipts to request from the EFT Terminal.TimException
public void receiptRequestAsync(ReceiptRequestType type) throws TimException
Terminal.receiptRequest(com.six.timapi.constants.ReceiptRequestType)
. Returns immediately and calls
TerminalListener.receiptRequestCompleted(com.six.timapi.TimEvent, com.six.timapi.ReceiptRequestResponse)
on all notifiers once finished.TimException
public PrintData reconfig() throws TimException
TimException
public void reconfigAsync() throws TimException
Terminal.reconfig()
. Returns immediately and
calls TerminalListener.reconfigCompleted(com.six.timapi.TimEvent, com.six.timapi.PrintData)
on all notifiers once finished.TimException
public PrintData rollback() throws TimException
TimException
public void rollbackAsync() throws TimException
Terminal.rollback()
. Returns immediately and calls
TerminalListener.rollbackCompleted(com.six.timapi.TimEvent, com.six.timapi.PrintData)
on all notifiers once finished.TimException
public UpdateStatus softwareUpdate() throws TimException
TimException
public void softwareUpdateAsync() throws TimException
TimException
public SystemInformationResponse systemInformation() throws TimException
Request system information from the EFT Terminal.
Note: Set EcrData property before calling SystemInformation.
TimException
public void systemInformationAsync() throws TimException
Request system information from the EFT Terminal. Asynchronous version
of Terminal.systemInformation()
. Returns immediately and calls
TerminalListener.systemInformationCompleted(com.six.timapi.TimEvent, com.six.timapi.SystemInformationResponse)
on all notifiers
once finished.
Note: Set EcrData property before calling SystemInformation.
TimException
public TransactionResponse transaction(TransactionType type, Amount amount) throws TimException
Starts an EFT Terminal Transaction.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
type
- Financial Transaction Function.amount
- Transaction amount.Convenience.processPrintReceipts(Terminal, PrintData)
)TimException
public TransactionResponse transaction(TransactionType type, TransactionRequest request) throws TimException
Starts an EFT Terminal Transaction.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
type
- Financial Transaction Function.request
- Transaction parameters without using TransactionRequest property.Convenience.processPrintReceipts(Terminal, PrintData)
)TimException
public void transactionAsync(TransactionType type, Amount amount) throws TimException
Starts an EFT Terminal Transaction. Asynchronous version of
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
. Returns immediately and calls
TerminalListener.transactionCompleted(com.six.timapi.TimEvent, com.six.timapi.TransactionResponse)
on all notifiers once finished.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
type
- Financial Transaction Function.amount
- Transaction amount.TimException
public void transactionAsync(TransactionType type, TransactionRequest request) throws TimException
Starts an EFT Terminal Transaction.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
type
- Financial Transaction Function.request
- Transaction parameters without using TransactionRequest property.TimException
public TransactionResponse transactionTip(TransactionType type, Amount amount, Amount tipAmount) throws TimException
Starts an EFT Terminal Transaction with Tip amount.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
Note: This method is only available if Guides.GASTRO
is enabled.
type
- Financial Transaction Function.amount
- Transaction amount.tipAmount
- Proposed tip amount.TimException
public void transactionTipAsync(TransactionType type, Amount amount, Amount tipAmount) throws TimException
Starts an EFT Terminal Transaction. Asynchronous version of
Terminal.transaction(com.six.timapi.constants.TransactionType, com.six.timapi.Amount)
. Returns immediately and calls
TerminalListener.transactionCompleted(com.six.timapi.TimEvent, com.six.timapi.TransactionResponse)
on all notifiers once finished.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
Note: This method is only available if Guides.GASTRO
is enabled.
type
- Financial Transaction Function.amount
- Transaction amount.tipAmount
- Proposed tip amount.TimException
public TransactionResponse transactionCashback(TransactionType type, Amount amount, Amount amountOther) throws TimException
Starts an EFT Terminal Transaction with Cashback amount.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
Note: This method is only available if
Guides.ADVANCED_RETAIL
is enabled.
type
- Financial Transaction Function.amount
- Transaction amount.amountOther
- Cashback amount.TimException
public void transactionCashbackAsync(TransactionType type, Amount amount, Amount amountOther) throws TimException
Starts an EFT Terminal Transaction. Asynchronous version of
Terminal.transactionCashback(com.six.timapi.constants.TransactionType, com.six.timapi.Amount, com.six.timapi.Amount)
. Returns immediately and calls
TerminalListener.transactionCompleted(com.six.timapi.TimEvent, com.six.timapi.TransactionResponse)
on all notifiers once finished.
Note: The transaction parameters are taken from TransactionRequest terminal property since those do not change often if at all (default parameters).
Note: This method is only available if
Guides.ADVANCED_RETAIL
is enabled.
type
- Financial Transaction Function.amount
- Transaction amount.amountOther
- Cashback amount.TimException
public void closeReader() throws TimException
Close the shutter of the card reader.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void closeReaderAsync() throws TimException
Close the shutter of the card reader.
Asynchronous version of Terminal.closeReader()
. Returns immediately and calls
TerminalListener.closeReaderCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void openReader() throws TimException
Open the shutter of the card reader.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void openReaderAsync() throws TimException
Open the shutter of the card reader.
Asynchronous version of Terminal.openReader()
. Returns immediately and calls
TerminalListener.openReaderCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void ejectCard() throws TimException
Eject a card from the card reader.
Note: This method is only available if Guides.UNATTENDED
or Guides.ADVANCED_RETAIL
is enabled.
TimException
public void ejectCardAsync() throws TimException
Eject a card from the card reader.
Asynchronous version of Terminal.ejectCard()
. Returns immediately and calls
TerminalListener.ejectCardCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void openMaintenanceWindow() throws TimException
Opens the maintenance window to the terminal so it can perform collected maintenance requests on its own, without interaction with the ECR. The terminal shall respond immediately to the ECR request whether it is able to handle the request or not.
If the terminal is able to handle the request, the ECR is free itself to perform maintenance as well or it can monitor the terminal by reading the TerminalStatus notifications.
It is possible that the connection between ECR and EFT terminal is terminated due to one or multiple reboot processes.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void openMaintenanceWindowAsync() throws TimException
Opens the maintenance window to the terminal so it can perform collected maintenance requests on its own, without interaction with the ECR. The terminal shall respond immediately to the ECR request whether it is able to handle the request or not.
If the terminal is able to handle the request, the ECR is free itself to perform maintenance as well or it can monitor the terminal by reading the TerminalStatus notifications.
It is possible that the connection between ECR and EFT terminal is terminated due to one or multiple reboot processes.
Asynchronous version of Terminal.openMaintenanceWindow()
. Returns immediately and calls
TerminalListener.openMaintenanceWindowCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void closeMaintenanceWindow() throws TimException
Closes the maintenance window to the terminal so it can perform collected maintenance requests on its own, without interaction with the ECR. The terminal shall respond immediately to the ECR request whether it is able to handle the request or not.
If the terminal is able to handle the request, the ECR is free itself to perform maintenance as well or it can monitor the terminal by reading the TerminalStatus notifications.
It is possible that the connection between ECR and EFT terminal is terminated due to one or multiple reboot processes.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void closeMaintenanceWindowAsync() throws TimException
Closes the maintenance window to the terminal so it can perform collected maintenance requests on its own, without interaction with the ECR. The terminal shall respond immediately to the ECR request whether it is able to handle the request or not.
If the terminal is able to handle the request, the ECR is free itself to perform maintenance as well or it can monitor the terminal by reading the TerminalStatus notifications.
It is possible that the connection between ECR and EFT terminal is terminated due to one or multiple reboot processes.
Asynchronous version of Terminal.closeMaintenanceWindow()
. Returns immediately and calls
TerminalListener.closeMaintenanceWindowCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void holdCommit() throws TimException
Extends the Commit timeout if the terminal needs additional time before the Commit shall be performed. An example could be on a public transport vending machine: if the machine is printing multiple tickets and this printing action would extend the commit timeout, a HoldCommit notification shall be sent to extend the Commit timeout as well. If the printing action fails after some tickets a partial commit can be performed.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void activateServiceMenu() throws TimException
Activate service menu.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void activateServiceMenuAsync() throws TimException
Activate service menu.
Note: This method is only available if Guides.UNATTENDED
is enabled.
TimException
public void openDialogMode() throws TimException
Open dialog mode on the terminal.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void openDialogModeAsync() throws TimException
Open dialog mode on the terminal.
Asynchronous version of Terminal.openDialogMode()
. Returns immediately and calls
TerminalListener.openDialogModeCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void closeDialogMode() throws TimException
Close dialog mode on the terminal.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void closeDialogModeAsync() throws TimException
Close dialog mode on the terminal.
Asynchronous version of Terminal.closeDialogMode()
. Returns immediately and calls
TerminalListener.closeDialogModeCompleted(com.six.timapi.TimEvent)
on all notifiers once finished.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public ShowSignatureCaptureResponse showSignatureCapture(ShowSignatureCaptureRequest request) throws TimException
Show signature capture on the terminal.
Can be called only if dialog mode is open.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void showSignatureCaptureAsync(ShowSignatureCaptureRequest request) throws TimException
Show signature capture on the terminal.
Asynchronous version of Terminal.showSignatureCapture(com.six.timapi.ShowSignatureCaptureRequest)
. Returns immediately and calls
TerminalListener.showSignatureCaptureCompleted(com.six.timapi.TimEvent, com.six.timapi.ShowSignatureCaptureResponse)
on all notifiers once finished.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public ShowDialogResponse showDialog(ShowDialogRequest request) throws TimException
Show dialog on the terminal.
Can be called only if dialog mode is open.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void showDialogAsync(ShowDialogRequest request) throws TimException
Show dialog on the terminal.
Asynchronous version of Terminal.showDialog(com.six.timapi.ShowDialogRequest)
. Returns immediately and calls
TerminalListener.showDialogCompleted(com.six.timapi.TimEvent, com.six.timapi.ShowDialogResponse)
on all notifiers once finished.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public List<CommandResponse> sendCardCommand(List<CommandRequest> requests) throws TimException
This function is used for a direct communication with the inserted card using APDUs. It is possible to send a list of APDU command in the request (sixml:CommandRequestList) and to set responses that shall be accepted as "Positive" responses using sixml:PositiveAnswerList.
Each sixml:CommandRequest is numbered with a unique order number (starting with 1). In the response, the terminal sends the response of the device for each CommandRequest, including the order number of the request.
If the device answers with a negative response (i.e. SW1SW2 != 9000 or other as "positive" defined answers using sixml:PositiveAnswerList), the processing of the sixml:CommandRequests is aborted, and the remaining commands are not sent to the device.
Furthermore it can be defined which dialogs shall be shown using the container sixml:CommandResources in the following use cases:
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public void sendCardCommandAsync(List<CommandRequest> requests) throws TimException
This function is used for a direct communication with the inserted card using APDUs. It is possible to send a list of APDU command in the request (sixml:CommandRequestList) and to set responses that shall be accepted as "Positive" responses using sixml:PositiveAnswerList.
Each sixml:CommandRequest is numbered with a unique order number (starting with 1). In the response, the terminal sends the response of the device for each CommandRequest, including the order number of the request.
If the device answers with a negative response (i.e. SW1SW2 != 9000 or other as "positive" defined answers using sixml:PositiveAnswerList), the processing of the sixml:CommandRequests is aborted, and the remaining commands are not sent to the device.
Furthermore it can be defined which dialogs shall be shown using the container sixml:CommandResources in the following use cases:
Asynchronous version of Terminal.sendCardCommand(java.util.List<com.six.timapi.CommandRequest>)
. Returns immediately and calls
TerminalListener.sendCardCommandCompleted(com.six.timapi.TimEvent, java.util.List<com.six.timapi.CommandResponse>)
on all notifiers once finished.
Note: This method is only available if Guides.DIALOG
is enabled.
TimException
public BalanceInquiryResponse balanceInquiry() throws TimException
Get information about the current account balance of the inserted card.
Note: This method is only available if
Guides.ADVANCED_RETAIL
is enabled.
TimException
public void balanceInquiryAsync() throws TimException
Get information about the current account balance of the inserted card.
Asynchronous version of Terminal.balanceInquiry()
. Returns immediately and calls
TerminalListener.balanceInquiryCompleted(com.six.timapi.TimEvent, com.six.timapi.BalanceInquiryResponse)
on all notifiers once finished.
Note: This method is only available if
Guides.ADVANCED_RETAIL
is enabled.
TimException
public String requestAlias(String sixTransRef) throws TimException
The RequestAlias-function is used to request a Saferpay Alias for Alias-based transactions. Saferpay offers these kind of transactions which can be performed only using a secure Alias that can be created out of card information from a precious transaction. This Alias then can be used to perform a transaction without having the same card present.
An Alias can be used for the following transactions:
sixTransRef
- The SIX omni channel reference number.TimException
public void requestAliasAsync(String sixTransRef) throws TimException
The RequestAlias-function is used to request a Saferpay Alias for Alias-based transactions. Saferpay offers these kind of transactions which can be performed only using a secure Alias that can be created out of card information from a precious transaction. This Alias then can be used to perform a transaction without having the same card present.
An Alias can be used for the following transactions:
Asynchronous version of Terminal.requestAlias(java.lang.String)
. Returns immediately
and calls TerminalListener.requestAliasCompleted(com.six.timapi.TimEvent, java.lang.String)
on all notifiers
once finished.
sixTransRef
- The SIX omni channel reference number.TimException
public boolean canDcc()
public boolean canDeclinedReceipts()
public boolean canMultiAccountSelection()
public boolean hasSwUpdate()
public void addListener(TerminalListener listener)
IllegalArgumentException
- listener is null.IllegalArgumentException
- listener is registered.public void removeListener(TerminalListener listener)
IllegalArgumentException
- listener is null.IllegalArgumentException
- listener is not registered.