{"title":"Handle Dynamic Currency Conversion","category":"default","creationDate":1776961627,"content":"<h2 id=\"implement-the-dcc-callback\">Implement the DCC callback<\/h2>\n<p>Implement this <code>tender_dcc_CB<\/code>\u00a0and assign to the function pointer\u00a0<code>status_tender_DCC<\/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_dcc_CB(response_header*, ped_device_info*, void * echo_struct)<\/code><\/pre>\n<h2 id=\"invoke-dynamic-currency-conversion-callback\">Invoke Dynamic Currency Conversion callback<\/h2>\n<p>Set up <code>AskDCC<\/code> in merchant account settings to invoke the DCC callback. 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>\u00a0to enable this setting.<\/p>\n<h2 id=\"handle-the-dcc-callback\">Handle the DCC callback<\/h2>\n<p>The <code>tender_dcc_CB<\/code> callback presents a currency conversion option to the shopper. This allows the POS to indicate this on the POS screen and to provide the details of the currency conversion option also to the shop agent.<\/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>ped_device_info<\/code><\/td>\n<td>See <code>ped_device_info<\/code> for a description of the\u00a0<code>ped_device_info<\/code> struct.<\/td>\n<\/tr>\n<tr>\n<td><code>response_header<\/code><\/td>\n<td>See <code>response_header<\/code> for a description of the\u00a0<code>response_header.<\/code> <code>response_header<\/code> includes\u00a0<code>additional_data_struct<\/code> and its returned data elements. indicates the progress state of the transaction in the state data element, which is an enum of type\u00a0<code>TENDER_STATE<\/code>. In this case it will be\u00a0<code>ASK_DCC<\/code>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"dcc-returned-details\">DCC Returned Details<\/h2>\n<p>The DCC details contain the following keys:<\/p>\n<table>\n<thead>\n<tr>\n<th>Fields<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>dcc.markup<\/code><\/td>\n<td>The markup percentage (for example, 300 = 3%).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.commissionfee<\/code><\/td>\n<td>The commission fee in minor units (for example, 0. Not used currently.).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.exchangerate<\/code><\/td>\n<td>The exchange rate (for example, 16178 = 1.6178).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.converted.amount.value<\/code><\/td>\n<td>The amount after conversion (for example, minor units).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.converted.amount.currency<\/code><\/td>\n<td>The currency after conversion (For example, USD).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.org.amount.value<\/code><\/td>\n<td>The original amount in minor units.<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.org.amount.currency<\/code><\/td>\n<td>The original currency (for example, EUR).<\/td>\n<\/tr>\n<tr>\n<td><code>dcc.source<\/code><\/td>\n<td>The exchange rate source.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"helper-functions\">Helper functions<\/h2>\n<p>A function is available to get additional data values from the <code>additional_data<\/code> struct. See <code>get_additional_data_value<\/code>\u00a0in <span translate=\"no\"><strong>additional_data.h<\/strong><\/span>.<\/p>\n<p>The SDK package contains a folder <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 <span translate=\"no\"><strong>dcc_callback.log<\/strong><\/span> file that shows a live example of the register device call and the related callback.<\/p>","url":"https:\/\/docs.adyen.com\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/extras-c-library\/handle-dynamic-currency-conversion-c-library","articleFields":{"id":"24217514","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\/extras-c-library\/handle-dynamic-currency-conversion-c-library","title":"Handle Dynamic Currency Conversion","content":"Implement the DCC callback\nImplement this tender_dcc_CB\u00a0and assign to the function pointer\u00a0status_tender_DCC.\u00a0For more information on how to do this, see\u00a0Implement callbacks with register_device_request.\nCode example\nvoid tender_dcc_CB(response_header*, ped_device_info*, void * echo_struct)\nInvoke Dynamic Currency Conversion callback\nSet up AskDCC in merchant account settings to invoke the DCC callback. Contact\u00a0Support Team\u00a0to enable this setting.\nHandle the DCC callback\nThe tender_dcc_CB callback presents a currency conversion option to the shopper. This allows the POS to indicate this on the POS screen and to provide the details of the currency conversion option also to the shop agent.\nParameters\n\n\n\nName\nDescription\n\n\n\n\nped_device_info\nSee ped_device_info for a description of the\u00a0ped_device_info struct.\n\n\nresponse_header\nSee response_header for a description of the\u00a0response_header. response_header includes\u00a0additional_data_struct and its returned data elements. indicates the progress state of the transaction in the state data element, which is an enum of type\u00a0TENDER_STATE. In this case it will be\u00a0ASK_DCC.\n\n\n\nDCC Returned Details\nThe DCC details contain the following keys:\n\n\n\nFields\nDescription\n\n\n\n\ndcc.markup\nThe markup percentage (for example, 300 = 3%).\n\n\ndcc.commissionfee\nThe commission fee in minor units (for example, 0. Not used currently.).\n\n\ndcc.exchangerate\nThe exchange rate (for example, 16178 = 1.6178).\n\n\ndcc.converted.amount.value\nThe amount after conversion (for example, minor units).\n\n\ndcc.converted.amount.currency\nThe currency after conversion (For example, USD).\n\n\ndcc.org.amount.value\nThe original amount in minor units.\n\n\ndcc.org.amount.currency\nThe original currency (for example, EUR).\n\n\ndcc.source\nThe exchange rate source.\n\n\n\nHelper functions\nA function is available to get additional data values from the additional_data struct. See get_additional_data_value\u00a0in additional_data.h.\nThe SDK package contains a folder documentation\/log_files\/documentation. This folder contains log files of actual test runs that relate to the items discussed in this manual.\nThe dcc_callback.log file that shows a live example of the register device 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":"Extras","lvl6":"Handle Dynamic Currency Conversion"},"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\/extras-c-library","lvl6":"\/pt\/point-of-sale\/classic-library-deprecation\/classic-library-integrations\/c-library-integration\/extras-c-library\/handle-dynamic-currency-conversion-c-library"},"levels":7,"category":"In-person payments","category_color":"green","tags":["Handle","Dynamic","Currency","Conversion"]}}
