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 theSCPConnectionTokenProvider
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 moreDeclaration
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 moreDeclaration
Objective-C
@protocol SCPConnectionTokenProvider
Swift
protocol ConnectionTokenProvider
-
Implement this protocol to handle connection and payment updates from the Stripe Terminal iOS SDK.
See moreDeclaration
Objective-C
@protocol SCPTerminalDelegate <NSObject>
Swift
protocol TerminalDelegate : NSObjectProtocol
-
Possible reasons for Bluetooth reader disconnects.
See moreDeclaration
Objective-C
enum SCPDisconnectReason : NSUInteger {}
Swift
enum DisconnectReason : UInt, @unchecked Sendable
-
Implement this protocol to handle callbacks when the SDK is performing actions related to offline mode.
See moreDeclaration
Objective-C
@protocol SCPOfflineDelegate <NSObject>
Swift
protocol OfflineDelegate : NSObjectProtocol
-
Provides offline status details for the connected reader and the SDK.
See moreDeclaration
Objective-C
@interface SCPOfflineStatus : NSObject
Swift
class OfflineStatus : NSObject
-
The various log levels for the SDK.
See moreDeclaration
Objective-C
enum SCPLogLevel : NSUInteger {}
Swift
enum LogLevel : UInt, @unchecked Sendable
-
An object representing an action that can be canceled.
See moreDeclaration
Objective-C
@interface SCPCancelable : NSObject
Swift
class Cancelable : NSObject
-
Objects conforming to this protocol can be instantiated by decoding a JSON dictionary.
See moreDeclaration
Objective-C
@protocol SCPJSONDecodable <NSObject>
Swift
protocol JSONDecodable : NSObjectProtocol
-
The current version of this library.
Declaration
Objective-C
static NSString *const _Nonnull SCPSDKVersion = @"4.1.0"
Swift
let SCPSDKVersion: String
-
The possible network connection statuses for the SDK.
See moreDeclaration
Objective-C
enum SCPNetworkStatus : NSUInteger {}
Swift
enum NetworkStatus : UInt, @unchecked Sendable
-
Base class for all builders. Defines the
See morebuild
method that all builders must implement.Declaration
Objective-C
@interface SCPBuilder<__covariant T> : NSObject
Swift
class SCPBuilder<T> : NSObject where T : AnyObject
-
Contains configuration information relevant to collecting non-payment data.
See moreDeclaration
Objective-C
@interface SCPCollectDataConfiguration : NSObject <NSCopying>
Swift
class CollectDataConfiguration : NSObject, NSCopying
-
The
See moreCollectDataConfigurationBuilder
is used to create aCollectDataConfiguration
object.Declaration
Objective-C
@interface SCPCollectDataConfigurationBuilder : SCPBuilder <SCPCollectDataConfiguration *>
Swift
class CollectDataConfigurationBuilder : SCPBuilder<CollectDataConfiguration>
-
The type of data to collect.
See moreDeclaration
Objective-C
enum SCPCollectDataType : NSUInteger {}
Swift
enum CollectDataType : UInt, @unchecked Sendable
-
Represents non-payment data collected using
See morecollectData
.Declaration
Objective-C
@interface SCPCollectedData : NSObject
Swift
class CollectedData : NSObject