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 and call selectVaulted(_:) / delete(_:) directly.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, 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:Customizing slots
Provide any combination of slots; omitted slots fall back to their defaults. Custom content must be wrapped inAnyView.
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 row and the submit button, wired to
updateCvvInput(_:). When recapture is required, the submit button stays disabled until a valid CVV is entered.VaultedPaymentMethodsDefaults
The default slot content. BecausePrimerVaultedPaymentMethods 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.