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]: 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  | 
| 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:
- 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.
- Present card, wait for authorization and "Thank you" screen.
- Close the relevant session- in this case, use [2]: Close Session 0.
 
- Start a session with 
See Also
Updated 25 days ago