STPAddCardViewController

@interface STPAddCardViewController : STPCoreTableViewController

This view controller contains a credit card entry form that the user can fill out. On submission, it will use the Stripe API to convert the user’s card details to a Stripe token. It renders a right bar button item that submits the form, so it must be shown inside a UINavigationController.

  • A convenience initializer; equivalent to calling initWithConfiguration:[STPPaymentConfiguration sharedConfiguration] theme:[STPTheme defaultTheme].

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()
  • Initializes a new STPAddCardViewController with the provided configuration and theme. Don’t forget to set the delegate property after initialization.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithConfiguration:
                                (nonnull STPPaymentConfiguration *)configuration
                                            theme:(nonnull STPTheme *)theme;

    Swift

    init(configuration: STPPaymentConfiguration, theme: STPTheme)

    Parameters

    configuration

    The configuration to use (this determines the Stripe publishable key to use, the required billing address fields, whether or not to use SMS autofill, etc). - see: STPPaymentConfiguration

    theme

    The theme to use to inform the view controller’s visual appearance. - see: STPTheme

  • The view controller’s delegate. This must be set before showing the view controller in order for it to work properly. - see: STPAddCardViewControllerDelegate

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<STPAddCardViewControllerDelegate>
        delegate;

    Swift

    weak var delegate: STPAddCardViewControllerDelegate? { get set }
  • You can set this property to pre-fill any information you’ve already collected from your user. - see: STPUserInformation.h

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        STPUserInformation *prefilledInformation;

    Swift

    var prefilledInformation: STPUserInformation? { get set }
  • Provide this view controller with a footer view.

    When the footer view needs to be resized, it will be sent a sizeThatFits: call. The view should respond correctly to this method in order to be sized and positioned properly.

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable) UIView *customFooterView;

    Swift

    var customFooterView: UIView? { get set }
  • Unavailable

    Use init: or initWithConfiguration:theme:

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTheme:(nonnull STPTheme *)theme;
  • Unavailable

    Use init: or initWithConfiguration:theme:

    Declaration

    Objective-C

    - (nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil
                                     bundle:(nullable NSBundle *)nibBundleOrNil;
  • Unavailable

    Use init: or initWithConfiguration:theme:

    Declaration

    Objective-C

    - (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;