DropInComponent

public final class DropInComponent : NSObject, PresentableComponent
extension DropInComponent: PresentationDelegate
extension DropInComponent: FinalizableComponent
extension DropInComponent: ReadyToSubmitPaymentComponentDelegate

A component that handles the entire flow of payment selection and payment details entry.

  • The payment methods to display.

    Declaration

    Swift

    public private(set) var paymentMethods: PaymentMethods { get }
  • Indicates the UI configuration of the drop in component.

    Declaration

    Swift

    public let style: Style
  • The title text on the first page of drop in component.

    Declaration

    Swift

    public let title: String
  • Initializes the drop in component.

    Declaration

    Swift

    public init(paymentMethods: PaymentMethods,
                configuration: Configuration,
                style: Style = Style(),
                title: String? = nil)

    Parameters

    paymentMethods

    The payment methods to display.

    configuration

    The payment method specific configuration.

    style

    The UI styles of the components.

    title

    Name of the application. To be displayed on a firstpayment page. If no external value provided, the Main Bundle’s name would be used.

Delegates

Handling Actions

  • Handles an action to complete a payment.

    Declaration

    Swift

    public func handle(_ action: Action)

    Parameters

    action

    The action to handle.

Handling Partial Payments

  • Reloads the DropIn with a partial payment order and a new PaymentMethods object.

    Throws

    PartialPaymentError.missingOrderData in case order.orderData is nil.

    Declaration

    Swift

    public func reload(with order: PartialPaymentOrder,
                       _ paymentMethods: PaymentMethods) throws

    Parameters

    order

    The partial payment order.

    paymentMethods

    The new payment methods.

  • Stops loading and finalise DropIn’s selected payment if nececery. This method must be called after certan payment methods (e.x. ApplePay)

    Declaration

    Swift

    public func didFinalize(with success: Bool)

    Parameters

    success

    Status of the payment.

  • Indicates the UI configuration of the drop in components.

    See more

    Declaration

    Swift

    struct Style
  • Contains the configuration for the drop in component and the embedded payment method components.

    See more

    Declaration

    Swift

    final class Configuration : APIContextAware
  • Apple Pay component configuration.

    See more

    Declaration

    Swift

    final class ApplePayConfiguration