{"title":"Register the application with Adyen","category":"default","creationDate":1776961627,"content":"<p>Before using the POS systems and connected PEDs to process transactions on the\u00a0plataforma de pagamentos da Adyen, you must authenticate and authorize the POS system and the PED with the plataforma de pagamentos da Adyen\u00a0(at least once).\u00a0Register the POS by making a call to the library with input parameters and processing the callbacks that are returned by the library after registration has been processed.<\/p>\n<p>The POS can then authenticate and authorize any connected PED. After you authenticate and authorize each POS and PED, they are registered in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>.<\/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<p>The merchant account, user id and password that are required to authenticate and authorize the POS are provided by Adyen when the required accounts are being set up.<\/p>\n<h2 id=\"implement-the-callback\">Implement the callback<\/h2>\n<p>Implement the\u00a0<code>register_app_CB<\/code>\u00a0and pass this as a parameter of the <code>register_app<\/code> call.\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 register_pos_CB(register_app_response * result, void * echo_struct)<\/code><\/pre>\n<h2 id=\"allocate-request-structure\">Allocate request structure<\/h2>\n<p>Use\u00a0<code>register_app_allocate<\/code>\u00a0to allocate memory for an\u00a0<code>register_app_request<\/code>\u00a0structure.\u00a0Populate the request by performing string duplication and filling heap allocated strings. If you want the data for later use, retain it, or it will be released automatically.<\/p>\n<h2 id=\"call-the-register_app-function\">Call the register_app Function<\/h2>\n<p>Call the\u00a0<code>register_app<\/code>\u00a0function with the provided parameters to authenticate and authorize the POS.<\/p>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 11%\"><col style=\"width: 0%\"><col style=\"width: 0%\"><col style=\"width: 88%\"><\/colgroup><thead><tr class=\"header\"><th>Name<\/th><th>Type<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>register_app_request_ptr<\/code><\/p>\n<\/td><td>\n<p><a href=\"\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/structs\/register_app_request\">register_app_request<\/a><\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>Pointer to the <code>register_app_request<\/code> struct, this struct contains all the input parameters for this call.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>register_app_CB<\/code><\/p>\n<\/td><td>\n<p>Function<\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>Pointer to the callback function the system returns to the POS with the results of the <code>register_app<\/code> call.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>echo_struct<\/code><\/p>\n<\/td><td>\n<p>Struct:\u00a0<a href=\"\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/structs\/echo_struct\">echo_struct<\/a><\/p>\n<\/td><td>\n<p><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/p>\n<\/td><td>\n<p>Pointer to a user-defined struct that is echoed back in the callback. Use echo_struct 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<h3 id=\"code-example-1\">Code example<\/h3>\n<p>The declaration of the call to register the POS is:<\/p>\n<pre><code class=\"language-cpp\">ADYLibraryResult register_app_result = register_app(register_app_request_ptr, register_pos_CB, &amp;state);<\/code><\/pre>\n<h2 id=\"get-the-function-call-result\">Get the function call result<\/h2>\n<p><code>ADYLibraryResult<\/code>\u00a0is used to store the result of the function call, the immediate response to the call. This is an enum that indicates if the system received the request. 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\u00a0<a href=\"https:\/\/ca-test.adyen.com\/ca\/ca\/contactUs\/support.shtml?form=other\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Support Team<\/a><\/p>\n<div class=\"sc-notice note\"><div>\n<p>This is not the final result of the call. The library returns the final result in response to the library initialization call.<\/p>\n<\/div><\/div>\n<h2 id=\"handle-the-callback\">Handle the callback<\/h2>\n<p>The POS needs to wait for the\u00a0<code>register_pos_cb<\/code>\u00a0to happen, before it can continue with other functions, like boarding the PED device and performing transactions.<\/p>\n<h3 id=\"parameters-1\">Parameters<\/h3>\n<p>The callback passes the following parameters:<\/p>\n<table style=\"width:100%;\"><colgroup><col style=\"width: 11%\"><col style=\"width: 88%\"><\/colgroup><thead><tr class=\"header\"><th>Value<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>\n<p><code>register_app_response<\/code><\/p>\n<\/td><td>\n<p>Response to the <code>register_app_request<\/code>.\u00a0The\u00a0<code>register_app_response<\/code>\u00a0struct page lists included data elements.<\/p>\n<\/td><\/tr><tr><td>\n<p><code>echo_struct<\/code><\/p>\n<\/td><td>\n<p>Pointer to a user-defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.Pointer to a User defined struct that is echoed back in the callback. Use echo_struct 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>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/register-the-application-with-adyen-c-library","articleFields":{"id":"24217501","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"21-05-2019 12:10"},"algolia":{"url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/register-the-application-with-adyen-c-library","title":"Register the application with Adyen","content":"Before using the POS systems and connected PEDs to process transactions on the\u00a0plataforma de pagamentos da Adyen, you must authenticate and authorize the POS system and the PED with the plataforma de pagamentos da Adyen\u00a0(at least once).\u00a0Register the POS by making a call to the library with input parameters and processing the callbacks that are returned by the library after registration has been processed.\nThe POS can then authenticate and authorize any connected PED. After you authenticate and authorize each POS and PED, they are registered in your Customer Area.\n\nThe call and the callback are asynchronous to prevent the call from blocking the calling thread.\n\nThe merchant account, user id and password that are required to authenticate and authorize the POS are provided by Adyen when the required accounts are being set up.\nImplement the callback\nImplement the\u00a0register_app_CB\u00a0and pass this as a parameter of the register_app call.\u00a0For more information on how to do this, see\u00a0Implement callbacks.\nCode example\nThe callback function declaration is:\nvoid register_pos_CB(register_app_response * result, void * echo_struct)\nAllocate request structure\nUse\u00a0register_app_allocate\u00a0to allocate memory for an\u00a0register_app_request\u00a0structure.\u00a0Populate the request by performing string duplication and filling heap allocated strings. If you want the data for later use, retain it, or it will be released automatically.\nCall the register_app Function\nCall the\u00a0register_app\u00a0function with the provided parameters to authenticate and authorize the POS.\nParameters\nNameTypeRequiredDescription\nregister_app_request_ptr\n\nregister_app_request\n\n\n\nPointer to the register_app_request struct, this struct contains all the input parameters for this call.\n\nregister_app_CB\n\nFunction\n\n\n\nPointer to the callback function the system returns to the POS with the results of the register_app call.\n\necho_struct\n\nStruct:\u00a0echo_struct\n\n\n\nPointer to a user-defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.\n\nCode example\nThe declaration of the call to register the POS is:\nADYLibraryResult register_app_result = register_app(register_app_request_ptr, register_pos_CB, &amp;state);\nGet the function call result\nADYLibraryResult\u00a0is used to store the result of the function call, the immediate response to the call. This is an enum that indicates if the system received the request. Should be\u00a0ADYEN_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\u00a0Support Team\n\nThis is not the final result of the call. The library returns the final result in response to the library initialization call.\n\nHandle the callback\nThe POS needs to wait for the\u00a0register_pos_cb\u00a0to happen, before it can continue with other functions, like boarding the PED device and performing transactions.\nParameters\nThe callback passes the following parameters:\nValueDescription\nregister_app_response\n\nResponse to the register_app_request.\u00a0The\u00a0register_app_response\u00a0struct page lists included data elements.\n\necho_struct\n\nPointer to a user-defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.Pointer to a User defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.\n","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":"Register the application with Adyen"},"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\/register-the-application-with-adyen-c-library"},"levels":7,"category":"In-person payments","category_color":"green","tags":["Register","application","Adyen"]}}
