confirmPaymentIntent
suspend fun Terminal.confirmPaymentIntent(intent: PaymentIntent, config: ConfirmPaymentIntentConfiguration = ConfirmPaymentIntentConfiguration.Builder().build()): PaymentIntent
Return
The confirmed PaymentIntent
Parameters
intent
The PaymentIntent to confirm
config
Configuration for the confirmation process
See also
Confirms a PaymentIntent after collecting the payment method.
This suspend function wraps Terminal.confirmPaymentIntent and integrates with Kotlin's structured concurrency. If the coroutine calling this function is cancelled, the underlying confirm operation will automatically be cancelled as well.
Example usage:
val job = coroutineScope.launch {
try {
val confirmedIntent = terminal.confirmPaymentIntent(paymentIntent, config)
// Handle successful confirmation
} catch (e: TerminalException) {
// Handle confirmation failure
}
}
// Cancelling the job will cancel the confirm operation
job.cancel()Content copied to clipboard
Throws
if the confirmation operation fails