Vending Session Management

This page covers the data structures used in the Marshall SDK to handle vending product requests and sessions. Such as:

  • vend_item_t
  • vend_session_data_t
  • vend_session_t

These structures define the classes and fields necessary to manage product details, session data, and the overall vending session.

Product Class

The vend_item_t class represents an individual product request within a vending session. This class includes the product code, price, quantity, and unit of measure. The following code block lists all class parameters:

public static class vend_item_t {
    public short code;
    public int price;
    public int qty;
    public byte unit;
}
struct vend_item_t
	uint16_t code;
	uint16_t/uint32_t price;
	uint32_t qty;
	uint32_t unit;

Product Parameters

The table below provides a more detailed description of the parameters.

ParameterType (inferred)Description
codeString or IntThe unique identifier for the product, also known as the MDB code.
priceIntProduct price, where the real price is calculated as price / (10 ^ decimal places).
qtyIntThe quantity of the product being vented.
unitIntUnit of measure for the product, with 0 indicating a discrete unit (e.g., a single drink bottle).

Vending Session Data Class

The vend_session_data_t class holds detailed information about a vending session, including transaction details and card information. The following code block lists all class parameters:

public static class vend_session_data_t {  
    public long transaction_id;  
    public short choose_product_timeout;  
    public int card_type;  
    public int card_entry_mode;  
    public String card_bin;  
    public String card_bin_hash;  
    public String prop_card_uid;  
    public int vmc_auth_status;  
    public int com_status;  
    public String excel_data;  
    public String cc_last_4_digits;  
}
struct vmc_vend_transfer_data_t
  int 	 encode_bitmap;
  int       transaction_id_len;
  uint8_t[] transaction_id;
  uint16_t  choose_product_timeout;
  uint8_t   card_type;
  uint8_t   card_sub_type;
  uint8_t   card_entry_mode;
  int     	 card_bin_len;
  uint8_t[] card_bin;
  int     	 card_bin_hash_len;
  uint8_t[] card_bin_hash;
  int     	 prop_card_uid_len;
  uint8_t[] prop_card_uid;
  uint8_t   vmc_auth_status;
  uint32_t  com_status;
  int     	 ftl_data_len;
  uint8_t[] ftl_data;
  char[] 	 cc_last_4_digits;
  uint16_t  product_code;
  uint32_t  product_price;
  uint32_t  default_credit;
  uint8_t[] main_fw_ver;
  uint8_t[] pos_fw_ver
  uint8_t[] monyx_id;
  uint32_t  final_price;
  sint32_t  card_balance;

Class Parameters

The table below provides a more detailed description of the parameters.

ParameterType (inferred)Description
transaction_idString or IntTransaction unique identifier.
choose_product_timeoutIntTimeout duration for choosing a product.
card_typeStringCard type used in the transaction.
card_entry_modeStringCard entry mode (e.g., swipe, insert).
card_binString or IntThe Bank Identification Number (BIN) of the card.
card_bin_hashStringThe hashed BIN of the card for security purposes.
prop_card_uidStringThe UID of the proprietary card.
vmc_auth_statusString or IntAuthorization status from the VMC.
com_statusString or IntCommunication status.
excel_dataStringAdditional data in Excel format.
cc_last_4_digitsStringThe last four digits of the credit card.

Vending Session Handle Class

The vend_session_t class represents a vending session, encapsulating session-specific data, product lists, and session status. The following code block lists all class parameters:

public static class vend_session_t {
    public int funds_avail;
    public int session_status;
    public vend_session_data_t data;
    public ArrayList<vend_item_t> products_list;
}
struct vend_session_t
  int funds_avail;
	int total_amount;
	int vend_amount;
	int discount;
	uint16_t session_id;
	vmc_vend_transfer_data_t* data;
	vend_item_t* products;
	int total_products;

Vending Session Class Parameters

The table below provides a more detailed description of the parameters.

ParameterType (inferred)Description
funds_availintAvailable funds for the session.
session_statusString or EnumThe user sets the session's status, especially in cases of cancellation or failed dispensing.
vend_session_data_t dataObjectAn instance of vend_session_data_t containing detailed session data.
products_listArrayList<vend_item_t>A list of vend_item_t objects representing the products involved in the session. Note that only a single product is allowed in multi-session mode.