No momento, esta página não está disponível em português
Point-of-sale icon

Handle Dynamic Currency Conversion

Implement the DCC callback

Implement this tender_dcc_CB and assign to the function pointer status_tender_DCC. For more information on how to do this, see Implement callbacks with register_device_request.

Code example

void tender_dcc_CB(response_header*, ped_device_info*, void * echo_struct)

Invoke Dynamic Currency Conversion callback

Set up AskDCC in merchant account settings to invoke the DCC callback. Contact Support Team to enable this setting.

Handle the DCC callback

The 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.

Parameters

Name Description
ped_device_info See ped_device_info for a description of the ped_device_info struct.
response_header See response_header for a description of the response_header. response_header includes additional_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 TENDER_STATE. In this case it will be ASK_DCC.

DCC Returned Details

The DCC details contain the following keys:

Fields Description
dcc.markup The markup percentage (for example, 300 = 3%).
dcc.commissionfee The commission fee in minor units (for example, 0. Not used currently.).
dcc.exchangerate The exchange rate (for example, 16178 = 1.6178).
dcc.converted.amount.value The amount after conversion (for example, minor units).
dcc.converted.amount.currency The currency after conversion (For example, USD).
dcc.org.amount.value The original amount in minor units.
dcc.org.amount.currency The original currency (for example, EUR).
dcc.source The exchange rate source.

Helper functions

A function is available to get additional data values from the additional_data struct. See get_additional_data_value in additional_data.h.

The 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.

The dcc_callback.log file that shows a live example of the register device call and the related callback.