Interface ComponentCallback

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit onSubmit(T state) In this method you should make a network call to the /payments endpoint of the Checkout API through your server.
      abstract Unit onAdditionalDetails(ActionComponentData actionComponentData) In this method you should make a network call to the /payments/details endpoint of the Checkout API through your server.
      abstract Unit onError(ComponentError componentError) The component has encountered an error.
      Unit onStateChanged(T state) You can implement this optional method to receive an update any time the state of the component changes.
      Unit onPermissionRequest(String requiredPermission, PermissionHandlerCallback permissionCallback) Should be overridden to support runtime permissions for components.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • onSubmit

         abstract Unit onSubmit(T state)

        In this method you should make a network call to the /payments endpoint of the Checkout API through your server.

        We provide a PaymentComponentState which contains information about the state of the payment component at the moment the user submits the payment.

        We also provide inside PaymentComponentState.data the parameters that we can infer from the component's configuration and the user input, especially the state.data.paymentMethod object with the shopper input details.

        Use PaymentComponentData.SERIALIZER to serialize this data to a JSONObject. The rest of the /payments call request data should be filled in, on your server, according to your needs.

        See https://docs.adyen.com/api-explorer/ for more information on the API documentation.

        Parameters:
        state - The state of the payment component at the moment the user submits the payment.
      • onAdditionalDetails

         abstract Unit onAdditionalDetails(ActionComponentData actionComponentData)

        In this method you should make a network call to the /payments/details endpoint of the Checkout API through your server.

        We provide inside ActionComponentData the whole request data expected by the /payments/details endpoint. Use ActionComponentData.SERIALIZER to serialize this data to a JSONObject.

        You can dismiss the component after this API call is successful, there is no need to perform any extra actions.

        See https://docs.adyen.com/api-explorer/ for more information on the API documentation.

        Parameters:
        actionComponentData - The data from the action component.
      • onStateChanged

         Unit onStateChanged(T state)

        You can implement this optional method to receive an update any time the state of the component changes.

        This mainly occurs through a user interaction (editing an input, selecting an item from a list, etc) and will be triggered regardless whether the component is valid or not.

        We provide a PaymentComponentState which contains information about the state of the payment component at that moment.

        Parameters:
        state - The state of the payment component at the current moment.
      • onPermissionRequest

         Unit onPermissionRequest(String requiredPermission, PermissionHandlerCallback permissionCallback)

        Should be overridden to support runtime permissions for components. Runtime permission should be requested and communicated back through the callback. If not overridden, PermissionHandlerCallback.onPermissionRequestNotHandled will be invoked, which will show an error message.

        Parameters:
        requiredPermission - Required runtime permission.
        permissionCallback - Callback to be used when passing permission result.