Register the application with the Adyen payments platform

Before using the POS systems and connected PEDs to process transactions on the Adyen payments platform, you must authenticate and authorise the POS system and the PED with the Adyen payments platform (at least once). Register the POS by making a call to the library with input parameters and processing the callbacks that are returned by the library after registration has been processed.

The POS can then authenticate and authorise any connected PED. After you authenticate and authorise each POS and PED, they are registered in the POSTFM system. Access the POSTFM in the Adyen Customer Area (CA).

The call and the callback are asynchronous to prevent the call from blocking the calling thread.

The merchant account, user id and password that are required to authenticate and authorise the POS are provided by Adyen when the required accounts are being set up.

Implement the callback

Implement the register_app_CB and pass this as a parameter of the register_app call. For more information on how to do this, see Implement callbacks.

Code example

The callback function declaration is:

void register_pos_CB(register_app_response * result, void * echo_struct)

Allocate request structure

Use register_app_allocate to allocate memory for an register_app_request structure. Populate the request by performing string duplication and filling heap allocated strings. If you want the data for later use, retain it, or it will be released automatically.

Call the register_app Function

Call the register_app function with the provided parameters to authenticate and authorise the POS.

Parameters

Name Type Required Description
register_app_request_ptr register_app_request (tick) Pointer to the register_app_request struct, this struct contains all the input parameters for this call.
register_app_CB Function (tick) Pointer to the callback function the system returns to the POS with the results of the register_app call.
echo_struct Struct: echo_struct (tick) Pointer to a user-defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.

Code example

The declaration of the call to register the POS is:

ADYLibraryResult register_app_result = register_app(register_app_request_ptr, register_pos_CB, &state);

Get the function call result

ADYLibraryResult is used to store the result of the function call, the immediate response to the call. This is an enum that indicates if the system received the request. Should be ADYEN_OK, if this is not the case, something has gone wrong. In this case, check the input to the call and if it cannot be resolved, log the result and contact POS Support Team

This is not the final result of the call. The library returns the final result in response to the library initialization call.

Handle the callback

The POS needs to wait for the register_pos_cb to happen, before it can continue with other functions, like boarding the PED device and performing transactions.

Parameters

The callback passes the following parameters:

Value Description
register_app_response Response to the register_app_request. The register_app_repsonse struct page lists included data elements.
echo_struct Pointer to a user-defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.Pointer to a User defined struct that is echoed back in the callback. Use echo_struct to share a POS data struct between the call to the library and the callback from the library in response to the call.