From 5446449e048d6675c1d587ffd18d01e803a5a7d3 Mon Sep 17 00:00:00 2001 From: Frederik Juhl Williams Date: Wed, 6 Nov 2019 09:00:21 +0100 Subject: [PATCH] Update README.md added missing function()...end to pcall in sample code --- README.md | 62 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index b1be16b..777b739 100644 --- a/README.md +++ b/README.md @@ -87,20 +87,22 @@ end function handle(request_rec) local success, result = pcall ( - integrationConfigJson = - [[ - ... INSERT INTEGRATION CONFIG ... - ]] + function() + integrationConfigJson = + [[ + ... INSERT INTEGRATION CONFIG ... + ]] - initRequiredHelpers(request_rec) + initRequiredHelpers(request_rec) - kuHandler = require("KnownUserApacheHandler") + kuHandler = require("KnownUserApacheHandler") - return kuHandler.handleByIntegrationConfig( - "... INSERT CUSTOMER ID ...", - "... INSERT SECRET KEY ...", - integrationConfigJson, - request_rec) + return kuHandler.handleByIntegrationConfig( + "... INSERT CUSTOMER ID ...", + "... INSERT SECRET KEY ...", + integrationConfigJson, + request_rec) + end ) if (success) then @@ -128,25 +130,27 @@ The following is an example of how the handle function would look if the configu function handle(request_rec) local success, result = pcall ( - local models = require("Models") - eventconfig = models.QueueEventConfig.create() - eventconfig.eventId = ""; -- ID of the queue to use - eventconfig.queueDomain = "xxx.queue-it.net"; -- Domain name of the queue, usually in the format [CustomerId].queue-it.net - -- eventconfig.cookieDomain = ".my-shop.com"; -- Optional, domain name where the Queue-it session cookie should be saved - eventconfig.cookieValidityMinute = 15; -- Optional, validity of the Queue-it session cookie. Default is 10 minutes. - eventconfig.extendCookieValidity = true; -- Optional, should the Queue-it session cookie validity time be extended each time the validation runs? Default is true. - -- eventconfig.culture = "en-US"; -- Optional, culture of the queue ticket layout in the format specified here: https:-- msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx Default is to use what is specified on Event - -- eventconfig.layoutName = "NameOfYourCustomLayout"; -- Optional, name of the queue ticket layout e.g. "Default layout by Queue-it". Default is to take what is specified on the Event - - initRequiredHelpers(request_rec) - - kuHandler = require("KnownUserApacheHandler") + function() + local models = require("Models") + eventconfig = models.QueueEventConfig.create() + eventconfig.eventId = ""; -- ID of the queue to use + eventconfig.queueDomain = "xxx.queue-it.net"; -- Domain name of the queue, usually in the format [CustomerId].queue-it.net + -- eventconfig.cookieDomain = ".my-shop.com"; -- Optional, domain name where the Queue-it session cookie should be saved + eventconfig.cookieValidityMinute = 15; -- Optional, validity of the Queue-it session cookie. Default is 10 minutes. + eventconfig.extendCookieValidity = true; -- Optional, should the Queue-it session cookie validity time be extended each time the validation runs? Default is true. + -- eventconfig.culture = "en-US"; -- Optional, culture of the queue ticket layout in the format specified here: https:-- msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx Default is to use what is specified on Event + -- eventconfig.layoutName = "NameOfYourCustomLayout"; -- Optional, name of the queue ticket layout e.g. "Default layout by Queue-it". Default is to take what is specified on the Event + + initRequiredHelpers(request_rec) + + kuHandler = require("KnownUserApacheHandler") - return kuHandler.handleByLocalConfig( - "... INSERT CUSTOMER ID ...", - "... INSERT SECRET KEY ...", - eventconfig, - request_rec) + return kuHandler.handleByLocalConfig( + "... INSERT CUSTOMER ID ...", + "... INSERT SECRET KEY ...", + eventconfig, + request_rec) + end ) if (success) then