onCreateIntent

abstract suspend fun onCreateIntent(confirmationToken: ConfirmationToken): CreateIntentResult

Called with the ConfirmationToken when the customer confirms the payment or setup.

Return

CreateIntentResult.Success with client secret, or CreateIntentResult.Failure if an error occurred.

Parameters

confirmationToken

your implementation should:

  1. Send the ConfirmationToken to your server

  2. Create a PaymentIntent or SetupIntent using the server-side API

  3. Return the client secret wrapped in CreateIntentResult.Success