Mobile SDK
...
Transactions
Purchase
1 min
starting a purchase once a device has been selected, you can start a transaction using the starttransaction method on your toroclient instance toro starttransaction( amount 1000, // £10 00 type purchase, currency gbp, metadata nil, oncompleted { receipt in // called when a receipt has been generated for a transaction print("transaction completed \\(receipt)") }, oncancelled { cancellationtype in // called when the transaction was cancelled by the attendant or customer print("transaction cancelled \\(cancellationtype)") }, onerror { error in // called when an error has occured during a transaction print("transaction error \\(error)") }, ongratuityconfirmed { amount, percentage in print("customer confirmed a gratuity of \\(amount) (\\(percentage)%)") } )
