Skip to content
forked from RevZero/zvtlib

This library can be used to communicate with payment terminals according to the ZVT-Protocol specification.

License

Notifications You must be signed in to change notification settings

BSchuhmacher/zvtlib

 
 

Repository files navigation

Introduction

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. It is .netstandard21 compliant.
  • CardTerminals.Tests: Command line utility that can be used to run/test several CardTerminalLibrary functions. It is .net6.0 compliant.
  • ZvtEcrInterface: This library provides a very easy to use wrapper around the original CardTerminalLibrary. It is .netstandard21 compliant.
  • ZvtEcrInterfaceTester: Provides a simple GUI for using/testing the ZvtEcrInterface and performing various payment terminal tasks. It is .net6.0 compliant.

ZvtEcrInterfaceTester

Provides a simple GUI for using/testing the ZvtEcrInterface and performing various payment terminal tasks.

Usage:

  1. Select desired port and baud rate
  2. Click "Create Interface" (observe log window)
  3. Click "Register" (observe log window)
  4. Perform payment actions like "Pay", "Refund" etc.

The propertygrid will display payment results after a successful payment has been performed.

ZvtEcrInterface Tester v1.4.0

ZvtEcrInterface

This library provides a very easy to use wrapper around the original CardTerminalLibrary.

  1. 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}");
};
  1. Most terminals require an initial registration command before performing payment commands
try {
  var result = _ZvtCommunication?.Register();
  // evaluate result
} catch (Exception ex) {
  // handle exception
} 
  1. Perform payments, refunds etc.
try {
  var result = _ZvtCommunication?.Pay(100);
  // evaluate result
} catch (Exception ex) {
  // handle exception
} 

That's it.

Acknowledgments

Thanks to all the ones contributing to the source code and for sharing the original code.
Thanks to my employer VAS Software for allowing to give back to the comunity.

About

This library can be used to communicate with payment terminals according to the ZVT-Protocol specification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%