Implement the additional data callback
tender_additional_data_CB and assign to the function pointer
status_tender_additional_data. For more information on how to do this, see Implement callbacks with register_device_request.
void tender_additional_data_CB(response_header *status_tender, ped_device_info *ped_state, void *echo_struct)
Invoke the additional data callback
create_tender call with the
GetAdditionalData tender option to invoke the
tender_additional_data_CB. The card number is used as a key to collect additional data and make it available to the POS during the transaction. Create this function and assign to the function pointer
Apart from card information, there are two additional sets of data:
- Loyalty data for merchant branded cards and/or recurring references in case of a non-merchant card. Loyalty data is retrieved from the merchant loyalty database. The Adyen payments platform and the merchant managed loyalty system must be able to communicate. The merchant guarantees that no sensitive data elements, like card numbers, are present in the loyalty data that is passed, as this would bring the merchant into the scope of PCI DSS. Provide the shopper reference and/or shopper reference at the start of the transaction. If the card has been used before, the existing alias, last used shopper reference, and last used shopper email address are returned. A new alias is generated if it does not already exist.
- Digital Customer Recognition and Global Blue data. This option is also required to implement DCC. Use the standard Adyen facilities for recurring payments, by either using the alias or the shopper reference to retrieve the recurring details for a specific customer. These recurring details can then be used to submit subsequent recurring transactions. The shopper recognition details can also be used to support one-click payments in the web shop. Recurring details are recorded only when the payment is authorised. Recurring payments can not be processed against cards that are not authorised.
Some schemes do not allow recurring payments, see the payment methods overview for more information.
The shopper reference and/or the shopper email address can be provided in the
TransactionRequest passed to the library when starting such a transaction.
The additional data callback function declaration is:
void additional_data_CB(response_header*, ped_device_info*, void * echo_struct)
Additional Data Response
response_header page lists the returned data elements, including
Allocate the additional_data_obj
additional_data_obj_allocate function to allocate, initialize and return an
additional_data_obj structure. Populate the request by performing string duplication to fill heap-allocated strings. The library automatically frees this memory.
Confirm the additional data callback
confirm_additional_data function After the POS receives the additional data callback from the PED, the POS must confirm in order to continue the transaction. Based on the information received during the callback, the amount can be adjusted. The currency must be the same as the original currency.
||Terminal id of the PED.|
||The tender_reference of the transaction.|
||The currency of the transaction (must match original currency).|
||The adjusted amount.|
||The shopper reference.|
||The shopper email.|
||Object used to hold additional data|
The declaration of the call to confirm the additional data callback is as follows:
void confirm_additional_data(char *terminal_id, char * tender_reference, char * adjust_currency, char * adjust_amount, char * shopper_reference, char * shopper_email, additional_data_struct * additional_data_obj);
To finish the transaction without changes or new information, enter the
tender_reference and set all other fields to NULL.
- A transaction was started for EUR 10,00.
- The loyalty data received in the call indicates this is a shopper that is eligible for a discount of 10%.
In this case, the amount can be changed to EUR 9,00.
It is also possible to record the shopper reference and shopper email at this stage, if the shopper has been identified.