- Handling events through the
vmc_link_events_tinterface. - Understanding the structure of
vpos_config_tclass.
Link Events Interface
Thevmc_link_events_tInterface defines the events related to the communication link between the vending machine controller (VMC) and Nayax devices. Implementing this interface enables your application to respond to critical events that occur during the device’s operation.
The following code block presents how to add the interface:
Interface Methods
The table below describes the available methods of the interface.| Method | Description |
|---|---|
onReady() | This method is called when the link with the VPOS (Vend Point of Sale) is successfully established and the device is ready for vending operations. It provides the VPOS’s configuration details. |
onCommError() | This method is invoked when a communication error occurs between the VMC and the VPOS, allowing your application to handle such errors appropriately. |
VPOS Configuration Class
Thevpos_config_t class encapsulates the configuration settings for the VPOS, which are communicated between the VMC and the device. The following code block lists all available configurations:
Class Parameters
The table below provides a detailed description of the parameters.| Parameter | Type (inferred) | Description |
|---|---|---|
prot_ver_major | int | The major version of the Marshall protocol. |
prot_ver_minor | int | The minor version of the Marshall protocol. |
language | String | The language setting of the VPOS. |
country_code | String | The country code in ISO format. |
currency_code | String | The currency code in ISO format. |
decimal_place | int | The price is represented as 10 exponents. For example, if the decimal place is 2 and the requested price is 100, then the actual cost is 1.00 (with 2 decimal places). |
vpos_serial | String | The serial number of the VPOS. |
machine_type | String | The type of machine connected to the VPOS. |
merchant_id | String | The merchant ID. |
acquirer_terminal_id | String | The acquirer terminal ID. |
machine_location | String | The location of the machine. |