STPFile

Objective-C

@interface STPFile : NSObject <STPAPIResponseDecodable>

Swift

class STPFile : NSObject, STPAPIResponseDecodable

Representation of a file upload object in the Stripe API.

  • The token for this file.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull fileId;

    Swift

    var fileId: String { get }
  • The date this file was created.

    Declaration

    Objective-C

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

    Swift

    var created: Date { get }
  • The purpose of this file. This can be either an identifing document or an evidence dispute.

    Declaration

    Objective-C

    @property (nonatomic, readonly) STPFilePurpose purpose;

    Swift

    var purpose: STPFilePurpose { get }
  • The file size in bytes.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull size;

    Swift

    var size: NSNumber { get }
  • The file type. This can be “jpg”, “png”, or “pdf”.

    Declaration

    Objective-C

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

    Swift

    var type: String { get }
  • Returns the string value for a purpose.

    Declaration

    Objective-C

    + (nullable NSString *)stringFromPurpose:(STPFilePurpose)purpose;

    Swift

    class func string(from purpose: STPFilePurpose) -> String?