STPToken
Objective-C
@interface STPToken : NSObject <STPAPIResponseDecodable, STPSourceProtocol>
Swift
class 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 anSTPAPIClient
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 (nonatomic, readonly, 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 (nonatomic, readonly) BOOL livemode;
Swift
var livemode: Bool { get }
-
The type of this token.
Declaration
Objective-C
@property (nonatomic, readonly) STPTokenType type;
Swift
var type: STPTokenType { 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 (nonatomic, readonly, nullable) STPBankAccount *bankAccount;
Swift
var bankAccount: STPBankAccount? { get }
-
When the token was created.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) NSDate *created;
Swift
var created: Date? { get }