Mobile SDK
...
Transactions
Refund
2 min
starting a refund refunds work very similarly to docid\ mkssy1onfv6v3fuyrrt3m , with a few key differences the transactiontype must be specified as refund when calling toro starttransaction() there needs to be an existing purchase to refund some details of the original purchase are required in order to initiate the refund the refund amount cannot be more than the original purchase amount gratuities are not applicable the refund amount cannot be greater than the original purchase amount toro starttransaction( amount 1000, type refund, currency gbp, metadata transactionmetadata( originaltransactiondetails originaltransactiondetails ), 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 { , in // not applicable } ) below is an example originaltransactiondetails object which needs to be passed through the transactionmetadata originaltransactiondetails( salereferenceid "sale 12345", amount 1000, currency gbp, datetime "2025 01 01t00 00 00 000z", transactionreference "purchase 12345123", responsecode approved, authcode "123456", paymentinterface contact, terminalserialnumber "2110022", additionalresponseinformation "01\ xzz022a3a0a9a99f1b5mxjyict525hcf" )
