Java SDK Simulator

The Nayax Marshall SDK includes a simulator to help developers test and debug their implementation with the Nayax payment system. The simulator replicates the behavior 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]: Info Session
[4]: Check balance
[5]: query opened sessions
[6]: query reader state
[7]: cash sale
[8]: alert
[9]: select brand
[10]: transfer custom transaction_id
[11]: display message
[12]: open socket
[13]: close socket
[14]: UI control
[15]: marshall parser
[q]: quit
[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) with product code 0.

Cancel Session

Cancels the transaction from the peripheral's end. Can be sent up until the consumer's card has been approved.

Close Session 0

Only relevant in multisession. Closes the session (settles it) at the end of a transaction.

Info Session

Retrieves card details (BIN, PAN-HASH, 4 digits) without charging the consumer or vending a product

Check balance

Relevant only for the Japanese market (TMN)

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.

Select brand

Relevant only for the Japanese market and firmware version. When selected prior to starting a transaction and then selecting a product, the desired brand selection would take place (without going into the brand selection screen). In order for the peripheral to know which brands are set on the device's end, the devices sends the brands information during the pairing process

transfer custom transaction_id

Allows the customer to send a custom transaction ID. Needs to be sent during an ongoing transaction process (before or after the authorization)

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 Nayax Core.

Marshall parser

Irrelevant, an internal testing tool

Quit

Quits the simulator program.

Transaction Flow Examples

Below are examples of the flow for each transaction type:

  1. Regular Transaction (Single Session):
    1. Start a session: with [0]: Start session.
    2. Present card, wait for authorization and "Thank you" screen.
  2. Multi-Session Transaction:
    1. Start a session with [0]: Start session 0.
    2. Present card, wait for authorization and "Thank you" screen.
    3. Close the relevant session- in this case, use [2]: Close Session 0.

See Also