Setup
Setup the provided NodeJS and C++ SDK’s according to the SDK Setup sections in the docs. The NodeJS package is provided as an npm library that can be included in your package.json. For C++ we have provided a C++ header file and a Dynamic Library (dll), which should be placed in the same directory as your exe. If you would prefer a .lib (statically linkable) library we can provide this too (just reach out to support).Initialisation
When your POS Software starts it should initialise the library with relevant configuration. This function call is offline only and will always succede, unless passed malformed parameters. ie. If the initialise call fails, this should be treated as a bug, and you should shutdown the application.Note we provide both NodeJS and C++ examples in all snippets (check the tabs)
Checkout Sessions
When a new pos session (first screen) is initiated for a customer arriving at the till, you create aSession. This session stores context about the POS session such as items that get scanned into the basket,
basket totals etc and is used to help the API process transactions that involve discounts on basket items.
All session functions are completely offline (in memory) and therefore safe to call as part of a regular interaction
(no need to worry about network outages etc).
Session as early as possible in the checkout flow (before beginning to scan customer basket items).
When creating a session you pass a ref, which is YOUR unique identifier for the customer interaction. This is used to
help reconcile transactions in your system with ours when performing settlement and reconsiliation functions with treasury.
close the session, as described in the reference.
As items are scanned (or at the end of the item scanning process), you should set any basket items and the basket total.
This will be set against the currently active session.
Token Scanning or Manual Encoding
The SDK exposes aToken Scan function that provides easy access to the scanner
and a Token Encode function that allows you to manually encode a token.
These tokens can then be used when creating transactions.
When scanning or encoding, you provide a provider key which represents the type
of code, for instance sodexo, gifted or sharetreats (see the API for a full list).
Transactions
To transact atoken you call the Create Transaction function. By doing this
you can check the details of the transaction before it finalises.
You can then either finalise or cancel the transaction.
The Create Transaction function accepts a ref which is YOUR unique identifier
for the transaction. This is purely informational and helps to reconcile the transaction
later.
