STPAddCardViewController

public class STPAddCardViewController: STPCoreTableViewController, STPAddressViewModelDelegate,
  STPCardScannerDelegate, STPPaymentCardTextFieldDelegate, UITableViewDelegate,
  UITableViewDataSource

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 init(configuration: STPPaymentConfiguration.shared, theme: STPTheme.defaultTheme).

    Declaration

    Swift

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

    Declaration

    Swift

    @objc(initWithConfiguration:theme:)
    public 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). - seealso: STPPaymentConfiguration

    theme

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

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

    Declaration

    Swift

    @objc
    public weak var delegate: STPAddCardViewControllerDelegate?
  • You can set this property to pre-fill any information you’ve already collected from your user. - seealso: STPUserInformation.h

    Declaration

    Swift

    @objc
    public var prefilledInformation: STPUserInformation?
  • 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

    Swift

    @objc
    public var customFooterView: UIView? { get set }
  • The API Client to use to make requests. Defaults to STPAPIClient.shared

    Declaration

    Swift

    @objc
    public var apiClient: STPAPIClient

STPPaymentCardTextField