This library can be used to communicate with payment terminals according to the ZVT-Protocol specification.
The solution contains 4 seperate projects:
- CardTerminalLibrary: This library contains the actual ZVT-Protocol implementation.
- CardTerminals.Tests: Command line utility that can be used to run/test several CardTerminalLibrary functions.
- ZvtEcrInterface: This library provides a very easy to use wrapper around the original CardTerminalLibrary.
- ZvtEcrInterfaceTester: Provides a simple GUI for using/testing the ZvtEcrInterface and performing various payment terminal tasks.
Provides a simple GUI for using/testing the ZvtEcrInterface and performing various payment terminal tasks.
Usage:
- Select desired port and baud rate
- Click "Create Interface" (observe log window)
- Click "Register" (observe log window)
- Perform payment actions like "Pay", "Refund" etc.
The propertygrid will display payment results after a successful payment has been performed.
This library provides a very easy to use wrapper around the original CardTerminalLibrary.
- Create communication interface and specify required serial port settings
The EnvironmentStatus event reports intermediate status information with respect to payments etc.
ZvtCommunication zvtCommunication = new ZvtCommunication(new ZvtSerialPortSettings("COM1", 115200), Console.Out);
zvtCommunication.EnvironmentStatus += delegate(IntermediateStatus status) {
if (InvokeRequired) {
Invoke(new Action(() => ZvtCommunicationOnEnvironmentStatus(status)));
return;
}
Debug.WriteLine($"ZvtEnvironment Status: {status}");
};
- Most terminals require an initial registration command before performing payment commands
try {
var result = _ZvtCommunication?.Register();
// evaluate result
} catch (Exception ex) {
// handle exception
}
- Perform payments, refunds etc.
try {
var result = _ZvtCommunication?.Pay(100);
// evaluate result
} catch (Exception ex) {
// handle exception
}
That's it.