extension ViewController: AuthnDelegate {
public func authn(_ authn: D1Authn, shouldConfirmTransactionData transactionData: [String : String], proceedHandler: (@escaping() -> Void), cancelHandler: (@escaping() -> Void)) {
// Compose transaction details message using JSON payload received.
var message = ""
// Display the transaction details message to the end user, with the option to proceed or cancel.
let alertController = UIAlertController(title: "Transaction Details", message: message, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Proceed", style: .default, handler: { action in
proceedHandler()
}))
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: {action in
cancelHandler()
}))
present(alertController, animated: true)
}
public func authnTouchIDOperationPrompt(_ authn: D1Authn) -> String {
return <Message to be displayed to the user during Touch ID verification>
}
}
let d1Authn = d1Task.d1Authn(self)