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

    Note

    OPPaymentCardDetailsForm uses text colors, most of which are iOS system colors, that are designed to be as accessible as possible, so any customization should avoid decreasing contrast between the text and background.

    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 }
  • Returns the OPPaymentMethodParamsProtocol instance representing the details in the form, if it exists, otherwise null.

    Declaration

    Swift

    @objc
    public func getPaymentMethodParams() -> OPPaymentMethodParamsProtocol?