Terminal

  • The SCPTerminal singleton object exposes an interface for discovering readers, connecting to a reader, creating payments, and saving card information for later use.

    Before accessing the singleton object using the shared property, you must set a ConnectionToken provider: an object that implements the SCPConnectionTokenProvider protocol. This object should authenticate with your backend, then fetch the secret from a freshly minted ConnectionToken.

    The SCPTerminal singleton can only be connected to one reader at a time, and can only perform one operation at a time. As a general rule, make sure the completion handler of one operation has been called before calling another operation from within your app.

    The Stripe Terminal SDK sends updates to your app by using the delegate pattern. You may want multiple views in your app to respond to these delegate calls. We recommend creating a central delegate announcer which broadcasts all delegate calls to views and ViewControllers that register themselves with that announcer. We have an example implementation of a TerminalDelegateAnnouncer as part of our example application.

    See more

    Declaration

    Objective-C

    
    @interface SCPTerminal : NSObject

    Swift

    class Terminal : NSObject
  • Before integrating the SDK, you should create an endpoint on your backend server that creates a new connection token via the Stripe Terminal API. The connection token is used by the SDK to connect to a reader.

    An overview of the lifecycle of a connection token:

    • When Stripe Terminal is initialized, the SDK attempts to proactively request an connection token from your backend server.
    • The SDK uses the connection to connect to a reader.
    • Subsequent calls to connect require a new connection token. If you disconnect from a reader, and then call connect again, the SDK will need a new connection token from your backend server.

    We suggest making your application’s API client conform to this protocol.

    See more

    Declaration

    Objective-C

    @protocol SCPConnectionTokenProvider

    Swift

    protocol ConnectionTokenProvider
  • Implement this protocol to handle connection and payment updates from the Stripe Terminal iOS SDK.

    See more

    Declaration

    Objective-C

    @protocol SCPTerminalDelegate <NSObject>

    Swift

    protocol TerminalDelegate : NSObjectProtocol
  • Implement this protocol to handle bluetooth auto-reconnection.

    See more

    Declaration

    Objective-C

    @protocol SCPReconnectionDelegate <NSObject>

    Swift

    protocol ReconnectionDelegate : NSObjectProtocol
  • The various log levels for the SDK.

    See more

    Declaration

    Objective-C

    enum SCPLogLevel : NSUInteger {}

    Swift

    enum LogLevel : UInt, @unchecked Sendable
  • An object representing an action that can be canceled.

    See more

    Declaration

    Objective-C

    
    @interface SCPCancelable : NSObject

    Swift

    class Cancelable : NSObject
  • Objects conforming to this protocol can be instantiated by decoding a JSON dictionary.

    See more

    Declaration

    Objective-C

    @protocol SCPJSONDecodable <NSObject>

    Swift

    protocol JSONDecodable : NSObjectProtocol
  • The current version of this library.

    Declaration

    Objective-C

    static NSString *const _Nonnull SCPSDKVersion = @"2.23.0"

    Swift

    let SCPSDKVersion: String