- For Java and the C# SDKs the
vend_callbacks_tinterface defines the set of callback methods that your application must implement to respond to these events. - In the C SDK the
vmc_vend_event_eenumeration performs the same.
Vending Callbacks Interface
Thevend_callbacks_t interface is designed to handle events related to vending operations.
vend_callbacks_t interface:
Interface Methods
The table below provides a more detailed description of the Methods.Vending Events Enumeration
Thevmc_vend_event_e enumeration is designed to handle events related to vending operations in the C SDK.
C
Enumeration Methods
Below is a list of methods available when using thevend_callbacks_t interface:
Why onVendDenied Carries No Reason
onVendDenied tells your peripheral that the vend was denied, but never why. That is deliberate. The machine is unattended, and surfacing a reason such as a blocked card on a public screen would embarrass the consumer.
The same applies to insufficient credit: the device does not show it and the SDK logs do not record it, because it concerns the exchange between the device and the acquirer rather than the exchange between the device and your machine.
You can see the reason a card was rejected or a transaction was cancelled in Nayax Core.
Approve a Card with a Third-Party Server
When your peripheral authorizes proprietary cards against your own server, the flow runs outside the SDK up to the point of the verdict. After the Vend Request is sent and the consumer presents a card, the device sends the Transfer Data command. Your peripheral receives the card details and forwards them to your server on its own. Once your server approves or denies the card, the peripheral reports the verdict back throughclient_gateway_auth, which also informs the device.
true:
Cancel a Vend Request
Once you have sent a Vend Request and have not yet received Vend Approved or Vend Denied, you can send the Cancel command. It causes Vend Denied to be sent. If Vend Approved was already on its way when you sent Cancel, the cancel does not appear in the logs, because a cancel cannot follow a Vend Approved. The peripheral sends Vend Failure instead. Responding with Vend Failure directly, without using Cancel, gives the same result. You can also cancel before sending the Vend Request, when a consumer starts a transaction and then backs out. That covers both the case before a card is presented and the case just after Begin Session arrives but before you send the Vend Request. In the first case, the SDK log shows onlyreader enable.