Skip to main content
Primer Checkout iOS SDK is currently in beta (v3.0.0-beta.1). The API is subject to change before the stable release.

Core API

Card Form

Payment Methods

Theming

Common Objects

Session pattern

The iOS SDK exposes one managed entry point and one composable entry point. Both are built on the same observable PrimerCheckoutSession, which owns the checkout lifecycle: it loads the client session, tracks the lifecycle Phase, and delivers the final PrimerCheckoutState.

Composable (inline)

Hold a PrimerCheckoutSession as a @StateObject, then attach it to your view hierarchy with the .primerCheckoutSession(_:onCompletion:) modifier. The composable views — PrimerCardForm, PrimerPaymentMethods, and PrimerVaultedPaymentMethods — resolve their per-feature session from the SwiftUI environment and expose @ViewBuilder slots you can override.
Each composable view receives its session as a slot parameter so you can read state and call actions from your custom UI:
Sessions are @MainActor ObservableObjects. Observe them with @StateObject (when you own them) or @ObservedObject (when they are passed into a slot), and read their @Published state/phase directly in your views.

Managed (modal)

For a turnkey flow that renders the SDK’s default screens, use PrimerCheckout in SwiftUI, or PrimerCheckoutPresenter from UIKit.
Start with the managed PrimerCheckout view to get a working checkout quickly, then move to the composable views and @ViewBuilder slots when you need full control over the UI.

See also

PrimerCheckoutSession

Own the checkout lifecycle for inline, composable checkout.

PrimerCheckout

Drop in the managed SwiftUI checkout view.

PrimerCardForm

Build a custom card form with @ViewBuilder slots.

Handle payment result

React to the final PrimerCheckoutState.