Cancellation
1 min
To cancel an authorisation which has not yet cleared, you can send cancellation advice to the Toro gateway as shown below.
let originalTransactionDetails = 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"
)
toro.sendCancellationAdvice(
originalTransactionDetails: originalTransactionDetails,
onCompleted: { responseCode in
print("Cancellation advice response received \(responseCode)")
},
onError: { error in
print("Cancellation advice error: \(error)")
}
)