Portalum.Payment.Zvt is a library designed to simplify communication with payment terminals via the ZVT Protocol. The library is based on Microsoft .NET. Communication via TCP/IP is supported and communication via a serial connection is also provided. The most important commands for processing a payment transaction with an electronic POS system are also already integrated.
- Registration
- Log-Off
- Authorization
- Reversal
- Refund
- End-of-Day
- Send Turnover Totals
- Repeat Receipt
- Diagnosis
- Status-Information
- Intermediate StatusInformation
- Print Line
- Print Text-Block
- BMP Processing
- TLV Processing
The package is available via nuget
PM> install-package Portalum.Payment.Zvt
Before sending a payment to the terminal, you should consider how to configure the terminal. For example, it can be set that a manual start of a payment at the terminal is no longer possible. You must also set where the receipts are printed directly via the terminal or via an external printer. For the configuration use the Registration
command.
This library uses the Microsoft.Extensions.Logging
package so you can easily decide where to write the log files, to a file or directly to the console output for example.
To write the logging output directly to the console output, this nuget packages is needed Microsoft.Extensions.Logging.Console
.
using var loggerFactory = LoggerFactory.Create(builder =>
{
builder.AddConsole().SetMinimumLevel(LogLevel.Debug);
});
var deviceCommunicationLogger = loggerFactory.CreateLogger<TcpNetworkDeviceCommunication>();
var zvtClientLogger = loggerFactory.CreateLogger<ZvtClient>();
var deviceCommunication = new TcpNetworkDeviceCommunication("192.168.0.10", logger: deviceCommunicationLogger);
var zvtClient = new ZvtClient(deviceCommunication, logger: zvtClientLogger);
var deviceCommunication = new TcpNetworkDeviceCommunication("192.168.0.10");
var zvtClient = new ZvtClient(deviceCommunication, password: 123456);
var deviceCommunication = new TcpNetworkDeviceCommunication("192.168.0.10", port: 20007);
var deviceCommunication = new TcpNetworkDeviceCommunication("192.168.0.10");
await deviceCommunication.ConnectAsync();
using var zvtClient = new ZvtClient(deviceCommunication);
zvtClient.StatusInformationReceived += (statusInformation) => Console.WriteLine(statusInformation.ErrorMessage);
await zvtClient.PaymentAsync(10.5M);
var deviceCommunication = new TcpNetworkDeviceCommunication("192.168.0.10");
await deviceCommunication.ConnectAsync();
using var zvtClient = new ZvtClient(deviceCommunication);
zvtClient.StatusInformationReceived += (statusInformation) => Console.WriteLine(statusInformation.ErrorMessage);
await zvtClient.EndOfDayAsync();
With the Portalum.Zvt.TestUi you can test the different ZVT functions.
- Install .NET Desktop Runtime 5.x
- Download and extract the TestUi (download)
Provider | Terminal |
---|---|
CardComplete | ingenico iWL250 |
Hobex | ingenico Desk/3500 |
Wordline (SIX) | yomani touch family |
- Encoding is fixed to
UTF-8
instead of default character setCP437
. There is no way to configure this Print Line
contains TLV data at the end of the package, afterTLV-activation
. According to official documentation, there should be no TLV data here
- No
Print Line
support - Sends TLV data even without
TLV-activation