SCPReaderInteractionDelegate

Objective-C

@protocol SCPReaderInteractionDelegate <SCPReaderDelegate>

Swift

protocol ReaderInteractionDelegate : ReaderDelegate

A base delegate for interactions shared by mobile and Tap to Pay readers.

Don’t implement this protocol directly. Instead, implement SCPMobileReaderDelegate or SCPTapToPayReaderDelegate for the reader types your integration supports.

  • The reader has started installing a software update.

    The installation lifecycle callbacks cover both Mobile Reader software updates and mandatory Tap to Pay configuration installation during -[SCPTerminal connectReader:completion:].

    Declaration

    Objective-C

    - (void)reader:(nonnull SCPReader *)reader
        didStartInstallingUpdate:(nonnull SCPReaderSoftwareUpdate *)update
                      cancelable:(nullable SCPCancelable *)cancelable;

    Swift

    func reader(_ reader: SCPReader, didStartInstallingUpdate update: SCPReaderSoftwareUpdate, cancelable: SCPCancelable?)

    Parameters

    reader

    The originating reader.

    update

    The SCPReaderSoftwareUpdate with a durationEstimate that can be used to communicate how long the update is expected to take.

    cancelable

    A cancelable that can be used to cancel the installation when cancellation is supported.

  • The reader reported progress on a software update.

    Declaration

    Objective-C

    - (void)reader:(nonnull SCPReader *)reader
        didReportReaderSoftwareUpdateProgress:(float)progress;

    Swift

    func reader(_ 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)reader:(nonnull SCPReader *)reader
        didFinishInstallingUpdate:(nullable SCPReaderSoftwareUpdate *)update
                            error:(nullable NSError *)error;

    Swift

    func reader(_ reader: SCPReader, didFinishInstallingUpdate update: SCPReaderSoftwareUpdate?, error: (any Error)?)

    Parameters

    reader

    The originating reader.

    update

    The update that was being installed, if any.

    error

    The error that prevented installation, or nil if the installation succeeded.

  • This method is called when the reader begins waiting for input. Your app should prompt the customer to present one of the given payment methods.

    Declaration

    Objective-C

    - (void)reader:(nonnull SCPReader *)reader
        didRequestReaderInput:(SCPReaderInputOptions)inputOptions;

    Swift

    func reader(_ reader: SCPReader, didRequestReaderInput inputOptions: ReaderInputOptions = [])

    Parameters

    reader

    The originating reader.

    inputOptions

    The armed input options on the reader.

  • This method is called when the reader requests that a prompt be displayed in your app.

    Declaration

    Objective-C

    - (void)reader:(nonnull SCPReader *)reader
        didRequestReaderDisplayMessage:(SCPReaderDisplayMessage)displayMessage;

    Swift

    func reader(_ reader: SCPReader, didRequestReaderDisplayMessage displayMessage: ReaderDisplayMessage)

    Parameters

    reader

    The originating reader.

    displayMessage

    The message to display to the user.