DropInComponentDelegate

public protocol DropInComponentDelegate : AnyObject

Defines the methods a delegate of the drop in component should implement.

  • Invoked when a payment method is selected and the initial details have been filled.

    Declaration

    Swift

    func didSubmit(_ data: PaymentComponentData, for paymentMethod: PaymentMethod, from component: DropInComponent)

    Parameters

    data

    The data supplied by the drop in component, containing the filled payment method details.

    paymentMethod

    The paymen method of selected paymen component.

    component

    The drop in component in which the payment method was selected and filled.

  • Invoked when additional details have been provided for a payment method.

    Declaration

    Swift

    func didProvide(_ data: ActionComponentData, from component: DropInComponent)

    Parameters

    data

    The additional data supplied by the drop in component.

    component

    The drop in component from which the additional details were provided.

  • Invoked when the action component finishes, without any further steps needed by the application, for example in case of voucher payment methods. The application just needs to dismiss the DropInComponent.

    Declaration

    Swift

    func didComplete(from component: DropInComponent)

    Parameters

    component

    The component that handled the action.

  • Invoked when the drop in component failed with an error.

    Declaration

    Swift

    func didFail(with error: Error, from component: DropInComponent)

    Parameters

    error

    The error that occurred.

    component

    The drop in component that failed.

  • Invoked when user closes a payment component.

    Declaration

    Swift

    func didCancel(component: PaymentComponent, from dropInComponent: DropInComponent)

    Parameters

    component

    The component that the user closed.

    dropInComponent

    The drop in component that owns the component.

  • Invoked when payment component redirected to external app.

    Declaration

    Swift

    func didOpenExternalApplication(_ component: DropInComponent)

    Parameters

    component

    The component that the user closed.

    dropInComponent

    The drop in component that owns the component.