Interface SessionsGiftCardComponentCallback

    • 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 onPartialPayment(SessionPaymentResult result) Indicates that a partial payment has been done.
      Boolean onBalanceCheck(PaymentComponentState<?> paymentComponentState) Only applicable for partial payments flow.
      Boolean onOrderRequest() Only applicable for partial payments flow.
      Unit onOrder(OrderResponse orderResponse)
      Unit onBalance(BalanceResult balanceResult)
      • Methods inherited from class com.adyen.checkout.sessions.core.SessionComponentCallback

        onAction, onAdditionalDetails, onError, onFinished, onLoading, onStateChanged, onSubmit
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • onPartialPayment

         abstract Unit onPartialPayment(SessionPaymentResult result)

        Indicates that a partial payment has been done. This means an order for this payment has been created and part of the amount is still remaining to be paid. This callback provides you with the necessary objects to be able to create a new session to complete the payment for the remaining amount.

        Parameters:
        result - The result of the payment.
      • onBalanceCheck

         Boolean onBalanceCheck(PaymentComponentState<?> paymentComponentState)

        Only applicable for partial payments flow.

        Override this method if you want to take over the sessions flow and make a network call to the /paymentMethods/balance endpoint of the Checkout API through your server. This method is called right after the user enters their partial payment method details and submits them.

        You need to return true if you want to take over the sessions flow, otherwise the API calls will still be handled internally by the SDK. This could be useful in case you want to handle the flow yourself only in certain conditions, then you can return false if these conditions are not met.

        Once you take over the flow you will need to handle all the necessary subsequent network calls, otherwise a MethodNotImplementedException will be thrown.

        We provide a PaymentComponentState which has a PaymentComponentData object containing a non-serialized version of the partial payment method JSON. Use PaymentMethodDetails.SERIALIZER to serialize it to a JSONObject.

        You should eventually call component.resolveBalanceResult with a BalanceResult containing the result of the network request.

        Note that not overriding this method while enabling partial payments will cause a MethodNotImplementedException to be thrown.

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

        Parameters:
        paymentComponentState - The state from the partial payment method component.
        Returns:

        true if you took over the sessions flow, false otherwise.

      • onOrderRequest

         Boolean onOrderRequest()

        Only applicable for partial payments flow.

        Override this method if you want to take over the sessions flow and make a network call to the /orders endpoint of the Checkout API through your server. This method is called when the user is trying to pay a part of the Drop-in amount using a partial payment method.

        You need to return true if you want to take over the sessions flow, otherwise the API calls will still be handled internally by the SDK. This could be useful in case you want to handle the flow yourself only in certain conditions, then you can return false if these conditions are not met.

        Once you take over the flow you will need to handle all the necessary subsequent network calls, otherwise a MethodNotImplementedException will be thrown.

        You should eventually call component.resolveOrderResponse with an OrderResponse containing the result of the network request.

        Note that not overriding this method while enabling partial payments will cause a MethodNotImplementedException to be thrown.

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

        Returns:

        true if you took over the sessions flow, false otherwise.