onBalanceCheck
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.
Return
true if you took over the sessions flow, false otherwise.
Parameters
The state from the partial payment method component.