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.
PrimerVaultedPaymentMethods renders the customer’s saved (vaulted) payment methods as a list, composed from three slots: a header, a per-method row, and a submit button. Tapping a row selects that method; the submit button pays with the currently selected vaulted method. The view resolves its PrimerSelectionSession from the environment. Selection, deletion, and CVV recapture are all driven through that session — PrimerVaultedPaymentMethods only composes the UI.
This view reads its session from the environment injected by the .primerCheckoutSession(_:onCompletion:) modifier. Place it inside a view hierarchy that applies that modifier. When no session is present it renders an empty placeholder.

PrimerVaultedPaymentMethods

Slots are type-erased to AnyView rather than using opaque return types. The three-argument item and submitButton builders hit Swift’s generic-default inference limits, so this view trades the opaque-return ergonomics of PrimerCardForm for guaranteed composition. Wrap any custom slot content in AnyView.

VaultedMethod typealias

VaultedMethod is a convenience alias for PrimerHeadlessUniversalCheckout.VaultedPaymentMethod, the model passed to the item slot.

Usage

The default slots produce a complete, themed vaulted list — no slot arguments are required:
Wrap the view in a hierarchy that injects a checkout session:

Customizing slots

Provide any combination of slots; omitted slots fall back to their defaults. Custom content must be wrapped in AnyView.
Use the isSelected flag the item slot receives to render selection affordances (checkmarks, borders, highlights). Calling onSelect marks the row’s method as the active vaulted method so the next submit targets it.

Driving selection, deletion, and CVV

PrimerVaultedPaymentMethods delegates all behavior to PrimerSelectionSession. Read vaultedPaymentMethods and call the session methods directly from custom slots. The selection state read by the slots lives on session.state (PrimerPaymentMethodSelectionState):
CVV recapture is handled by the SDK and is not a customizable slot. When the selected vaulted card requires a CVV, the view inserts a managed CVV field between the rows and the submit button, wired to updateCvvInput(_:). The submit button stays disabled until a method is selected and — when CVV recapture is required — until a valid CVV is entered.

VaultedPaymentMethodsDefaults

The default slot content. Because PrimerVaultedPaymentMethods erases its slots to AnyView, these helpers return some View. Compose them inside custom slots to keep the default look while overriding only part of the layout.
Reuse a default while customizing a sibling slot:

See also

PrimerSelectionSession

Selection, deletion, and CVV actions for payment methods and vaulted methods.

PrimerPaymentMethods

Slot-based list of available (non-vaulted) payment methods.

PaymentMethodsDefaults

Default slot content for the payment methods list.

PrimerCardForm

Slot-based card entry form for new cards.