STPToken

@interface STPToken : NSObject <STPAPIResponseDecodable, STPSourceProtocol>

A token returned from submitting payment details to the Stripe API. You should not have to instantiate one of these directly.

  • Unavailable

    You cannot directly instantiate an STPToken. You should only use one that has been returned from an STPAPIClient callback.

    You cannot directly instantiate an STPToken. You should only use one that has been returned from an STPAPIClient callback.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • The value of the token. You can store this value on your server and use it to make charges and customers.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) NSString *tokenId;

    Swift

    var tokenId: String { get }
  • Whether or not this token was created in livemode. Will be YES if you used your Live Publishable Key, and NO if you used your Test Publishable Key.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL livemode;

    Swift

    var livemode: Bool { get }
  • The type of this token.

    Declaration

    Objective-C

    @property (readonly, nonatomic) STPTokenType type;

    Swift

    var type: STPTokenType { get }
  • The credit card details that were used to create the token. Will only be set if the token was created via a credit card or Apple Pay, otherwise it will be nil.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) STPCard *card;

    Swift

    var card: STPCard? { get }
  • The bank account details that were used to create the token. Will only be set if the token was created with a bank account, otherwise it will be nil.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) STPBankAccount *bankAccount;

    Swift

    var bankAccount: STPBankAccount? { get }
  • When the token was created.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSDate *created;

    Swift

    var created: Date? { get }