public final class CliSiTef
extends java.lang.Object
Esta classe utiliza a JCliSiTefI e contém métodos novos para Android
Modifier and Type | Field and Description |
---|---|
IBarcode |
barcode
Barcode
|
static int |
CMD_ABORT_REQUEST
Asks the application if it wants to abort the data collecting process.
|
static int |
CMD_CLEAR_HEADER
Informs that the header of the application must be cleared.
|
static int |
CMD_CLEAR_MENU_TITLE
Informs that the header in the menu presentation must be removed.
|
static int |
CMD_CLEAR_MSG_CASHIER
Informs that the message displayed in the operator display must be removed.
|
static int |
CMD_CLEAR_MSG_CASHIER_CUSTOMER
Informs that the message displayed in both operator and client displays must be removed.
|
static int |
CMD_CLEAR_MSG_CUSTOMER
Informs that the message displayed in the client display must be removed.
|
static int |
CMD_CONFIRM_GO_BACK
Asks to confirm the "step back" request.
|
static int |
CMD_CONFIRMATION
Requests a confirmation (YES/NO).
|
static int |
CMD_GET_FIELD
Asks for a specific field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_BARCODE
Asks for a Barcode field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_CHEQUE
Asks for a Cheque (Check) field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_CURRENCY
Asks for a Currency field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_INTERNAL
Asks for a specific field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_PASSWORD
Asks for a Password field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_FIELD_TRACK
Asks for a Track field, whose size is between minLength and maxLength.
|
static int |
CMD_GET_MASKED_FIELD
Asks for a specific field, that must be masked to the user, whose size is between minLength and maxLength.
|
static int |
CMD_GET_MENU_OPTION
Sends a list of options so the operator can select one item.
|
static int |
CMD_GET_PINPAD_CONFIRMATION
Requests a confirmation (YES/NO) on the pinpad.
|
static int |
CMD_MESSAGE_QRCODE
Send a message to be displayed at the qrcode footer.
|
static int |
CMD_PRESS_ANY_KEY
Waits for the operator to press a key.
|
static int |
CMD_REMOVE_QRCODE_FIELD
Informs the application that the qrcode must be removed from the display.
|
static int |
CMD_RESULT_DATA
Returns a value to be stored by the automation application, if desired.
|
static int |
CMD_SHOW_HEADER
Informs the header that the application must show.
|
static int |
CMD_SHOW_MENU_TITLE
Sends a text that must be used as the header in the menu presentation (Command 21 - CMD_GET_MENU_OPTION).
|
static int |
CMD_SHOW_MSG_CASHIER
Sends a message to be shown in the operator display.
|
static int |
CMD_SHOW_MSG_CASHIER_CUSTOMER
Sends a menssage to be shown in both operator and client displays.
|
static int |
CMD_SHOW_MSG_CUSTOMER
Sends a message to be shown in the client display.
|
static int |
CMD_SHOW_QRCODE_FIELD
Informs the application that the qrcode should be displayed.
|
static int |
CONFIG_ERROR_CLISITEF_LIBRARY_NOT_FOUND |
static int |
CONFIG_ERROR_INITIALIZING_FILES |
static int |
CONFIG_ERROR_INVALID_FIELD |
static int |
CONFIG_ERROR_INVALID_PATH |
static int |
CONFIG_ERROR_INVALID_SITEF_ADDRESS |
static int |
CONFIG_ERROR_INVALID_STORE_ID |
static int |
CONFIG_ERROR_INVALID_TERMINAL_ID |
static int |
CONFIG_ERROR_MAX_SITEF_IP_REACHED |
static int |
CONFIG_ERROR_MISSING_COLLECT_FUNCTION |
static int |
CONFIG_ERROR_MISSING_RECEIVE_FUNCTION |
static int |
CONFIG_ERROR_OUT_OF_MEMORY |
static int |
CONFIG_ERROR_SECURE_MODE |
static int |
CONFIG_ERROR_TCPIP_SETUP |
static int |
CONFIG_OK |
static int |
EVT_BEGIN_BT_STARTUP
Evento indicando que será ligado o adaptador BT do celular
|
static int |
EVT_BEGIN_PP_CONFIG
Indica início de configuração com o dispositivo recém-conectado
|
static int |
EVT_BEGIN_PP_CONNECT
Evento indicando que o usuário deve ligar o pinpad bluetooth
|
static int |
EVT_BT_PP_DISCONNECT
Evento indicando fim de conexão com o pinpad bluetooth
|
static int |
EVT_END_BT_STARTUP
Evento indicando término da etapa de ativação do adaptador BT do celular
|
static int |
EVT_END_PP_CONFIG
Indica sucesso na configuração do pinpad
|
static int |
EVT_END_PP_CONNECT
Indica conexão de um dispositivo bluetooth
|
IPinPad |
pinpad
PinPad
|
Constructor and Description |
---|
CliSiTef(android.content.Context context)
Cria uma instância da CliSiTefI.
|
Modifier and Type | Method and Description |
---|---|
int |
abortTransaction(int continueStatus)
Aborts the current transaction process.
|
int |
closePinPad()
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
configure(java.lang.String sitefIP,
java.lang.String storeID,
java.lang.String terminalID,
java.lang.String additionalParameters)
Performs the initial clisitef setup, thus allowing to interact with the SiTef Server.
|
int |
continueTransaction(java.lang.String data)
Continues the current transaction process, using the data provided as input for the latest onData triggered event.
|
int |
execSendReceiveSiTefDirectly(short RedeDestino,
short FuncaoSiTef,
short TempoEsperaRx,
java.lang.String NumeroCuponFiscal,
java.lang.String DataFiscal,
java.lang.String Horario,
java.lang.String Operador,
short TipoTransacao)
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
finishTransaction(ICliSiTefListener listener,
int confirm,
java.lang.String taxInvoiceNumber,
java.lang.String taxInvoiceDate,
java.lang.String taxInvoiceTime,
java.lang.String additionalParameters)
Performs the settlement of a specific transaction.
|
int |
finishTransaction(int confirm)
Performs the settlement of the last transaction initiated.
|
int |
finishTransaction(int confirm,
java.lang.String taxInvoiceNumber,
java.lang.String taxInvoiceDate,
java.lang.String taxInvoiceTime,
java.lang.String additionalParameters)
Deprecated.
|
java.lang.String |
getBuffer() |
java.lang.String |
getCliSiTefIVersion() |
java.lang.String |
getCliSiTefVersion() |
int |
getCommand() |
int |
getFieldId() |
static CliSiTef |
getInstance()
Obtem um handle da última instância criada da classe.
|
short |
getMaxLength() |
short |
getMinLength() |
int |
getQttPendingTransactions(java.lang.String taxInvoiceDate,
java.lang.String taxInvoiceNumber)
Verify how many transactions were made in case of a blackout.
|
short |
getResponseCode()
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
byte[] |
getRxData()
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
getSendReceiveSiTefDirectlyResult(short TamMaxDadosServico)
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
java.lang.String |
getServiceCode()
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
java.lang.String |
getServiceData()
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
java.lang.String |
getTrack1()
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
java.lang.String |
getTrack2()
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
java.lang.String |
getVersion()
Get the CliSiTef and CliSiTefI version.
|
int |
loadTranslationFile(java.lang.String filename)
Allows to dynamically load a set of messages for internationalization.
|
int |
loadTranslationFile(java.lang.String filename,
java.lang.String CieloFilename)
Allows to dynamically load a set of messages for internationalization.
|
int |
readCardDirectly(java.lang.String message)
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
sendReceiveSiTefDirectly(short RedeDestino,
short FuncaoSiTef,
short OffsetCartao,
byte[] DadosTx,
short TamDadosTx,
short TamMaxDadosRx,
short TempoEsperaRx,
java.lang.String NumeroCuponFiscal,
java.lang.String DataFiscal,
java.lang.String Horario,
java.lang.String Operador,
short TipoTransacao)
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
void |
setActivity(android.app.Activity activity)
Sets the Activity that will show the virtual pinpad (only APOS with internal pinpad).
|
void |
setBuffer(java.lang.String Buffer) |
void |
setContinueFlag(int continueFlag) |
void |
setDebug(boolean value)
Habilita o modo debug, imprimindo mensagens na System.err.
|
void |
setMessageHandler(android.os.Handler hndMessage)
Grava um handler para recepção de eventos genéricos
|
int |
setSendReceiveSiTefDirectlyParameter(short IndiceParametro,
java.lang.String Parametro,
short ParametroCartao,
short Delimitador)
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
startTransaction(ICliSiTefListener listener,
int functionId,
java.lang.String trnAmount,
java.lang.String taxInvoiceNumber,
java.lang.String taxInvoiceDate,
java.lang.String taxInvoiceTime,
java.lang.String cashierOperator,
java.lang.String additionalParameters)
Starts a transaction process.
|
int |
stopReadCardDirectly()
Deprecated.
Funcionalidade experimental (em testes, pode ser removida no futuro!).
|
int |
submitPendingMessages()
During a connection problem with the SiTef server, the CliSiTef will send automatically the pending settlements and unmakings in the next transaction.
|
public static final int CONFIG_OK
public static final int CONFIG_ERROR_INVALID_SITEF_ADDRESS
public static final int CONFIG_ERROR_INVALID_STORE_ID
public static final int CONFIG_ERROR_INVALID_TERMINAL_ID
public static final int CONFIG_ERROR_MISSING_COLLECT_FUNCTION
public static final int CONFIG_ERROR_MISSING_RECEIVE_FUNCTION
public static final int CONFIG_ERROR_TCPIP_SETUP
public static final int CONFIG_ERROR_OUT_OF_MEMORY
public static final int CONFIG_ERROR_CLISITEF_LIBRARY_NOT_FOUND
public static final int CONFIG_ERROR_MAX_SITEF_IP_REACHED
public static final int CONFIG_ERROR_INITIALIZING_FILES
public static final int CONFIG_ERROR_INVALID_FIELD
public static final int CONFIG_ERROR_SECURE_MODE
public static final int CONFIG_ERROR_INVALID_PATH
public static final int CMD_RESULT_DATA
public static final int CMD_SHOW_MSG_CASHIER
public static final int CMD_SHOW_MSG_CUSTOMER
public static final int CMD_SHOW_MSG_CASHIER_CUSTOMER
public static final int CMD_SHOW_MENU_TITLE
public static final int CMD_CLEAR_MSG_CASHIER
public static final int CMD_CLEAR_MSG_CUSTOMER
public static final int CMD_CLEAR_MSG_CASHIER_CUSTOMER
public static final int CMD_CLEAR_MENU_TITLE
public static final int CMD_SHOW_HEADER
public static final int CMD_CLEAR_HEADER
public static final int CMD_CONFIRM_GO_BACK
public static final int CMD_CONFIRMATION
public static final int CMD_GET_MENU_OPTION
public static final int CMD_PRESS_ANY_KEY
public static final int CMD_ABORT_REQUEST
public static final int CMD_GET_FIELD_INTERNAL
public static final int CMD_GET_FIELD
public static final int CMD_GET_FIELD_CHEQUE
public static final int CMD_GET_FIELD_TRACK
public static final int CMD_GET_FIELD_PASSWORD
public static final int CMD_GET_FIELD_CURRENCY
public static final int CMD_GET_FIELD_BARCODE
public static final int CMD_GET_PINPAD_CONFIRMATION
public static final int CMD_GET_MASKED_FIELD
public static final int CMD_SHOW_QRCODE_FIELD
public static final int CMD_REMOVE_QRCODE_FIELD
public static final int CMD_MESSAGE_QRCODE
public static final int EVT_BEGIN_BT_STARTUP
public static final int EVT_END_BT_STARTUP
public static final int EVT_BEGIN_PP_CONNECT
public static final int EVT_END_PP_CONNECT
public static final int EVT_BEGIN_PP_CONFIG
public static final int EVT_END_PP_CONFIG
public static final int EVT_BT_PP_DISCONNECT
public final IPinPad pinpad
public final IBarcode barcode
public CliSiTef(android.content.Context context)
context
- Context que poderá receber eventos de pinpad.public static CliSiTef getInstance()
Pode ser usada entre diversas Activities, sem utilizar putExtra()
public final void setDebug(boolean value)
value
- true, para habilitar o modo debug; false caso contrário.public void setMessageHandler(android.os.Handler hndMessage)
public final java.lang.String getBuffer()
public final void setBuffer(java.lang.String Buffer)
public final void setContinueFlag(int continueFlag)
public final int getCommand()
public final int getFieldId()
public final short getMaxLength()
public final short getMinLength()
public java.lang.String getCliSiTefVersion()
public java.lang.String getCliSiTefIVersion()
public int loadTranslationFile(java.lang.String filename)
filename
- Name of the file to be loaded, containing the translated messages.public int loadTranslationFile(java.lang.String filename, java.lang.String CieloFilename)
filename
- Name of the file to be loaded, containing the translated messages.CieloFilename
- file conteing messages to be used with Cielo.public int configure(java.lang.String sitefIP, java.lang.String storeID, java.lang.String terminalID, java.lang.String additionalParameters)
sitefIP
- The IP address or hostname of the SiTef Server.storeID
- SiTef Store ID.terminalID
- SiTef Terminal ID.additionalParameters
- Additional Parameters used to set up specific configurations of the CliSiTef.public int startTransaction(ICliSiTefListener listener, int functionId, java.lang.String trnAmount, java.lang.String taxInvoiceNumber, java.lang.String taxInvoiceDate, java.lang.String taxInvoiceTime, java.lang.String cashierOperator, java.lang.String additionalParameters)
listener
- Listener that receives the transaction events.functionId
- Type of transaction to be performed.trnAmount
- It contains the amount to be paid with the decimal separator (","). Applications must always pass it with two decimal places after the comma (","). If no amount is specified (for instance, recharge of prepaid), this field must contain zero.taxInvoiceNumber
- Tax Invoice Number used to identify the transaction. Must be unique.taxInvoiceDate
- Tax Invoice Date in the format YYYYMMDD.taxInvoiceTime
- Tax Invoice Time in the format HHMMSS.cashierOperator
- Cashier Operator ID.additionalParameters
- Additional Parameters used to narrow the payment forms of the transaction. This parameter format is explained in the CliSiTef documentation.finishTransaction
to confirm or not the transaction. public int abortTransaction(int continueStatus)
public int continueTransaction(java.lang.String data)
data
- String containing the input for the latest onData triggered event.@Deprecated public int finishTransaction(int confirm, java.lang.String taxInvoiceNumber, java.lang.String taxInvoiceDate, java.lang.String taxInvoiceTime, java.lang.String additionalParameters)
finishTransaction(ICliSiTefListener, int, String, String, String, String)
insteadconfirm
- True, to confirm the transaction; False, to cancel the transaction.taxInvoiceNumber
- Tax Invoice Number used to identify the transaction, must be unique.taxInvoiceDate
- Tax Invoice Date in the format YYYYMMDD.taxInvoiceTime
- Tax Invoice Time in the format HHMMSS.additionalParameters
- Additional parameters (check CliSiTef document: SiTef - Interface Simplificada com a aplicação)public int finishTransaction(ICliSiTefListener listener, int confirm, java.lang.String taxInvoiceNumber, java.lang.String taxInvoiceDate, java.lang.String taxInvoiceTime, java.lang.String additionalParameters)
listener
- Listener that receives the transaction events.confirm
- True, to confirm the transaction; False, to cancel the transaction.taxInvoiceNumber
- Tax Invoice Number used to identify the transaction, must be unique.taxInvoiceDate
- Tax Invoice Date in the format YYYYMMDD.taxInvoiceTime
- Tax Invoice Time in the format HHMMSS.additionalParameters
- Additional parameters (check CliSiTef document: SiTef - Interface Simplificada com a aplicação)public int finishTransaction(int confirm) throws java.lang.Exception
confirm
- True, to confirm the transaction; False, to cancel the transaction.java.lang.Exception
- if last transaction made is not found.public int getQttPendingTransactions(java.lang.String taxInvoiceDate, java.lang.String taxInvoiceNumber) throws java.lang.Exception
taxInvoiceDate
- Invoice date (data fiscal)taxInvoiceNumber
- Invoice number (cupom fiscal)java.lang.Exception
- if no transaction was done previously.public java.lang.String getVersion() throws java.lang.Exception
java.lang.Exception
- if it was not possible to get the versions.public int submitPendingMessages()
public void setActivity(android.app.Activity activity)
startTransaction
and
gets the user input for the transaction.
It is mandatory for the application to call this method before
calling startTransaction
. In case this does not happen, the
the transaction will fail and return code 31 (pinpad error).
We recommend calling this method in the Activity's onCreate method.
This method only aplies to single screen terminals with internal
pinpad, that is, terminals that need a virtual pinpad (e.g. Gertec GPOS700, Ingenico A8).activity
- application Activity that implements the transactionpublic int sendReceiveSiTefDirectly(short RedeDestino, short FuncaoSiTef, short OffsetCartao, byte[] DadosTx, short TamDadosTx, short TamMaxDadosRx, short TempoEsperaRx, java.lang.String NumeroCuponFiscal, java.lang.String DataFiscal, java.lang.String Horario, java.lang.String Operador, short TipoTransacao)
RedeDestino
- FuncaoSiTef
- OffsetCartao
- DadosTx
- TamDadosTx
- TamMaxDadosRx
- TempoEsperaRx
- NumeroCuponFiscal
- DataFiscal
- Horario
- Operador
- TipoTransacao
- public final short getResponseCode()
public final byte[] getRxData()
public int setSendReceiveSiTefDirectlyParameter(short IndiceParametro, java.lang.String Parametro, short ParametroCartao, short Delimitador)
IndiceParametro
- Parametro
- ParametroCartao
- Delimitador
- public int execSendReceiveSiTefDirectly(short RedeDestino, short FuncaoSiTef, short TempoEsperaRx, java.lang.String NumeroCuponFiscal, java.lang.String DataFiscal, java.lang.String Horario, java.lang.String Operador, short TipoTransacao)
RedeDestino
- FuncaoSiTef
- TempoEsperaRx
- NumeroCuponFiscal
- DataFiscal
- Horario
- Operador
- TipoTransacao
- public int getSendReceiveSiTefDirectlyResult(short TamMaxDadosServico)
TamMaxDadosServico
- public final java.lang.String getServiceCode()
public final java.lang.String getServiceData()
public int readCardDirectly(java.lang.String message)
message
- public int stopReadCardDirectly()
public java.lang.String getTrack1()
public java.lang.String getTrack2()
public int closePinPad()