Payment terminals
K2 payment terminal via TCP/IP
Supported devices
Payments via a payment terminal are increasingly in demand, which is why we have linked the payment terminal with the K2 system. Payment terminals can be connected via a local as well as a remote desktop. The number of terminals connected to the K2 system is not limited; the linkage of a specific cash point and a specific payment terminal can be implemented based on the computer name or the logged-in K2 user.
By using a payment terminal, you increase control over the correctness of the entered payments. The request for a specific amount, currency or reference number is sent to the payment terminal by K2 (Retail sale).
Only the connection of a payment terminal using the TCP/IP protocol is supported, with the terminal working in the so-called server mode. Terminals are connected via Ethernet. Wireless terminals must communicate via WiFi. Terminals using Bluetooth are not supported. Communication with the Ingenico iCT 220, VX520 and iwl 220 payment terminals has been implemented. Linkage with other terminals is possible but not certified. The payment terminal must allow printing of a receipt for the card transaction performed.
Communication protocols may differ across banks; the supported and certified protocols are GPE - Global Payments Europe (e.g. Česká spořitelna, KB) and the ČSOB B-protocol (a protocol adapted to the needs of ČSOB bank). For ČSOB and the B-protocol, support for the PAX S800 and PAX S920 payment terminal types has been added.
For the GPE protocol, the automatic transaction Reversal function must be enabled.
Settings
To connect to the payment terminal, it is necessary to know the IP address, the port number and the compatible mode. Function 785 is used to set these terminal parameters.
In the Payment terminal settings window, it is first necessary to select the configuration type. In the individual setting types, the connection between K2 and the payment terminal can then be verified for a specific configuration with the "Terminal connection test" button, or the connection between the payment terminal and the bank can be verified with the "Bank connection test" button, only when the ČSOB B-protocol is used.

Picture: Payment terminal settings
If more payment terminals are connected to K2, Configuration by PC name or Configuration by user must be selected. These 2 types have a list of items in which the necessary data are filled in.
Configuration by PC name is suitable when different users operate the same payment terminal. The field for entering the computer name is case-sensitive. If the user connects to K2 via remote desktop, the name of the client computer (the name of the computer at which the user is sitting) is used.

Picture: Configuration by PC name
Configuration by user is suitable in cases when a specific user always operates a specific payment terminal. The user can easily be selected from the preview table.

Picture: Configuration by user
Script
Objects enabling synchronous communication have been published to the script. Each of these objects sends a request of the given type and waits until it receives a response as to whether the transaction was successful or not. If K2 does not receive a response within 60 seconds, the transaction fails. A localized message about the transaction status, which is in the LocalizedResponseDescription property, can be displayed to the user.
If a client for a specific payment terminal has already been created and another one is created before the transaction is completed, the older of them drops the connection with the terminal. The new client connects and can execute its methods. However, the correct procedure is to release the client first using Free and only then create another one. An example of using the terminal in a script is written in the Prikl_142.PAS unit.
Objects published to the script:
- TPaymentClient – performs a classic payment. The required parameters are the amount and the currency; the reference number is an optional parameter.
- TPaymentWithCashbackClient - performs a payment with a cashback withdrawal. The required parameters are the amount to be paid, the amount to be withdrawn and the currency; the optional parameter is the reference number.
- TReversalClient – cancels the last transaction. The required parameters are the amount, the currency and the authorization code.
- TReturnClient – performs a refund; the amount is transferred to the account number of the payment card. The required parameters are the amount and the currency; the reference number is an optional parameter.
- TCloseTotalsClient – performs the closing. The method has no parameters.
Logging
All transactions are logged to the "PointOfSale" folder in the user directory. The name of the log file corresponds to the time of its creation in the format "YYYY-MM-DD_hh-mm-ss.log". If problems occur while setting up or using the payment terminal, the quickest way to find out what happened is by means of the log.