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 initialize the SDK by calling initWithTokenProvider: with 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
  • Possible reasons for Bluetooth reader disconnects.

    See more

    Declaration

    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 more

    Declaration

    Objective-C

    @protocol SCPOfflineDelegate <NSObject>

    Swift

    protocol OfflineDelegate : NSObjectProtocol
  • Provides offline status details for the connected reader and the SDK.

    See more

    Declaration

    Objective-C

    
    @interface SCPOfflineStatus : NSObject

    Swift

    class OfflineStatus : NSObject
  • 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
  • The current version of this library.

    Declaration

    Objective-C

    static NSString *const _Nonnull SCPSDKVersion = @"5.6.0"

    Swift

    let SCPSDKVersion: String
  • The possible network connection statuses for the SDK.

    See more

    Declaration

    Objective-C

    enum SCPNetworkStatus : NSUInteger {}

    Swift

    enum NetworkStatus : UInt, @unchecked Sendable
  • Base class for all builders. Defines the build method that all builders must implement.

    See more

    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 more

    Declaration

    Objective-C

    
    @interface SCPCollectDataConfiguration : NSObject <NSCopying>

    Swift

    class CollectDataConfiguration : NSObject, NSCopying
  • The CollectDataConfigurationBuilder is used to create a CollectDataConfiguration object.

    See more

    Declaration

    Objective-C

    
    @interface SCPCollectDataConfigurationBuilder
        : SCPBuilder <SCPCollectDataConfiguration *>

    Swift

    class CollectDataConfigurationBuilder : SCPBuilder<CollectDataConfiguration>
  • The type of data to collect.

    See more

    Declaration

    Objective-C

    enum SCPCollectDataType : NSUInteger {}

    Swift

    enum CollectDataType : UInt, @unchecked Sendable
  • Represents non-payment data collected using collectData.

    See more

    Declaration

    Objective-C

    
    @interface SCPCollectedData : NSObject

    Swift

    class CollectedData : NSObject
  • Represents non-payment data collected using collectData with the magstripe interface.

    See more

    Declaration

    Objective-C

    
    @interface SCPMagstripeCollectedData : SCPCollectedData

    Swift

    class MagstripeCollectedData : CollectedData
  • Represents non-payment data collected using collectData with the NFC interface.

    See more

    Declaration

    Objective-C

    
    @interface SCPNfcUidCollectedData : SCPCollectedData

    Swift

    class NfcUidCollectedData : CollectedData
  • Configures localization of API error messages returned through SCPApiError.message.

    API errors surfaced through NSError‘s SCPErrorKeyStripeAPIError will have their SCPApiError.message translated to the resolved locale.

    For smart readers, reader software version 2.43 or later is required for localization.

    Note: The scope of localization may expand in future SDK releases. For example, NSError.localizedDescription and other SDK-originated strings may also be localized. Integrations should avoid relying on error message content for application logic. Use error codes such as SCPError and SCPApiError.code instead.

    See more

    Declaration

    Objective-C

    
    @interface SCPLocaleConfig : NSObject <NSCopying>

    Swift

    class LocaleConfig : NSObject, NSCopying

Hardcoded locale

  • Localizes API error messages to a fixed locale tag.

    The locale tag must conform to the format language[-script][-region] where:

    • language is a 2-3 letter ISO 639 code (e.g., “en”, “fil”)
    • script (optional) is only “Hans” or “Hant”
    • region (optional) is a 2-letter ISO 3166-1 alpha-2 code (e.g., “US”) or a 3-digit UN M.49 code (e.g., “419”)

    If the locale is not supported by Stripe’s localization infrastructure, error messages will fall back to English (en-US).

    See more

    Declaration

    Objective-C

    
    @interface SCPHardcodedLocaleConfig : SCPLocaleConfig

    Swift

    class HardcodedLocaleConfig : LocaleConfig
  • A builder class for SCPHardcodedLocaleConfig. The locale tag is validated by build:.

    See more

    Declaration

    Objective-C

    
    @interface SCPHardcodedLocaleConfigBuilder
        : SCPBuilder <SCPHardcodedLocaleConfig *>

    Swift

    class HardcodedLocaleConfigBuilder : SCPBuilder<HardcodedLocaleConfig>
  • Reports the outcome of localizing an SCPApiError.message.

    • requestedLocale reflects the locale the SDK sent in the Accept-Language request header.
    • resolvedLocale reflects the locale the message was localized to, taken from the Content-Language response header (defaults to en-US if the header is absent).

    The two may differ when the requested locale is not supported — in that case, the server falls back to en-US.

    See more

    Declaration

    Objective-C

    
    @interface SCPLocalizationResult : NSObject <NSCopying>

    Swift

    class LocalizationResult : NSObject, NSCopying