Mobile SDK
iOS
Configuration
6 min
toro config the toro sdk can be configured using the toroconfig class public struct toroconfig { /// the mode in which to capture payments /// `automatic` (default) the payment will be captured automatically when sent for authorisation /// `manual` the payment will need to be captured later manually public var capturemode capturemode /// whether to collect geolocation data for transactions /// `false` (default) geolocation data will not be collected /// `true` geolocation data will be collected public var collectgeolocation bool /// whether to enable gratuity for transactions /// `false` (default) gratuity will not be enabled /// `true` gratuity will be enabled public var gratuityenabled bool /// the options for gratuity percentages /// `\[0, 10, 15, 20]` (default) the options will be 0%, 10%, 15%, and 20% public var gratuitypercentages \[int] /// the mode in which to capture signatures /// `device` (default) the signature will be captured on the miura device (e g ped) /// if the device does not support signature capture a toroexception devicenotsupported will be thrown /// `app` the signature will always be captured in the app public var signaturemode signaturemode /// the mode in which to connect to the miura device /// `bluetooth` (default) the miura device will be connected using bluetooth public var connectionmode connectionmode /// whether to allow partial approvals for transactions /// `false` (default) during authorisation, the gateway will be informed that the poi does not support partial approvals /// `true` the gateway will be informed the poi does support partial approvals external factors such as acquirer support and merchant configuration may override this public var allowpartialapprovals bool /// maximum time to wait for a response from the toro gateway, 30 seconds by default public var gatewaytimeoutseconds int /// use this to override strings used in messages displayed on the device /// and in the signatureactivity public var strings torostrings /// details of the merchant performing the transaction public var merchant merchantconfig /// the passphrase used to generate/verify macs of iso20022 messages exchanged with the gateway public var passphrase string? /// the policy for verifying and generating security trailers public var securitytrailerpolicy securitytrailerpolicy /// whether to preserve the session after a transaction ends /// when false (default), the session is automatically closed when oncomplete, oncancel, or onerror is called /// when true, the session remains open and must be manually closed using closesession() public var preservesessionontransactionend bool } the toroconfig can also be updated during runtime using the setconfig method try toro setconfig(toroconfig( )) the config cannot be updated when a transaction is in progress doing so will result in an toroerror being thrown string customisation the sdk allows integrators to customise all user facing text through the strings property in toroconfig this includes messages displayed directly on the ped, as well is in the built in signatureactivity let config = toroconfig( strings torostrings( // messages presented on ped processingmagswipetransaction "kártya feldolgozása ", entersignaturepos "adja meg aláírását a pos terminálon", uploadingconfigfiles "konfigurációs fájlok feltöltése ", // other ped messages here // signatureview signatureheading "aláírás szükséges", signatureclear "törlés", signaturecancel "mégsem" // other strings here ) ) this allows integrators to support different languages for their application all strings have default english values if not specified otherwise note that some messages displayed on the ped are determined by the configuration files stored directly on them, such as pin entry messages to amend these you will need to consult the miura documentation, one such configuration file is mpi dynamic cfg logging the toroclient automatically selects an appropriate logger based on your build variant debug builds use debuglogger by default, which logs helpful messages using the android log class release builds use mutedlogger by default, which disables logging entirely to prevent sensitive information leaks you can override this default behavior by implementing the torologging protocol and passing your own logger to the toroclient constructor import torosdk class customlogger torologging { func debug( message string, file string, function string, line int) { savelogmessage("debug", message) } func info( message string) { savelogmessage("info", message) } func warn( message string) { savelogmessage("warn", message) } func error( message string, error (any error)?) { savelogmessage("error", message) } } toroclient(logger customlogger()) this way you can retain logs for monitoring and debugging purposes in production, which is highly recommended please be cautious with logging in production as it can potentially leak sensitive information
