@jaakaru/softpos_api

0.1.48 • Public • Published

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 object
  • successCallback as a function for successful callback
  • failureCallback as a function for failure callback

addToOpenTable

addToOpenTable

Parameters

removeFromOpenTable

removeFromOpenTable

Parameters

  • removeReq as a JSON object with parameters "tableCode", "clerkCode": "rowID"
  • successCallback as a function for successful callback
  • failureCallback 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 execute
  • successCallback
  • failureCallback

Meta

  • deprecated: use evalLisp instead, kept some time for backwards compatibility

evalLisp

Evaluate lisp macro on cashregister side

Parameters

  • cmd lisp macro to evaluate
  • successCallback
  • failureCallback

printer

JSON API methods to control the SoftPoS CashRegister printing

print

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 transactions
  • successCallback
  • errorCallback

removeTransactionFromKitchenSystem

Experimental: Remove transactions based on jobOrderSystemId and transactionUuid

Parameters

  • jobOrderSystemId Job order system id from which to remove transaction
  • transactionUuid transcation to remove
  • successCallback
  • errorCallback

setLineStateInKitchenSystem

Experimental: Change transactionsline state

Parameters

  • jobOrderSystemId Job order system id from which to remove transaction
  • transactionUuid transcation to modify
  • lineStateName Ordered, Ready, Prepared, Served, Deleted, Other
  • successCallback
  • errorCallback

getConfiguration

Experimental: Get map of configuration parameters, including custom configuration

Parameters

  • successCallback
  • errorCallback

saveCustomConfiguration

Experimental: Save custom configuration

Parameters

  • conf custom configuration
  • successCallback
  • 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

Package Sidebar

Install

npm i @jaakaru/softpos_api

Weekly Downloads

1

Version

0.1.48

License

MIT

Unpacked Size

30.7 kB

Total Files

8

Last publish

Collaborators

  • jaakaru