{"title":"Exit the Library","category":"default","creationDate":1776961627,"content":"<p>Exit the library before you turn the POS off.<\/p>\n<div class=\"sc-notice note\"><div>\n<p>The call and the callback are asynchronous to prevent the call from blocking the calling thread.<\/p>\n<\/div><\/div>\n<h2 id=\"implement-the-library_shutdown_cb\">Implement the\u00a0library_shutdown_CB<\/h2>\n<p>Implement the\u00a0<code>library_shutdown_CB<\/code> callback function, pass a pointer of\u00a0<code>library_shutdown_CB<\/code> to the\u00a0<code>exit_library function.<\/code>\u00a0For more information on how to do this, see\u00a0<a href=\"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/calls-and-callbacks-c-library\/implement-callbacks\">Implement callbacks<\/a>.<\/p>\n<h3 id=\"code-example\">Code example<\/h3>\n<p>The callback function declaration is:<\/p>\n<pre><code class=\"language-cpp\">void library_shutdown_CB(void* none, void * echo_struct);<\/code><\/pre>\n<h2 id=\"exit_task-function\">exit_task function<\/h2>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 6%\"><col style=\"width: 92%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>exit_task<\/code>\u00a0<\/p>\n<\/td><td>\n<p>Exits the library when called with the <code>library_shutdown_CB<\/code> parameter.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<h3 id=\"code-example-1\">Code example<\/h3>\n<pre><code class=\"language-cpp\">ADYEN_RESULT exit_result = exit_task(library_shutdown_CB, &amp;state);<\/code><\/pre>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 14%\"><col style=\"width: 85%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>ADYEN_RESULT exit_result<\/code><\/p>\n<\/td><td>\n<p>An enum that indicates if the plataforma de pagamentos da Adyen has successfully received the request.<div class=\"sc-notice note\"><div>This is not the final result of the call. The final result of the call is in a callback returned by the system to the library initialization call.<\/div><\/div>Result of the call to exit the library. Should be\u00a0 <code>ADYEN_OK<\/code> , if this is not the case, something has gone wrong. In this case, check the input to the call and if it cannot be resolved, log the result and contact our\u00a0 <a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml\" class=\"external-link external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"> Support Team<\/a>.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>library_shutdown_CB<\/code><\/p>\n<\/td><td>\n<p>Pointer to the callback function in the POS that is called with the results of the exit call.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>echo_struct<\/code><\/p>\n<\/td><td>\n<p>Pointer to a POS defined struct that can be set by the POS that is echoed back in the callback, it can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.<\/p>\n<\/td><\/tr><\/tbody><\/table>\n<h2 id=\"handle-the-callback\">Handle the callback<\/h2>\n<p>The POS must wait until the system returns the <code>library_shutdown_cb<\/code>\u00a0before continuing with other functions.\u00a0This confirms that the library has been successfully discarded and all related resources are destroyed.<\/p>\n<h2 id=\"logs\">Logs<\/h2>\n<p>The SDK package contains a folder\u00a0<span translate=\"no\"><strong>documentation\/log_files\/documentation<\/strong><\/span>. This folder contains log files of actual test runs that relate to the items discussed in this manual.<\/p>\n<p>The\u00a0<code>exit_task.log<\/code>\u00a0file that shows a live example of the library exit call and the related callback.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/exit-the-library-c-library","articleFields":{"id":"25152116","type":"page","_expandable":{"operations":""},"status":"current"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/exit-the-library-c-library","title":"Exit the Library","content":"Exit the library before you turn the POS off.\n\nThe call and the callback are asynchronous to prevent the call from blocking the calling thread.\n\nImplement the\u00a0library_shutdown_CB\nImplement the\u00a0library_shutdown_CB callback function, pass a pointer of\u00a0library_shutdown_CB to the\u00a0exit_library function.\u00a0For more information on how to do this, see\u00a0Implement callbacks.\nCode example\nThe callback function declaration is:\nvoid library_shutdown_CB(void* none, void * echo_struct);\nexit_task function\nNameDescription\nexit_task\u00a0\n\nExits the library when called with the library_shutdown_CB parameter.\n\nCode example\nADYEN_RESULT exit_result = exit_task(library_shutdown_CB, &amp;state);\nParameters\nNameDescription\nADYEN_RESULT exit_result\n\nAn enum that indicates if the plataforma de pagamentos da Adyen has successfully received the request.This is not the final result of the call. The final result of the call is in a callback returned by the system to the library initialization call.Result of the call to exit the library. Should be\u00a0 ADYEN_OK , if this is not the case, something has gone wrong. In this case, check the input to the call and if it cannot be resolved, log the result and contact our\u00a0  Support Team.\n\nlibrary_shutdown_CB\n\nPointer to the callback function in the POS that is called with the results of the exit call.\n\necho_struct\n\nPointer to a POS defined struct that can be set by the POS that is echoed back in the callback, it can be used to share a POS data struct between the call to the library and the callback from the library in response to the call.\n\nHandle the callback\nThe POS must wait until the system returns the library_shutdown_cb\u00a0before continuing with other functions.\u00a0This confirms that the library has been successfully discarded and all related resources are destroyed.\nLogs\nThe SDK package contains a folder\u00a0documentation\/log_files\/documentation. This folder contains log files of actual test runs that relate to the items discussed in this manual.\nThe\u00a0exit_task.log\u00a0file that shows a live example of the library exit call and the related callback.","type":"page","locale":"pt","boost":14,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"C library integration","lvl5":"Key steps","lvl6":"Exit the Library"},"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\/c-library-integration","lvl5":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library","lvl6":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/exit-the-library-c-library"},"levels":7,"category":"In-person payments","category_color":"green","tags":["Library"]}}
