@jaakaru/softpos_api
v0.1.48
Published
Kassamagneetti SoftPoS Javascript API
Downloads
8
Maintainers
Readme
Table of Contents
jsonApi
JSON API methods to control the SoftPoS CashRegister, see also https://github.com/Soft-Contact/resto/issues/2#placeorder
placeOrder
Place order
Parameters
order
as a JSON objectsuccessCallback
as a function for successful callbackfailureCallback
as a function for failure callback
addToOpenTable
addToOpenTable
Parameters
openTable
as a JSON object from https://github.com/Soft-Contact/resto/issues/2#addtoopentablesuccessCallback
as a function for successful callbackfailureCallback
as a function for failure callback
removeFromOpenTable
removeFromOpenTable
Parameters
removeReq
as a JSON object with parameters "tableCode", "clerkCode": "rowID"successCallback
as a function for successful callbackfailureCallback
as a function for failure callback
getActiveTransaction
get currently on cashregister screen active transaction
Parameters
successCallback
failureCallback
executeLisp
Execute lisp macro on cashregister side
Parameters
cmd
lisp macro to executesuccessCallback
failureCallback
Meta
- deprecated: use evalLisp instead, kept some time for backwards compatibility
evalLisp
Evaluate lisp macro on cashregister side
Parameters
cmd
lisp macro to evaluatesuccessCallback
failureCallback
printer
JSON API methods to control the SoftPoS CashRegister printing
Experimental: Print data to the printer
Parameters
printData
successCallback
Examples
let printData =
{
lines: [
{ type: "TEXT", contents: "test string"},
{ type: "TEXT", contents: "text\non\nmultiple\nlines"},
{ type: "QR_CODE", contents: "sample code", alignment: "RIGHT"},
{ type: "BAR_CODE", contents: "1234567890123"},
{ type: "QR_CODE", contents: "another code"},
]
}
payments
JSON API methods to control the SoftPoS CashRegister payment terminal
authorizePayment
Experimental: Authorize payment on SoftPoS side using SoftPos configured payment device
Parameters
payment
successCallback
failureCallback
statusCallback
abortAuthorization
Experimental: Abort currently active payment
Parameters
successCallback
articles
JSON API methods to get article and article group data
listAll
Get all articles from SoftPos
Parameters
successCallback
errorCallback
displays
API methods needed by various separate displays (KitchenDisplay, OrderDisplay).
listAllKitchenSystemTransactions
Experimental: List all transactions based on jobOrderSystemId
Parameters
jobOrderSystemId
Job order system id from which to list transactionssuccessCallback
errorCallback
removeTransactionFromKitchenSystem
Experimental: Remove transactions based on jobOrderSystemId and transactionUuid
Parameters
jobOrderSystemId
Job order system id from which to remove transactiontransactionUuid
transcation to removesuccessCallback
errorCallback
setLineStateInKitchenSystem
Experimental: Change transactionsline state
Parameters
jobOrderSystemId
Job order system id from which to remove transactiontransactionUuid
transcation to modifylineStateName
Ordered, Ready, Prepared, Served, Deleted, OthersuccessCallback
errorCallback
getConfiguration
Experimental: Get map of configuration parameters, including custom configuration
Parameters
successCallback
errorCallback
saveCustomConfiguration
Experimental: Save custom configuration
Parameters
conf
custom configurationsuccessCallback
errorCallback
saveWaitingTime
Save kitchen system waiting time in minutes
Parameters
jobOrderSystemId
waitingTime
successCallback
errorCallback
getWaitingTime
Get kitchen system waiting time in minutes
Parameters
jobOrderSystemId
successCallback
errorCallback
messages
Methods related to messages from SoftPos
listenAll
Experimental: Listen for all messages
Parameters
listenCallbackFn
callback fn where all SoftPoS side asynchronous messages are passed
Examples
{ type: "COMMAND", data: "REFRESH_KITCHEN_DISPLAY"}
utils
Utility methods
getApiType
Gets the SoftPoS API type depending on which environment is used to run it
Returns string one of NONE/HTMLVIEW_LEGACY/HTMLVIEW_JCEF
getSoftPosVersion
Gets the SoftPoS version
Returns string SoftPoS version
getSoftPosInfo
Get the SoftPos info JSON
Parameters
successCallback
failureCallback
Returns json with fields "success" and "response", where response contains the SoftPosInfo object
log
Utility methods for logging
log
Parameters
logRecord
Examples
window.softPos.log({level: 'INFO', msg:'Info message'});
trace
Log TRACE message
Parameters
msg
obj
debug
Log DEBUG message
Parameters
msg
obj
info
Log INFO message
Parameters
msg
obj
warn
Log WARN message
Parameters
msg
obj
error
Log ERROR message
Parameters
msg
obj
fatal
Log FATAL message
Parameters
msg
obj