{"title":"Handle the final state callback","category":"default","creationDate":1776961627,"content":"<h2 id=\"implement-the-tender-finished-callback\">Implement the tender finished callback<\/h2>\n<p>Implement the\u00a0<code>tender_finished_cb<\/code>,\u00a0assign to the function pointer\u00a0<code>status_tender_final<\/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-with-register_device_request\">Implement callbacks with register_device_request<\/a>.\u00a0<\/p>\n<h2 id=\"callback\">Callback<\/h2>\n<p>Finally, the system returns the\u00a0<code>tender_finished_cb<\/code>\u00a0callback that contains the final transaction result. Another transaction can only be started when the final transaction result is received.<\/p>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>final_strct<\/code><\/td>\n<td>Pointer to a <code>final_strct<\/code> struct that defines the final outcome of the transaction. For included parameters and more information, see the <code>final_strct<\/code>page.<\/td>\n<\/tr>\n<tr>\n<td><code>ped_device_info<\/code><\/td>\n<td>Pointer to a <code>ped_device_info<\/code> struct that defines the status and details of the PED. For included parameters and more information, see the <code>ped_device_info<\/code>\u00a0page.<\/td>\n<\/tr>\n<tr>\n<td><code>echo_struct<\/code><\/td>\n<td>Pointer to a struct set by the POS in the <code>device_callbacks<\/code> struct is echoed back in this struct.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Transaction information is returned in the\u00a0<code>response_header<\/code> struct.<\/p>\n<p>The state is an enum of type TENDER_STATE and defines the final outcome of the transaction, it can be one of the following:<\/p>\n<ul>\n<li>FINAL_STATE_APPROVED<\/li>\n<li>FINAL_STATE_DECLINED<\/li>\n<li>FINAL_STATE_CANCELLED<\/li>\n<li>FINAL_STATE_ERROR<\/li>\n<\/ul>\n<div class=\"sc-notice note\"><div>\n<p>This is different from <code>ped_result_code<\/code> APPROVED.<\/p>\n<\/div><\/div>\n<p>The <code>pos_result_code,<\/code>\u00a0an enum of type <code>POS_RESULT_CODE,<\/code> represents the response from the issuer. If the state is\u00a0<code>FINAL_STATE_DECLINED<\/code>,\u00a0<code>FINAL_STATE_CANCELLED<\/code>\u00a0or\u00a0<code>FINAL_STATE_ERROR,<\/code> additional information is available.\u00a0\u00a0<\/p>\n<p>Additional information might also be available in\u00a0<code>refusal_reason<\/code>\u00a0and\/or <code>error_message<\/code>.\u00a0<\/p>\n<div class=\"sc-notice note\"><div>\n<p>As card approval is still required, the POS result code is not the final result of the transaction.<\/p>\n<\/div><\/div>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/process-a-basic-transaction-c-library\/handle-the-final-state-callback-c-library","articleFields":{"id":"24217518","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\/process-a-basic-transaction-c-library\/handle-the-final-state-callback-c-library","title":"Handle the final state callback","content":"Implement the tender finished callback\nImplement the\u00a0tender_finished_cb,\u00a0assign to the function pointer\u00a0status_tender_final.\u00a0For more information on how to do this, see\u00a0Implement callbacks with register_device_request.\u00a0\nCallback\nFinally, the system returns the\u00a0tender_finished_cb\u00a0callback that contains the final transaction result. Another transaction can only be started when the final transaction result is received.\nParameters\n\n\n\nName\nDescription\n\n\n\n\nfinal_strct\nPointer to a final_strct struct that defines the final outcome of the transaction. For included parameters and more information, see the final_strctpage.\n\n\nped_device_info\nPointer to a ped_device_info struct that defines the status and details of the PED. For included parameters and more information, see the ped_device_info\u00a0page.\n\n\necho_struct\nPointer to a struct set by the POS in the device_callbacks struct is echoed back in this struct.\n\n\n\nTransaction information is returned in the\u00a0response_header struct.\nThe state is an enum of type TENDER_STATE and defines the final outcome of the transaction, it can be one of the following:\n\nFINAL_STATE_APPROVED\nFINAL_STATE_DECLINED\nFINAL_STATE_CANCELLED\nFINAL_STATE_ERROR\n\n\nThis is different from ped_result_code APPROVED.\n\nThe pos_result_code,\u00a0an enum of type POS_RESULT_CODE, represents the response from the issuer. If the state is\u00a0FINAL_STATE_DECLINED,\u00a0FINAL_STATE_CANCELLED\u00a0or\u00a0FINAL_STATE_ERROR, additional information is available.\u00a0\u00a0\nAdditional information might also be available in\u00a0refusal_reason\u00a0and\/or error_message.\u00a0\n\nAs card approval is still required, the POS result code is not the final result of the transaction.\n","type":"page","locale":"pt","boost":13,"hierarchy":{"lvl0":"Home","lvl1":"Terminais","lvl2":"Deprecation of classic libraries","lvl3":"Library integrations","lvl4":"C library integration","lvl5":"Key steps","lvl6":"Process a basic transaction","lvl7":"Handle the final state callback"},"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":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/process-a-basic-transaction-c-library","lvl7":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/key-steps-c-library\/process-a-basic-transaction-c-library\/handle-the-final-state-callback-c-library"},"levels":8,"category":"In-person payments","category_color":"green","tags":["Handle","final","state","callback"]}}
