Interface SessionsGiftCardComponentCallback
-
- All Implemented Interfaces:
-
com.adyen.checkout.components.core.internal.BaseComponentCallback,com.adyen.checkout.sessions.core.SessionComponentCallback
public interface SessionsGiftCardComponentCallback implements SessionComponentCallback<GiftCardComponentState>
Implement this callback to interact with a GiftCardComponent initialized with a session.
-
-
Method Summary
Modifier and Type Method Description abstract UnitonPartialPayment(SessionPaymentResult result)Indicates that a partial payment has been done. BooleanonBalanceCheck(PaymentComponentState<?> paymentComponentState)Only applicable for partial payments flow. BooleanonOrderRequest()Only applicable for partial payments flow. UnitonOrder(OrderResponse orderResponse)UnitonBalance(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
-
-
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.
-
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.
-
onOrder
@RestrictTo(value = {RestrictTo.Scope.LIBRARY_GROUP}) Unit onOrder(OrderResponse orderResponse)
-
onBalance
@RestrictTo(value = {RestrictTo.Scope.LIBRARY_GROUP}) Unit onBalance(BalanceResult balanceResult)
-
-
-
-