--- title: "Register the PED with the Adyen payments platform" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/register-the-ped-with-the-adyen-payments-platform-c-library" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/register-the-ped-with-the-adyen-payments-platform-c-library.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/register-the-ped-with-the-adyen-payments-platform-c-library" last_modified: "2019-05-21T12:08:00+02:00" language: "en" --- # Register the PED with the Adyen payments platform [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/register-the-ped-with-the-adyen-payments-platform-c-library.md) Before using the connected PEDs to process transactions on the Adyen payments platform, you must authenticate and authorize them with the Adyen payments platform (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](https://ca-live.adyen.com/) 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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/register-the-application-with-adyen-c-library). 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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/calls-and-callbacks-c-library/implement-callbacks). ### Code example The callback function declaration is:  ```cpp void register_ped_CB(register_device_response * result, void * echo_struct) ``` ## Allocate request structure Use `register_dev_allocate` to allocate a [register\_device\_request](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/structs/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 | Name | Type | Required | Description | | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `register_dev_req` | [register\_device\_request](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/structs/register_device_request) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/structs/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-](/user/data/smileys/emoji/white_check_mark.png "-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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/structs/echo_struct) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-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: ```cpp 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: | Value | Description | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/structs/ped_device_info).These data elements are recorded in the [Customer Area](https://ca-test.adyen.com/).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: * [Handle progress events - C library](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-progress-events-c-library) * [Handle the Additional Data callback - C library](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-additional-data-callback-c-library) * [Handle Dynamic Currency Conversion - C library](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/extras-c-library/handle-dynamic-currency-conversion-c-library) * [Handle the Print Receipt callback - C library](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-print-receipt-callback-c-library) * [Handle the Signature callback - C library](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-signature-callback-c-library) * [status\_tender\_final](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/process-a-basic-transaction-c-library/handle-the-final-state-callback-c-library) 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.