Pre-requisites
- Ensure your SDK is running and connected to the Nayax device indicated by the
onReady()event.
Create a Payment
To perform a transaction using the Nayax Marshall SDK, follow the steps below.-
Start by enabling the device for transactions.
-
When a client presents a card and it is approved, the
onSessionBegin()event is triggered. This is the signal for the peripheral, such as the vending machine, to prepare for payment approval.
Multi-vend SessionFor a multi-vend session, when the consumer is able to select multiple items in one transaction, enable the
You can review an example of it in the demo apps.
multi_vend_support flag. The session would then include a list of products.You can review an example of it in the demo apps.
- After the VPOS approves the vending request, the peripheral must notify the SDK that the product has been successfully delivered to the consumer. This is done by implementing the
onVendApproved(...)API and returning one of the following:
True: If the vend process is successful, the client’s credit card is charged the requested amount.False: For a failed vend process.
- Whether it’s a single session or multi-session, the
onReady()event will be called upon finishing the vending process, indicating that the device is ready for the next transaction.
Multi-SessionFor multi-session configurations, when the session on the peripheral’s end is finished, it is up for the peripheral to close the session in order for the transaction to be settled: