Cause: Payment gets stuck during 3DS authentication.Solution: Ensure your Activity has android:configChanges="orientation|screenSize" to prevent the WebView from being destroyed during configuration changes.
Understanding the difference helps with proper error handling:
Error Type
When It Occurs
How It’s Handled
Validation errors
During input (invalid format, missing fields)
Handled automatically by input components; prevents form submission
Payment failures
After form submission (declined card, network issues)
Requires explicit handling with error container or custom code
Don’t confuse these two error types. Validation errors prevent form submission and are shown inline. Payment failures occur after the form is submitted and require explicit handling.
val state by checkout.state.collectAsStateWithLifecycle()LaunchedEffect(state) { Log.d("PrimerCheckout", "State: $state") when (val s = state) { is PrimerCheckoutState.Success -> { } is PrimerCheckoutState.Failure -> { Log.e("PrimerCheckout", "diagnosticsId: ${s.error.diagnosticsId}") } else -> Unit }}
The diagnosticsId from any PrimerCheckoutState.Failure
Your Android API level, Compose version, and SDK version
Steps to reproduce the issue
val state by checkout.state.collectAsStateWithLifecycle()LaunchedEffect(state) { val s = state if (s is PrimerCheckoutState.Failure) { Log.e("Checkout", "diagnosticsId: ${s.error.diagnosticsId}") }}