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:
Decimal Place
Decimal Place is a parameter in Nayax Core that the device forwards to your peripheral in the MarshallConfig command, which is sent as part of the pairing process.
Your machine calculates the multiplier from it:
Credorax only accepts transactions of 10 cents and above. A price of
1 with 2 decimal places resolves to 0.01 Euro by the time it reaches Credorax, and the transaction is declined.Close a Session Without Charging the Consumer
When you cannot provide the goods, close the session with a status other thanStatus Ok, such as Failed to dispense the product. Do not close it with a price of 0 and a status of Status Ok.
A price of 0 with an ok status reads as a price calculation error on your side. Anyone looking at the virtual machine’s Last Sales would conclude that Nayax failed to settle the transaction, when in fact the flow between your peripheral and the device worked and you simply chose not to charge. Responding with Vend Failure, or closing with User cancel or Failed to dispense the product, records the real reason in Last Sales and the Dynamic Transaction Monitor.
Once the status is anything other than Status Ok, the price you send is irrelevant, because the transaction counts as cancelled.
Handle Missing ACKs During a Transaction
Every Marshall command is answered with an ACK. When a command goes unanswered through all three attempts, what happens to the transaction depends on how far it had progressed:- No ACKs after Vend Success: Nayax is responsible for the settlement.
- No ACKs after the authorization but before Vend Success: Nayax cancels the transaction.
- No ACKs before the authorization stage: Nayax cancels the transaction.
Refunds
Marshall has no refund feature, because a refund concerns the payment rather than the communication between your machine and the device. If you could not provide the goods, do not charge the consumer in the first place: respond with Vend Failure rather than Vend Success. For a transaction that was already charged and settled, request the refund from Nayax Core, as described in Nayax Core Operations.See Also
Get Started
Get up and running with the Marshall SDK integration.
Methods & Functions
Find reference documentation for all methods and functions in the Marshall SDK.