Skip to main content

JavaScript Functions

posCallbacks : Object.<string, posCallback>

Kind: global constant

pos_close()

Closes the web view hosted in the POS app.

Kind: global function

pos_navigateToCheckoutView()

Navigates to the checkout view in the POS app.

Kind: global function

pos_disableCloseButton()

Hides the button that closes the web view hosted in the POS app.

Kind: global function

pos_openDrawer()

Opens the configured drawer.

Kind: global function

pos_forceCommitCurrentAccount()

Forces a commit on the current account.

Kind: global function

pos_commitCurrentAccount()

Commits the current account.

Kind: global function

pos_loadAccountForNumber(number)

Loads an account identified by the specified number.

Kind: global function

ParamTypeDescription
numberstring

Reference number used to identify the account to load.

pos_loadAccountForName(name)

Loads an account identified by the specified name.

Kind: global function

ParamTypeDescription
namestring

Reference name used to identify the account to load.

pos_linkCurrentAccountWithTable(tableNumber, callback)

Link a table to the current account.

Kind: global function

ParamTypeDescription
tableNumberstring

The table number to link the account to.

callbackposCallback

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

ParamTypeDescription
tableNumberstring

Table name used to check.

callbackposCallback

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

ParamTypeDescription
referencestring

The reference to add.

prefixstring

The prefix to concatenate.

pos_changeAccountProfile(accountProfileCode)

Changes the profile of the current account.

Kind: global function

ParamTypeDescription
accountProfileCodestring

Reference code used to identify the order profile.

pos_addItemToCurrentAccount(itemId)

Adds the specified item to the current account.

Kind: global function

ParamTypeDescription
itemIdstring

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

ParamTypeDescription
itemIdstring

Reference identifier used to identify the item to add.

priceCentsnumber

The price of the item to add in cents.

namestring

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

ParamTypeDescription
keystring

The key to use to store the data.

valuestring

The data to store.

pos_loadData(key, callback)

Loads data from the POS app's defaults using the specified key.

Kind: global function

ParamTypeDescription
keystring

The key to use to retrieve the data.

callbackposCallback

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

ParamTypeDescription
coversPow2number

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

ParamTypeDescription
callbackposCallback

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

ParamTypeDescription
amountCentsnumber

The amount of the payment in cents.

paymentMethodCodestring

Reference code used to identify the payment method to use when adding the payment.

callbackposCallback

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

ParamTypeDescription
paymentMethodCodestring

Reference code used to identify the payment method to use when paying for the current account.

callbackposCallback

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

ParamTypeDescription
amountCentsnumber

The amount of the payment in cents.

paymentMethodCodestring

Reference code used to identify the payment method to use when paying for the current account.

tipCentsnumber

The amount of the tips in cents.

callbackposCallback

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

ParamTypeDescription
callbackposCallback

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

ParamTypeDescription
callbackposCallback

The callback that will be invoked when the native function is done executing.

pos_getCurrentAccount(callback)

Fetches the current account.

Kind: global function

ParamTypeDescription
callbackposCallback

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

ParamTypeDescription
callbackposCallback

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

ParamTypeDescription
discountCodestring

Reference code used to identify the discount to toggle.

lineIdstring

Reference identifier used to identify the line containing the discount.

callbackposCallback

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

ParamTypeDescription
discountCodestring

Reference code used to identify the discount to toggle.

callbackposCallback

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

ParamTypeDescription
consumerposConsumer

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

ParamTypeDescription
pathstring

Path that the request uses.

httpMethodstring

Method that the request uses.

data*

Content that the request uses.

mimeTypestring

Media type that the request uses.

callbackposCallback

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

ParamTypeDescription
dataObject

Object containing information relevant to the message.

pos_relaySuccessfulFunctionExecution(callbackId, data)

Invokes the specified callback with the received data.

Kind: global function

ParamTypeDescription
callbackIdstring

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

ParamTypeDescription
callbackIdstring

The identifier of the callback to invoke.

errorMessagestring

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

ParamTypeDescription
callbackIdstring

The identifier of the callback to invoke.

responseObject

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

NameTypeDescription
messagestring

A description of the error.

posData : *

Represents the data received after executing a native function.

Kind: global typedef

posResponse : Object

Represents the response received after executing a native function.

Kind: global typedef
Properties

NameType
posResponse.errorposError
posResponse.dataposData

posConsumer : Object

Represents the consumer object.

Kind: global typedef
Properties

NameType
posConsumer.identifierstring
posConsumer.consumerObject
posConsumer.firstNamestring
posConsumer.lastNamestring
posConsumer.phoneNumber1string
posConsumer.emailstring
posConsumer.addressLine1string
posConsumer.addressLine2string
posConsumer.zipCodestring
posConsumer.citystring

posCallback : function

Callback invoked in an asynchronous manner after executing a native function.

Kind: global typedef

ParamTypeDescription
responseposResponse

Contains the result of executing a native function.