Basic Operation
Initial step
Initially, Commercial Automation must execute the ConfiguraIntSiTefInterativo command, passing the information necessary for the Sales Terminal to communicate with SiTef, such as Address
This function should only be called when CliSiTef is loaded, i.e., it is not necessary call it with each new transaction (unless there is a specific need to change company parameters, terminal or SiTef server IP).
The routine returns a value indicating whether the configuration was successful or not. If it returns 0 (zero) the process occurred correctly.
Transaction itself
The next step is then to call the IniciaFuncaoSiTefInterativo function, passing the described parameters to she.
Upon return, it returns the value 10000 to continue the transaction or another value to close.
If the return is 10000, you must call the ContinuaFuncaoSiTefInterativo function, with the parameters also described for her in the next topics.
As long as CliSiTef returns the value 10000 when calling this function, the automation must keep repeating the call this function as many times as necessary until the return value of the function is 0 (zero), indicating that everything went well, or different from 0 and 10000 indicating that an abnormal interruption occurred.
Confirmation (or non-confirmation) of the transaction
If the return was 0 (zero), the automation closes the loop and if a TEF coupon was printed, the automation must print them and call another function, FinalizaFuncaoSiTefInterativo, confirming the transaction or not depending, respectively, on whether the coupon was printed correctly or not.
If the return was different from 10000 and 0 then the automation simply exits the loop and, at the option of the programmer, may or may not display a message according to the return of the called function. For example, if returned -2, means the transaction was canceled by the operator. These negative returns are described in this document.