Toro Client
The main entry point for the Toro SDK. This class provides methods to start transactions and manage the selected device.
Parameters
The application context.
The configuration for the Toro SDK.
See also
Constructors
Properties
Lists all Miura devices which have been paired in bluetooth settings excluding selectedBluetoothDevice.
True when the ToroClient instance is fully initialised, false otherwise.
Indicates whether a session is open on the selectedBluetoothDevice or selectedUsbDevice depending on the ToroConfig.connectionMode.
The selected Miura device for transactions. This will be persisted across app restarts. Only applicable when ToroConfig.connectionMode is ConnectionMode.BLUETOOTH.
The selected Miura device for transactions via USB. This will be persisted across app restarts. Only applicable when ToroConfig.connectionMode is ConnectionMode.USB.
Callback for handling the result of the signature activity. Used for creating an ActivityResultLauncher for the signature activity.
The current state of the transaction.
Lists all Miura devices currently attached to the system via USB excluding selectedUsbDevice.
Functions
Cancels the current transaction (if there is one in progress). Will also close the bluetooth session if it is open.
Closes the current session if there is one open.
Java-friendly version of ensureDeviceReady driven by a DeviceSetupListener instead of Kotlin function-type callbacks. See ensureDeviceReady for full behaviour.
When forceSoftwareReset is true, attempts to reinstall both MPI and OS even if their versions already match, then handles pending TMS updates as usual.
Ensures the selected device is in a Toro-compatible state: resets OS and MPI to the required versions if needed, then checks for and applies any pending TMS updates (ECC certificate signing, key injection, configuration).
Information about the selected Miura device selectedBluetoothDevice. Uses a session open to the selected device, waiting for one still opening, and leaves it open. Otherwise opens its own session, replacing any other, and closes it afterwards.
Java-friendly version of ToroClient.getDeviceInfo
Installs a signed ECC terminal certificate (terminal-ecc-cert.json) onto the selected device. The device restarts automatically on success.
Java-friendly version of installEccTerminalCert. The device restarts automatically on success. See installEccTerminalCert for full behaviour (TEST devices only).
Opens a session with the selectedBluetoothDevice or selectedUsbDevice depending on the ToroConfig.connectionMode.
Sends cancellation advice to the gateway for an already completed transaction.
Sends financial completion advice to the gateway for a transaction which has already been authorised (but not yet captured).
Handles the device session as getDeviceInfo does.
Sets the CardEventListener to receive card event updates.
Updates the configuration for the Toro SDK. Useful if you need to dynamically change the config after the application has already initialized the Toro SDK.
Sets the ActivityResultLauncher for the SDK internal signature activity. This should be set in an Activity/Fragment where the transaction state will be TransactionState.AWAITING_SIGNATURE. The activity will only be used for capturing signatures when signatureMode in ToroConfig is set to APP. Using the default config, the SDK will try collect the signature from the Miura device instead.
Sets the TransactionStateListener to receive transaction state updates.
Starts a transaction with the specified amount and currency code on the selected device.