The Clover Remote Pay SDKs utilize USB or WebSockets to connect your POS to the Clover device. USB and WebSockets are designed to provide a persistent connection, so it is recommended that you connect and then maintain a connection to the Clover device.
onDeviceReady handler should be used to notify your POS that a connection to the Clover device has been established and that it is ready to process a transaction. There is no guarantee that this handler will only be called once, so you should not start any transaction from within
onDeviceReadyis called again if the device connection is lost and then re-established. This allows your POS to perform recovery actions if needed.
Additionally, to help maintain proper connection status,
onDeviceConnected (connected but not ready) and
onDeviceDisconnected should also be implemented.
Your POS should properly dispose of the Clover Connector by calling
dispose when your application has closed (before the browser unloads if using the Cloud SDK).
Updated over 1 year ago