OPPaymentCardDetailsForm

@objc
public class OPPaymentCardDetailsForm : UIView, STPCardFormViewDelegate

Convenience multi-field form for collecting card details from a user

Important

Card details are intentionally restricted for PCI compliance
  • Public initializer for OPPaymentCardDetailsForm

    Declaration

    Swift

    @objc
    public init(style: OPCardFormStyle = .standard)

    Parameters

    style

    The visual style to use for this instance

  • The delegate to notify when the card form transitions to or from being valid.

    Declaration

    Swift

    @objc
    public var cardDetailsDelegate: OPPaymentCardDetailsFormDelegate?
  • The background color for the form

    Declaration

    Swift

    public override var backgroundColor: UIColor? { get set }
  • The background color that is automatically applied to the input fields when isUserInteractionEnabled is set to false

    Declaration

    Swift

    @objc
    public var disabledBackgroundColor: UIColor? { get set }
  • Whether or not the form is in a valid state. Use OPPaymentCardDetailsFormDelegate to know when this state changes

    Declaration

    Swift

    @objc
    public var isValid: Bool { get }
  • Causes the number field to begin editing and presents the keyboard

    Important

    This is functionally the same as calling becomeFirstResponder(at: .number)

    Declaration

    Swift

    public override func becomeFirstResponder() -> Bool
  • Causes the specific text field to begin editing and presents the keyboard

    Declaration

    Swift

    @discardableResult
    @objc
    public func becomeFirstResponder(at field: OPCardField) -> Bool

    Parameters

    field

    Determins which card field to be set as first responder

  • Returns the OPPaymentMethodParamsProtocol instance representing the details in the form, if it exists, otherwise nil.

    Declaration

    Swift

    @objc
    public func getPaymentMethodParams() -> OPPaymentMethodParamsProtocol?