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.
| Property | Type | Description |
|---|
checkoutData | PrimerCheckoutData | Payment result containing payment ID and status |
Failure
Dispatched when a payment fails or an error occurs.
| Property | Type | Description |
|---|
error | PrimerError | Error details including description, error code, and diagnostics ID |
Event timing
| Event | When |
|---|
Success | After payment confirmation from processor |
Failure | After 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,
)
| Property | Type | Description |
|---|
id | String | Unique payment identifier assigned by Primer |
orderId | String | Order identifier from the client session |