Skip navigation links

Version 1.6

Package at.hobex.pos.ecr.zvt

ZVTClient

See: Description

Package at.hobex.pos.ecr.zvt Description

ZVTClient

This package contains the implementation of the ZVT protocol.

Features

The following business processes are available:

Requirements

The ECR-API uses log4j as primary log handler. For the integration in your environment it's necessary to add

Configuration

log4j.properties must be included in your classpath, or add loglevel for at.hobex.pos.ecr to your log4j configuration.

If you using the default constructor ZVTClient() hobex.properties must be included in your classpath

Parameters (hobex.properties):

com.host=COMX (IP Address or serial port from the payment terminal)

com.port=20007 (ZVT listen port - default 20007)

com.timeout=180000 (timeout4 according to ZVT specification)

configByte=BE (config byte change the behavior of the payment terminal)

forceRegistration=true (forces an open connection (registration) before an action

timeout3=5000 (timeout4 according to ZVT specification)

Communication

Send the request directly to the terminal.

POS Terminal

Simple Usage

try {

  // see overloaded constructors or instantiate with hobex.proerty file
  ZVTClient client = new ZVTClient("COM6");

  // for TCP/IP use
  client = new ZVTClient("192.168.0.10", 20007);

  // to register intermediate status information listener - requires to set the config byte and logon()
  client.addListener(this);

  // set config byte
  ConfigByte.setConfigByte(0xBE);

  // another way to set the config byte
  ConfigByte.setEcrRequiredStatusInformation(true);
  ConfigByte.setEcrControlsAdministrativeFunctions(true);
  ConfigByte.setEcrControlsPaymentFunctions(true);

  // set the terminal behavior
  client.logon();

  // do a simple purchase (reference number is optional)
  ZVTResponse res = (ZVTResponse) client.purchase(1, 1234567);
  log.debug(res.getMerchantReceipt());
  log.debug(res.getCustomerReceipt());

  //if purchase is ok cancel the purchase
  if (res.isOk()) {
    res = (ZVTResponse) client.cancel();
        
    log.debug(res.getMerchantReceipt());
    log.debug(res.getCustomerReceipt());
  }

  //perform an end of day
  res = client.closeBatch();
                        
  log.debug("Turnover Totals: " + res.getAmount());
  log.debug(res.getAdministraiveReceipt());
                        
  //delete the terminal behavior from former logon()
  client.logoff();
} catch (ECRException e) {
  log.error(e.getMessage());
} catch (ECRCommunicationException e) {
  log.error(e.getMessage());
}
        

Receipt (provided from the terminal after setup terminal behavior - see Config-byte & logon))

                 hobex AG
         Josef-Brandst�tterstr. 2
              A-5020 Salzburg
        ---------------------------
        03.04.2018         14:25:42
        0000059    0004      000005
             RECEIPT FOR SALES
        ---------------------------
        Terminal: AH000010
        Receipt#: H004005
        L:************1227
        AID: A0000000041010
        Card: MASTERCARD
        App.: RAIFFEISEN CARD
                  PayPass
        NORMAL PURCHASE
         
        SUM
                 EUR: 1,00
         
        Ref:
         
        Authorization code:00517A2
                 (RC 000)
         Transaction performed
                offline
         
                  NO CVM
         
         AV: 03.39 TI: E DT: 0/0/
             OF: 1/1/ CG: 0/0/
         
         
 
        
Skip navigation links

Version 1.6