Package com.datecs.fiscalprinter.SDK.model.UserLayerV2

# Class cmdPinpad

java.lang.Object
com.datecs.fiscalprinter.SDK.model.DatecsFiscalDevice
com.datecs.fiscalprinter.SDK.model.UserLayerV2.cmdPinpad

    public class cmdPinpad
    extends DatecsFiscalDevice

This class provides a shell for all pinpad operation commands connected directly to one of the communication interfaces of the fiscal device (RS232 or Bluetooth). Network interfaces of the cash register (LAN, or GPRS via user APN) is used, to connect to your pinpad and bank servers. To complete the pinpad transactions, provide an Internet connection to your fiscal device.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `cmdPinpad.DocTypeToCopy` |
  `static class` | `cmdPinpad.PinpadType` |
  `static class` | `cmdPinpad.PurchaseResult` |

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `cmdPinpad()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `boolean` | `checkPinpadConnection()` |
  `boolean` | `CheckPinpadServerConnection()` |
  `void` | `endOfDayReport()` |
  `int` | `getPinpadComBaudRate()` | Baud rate of COM port that has pinpad device assigned.
  `int` | `getPinpadComPort()` |
  `int` | `getPinpadConnectionType()` | Type of connection between cash register and bank server
  `int` | `getPinpadLoyaltyPayment()` | Function of PY4 key
  `int` | `getPinpadPaymentMenu()` | Function of PY2 key in registration
  `int` | `getPinpadReceiptCopies()` | Copies of the receipt from pinpad
  `int` | `getPinpadReceiptInfo()` | Where to print pinpad receipt
  `boolean` | `getPinpadShortRec()` |
  `cmdPinpad.PinpadType` | `getPinpadType()` | Type of pinpad
  `cmdPinpad.PurchaseResult` | `makePurchase​(java.lang.Double amount)` | Make sale from pinpad
  `void` | `printCopyOfLastTransactionDocument()` | Copy of last document;
  `void` | `printCopyTransactionDocument​(cmdPinpad.DocTypeToCopy docTypeToCopy, java.lang.String docNumber)` | Copy of document by type;
  `void` | `printTransactionReceipt()` | Print receipt for pinpad after succesfull transaction.
  `void` | `returnTransaction​(boolean Operation)` | Used when command 53( paying with pinpad ) and command 55 ( option 14 ) returns error along with sum and last digits of card number
  `void` | `setPinpadComBaudRate​(int value)` | Baud rate of COM port that has pinpad device assigned.
  `void` | `setPinpadComPort​(int value)` | Number of COM port for communication with pinpad
  `void` | `setPinpadConnectionType​(int value)` | Type of pinpad
  `void` | `setPinpadDateTime​(java.lang.String dateTime)` |
  `void` | `setPinpadLoyaltyPayment​(int value)` | Function of PY4 key
  `void` | `setPinpadPaymentMenu​(int value)` | Function of PY2 key in registration
  `void` | `setPinpadReceiptCopies​(int value)` | Copies of the receipt from pinpad
  `void` | `setPinpadReceiptInfo​(int value)` | Where to print pinpad receipt
  `void` | `setPinpadShortRec​(boolean value)` | Short receipt or normal receipt from pinpad;
  `void` | `setPinpadType​(cmdPinpad.PinpadType value)` | Type of pinpad
  `void` | `voidTransactionBorica​(java.lang.String PayType, java.lang.Double Amount, java.lang.String RRN, java.lang.String AC)` |
  `void` | `voidTransactionDSK​(java.lang.Double Amount)` |
  `void` | `voidTransactionUBB​(java.lang.String PayType, java.lang.Double Amount, java.lang.String Number)` |

  ### Methods inherited from class com.datecs.fiscalprinter.SDK.model.DatecsFiscalDevice

  `checkErrorCode, close, getConnectedECRV1, getConnectedModelV2, getConnectedPrinterV1, getCountryCode, getMaxDepartments, getMaxStockGroup, isCheckLastError, isConnectedDeviceV2, isConnectedECR, isConnectedPrinter, isEditItemPrice, isEditItemQTY, isFontSupported, isPaperCuttingDevice, setCheckLastError, setConnectedModel, setConnectedModel, setConnectedModel, setCountryCode`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### cmdPinpad

    public cmdPinpad()

- ## Method Details

  - ### printCopyTransactionDocument

    public void printCopyTransactionDocument​(cmdPinpad.DocTypeToCopy docTypeToCopy, java.lang.String docNumber) throws java.io.IOException, FiscalException
    Copy of document by type;
    Parameters:
      `docTypeToCopy` -
      `docNumber` -
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### makePurchase

    public cmdPinpad.PurchaseResult makePurchase​(java.lang.Double amount) throws java.io.IOException, FiscalException
    Make sale from pinpad
    Parameters:
      `amount` -
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### endOfDayReport

    public void endOfDayReport() throws java.io.IOException, FiscalException
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### printCopyOfLastTransactionDocument

    public void printCopyOfLastTransactionDocument() throws java.io.IOException, FiscalException
    Copy of last document;
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### checkPinpadConnection

    public boolean checkPinpadConnection() throws java.io.IOException, FiscalException
    Returns:
      true if pinpad is connected to fiscal device;
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### CheckPinpadServerConnection

    public boolean CheckPinpadServerConnection() throws java.lang.Exception
    Returns:
      true if pinapd test transaction is successful;
    Throws:
      `java.lang.Exception`

  - ### getPinpadComPort

    public int getPinpadComPort() throws java.lang.Exception
    Returns:
      -( 1-COM1, 2-COM2, 4-Bluetooth );
    Throws:
      `java.lang.Exception`

  - ### setPinpadComPort

    public void setPinpadComPort​(int value) throws java.lang.Exception
    Number of COM port for communication with pinpad
    Parameters:
      `value` - ( 1-COM1, 2-COM2, 4-Bluetooth );
    Throws:
      `java.lang.Exception`

  - ### getPinpadComBaudRate

    public int getPinpadComBaudRate() throws java.lang.Exception
    Baud rate of COM port that has pinpad device assigned.
    Returns:
      -( from 0 to 9 );
    Throws:
      `java.lang.Exception`

  - ### setPinpadComBaudRate

    public void setPinpadComBaudRate​(int value) throws java.lang.Exception
    Baud rate of COM port that has pinpad device assigned.
    Parameters:
      `value` - ( from 0 to 9 );
    Throws:
      `java.lang.Exception`

  - ### getPinpadType

    public cmdPinpad.PinpadType getPinpadType() throws java.lang.Exception
    Type of pinpad
    Returns:
      - 1 - BORICA; 2 - UBB; 3 - DSK ;
    Throws:
      `java.lang.Exception`

  - ### setPinpadType

    public void setPinpadType​(cmdPinpad.PinpadType value) throws java.lang.Exception
    Type of pinpad
    Parameters:
      `value` - 1 - BORICA; 2 - UBB; 3 - DSK ;
    Throws:
      `java.lang.Exception`

  - ### getPinpadConnectionType

    public int getPinpadConnectionType() throws java.lang.Exception
    Type of connection between cash register and bank server
    Returns:
      0-GPRS, 1-LAN
    Throws:
      `java.lang.Exception`

  - ### setPinpadConnectionType

    public void setPinpadConnectionType​(int value) throws java.lang.Exception
    Type of pinpad
    Parameters:
      `value` - 0-GPRS, 1-LAN
    Throws:
      `java.lang.Exception`

  - ### getPinpadReceiptInfo

    public int getPinpadReceiptInfo() throws java.lang.Exception
    Where to print pinpad receipt
    Returns:
      - 1 - in fiscal receipt; 0 - separate from fiscal receipt
    Throws:
      `java.lang.Exception`

  - ### setPinpadReceiptInfo

    public void setPinpadReceiptInfo​(int value) throws java.lang.Exception
    Where to print pinpad receipt
    Parameters:
      `value` - 1 - in fiscal receipt; 0 - separate from fiscal receipt
    Throws:
      `java.lang.Exception`

  - ### getPinpadReceiptCopies

    public int getPinpadReceiptCopies() throws java.lang.Exception
    Copies of the receipt from pinpad
    Returns:
      - ( 0 - 3 )
    Throws:
      `java.lang.Exception`

  - ### setPinpadReceiptCopies

    public void setPinpadReceiptCopies​(int value) throws java.lang.Exception
    Copies of the receipt from pinpad
    Parameters:
      `value` - ( 0 - 3 )
    Throws:
      `java.lang.Exception`

  - ### getPinpadPaymentMenu

    public int getPinpadPaymentMenu() throws java.lang.Exception
    Function of PY2 key in registration
    Returns:
      - 0 - payment with card with pinpad ). Works only with configuration with BORICA. 1 - menu for payment with pinpad( card and loyalty scheme );
    Throws:
      `java.lang.Exception`

  - ### setPinpadPaymentMenu

    public void setPinpadPaymentMenu​(int value) throws java.lang.Exception
    Function of PY2 key in registration
    Parameters:
      `value` - 1 - menu for payment with pinpad( card and loyalty scheme ); 0 - payment with card with pinpad ). Works only with configuration with BORICA.
    Throws:
      `java.lang.Exception`

  - ### getPinpadLoyaltyPayment

    public int getPinpadLoyaltyPayment() throws java.lang.Exception
    Function of PY4 key
    Returns:
      - 0 - payment PY4 ). Works only with configuration with BORICA. 1 - payment with pinpad with loyalty scheme;
    Throws:
      `java.lang.Exception`

  - ### setPinpadLoyaltyPayment

    public void setPinpadLoyaltyPayment​(int value) throws java.lang.Exception
    Function of PY4 key
    Parameters:
      `value` - 1 - payment with pinpad with loyalty scheme; 0 - payment PY4 ). Works only with configuration with BORICA.
    Throws:
      `java.lang.Exception`

  - ### getPinpadShortRec

    public boolean getPinpadShortRec() throws java.lang.Exception
    Returns:
      - Short receipt or normal receipt from pinpad;
    Throws:
      `java.lang.Exception`

  - ### setPinpadShortRec

    public void setPinpadShortRec​(boolean value) throws java.lang.Exception
    Short receipt or normal receipt from pinpad;
    Parameters:
      `value` - True=short
    Throws:
      `java.lang.Exception`

  - ### setPinpadDateTime

    public void setPinpadDateTime​(java.lang.String dateTime) throws java.lang.Exception
    Parameters:
      `dateTime` - - Date and time in format: "DD-MM-YY hh:mm:ss DST"; DD - Day; MM - Month; YY - Year; hh - Hour; mm - Minute; ss - Second; DST - Text "DST" if exist time is Summer time;
    Throws:
      `java.lang.Exception`

  - ### printTransactionReceipt

    public void printTransactionReceipt() throws java.io.IOException, FiscalException
    Print receipt for pinpad after succesfull transaction. Must be executed after command 53( when paying with pinpad ) and after command 56( when paying with pinpad );
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### voidTransactionBorica

    public void voidTransactionBorica​(java.lang.String PayType, java.lang.Double Amount, java.lang.String RRN, java.lang.String AC) throws java.io.IOException, FiscalException
    Parameters:
      `PayType` - - Type of payment: 7 - Return with money, 13 - Return with points from loyal scheme;
      `Amount` - - The amount of the transaction;
      `RRN` - - RRN of the transaction(12 digits max);
      `AC` - - AC of the transaction(6 digits max);
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### voidTransactionUBB

    public void voidTransactionUBB​(java.lang.String PayType, java.lang.Double Amount, java.lang.String Number) throws java.io.IOException, FiscalException
    Parameters:
      `PayType` - -Type of payment: 16 - Return with AC number, 17 - Return with receipt number;
      `Amount` - - The amount of the transaction;
      `Number` - - depent on PayType( 16 - AC number, 17 - receipt number )
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### voidTransactionDSK

    public void voidTransactionDSK​(java.lang.Double Amount) throws java.io.IOException, FiscalException
    Parameters:
      `Amount` - - The amount of the transaction;
    Throws:
      `java.io.IOException`
      `FiscalException`

  - ### returnTransaction

    public void returnTransaction​(boolean Operation) throws java.io.IOException, FiscalException
    Used when command 53( paying with pinpad ) and command 55 ( option 14 ) returns error along with sum and last digits of card number
    Parameters:
      `Operation` - for execution; if true - Print receipt; if false - Void transaction from pinpad;
    Throws:
      `java.io.IOException`
      `FiscalException`