Skip navigation links

Version 1.6

ECR API by Hobex

This class library is used for communication between any retail pos software or others and Hobex POS devices.

See: Description

Packages 
Package Description
at.hobex.pos.ecr
There are different protocols implemented in the API.
at.hobex.pos.ecr.smartpos
SmartPOSClient
at.hobex.pos.ecr.tecs
TecsClient
at.hobex.pos.ecr.zvt
ZVTClient
at.hobex.pos.logger
This package provides the ability to use different logger implementation.
This class library is used for communication between any retail pos software or others and Hobex POS devices. Base for all integration scenarios is ECRBase. ECRBase provides you with all the necessary business methods to integrate payment business scenarios in your software.

With just a few lines of code, you are able to trigger a purchase transaction for a Hobex Terminal.

Don't hesitate to contact us directly under ecr@hobex.at


Download the latest version of the hobex Java API

hobex Java API 1.6.16

hobex Java API 1.6.15

hobex Java API 1.6.13

hobex Java API 1.6.11

hobex Java API 1.6.10

hobex Java API 1.6.9

hobex Java API 1.6.8

hobex Java API 1.6.8

hobex Java API 1.6.7

hobex Java API 1.6.6

hobex Java API 1.6.5

hobex Java API 1.6.4

hobex Java API 1.5.3

hobex Java API 1.5.2

hobex Java API 1.4.11

hobex Java API 1.4.10

hobex Java API 1.4.8

hobex Java API 1.4.6

hobex Java API 1.4.4

hobex Java API 1.4.1

hobex Java API 1.3.30

hobex Java API 1.3.29

hobex Java API 1.3.22


Download the hobex JavaAPI-Test GUI (including Terminal simulator) here

This GUI implements the hobex Java API to demonstrate the functionality

It is also possible to simulate a virtual terminal on localhost. This Simulator simulates the responses from a real Terminal for dev-purposes. So it is possible to test implementation without a physical terminal.



Interface matrix / Overview about the supported interfaces

Interface matrix

Receipt requirements

The minimal requirement to the receipt are:

The receipt for customers must at least be offered for printing. Merchant receipt is sufficient digitally (however, it must be possible to reprint) - Attention for signature-based transactions -> signature is also sufficient digitally, but must be combined with the receipt when printing.

In the case of subsequent filing, a PDF document (or other related document) must be able to be delivered with the data (from the dealer). A text file with the information is not enough.

receipt samples

Example for using the inheritance with the hobex Java API

public void test() {
  // To dynamically use the different protocols can be deriving from the ECRBase
  // class.
  // This is the example of our TestGUI which is available to test the different
  // API functions.

  // The different parameter - set up by your program configuration
  // Please note that the protocols requires different parameters
  String tid = "3512186";
  String password = "";
  String host = "tca.hobex.at";
  int port = 9991;
  int timeout3 = 5000;
  int timeout4 = 180000;
  String configByte = "BE";
  int baud = 9600;
  int stopbits = 2;
  String language = "EN";
  boolean ssl = true;

  //To set the trustStore -> TECSClient SSL
  System.setProperty("javax.net.ssl.trustStore", "hpg-ecr-2018.ts");
  System.setProperty("javax.net.ssl.trustStorePassword", "XXXXXXXX");
  
  // Switch over the different protocols.
  // In this example the selected Protocol simulate a drop down or something else
  // from your config screen.
  // 0 - TecsClient
  // 1 - ZVTClient
  // 2 - FirstDataOCP (Open Com Protocol) - DEPRECATED!

  // the selectedConnectionType indicates the different connection types and also
  // the possibility to read the settings from the app.config

  // Code Snippet:

  int selectedProtocol = 0;
  int selectedConnectionType = 1;

  ECRBase terminal = null;

  switch (selectedProtocol) {
  case 0:
    switch (selectedConnectionType) {
    case 0:
      terminal = new TecsClient();
      break;
    case 1:
      terminal = new TecsClient(tid, password, host, port, timeout4, ssl, language);
      break;
    }
    break;
  case 1:
    switch (selectedConnectionType) {
    case 0:
      terminal = new ZVTClient();
      break;
    case 1:
      terminal = new ZVTClient(host, port, timeout3, timeout4, configByte);
      terminal.setLanguage(language);
      break;
    case 2:
      terminal = new ZVTClient(host, baud, stopbits, timeout3, timeout4, configByte);
      terminal.setLanguage(language);
      break;
    }
    break;
  case 2:
    switch (selectedConnectionType) {
    case 0:
      terminal = new FirstDataOCP();
      break;
    }
    break;
  }

  // to a simple purchase with cancel

  Response response = null;

  try {
    terminal.logon();
  } catch (Exception e) {
  }

  double amount = 1;
  // save the transaction id for the "TECSClient Limitation"
  String transactionID = terminal.newTransactionId();

  try {
    response = terminal.purchase(transactionID, amount);

    System.out.println(response.getMerchantReceipt());


    if (response.isOk()) {
      // Plese keep in mind that for a cancel ZVTClient needs the receipt number and
      // TECSClient use the transaction id
      if (terminal instanceof ZVTClient) {
        response = terminal.cancel(response.getAmount(), response.getReceiptNo());
      } else {
        response = terminal.cancel(response.getAmount(), response.getTransactionId());
      }

      System.out.println(response.getMerchantReceipt());
    }
  } catch (Exception e) {
    // TECS Client limitation
    int maxAttempts = 10;

    for (int i = 0; !(response != null && response.isOk()) && i < maxAttempts; i++) {
      try {

        // wait for internet connection
        Thread.sleep(5000);

        // check if terminal is online
        response = terminal.status();

        if (response.isOk()) {
          response = terminal.cancel(amount, transactionID);
        }
      } catch (Exception ex) {
      }
    }
  }

  try {
    terminal.logoff();
  } catch (Exception e) {
  }
}
                
Skip navigation links

Version 1.6