{"title":"Handle the Signature callback","category":"default","creationDate":1776961627,"content":"<h2 id=\"implement-the-signature-callback\">Implement the signature callback<\/h2>\n<p>Implement the\u00a0<code>tender_check_signature_CB<\/code>\u00a0and assign to the function pointer\u00a0<code>status_tender_check_signature<\/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>.<\/p>\n<h3 id=\"code-example\">Code example<\/h3>\n<pre><code class=\"language-cpp\">void tender_check_signature_CB(response_header *, ped_device_info *, void * echo_struct);<\/code><\/pre>\n<h2 id=\"handle-the-check-signature-callback\">Handle the check signature callback<\/h2>\n<p>The\u00a0<code>tender_check_signature_CB<\/code> is invoked whenever a shopper signature is required, either on the touchscreen of the PED or on a printed paper receipt. The PED must confirm this and accept or decline the signature to proceed.<\/p>\n<ul>\n<li>The shopper can sign on the touch screen display of the PED. The check signature callback then invokes the merchant to accept or decline the signature. In that case, the response header contains a graphic representation of the signature, so it can be shown on the POS.<\/li>\n<li>A signature on the printed paper copy of the receipt also needs to be confirmed. In this scenario, there would not be no graphical representation of the signature.  <\/li>\n<\/ul>\n<p>In both cases, it is assumed that a cashier checks the signature against the signature on the back of the card, before confirming and accepting the signature.<\/p>\n<p>Create this function and assign to the function pointer\u00a0 <code>status_tender_check_signature<\/code>.<\/p>\n<h3 id=\"parameters\">Parameters<\/h3>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>response_header<\/code><\/td>\n<td>Pointer to the <code>response_header<\/code> struct, this struct contains all the input parameters for this call. This includes the <code>additional_data<\/code> struct and its signature data elements.<\/td>\n<\/tr>\n<tr>\n<td><code>ped_device_info<\/code><\/td>\n<td>Pointer to the <code>ped_device_info<\/code> struct in the POS. Called with the results of the create tender call.<\/td>\n<\/tr>\n<tr>\n<td><code>echo_struct<\/code><\/td>\n<td>Pointer to a POS defined struct. Returned in the callback. Can be used to share a POS data struct between the call to the library and the associated callback from the library<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The <code>state<\/code> is an enum of type <code>TENDER_STATE<\/code> and contains the transaction state, which is <code>CHECK_SIGNATURE<\/code>.<\/p>\n<h2 id=\"confirming-the-check-signature-callback\">Confirming the check signature callback<\/h2>\n<h3 id=\"function\">Function<\/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>\u00a0<code>confirm_signature<\/code><\/td>\n<td>In response to the check signature callback, a call must be made to inform the Library that the merchant has approved or declined the signature of the shopper. The transaction continues after this confirmation is received.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"parameters-1\">Parameters<\/h3>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>terminal_id<\/code><\/td>\n<td>Terminal id of the PED.<\/td>\n<\/tr>\n<tr>\n<td><code>tender_reference<\/code><\/td>\n<td>Tender reference of the transaction.<\/td>\n<\/tr>\n<tr>\n<td><code>confirmation<\/code><\/td>\n<td>Enum of type a <code>ATTENDANT_ACTION_CODE<\/code>, indicating either <code>ATTENDANT_ACTION_CODE_APPROVED<\/code>, <code>ATTENDANT_ACTION_CODE_DECLINED<\/code>, <code>ATTENDANT_ACTION_CODE_RETRY<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"code-example-1\">Code example<\/h3>\n<p>The declaration of the call to confirm the signature callback is as follows:<\/p>\n<pre><code class=\"language-cpp\">\u00a0confirm_signature (char *terminal_id, char *tender_reference, ATTENDANT_ACTION_CODE confirmation)<\/code><\/pre>","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-signature-callback-c-library","articleFields":{"id":"24217516","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"12-01-2021 16:02"},"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-signature-callback-c-library","title":"Handle the Signature callback","content":"Implement the signature callback\nImplement the\u00a0tender_check_signature_CB\u00a0and assign to the function pointer\u00a0status_tender_check_signature.\u00a0For more information on how to do this, see\u00a0Implement callbacks with register_device_request.\nCode example\nvoid tender_check_signature_CB(response_header *, ped_device_info *, void * echo_struct);\nHandle the check signature callback\nThe\u00a0tender_check_signature_CB is invoked whenever a shopper signature is required, either on the touchscreen of the PED or on a printed paper receipt. The PED must confirm this and accept or decline the signature to proceed.\n\nThe shopper can sign on the touch screen display of the PED. The check signature callback then invokes the merchant to accept or decline the signature. In that case, the response header contains a graphic representation of the signature, so it can be shown on the POS.\nA signature on the printed paper copy of the receipt also needs to be confirmed. In this scenario, there would not be no graphical representation of the signature.  \n\nIn both cases, it is assumed that a cashier checks the signature against the signature on the back of the card, before confirming and accepting the signature.\nCreate this function and assign to the function pointer\u00a0 status_tender_check_signature.\nParameters\n\n\n\nField\nDescription\n\n\n\n\nresponse_header\nPointer to the response_header struct, this struct contains all the input parameters for this call. This includes the additional_data struct and its signature data elements.\n\n\nped_device_info\nPointer to the ped_device_info struct in the POS. Called with the results of the create tender call.\n\n\necho_struct\nPointer to a POS defined struct. Returned in the callback. Can be used to share a POS data struct between the call to the library and the associated callback from the library\n\n\n\nThe state is an enum of type TENDER_STATE and contains the transaction state, which is CHECK_SIGNATURE.\nConfirming the check signature callback\nFunction\n\n\n\nName\nDescription\n\n\n\n\n\u00a0confirm_signature\nIn response to the check signature callback, a call must be made to inform the Library that the merchant has approved or declined the signature of the shopper. The transaction continues after this confirmation is received.\n\n\n\nParameters\n\n\n\nField\nDescription\n\n\n\n\nterminal_id\nTerminal id of the PED.\n\n\ntender_reference\nTender reference of the transaction.\n\n\nconfirmation\nEnum of type a ATTENDANT_ACTION_CODE, indicating either ATTENDANT_ACTION_CODE_APPROVED, ATTENDANT_ACTION_CODE_DECLINED, ATTENDANT_ACTION_CODE_RETRY.\n\n\n\nCode example\nThe declaration of the call to confirm the signature callback is as follows:\n\u00a0confirm_signature (char *terminal_id, char *tender_reference, ATTENDANT_ACTION_CODE confirmation)","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 Signature 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-signature-callback-c-library"},"levels":8,"category":"In-person payments","category_color":"green","tags":["Handle","Signature","callback"]}}
