Java SDK Simulator
The Nayax Marshall SDK includes a simulator to help developers test and debug their device integration with the Nayax payment system. The simulator replicates the behaviour of the actual hardware and software interactions, allowing you to validate the vending process without needing physical hardware.
Simulator
When the Java SDK simulator is started on a terminal, its menu will look like this:
[0]: Start Vend Session 0 [1]: Cancel Session [2]: Close Session 0 [3]: query opened sessions [4]: query reader state [5]: cash sale [6]: alert [7]: display message [8]: open socket [9]: close socket [10]: UI control [q]: quit
The table below describes each option:
Command | Description |
---|---|
Start Vend Session 0 | Starts a session (a transaction). |
Cancel Session | Cancels the transaction as if you pressed the X button on Nayax's device. |
Close Session 0 | Only relevant in multisession. Closes the session at the end of a transaction. |
Query opened sessions | Gives information about which sessions are currently open. This option is relevant from 4.0.0.22 and above. |
Query reader state | Gives information about whether the reader is enabled (1)/ disabled (0) . This option is Relevant from 4.0.0.22 and above. |
Cash sale | Simulates cash sale. |
Alert | Sends an alert to the DCS. It can be seen in Last Alerts. |
Display message | Currently, this option is not available. |
Open socket | For the peripheral, use Nayax's modem for its own needs. |
Close socket | Closes the socket which was opened for the peripheral. |
UI control | Tests the Display Control feature. Needs configurations in the DCS. |
Quit | Quits the simulator program. |
Multi-Session
When performing a multi-session simulation, you will notice that there are multiple 2
Start vend session
andClose session
options.
- Using
Close session 0
causes the product not to be dispensed due to:m_session.session_status = vmc_vend_t.session_status_fail_to_dispense_e;
- While
Close session 1
has:m_session.session_status = vmc_vend_t.session_status_ok_e;
Transaction Flow Examples
Below are examples of the flow for each transaction type:
- Regular Transaction (Single Session):
- Start a session: with
[0]: Start session
. - Present card, wait for authorization and "Thank you" screen.
- Start a session: with
- Multi-Session Transaction:
- Start a session with
[0]: Start session 0
. - Start another session with
[2]: Start session 1
. - Present card, wait for authorization and "Thank you" screen for each session.
- Close sessions individually using
[1]: Close Session 0
and[4]: Close Session 1
.
- Start a session with
- Unsuccessful Transaction:
- Start a session with
[0]: Start session
. - Present card, wait for authorization.
- Close the session with an error status:
[1]: Close Session 0
.
- Start a session with
See Also
Updated 2 days ago