Skip to main content
Primer Checkout iOS SDK is currently in beta (v3.0.0-beta.5). The API is subject to change before the stable release.
PrimerVaultedPaymentMethods is the returning-customer shortcut: it renders the selected saved payment method — the first saved one until the customer picks another — with a header and a submit button that pays with it. It is composed from three slots: header, item row, and submit button. The header’s “Show all” action opens the SDK’s saved-payment-methods screen, which lists every saved method and is the only place a customer can delete one.
This is a one-row shortcut, not a full list. If you want every saved method visible inline, build that yourself — iterate PrimerSelectionSession.vaultedPaymentMethods, keep the highlight in your own view state, and call selectVaulted(_:) from your pay button and delete(_:) to remove one.
The view resolves its PrimerSelectionSession from the environment. Paying and deletion are driven through that session — PrimerVaultedPaymentMethods only composes the UI. CVV recapture is a screen the SDK raises for itself.
This view reads its session from the environment injected by the .primerCheckoutSession(_:theme:onCompletion:) modifier. Place it inside a view hierarchy that applies that modifier. When no session is present it renders an empty placeholder, and when the customer has no saved methods it renders nothing at all — so you do not need to hide it yourself.

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 saved-method shortcut — 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 payment and deletion

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 entirely by the SDK. When the saved card requires a CVV, selectVaulted(_:) raises the SDK’s own CVV screen, and that screen finishes the payment. Nothing is inserted into your layout, so a merchant-owned pay button needs no field and no disabled state for it.

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

Paying and deletion 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.