{"title":"Pass variables with the Adyen.POS service and COM","category":"default","creationDate":1776961627,"content":"<h2 id=\"the-adyen-pos-service\">The Adyen.POS service<\/h2>\n<p>Specific calls used will vary depending on the implementation language,<\/p>\n<p>The single service executable registers under the name \"Adyen.POS\". The cash register creates an instance of the\u00a0<code>Adyen.POS<\/code>\u00a0service according to\u00a0coding preference. For example:\u00a0<code>objADYPOS<\/code>. We use this example name throughout this guide.<\/p>\n<h2 id=\"pass-boolean-variables-using-the-com\">Pass boolean variables using the COM<\/h2>\n<p>Communicating boolean variables across COM varies for different application languages and implementations. To prevent variations in implementations, in the C library COM extension for Windows booleans are handled via a simple {0,1} Integer mapping. False equates to 0 and True is passed as 1.<\/p>\n<p>To implement this, we assume the cash register has a method, for example\u00a0<code>COMBoolean<\/code>,\u00a0which takes a single argument of type boolean and returns a 0\/1. We use the method throughout this guide.\u00a0<\/p>\n<h2 id=\"pass-enums-using-the-com\">Pass ENUMs using the COM<\/h2>\n<p>The ENUMs as defined in the C library are\u00a0not portable\u00a0through the COM extension for Windows. Adyen provides helper methods to allow the cash register to retrieve the string representing the ENUM.<\/p>\n<p>Example methods\u00a0are:\u00a0<code>GetInitFlags<\/code>,\u00a0<code>GetPEDresultStr<\/code>,\u00a0<code>GetLIBresultStr<\/code>, and\u00a0<code>GetPSPresultStr<\/code>.<\/p>\n<p>Callback results are passed in the form of integers. The values can then be\u00a0checked by the application for process control. The\u00a0<code>objADYPOS<\/code>\u00a0instance offers methods to interpret the provided values.<\/p>\n<h3 id=\"code-example-result-checking\">Code Example: Result checking<\/h3>\n<pre><code class=\"language-C\">private void AdyenPOSClass_RegisterAppCB(AppInfo appObj, int pedResult, int pspResult, int libResult, string errorMessage)\n{\n    \/\/ Check if pspresult and library result is 0. If result is 0 then the register application is successful\n\n    if (pspResult == 0 &amp;&amp; libResult==0)\n    {\n        Log.Debug(\"App registered\");\n    }\n\n    else\n    {\n    \/\/ Translate the error messages\n\n        string pspResultCode = objPOS.GetPSPresultStr(pspResult);\n        string libResultCode = objPOS.GetLIBresultStr(libResult);\n        Log.Debug(String.Format(\n            \"RegisterApp callback ped_result: {0} lib_result: {1} PSP_result: {2} error_message: {3}\",\n            pedResult, libResultCode, pspResultCode, errorMessage));\n    }\n\n    WaitForRegisterApp.Set();\n}<\/code><\/pre>\n<p>The values returned by the ENUM in the C Library are string literals. The value\u00a00\u00a0is used for successful results. All other values indicate an action has been duplicated unnecessarily, a longer wait is required, or a problem was encountered. When the application encounters a non-zero value, it is recommended to log the issue and have the application message the cash register staff so that they can take action if necessary.\u00a0<\/p>\n<div class=\"sc-notice note\"><div>\n<p>Obtain the available values (strings) by either looking at the C library header files or by running a simple loop on the helper methods. If you find an occurrence of an empty string, or a string with the value UNKNOWN, this indicates the end of the available entries in the underlying ENUM.<\/p>\n<\/div><\/div>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/com-extension-for-windows-integration\/get-started-with-the-com-extension-for-windows\/pass-variables-with-the-adyenpos-service-and-com","articleFields":{"id":"39950772","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/com-extension-for-windows-integration\/get-started-with-the-com-extension-for-windows\/pass-variables-with-the-adyenpos-service-and-com","title":"Pass variables with the Adyen.POS service and COM","content":"The Adyen.POS service\nSpecific calls used will vary depending on the implementation language,\nThe single service executable registers under the name \"Adyen.POS\". The cash register creates an instance of the\u00a0Adyen.POS\u00a0service according to\u00a0coding preference. For example:\u00a0objADYPOS. We use this example name throughout this guide.\nPass boolean variables using the COM\nCommunicating boolean variables across COM varies for different application languages and implementations. To prevent variations in implementations, in the C library COM extension for Windows booleans are handled via a simple {0,1} Integer mapping. False equates to 0 and True is passed as 1.\nTo implement this, we assume the cash register has a method, for example\u00a0COMBoolean,\u00a0which takes a single argument of type boolean and returns a 0\/1. We use the method throughout this guide.\u00a0\nPass ENUMs using the COM\nThe ENUMs as defined in the C library are\u00a0not portable\u00a0through the COM extension for Windows. Adyen provides helper methods to allow the cash register to retrieve the string representing the ENUM.\nExample methods\u00a0are:\u00a0GetInitFlags,\u00a0GetPEDresultStr,\u00a0GetLIBresultStr, and\u00a0GetPSPresultStr.\nCallback results are passed in the form of integers. The values can then be\u00a0checked by the application for process control. The\u00a0objADYPOS\u00a0instance offers methods to interpret the provided values.\nCode Example: Result checking\nprivate void AdyenPOSClass_RegisterAppCB(AppInfo appObj, int pedResult, int pspResult, int libResult, string errorMessage)\n{\n    \/\/ Check if pspresult and library result is 0. If result is 0 then the register application is successful\n\n    if (pspResult == 0 &amp;&amp; libResult==0)\n    {\n        Log.Debug(\"App registered\");\n    }\n\n    else\n    {\n    \/\/ Translate the error messages\n\n        string pspResultCode = objPOS.GetPSPresultStr(pspResult);\n        string libResultCode = objPOS.GetLIBresultStr(libResult);\n        Log.Debug(String.Format(\n            \"RegisterApp callback ped_result: {0} lib_result: {1} PSP_result: {2} error_message: {3}\",\n            pedResult, libResultCode, pspResultCode, errorMessage));\n    }\n\n    WaitForRegisterApp.Set();\n}\nThe values returned by the ENUM in the C Library are string literals. The value\u00a00\u00a0is used for successful results. All other values indicate an action has been duplicated unnecessarily, a longer wait is required, or a problem was encountered. When the application encounters a non-zero value, it is recommended to log the issue and have the application message the cash register staff so that they can take action if necessary.\u00a0\n\nObtain the available values (strings) by either looking at the C library header files or by running a simple loop on the helper methods. If you find an occurrence of an empty string, or a string with the value UNKNOWN, this indicates the end of the available entries in the underlying ENUM.\n","type":"page","locale":"pt","boost":14,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"COM extension for Windows integration","lvl5":"Get started with the COM extension for Windows","lvl6":"Pass variables with the Adyen.POS service and COM"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/pt","lvl1":"https:\/\/docs.adyen.com\/pt\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation","lvl3":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations","lvl4":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/com-extension-for-windows-integration","lvl5":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/com-extension-for-windows-integration\/get-started-with-the-com-extension-for-windows","lvl6":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/com-extension-for-windows-integration\/get-started-with-the-com-extension-for-windows\/pass-variables-with-the-adyenpos-service-and-com"},"levels":7,"category":"In-person payments","category_color":"green","tags":["variables","Adyen.POS","service"]}}
