Class GenericActionComponent

  • All Implemented Interfaces:
    com.adyen.checkout.action.core.internal.ActionHandlingComponent , com.adyen.checkout.components.core.internal.ActionComponent , com.adyen.checkout.components.core.internal.Component , com.adyen.checkout.components.core.internal.IntentHandlingComponent , com.adyen.checkout.components.core.internal.ResultHandlingComponent , com.adyen.checkout.ui.core.internal.ui.ViewableComponent

    
    public final class GenericActionComponent
    extends ViewModel implements ActionComponent, ViewableComponent, IntentHandlingComponent, ActionHandlingComponent
                        

    An ActionComponent that is able to handle every action.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ActionDelegate getDelegate()
      Flow<ComponentViewType> getViewFlow()
      Boolean canHandleAction(Action action) Checks if this component can handle the specific action type.
      Unit handleAction(Action action, Activity activity) Provide the action from the API response that needs to be handled.
      Unit handleIntent(Intent intent) Call this method when receiving the return URL from the redirect with the result data.
      Unit setOnRedirectListener(Function0<Unit> listener) Set a callback that will be called when a redirect is opened.
      • Methods inherited from class androidx.lifecycle.ViewModel

        addCloseable, addCloseable, getCloseable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • canHandleAction

         Boolean canHandleAction(Action action)

        Checks if this component can handle the specific action type.

        Parameters:
        action - The Action object from the API response.
        Returns:

        If the action can be handled by this component.

      • handleAction

         Unit handleAction(Action action, Activity activity)

        Provide the action from the API response that needs to be handled.

        Parameters:
        action - The parsed object from the API of the action to be taken.
        activity - The Activity starting the action.
      • handleIntent

         Unit handleIntent(Intent intent)

        Call this method when receiving the return URL from the redirect with the result data. This result will be in the Intent.getData and begins with the returnUrl you specified on the payments/ call.

        Parameters:
        intent - The received Intent.
      • setOnRedirectListener

         Unit setOnRedirectListener(Function0<Unit> listener)

        Set a callback that will be called when a redirect is opened.

        Parameters:
        listener - The callback that will be called on redirect.