POS Terminal Integration Guide
POS Terminal Integration Guide
SecurOS® ("SecurOS") and all respective logos are trademarks of ISS Corp, in the U.S. and/or other countries.
Intelligent Security Systems reserves the right to make changes to both this Manual and to the products it describes. System
specifications are subject to change without notice. Nothing contained within this Manual is intended as any offer, warranty, promise
or contractual condition, and must not be taken as such.
No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system or translated into any human or
computer language in any form by any means without the express written permission of the copyright holder. Unauthorized copying
of this publication may not only infringe copyright but also reduce the ability of Intelligent Security Systems to provide accurate and
up-to-date information to both users and operators.
SecurOS POS 3 Terminal Integration Guide
Contents
Contents
1 Preface 4
1.1 Scope
........................................................................... 4
1.2 Target
. . . Audience
........................................................................ 4
1.3 Using
. . .This
. . . .Manual
.................................................................... 4
1.4 Getting
. . . .Technical
. . . . . . . . .Support
.............................................................. 4
1.5 Design
. . . .Convention
....................................................................... 5
1.6 Design
. . . .Elements
....................................................................... 6
2 General Description 7
3 Integration Procedure 8
3.1 Creating
. . . . .Parser
. . . . . .XML
. . . . Description
. . . . . . . . . . .File
................................................. 8
3.2 JS Parser
. . . . . .Implementation
..................................................................... 9
3.2.1 Methods. .of
. .listener
. . . . . . .Object
.......................................................................... 9
3.2.1.1 pushReceiptBegin .......................................................................... 9
3.2.1.2 pushCashierName .......................................................................... 10
3.2.1.3 pushNewSale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.1.4 pushSaleAmount .......................................................................... 10
3.2.1.5 pushSaleDiscount .......................................................................... 10
3.2.1.6 pushSaleProductsCount.......................................................................... 11
3.2.1.7 pushSaleArticle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.8 pushSaleEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.9 pushReceiptDiscount .......................................................................... 11
3.2.1.10 pushReceiptEnd .......................................................................... 11
3.2.1.11 pushFilteredString .......................................................................... 12
3.2.1.12 pushEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2.1.13 setEventReceiptCode .......................................................................... 13
3.2.1.14 setReceiptCode .......................................................................... 13
4 Integration Example 14
5 Appendixes 19
5.1 Appendix
. . . . . . .A.
. .Technical
. . . . . . . . .Support
. . . . . . . Information
.................................................. 19
Index 21
www.issivs.com
SecurOS POS 4 Terminal Integration Guide
Preface
1 Preface
This section contains general information about the document, the means of its design and use, as well
as how to get additional technical support for the product.
1.1 Scope
This manual describes the process of POS terminal integration in SecurOS system for their teamwork
with the SecurOS POS Module.
To get online help (Microsoft HTML Help) just press the F1 key when running SecurOS. In
administration mode You can get context help for a given object/utility by pressing the F1 key when its
settings window/utility window is open. In operator mode, use the F1 key to open a description of the
active window of the current operator interface or utility.
If you have any questions after reading this manual, please address them to your system administrator
or supervisor.
For any further information you can contact the Intelligent Security Systems Technical Support Team:
Note. For all technical support requests, please open a ticket from the ISS Partner Portal:
https://support.issivs.com. You will need to create an account if you don’t already have one.
www.issivs.com
SecurOS POS 5 Terminal Integration Guide
Preface
· in USA:
Phone: +1 732 855 1111
· in Canada:
Phone: +1 778 929 8565
· in Mexico:
Phone: +52 55 9001 5252
· in Colombia:
Phone: +57 320 303 2849
· in Brazil:
Phone: +55 85 9668 2530
· in Central America and Caribbean:
Phone: +502 5517 8395
· in Argentina/ Paraguay/ Uruguay:
Phone: +54 911 5039 6440
· in Peru/ Bolivia/ Chile:
Phone: +56 9 3261 9893
· in Ecuador:
Phone: +57 312 255 2932
· in Venezuela:
Phone: +57 321 722 0425
· in Europe:
Phone: +380 44 299 0810
· in Dubai:
Phone: +971 4 874 7100
· in Qatar:
Phone: +974 6 677 8309
· in Saudi Arabia:
Phone: +966 54 109 9699
To solve problems faster, we recommend preparing the service information described in the Technical
Support Information Section before addressing the Technical Support Team.
Font Description
www.issivs.com
SecurOS POS 6 Terminal Integration Guide
Preface
Font Description
bold italic type Used to mark out the elements of homogeneous lists.
Used to mark out macro text and programming code, file names and
monospace their paths. Also it is used to specify the necessary options, to mark
out values specified by the user from the keyboard (manually).
Additional Information
Used to display additional information. These type of elements contain, for example, the description of options for
executing a task or reference to additional literature.
www.issivs.com
SecurOS POS 7 Terminal Integration Guide
General Description
2 General Description
Integration of a POS terminal with SecurOS SecurOS POS Module gives the user additional
opportunities on management and monitoring of the security system, and as a sharing opportunity of
various POS terminals with other subsystems (e. g., video and audio monitoring, see SecurOS
Administration Guide).
www.issivs.com
SecurOS POS 8 Terminal Integration Guide
Integration Procedure
3 Integration Procedure
Terminal integration mechanism is based on running JavaScript (JS parser) script writing with use of
JavaScript integration library.
Note. Possible degrees of freedom for the XML parser modification are described in DTD document, see it on
the http://java.sun.com/dtd/properties.dtd web site.
Warning! charsetname attribute is not used for data transferred through UDP port from terminals.
www.issivs.com
SecurOS POS 9 Terminal Integration Guide
Integration Procedure
Note. A parser script must be written due to JavaScript v 1.5 rules. For more information
see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference.
JS script of cash vouchers syntax analyzer (parser) is used for data analysis and extraction received from
a cash voucher on a terminal.
Listing 2. Parser script example. In this case, this script results in one line shift without printing any
cash voucher information.
function createComponents() {
var self = new Object();
self.dispatcher = function(data) {
listener.pushFilteredString(data); //data line parser script
}
return self;
}
3. Before a parser execution the callback object is set as listener predefined global variable. Methods
of listener object (ыуу Methods of listener Object) are used for cash voucher parsing and
notification of the POS Terminal object about recognized cash voucher/ sales/events for subsequent
displaying in titles.
This section describes the listener object methods available from the parser script.
3.2.1.1 pushReceiptBegin
Parameters:
www.issivs.com
SecurOS POS 10 Terminal Integration Guide
Integration Procedure
Current cash voucher code from the protocol, or null when cash voucher
code
code is not accessible from the protocol. Argument type: String
Returned value:
3.2.1.2 pushCashierName
Parameters:
3.2.1.3 pushNewSale
Description: Add a new record about commodity sale into a current cash voucher. Returns the sale
record ID
Parameters:
3.2.1.4 pushSaleAmount
Parameters:
3.2.1.5 pushSaleDiscount
Parameters:
www.issivs.com
SecurOS POS 11 Terminal Integration Guide
Integration Procedure
3.2.1.6 pushSaleProductsCount
Parameters:
3.2.1.7 pushSaleArticle
Parameters:
3.2.1.8 pushSaleEnd
Syntax: pushSaleEnd ()
Parameters: none
3.2.1.9 pushReceiptDiscount
Parameters:
Overall discount for the whole cash voucher (in percentage). Argument
percents
type: Float
3.2.1.10 pushReceiptEnd
Parameters:
www.issivs.com
SecurOS POS 12 Terminal Integration Guide
Integration Procedure
Total amount of the current cash voucher taken from the protocol, or
null. In the latter case (null), total amount value is set by taking into
totalAmount
account all sales within the current cash voucher (as in
pushReceiptEnd()). Argument type: Float
Syntax: pushReceiptEnd ()
Description: Indicate the end of the current cash voucher. Its total amount value is set by taking
into account all sales within the current cash voucher
Parameters: none
3.2.1.11 pushFilteredString
Description: Add a new line to titles. Then push down cash voucher line displayed in titles on this
new line
Parameters:
3.2.1.12 pushEvent
Description: Send events into SecurOS system on behalf of the Module POS Terminal object (see
event list in SecurOS POS User Guide)
Parameters:
Returned value:
Event identifier
Description: Send events into SecurOS system on behalf of the Module POS Terminal object (see
event list in SecurOS POS User Guide)
Parameters:
Cashier name for this event, or null if the name is undefined. Argument
cashierName
type: String
www.issivs.com
SecurOS POS 13 Terminal Integration Guide
Integration Procedure
Total amount of cash voucher (sale) for this event, or null if the amount
amount
is undefined. Argument type: Float
Returned value:
Event identifier
3.2.1.13 setEventReceiptCode
Description: Set a cash voucher code for the event with specified eventId
Parameters:
3.2.1.14 setReceiptCode
Description: Set a cash voucher code with the given receiptId. If updateSalesCode == true
then the code is set for all sales of the current cash voucher, otherwise the code is set for the cash
voucher only
Parameters:
www.issivs.com
SecurOS POS 14 Terminal Integration Guide
Integration Example
4 Integration Example
There is an example of JS parser for a POS Terminal software integration below.
* "Avalon Company" *
============================
Cashier: Ivanova Olga
============================
+ Rice 6 kg 100.0
+ Meat 1 kg 50.0
============================
Discount: 10 \% 15.0
TOTAL: 135.0
* Have a good day! *
Steps:
1. Create a <profile_name>.js JS parser and add the following code fragments.
2. Define bill beginning and ending.
self.testReceiptBegin = function(data) {
if (/\* "Avalon Company" \*/.test(data)) {
listener.pushReceiptBegin();
listener.pushFilteredString("-----------------------------");
listener.pushFilteredString(" Beginning ");
listener.pushFilteredString("-----------------------------");
return true;
}
return false;
}
The second line of the code above compares string with the start string (bill beginning) by test
method. See lines 3 - 7: this code describes actions on bill beginning detection: send POS Terminal object
a notification of bill beginning (line 3), titles displaying (lines 4 - 6). The way of bill ending detection is
the same.
self.testReceiptEnd = function(data) {
* Have a good day! \*/.test(data)) {
listener.pushReceiptEnd();
listener.pushFilteredString("-----------------------------");
listener.pushFilteredString(" Finished! ");
listener.pushFilteredString("-----------------------------");
return true;
}
return false;
www.issivs.com
SecurOS POS 15 Terminal Integration Guide
Integration Example
self.testCashierName = function(data) {
var matches = /Cashier: (\w+\s*\w*)/.exec(data);
if (matches != null && matches.length >= 2) {
listener.pushCashierName(matches[1]);
return true;
}
return false;
}
Regular expressions are used to single-out cashier first and second name (see line 2, exec method).
Line 4 describes a current cashier registration, if a line coincides with parser template. For the detailed
description of the JavaScript regular expressions see https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference.
self.testSale = function(data) {
var matches = /\+\s(\w+)\s+(\d+)\s*\w*\s*(\d+\.?\d*)/.exec(data);
if (matches != null && matches.length >= 3) {
var productName = matches[1];
var productCount = parseFloat(matches[2]);
var amount = parseFloat(matches[3]);
listener.pushNewSale(productName);
listener.pushSaleProductsCount(productCount);
listener.pushSaleAmount(amount);
listener.pushSaleEnd();
listener.pushFilteredString(data);
return true;
}
return false;
}
Regular expressions are used to single-out sale parameters (see line 2 in the code above). Lines 7, 8 and
9 define sales parameters: product name, product count and sale amount.
self.testTotalSale = function(data) {
var matches = /TOTAL: \s+(\w*)/.exec(data);
if (matches != null) {
var totalCount = parseFloat(matches[1]);
listener.pushSaleProductsCount(totalCount);
return true;
}
www.issivs.com
SecurOS POS 16 Terminal Integration Guide
Integration Example
return false;
}
Regular expressions are used to calculate total amount (see line 2 in the code above). Line 5 describes a
total amount registration, if a line coincides with parser template. The way of discount definition (in
percents) is the same.
self.testDiscount = function(data) {
var matches = /Discount: \s+(\w+)\s+\%?\s+(\d+\.?\d*)/.exec(data);
if (matches != null && matches.length >= 3) {
var saleDiscount = parseFloat(matches[1]);
listener.pushReceiptDiscount(saleDiscount);
return true;
}
return false;
}
Listing 10. Script text. Line processing consists of line shift, printing line symbol on titles and applying
all created function to received cash voucher line for data extraction.
function createComponents() {
var self = new Object();
... //list of parser functions
self.dispatcher = function(data) { //dispatcher method for
out.println(data); //processing received line
listener.pushFilteredString(data);
this.testReceiptBegin(data) ||
this.testReceiptEnd(data) ||
this.testCashierName(data) ||
this.testSale(data) ||
this.testTotalSale(data) ||
this.testDiscount(data);
}
return self;
}
function createComponents() {
var self = new Object();
self.testReceiptBegin = function(data) {
if (/\* "Avalon Company" \*/.test(data)) {
listener.pushReceiptBegin();
listener.pushFilteredString("-----------------------------");
listener.pushFilteredString(" Beginning ");
listener.pushFilteredString("-----------------------------");
return true;
}
return false;
www.issivs.com
SecurOS POS 17 Terminal Integration Guide
Integration Example
self.testReceiptEnd = function(data) {
if (/\* Have a good day! \*/.test(data)) {
listener.pushReceiptEnd();
listener.pushFilteredString("-----------------------------");
listener.pushFilteredString(" Finished! ");
listener.pushFilteredString("-----------------------------");
return true;
}
return false;
}
self.testSale = function(data) {
var matches = /\+\s(\w+)\s+(\d+)\s*\w*\s*(\d+\.?\d*)/.exec(data);
if (matches != null && matches.length >= 3) {
var productName = matches[1];
var productCount = parseFloat(matches[2]);
var amount = parseFloat(matches[3]);
listener.pushNewSale(productName);
listener.pushSaleProductsCount(productCount);
listener.pushSaleAmount(amount);
listener.pushSaleEnd();
listener.pushFilteredString(data);
return true;
}
return false;
}
self.testTotalSale = function(data) {
var matches = /TOTAL: \s+(\w*)/.exec(data);
if (matches != null) {
var totalCount = parseFloat(matches[1]);
listener.pushSaleProductsCount(totalCount);
return true;
}
return false;
}
self.testDiscount = function(data) {
var matches = /Discount: \s+(\w+)\s+\%?\s+(\d+\.?\d*)/.exec(data);
if (matches != null && matches.length >= 3) {
var saleDiscount = parseFloat(matches[1]);
listener.pushReceiptDiscount(saleDiscount);
return true;
}
return false;
}
self.testCashierName = function(data) {
var matches = /Cashier: (\w+\s*\w*)/.exec(data);
if (matches != null && matches.length >= 2) {
listener.pushCashierName(matches[1]);
return true;
}
return false;
}
self.dispatcher = function(data) {
out.println(data);
www.issivs.com
SecurOS POS 18 Terminal Integration Guide
Integration Example
listener.pushFilteredString(data);
this.testReceiptBegin(data) ||
this.testReceiptEnd(data) ||
this.testCashierName(data) ||
this.testSale(data) ||
this.testTotalSale(data) ||
this.testDiscount(data);
}
return self;
}
www.issivs.com
SecurOS POS 19 Terminal Integration Guide
Appendixes
5 Appendixes
5.1 Appendix A. Technical Support Information
Current section contains service information that is necessary on addressing to Intelligent Security
Systems Technical Support.
Note. Collected data have to be send to the Intelligent Security Systems Technical Support Team (see Getting
Technical Support).
Note. Equipment Dallas code can be found by the Hardware Report Utility (see SecurOS Administration
Guide for detailed information about utility).
· (*) name and version of the installed Intelligent Security Systems company software.
· total number of video servers and monitoring (operator) workstations in the system;
· operating system (name and service pack version).
9. Another useful information, if possible. For example:
· computer equipment configuration.
· central processors load.
www.issivs.com
SecurOS POS 20 Terminal Integration Guide
Appendixes
www.issivs.com
SecurOS POS 21 Terminal Integration Guide
Index
Index
P
pushCashierName, method, 10
pushEvent, method,
eventDescription, 12
eventDescription, cashierName, amount, 12
pushFilteredString, method, 12
pushNewSale, method, 10
pushReceiptBegin, method, 9
pushReceiptDiscount, method, 11
pushReceiptEnd, method,
no parameters, 12
totalAmount, 11
pushSaleAmount, method, 10
pushSaleArticle, method, 11
pushSaleDiscount, method, 10
pushSaleEnd, method, 11
pushSaleProductsCount, method, 11
S
setEventReceiptCode, method, 13
setReceiptCode, method, 13
T
technical support,
how to get, 4
how to prepare service information, 19
www.issivs.com