JavaScript Functions
posCallbacks : Object.<string, posCallback>
pos_close()
Closes the web view hosted in the POS app.
pos_navigateToCheckoutView()
Navigates to the checkout view in the POS app.
pos_disableCloseButton()
Hides the button that closes the web view hosted in the POS app.
pos_openDrawer()
Opens the configured drawer.
pos_forceCommitCurrentAccount()
Forces a commit on the current account.
pos_commitCurrentAccount()
Commits the current account.
pos_loadAccountForNumber(number)
Loads an account identified by the specified number.
Kind: global function
Param | Type | Description |
---|---|---|
number | string | Reference number used to identify the account to load. |
pos_loadAccountForName(name)
Loads an account identified by the specified name.
Kind: global function
Param | Type | Description |
---|---|---|
name | string | Reference name used to identify the account to load. |
pos_linkCurrentAccountWithTable(tableNumber, callback)
Link a table to the current account.
Kind: global function
Param | Type | Description |
---|---|---|
tableNumber | string | The table number to link the account to. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_checkIfTableAvailable(tableNumber, callback)
Check if the table has an open account associated with it.
Kind: global function
Param | Type | Description |
---|---|---|
tableNumber | string | Table name used to check. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_addExternalReference(reference, prefix)
Adds an external reference with the specified prefix.
Kind: global function
Param | Type | Description |
---|---|---|
reference | string | The reference to add. |
prefix | string | The prefix to concatenate. |
pos_changeAccountProfile(accountProfileCode)
Changes the profile of the current account.
Kind: global function
Param | Type | Description |
---|---|---|
accountProfileCode | string | Reference code used to identify the order profile. |
pos_addItemToCurrentAccount(itemId)
Adds the specified item to the current account.
Kind: global function
Param | Type | Description |
---|---|---|
itemId | string | Reference identifier used to identify the item to add. |
pos_addSpecialItemToCurrentAccount(itemId, priceCents, name)
Adds the specified special item to the current account.
Kind: global function
Param | Type | Description |
---|---|---|
itemId | string | Reference identifier used to identify the item to add. |
priceCents | number | The price of the item to add in cents. |
name | string | The name of the item to add. |
pos_storeData(key, value)
Stores data in the POS app's defaults using the specified key.
Kind: global function
Param | Type | Description |
---|---|---|
key | string | The key to use to store the data. |
value | string | The data to store. |
pos_loadData(key, callback)
Loads data from the POS app's defaults using the specified key.
Kind: global function
Param | Type | Description |
---|---|---|
key | string | The key to use to retrieve the data. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_setCurrentAccountCovers(coversPow2)
Sets the specified number of covers for the current account.
Kind: global function
Param | Type | Description |
---|---|---|
coversPow2 | number | The number of covers to set, multiplied by 100. Example: for 2 covers, enter 200. |
pos_getVersion(callback)
Fetches the POS app's version number.
Kind: global function
Param | Type | Description |
---|---|---|
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_addPayment(amountCents, paymentMethodCode, callback)
Adds a payment to the current account. Excess payment will be displayed on the register as change due.
Kind: global function
Param | Type | Description |
---|---|---|
amountCents | number | The amount of the payment in cents. |
paymentMethodCode | string | Reference code used to identify the payment method to use when adding the payment. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_payAccount(paymentMethodCode, callback)
Pays for the current account. Excess payment will be displayed on the register as change due.
Kind: global function
Param | Type | Description |
---|---|---|
paymentMethodCode | string | Reference code used to identify the payment method to use when paying for the current account. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_payAccountWithTips(amountCents, paymentMethodCode, tipCents, callback)
Pays for the current account with possibility to manually add tips Excess payment will be displayed on the register as change due.
Kind: global function
Param | Type | Description |
---|---|---|
amountCents | number | The amount of the payment in cents. |
paymentMethodCode | string | Reference code used to identify the payment method to use when paying for the current account. |
tipCents | number | The amount of the tips in cents. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_onNFCEvent(callback)
Listening to a BLE NFC event (getting the card identifier)
Kind: global function
Param | Type | Description |
---|---|---|
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_onBarcodeScanEvent(callback)
Listening to a Barcode Scanner event (getting the card identifier)
Kind: global function
Param | Type | Description |
---|---|---|
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_getCurrentAccount(callback)
Fetches the current account.
Kind: global function
Param | Type | Description |
---|---|---|
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_getAvailableDiscounts(callback)
Fetches the currently configured available discounts.
Kind: global function
Param | Type | Description |
---|---|---|
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_toggleDiscount(discountCode, lineId, callback)
Toggles the specified discount on the specified line.
Kind: global function
Param | Type | Description |
---|---|---|
discountCode | string | Reference code used to identify the discount to toggle. |
lineId | string | Reference identifier used to identify the line containing the discount. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_toggleGlobalDiscount(discountCode, callback)
Toggles the specified global discount.
Kind: global function
Param | Type | Description |
---|---|---|
discountCode | string | Reference code used to identify the discount to toggle. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_setConsumer(consumer)
Sets the consumer for the current account.
Kind: global function
Param | Type | Description |
---|---|---|
consumer | posConsumer | The consumer object to set. |
pos_apiCall(path, httpMethod, data, mimeType, callback)
Proxies any API requests to the native side of the application
Kind: global function
Param | Type | Description |
---|---|---|
path | string | Path that the request uses. |
httpMethod | string | Method that the request uses. |
data | * | Content that the request uses. |
mimeType | string | Media type that the request uses. |
callback | posCallback | The callback that will be invoked when the native function is done executing. |
pos_postMessage(data)
Sends a message to the POS app in order to execute some function or relay some information.
Kind: global function
Param | Type | Description |
---|---|---|
data | Object | Object containing information relevant to the message. |
pos_relaySuccessfulFunctionExecution(callbackId, data)
Invokes the specified callback with the received data.
Kind: global function
Param | Type | Description |
---|---|---|
callbackId | string | The identifier of the callback to invoke. |
data | * | The data received after a successful native function execution. |
pos_relayFailedFunctionExecution(callbackId, errorMessage)
Invokes the specified callback with the received error message.
Kind: global function
Param | Type | Description |
---|---|---|
callbackId | string | The identifier of the callback to invoke. |
errorMessage | string | The error message received after a failed native function execution. |
pos_relayFunctionExecution(callbackId, response)
Invokes the specified callback with the received response.
Kind: global function
Param | Type | Description |
---|---|---|
callbackId | string | The identifier of the callback to invoke. |
response | Object | The response to pass to the callback. |
pos_generateUUIDV4() ⇒ string
Generates a valid UUID.
Kind: global function
Returns: string
-
A valid UUID.
pos_generateCallbackId() ⇒ string
Generates a unique callback identifier.
Kind: global function
Returns: string
-
A unique identifier.
posError : Object
Represents the error received after executing a native function.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
message | string | A description of the error. |
posData : *
Represents the data received after executing a native function.
posResponse : Object
Represents the response received after executing a native function.
Kind: global typedef
Properties
Name | Type |
---|---|
posResponse.error | posError |
posResponse.data | posData |
posConsumer : Object
Represents the consumer object.
Kind: global typedef
Properties
Name | Type |
---|---|
posConsumer.identifier | string |
posConsumer.consumer | Object |
posConsumer.firstName | string |
posConsumer.lastName | string |
posConsumer.phoneNumber1 | string |
posConsumer.email | string |
posConsumer.addressLine1 | string |
posConsumer.addressLine2 | string |
posConsumer.zipCode | string |
posConsumer.city | string |
posCallback : function
Callback invoked in an asynchronous manner after executing a native function.
Kind: global typedef
Param | Type | Description |
---|---|---|
response | posResponse | Contains the result of executing a native function. |