Settlement
METHOD NAME settlement
Requires state
IDLE
and during process moves toSETTLEMENT
Description
Perform a settlement request to the host. Firstly, the terminal will update the parameters. Then, depending on the terminal configuration, it will pack the batch file and send all the transactions currently stored in the batch file. This settlement will have an id and batch number if any transaction is batched. This method returns once the request has been completed.
Parameters
object
-
host
string
REQUIRED
Currently, the value isSHVA
only -
reportFormat
ReportFormat
The format for the report. DefaultNARROW
(1) Show values-
ReportFormat
The format of a report sent back from Shva.
NARROW
Narrow paper printerMEDIUM
Medium sized paper printerWIDE
wide paper printerXML
XML format
-
END
-
-
resetGen
boolean
Reset all parameters generation revision. Defaultfalse
.
Result
object
when a request is valid and settlement starts processing.
-
result
Result
Possible results are:OK
,NETWORK_ERROR
,GENERAL_ERROR
(1) Show values-
Result
Result of new request. Each command has possible values in the field.
OK
Request is okGENERAL_ERROR
An error occurredCANCELED
Command was canceled either by the user (on-screen) or throughcancel
command.TIMEOUT
Operation was timed out.NETWORK_ERROR
No internet connection is available.HOST_ERROR
Host returned an error regarding the request.SMART_READER_ERROR
An error occurred with the smart-readerSMART_CARD_ERROR
An error occurred with the smart card, or the reader couldn't communicate with the card.NONE_CREDIT_CARD
Industrial card was detected when performing a transaction.CARD_NOT_ALLOWED
When the detected card is not allowed to be processed
-
-
settlement
Settlement
Settlement payload
Important
Starting from version 1.4.5, the settlement object may be returned even when the result
indicates a GENERAL_ERROR
. The settlement process performs two independent tasks: updating terminal parameters and batching transactions (when working directly with the processor). Since transaction batching occurs in the middle of the parameters update process, a GENERAL_ERROR
can occur in two scenarios:
- Parameter update succeeds, batching fails: The settlement object will contain basic data only (no batching details)
- Batching succeeds, parameter update fails: The settlement object will contain full batching data and report
Since batched transactions cannot be re-processed, the settlement object preserves transaction data when batching was successful, regardless of parameter update failures. Always check the settlement object content to determine which operations completed successfully.
Errors
HostDisabled
MissingParams
IllegalState
ScreenNotReady
InsufficientBattery