PrimerCheckoutState is a public, Equatable enum that represents the current state of the checkout flow. It captures both the lifecycle of the session (initializing, ready) and its terminal outcome (success, failure, dismissed).
Your onCompletion closure on PrimerCheckout or on the .primerCheckoutSession(_:onCompletion:) modifier receives outcome states only — .success, .failure, or .dismissed. The lifecycle states .initializing and .ready are part of the enum’s definition but are never delivered to onCompletion; they describe internal progress the SDK drives on your behalf.
.success and .dismissed end the session and are delivered at most once. .failure depends on when it happens: once the checkout is ready, a failed payment attempt does not end the session — the SDK shows its error screen, offers a retry, and your closure is called again with the outcome of each further attempt. Only a failure that occurs before the checkout becomes ready is terminal.
On iOS, a single
PrimerCheckoutState enum covers what the Android SDK splits across PrimerCheckoutState (lifecycle) and PrimerCheckoutEvent (outcomes). The .initializing and .ready cases mirror the lifecycle; .success, .failure, and .dismissed mirror the outcome events delivered to onCompletion.Definition
States
.ready associated values
Because
.ready is never delivered to onCompletion, read the client session from the session object instead — PrimerCheckoutSession.clientSession is @Published and becomes non-nil as soon as the checkout is ready:
This requires the inline integration.
PrimerCheckout — the managed modal — renders the SDK’s own screens and exposes no session object, so the client session is not reachable from it.Lifecycle
A checkout session progresses from the lifecycle states to an outcome..success and .dismissed end it; a .failure after .ready does not:
.success and .dismissed are delivered at most once per session. .failure is terminal only before .ready; after that it is delivered once per failed attempt. The lifecycle states .initializing and .ready are never passed to onCompletion.Handling completion
Pass anonCompletion closure when you present checkout. It receives the outcome states — .success, .failure, or .dismissed — and may be called more than once if a payment attempt fails and the customer retries.
PaymentResult
PaymentResult is the value carried by .success. It is a public, Sendable, Equatable struct describing the completed payment.
PaymentStatus
PaymentStatus is a public, Sendable enum describing the final status of a payment.
Always include a
default: (or @unknown default:) case when switching on PaymentStatus to handle future additions.Handling the result
Use the.success payload to read the payment details and route your UI:
PrimerClientSession
The resolved client session, carried by.ready and published on PrimerCheckoutSession.clientSession.
Every property is optional because the client session itself is merchant-configured — a session created without line items has none. Read them defensively rather than assuming a shape.
PrimerLineItem
PrimerOrder
PrimerCustomer
PrimerAddress
PaymentMethod
PrimerFee
See also
PrimerCheckout
Present checkout and receive the final state through
onCompletion.PrimerError
Error details carried by the
.failure state.Handle payment result
Route your UI based on the checkout outcome.
PrimerCheckoutSession
Drive the inline checkout lifecycle from your own layout.