onSubmit
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.
You should eventually call sendResult with a DropInServiceResult containing the result of the network request. Drop-in will be updated then based on the DropInServiceResult you sent.
NOTICE: this method runs on the main thread, you should make sure the API call and any other long running operation is made on a background thread.
Note that the PaymentComponentState is a abstract class, you can check and cast to one of its subclasses for a more component specific state.
Only applicable for partial payments flow: in case of a partial payment, you should update Drop-in by calling sendResult with DropInServiceResult.Update.
See https://docs.adyen.com/api-explorer/ for more information on the API documentation.
Parameters
The state of the payment component at the moment the user submits the payment.