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.
PrimerError is the error type delivered when a payment or checkout fails. Every error carries a stable errorId for programmatic handling, a diagnosticsId to share with Primer support, and (where applicable) a recoverySuggestion describing how to recover.
PrimerError conforms to LocalizedError and CustomNSError, so you also get localizedDescription for free and can bridge it to NSError when needed.

How errors are delivered

You never construct a PrimerError yourself. The SDK delivers it to you through one of two channels, depending on how you present checkout. See Handle the payment result for the full success / failure / dismissed flow.

Properties

errorDescription and localizedDescription are intended for logging and diagnostics, not for display to shoppers. Show your own localized, branded messaging in the UI and reserve the SDK description for your logs.

Handling an error

Receive the checkout state through the completion closure and, in the .failure branch, log the diagnosticsId and errorId. Branch on errorId only when you need behavior specific to a category (for example treating a cancellation differently from a hard failure).
For a UIKit / presenter integration, the same PrimerError arrives through the delegate:
When filing a support ticket, include the diagnosticsId. It lets Primer trace the exact occurrence of the failure across SDK and backend logs.

See also

PrimerCheckoutState

The checkout state that delivers .failure(PrimerError).

Handle the payment result

Handle success, failure, and dismissal end to end.

PrimerCheckoutPresenter

Receive failures through the presenter delegate.

ValidationResult

Inline field validation, distinct from checkout errors.