SCPTapToPayReaderDelegate
Objective-C
@protocol SCPTapToPayReaderDelegate <SCPReaderDelegate>
Swift
protocol TapToPayReaderDelegate : ReaderDelegate
Implement this protocol to handle a connected tap to pay reader’s events throughout the lifetime of its connection.
Implementing this delegate is required when connecting to any Tap To Pay reader.
The provided delegate must be retained by your application until the reader disconnects.
-
The reader has started installing a software update.
Declaration
Objective-C
- (void)tapToPayReader:(nonnull SCPReader *)reader didStartInstallingUpdate:(nonnull SCPReaderSoftwareUpdate *)update cancelable:(nullable SCPCancelable *)cancelable;
Swift
func tapToPayReader(_ reader: SCPReader, didStartInstallingUpdate update: SCPReaderSoftwareUpdate, cancelable: SCPCancelable?)
Parameters
reader
The originating reader.
update
The
SCPReaderSoftwareUpdate
with andurationEstimate
that can be used to communicate how long the update is expected to take.cancelable
This cancelable is provided to cancel the installation if needed. Canceling a required update will result in a failed connect with error
SCPErrorUnsupportedReaderVersion
. Some updates will have a nil cancelable because these updates can not be canceled. -
The reader reported progress on a software update.
Declaration
Objective-C
- (void)tapToPayReader:(nonnull SCPReader *)reader didReportReaderSoftwareUpdateProgress:(float)progress;
Swift
func tapToPayReader(_ reader: SCPReader, didReportReaderSoftwareUpdateProgress progress: Float)
Parameters
reader
The originating reader.
progress
An estimate of the progress of the software update (in the range [0.0, 1.0]).
-
The reader has finished installing an update.
Declaration
Objective-C
- (void)tapToPayReader:(nonnull SCPReader *)reader didFinishInstallingUpdate:(nullable SCPReaderSoftwareUpdate *)update error:(nullable NSError *)error;
Swift
func tapToPayReader(_ reader: SCPReader, didFinishInstallingUpdate update: SCPReaderSoftwareUpdate?, error: (any Error)?)
Parameters
reader
The originating reader.
update
The update that was being installed, if any.
error
If the installed failed, this will describe the error preventing install. If it succeeded, the error will be
nil
. -
This method is called when the reader begins waiting for input. Use
- [SCPTerminal stringFromReaderInputOptions:]
to get a user facing string for the input options.Declaration
Objective-C
- (void)tapToPayReader:(nonnull SCPReader *)reader didRequestReaderInput:(SCPReaderInputOptions)inputOptions;
Swift
func tapToPayReader(_ reader: SCPReader, didRequestReaderInput inputOptions: ReaderInputOptions = [])
Parameters
reader
The originating reader.
inputOptions
The armed input options on the reader.
-
This method is called to request that a prompt be displayed in your app. Use
- [SCPTerminal stringFromReaderDisplayMessage:]
to get a user facing string for the prompt.See
SCPReaderDisplayMessageDeclaration
Objective-C
- (void)tapToPayReader:(nonnull SCPReader *)reader didRequestReaderDisplayMessage:(SCPReaderDisplayMessage)displayMessage;
Swift
func tapToPayReader(_ reader: SCPReader, didRequestReaderDisplayMessage displayMessage: ReaderDisplayMessage)
Parameters
reader
The originating reader.
displayMessage
The message to display to the user.
-
The reader is reporting that, as part of preparing to accept payments, the terms of service has been accepted.
Declaration
Objective-C
- (void)tapToPayReaderDidAcceptTermsOfService:(nonnull SCPReader *)reader;
Swift
optional func tapToPayReaderDidAcceptTermsOfService(_ reader: SCPReader)
Parameters
reader
The originating reader.