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

Register the PED with the Adyen payments platform

Before using the connected PEDs to process transactions on the plataforma de pagamentos da Adyen, you must authenticate and authorize them with the plataforma de pagamentos da Adyen (at least once). Authenticate and authorize the PED by making a register_device call to the library with input parameters. The library returns a callback. Process this after the system processes the PED registration call. 

After you authenticate and authorize each PED, they are registered in your Customer Area

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

Register the PED after you authenticate and authorize the POS. If the POS is not authenticated and authorized, the call fails.

Implement the callback

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

Code example

The callback function declaration is: 

void register_ped_CB(register_device_response * result, void * echo_struct)

Allocate request structure

Use register_dev_allocate to allocate a register_device_request structure. Populate the request by performing string duplication to fill heap-allocated strings.  The library automatically frees this memory..

Call the register_device Function

Call the register_device function to authenticate and authorize the PED by making this call to the library with input parameters. The library returns a callback. Process this after the system processes the PED registration call. 

Parameters

NameTypeRequiredDescription

register_dev_req

register_device_request

-white_check_mark-

Pointer to the register_device_request struct, this struct contains all the input parameters for this call. For a list of parameters, see register_device_request.

You can register a PED to a specific store by populating the store parameter of the register_device_request.

register_ped_CB

Function

-white_check_mark-

Pointer to the callback function the system returns to the POS with the results of the register_device call.

echo_struct

Struct: echo_struct

-white_check_mark-

Pointer to a POS 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.

You can register more than one PED on the library with the register_device function.

Code example

The declaration of the call to register the PED is as follows:

ADYLibraryResult register_device_result = register_device(register_device_request_ptr, register_ped_CB, &state);

Handle the callback

The POS needs to wait for the register_ped_cb to happen, before it can continue with other functions.

Parameters

The callback passes the following parameters:

ValueDescription

ped_device_info

A pointer to a ped_device_info struct that defines the status and details of the PED. For a list of parameters, see ped_device_info.These data elements are recorded in the Customer Area.The terminal_serial_number, terminal_type, terminal_brand, terminal_api_version, terminal_os_version, and terminal_hardware_version data elements are used to define the exact state of the PED. Use these elements to investigate issues.

echo_struct

A pointer to a User-defined struct that can be set by the POS on the device_callbacks struct and which is being echoed back here.

Other Register device callback functions

To allow the library to return callbacks specified by the POS. they need to be provided to the library. The callback functions are registered during the register device stage, where the callbacks handlers are specified in the callbacks structure of the register_device_request.

The following callback functions must be specified:

As the payment process is handled by the PED, all state information should also be retrieved from the PED. The POS application must never assume the final state and should wait for the final state of the transaction as reported by the PED (from the library). Even when the POS initiates a request to cancel, it should wait until the library returns the final state of the transaction.

The POS needs to wait for the register device callback to happen, before it can continue with other functions, in particular, performing transactions.

This callback not only arrives in response to a register_device call, it is also be called every time a change in device status occurs, It is possible to happen during a transaction.