SCPApiError

Objective-C


@interface SCPApiError : NSObject <NSCopying>

Swift

class ApiError : NSObject, NSCopying

An API error returned by Stripe when a request fails.

  • The type of error returned.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *type;

    Swift

    var type: String? { get }
  • ID of failed charge, if applicable.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *charge;

    Swift

    var charge: String? { get }
  • For some errors that could be handled programmatically, a short string indicating the error code reported.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *code;

    Swift

    var code: String? { get }
  • For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *declineCode;

    Swift

    var declineCode: String? { get }
  • A URL to more information about the error code reported.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *docUrl;

    Swift

    var docUrl: String? { get }
  • A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *message;

    Swift

    var message: String? { get }
  • If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *param;

    Swift

    var param: String? { get }
  • Unavailable

    You cannot directly instantiate this class. You should only use ApiErrors that have been returned by other methods in our SDK.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    You cannot directly instantiate this class. You should only use ApiErrors that have been returned by other methods in our SDK.

    Declaration

    Objective-C

    + (nonnull instancetype)new;