ECMAScript5.1 specification is fully supported. Related JS functionality is documented at http://www.ecma-international.org/ecma-262/5.1/
The ARGV object.
The ARGV object used for passing a flat map of key-value pairs. Values are restricted to basic types, objects cannot be passed.
Terminal Commerce applications can store data persistently on flash drive.
Interacting with External Servers
. XMLHTTPRequest class is provided for sending HTTP POST/GET requests. A TLS1.2 secured connection to VFI cloud is provided transparently to Terminal Commerce applications by the runtime proxy.
Sending and Receiving Notifications
. Terminal Commerce applications can send out notifications with a JSON payload to:
- Request service from a payment application (send and wait synchronously for answer)
- Provide result data to payment application (asynchronously send and exit application)
Printing to Buffer. Terminal Commerce applications can also print to a buffer and send this buffer to the payment application to either forward it to a connected ECR or print as an addendum to the payment receipt. The provided functions generate an HTML document with images and barcodes included as inline images, so that the returned document is self-contained.
Using Text Catalogs. The runtime supports text catalogs to store texts that can be looked up from the HTML documents when using <?text ... ?> preprocessing instructions. The texts are stored in catalog files. By using catalog files, an application is able to separate texts from the HTML code, making it possible to create language independent HTML and template files.
Try Catch -loop for the JS functionality
Good development practice is to use try – catch exception handling
• Include JS code within a try-block
• In case of runtime error (example: wrongly built payload for the notification function), the catch –block provides the exception-handling code
• Do not forget the proper app exit, and maybe a notification to the user as well