Skip to main content
Primer Checkout Android SDK is currently in beta (v3.0.0-beta.2). The API is subject to change before the stable release.
Sealed interface for payment outcome events. Delivered through the onEvent callback on PrimerCheckoutSheet or PrimerCheckoutHost.

Definition

@Immutable
sealed interface PrimerCheckoutEvent {

    data class Success(
        val checkoutData: PrimerCheckoutData,
    ) : PrimerCheckoutEvent

    data class Failure(
        val error: PrimerError,
    ) : PrimerCheckoutEvent
}

Events

Success

Dispatched when payment completes successfully. Only emitted in AUTO payment handling mode.
PropertyTypeDescription
checkoutDataPrimerCheckoutDataPayment result containing payment ID and status

Failure

Dispatched when a payment fails or an error occurs.
PropertyTypeDescription
errorPrimerErrorError details including description, error code, and diagnostics ID

Event timing

EventWhen
SuccessAfter payment confirmation from processor
FailureAfter a payment error or SDK error
Events can fire multiple times per session (e.g., a Failure followed by a Success on retry).

PrimerCheckoutData

data class PrimerCheckoutData(
    val payment: Payment,
)

Payment

data class Payment(
    val id: String,
    val orderId: String,
)
PropertyTypeDescription
idStringUnique payment identifier assigned by Primer
orderIdStringOrder identifier from the client session