0.1.48 • Published 1 year ago

@jaakaru/softpos_api v0.1.48

Weekly downloads
12
License
MIT
Repository
github
Last release
1 year ago

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
0.1.47

1 year ago

0.1.48

1 year ago

0.1.46

2 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.1.41

3 years ago

0.1.42

3 years ago

0.1.43

3 years ago

0.1.44

3 years ago

0.1.45

3 years ago

0.1.40

3 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.31

3 years ago

0.1.30

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.20

4 years ago

0.1.21

4 years ago

0.1.22

4 years ago

0.1.23

4 years ago

0.1.24

4 years ago

0.1.17

4 years ago

0.1.18

4 years ago

0.1.19

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.16

4 years ago

0.1.13

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.6

4 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.0

5 years ago

0.1.1

5 years ago

0.0.6

5 years ago