Skip to main content

iOS Secure Fields

Collect card data inside a native iOS application without your code ever touching raw card values. The SDK renders secure UIKit input fields, validates the data, tokenizes it against the Purse gateway, and returns an opaque vault_form_token to your app.

How it works

Your backend uses the vault_form_token to create a payment via the Payment API — raw card data never passes through your servers or application code. This is the native iOS counterpart of the web SecureFields flow; the server-side payment steps are identical.

Key characteristics

AspectDetail
Card data isolationCard field classes are internal to the SDK module. The text and attributedText getters on card fields return nil — no cast can extract a PAN, CVV, or expiry date.
What your app receivesField validity, focus state, PAN digit count, detected brand, BIN prefix, last four digits, and the vault_form_token.
UI frameworkUIKit views (panContainer, cvvView, expDateView, holderNameView), wrappable in SwiftUI via UIViewRepresentable
EnvironmentsSandbox and production, selected via the VaultEnvironment enum at init — the SDK resolves the vault URL internally
DistributionSigned XCFramework via Swift Package Manager

Requirements

RequirementValue
Minimum iOS versioniOS 15+
Swift5.9+
Xcode15+
Dependency managerSwift Package Manager (CocoaPods and Carthage are not supported)

When to use this SDK

ScenarioRecommendation
Building a native iOS checkout✅ iOS Secure Fields
Building a web checkout with the same server-side controlWeb SecureFields (Advanced Flow)
Building a hybrid or fully web checkoutConsider Drop-in Checkout or Headless Checkout
CVV-only re-auth for a stored card✅ iOS Secure Fields — omit the other fields and pass saveToken at submit
Fully outsourcing the checkout UIConsider Hosted Page

PCI DSS scope

SAQ A-EP eligibility

The SDK architecture is designed to support SAQ A-EP eligibility: card data is captured and tokenized by the SDK without your application code accessing the raw values. Formal scope determination requires assessment by a qualified security assessor (QSA). See Security and compliance for merchant obligations.

Next steps