Single Session with Pre-Selection
In the Pre-selection flow, the customer first selects a product before proceeding to initiate payment. The vending machine remains idle, waiting for product selection. Once the user chooses a product, the payment terminal requests card authorization and, upon approval, dispenses the product.
This method ensures a smooth, secure transaction by separating product selection from payment authorization within a single vending session.
Payment Flow
Visualize the Pre-selection process with the diagram below, which illustrates each step of the single vending session flow, from product selection to payment authorization and dispensing.

Below is a breakdown of the diagram:
- The Nayax Device sends a message to the Card Holder: "Please Select a Product."
- The Card Holder selects a product for the vending machine.
- The vending machine SDK sends a vending request to the Nayax Device.
In C: vmc_vend_vend_request(vend_session_t *session) In C#: vmc_instance.vend.vend_request(session); In Java: m_vmc.vend.vend_request(m_sessions[m_active_session]);
- The Nayax Device sends a message to the Card Holder: "Please Present Card."
- Card Holder presents their payment card.
- The Nayax Device sends an authorization request to the Nayax Server.
- The Nayax Server forwards the authorization request to the Billing Provider.
- The Billing Provider sends an authorization response (approved) to the Nayax Server.
- The Nayax Server sends the authorization response (approved) back to the Nayax Device.
- The vending machine SDK handles transaction data
In C: vmc_vend_event_handler_cb(vm_vend_event_on_transaction_info) // WIP!!! needs to add the calls of the functions In C#: onTransactionInfo(data) In Java onTransactionInfo
- The SDK triggers vend approved events (
vmc_vend_event_handler_cb(vm_vend_event_on_vend_approved)
). - The vending machine dispenses the product.
- The SDK reports vend success (
vmc_vend_vend_status(&session, __true)
) and completes the vend session (vmc_vend_vend_session_complete_lowlevel()
). - Message to Card Holder: "Please Take Product."
- The Nayax Device sends a settlement request to the Nayax Server.
- The Nayax Server forwards the settlement request to the Billing Provider.
- The Billing Provider sends a settlement response (OK) to the Nayax Server.
- The Nayax Server returns the settlement response (OK) to the Nayax Device.
- The vending session ends.
- Message to Card Holder: "Thank you & Goodbye."
See Also
Updated 3 days ago