Errors

SCPError

  • Possible error codes for NSError objects under the SCPErrorDomain domain.

    See more

    Declaration

    Objective-C

    enum SCPError : NSInteger {}

    Swift

    typealias ErrorCode.Code._ErrorType = ErrorCode
  • The error domain for all errors originating from the Stripe Terminal SDK.

    Declaration

    Objective-C

    extern NSString *const _Nonnull SCPErrorDomain

    Swift

    let ErrorDomain: String

UserInfo keys

  • Use this enum to access userInfo keys for NSError objects under the SCPErrorDomain domain.

    Declaration

    Objective-C

    typedef NSString *const SCPErrorKey

    Swift

    struct ErrorKey : _ObjectiveCBridgeable, Hashable, Equatable, _SwiftNewtypeWrapper, RawRepresentable, @unchecked Sendable
  • An error message explaining what went wrong. You probably shouldn’t show this to your users, but may want to use it yourself.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyMessage

    Swift

    static let message: ErrorKey
  • The HTTP status code of the response.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyHttpStatusCode

    Swift

    static let httpStatusCode: ErrorKey
  • This error message comes from the reader. You probably shouldn’t show this to your users, but may want to inspect it yourself.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyReaderMessage

    Swift

    static let readerMessage: ErrorKey
  • If an Apple Built-In reader fails to connect due to a device ban and the error has an associated ban expiry date, the NSDate will be returned under this key.

    See

    SCPErrorAppleBuiltInReaderDeviceBanned

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyDeviceBannedUntilDate

    Swift

    static let deviceBannedUntilDate: ErrorKey
  • If an Apple Built-In reader fails to prepare and includes an associated reason string, the associated NSString will be returned under this key.

    See

    SCPErrorAppleBuiltInReaderFailedToPrepare

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyPrepareFailedReason

    Swift

    static let prepareFailedReason: ErrorKey
  • If a Stripe API request failed, the failed request’s id will be returned in the error under this key.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIRequestId

    Swift

    static let stripeAPIRequestId: ErrorKey
  • The decline code returned by the Stripe API.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIDeclineCode

    Swift

    static let stripeAPIDeclineCode: ErrorKey
  • The error code returned by the Stripe API.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIErrorCode

    Swift

    static let stripeAPIErrorCode: ErrorKey
  • The parameter the error relates to if the error is parameter-specific.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIErrorParameter

    Swift

    static let stripeAPIErrorParameter: ErrorKey
  • The error type returned by the Stripe API.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIErrorType

    Swift

    static let stripeAPIErrorType: ErrorKey
  • If a Stripe API request failed and the error has an associated PaymentIntent, the SCPPaymentIntent will be returned under this key.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIPaymentIntent

    Swift

    static let stripeAPIPaymentIntent: ErrorKey
  • The documentation URL for the error returned by the Stripe API.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIDocUrl

    Swift

    static let stripeAPIDocUrl: ErrorKey
  • If a refund fails, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyStripeAPIFailureReason

    Swift

    static let stripeAPIFailureReason: ErrorKey
  • If a decline occurs while offline, the reason for the failure.

    Declaration

    Objective-C

    extern SCPErrorKey _Nonnull SCPErrorKeyOfflineDeclineReason

    Swift

    static let offlineDeclineReason: ErrorKey