C library integration

This document applies for library version 1.6. For the version 1.5 document, click here.

Use the C Library integration to allow communication between your POS application, terminal, and the Adyen platform. Register the POS app and terminal, make calls and receive callbacks, and review enums for their state and result.

C library transaction flow

The transaction flow is:

  1. Initialize the library (init_task)
  2. Register the POS (register_app)
  3. Register the PED (register_device)
  4. Start a transaction (create_tender) -  this step can be repeated as many times as required
  5. Exit the library (exit_task)

Architecture Diagram

Calls and callbacks

The library handles calls asynchronously. Calls return directly and the system returns results in the form of callbacks. All calls to the library are non-blocking.

Because the library processes asynchronously, and callbacks are required to get additional info from the attendant, a number of callback routines must be specified. The library returns these callbacks to the above calls whenever additional input is required.

These callbacks are:

  1. Library initialization callback
  2. Register POS callback
  3. Register PED callback
  4. Create tender callback
  5. Cancel or Refund callback
  6. Show Screen callback 
  7. Additional data callback
  8. Receipt callback 
  9. Signature callback
  10. Progress event callback
  11. TxStoreReport callback
  12. Exception callback
  13. Log callback
  14. Balance Inquiry Gift Card callback
  15. Balance Acquired callback
  16. Load Gift Card callback
  17. Final result callback
  18. PED State callback
  19. Library exit callback

ENUMS

The library represents results, states and other fixed values using enums. The adyen_enum.h file contains these enums. Helper functions are available to convert strings to enums and enums to strings.

You should include POSLibC.h as this will handle your platform specifics, such as threading, data models, platform specifications etc.

The POS App should use the enumerated values instead of the underlying values. For example, if a value of an enum should be stored to disk, store the string and not the integer value.

Questions

Can't find something you are looking for? Look at our FAQ for answers or send an email to support.