When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.
This guide explains the event-driven model behind Primer Checkout and walks through the integration decisions you’ll face when wiring events into your application. It is organized around the questions you’ll encounter as you build: where to listen, what to set up first, and how to handle each phase of the payment lifecycle.
This guide focuses on when and why to use each event. For the complete API surface, every event name, payload shape, type definition, and callback signature see the platform-specific SDK references.
Primer Checkout components dispatch CustomEvent objects. Every Primer event is created with bubbles: true and composed: true, which means events propagate up through shadow DOM boundaries and can be caught at any ancestor element, including document. This design gives you two choices for where to listen, covered in the next section.
The Android SDK communicates through a single channel:
State (PrimerCheckoutState): the full checkout lifecycle — loading, ready, and the terminal Success/Failure outcomes
State is a StateFlow<PrimerCheckoutState> you observe in Compose via checkout.state. Payment outcomes are terminal cases of that same flow.
The iOS SDK communicates through two mechanisms:
Published session state: PrimerCheckoutSession publishes the lifecycle phase (.initializing / .ready) and clientSession. PrimerCardFormSession and PrimerSelectionSession publish state for field-level and selection progress
onCompletion callback (PrimerCheckoutState): Receives .failure once per failed attempt, including a failed initialization. Then it receives .success or .dismissed at most once. It never receives .initializing or .ready, so read those from phase
For the managed modal, pass onCompletion to PrimerCheckout. For inline, composable UI, observe each session’s @Published state inside your SwiftUI views and receive the outcome through the .primerCheckoutSession(_:theme:onCompletion:) modifier. In UIKit, conform to PrimerCheckoutPresenterDelegate.
Each platform has its own mechanism for receiving SDK events and state changes.
Web
Android
iOS
Component Level
Document Level
Attach listeners directly to the <primer-checkout> element. Each listener is scoped to a single checkout instance.
const checkout = document.querySelector('primer-checkout');checkout.addEventListener('primer:ready', (event) => { // This listener only fires for this checkout instance const primer = event.detail; configureCallbacks(primer);});
Choose this when:
You want to co-locate event logic with the component that owns it, such as inside a framework component’s lifecycle hook.
You need to tear down listeners cleanly when a checkout is removed from the DOM.
Attach listeners to document. Because Primer events bubble and are composed, they reach the document root regardless of where the component sits in the DOM.
document.addEventListener('primer:payment-success', (event) => { // Fires when any Primer event bubbles up to document analytics.track('payment_completed', event.detail);});
Choose this when:
You have a single checkout per page and prefer centralized event handling.
You’re building cross-cutting concerns like analytics, logging, or error monitoring.
Your architecture already uses a global event bus pattern.
When using component-level listeners, make sure the element is in the DOM before attaching them. If your checkout renders dynamically (through a router transition, a conditional template, or lazy loading), the element may not exist at script-execution time.
// Safe: wait for the DOM to be ready before queryingdocument.addEventListener('DOMContentLoaded', () => { const checkout = document.querySelector('primer-checkout'); if (checkout) { checkout.addEventListener('primer:payment-success', handlePaymentSuccess); checkout.addEventListener('primer:payment-failure', handlePaymentFailure); }});
If your framework provides a lifecycle hook that runs after the component mounts (React’s useEffect, Vue’s onMounted, etc.), prefer that over DOMContentLoaded.
State — including the terminal Success and Failure outcomes — is observed from checkout.state:
val checkout = rememberPrimerCheckoutController(clientToken)val state by checkout.state.collectAsStateWithLifecycle()when (state) { is PrimerCheckoutState.Loading -> { CircularProgressIndicator() } is PrimerCheckoutState.Ready -> { val clientSession = (state as PrimerCheckoutState.Ready).clientSession Text("Total: ${checkout.formatAmount(clientSession.totalAmount ?: 0)}") PrimerCheckoutSheet(checkout = checkout) }}
The outcome is delivered to the onCompletion closure on PrimerCheckout (managed modal) or on the .primerCheckoutSession(_:theme:onCompletion:) modifier (inline), as a PrimerCheckoutState — .success, .failure, or .dismissed. .success and .dismissed end the session and arrive at most once. .failure arrives once per failed attempt. While the SDK error screen is enabled (uiOptions.isErrorScreenEnabled, on by default), the checkout stays open on it. The closure is then called again if the customer retries. With PrimerCheckout this includes a failed initialization, whose error screen offers a retry. With the inline modifier, a failure before .ready ends the session. This example uses the managed modal:
PrimerCheckout(clientToken: clientToken) { state in switch state { case let .success(result): print("Payment ID: \(result.paymentId)") case let .failure(error, _): print("Failed: \(error.errorDescription ?? "")") case .dismissed: print("Dismissed") default: break }}
For inline UI you observe lifecycle and field-level progress by reading each session’s @Published property: PrimerCheckoutSession publishes phase, while PrimerCardFormSession and PrimerSelectionSession publish state.
Every Primer Checkout integration begins with initialization. The SDK must fully initialize before you can pre-fill form fields or call SDK methods.
Web
Android
iOS
The primer:ready event fires once after the SDK has fully initialized. It delivers the PrimerJS instance as event.detail.
const checkout = document.querySelector('primer-checkout');checkout.addEventListener('primer:ready', (event) => { const primer = event.detail; // Pre-fill known data (optional) const user = getAuthenticatedUser(); if (user?.fullName) { primer.setCardholderName(user.fullName); } // Access available methods immediately if needed const methods = primer.getPaymentMethods(); console.log(`${methods.length} payment method(s) available at init`);});// Handle payment outcomes via eventscheckout.addEventListener('primer:payment-success', (event) => { const { payment, paymentMethodType } = event.detail; console.log('Payment successful:', payment.last4Digits); window.location.href = `/confirmation?method=${paymentMethodType}`;});checkout.addEventListener('primer:payment-failure', (event) => { const { error } = event.detail; console.error('Payment failed:', error.message); // The checkout UI already displays the error to the user. // Use this event for logging, analytics, or retry logic.});
If you don’t listen for primer:payment-success and primer:payment-failure, successful and failed payments will complete silently with no redirect or confirmation. Always attach these event listeners.
Before using primer:payment-failure to offer a retry, check the error’s code and origin — not all failures are retryable, and a network-level failure may hide a payment that actually succeeded.
The checkout controller initializes automatically when created with rememberPrimerCheckoutController(). Payment outcomes are terminal cases of checkout.state — observe the flow to react to them:
val state by checkout.state.collectAsStateWithLifecycle()LaunchedEffect(state) { when (val s = state) { is PrimerCheckoutState.Success -> { val payment = s.checkoutData Log.d("Checkout", "Payment ID: ${payment.payment.id}") navigateToConfirmation(payment) } is PrimerCheckoutState.Failure -> { val error = s.primerError Log.e("Checkout", "Failed: ${error.description}") Log.e("Checkout", "Diagnostics: ${error.diagnosticsId}") // Present when the payment was created before failing, e.g. a decline. s.checkoutData?.payment?.let { payment -> Log.e("Checkout", "Payment: ${payment.id} order: ${payment.orderId}") } } else -> Unit }}PrimerCheckoutSheet(checkout = checkout)
The checkout initializes automatically when the PrimerCheckout SwiftUI view appears (or when the .primerCheckoutSession modifier calls start() on appear). Pass an onCompletion closure to receive the outcome:
PrimerCheckout(clientToken: clientToken) { state in switch state { case let .success(result): print("Payment ID: \(result.paymentId)") navigateToConfirmation(result) case let .failure(error, checkoutData): print("Failed: \(error.errorDescription ?? "")") print("Diagnostics: \(error.diagnosticsId)") // Present when the payment was created before failing, e.g. a decline. if let payment = checkoutData?.payment { print("Payment: \(payment.id ?? "-") order: \(payment.orderId ?? "-")") } case .dismissed: navigateBack() default: break }}
To observe the .ready lifecycle state for an inline integration, read the phase published by PrimerCheckoutSession (.initializing / .ready) inside your SwiftUI view. The client session that .ready carries is published separately as PrimerCheckoutSession.clientSession — nil until the session is ready, then the same PrimerClientSession value:
if let total = session.clientSession?.totalAmount, let formatted = session.formatAmount(total) { Text("Total: \(formatted)")}
totalAmount is in minor units, so rendering it directly shows 1000 for a ten-dollar order. Use session.formatAmount(_:) to format it the way the SDK’s own screens do.
If you don’t provide an onCompletion closure, successful and failed payments will complete with no redirect or confirmation. Always provide this closure.
Shortly after initialization, the SDK provides information about available payment methods for the current session.
Web
Android
iOS
The SDK dispatches primer:methods-update with the list of payment methods available for the current session. This event fires once on load and may fire again if the session changes (e.g. after calling primer.refreshSession() in response to a cart update).You should use this event when you want to build a custom payment method selector, conditionally render UI based on what’s available, or route users to a specific method.
checkout.addEventListener('primer:methods-update', (event) => { const methods = event.detail; // Conditionally show an "Express Checkout" section only if Apple Pay or Google Pay is available const hasExpressMethod = methods.toArray().some( (m) => m.type === 'APPLE_PAY' || m.type === 'GOOGLE_PAY' ); document.getElementById('express-checkout-section').hidden = !hasExpressMethod;});
If you’re building a fully custom payment method layout (headless), you’ll also iterate over the methods to create <primer-payment-method> elements dynamically. The Headless Vault Guide covers that pattern in detail.
Payment methods are managed automatically by the SDK components (PrimerPaymentMethods, PrimerVaultedPaymentMethods). You can access the client session details from the Ready state:
val state by checkout.state.collectAsStateWithLifecycle()when (state) { is PrimerCheckoutState.Ready -> { val clientSession = (state as PrimerCheckoutState.Ready).clientSession Text("Total: ${checkout.formatAmount(clientSession.totalAmount ?: 0)}") }}
Payment methods are managed by the PrimerPaymentMethods view, which resolves a PrimerSelectionSession from the environment. Observe the session’s published state to track available and selected methods:
struct MethodCount: View { @ObservedObject var session: PrimerSelectionSession var body: some View { VStack(alignment: .leading) { Text("Methods: \(session.state.paymentMethods.count)") if let selected = session.state.selectedPaymentMethod { Text("Selected: \(selected.name)") } } }}
Read state inside a header or emptyState slot, which receive the PrimerSelectionSession. The method slot instead receives a CheckoutPaymentMethod and an onSelect closure, so it does not have access to the session.
primer:bin-data-available fires as the user types their card number. It provides the detected card network, co-badged network alternatives, and additional BIN data such as issuer information when available. Use it to display the correct card brand logo, show a co-badge network picker, or adjust UI based on card attributes.
checkout.addEventListener('primer:bin-data-available', (event) => { const { preferred, alternatives, status } = event.detail; const logoEl = document.getElementById('card-logo'); const cobrandEl = document.getElementById('cobrand-selector'); if (preferred) { logoEl.src = `/images/${preferred.network.toLowerCase()}.svg`; logoEl.alt = preferred.displayName; } // Some cards support co-badging (e.g. Carte Bancaire / Visa). // If there are multiple allowed networks, show a picker. const selectableNetworks = [preferred, ...alternatives].filter(n => n?.allowed); cobrandEl.hidden = selectableNetworks.length <= 1; // When status is 'complete', additional issuer data is available if (status === 'complete' && preferred?.issuerCountryCode) { console.log(`Card issued in: ${preferred.issuerCountryCode}`); }});
To show a loading indicator while BIN data is being fetched, listen for primer:bin-data-loading-change:
primer:bin-data-available replaces the older primer:card-network-change event with a richer payload that includes issuer details and card attributes. See the Events Reference for the full payload shape.
The Android SDK handles card network detection and display automatically within the PrimerCardForm component. Card brand icons update in real-time as the user types.
Card network detection is available via PrimerCardFormState. The PrimerCardForm view injects a PrimerCardFormSession into each of its slots; observe the session’s published state and read selectedNetwork and availableNetworks as the user types:
PrimerCardForm(cardDetails: { session in VStack(alignment: .leading) { CardFormDefaults.cardNumber(session) if let network = session.state.selectedNetwork { Text("Detected network: \(network.displayName)") } // Co-badged cards expose multiple networks if session.state.availableNetworks.count > 1 { Text("Co-badge options: \(session.state.availableNetworks.map(\.displayName).joined(separator: ", "))") } }})
To select a network on a co-badged card, call session.selectCardNetwork(_:).
bubbles: true and composed: true are required so the event crosses shadow DOM boundaries and reaches the card form component inside <primer-checkout>. Omitting either option will silently prevent submission.
For vault payment submission from a custom button, dispatch primer:vault-submit in the same way. See the Events Reference and Triggerable Events for the full list of events you can dispatch.
The Android SDK handles user interaction through Compose components. Card form state is managed via PrimerCardFormController:
val cardFormController = rememberCardFormController()
The SDK provides built-in components for card input (PrimerCardForm), payment method selection (PrimerPaymentMethods), and vaulted methods (PrimerVaultedPaymentMethods). These handle user interaction automatically.
If you’re building a custom card form UI, drive the fields and submission through the PrimerCardFormSession injected into each PrimerCardForm slot. Bind your TextFields to the update* methods and call submit() from your custom button:
Call session.cancel() to leave the card form. When other payment methods are configured, it returns to payment method selection. When the card is the only configured payment method, it dismisses the checkout and delivers .dismissed, even if the customer has saved methods. It is ignored while a payment is running or while your onBeforePaymentCreate handler has not decided yet.
Once the user submits, the SDK moves through a processing to outcome sequence.
Web
Android
iOS
The primer:state-change event fires at every step, giving you a single stream to drive your UI state.
checkout.addEventListener('primer:state-change', (event) => { const { isLoading, isProcessing, isSuccessful, paymentFailure, primerJsError } = event.detail; const submitBtn = document.getElementById('custom-pay-button'); const spinner = document.getElementById('loading-overlay'); // Disable the button during loading or processing submitBtn.disabled = isLoading || isProcessing; // Show a loading overlay while the payment is in flight spinner.hidden = !isProcessing; if (isSuccessful) { // Payment succeeded — primer:payment-success will also fire document.getElementById('checkout-form').hidden = true; } if (paymentFailure) { // The checkout component already displays the error to the user. // Use this for supplementary logging or analytics. console.error(`Payment error [${paymentFailure.code}]: ${paymentFailure.message}`); } if (primerJsError) { // An SDK-level error (network failure, configuration issue, etc.) // Unlike paymentFailure, this may not be shown in the checkout UI. reportToErrorService(primerJsError); }});
val state by checkout.state.collectAsStateWithLifecycle()LaunchedEffect(state) { when (val s = state) { is PrimerCheckoutState.Success -> { val payment = s.checkoutData Log.d("Checkout", "Payment ID: ${payment.payment.id}") navigateToConfirmation(payment) } is PrimerCheckoutState.Failure -> { val error = s.primerError Log.e("Checkout", "Failed: ${error.description}") Log.e("Checkout", "Diagnostics: ${error.diagnosticsId}") // Present when the payment was created before failing, e.g. a decline. s.checkoutData?.payment?.let { payment -> Log.e("Checkout", "Payment: ${payment.id} order: ${payment.orderId}") } } else -> Unit }}PrimerCheckoutSheet(checkout = checkout)
The onCompletion closure receives .failure once per failed attempt. While the SDK error screen is enabled, the checkout stays open so the customer can retry. It then receives .success or .dismissed at most once, and after that nothing more. Read the PaymentResult on .success and the PrimerError on .failure:
PrimerCheckout(clientToken: clientToken) { state in switch state { case let .success(result): print("Payment ID: \(result.paymentId)") print("Status: \(result.status)") navigateToConfirmation(result) case let .failure(error, checkoutData): print("Error: \(error.errorDescription ?? "")") print("Diagnostics: \(error.diagnosticsId)") // Present when the payment was created before failing, e.g. a decline. if let payment = checkoutData?.payment { print("Payment: \(payment.id ?? "-") order: \(payment.orderId ?? "-")") } case .dismissed: break default: break }}
For an inline integration, drive intermediate UI (spinners, disabled buttons) from each session’s @Published state — for example PrimerCardFormSession.state.isLoading while a payment is in flight.
primer:state-change fires multiple times during a single payment. The outcome events (primer:payment-success, primer:payment-failure) fire exactly once at the end. Use primer:state-change for continuous UI updates (spinners, button states, progress indicators). Use the outcome events for final actions (redirects, confirmations, server notifications).
Events may fire multiple times during a single checkout session (for example, if the user retries after a failure).
Web
Android
iOS
primer:state-change fires at every step — use it for continuous UI updates (spinners, button states)
primer:payment-success and primer:payment-failure fire exactly once at the end — use them for final actions
Success fires immediately — the default success screen auto-dismisses after 3 seconds
Failure fires immediately — the error screen stays open for retry
Each session’s @Published state updates as the flow progresses — observe it for continuous UI updates (spinners, button states)
.success and .dismissed end the checkout. Only one of them reaches onCompletion, at most once — use it for final actions (navigation, confirmation)
.failure reaches onCompletion once per failed attempt. While the SDK error screen is enabled, the checkout stays open for a retry — log the error or show your own message instead of navigating away
.dismissed fires when the user dismisses the checkout without completing payment
Call primer.refreshSession() to sync the client-side SDK with your server session after a cart change. The SDK will re-dispatch primer:methods-update with the updated method list.
Handle checkout dismissal via the onDismiss callback:
Call checkout.refresh() to reinitialize the checkout after updating the order on your server.Use checkout.formatAmount() to display currency-formatted values:
val formattedTotal = checkout.formatAmount(1000) // "$10.00"
Handle dismissal by observing the .dismissed state in onCompletion:
PrimerCheckout(clientToken: clientToken) { state in if case .dismissed = state { navigateBack() }}
For an inline integration, call await session.refresh() on your PrimerCheckoutSession to re-fetch configuration and payment methods after a client-session update (for example, an amount or currency change).
Sometimes you need to run a check after the user clicks “Pay” but before the payment is created — for example, confirming terms-of-service acceptance, validating inventory, or applying a last-second promotion code.
Web
Android
iOS
The primer:payment-start event gives you that interception point.
checkout.addEventListener('primer:payment-start', (event) => { const { paymentMethodType, continuePaymentCreation, abortPaymentCreation } = event.detail; // Prevent automatic continuation event.preventDefault(); const termsAccepted = document.getElementById('terms-checkbox').checked; if (!termsAccepted) { showInlineError('Please accept the terms of service before paying.'); abortPaymentCreation(); return; } // Optionally inspect paymentMethodType to apply method-specific logic continuePaymentCreation();});
If you call event.preventDefault(), you must call either continuePaymentCreation() or abortPaymentCreation() in every code path. If neither is called, the payment will hang indefinitely. If you don’t call preventDefault(), the payment continues automatically.
Payment interception is not available in the composable module.
Set onBeforePaymentCreate on your PrimerCheckoutSession to intercept payments after the user taps “Pay” but before the payment is created. It runs for every payment method, including payments with a saved method started from the SDK’s pay button or from PrimerSelectionSession.selectVaulted(_:). The handler receives the payment-method data and a decision handler:
struct CheckoutView: View { @StateObject private var session: PrimerCheckoutSession init(clientToken: String) { let session = PrimerCheckoutSession(clientToken: clientToken) session.onBeforePaymentCreate = { _, decisionHandler in guard termsAccepted else { decisionHandler(.abortPaymentCreation()) return } decisionHandler(.continuePaymentCreation(withIdempotencyKey: nil)) } _session = StateObject(wrappedValue: session) } var body: some View { ScrollView { PrimerCardForm() } .primerCheckoutSession(session) { state in // Handle the outcome. } }}
You must call the decisionHandler closure with either .continuePaymentCreation(withIdempotencyKey:) or .abortPaymentCreation() in every code path. The SDK never times out the decision. It logs a warning after 5 seconds, and the payment hangs until you call it.
continuePaymentCreation accepts an optional { idempotencyKey } parameter. When provided, this key is sent with the payment request to prevent duplicate payments from being created. See the Events Reference for the full type definition.
primer:payment-start is for client-side checks that resolve in the browser. If you need a server-side decision (running a fraud check or inventory validation on your backend before the payment is created), use the Manual payment approval flow, which pauses on the primer:payment-approval-required event until your backend approves or aborts the attempt.
If your integration supports saved (vaulted) payment methods, additional events become relevant.
Web
Android
iOS
primer:vault-methods-update — fires when vaulted payment methods are loaded or when the vault state changes. Use it to render saved cards, show a “Pay with saved card” section, or determine whether CVV re-entry is required.
primer:vault-selection-change — fires when the user selects or deselects a saved method. Use it to enable or disable your submit button, or to toggle between “pay with saved card” and “pay with new card” views.
let cvvRequired = false;checkout.addEventListener('primer:vault-methods-update', (event) => { const { vaultedPayments, cvvRecapture } = event.detail; cvvRequired = cvvRecapture; const savedMethodsSection = document.getElementById('saved-methods'); if (vaultedPayments.length > 0) { savedMethodsSection.hidden = false; renderSavedMethodsList(vaultedPayments); } else { savedMethodsSection.hidden = true; }});checkout.addEventListener('primer:vault-selection-change', (event) => { const { paymentMethodId } = event.detail; const vaultSubmitBtn = document.getElementById('vault-pay-button'); // Enable the button only when a method is selected vaultSubmitBtn.disabled = !paymentMethodId; // If CVV re-entry is required, show the CVV input when a method is selected if (paymentMethodId && cvvRequired) { showCvvInput(paymentMethodId); }});
For full headless vault implementation, including primer.vault.createCvvInput(), primer.vault.startPayment(), and primer.vault.delete() see the Headless Vault Guide.
Vaulted payment methods are managed by the PrimerVaultedPaymentMethods component and rememberVaultedPaymentMethodsController():
val vaultController = rememberVaultedPaymentMethodsController()
The SDK provides built-in UI for displaying and selecting saved payment methods within PrimerCheckoutSheet.
Saved methods are rendered by the PrimerVaultedPaymentMethods view, backed by the same PrimerSelectionSession. Read the published vaultedPaymentMethods for the list, keep the highlight in your own view state, and call selectVaulted(_:) from your pay button. It is the pay verb, not a selection verb:
struct SavedMethodList: View { @ObservedObject var session: PrimerSelectionSession @State private var highlighted: String? var body: some View { VStack(alignment: .leading, spacing: 8) { ForEach(session.vaultedPaymentMethods, id: \.id) { method in Button(method.paymentMethodType) { highlighted = method.id } } Button("Pay") { guard let method = session.vaultedPaymentMethods .first(where: { $0.id == highlighted }) else { return } session.selectVaulted(method) } } }}
A card that needs CVV recapture raises the CVV recapture screen on submit, and that screen finishes the payment.Call try await session.delete(_:) to remove a saved method — it deletes immediately, with no confirmation step — and session.showAll() to present the SDK’s saved-methods screen, where the customer can switch methods or delete one. The default header of PrimerVaultedPaymentMethods already wires showAll() in.
Events not firing? Confirm the <primer-checkout> element is in the DOM before you add listeners. In SPAs, race conditions between route rendering and listener attachment are the most common cause.
Shadow DOM boundary issues? Triggerable events (primer:card-submit, primer:vault-submit) must be dispatched with bubbles: true and composed: true or they won’t reach the internal form component.
Stale data after a cart change? Call primer.refreshSession() to sync the client-side SDK with your server session. The SDK will re-dispatch primer:methods-update with the updated method list.
State not updating? Make sure you’re using collectAsStateWithLifecycle() instead of collectAsState().
Outcomes not received? Ensure you’re observing checkout.state and handling the terminal PrimerCheckoutState.Success and PrimerCheckoutState.Failure cases.
Stale data after a cart change? Call checkout.refresh() to reinitialize the checkout.
Log diagnostics IDs. Every PrimerError includes a diagnosticsId. Log it for troubleshooting with Primer support.
State not updating? Observe the session with @ObservedObject (or hold PrimerCheckoutSession as a @StateObject) so SwiftUI re-renders when its published properties change. These are phase and clientSession on PrimerCheckoutSession, state on PrimerCardFormSession, and state and vaultedPaymentMethods on PrimerSelectionSession.
onCompletion not firing? It fires for .success, .failure and .dismissed. Read PrimerCheckoutSession.phase to follow .initializing and .ready.
Composable views not rendering? Make sure the .primerCheckoutSession(_:theme:onCompletion:) modifier is applied above PrimerCardForm / PrimerPaymentMethods in the hierarchy. Without it, they cannot resolve a session from the environment.
Child sessions are nil?PrimerCheckoutSession.cardForm and .selection are non-nil only once phase == .ready.
Log diagnostics IDs. Every PrimerError includes a diagnosticsId. Log it for troubleshooting with Primer support.
Every Web event name, payload type, callback signature, and instance method
Android SDK reference
Android SDK API documentation
iOS SDK reference
iOS SDK API documentation
Recipes
Use-case driven examples for common integration scenarios
Error handling
Deep dive into error handling, retries, and failure recovery
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Primer","description":"Learn how to connect, build, and scale with Primer. Our docs offer clear guides and technical references to help you get more from our unified payments infrastructure.","colors":{"primary":"#FF7C4F","light":"#FF7C4F","dark":"#1b1a1a"},"logo":{"light":"https://mintcdn.com/primer-cc826789/fMxS38v0lFyMKyzD/logo/primer_logo.svg?fit=max\u0026auto=format\u0026n=fMxS38v0lFyMKyzD\u0026q=85\u0026s=0010b4ac2a8a90e656efd18fb57c9366","dark":"https://mintcdn.com/primer-cc826789/fMxS38v0lFyMKyzD/logo/primer_logo.svg?fit=max\u0026auto=format\u0026n=fMxS38v0lFyMKyzD\u0026q=85\u0026s=0010b4ac2a8a90e656efd18fb57c9366","href":"https://primer.io/docs"},"favicon":"https://mintcdn.com/primer-cc826789/fMxS38v0lFyMKyzD/logo/primer_logo.svg?fit=max\u0026auto=format\u0026n=fMxS38v0lFyMKyzD\u0026q=85\u0026s=0010b4ac2a8a90e656efd18fb57c9366","appearance":{"default":"light"},"background":{"decoration":"grid","color":{"light":"#ffffff"}},"navbar":{"links":[{"href":"https://primer.io/contact-us","label":"Contact Sales"}],"primary":{"type":"button","label":"Contact support","href":"https://portal.support.primer.io/servicedesk/customer/portal/11"}},"footer":{"socials":{"youtube":"https://www.youtube.com/channel/UCblj8Ya4PGjRbKVXmVwKyeQ","linkedin":"https://www.linkedin.com/company/primerapi","website":"https://primer.io/"}},"styling":{"eyebrows":"breadcrumbs","codeblocks":"dark","latex":false},"integrations":{"gtm":{"tagId":"GTM-NW2HXNZC"},"cookies":{"key":"ANALYTICS_CONSENT","value":"yes"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"primer-cc826789","hasAudioNarration":false,"actualSubdomain":"primer-cc826789","customDomains":["primer.io"],"gitSource":{"type":"gitlab","owner":"primer-io/general","repo":"public-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"projectId":69511232,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aedeceee38f903348a1bd08","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"SDK Reference","count":256},{"language":"default","tag":"Payment methods","count":242},{"language":"default","tag":"Documentation","count":171},{"language":"default","tag":"API reference","count":164},{"language":"default","tag":"API Reference","count":158},{"language":"default","tag":"Legacy SDKs","count":139},{"language":"default","tag":"Connections","count":129},{"language":"default","tag":"Checkout","count":118},{"language":"default","tag":"PrimerHeadlessUniversalCheckout","count":77},{"language":"default","tag":"iOS","count":58}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"css/colorCard.css","content":".color_card{display:block;max-width:268px;border-radius:16px;text-decoration:none;color:#1c1c1c;margin:1rem 0;background-color:#fffbeb;border:none!important;transition:transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out}.color_card:hover{transform:translateY(-5px);box-shadow:0 10px 20px rgba(0, 0, 0, 0.1);border:none!important}.color_card-visual{display:flex;justify-content:center;align-items:center}.color_card-image{max-width:100%;height:auto;border-radius:16px 16px 0 0;margin:0}.color_card-text-content{text-align:start;padding:1.5rem}.color_card-title{font-size:1rem;font-weight:600;margin:0 0 0.5rem 0}.color_card-description{font-size:1rem;line-height:1.6;margin:0;color:#796262!important;font-weight:400!important}.dark .color_card-description{color:#9B7A7A!important}.color_card-description p{margin:0}.dark .horizontal_color_card h2{color:#FFFFFF}.color_card.yellow,.horizontal_card.yellow,.icon-container.yellow{background-color:#FFEDE6}.dark .color_card.yellow,.dark .horizontal_card.yellow,.dark .icon-container.yellow{background-color:#381000}.color_card.purple,.horizontal_card.purple,.icon-container.purple{background-color:#FFEDE6}.dark .color_card.purple,.dark .horizontal_card.purple,.dark .icon-container.purple{background-color:#381000}.color_card.red,.horizontal_card.red,.icon-container.red{background-color:#FFEDE6}.dark .color_card.red,.dark .horizontal_card.red,.dark .icon-container.red{background-color:#381000}.color_card.lilac,.horizontal_card.lilac,.icon-container.lilac{background-color:#FFEDE6}.dark .color_card.lilac,.dark .horizontal_card.lilac,.dark .icon-container.lilac{background-color:#381000}.color_card.pink,.horizontal_card.pink,.icon-container.pink{background-color:#FFEDE6}.dark .color_card.pink,.dark .horizontal_card.pink,.dark .icon-container.pink{background-color:#381000}.color_card.green,.horizontal_card.green,.icon-container.green{background-color:#FFEDE6}.dark .color_card.green,.dark .horizontal_card.green,.dark .icon-container.green{background-color:#381000}.color_card.blue,.horizontal_card.blue,.icon-container.blue{background-color:#FFEDE6}.dark .color_card.blue,.dark .horizontal_card.blue,.dark .icon-container.blue{background-color:#381000}"},{"filePath":"css/home.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7SUc.woff2) format('woff2');\n unicode-range: U+1F00-1FFF;\n}\n/* greek */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7SUc.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7SUc.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 700;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/inter/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nbody{font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;min-height:100vh;transition:all 0.3s ease}body{background:white}body.dark{background:#000000}.hero-section{text-align:center;position:relative;padding:6.5rem 20px 160px 20px;min-height:400px;display:flex;align-items:center;justify-content:center;background:#f8fafc}@media (max-width: 768px){.hero-section{padding:60px 16px 160px 16px;min-height:300px}}.dark .hero-section{background:#111827}.hero-banner{width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;z-index:1}.hero-content{position:relative;z-index:2;padding:0 20px;max-width:1200px;margin:0 auto}.hero-content h1{font-family:\"Inter Display\", \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;font-size:4rem;max-width:1000px;font-weight:600;margin-bottom:2.5rem;letter-spacing:-1px;line-height:4.5rem;color:#212121}@media (max-width: 768px){.hero-content h1{font-size:2.5rem;margin-bottom:1rem;letter-spacing:-.075rem;line-height:2.8rem}}.dark .hero-content h1{color:#ffffff}.hero-content p{font-size:1rem;line-height:1.4375rem;font-weight:400;color:black;max-width:620px;margin:0 auto;padding:0 16px}@media (max-width: 768px){.hero-content p{font-size:0.9rem;line-height:1.5}}.dark .hero-content p{color:#d1d5db}.features-section{position:relative;margin-top:-100px;padding:0 20px 80px 20px;z-index:10}.features-grid{display:grid;grid-template-columns:repeat(3, 1fr);gap:24px;max-width:860px;margin:0 auto}.features-grid .card h2{font-weight:600!important}.features-grid .card{background:white;border-radius:16px;overflow:hidden;border:1px solid #e5e7eb;box-shadow:0 4px 20px rgba(0, 0, 0, 0.08);transition:all 0.3s ease;margin:0}.dark .features-grid .card{background-color:rgb(28 28 28);border-color:#424242;box-shadow:0 4px 20px rgba(0, 0, 0, 0.3)}.features-grid .card:hover{transform:translateY(-4px);box-shadow:0 8px 30px rgba(0, 0, 0, 0.12)}.dark .features-grid .card:hover{box-shadow:0 8px 30px rgba(0, 0, 0, 0.4)}.feature-image{width:100%;height:200px;object-fit:cover}.feature-content{padding:24px;height:140px;display:flex;flex-direction:column;justify-content:flex-start}.feature-card h3{font-size:1.25rem;font-weight:600;color:#1a1a1a;margin-bottom:8px;transition:color 0.3s ease}.dark .feature-card h3{color:white}.feature-card p{font-size:0.95rem;color:#6b7280;line-height:1.5;transition:color 0.3s ease}.dark .feature-card p{color:#9ca3af}@media (max-width: 768px){.features-grid{grid-template-columns:1fr;gap:20px}.hero{padding:60px 16px 150px 16px}.features-section{margin-top:-80px;padding:0 16px 60px 16px}.theme-toggle{top:20px;right:20px;padding:10px 16px;font-size:14px}}@media (max-width: 1024px) and (min-width: 769px){.features-grid{grid-template-columns:repeat(2, 1fr)}}.build-with-ai-cta{display:inline-flex;align-items:center;gap:0.5rem;margin-top:2rem;padding:15px 20px;border:1px solid #FF7C4F!important;border-radius:9999px;background:#FF7C4F;color:#230800!important;font-size:1rem;font-weight:600;line-height:1;text-decoration:none!important;transition:color 0.3s, background 0.3s, border 0.3s}.build-with-ai-cta:hover{border-color:#230800!important;background:#230800;color:#F9F3EE!important}.build-with-ai-cta__icon{position:relative;display:inline-flex;overflow:hidden}.build-with-ai-cta__arrow{display:flex;transform:translateX(0%);transition:transform 0.5s cubic-bezier(0.6, 0.6, 0, 1) 0.1s}.build-with-ai-cta__arrow--in{position:absolute;inset:0;transform:translateX(-100%);transition:transform 0.5s cubic-bezier(0.6, 0.6, 0, 1)}.build-with-ai-cta:hover .build-with-ai-cta__arrow{transform:translateX(100%);transition:transform 0.5s cubic-bezier(0.6, 0.6, 0, 1)}.build-with-ai-cta:hover .build-with-ai-cta__arrow--in{transform:translateX(0%);transition:transform 0.5s cubic-bezier(0.6, 0.6, 0, 1) 0.1s}"},{"filePath":"css/horizontalCard.css","content":".horizontal_card{display:flex;border-radius:2px;overflow:hidden;margin:1rem 0;border:1px solid #110f0e1a;margin-top:20px;border-radius:8px;transition:border-color 0.2s ease}a.horizontal_card:hover,.dark a.horizontal_card:hover{border-color:#FF7C4F}.dark .horizontal_card{border-color:#ffffff1a}.horizontal_card .card-image-container{flex:1;min-width:45%}.horizontal_card .card-image-container img{width:100%;height:100%;border-radius:0;object-fit:cover;margin:0!important}.horizontal_card .card-content-container{flex:2;padding:40px 24px;display:flex;flex-direction:column}.horizontal_card .card-title{margin:0 0 0.75rem 0;font-size:1rem;font-weight:500;letter-spacing:0.01rem}.horizontal_card .card-description{font-size:1rem;line-height:1.5;flex-grow:1;font-weight:350}.horizontal_card .card-description p{margin:0;font-weight:350}.horizontal_card .card-link{margin-top:1rem;text-decoration:none;transition:color 0.2s ease-in-out;border:none;max-width:fit-content;font-weight:500}.horizontal_card .card-link:hover{text-decoration:underline}@media (max-width: 768px){.horizontal_card{flex-direction:column}.horizontal_card .card-image-container{min-width:100%}.horizontal_card .card-content-container{padding:20px 16px}}"},{"filePath":"css/horizontalColorCard.css","content":""},{"filePath":"css/iconCard.css","content":".icon-title-card{display:inline-flex;flex-direction:column;align-items:center;text-decoration:none;margin:0 auto}.icon-container svg{width:32px;height:32px;color:#5b21b6}.item-title{font-weight:500;text-align:center;margin:0;font-size:0.9rem}.icon-container{width:50px;height:50px;border-radius:50%;background-color:#ede9fe;margin-bottom:1rem;display:flex;justify-content:center;align-items:center}.dark .icon-container{background-color:#4c1d95}.icon-container svg{width:24px;height:24px;color:#000}.dark .icon-container svg{color:#fff}"},{"filePath":"css/logoCarousel.css","content":"@keyframes scroll{0%{transform:translateX(0)}100%{transform:translateX(-50%)}}.logo-carousel-container{padding:2rem 0;border:1px solid #110f0e1a;border-radius:2px;margin-top:20px}.dark .logo-carousel-container{border-color:#333}.carousel-title{font-size:1.25rem;font-weight:500;margin-bottom:2rem;margin-top:1.5rem;padding:0 2rem}.logo-carousel-scroller{overflow:hidden;position:relative}.logo-track{display:flex;width:calc(200px * var(--logo-count));animation:scroll 12s linear infinite}.logo-track a{text-decoration:none;color:inherit;border:none}.logo-item{width:100px;height:80px;display:flex;justify-content:center;align-items:center;flex-shrink:0;transition:transform 0.2s ease}.logo-item:hover{transform:scale(1.1)}.logo-item svg{max-width:100%;max-height:56px;opacity:0.95;transition:opacity 0.2s ease;border-radius:8px}.logo-item:hover svg{opacity:1}.explore-link{display:block;width:fit-content;margin-left:2rem;margin-top:1.5rem;margin-bottom:0;font-size:1rem;font-weight:500;color:#333;text-decoration:underline;transition:color 0.2s ease;border-bottom:none!important}.dark .explore-link{color:#eee}.explore-link:hover{color:#e88178}"},{"filePath":"css/style.css","content":"@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700\u0026family=Inter+Display:wght@400;500;600;700\u0026display=swap\");@import url(\"./filterableTable.css\");div.card .prose a.link{color:#007bff;text-decoration:underline;font-weight:500}div.card .prose a.link:visited{color:#551a8b}div.card .prose a.link:hover{color:#0056b3;text-decoration:underline}.prose :where(code):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)){color:red;font-family:\"Roboto Mono\", monospace;font-size:13px;font-weight:300;line-height:inherit!important}.overview_cards_container .card{max-width:269px!important}.card-group{justify-items:baseline}.dark .group img{background-color:transparent!important}.param-head{div[data-component-part=\"field-name\"] {\n color: #000 !important;\n }}.dark .param-head{div[data-component-part=\"field-name\"] {\n color: #fff !important;\n }}h1,h2,h3,h4,h5,h6{font-weight:600!important;font-family:\"Inter Display\", \"Inter\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif}.block.absolute.inset-0.overflow-hidden{background:none!important}.banner_img_cover{border-radius:8px}table th{text-align:left!important}.color-value{display:flex;align-items:center;justify-content:space-between;gap:6px}.color-swatch{width:14px;height:14px;border-radius:3px;flex-shrink:0}.color-swatch--bordered{border:1px solid #E0E0E0}.tokens-grid table{width:100%}.tokens-grid td:first-child{width:120px}.tokens-grid td:last-child code{font-size:12px;white-space:nowrap}.token-swatch{display:inline-block;width:48px;height:48px;border-radius:6px;vertical-align:middle}.token-radius{display:inline-block;width:48px;height:48px;background-color:#E0E0E0;vertical-align:middle;margin-right:8px}.token-space{display:inline-block;height:24px;background-color:#2f98ff;border-radius:2px;vertical-align:middle;margin-right:8px;min-width:2px}.token-size{display:inline-block;background-color:#2f98ff;border-radius:4px;vertical-align:middle;margin-right:8px}.token-width{display:inline-block;width:48px;height:32px;background-color:#ffffff;border:solid #212121;border-radius:4px;vertical-align:middle;margin-right:8px}.token-typography-preview{padding:16px;background-color:#f5f5f5;border-radius:8px;margin:12px 0 24px 0;font-family:-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif}.dark .token-typography-preview{background-color:#2a2a2a}.token-animation-preview{padding:24px;background-color:#f5f5f5;border-radius:8px;display:flex;align-items:center;gap:16px}.dark .token-animation-preview{background-color:#2a2a2a}.animation-demo{width:48px;height:48px;background-color:#2f98ff;border-radius:8px;transition:transform 200ms cubic-bezier(0.44, 0, 0.4, 1)}.animation-demo:hover{transform:scale(1.2)}.phase-timeline-circle{background-color:#fff}.dark .phase-timeline-circle{background-color:#0e0b0c}"},{"filePath":"css/filterableTable.css","content":".filterable-table-container{width:100%;max-width:100%;margin:0 0 1.5rem 0!important}div:has(>.filterable-table-container){margin-top:0!important}.filterable-table-container *,.filterable-table-container *::before,.filterable-table-container *::after{box-sizing:border-box}.filterable-table-controls{display:flex;flex-direction:column;gap:1rem;margin-bottom:1rem}@media (min-width: 768px){.filterable-table-controls{flex-direction:row;align-items:center;justify-content:space-between}}.filterable-table-search{flex:1;max-width:400px}.filterable-table-search-input{width:100%;padding:0.625rem 1rem;border:1px solid #e5e7eb;border-radius:8px;font-size:0.875rem;background-color:#fff;color:#1f2937;transition:border-color 0.2s ease, box-shadow 0.2s ease}.filterable-table-search-input:focus{outline:none;border-color:#FF7C4F;box-shadow:0 0 0 3px rgba(255, 124, 79, 0.1)}.filterable-table-search-input::placeholder{color:#9ca3af}.dark .filterable-table-search-input{background-color:#1f2937;border-color:#374151;color:#f9fafb}.dark .filterable-table-search-input:focus{border-color:#FF7C4F;box-shadow:0 0 0 3px rgba(255, 124, 79, 0.2)}.dark .filterable-table-search-input::placeholder{color:#6b7280}.filterable-table-filters{display:flex;flex-wrap:wrap;gap:0.75rem;align-items:center}.filterable-table-select{padding:0.625rem 2rem 0.625rem 1rem;border:1px solid #e5e7eb;border-radius:8px;font-size:0.875rem;background-color:#fff;color:#1f2937;cursor:pointer;appearance:none;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right 0.75rem center;transition:border-color 0.2s ease}.filterable-table-select:focus{outline:none;border-color:#FF7C4F}.dark .filterable-table-select{background-color:#1f2937;border-color:#374151;color:#f9fafb;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E\")}.dark .filterable-table-select:focus{border-color:#FF7C4F}.filterable-table-clear-btn{padding:0.625rem 1rem;border:none;border-radius:8px;font-size:0.875rem;background-color:#fee2e2;color:#b91c1c;cursor:pointer;transition:background-color 0.2s ease}.filterable-table-clear-btn:hover{background-color:#fecaca}.dark .filterable-table-clear-btn{background-color:#450a0a;color:#fca5a5}.dark .filterable-table-clear-btn:hover{background-color:#7f1d1d}.filterable-table-results-count{font-size:0.875rem;color:#6b7280;margin-bottom:0.75rem}.dark .filterable-table-results-count{color:#9ca3af}.filterable-table-wrapper{overflow:hidden;border-radius:8px;border:1px solid #e5e7eb}.dark .filterable-table-wrapper{border-color:#374151}table.filterable-table{width:100%;border-collapse:collapse;border-spacing:0;font-size:0.875rem;table-layout:auto;margin:0;padding:0;border:none}table.filterable-table thead{background-color:#f9fafb}.dark table.filterable-table thead{background-color:#1f2937}table.filterable-table th{padding:0.75rem 1rem;text-align:left;font-weight:600;color:#374151;border:none;border-bottom:1px solid #e5e7eb;white-space:nowrap;background-color:#f9fafb}.dark table.filterable-table th{color:#e5e7eb;border-bottom-color:#374151;background-color:#1f2937}table.filterable-table td{padding:0.75rem 1rem;color:#4b5563;border:none;border-bottom:1px solid #e5e7eb;vertical-align:top;background-color:#fff}.dark table.filterable-table td{background-color:#111827;color:#d1d5db;border-bottom-color:#374151}table.filterable-table tbody tr:hover td{background-color:#f3f4f6}.dark table.filterable-table tbody tr:hover td{background-color:#1f2937}table.filterable-table tbody tr:last-child td{border-bottom:none}table.filterable-table th:first-child,table.filterable-table td:first-child{padding-left:1.25rem}table.filterable-table th:last-child,table.filterable-table td:last-child{padding-right:1.25rem}table.filterable-table code{font-size:0.8125rem;padding:0.125rem 0.375rem;border-radius:4px;background-color:#f3f4f6;color:#1f2937;font-family:ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace}.dark table.filterable-table code{background-color:#374151;color:#e5e7eb}.filterable-table-compatibility{font-size:0.8125rem;line-height:1.75}.filterable-table-no-results{text-align:center;padding:2rem 1rem;color:#6b7280}.dark .filterable-table-no-results{color:#9ca3af}"},{"filePath":"css/componentTree.css","content":".component-tree-container{border-radius:8px;padding:20px;border:1px solid #e5e7eb}.component-tree-connector{color:#9ca3af;user-select:none}.component-tree-name{font-weight:500;color:#111827}.component-tree-goes-into{margin-left:10px;padding:2px 8px;border-radius:4px;background-color:#f3f4f6;color:#6b7280;font-size:11px;font-weight:400}.component-tree-slot{margin-left:8px;padding:2px 8px;border-radius:4px;background-color:#dbeafe;color:#1d4ed8;font-size:11px;font-weight:500}.component-tree-note{margin-left:10px;color:#6b7280;font-size:12px;font-style:italic}.component-tree-legend{display:flex;align-items:center;gap:20px;padding-top:16px;margin-top:16px;border-top:1px solid #e5e7eb;font-size:12px;color:#6b7280}.dark .component-tree-container{border-color:#374151}.dark .component-tree-connector{color:#6b7280}.dark .component-tree-name{color:#f9fafb}.dark .component-tree-goes-into{background-color:#374151;color:#d1d5db}.dark .component-tree-slot{background-color:#1e3a8a;color:#93c5fd}.dark .component-tree-note{color:#9ca3af}.dark .component-tree-legend{border-top-color:#374151;color:#9ca3af}"},{"filePath":"css/designSystem.css","content":":root{--ds-color-brand: #2f98ff;--ds-color-brand-light: #e8f2ff;--ds-color-brand-muted: rgba(47, 152, 255, 0.12);--ds-color-success: #1a8a5c;--ds-color-success-light: #edf8f2;--ds-color-success-muted: rgba(26, 138, 92, 0.12);--ds-color-warning: #c47a20;--ds-color-warning-light: #fef6eb;--ds-color-warning-muted: rgba(196, 122, 32, 0.12);--ds-color-error: #c44040;--ds-color-error-light: #fef0f0;--ds-color-text: #1c1b18;--ds-color-text-secondary: #5c5953;--ds-color-text-muted: #9d9a92;--ds-color-border: #e4e2dd;--ds-color-border-hover: #d0cec8;--ds-color-bg-page: #f5f4f1;--ds-color-bg-surface: #ffffff;--ds-color-bg-subtle: #fafaf8}.dark{--ds-color-brand: #60a5fa;--ds-color-brand-light: #1e3a8a;--ds-color-brand-muted: rgba(96, 165, 250, 0.15);--ds-color-success: #34d399;--ds-color-success-light: #064e3b;--ds-color-success-muted: rgba(52, 211, 153, 0.15);--ds-color-warning: #fbbf24;--ds-color-warning-light: #78350f;--ds-color-warning-muted: rgba(251, 191, 36, 0.15);--ds-color-error: #f87171;--ds-color-error-light: #7f1d1d;--ds-color-text: #f3f4f6;--ds-color-text-secondary: #d1d5db;--ds-color-text-muted: #9ca3af;--ds-color-border: #374151;--ds-color-border-hover: #4b5563;--ds-color-bg-page: #0a0a0a;--ds-color-bg-surface: #111827;--ds-color-bg-subtle: #1f2937}.ds-token-row-btn{display:block;width:100%;padding:12px;border:none;border-bottom:1px solid var(--ds-color-bg-subtle);background:var(--ds-color-bg-surface);cursor:pointer;text-align:left;transition:background 120ms ease}.ds-token-row-btn:last-child{border-bottom:none}.ds-token-row-btn:hover{background:var(--ds-color-bg-subtle)}.ds-token-row-btn.selected{background:var(--ds-color-brand-light)}.ds-token-row-name{font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-size:11px;color:var(--ds-color-text);font-weight:500}.ds-token-row-value{font-size:11px;color:var(--ds-color-text-muted);margin-top:2px;display:flex;justify-content:space-between;align-items:center}.ds-token-color-swatch{display:inline-flex;align-items:center;gap:4px}.ds-token-color-box{width:12px;height:12px;border-radius:2px;border:1px solid var(--ds-color-border)}.ds-mode-toggle-group{display:inline-flex;background:var(--ds-color-bg-subtle);border-radius:8px;padding:3px;border:1px solid var(--ds-color-border)}.ds-mode-toggle-btn{padding:8px 14px;border:none;border-radius:6px;background:transparent;color:var(--ds-color-text-muted);font-weight:500;font-size:12px;cursor:pointer;transition:all 120ms ease}.ds-mode-toggle-btn.active{background:var(--ds-color-bg-surface);color:var(--ds-color-text);box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.ds-category-pills{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:12px}.ds-category-pill{padding:5px 10px;border:none;border-radius:6px;background:var(--ds-color-bg-subtle);color:var(--ds-color-text-secondary);font-size:11px;font-weight:500;cursor:pointer;text-transform:capitalize;transition:all 120ms ease}.ds-category-pill.active{background:var(--ds-color-brand);color:#fff}.ds-tree-item{border-radius:8px;padding:10px 12px;margin:4px 0;cursor:pointer;transition:all 120ms ease;background:var(--ds-color-bg-subtle);border:2px solid var(--ds-color-border)}.ds-tree-item.depth-2{padding:6px 8px}.ds-tree-item.selected{background:var(--ds-color-warning-light);border-color:var(--ds-color-warning);box-shadow:0 0 0 3px rgba(196, 122, 32, 0.1)}.ds-tree-item.highlighted{background:var(--ds-color-success-light);border-color:var(--ds-color-success);box-shadow:0 0 0 3px rgba(26, 138, 92, 0.1)}.ds-tree-item.default{cursor:default}.ds-tree-item-label{font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-weight:600;font-size:12px;color:var(--ds-color-text-secondary);display:flex;align-items:center;gap:8px}.ds-tree-item.depth-2 .ds-tree-item-label{font-size:11px}.ds-tree-item.selected .ds-tree-item-label{color:var(--ds-color-warning)}.ds-tree-item.highlighted .ds-tree-item-label{color:var(--ds-color-success)}.ds-tree-item-children{margin-top:8px}.ds-highlight-wrapper{position:relative;border-radius:inherit}.ds-highlight-overlay{position:absolute;inset:-2px;border:2px solid var(--ds-color-success);border-radius:inherit;background:var(--ds-color-success-muted);pointer-events:none;transition:all 200ms ease}.ds-control-panel{display:flex;gap:8px;align-items:center;margin-bottom:16px;flex-wrap:wrap}.ds-reset-btn{padding:8px 12px;border:1px solid rgba(196, 64, 64, 0.4);border-radius:4px;background:var(--ds-color-bg-surface);color:var(--ds-color-error);font-size:12px;cursor:pointer}.ds-token-editor{margin-top:16px;padding:12px;background:var(--ds-color-bg-subtle);border-radius:8px;border:1px solid var(--ds-color-border)}.ds-token-editor-label{font-size:10px;font-weight:700;color:var(--ds-color-text-muted);text-transform:uppercase;letter-spacing:0.5px;margin-bottom:10px}.ds-token-editor-affects{margin-top:10px;font-size:10px;color:var(--ds-color-text-muted)}.ds-token-editor-affects-item{font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;color:var(--ds-color-success)}.ds-component-selector{padding:12px}.ds-component-selector-empty{color:var(--ds-color-text-muted);font-size:12px;font-style:italic}.ds-component-selector-title{font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-size:14px;font-weight:600;margin-bottom:12px}.ds-component-token-item{padding:10px;background:var(--ds-color-bg-subtle);border-radius:4px;margin-bottom:8px}.ds-component-token-name{font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;font-size:11px;font-weight:500;margin-bottom:8px;color:var(--ds-color-text)}.ds-main-grid{display:grid;grid-template-columns:260px 1fr;gap:20px}.ds-preview-section{display:flex;flex-direction:column;gap:16px}.ds-preview-card{padding:20px;background:var(--ds-color-bg-page);border-radius:0 0 12px 12px}.ds-legend{display:flex;gap:16px;font-size:11px;color:var(--ds-color-text-muted)}.ds-legend-item{display:flex;align-items:center;gap:8px}.ds-legend-box{width:14px;height:14px;border-radius:4px}.ds-legend-box.affected{background:var(--ds-color-success-light);border:2px solid var(--ds-color-success)}.ds-legend-box.selected{background:var(--ds-color-warning-light);border:2px solid var(--ds-color-warning)}.ds-preview-label{display:block;font-weight:500}.ds-preview-input{background:var(--ds-color-bg-surface)}"},{"filePath":"css/stylingVariables.css","content":".token-swatch{display:inline-block;width:24px;height:24px;border-radius:4px;border:1px solid #e0e0e0;vertical-align:middle}.dark .token-swatch{border-color:#4b5563}.token-radius{display:inline-block;width:32px;height:32px;background:#2f98ff;vertical-align:middle}.dark .token-radius{background:#60a5fa}.token-space{display:inline-block;height:24px;background:#2f98ff;vertical-align:middle}.dark .token-space{background:#60a5fa}.tokens-grid{margin:1rem 0}.tokens-grid table{width:100%}.tokens-grid td:first-child{width:100px}"},{"filePath":"css/themeBuilder.css","content":".theme-builder-container{border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;background:#fafafa}.theme-builder-header{background:white;padding:16px 20px;border-bottom:1px solid #e5e7eb}.theme-builder-title{margin:0 0 12px 0;font-size:16px;font-weight:600;color:#1a1a1a}.theme-builder-presets{display:flex;flex-wrap:wrap;gap:8px}.theme-builder-preset-btn{padding:6px 12px;border:1px solid #e5e7eb;border-radius:6px;background:white;color:#1a1a1a;cursor:pointer;font-size:13px;font-weight:500}.theme-builder-preset-btn.active{border:2px solid #2f98ff;background:#eff6ff;color:#2f98ff}.theme-builder-grid{display:grid;grid-template-columns:1fr 1fr;min-height:500px}.theme-builder-tokens{border-right:1px solid #e5e7eb;background:white;overflow:auto;max-height:600px}.theme-builder-group{border-bottom:1px solid #e5e7eb}.theme-builder-group-header{width:100%;padding:12px 16px;background:none;border:none;display:flex;justify-content:space-between;align-items:center;cursor:pointer;font-size:14px;font-weight:600;color:#1a1a1a}.theme-builder-group-content{padding:0 16px 16px}.theme-builder-token-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-top:1px solid #f3f4f6}.theme-builder-token-label{font-size:13px;color:#4b5563}.theme-builder-preview-panel{padding:20px;background:#f8f9fa;transition:background 200ms ease}.theme-builder-preview-panel.dark-bg{background:#0f0f0f}.theme-builder-preview-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.theme-builder-preview-label{font-size:14px;font-weight:600;color:#1a1a1a}.theme-builder-theme-toggle{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid #e5e7eb;border-radius:6px;background:white;color:#6b7280;cursor:pointer;font-size:11px;font-weight:500}.theme-builder-theme-toggle.dark{border-color:#374151;background:#1f2937;color:#e5e7eb}.code-preview-container{margin-top:16px;border-radius:8px;overflow:hidden;border:1px solid #e5e7eb}.code-preview-header{display:flex;align-items:center;justify-content:space-between;background:#f8f9fa;border-bottom:1px solid #e5e7eb;padding:0 12px}.code-preview-tabs{display:flex;gap:0}.code-preview-tab{padding:10px 16px;background:transparent;border:none;border-bottom:2px solid transparent;color:#6b7280;cursor:pointer;font-size:13px;font-weight:500;font-family:monospace}.code-preview-tab.active{border-bottom-color:#2f98ff;color:#2f98ff}.code-preview-copy-btn{display:flex;align-items:center;gap:6px;padding:6px 10px;background:transparent;border:1px solid #e5e7eb;border-radius:6px;color:#6b7280;cursor:pointer;font-size:12px;font-weight:500;transition:all 150ms ease}.code-preview-copy-btn.copied{background:#dcfce7;border-color:#86efac;color:#16a34a}.code-preview-code{background:#1a1a1a;color:#e5e7eb;padding:16px;margin:0;overflow:auto;font-size:12px;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;max-height:280px;line-height:1.5}.theme-builder-input-text{padding:6px 8px;border:1px solid #e5e7eb;border-radius:4px;font-size:12px;background:white;color:#1a1a1a}.theme-builder-input-text.monospace{font-family:monospace}.dark .theme-builder-container{background:#1f2937;border-color:#374151}.dark .theme-builder-header{background:#111827;border-bottom-color:#374151}.dark .theme-builder-title{color:#f3f4f6}.dark .theme-builder-preset-btn{background:#1f2937;border-color:#4b5563;color:#e5e7eb}.dark .theme-builder-preset-btn.active{background:#1e3a8a;border-color:#3b82f6;color:#93c5fd}.dark .theme-builder-tokens{background:#111827;border-right-color:#374151}.dark .theme-builder-group{border-bottom-color:#374151}.dark .theme-builder-group-header{color:#f3f4f6}.dark .theme-builder-token-row{border-top-color:#374151}.dark .theme-builder-token-label{color:#9ca3af}.dark .theme-builder-preview-panel{background:#0a0a0a}.dark .theme-builder-preview-label{color:#f3f4f6}.dark .theme-builder-theme-toggle{background:#1f2937;border-color:#4b5563;color:#e5e7eb}.dark .code-preview-container{border-color:#374151}.dark .code-preview-header{background:#1f2937;border-bottom-color:#374151}.dark .code-preview-tab{color:#9ca3af}.dark .code-preview-tab.active{color:#60a5fa;border-bottom-color:#60a5fa}.dark .code-preview-copy-btn{background:#1f2937;border-color:#4b5563;color:#9ca3af}.dark .code-preview-copy-btn.copied{background:#064e3b;border-color:#059669;color:#6ee7b7}.dark .theme-builder-input-text{background:#1f2937;border-color:#4b5563;color:#e5e7eb}"}],"page":{"pagePath":"checkout/primer-checkout/configuration/events","slug":"/checkout/primer-checkout/configuration/events","pageMetadata":{"title":"Events guide","sidebarTitle":"Events","description":"When and how to use the `primer:*` DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.","href":"/checkout/primer-checkout/configuration/events"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"When and how to use the \", _jsx(_components.code, {\n children: \"primer:*\"\n }), \" DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Mermaid,Note,Tab,Table,Tabs,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This guide explains the event-driven model behind Primer Checkout and walks through the integration decisions you’ll face when wiring events into your application. It is organized around the questions you’ll encounter as you build: where to listen, what to set up first, and how to handle each phase of the payment lifecycle.`}),`\n`,_jsx(Tip,{title:`Guide vs Reference`,children:_jsxs(_components.p,{children:[`This guide focuses on `,_jsx(_components.strong,{children:`when and why`}),` to use each event. For the complete API surface, every event name, payload shape, type definition, and callback signature see the platform-specific SDK references.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`how-events-work`,children:`How events work`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Web`,id:`web`,children:_jsxs(_components.p,{children:[`Primer Checkout components dispatch `,_jsx(_components.a,{href:`https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent`,children:_jsx(_components.code,{children:`CustomEvent`})}),` objects. Every Primer event is created with `,_jsx(_components.code,{children:`bubbles: true`}),` and `,_jsx(_components.code,{children:`composed: true`}),`, which means events propagate up through shadow DOM boundaries and can be caught at any ancestor element, including `,_jsx(_components.code,{children:`document`}),`. This design gives you two choices for where to listen, covered in the next section.`]})}),_jsxs(Tab,{title:`Android`,id:`android`,children:[_jsx(_components.p,{children:`The Android SDK communicates through a single channel:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`State`}),` (`,_jsx(_components.code,{children:`PrimerCheckoutState`}),`): the full checkout lifecycle — loading, ready, and the terminal `,_jsx(_components.code,{children:`Success`}),`/`,_jsx(_components.code,{children:`Failure`}),` outcomes`]}),`\n`]}),_jsxs(_components.p,{children:[`State is a `,_jsx(_components.code,{children:`StateFlow\u003cPrimerCheckoutState>`}),` you observe in Compose via `,_jsx(_components.code,{children:`checkout.state`}),`. Payment outcomes are terminal cases of that same flow.`]})]}),_jsxs(Tab,{title:`iOS`,id:`ios`,children:[_jsx(_components.p,{children:`The iOS SDK communicates through two mechanisms:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Published session state`}),`: `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` publishes the lifecycle `,_jsx(_components.code,{children:`phase`}),` (`,_jsx(_components.code,{children:`.initializing`}),` / `,_jsx(_components.code,{children:`.ready`}),`) and `,_jsx(_components.code,{children:`clientSession`}),`. `,_jsx(_components.code,{children:`PrimerCardFormSession`}),` and `,_jsx(_components.code,{children:`PrimerSelectionSession`}),` publish `,_jsx(_components.code,{children:`state`}),` for field-level and selection progress`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`onCompletion callback`}),` (`,_jsx(_components.code,{children:`PrimerCheckoutState`}),`): Receives `,_jsx(_components.code,{children:`.failure`}),` once per failed attempt, including a failed initialization. Then it receives `,_jsx(_components.code,{children:`.success`}),` or `,_jsx(_components.code,{children:`.dismissed`}),` at most once. It never receives `,_jsx(_components.code,{children:`.initializing`}),` or `,_jsx(_components.code,{children:`.ready`}),`, so read those from `,_jsx(_components.code,{children:`phase`})]}),`\n`]}),_jsxs(_components.p,{children:[`For the managed modal, pass `,_jsx(_components.code,{children:`onCompletion`}),` to `,_jsx(_components.code,{children:`PrimerCheckout`}),`. For inline, composable UI, observe each session’s `,_jsx(_components.code,{children:`@Published`}),` state inside your SwiftUI views and receive the outcome through the `,_jsx(_components.code,{children:`.primerCheckoutSession(_:theme:onCompletion:)`}),` modifier. In UIKit, conform to `,_jsx(_components.code,{children:`PrimerCheckoutPresenterDelegate`}),`.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`choosing-where-to-listen`,children:`Choosing where to listen`}),`\n`,_jsx(_components.p,{children:`Each platform has its own mechanism for receiving SDK events and state changes.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-2`,\"data-child-tab-ids\":`[\"component-level\",\"document-level\"]`,\"data-child-heading-ids\":`[\"ensuring-the-component-exists\"]`,children:[_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Component Level`,id:`component-level`,children:[_jsxs(_components.p,{children:[`Attach listeners directly to the `,_jsx(_components.code,{children:`\u003cprimer-checkout>`}),` element. Each listener is scoped to a single checkout instance.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`querySelector`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer-checkout'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:ready'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // This listener only fires for this checkout instance`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` primer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` configureCallbacks`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`primer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Choose this when:`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You want to co-locate event logic with the component that owns it, such as inside a framework component’s lifecycle hook.`}),`\n`,_jsx(_components.li,{children:`You need to tear down listeners cleanly when a checkout is removed from the DOM.`}),`\n`]})]}),_jsxs(Tab,{title:`Document Level`,id:`document-level`,children:[_jsxs(_components.p,{children:[`Attach listeners to `,_jsx(_components.code,{children:`document`}),`. Because Primer events bubble and are composed, they reach the document root regardless of where the component sits in the DOM.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-success'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Fires when any Primer event bubbles up to document`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` analytics`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`track`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'payment_completed'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Choose this when:`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You have a single checkout per page and prefer centralized event handling.`}),`\n`,_jsx(_components.li,{children:`You’re building cross-cutting concerns like analytics, logging, or error monitoring.`}),`\n`,_jsx(_components.li,{children:`Your architecture already uses a global event bus pattern.`}),`\n`]})]})]}),_jsx(Heading,{level:`3`,id:`ensuring-the-component-exists`,children:`Ensuring the component exists`}),_jsx(_components.p,{children:`When using component-level listeners, make sure the element is in the DOM before attaching them. If your checkout renders dynamically (through a router transition, a conditional template, or lazy loading), the element may not exist at script-execution time.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// Safe: wait for the DOM to be ready before querying`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'DOMContentLoaded'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`querySelector`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer-checkout'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-success'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`handlePaymentSuccess`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-failure'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`handlePaymentFailure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`If your framework provides a lifecycle hook that runs after the component mounts (React’s `,_jsx(_components.code,{children:`useEffect`}),`, Vue’s `,_jsx(_components.code,{children:`onMounted`}),`, etc.), prefer that over `,_jsx(_components.code,{children:`DOMContentLoaded`}),`.`]})]}),_jsxs(Tab,{title:`Android`,id:`android-2`,\"data-child-heading-ids\":`[\"primercheckoutstate\",\"primerclientsession\"]`,children:[_jsxs(_components.p,{children:[`State — including the terminal `,_jsx(_components.code,{children:`Success`}),` and `,_jsx(_components.code,{children:`Failure`}),` outcomes — is observed from `,_jsx(_components.code,{children:`checkout.state`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`rememberPrimerCheckoutController`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(clientToken)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout.state.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`collectAsStateWithLifecycle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`when`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Loading `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` CircularProgressIndicator`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Ready `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` clientSession = (state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`as`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Ready).clientSession`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Total: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`checkout.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`formatAmount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(clientSession.totalAmount ?: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` PrimerCheckoutSheet`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(checkout = checkout)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(Heading,{level:`3`,id:`primercheckoutstate`,children:`PrimerCheckoutState`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Properties`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Loading`})}),_jsx(_components.td,{children:`SDK is initializing, fetching configuration`}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Ready`})}),_jsx(_components.td,{children:`Checkout is ready for payment`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`clientSession: PrimerClientSession`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Success`})}),_jsx(_components.td,{children:`Payment completed`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`checkoutData: PrimerCheckoutData`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Failure`})}),_jsx(_components.td,{children:`Payment failed or an error occurred`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`error: PrimerError`})})]})]})]}),_jsx(Heading,{level:`3`,id:`primerclientsession`,children:`PrimerClientSession`}),_jsxs(_components.p,{children:[`Available in the `,_jsx(_components.code,{children:`Ready`}),` state:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`customerId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`String?`})}),_jsx(_components.td,{children:`Customer identifier`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`orderId`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`String?`})}),_jsx(_components.td,{children:`Order identifier`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`currencyCode`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`String?`})}),_jsxs(_components.td,{children:[`Currency code (e.g., `,_jsx(_components.code,{children:`\"USD\"`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`totalAmount`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`Int?`})}),_jsx(_components.td,{children:`Total amount in minor units (cents)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`lineItems`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`List\u003cPrimerLineItem>?`})}),_jsx(_components.td,{children:`Order line items`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`orderDetails`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PrimerOrder?`})}),_jsx(_components.td,{children:`Order details (country, shipping)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`customer`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PrimerCustomer?`})}),_jsx(_components.td,{children:`Customer details (email, name, address)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`paymentMethod`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PrimerPaymentMethod?`})}),_jsx(_components.td,{children:`Payment method configuration`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fees`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`List\u003cPrimerFee>?`})}),_jsx(_components.td,{children:`Associated fees`})]})]})]})]}),_jsxs(Tab,{title:`iOS`,id:`ios-2`,\"data-child-heading-ids\":`[\"primercheckoutstate-2\"]`,children:[_jsxs(_components.p,{children:[`The outcome is delivered to the `,_jsx(_components.code,{children:`onCompletion`}),` closure on `,_jsx(_components.code,{children:`PrimerCheckout`}),` (managed modal) or on the `,_jsx(_components.code,{children:`.primerCheckoutSession(_:theme:onCompletion:)`}),` modifier (inline), as a `,_jsx(_components.code,{children:`PrimerCheckoutState`}),` — `,_jsx(_components.code,{children:`.success`}),`, `,_jsx(_components.code,{children:`.failure`}),`, or `,_jsx(_components.code,{children:`.dismissed`}),`. `,_jsx(_components.code,{children:`.success`}),` and `,_jsx(_components.code,{children:`.dismissed`}),` end the session and arrive at most once. `,_jsx(_components.code,{children:`.failure`}),` arrives once per failed attempt. While the SDK error screen is enabled (`,_jsx(_components.code,{children:`uiOptions.isErrorScreenEnabled`}),`, on by default), the checkout stays open on it. The closure is then called again if the customer retries. With `,_jsx(_components.code,{children:`PrimerCheckout`}),` this includes a failed initialization, whose error screen offers a retry. With the inline modifier, a failure before `,_jsx(_components.code,{children:`.ready`}),` ends the session. This example uses the managed modal:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: clientToken) { state `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`success`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(result):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment ID: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`result.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`failure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(error, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`_`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Failed: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`errorDescription`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`dismissed`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Dismissed\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For inline UI you observe lifecycle and field-level progress by reading each session’s `,_jsx(_components.code,{children:`@Published`}),` property: `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` publishes `,_jsx(_components.code,{children:`phase`}),`, while `,_jsx(_components.code,{children:`PrimerCardFormSession`}),` and `,_jsx(_components.code,{children:`PrimerSelectionSession`}),` publish `,_jsx(_components.code,{children:`state`}),`.`]}),_jsx(Heading,{level:`3`,id:`primercheckoutstate-2`,children:`PrimerCheckoutState`}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Associated Values`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.initializing`})}),_jsxs(_components.td,{children:[`SDK is loading configuration. Not delivered to `,_jsx(_components.code,{children:`onCompletion`}),`. For inline UI, read `,_jsx(_components.code,{children:`PrimerCheckoutSession.phase`})]}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.ready`})}),_jsxs(_components.td,{children:[`Checkout is ready for payment. Not delivered to `,_jsx(_components.code,{children:`onCompletion`}),`. For inline UI, read `,_jsx(_components.code,{children:`PrimerCheckoutSession.phase`}),` and `,_jsx(_components.code,{children:`PrimerCheckoutSession.clientSession`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`clientSession: PrimerClientSession`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.success`})}),_jsx(_components.td,{children:`Payment completed. Delivered once`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`PaymentResult`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.failure`})}),_jsx(_components.td,{children:`A payment attempt or the initialization failed. Delivered once per failed attempt`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`PrimerError`}),`, `,_jsx(_components.code,{children:`checkoutData: PrimerCheckoutData?`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`.dismissed`})}),_jsx(_components.td,{children:`Checkout was dismissed. Delivered once`}),_jsx(_components.td,{children:`—`})]})]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`phase-1-initialization`,children:`Phase 1: Initialization`}),`\n`,_jsx(_components.p,{children:`Every Primer Checkout integration begins with initialization. The SDK must fully initialize before you can pre-fill form fields or call SDK methods.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-3`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`primer:ready`}),` event fires once after the SDK has fully initialized. It delivers the `,_jsx(_components.code,{children:`PrimerJS`}),` instance as `,_jsx(_components.code,{children:`event.detail`}),`.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`querySelector`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer-checkout'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:ready'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` primer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Pre-fill known data (optional)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` user`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getAuthenticatedUser`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`fullName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` primer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`setCardholderName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`user`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`fullName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Access available methods immediately if needed`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` methods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`primer`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getPaymentMethods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`methods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`length`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\" payment method(s) available at init`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// Handle payment outcomes via events`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-success'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`payment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`paymentMethodType`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Payment successful:'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`payment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`last4Digits`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` window`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`location`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`href`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`/confirmation?method=\"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethodType`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-failure'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Payment failed:'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // The checkout UI already displays the error to the user.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Use this event for logging, analytics, or retry logic.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`If you don’t listen for `,_jsx(_components.code,{children:`primer:payment-success`}),` and `,_jsx(_components.code,{children:`primer:payment-failure`}),`, successful and failed payments will complete silently with no redirect or confirmation. Always attach these event listeners.`]})}),_jsxs(_components.p,{children:[`Before using `,_jsx(_components.code,{children:`primer:payment-failure`}),` to offer a retry, check the error’s `,_jsx(_components.code,{children:`code`}),` and `,_jsx(_components.code,{children:`origin`}),` — `,_jsx(_components.a,{href:`/checkout/primer-checkout/build-your-ui/error-handling#not-all-failures-are-retryable`,children:`not all failures are retryable`}),`, and a network-level failure may hide a payment that actually succeeded.`]})]}),_jsxs(Tab,{title:`Android`,id:`android-3`,children:[_jsxs(_components.p,{children:[`The checkout controller initializes automatically when created with `,_jsx(_components.code,{children:`rememberPrimerCheckoutController()`}),`. Payment outcomes are terminal cases of `,_jsx(_components.code,{children:`checkout.state`}),` — observe the flow to react to them:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout.state.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`collectAsStateWithLifecycle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`LaunchedEffect`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` when`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` s = state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Success `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` payment = s.checkoutData`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`d`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment ID: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.payment.id`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateToConfirmation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(payment)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Failure `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` error = s.primerError`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Failed: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.description`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Diagnostics: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.diagnosticsId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Present when the payment was created before failing, e.g. a decline.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` s.checkoutData?.payment?.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { payment `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.id`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` order: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.orderId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` ->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Unit`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckoutSheet`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(checkout = checkout)`})]}),`\n`]})})})]}),_jsxs(Tab,{title:`iOS`,id:`ios-3`,children:[_jsxs(_components.p,{children:[`The checkout initializes automatically when the `,_jsx(_components.code,{children:`PrimerCheckout`}),` SwiftUI view appears (or when the `,_jsx(_components.code,{children:`.primerCheckoutSession`}),` modifier calls `,_jsx(_components.code,{children:`start()`}),` on appear). Pass an `,_jsx(_components.code,{children:`onCompletion`}),` closure to receive the outcome:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: clientToken) { state `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`success`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(result):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment ID: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`result.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateToConfirmation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(result)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`failure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(error, checkoutData):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Failed: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`errorDescription`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Diagnostics: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`diagnosticsId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Present when the payment was created before failing, e.g. a decline.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` payment = checkoutData?.payment {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"-\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` order: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"-\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`dismissed`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateBack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`To observe the `,_jsx(_components.code,{children:`.ready`}),` lifecycle state for an inline integration, read the `,_jsx(_components.code,{children:`phase`}),` published by `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` (`,_jsx(_components.code,{children:`.initializing`}),` / `,_jsx(_components.code,{children:`.ready`}),`) inside your SwiftUI view. The client session that `,_jsx(_components.code,{children:`.ready`}),` carries is published separately as `,_jsx(_components.code,{children:`PrimerCheckoutSession.clientSession`}),` — `,_jsx(_components.code,{children:`nil`}),` until the session is ready, then the same `,_jsx(_components.code,{children:`PrimerClientSession`}),` value:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` total = session.clientSession?.totalAmount,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` formatted = session.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`formatAmount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(total) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Total: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`formatted`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`totalAmount`}),` is in minor units, so rendering it directly shows `,_jsx(_components.code,{children:`1000`}),` for a ten-dollar order. Use `,_jsx(_components.a,{href:`/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout-session`,children:_jsx(_components.code,{children:`session.formatAmount(_:)`})}),` to format it the way the SDK’s own screens do.`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`If you don’t provide an `,_jsx(_components.code,{children:`onCompletion`}),` closure, successful and failed payments will complete with no redirect or confirmation. Always provide this closure.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`phase-2-payment-method-discovery`,children:`Phase 2: Payment method discovery`}),`\n`,_jsx(_components.p,{children:`Shortly after initialization, the SDK provides information about available payment methods for the current session.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-4`,children:[_jsxs(_components.p,{children:[`The SDK dispatches `,_jsx(_components.code,{children:`primer:methods-update`}),` with the list of payment methods available for the current session. This event fires once on load and may fire again if the session changes (e.g. after calling `,_jsx(_components.code,{children:`primer.refreshSession()`}),` in response to a cart update).`]}),_jsx(_components.p,{children:`You should use this event when you want to build a custom payment method selector, conditionally render UI based on what’s available, or route users to a specific method.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:methods-update'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` methods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Conditionally show an \"Express Checkout\" section only if Apple Pay or Google Pay is available`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` hasExpressMethod`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`methods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`toArray`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`().`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`some`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`m`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` m`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'APPLE_PAY'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` || `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`m`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'GOOGLE_PAY'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'express-checkout-section'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = !`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hasExpressMethod`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`If you’re building a fully custom payment method layout (headless), you’ll also iterate over the methods to create `,_jsx(_components.code,{children:`\u003cprimer-payment-method>`}),` elements dynamically. The `,_jsx(_components.a,{href:`/sdk/primer-checkout-web/components/primer-vault-manager#headless-vault-implementation`,children:`Headless Vault Guide`}),` covers that pattern in detail.`]})]}),_jsxs(Tab,{title:`Android`,id:`android-4`,children:[_jsxs(_components.p,{children:[`Payment methods are managed automatically by the SDK components (`,_jsx(_components.code,{children:`PrimerPaymentMethods`}),`, `,_jsx(_components.code,{children:`PrimerVaultedPaymentMethods`}),`). You can access the client session details from the `,_jsx(_components.code,{children:`Ready`}),` state:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout.state.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`collectAsStateWithLifecycle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`when`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Ready `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` clientSession = (state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`as`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Ready).clientSession`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Total: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`checkout.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`formatAmount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(clientSession.totalAmount ?: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),_jsxs(Tab,{title:`iOS`,id:`ios-4`,children:[_jsxs(_components.p,{children:[`Payment methods are managed by the `,_jsx(_components.code,{children:`PrimerPaymentMethods`}),` view, which resolves a `,_jsx(_components.code,{children:`PrimerSelectionSession`}),` from the environment. Observe the session’s published `,_jsx(_components.code,{children:`state`}),` to track available and selected methods:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`struct`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` MethodCount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`View `}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` @ObservedObject`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session: PrimerSelectionSession`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` body: `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`some`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` View {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` VStack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`alignment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`leading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Methods: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`count`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` selected = session.state.selectedPaymentMethod {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Selected: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`selected.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Read `,_jsx(_components.code,{children:`state`}),` inside a `,_jsx(_components.code,{children:`header`}),` or `,_jsx(_components.code,{children:`emptyState`}),` slot, which receive the `,_jsx(_components.code,{children:`PrimerSelectionSession`}),`. The `,_jsx(_components.code,{children:`method`}),` slot instead receives a `,_jsx(_components.code,{children:`CheckoutPaymentMethod`}),` and an `,_jsx(_components.code,{children:`onSelect`}),` closure, so it does not have access to the session.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`phase-3-user-interaction`,children:`Phase 3: User interaction`}),`\n`,_jsx(_components.p,{children:`As the user fills in payment details, the SDK provides real-time feedback.`}),`\n`,_jsx(Heading,{level:`3`,id:`showing-the-card-network`,children:`Showing the Card Network`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-5`,children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`primer:bin-data-available`}),` fires as the user types their card number. It provides the detected card network, co-badged network alternatives, and additional BIN data such as issuer information when available. Use it to display the correct card brand logo, show a co-badge network picker, or adjust UI based on card attributes.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:bin-data-available'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`alternatives`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`status`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` logoEl`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'card-logo'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` cobrandEl`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'cobrand-selector'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` logoEl`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`src`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`/images/\"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`network`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`toLowerCase`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\".svg`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` logoEl`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`alt`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`displayName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Some cards support co-badging (e.g. Carte Bancaire / Visa).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // If there are multiple allowed networks, show a picker.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` selectableNetworks`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = [`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, ...`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`alternatives`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`filter`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`n`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` n`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`allowed`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` cobrandEl`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`selectableNetworks`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`length`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c= `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // When status is 'complete', additional issuer data is available`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` === `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'complete'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`issuerCountryCode`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`Card issued in: \"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`preferred`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`issuerCountryCode`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`To show a loading indicator while BIN data is being fetched, listen for `,_jsx(_components.code,{children:`primer:bin-data-loading-change`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:bin-data-loading-change'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`loading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'card-logo'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`src`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`loading`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'/images/card-placeholder.svg'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` : `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'card-logo'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`src`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`primer:bin-data-available`}),` replaces the older `,_jsx(_components.code,{children:`primer:card-network-change`}),` event with a richer payload that includes issuer details and card attributes. See the `,_jsx(_components.a,{href:`/sdk/primer-checkout-web/events-reference#primerbin-data-available`,children:`Events Reference`}),` for the full payload shape.`]})})]}),_jsx(Tab,{title:`Android`,id:`android-5`,children:_jsxs(_components.p,{children:[`The Android SDK handles card network detection and display automatically within the `,_jsx(_components.code,{children:`PrimerCardForm`}),` component. Card brand icons update in real-time as the user types.`]})}),_jsxs(Tab,{title:`iOS`,id:`ios-5`,children:[_jsxs(_components.p,{children:[`Card network detection is available via `,_jsx(_components.code,{children:`PrimerCardFormState`}),`. The `,_jsx(_components.code,{children:`PrimerCardForm`}),` view injects a `,_jsx(_components.code,{children:`PrimerCardFormSession`}),` into each of its slots; observe the session’s published `,_jsx(_components.code,{children:`state`}),` and read `,_jsx(_components.code,{children:`selectedNetwork`}),` and `,_jsx(_components.code,{children:`availableNetworks`}),` as the user types:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`12`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCardForm`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`cardDetails`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` VStack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`alignment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`leading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` CardFormDefaults.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`cardNumber`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(session)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` network = session.state.selectedNetwork {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Detected network: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`network.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`displayName`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Co-badged cards expose multiple networks`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session.state.availableNetworks.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`count`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` > `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Co-badge options: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`availableNetworks`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`map`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(\\\\.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`displayName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`joined`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`separator`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\", \"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),_jsxs(_components.p,{children:[`To select a network on a co-badged card, call `,_jsx(_components.code,{children:`session.selectCardNetwork(_:)`}),`.`]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`triggering-submission-from-a-custom-button`,children:`Triggering Submission from a Custom Button`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-6`,children:[_jsxs(_components.p,{children:[`If you’re using your own “Pay” button instead of the built-in one, dispatch `,_jsx(_components.code,{children:`primer:card-submit`}),` to tell the SDK to validate and submit the card form.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'custom-pay-button'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'click'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, () `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`dispatchEvent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` CustomEvent`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:card-submit'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` bubbles:`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` composed:`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`bubbles: true`}),` and `,_jsx(_components.code,{children:`composed: true`}),` are required so the event crosses shadow DOM boundaries and reaches the card form component inside `,_jsx(_components.code,{children:`\u003cprimer-checkout>`}),`. Omitting either option will silently prevent submission.`]})}),_jsxs(_components.p,{children:[`For vault payment submission from a custom button, dispatch `,_jsx(_components.code,{children:`primer:vault-submit`}),` in the same way. See the `,_jsx(_components.a,{href:`/sdk/primer-checkout-web/events-reference#triggerable-events`,children:`Events Reference and Triggerable Events`}),` for the full list of events you can dispatch.`]})]}),_jsxs(Tab,{title:`Android`,id:`android-6`,children:[_jsxs(_components.p,{children:[`The Android SDK handles user interaction through Compose components. Card form state is managed via `,_jsx(_components.code,{children:`PrimerCardFormController`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` cardFormController = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`rememberCardFormController`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The SDK provides built-in components for card input (`,_jsx(_components.code,{children:`PrimerCardForm`}),`), payment method selection (`,_jsx(_components.code,{children:`PrimerPaymentMethods`}),`), and vaulted methods (`,_jsx(_components.code,{children:`PrimerVaultedPaymentMethods`}),`). These handle user interaction automatically.`]})]}),_jsxs(Tab,{title:`iOS`,id:`ios-6`,children:[_jsxs(_components.p,{children:[`If you’re building a custom card form UI, drive the fields and submission through the `,_jsx(_components.code,{children:`PrimerCardFormSession`}),` injected into each `,_jsx(_components.code,{children:`PrimerCardForm`}),` slot. Bind your `,_jsx(_components.code,{children:`TextField`}),`s to the `,_jsx(_components.code,{children:`update*`}),` methods and call `,_jsx(_components.code,{children:`submit()`}),` from your custom button:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCardForm`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` cardDetails`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` VStack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`spacing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` TextField`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Card number\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Binding`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` get`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`[.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`cardNumber`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`] },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` set`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`updateCardNumber`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`$0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ))`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` TextField`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Cardholder name\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`text`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`Binding`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` get`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`[.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`cardholderName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`] },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` set`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`updateCardholderName`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`$0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ))`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` submitButton`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { session `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Submit when your custom button is tapped`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Button`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Pay\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) { session.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`submit`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`() }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`disabled`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(!session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isValid`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` || session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`state`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isLoading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`session.cancel()`}),` to leave the card form. When other payment methods are configured, it returns to payment method selection. When the card is the only configured payment method, it dismisses the checkout and delivers `,_jsx(_components.code,{children:`.dismissed`}),`, even if the customer has saved methods. It is ignored while a payment is running or while your `,_jsx(_components.code,{children:`onBeforePaymentCreate`}),` handler has not decided yet.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`phase-4-payment-processing-and-outcome`,children:`Phase 4: Payment processing and outcome`}),`\n`,_jsx(_components.p,{children:`Once the user submits, the SDK moves through a processing to outcome sequence.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-7`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`primer:state-change`}),` event fires at every step, giving you a single stream to drive your UI state.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`28`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:state-change'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`isLoading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`isProcessing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`isSuccessful`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`paymentFailure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`primerJsError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` submitBtn`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'custom-pay-button'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` spinner`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'loading-overlay'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Disable the button during loading or processing`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` submitBtn`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`disabled`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isLoading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` || `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isProcessing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Show a loading overlay while the payment is in flight`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` spinner`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = !`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isProcessing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`isSuccessful`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Payment succeeded — primer:payment-success will also fire`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'checkout-form'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentFailure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // The checkout component already displays the error to the user.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Use this for supplementary logging or analytics.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`Payment error [\"}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentFailure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`code`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`]: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentFailure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`primerJsError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // An SDK-level error (network failure, configuration issue, etc.)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Unlike paymentFailure, this may not be shown in the checkout UI.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` reportToErrorService`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`primerJsError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),_jsxs(Tab,{title:`Android`,id:`android-7`,children:[_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`State`}),_jsx(_components.th,{children:`When`}),_jsx(_components.th,{children:`Key Properties`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PrimerCheckoutState.Success`})}),_jsx(_components.td,{children:`Payment completed`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`checkoutData: PrimerCheckoutData`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PrimerCheckoutState.Failure`})}),_jsx(_components.td,{children:`Payment failed`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`primerError: PrimerError`}),`, `,_jsx(_components.code,{children:`checkoutData: PrimerCheckoutData?`})]})]})]})]}),_jsx(CodeBlock,{filename:``,numberOfLines:`23`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`23`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout.state.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`collectAsStateWithLifecycle`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`LaunchedEffect`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` when`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` s = state) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Success `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` payment = s.checkoutData`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`d`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment ID: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.payment.id`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateToConfirmation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(payment)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` is`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` PrimerCheckoutState.Failure `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` error = s.primerError`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Failed: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.description`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Diagnostics: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.diagnosticsId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Present when the payment was created before failing, e.g. a decline.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` s.checkoutData?.payment?.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { payment `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`->`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`e`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Checkout\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.id`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` order: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.orderId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` ->`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` Unit`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckoutSheet`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(checkout = checkout)`})]}),`\n`]})})})]}),_jsxs(Tab,{title:`iOS`,id:`ios-7`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`onCompletion`}),` closure receives `,_jsx(_components.code,{children:`.failure`}),` once per failed attempt. While the SDK error screen is enabled, the checkout stays open so the customer can retry. It then receives `,_jsx(_components.code,{children:`.success`}),` or `,_jsx(_components.code,{children:`.dismissed`}),` at most once, and after that nothing more. Read the `,_jsx(_components.a,{href:`/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout-state`,children:_jsx(_components.code,{children:`PaymentResult`})}),` on `,_jsx(_components.code,{children:`.success`}),` and the `,_jsx(_components.a,{href:`/sdk/ios-checkout/v3.0.0-beta/api/common/primer-error`,children:_jsx(_components.code,{children:`PrimerError`})}),` on `,_jsx(_components.code,{children:`.failure`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: clientToken) { state `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` state {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`success`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(result):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment ID: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`result.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Status: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`result.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateToConfirmation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(result)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`failure`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(error, checkoutData):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Error: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`errorDescription`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Diagnostics: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`error.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`diagnosticsId`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Present when the payment was created before failing, e.g. a decline.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` payment = checkoutData?.payment {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Payment: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"-\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` order: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`payment.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` ?? `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"-\"`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`dismissed`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For an inline integration, drive intermediate UI (spinners, disabled buttons) from each session’s `,_jsx(_components.code,{children:`@Published`}),` state — for example `,_jsx(_components.code,{children:`PrimerCardFormSession.state.isLoading`}),` while a payment is in flight.`]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`state-change-vs-outcome-events`,children:`State change vs. outcome events`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`primer:state-change`}),` fires multiple times during a single payment. The outcome events (`,_jsx(_components.code,{children:`primer:payment-success`}),`, `,_jsx(_components.code,{children:`primer:payment-failure`}),`) fire exactly once at the end. Use `,_jsx(_components.code,{children:`primer:state-change`}),` for continuous UI updates (spinners, button states, progress indicators). Use the outcome events for final actions (redirects, confirmations, server notifications).`]}),`\n`,_jsx(Heading,{level:`3`,id:`event-timing`,children:`Event timing`}),`\n`,_jsx(_components.p,{children:`Events may fire multiple times during a single checkout session (for example, if the user retries after a failure).`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Web`,id:`web-8`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`primer:state-change`}),` fires at every step — use it for continuous UI updates (spinners, button states)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`primer:payment-success`}),` and `,_jsx(_components.code,{children:`primer:payment-failure`}),` fire exactly once at the end — use them for final actions`]}),`\n`]})}),_jsx(Tab,{title:`Android`,id:`android-8`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Success`}),` fires immediately — the default success screen auto-dismisses after 3 seconds`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Failure`}),` fires immediately — the error screen stays open for retry`]}),`\n`]})}),_jsx(Tab,{title:`iOS`,id:`ios-8`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Each session’s `,_jsx(_components.code,{children:`@Published`}),` state updates as the flow progresses — observe it for continuous UI updates (spinners, button states)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.success`}),` and `,_jsx(_components.code,{children:`.dismissed`}),` end the checkout. Only one of them reaches `,_jsx(_components.code,{children:`onCompletion`}),`, at most once — use it for final actions (navigation, confirmation)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.failure`}),` reaches `,_jsx(_components.code,{children:`onCompletion`}),` once per failed attempt. While the SDK error screen is enabled, the checkout stays open for a retry — log the error or show your own message instead of navigating away`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`.dismissed`}),` fires when the user dismisses the checkout without completing payment`]}),`\n`]})})]}),`\n`,_jsx(Heading,{level:`3`,id:`dismissal-and-session-refresh`,children:`Dismissal and session refresh`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Web`,id:`web-9`,children:_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`primer.refreshSession()`}),` to sync the client-side SDK with your server session after a cart change. The SDK will re-dispatch `,_jsx(_components.code,{children:`primer:methods-update`}),` with the updated method list.`]})}),_jsxs(Tab,{title:`Android`,id:`android-9`,children:[_jsxs(_components.p,{children:[`Handle checkout dismissal via the `,_jsx(_components.code,{children:`onDismiss`}),` callback:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckoutSheet`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` checkout = checkout,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` onDismiss = {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateBack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`checkout.refresh()`}),` to reinitialize the checkout after updating the order on your server.`]}),_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`checkout.formatAmount()`}),` to display currency-formatted values:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` formattedTotal = checkout.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`formatAmount`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`// \"$10.00\"`})]}),`\n`]})})})]}),_jsxs(Tab,{title:`iOS`,id:`ios-9`,children:[_jsxs(_components.p,{children:[`Handle dismissal by observing the `,_jsx(_components.code,{children:`.dismissed`}),` state in `,_jsx(_components.code,{children:`onCompletion`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: clientToken) { state `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .dismissed = state {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` navigateBack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For an inline integration, call `,_jsx(_components.code,{children:`await session.refresh()`}),` on your `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` to re-fetch configuration and payment methods after a client-session update (for example, an amount or currency change).`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`intercepting-payments-with-primerpayment-start`,children:`Intercepting payments with primer:payment-start`}),`\n`,_jsxs(_components.p,{children:[`Sometimes you need to run a check `,_jsx(_components.em,{children:`after`}),` the user clicks “Pay” but `,_jsx(_components.em,{children:`before`}),` the payment is created — for example, confirming terms-of-service acceptance, validating inventory, or applying a last-second promotion code.`]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-10`,children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`primer:payment-start`}),` event gives you that interception point.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:payment-start'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`paymentMethodType`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`continuePaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`abortPaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Prevent automatic continuation`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`preventDefault`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` termsAccepted`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'terms-checkbox'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checked`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (!`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`termsAccepted`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` showInlineError`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'Please accept the terms of service before paying.'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` abortPaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Optionally inspect paymentMethodType to apply method-specific logic`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` continuePaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`If you call `,_jsx(_components.code,{children:`event.preventDefault()`}),`, you must call either `,_jsx(_components.code,{children:`continuePaymentCreation()`}),` or `,_jsx(_components.code,{children:`abortPaymentCreation()`}),` in every code path. If neither is called, the payment will hang indefinitely. If you don’t call `,_jsx(_components.code,{children:`preventDefault()`}),`, the payment continues automatically.`]})})]}),_jsx(Tab,{title:`Android`,id:`android-10`,children:_jsx(Note,{children:`Payment interception is not available in the composable module.`})}),_jsxs(Tab,{title:`iOS`,id:`ios-10`,children:[_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`onBeforePaymentCreate`}),` on your `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` to intercept payments after the user taps “Pay” but before the payment is created. It runs for every payment method, including payments with a saved method started from the SDK’s pay button or from `,_jsx(_components.code,{children:`PrimerSelectionSession.selectVaulted(_:)`}),`. The handler receives the payment-method data and a decision handler:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`struct`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` CheckoutView`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`View `}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` @StateObject`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` private`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session: PrimerCheckoutSession`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` init`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`String`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`PrimerCheckoutSession`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`clientToken`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: clientToken)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`onBeforePaymentCreate`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = { `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`_`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, decisionHandler `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` guard`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` termsAccepted `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` decisionHandler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`abortPaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` return`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` decisionHandler`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`continuePaymentCreation`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`withIdempotencyKey`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`nil`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`))`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` _session = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`StateObject`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`wrappedValue`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: session)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` body: `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`some`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` View {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` ScrollView`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` PrimerCardForm`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`primerCheckoutSession`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(session) { state `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Handle the outcome.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`You must call the `,_jsx(_components.code,{children:`decisionHandler`}),` closure with either `,_jsx(_components.code,{children:`.continuePaymentCreation(withIdempotencyKey:)`}),` or `,_jsx(_components.code,{children:`.abortPaymentCreation()`}),` in every code path. The SDK never times out the decision. It logs a warning after 5 seconds, and the payment hangs until you call it.`]})})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`continuePaymentCreation`}),` accepts an optional `,_jsx(_components.code,{children:`{ idempotencyKey }`}),` parameter. When provided, this key is sent with the payment request to prevent duplicate payments from being created. See the `,_jsx(_components.a,{href:`/sdk/primer-checkout-web/events-reference#preparehandler`,children:`Events Reference`}),` for the full type definition.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`primer:payment-start`}),` is for `,_jsx(_components.strong,{children:`client-side`}),` checks that resolve in the browser. If you need a `,_jsx(_components.strong,{children:`server-side`}),` decision (running a fraud check or inventory validation on your backend before the payment is created), use the `,_jsx(_components.a,{href:`/checkout/primer-checkout/guides-and-recipes/manual-payment-approval`,children:`Manual payment approval`}),` flow, which pauses on the `,_jsx(_components.code,{children:`primer:payment-approval-required`}),` event until your backend approves or aborts the attempt.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`working-with-vaulted-payment-methods`,children:`Working with Vaulted Payment Methods`}),`\n`,_jsx(_components.p,{children:`If your integration supports saved (vaulted) payment methods, additional events become relevant.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Web`,id:`web-11`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`primer:vault-methods-update`})}),` — fires when vaulted payment methods are loaded or when the vault state changes. Use it to render saved cards, show a “Pay with saved card” section, or determine whether CVV re-entry is required.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`primer:vault-selection-change`})}),` — fires when the user selects or deselects a saved method. Use it to enable or disable your submit button, or to toggle between “pay with saved card” and “pay with new card” views.`]}),`\n`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` cvvRequired`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:vault-methods-update'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`vaultedPayments`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`cvvRecapture`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` cvvRequired`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`cvvRecapture`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` savedMethodsSection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'saved-methods'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`vaultedPayments`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`length`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` > `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` savedMethodsSection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` renderSavedMethodsList`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`vaultedPayments`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` savedMethodsSection`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`hidden`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`checkout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`addEventListener`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'primer:vault-selection-change'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:`paymentMethodId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` } = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`detail`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#4FC1FF`,\"--shiki-dark\":`#4FC1FF`},children:` vaultSubmitBtn`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`document`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`getElementById`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'vault-pay-button'`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // Enable the button only when a method is selected`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` vaultSubmitBtn`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`disabled`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` = !`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethodId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` // If CVV re-entry is required, show the CVV input when a method is selected`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethodId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`cvvRequired`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` showCvvInput`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethodId`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsxs(_components.p,{children:[`For full headless vault implementation, including `,_jsx(_components.code,{children:`primer.vault.createCvvInput()`}),`, `,_jsx(_components.code,{children:`primer.vault.startPayment()`}),`, and `,_jsx(_components.code,{children:`primer.vault.delete()`}),` see the `,_jsx(_components.a,{href:`/sdk/primer-checkout-web/components/primer-vault-manager#headless-vault-implementation`,children:`Headless Vault Guide`}),`.`]})]}),_jsxs(Tab,{title:`Android`,id:`android-11`,children:[_jsxs(_components.p,{children:[`Vaulted payment methods are managed by the `,_jsx(_components.code,{children:`PrimerVaultedPaymentMethods`}),` component and `,_jsx(_components.code,{children:`rememberVaultedPaymentMethodsController()`}),`:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` vaultController = `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`rememberVaultedPaymentMethodsController`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`The SDK provides built-in UI for displaying and selecting saved payment methods within `,_jsx(_components.code,{children:`PrimerCheckoutSheet`}),`.`]})]}),_jsxs(Tab,{title:`iOS`,id:`ios-11`,children:[_jsxs(_components.p,{children:[`Saved methods are rendered by the `,_jsx(_components.code,{children:`PrimerVaultedPaymentMethods`}),` view, backed by the same `,_jsx(_components.code,{children:`PrimerSelectionSession`}),`. Read the published `,_jsx(_components.code,{children:`vaultedPaymentMethods`}),` for the list, keep the highlight in your own view state, and call `,_jsx(_components.code,{children:`selectVaulted(_:)`}),` from your pay button. It is the pay verb, not a selection verb:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`struct`}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:` SavedMethodList`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`View `}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` @ObservedObject`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session: PrimerSelectionSession`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` @State`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` private`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` highlighted: `}),_jsx(_components.span,{style:{color:`#4EC9B0`,\"--shiki-dark\":`#4EC9B0`},children:`String`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`?`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` body: `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`some`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` View {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` VStack`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`alignment`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: .`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`leading`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`spacing`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` ForEach`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(session.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`vaultedPaymentMethods`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: \\\\.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) { method `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Button`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(method.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`paymentMethodType`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) { highlighted = method.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:` Button`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"Pay\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:` guard`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` method = session.vaultedPaymentMethods`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` .`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`first`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`where`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`$0`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` == highlighted }) `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` session.`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`selectVaulted`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`(method)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(_components.p,{children:`A card that needs CVV recapture raises the CVV recapture screen on submit, and that screen finishes the payment.`}),_jsxs(_components.p,{children:[`Call `,_jsx(_components.code,{children:`try await session.delete(_:)`}),` to remove a saved method — it deletes immediately, with no confirmation step — and `,_jsx(_components.code,{children:`session.showAll()`}),` to present the SDK’s saved-methods screen, where the customer can switch methods or delete one. The default header of `,_jsx(_components.code,{children:`PrimerVaultedPaymentMethods`}),` already wires `,_jsx(_components.code,{children:`showAll()`}),` in.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`event-flow-overview`,children:`Event flow overview`}),`\n`,_jsx(_components.p,{children:`The following diagram shows the typical sequence of events in a successful card payment, from initialization through confirmation.`}),`\n`,_jsx(Mermaid,{chart:`sequenceDiagram\n participant App as Your App\n participant SDK as Primer SDK\n\n Note over App,SDK: Phase 1 - Initialization\n SDK->>App: SDK ready\n Note right of App: Register callbacks, pre-fill fields\n\n Note over App,SDK: Phase 2 - Discovery\n SDK->>App: Payment methods available\n SDK->>App: Vaulted methods loaded\n Note right of App: Render payment method UI\n\n Note over App,SDK: Phase 3 - User Interaction\n App->>SDK: User enters card details\n SDK->>App: Card network detected\n Note right of App: Show card brand logo\n\n Note over App,SDK: Phase 4 - Processing \u0026 Outcome\n App->>SDK: Submit payment\n SDK->>App: State: processing\n Note right of App: Show spinner, disable button\n SDK->>App: State: successful\n SDK->>App: Payment success event\n Note right of App: Navigate to confirmation`}),`\n`,_jsx(Heading,{level:`2`,id:`debugging-tips`,children:`Debugging tips`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Web`,id:`web-12`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Events not firing?`}),` Confirm the `,_jsx(_components.code,{children:`\u003cprimer-checkout>`}),` element is in the DOM before you add listeners. In SPAs, race conditions between route rendering and listener attachment are the most common cause.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Shadow DOM boundary issues?`}),` Triggerable events (`,_jsx(_components.code,{children:`primer:card-submit`}),`, `,_jsx(_components.code,{children:`primer:vault-submit`}),`) must be dispatched with `,_jsx(_components.code,{children:`bubbles: true`}),` and `,_jsx(_components.code,{children:`composed: true`}),` or they won’t reach the internal form component.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stale data after a cart change?`}),` Call `,_jsx(_components.code,{children:`primer.refreshSession()`}),` to sync the client-side SDK with your server session. The SDK will re-dispatch `,_jsx(_components.code,{children:`primer:methods-update`}),` with the updated method list.`]}),`\n`]})}),_jsx(Tab,{title:`Android`,id:`android-12`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`State not updating?`}),` Make sure you’re using `,_jsx(_components.code,{children:`collectAsStateWithLifecycle()`}),` instead of `,_jsx(_components.code,{children:`collectAsState()`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Outcomes not received?`}),` Ensure you’re observing `,_jsx(_components.code,{children:`checkout.state`}),` and handling the terminal `,_jsx(_components.code,{children:`PrimerCheckoutState.Success`}),` and `,_jsx(_components.code,{children:`PrimerCheckoutState.Failure`}),` cases.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Stale data after a cart change?`}),` Call `,_jsx(_components.code,{children:`checkout.refresh()`}),` to reinitialize the checkout.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Log diagnostics IDs.`}),` Every `,_jsx(_components.code,{children:`PrimerError`}),` includes a `,_jsx(_components.code,{children:`diagnosticsId`}),`. Log it for troubleshooting with Primer support.`]}),`\n`]})}),_jsx(Tab,{title:`iOS`,id:`ios-12`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`State not updating?`}),` Observe the session with `,_jsx(_components.code,{children:`@ObservedObject`}),` (or hold `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),` as a `,_jsx(_components.code,{children:`@StateObject`}),`) so SwiftUI re-renders when its published properties change. These are `,_jsx(_components.code,{children:`phase`}),` and `,_jsx(_components.code,{children:`clientSession`}),` on `,_jsx(_components.code,{children:`PrimerCheckoutSession`}),`, `,_jsx(_components.code,{children:`state`}),` on `,_jsx(_components.code,{children:`PrimerCardFormSession`}),`, and `,_jsx(_components.code,{children:`state`}),` and `,_jsx(_components.code,{children:`vaultedPaymentMethods`}),` on `,_jsx(_components.code,{children:`PrimerSelectionSession`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`onCompletion not firing?`}),` It fires for `,_jsx(_components.code,{children:`.success`}),`, `,_jsx(_components.code,{children:`.failure`}),` and `,_jsx(_components.code,{children:`.dismissed`}),`. Read `,_jsx(_components.code,{children:`PrimerCheckoutSession.phase`}),` to follow `,_jsx(_components.code,{children:`.initializing`}),` and `,_jsx(_components.code,{children:`.ready`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Composable views not rendering?`}),` Make sure the `,_jsx(_components.code,{children:`.primerCheckoutSession(_:theme:onCompletion:)`}),` modifier is applied above `,_jsx(_components.code,{children:`PrimerCardForm`}),` / `,_jsx(_components.code,{children:`PrimerPaymentMethods`}),` in the hierarchy. Without it, they cannot resolve a session from the environment.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Child sessions are nil?`}),` `,_jsx(_components.code,{children:`PrimerCheckoutSession.cardForm`}),` and `,_jsx(_components.code,{children:`.selection`}),` are non-`,_jsx(_components.code,{children:`nil`}),` only once `,_jsx(_components.code,{children:`phase == .ready`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Log diagnostics IDs.`}),` Every `,_jsx(_components.code,{children:`PrimerError`}),` includes a `,_jsx(_components.code,{children:`diagnosticsId`}),`. Log it for troubleshooting with Primer support.`]}),`\n`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Web events reference`,icon:`book`,href:`/sdk/primer-checkout-web/events-reference`,children:_jsx(_components.p,{children:`Every Web event name, payload type, callback signature, and instance method`})}),_jsx(Card,{title:`Android SDK reference`,icon:`android`,href:`/sdk/android-checkout/v3.0.0-beta/api/overview`,children:_jsx(_components.p,{children:`Android SDK API documentation`})}),_jsx(Card,{title:`iOS SDK reference`,icon:`apple`,href:`/sdk/ios-checkout/v3.0.0-beta/api/overview`,children:_jsx(_components.p,{children:`iOS SDK API documentation`})}),_jsx(Card,{title:`Recipes`,icon:`utensils`,href:`/checkout/primer-checkout/guides-and-recipes/overview`,children:_jsx(_components.p,{children:`Use-case driven examples for common integration scenarios`})}),_jsx(Card,{title:`Error handling`,icon:`triangle-exclamation`,href:`/checkout/primer-checkout/build-your-ui/error-handling`,children:_jsx(_components.p,{children:`Deep dive into error handling, retries, and failure recovery`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Events guide","sidebarTitle":"Events","description":"When and how to use the `primer:*` DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.","href":"/checkout/primer-checkout/configuration/events"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How events work","slug":"how-events-work","depth":2,"children":[]},{"title":"Choosing where to listen","slug":"choosing-where-to-listen","depth":2,"children":[{"title":"Ensuring the component exists","slug":"ensuring-the-component-exists","depth":3,"children":[],"tabId":"web-2"},{"title":"PrimerCheckoutState","slug":"primercheckoutstate","depth":3,"children":[],"tabId":"android-2"},{"title":"PrimerClientSession","slug":"primerclientsession","depth":3,"children":[],"tabId":"android-2"},{"title":"PrimerCheckoutState","slug":"primercheckoutstate-2","depth":3,"children":[],"tabId":"ios-2"}]},{"title":"Phase 1: Initialization","slug":"phase-1-initialization","depth":2,"children":[]},{"title":"Phase 2: Payment method discovery","slug":"phase-2-payment-method-discovery","depth":2,"children":[]},{"title":"Phase 3: User interaction","slug":"phase-3-user-interaction","depth":2,"children":[{"title":"Showing the Card Network","slug":"showing-the-card-network","depth":3,"children":[]},{"title":"Triggering Submission from a Custom Button","slug":"triggering-submission-from-a-custom-button","depth":3,"children":[]}]},{"title":"Phase 4: Payment processing and outcome","slug":"phase-4-payment-processing-and-outcome","depth":2,"children":[{"title":"State change vs. outcome events","slug":"state-change-vs-outcome-events","depth":3,"children":[]},{"title":"Event timing","slug":"event-timing","depth":3,"children":[]},{"title":"Dismissal and session refresh","slug":"dismissal-and-session-refresh","depth":3,"children":[]}]},{"title":"Intercepting payments with primer:payment-start","slug":"intercepting-payments-with-primerpayment-start","depth":2,"children":[]},{"title":"Working with Vaulted Payment Methods","slug":"working-with-vaulted-payment-methods","depth":2,"children":[]},{"title":"Event flow overview","slug":"event-flow-overview","depth":2,"children":[]},{"title":"Debugging tips","slug":"debugging-tips","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/primer-cc826789/f9b3e76a02542eba/js/codeblocklayout.js"],"subdomain":"primer-cc826789","siteName":"Primer","title":"Events guide - Primer","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T14:30:30.359Z","originalFileLocation":"checkout/primer-checkout/configuration/events.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Primer\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Events guide - Primer\">\u003cmeta data-mint-head property=\"og:description\" content=\"When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Primer\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://primer.io/docs/checkout/primer-checkout/configuration/events\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://primer-cc826789.mintlify.site/docs/_mintlify/api/og/v2?division=Configure+Primer+Checkout\u0026amp;title=Events+guide\u0026amp;description=When+and+how+to+use+the+%60primer%3A*%60+DOM+events+%E2%80%93+ready%2C+payment+lifecycle%2C+card+form+and+vault+%E2%80%93+to+drive+your+checkout.\u0026amp;theme=115d40077fafa3c430405b4c\u0026amp;signature=cb7bb0e7f58827953c654978f306a55d6e11f42955032c17be4b34fc950dcd54\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Events guide - Primer\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://primer-cc826789.mintlify.site/docs/_mintlify/api/og/v2?division=Configure+Primer+Checkout\u0026amp;title=Events+guide\u0026amp;description=When+and+how+to+use+the+%60primer%3A*%60+DOM+events+%E2%80%93+ready%2C+payment+lifecycle%2C+card+form+and+vault+%E2%80%93+to+drive+your+checkout.\u0026amp;theme=115d40077fafa3c430405b4c\u0026amp;signature=cb7bb0e7f58827953c654978f306a55d6e11f42955032c17be4b34fc950dcd54\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/primer-cc826789/9meORDX7HOYVFtwE/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Primer\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF7C4F\">\u003clink data-mint-head rel=\"canonical\" href=\"https://primer.io/docs/checkout/primer-checkout/configuration/events\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/checkout/primer-checkout/configuration/events.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://primer.io/#organization\",\"name\":\"Primer\",\"url\":\"https://primer.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/primer-cc826789/fMxS38v0lFyMKyzD/logo/primer_logo.svg?fit=max\u0026auto=format\u0026n=fMxS38v0lFyMKyzD\u0026q=85\u0026s=0010b4ac2a8a90e656efd18fb57c9366\"}},{\"@type\":\"WebSite\",\"@id\":\"https://primer.io/docs#website\",\"name\":\"Primer\",\"url\":\"https://primer.io/docs\",\"publisher\":{\"@id\":\"https://primer.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events#webpage\",\"url\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events\",\"name\":\"Events guide\",\"description\":\"When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\",\"dateModified\":\"2026-10-21T14:30:30.359Z\",\"isPartOf\":{\"@id\":\"https://primer.io/docs#website\"},\"breadcrumb\":{\"@id\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Checkout\",\"item\":\"https://primer.io/docs/checkout/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Primer Checkout\",\"item\":\"https://primer.io/docs/checkout/primer-checkout/product-overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Configure Primer Checkout\",\"item\":\"https://primer.io/docs/checkout/primer-checkout/configuration/best-practices\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events guide\",\"item\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events#article\",\"headline\":\"Events guide\",\"name\":\"Events guide\",\"description\":\"When and how to use the primer:* DOM events – ready, payment lifecycle, card form and vault – to drive your checkout.\",\"url\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events\",\"mainEntityOfPage\":{\"@id\":\"https://primer.io/docs/checkout/primer-checkout/configuration/events#webpage\"},\"dateModified\":\"2026-10-21T14:30:30.359Z\",\"publisher\":{\"@id\":\"https://primer.io/#organization\"},\"isPartOf\":{\"@id\":\"https://primer.io/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Primer\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Primer","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/home"}]},{"tab":"Documentation","anchors":[{"anchor":"Get started","icon":"book-open","pages":[{"title":"Get started","href":"/get-started/overview"}]},{"anchor":"Primer concepts","icon":"brain","pages":[{"title":"Primer concepts","href":"/concepts/overview"}]},{"anchor":"Checkout","icon":"cart-shopping","pages":[{"group":"Checkout","pages":[{"title":"Overview","href":"/checkout/overview"},{"title":"Checkout Builder","sidebarTitle":"Checkout Builder","href":"/checkout/checkout-builder"},{"title":"Capture billing address","href":"/checkout/capture-billing-address"},{"title":"Client Session","sidebarTitle":"Client session","href":"/checkout/client-session"},{"group":"Primer Checkout","hidden":false,"tag":"NEW","pages":[{"group":"Get started","pages":[{"title":"Primer Checkout overview","sidebarTitle":"Overview","href":"/checkout/primer-checkout/product-overview"},{"title":"Install Primer Checkout","sidebarTitle":"Installation","href":"/checkout/primer-checkout/installation"},{"title":"Accept your first payment","sidebarTitle":"First payment","href":"/checkout/primer-checkout/first-payment"},{"title":"How Primer Checkout works","sidebarTitle":"Core concepts","href":"/checkout/primer-checkout/core-concepts"},{"title":"Use AI coding assistants with Primer Checkout","sidebarTitle":"Build with AI","href":"/checkout/primer-checkout/resources/build-with-ai"}]},{"group":"Migrate to Primer Checkout","pages":[{"title":"Migrate from Drop-in or Headless","sidebarTitle":"Migrate from Drop-in or Headless","href":"/checkout/primer-checkout/migration/overview"},{"title":"Framework-Specific Migration Guide","sidebarTitle":"Framework migration","href":"/checkout/primer-checkout/migration/frameworks"},{"title":"Migrate the manual flow","sidebarTitle":"Migrate the manual flow","href":"/checkout/primer-checkout/migration/manual-flow"}]},{"group":"Configure Primer Checkout","pages":[{"title":"Integration best practices","sidebarTitle":"Integration best practices","href":"/checkout/primer-checkout/configuration/best-practices"},{"title":"Components","sidebarTitle":"Components","href":"/checkout/primer-checkout/configuration/components"},{"title":"Configuring checkout","sidebarTitle":"Configuring checkout","description":"Set component properties with `setAttribute` and SDK options with `.options`.","href":"/checkout/primer-checkout/configuration/sdk-options"},{"title":"Events guide","sidebarTitle":"Events","href":"/checkout/primer-checkout/configuration/events"},{"title":"Error Handling \u0026 Failure States","sidebarTitle":"Error handling","description":"Distinguish validation errors from payment failures, and show the right message for each.","href":"/checkout/primer-checkout/build-your-ui/error-handling"},{"title":"Supported locales","sidebarTitle":"Supported locales","href":"/checkout/primer-checkout/configuration/localization"},{"title":"UI styling","sidebarTitle":"UI styling","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/styling-customization"},{"title":"Layout customization","sidebarTitle":"Layout customization","href":"/checkout/primer-checkout/build-your-ui/layout-customization"},{"group":"Design Tokens Explorer","pages":[{"title":"Design Tokens Explorer — Web","sidebarTitle":"Web","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/design-tokens-explorer-web"},{"title":"Design Tokens Explorer — iOS","sidebarTitle":"iOS","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/design-tokens-explorer-ios"},{"title":"Design Tokens Explorer — Android","sidebarTitle":"Android","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/design-tokens-explorer-android"}]},{"group":"Architecture Explorer","pages":[{"title":"Slot Architecture Explorer — Web","sidebarTitle":"Web","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/slot-architecture-explorer-web"},{"title":"Component Architecture Explorer — iOS","sidebarTitle":"iOS","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/scope-architecture-explorer-ios"},{"title":"Component Architecture Explorer — Android","sidebarTitle":"Android","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/component-architecture-explorer-android"}]},{"title":"Card Form Layout Builder","mode":"wide","href":"/checkout/primer-checkout/build-your-ui/card-form-layout-builder"},{"title":"Advanced layout with events","sidebarTitle":"Advanced layout with events","href":"/checkout/primer-checkout/build-your-ui/advanced-layout-customization"},{"title":"React integration guide","sidebarTitle":"React","href":"/checkout/primer-checkout/frameworks/react-integration-guide"},{"title":"Server-side rendering","sidebarTitle":"Server-side rendering","href":"/checkout/primer-checkout/frameworks/ssr-guide"}]},{"group":"Guides and Recipes","pages":[{"title":"Guides and recipes","sidebarTitle":"Overview","href":"/checkout/primer-checkout/guides-and-recipes/overview"},{"title":"Build a custom card form","sidebarTitle":"Build a custom card form","href":"/checkout/primer-checkout/guides-and-recipes/build-custom-card-form"},{"group":"Payment flow","pages":[{"title":"Redirect after successful payment","sidebarTitle":"Redirect after payment","href":"/checkout/primer-checkout/guides-and-recipes/redirect-after-payment"},{"title":"Show custom success message","sidebarTitle":"Show success message","href":"/checkout/primer-checkout/guides-and-recipes/show-success-message"},{"title":"Track payment in analytics","sidebarTitle":"Track in analytics","href":"/checkout/primer-checkout/guides-and-recipes/track-payment-analytics"},{"title":"Log errors for debugging","sidebarTitle":"Log errors","href":"/checkout/primer-checkout/guides-and-recipes/log-errors-debugging"},{"title":"Prevent duplicate payments with idempotency keys","sidebarTitle":"Prevent duplicate payments","href":"/checkout/primer-checkout/guides-and-recipes/use-idempotency-keys"},{"title":"Manual payment approval","sidebarTitle":"Manual payment approval","href":"/checkout/primer-checkout/guides-and-recipes/manual-payment-approval"},{"title":"Express Checkout: shipping in the Apple Pay and Google Pay sheets","sidebarTitle":"Express Checkout shipping","href":"/checkout/primer-checkout/guides-and-recipes/express-checkout-shipping"},{"title":"Use BIN Data to Control Click to Pay","sidebarTitle":"BIN data and Click to Pay","href":"/checkout/primer-checkout/guides-and-recipes/use-bin-data-to-control-click-to-pay"}]},{"group":"User experience","pages":[{"title":"Pre-fill cardholder name","sidebarTitle":"Pre-fill cardholder name","href":"/checkout/primer-checkout/guides-and-recipes/prefill-cardholder-name"},{"title":"Show loading indicator","sidebarTitle":"Show loading indicator","href":"/checkout/primer-checkout/guides-and-recipes/show-loading-indicator"},{"title":"Disable buttons during payment","sidebarTitle":"Disable buttons during payment","href":"/checkout/primer-checkout/guides-and-recipes/disable-buttons-during-payment"}]},{"group":"Custom controls","pages":[{"title":"External submit button","sidebarTitle":"External submit button","href":"/checkout/primer-checkout/guides-and-recipes/external-submit-button"},{"title":"Display detected card network","sidebarTitle":"Display card network","href":"/checkout/primer-checkout/guides-and-recipes/display-card-network"}]},{"group":"Vault","pages":[{"title":"Display saved payment methods","sidebarTitle":"Display saved payment methods","href":"/checkout/primer-checkout/guides-and-recipes/display-saved-payment-methods"}]}]},{"group":"Troubleshooting","pages":[{"title":"Troubleshooting — Web","sidebarTitle":"Web","href":"/checkout/primer-checkout/troubleshooting-web"},{"title":"Troubleshooting — iOS","sidebarTitle":"iOS","href":"/checkout/primer-checkout/troubleshooting-ios"},{"title":"Troubleshooting — Android","sidebarTitle":"Android","href":"/checkout/primer-checkout/troubleshooting-android"}]},{"title":"Glossary","sidebarTitle":"Glossary","href":"/checkout/primer-checkout/glossary"}]},{"group":"Legacy SDK","pages":[{"group":"Drop-in checkout","pages":[{"title":"Drop-in Checkout: Get started","sidebarTitle":"Get started","href":"/checkout/drop-in/overview"},{"group":"Customization","pages":[{"title":"Customization","sidebarTitle":"Overview","href":"/checkout/drop-in/customization"},{"title":"Web","sidebarTitle":"Web","href":"/checkout/drop-in/customization/web"},{"title":"iOS","sidebarTitle":"iOS","href":"/checkout/drop-in/customization/ios"},{"title":"Android","sidebarTitle":"Android","href":"/checkout/drop-in/customization/android"},{"title":"React Native","sidebarTitle":"React Native","href":"/checkout/drop-in/customization/react-native"}]}]},{"title":"Headless Checkout","sidebarTitle":"Headless checkout","href":"/checkout/headless"}]},{"group":"Advanced","pages":[{"title":"Manual payment creation","sidebarTitle":"Manual payment creation","href":"/checkout/advanced/manual-payment-creation"},{"title":"Content Security Policy","sidebarTitle":"Content security policy","href":"/checkout/advanced/content-security-policy"}]}]}]},{"anchor":"Workflows","icon":"arrow-progress","pages":[{"title":"Workflows","href":"/workflows/overview"}]},{"anchor":"Manage payments","icon":"money-bills","pages":[{"title":"Manage payments","href":"/manage-payments/overview"}]},{"anchor":"Payment services","icon":"credit-card","pages":[{"title":"Payment services","href":"/payment-services/overview"}]},{"anchor":"Primer Vault","icon":"vault","pages":[{"title":"Primer Vault","href":"/vault/overview"}]},{"anchor":"Subscriptions","icon":"rotate","pages":[{"title":"Subscriptions","href":"/subscriptions/overview"}]},{"anchor":"Observability","icon":"chart-simple","pages":[{"title":"Observability","href":"/observability/overview"}]},{"anchor":"Monitors","icon":"wave-pulse","pages":[{"title":"Monitors","href":"/monitors/overview"}]},{"anchor":"Reconciliation","icon":"file-lines","pages":[{"title":"Reconciliation","href":"/reconciliation/overview"}]},{"anchor":"Disputes","icon":"triangle-exclamation","pages":[{"title":"Disputes","href":"/disputes/overview"}]},{"anchor":"Testing","icon":"vial-circle-check","pages":[{"title":"Testing","href":"/testing/overview"}]}]},{"tab":"API Reference","versions":[{"version":"v2.4","tag":"GA","anchors":[{"anchor":"Getting started","icon":"rocket","groups":[{"group":"Getting started","pages":[{"title":"Overview","href":"/api-reference/get-started/v2.4/overview"},{"title":"API lifecycle","sidebarTitle":"API lifecycle","href":"/api-reference/get-started/api-lifecycle"},{"title":"Authentication","sidebarTitle":"Authentication","href":"/api-reference/get-started/authentication"},{"title":"API Responses","sidebarTitle":"API responses","href":"/api-reference/get-started/api-responses"},{"title":"Idempotency Key","sidebarTitle":"Idempotency key","href":"/api-reference/get-started/idempotency-key"},{"title":"Request requirements","sidebarTitle":"Request requirements","href":"/api-reference/get-started/request-requirements"},{"title":"Configure Webhooks","sidebarTitle":"Configure webhooks","href":"/api-reference/get-started/configure-webhooks"}]}]},{"anchor":"API reference","icon":"book-open","groups":[{"group":"API reference","pages":[{"group":"Client Session API","pages":[{"title":"Retrieve a client session","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml get /client-session","href":"/api-reference/v2.4/api-reference/client-session-api/retrieve-a-client-session"},{"title":"Create a client session","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /client-session","href":"/api-reference/v2.4/api-reference/client-session-api/create-a-client-session"},{"title":"Update client session","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml patch /client-session","href":"/api-reference/v2.4/api-reference/client-session-api/update-client-session"}]},{"group":"Payments API","pages":[{"title":"Search \u0026 list payments","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml get /payments","href":"/api-reference/v2.4/api-reference/payments-api/search-\u0026-list-payments"},{"title":"Create a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments","href":"/api-reference/v2.4/api-reference/payments-api/create-a-payment"},{"title":"Authorize a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/authorize","href":"/api-reference/v2.4/api-reference/payments-api/authorize-a-payment"},{"title":"Capture a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/capture","href":"/api-reference/v2.4/api-reference/payments-api/capture-a-payment"},{"title":"Cancel a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/cancel","href":"/api-reference/v2.4/api-reference/payments-api/cancel-a-payment"},{"title":"Refund a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/refund","href":"/api-reference/v2.4/api-reference/payments-api/refund-a-payment"},{"title":"Resume a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/resume","href":"/api-reference/v2.4/api-reference/payments-api/resume-a-payment"},{"title":"Adjust authorized amount","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payments/{id}/adjust-authorization","href":"/api-reference/v2.4/api-reference/payments-api/adjust-authorized-amount"},{"title":"Get a payment","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml get /payments/{id}","href":"/api-reference/v2.4/api-reference/payments-api/get-a-payment"}]},{"group":"Payment Attempts API","pages":[{"title":"Approve a payment attempt","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payment-attempts/{id}/approve","href":"/api-reference/v2.4/api-reference/payment-attempts-api/approve-a-payment-attempt"},{"title":"Abort a payment attempt","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payment-attempts/{id}/abort","href":"/api-reference/v2.4/api-reference/payment-attempts-api/abort-a-payment-attempt"},{"title":"Resolve a payment attempt","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payment-attempts/{id}/resolve","href":"/api-reference/v2.4/api-reference/payment-attempts-api/resolve-a-payment-attempt"}]},{"group":"Payment Methods API","pages":[{"title":"Save a payment method token","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payment-instruments/{paymentMethodToken}/vault","href":"/api-reference/v2.4/api-reference/payment-methods-api/save-a-payment-method-token"},{"title":"List saved payment methods","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml get /payment-instruments","href":"/api-reference/v2.4/api-reference/payment-methods-api/list-saved-payment-methods"},{"title":"Delete a saved payment method","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml delete /payment-instruments/{paymentMethodToken}","href":"/api-reference/v2.4/api-reference/payment-methods-api/delete-a-saved-payment-method"},{"title":"Update the default saved payment method","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /payment-instruments/{paymentMethodToken}/default","href":"/api-reference/v2.4/api-reference/payment-methods-api/update-the-default-saved-payment-method"}]},{"group":"Primer Proxy API","pages":[{"title":"Forward a request to a PSP, substituting vaulted card data","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml get /{proxyPath}","href":"/api-reference/v2.4/api-reference/primer-proxy-api/forward-a-request-to-a-psp-substituting-vaulted-card-data"},{"title":"Forward a request to a PSP, substituting vaulted card data","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml put /{proxyPath}","href":"/api-reference/v2.4/api-reference/primer-proxy-api/forward-a-request-to-a-psp-substituting-vaulted-card-data-1"},{"title":"Forward a request to a PSP, substituting vaulted card data","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml post /{proxyPath}","href":"/api-reference/v2.4/api-reference/primer-proxy-api/forward-a-request-to-a-psp-substituting-vaulted-card-data-2"},{"title":"Forward a request to a PSP, substituting vaulted card data","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml delete /{proxyPath}","href":"/api-reference/v2.4/api-reference/primer-proxy-api/forward-a-request-to-a-psp-substituting-vaulted-card-data-3"},{"title":"Forward a request to a PSP, substituting vaulted card data","deprecated":null,"version":null,"openapi":"https://api.schemas.primer.io/api-reference/v2.4/openapi.yaml patch /{proxyPath}","href":"/api-reference/v2.4/api-reference/primer-proxy-api/forward-a-request-to-a-psp-substituting-vaulted-card-data-4"}]}]}]},{"anchor":"Webhooks","icon":"webhook","groups":[{"group":"Webhooks","pages":[{"group":"Payment Webhooks","pages":[{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /payment-status","playground":"none","title":"Payment Status Update","href":"/api-reference/endpoints/v2.4/payment-webhooks/payment-status-update"},{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /payment-refund","playground":"none","title":"Payment Refund","href":"/api-reference/endpoints/v2.4/payment-webhooks/payment-refund"},{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /payment-operation-failure","playground":"none","title":"Payment Operation Failure","href":"/api-reference/endpoints/v2.4/payment-webhooks/payment-operation-failure"}]},{"group":"Workflow Webhooks","pages":[{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /workflow-run-failed","playground":"none","title":"Workflow Run Failed","href":"/api-reference/endpoints/v2.4/workflow-webhooks/workflow-run-failed"}]},{"group":"Disputes \u0026 Chargebacks Webhooks","pages":[{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /dispute-opened","playground":"none","title":"Dispute Open","href":"/api-reference/endpoints/v2.4/dispute-and-chargebacks-webhooks/dispute-open"},{"openapi":"https://api.schemas.primer.io/api-reference/v2.4/webhooks.yaml post /dispute-status","playground":"none","title":"Dispute Status","href":"/api-reference/endpoints/v2.4/dispute-and-chargebacks-webhooks/dispute-status"}]}]}]},{"anchor":"Changelogs","icon":"lines-leaning","pages":[{"title":"Changelog","url":"/changelogs/api-changelog","href":"/api-reference/changelog"}]}]},{"version":"v2.3","tag":"Supported","pages":[{"title":"v2.3","href":"/api-reference/get-started/v2.3/overview"}]},{"version":"v2.2","tag":"Supported","pages":[{"title":"v2.2","href":"/api-reference/get-started/v2.2/overview"}]},{"version":"v2.1","tag":"Supported","pages":[{"title":"v2.1","href":"/api-reference/get-started/v2.1/overview"}]},{"version":"v2","tag":"Supported","pages":[{"title":"v2","href":"/api-reference/get-started/v2/overview"}]}]},{"tab":"SDK Reference","anchors":[{"anchor":"Web","icon":"globe","groups":[{"group":"Web","pages":[{"title":"SDK reference overview","sidebarTitle":"Overview","href":"/sdk/primer-checkout-web/sdk-reference-overview"},{"title":"SDK options reference","sidebarTitle":"SDK options","href":"/sdk/primer-checkout-web/sdk-options-reference"},{"title":"Styling variables","href":"/sdk/primer-checkout-web/styling-variables"},{"title":"Events reference","sidebarTitle":"Events reference","href":"/sdk/primer-checkout-web/events-reference"},{"title":"Apple Pay options","sidebarTitle":"Apple Pay","href":"/sdk/primer-checkout-web/apple-pay"},{"title":"PayPal options","sidebarTitle":"PayPal","href":"/sdk/primer-checkout-web/paypal"},{"title":"Google Pay options","sidebarTitle":"Google Pay","href":"/sdk/primer-checkout-web/google-pay"},{"title":"Klarna options","sidebarTitle":"Klarna","href":"/sdk/primer-checkout-web/klarna"},{"title":"Klarna via Adyen options","sidebarTitle":"Klarna via Adyen","href":"/sdk/primer-checkout-web/adyen-klarna"},{"group":"Components","pages":[{"title":"Checkout component","sidebarTitle":"\u003cprimer-checkout>","href":"/sdk/primer-checkout-web/components/primer-checkout"},{"title":"Provider component","sidebarTitle":"\u003cprimer-provider>","href":"/sdk/primer-checkout-web/components/primer-provider"},{"title":"Main component","sidebarTitle":"\u003cprimer-main>","href":"/sdk/primer-checkout-web/components/primer-main"},{"title":"Payment Method Component","sidebarTitle":"\u003cprimer-payment-method>","href":"/sdk/primer-checkout-web/components/primer-payment-method"},{"title":"Payment Method Container","sidebarTitle":"\u003cprimer-payment-method-container>","href":"/sdk/primer-checkout-web/components/primer-payment-method-container"},{"group":"Card Form Components","pages":[{"title":"Card form","sidebarTitle":"\u003cprimer-card-form>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-card-form"},{"title":"Billing Address","sidebarTitle":"\u003cprimer-billing-address>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-billing-address"},{"title":"Card Number Input","sidebarTitle":"\u003cprimer-input-card-number>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-card-number"},{"title":"CVV Input","sidebarTitle":"\u003cprimer-input-cvv>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-cvv"},{"title":"Card Expiry Input","sidebarTitle":"\u003cprimer-input-card-expiry>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-card-expiry"},{"title":"Cardholder Name Input","sidebarTitle":"\u003cprimer-input-card-holder-name>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-card-holder-name"},{"title":"Card Form Submit Button","sidebarTitle":"\u003cprimer-card-form-submit>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-card-form-submit"},{"title":"Input Label","sidebarTitle":"\u003cprimer-input-label>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-label"},{"title":"Input Wrapper","sidebarTitle":"\u003cprimer-input-wrapper>","href":"/sdk/primer-checkout-web/components/primer-card-form/primer-input-wrapper"}]},{"title":"Vault Manager Component","sidebarTitle":"\u003cprimer-vault-manager>","href":"/sdk/primer-checkout-web/components/primer-vault-manager"},{"title":"Show Other Payments Component","sidebarTitle":"\u003cprimer-show-other-payments>","href":"/sdk/primer-checkout-web/components/primer-show-other-payments"},{"title":"Error Message Container","sidebarTitle":"\u003cprimer-error-message-container>","href":"/sdk/primer-checkout-web/components/primer-error-message-container"}]}]}]},{"anchor":"iOS","icon":"apple","versions":[{"version":"3.0.0-beta","groups":[{"group":"iOS","pages":[{"title":"Installation","sidebarTitle":"Installation","href":"/sdk/ios-checkout/v3.0.0-beta/installation"},{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","href":"/sdk/ios-checkout/v3.0.0-beta/troubleshooting"},{"group":"Guides","pages":[{"title":"Handle the payment result","sidebarTitle":"Handle payment result","href":"/sdk/ios-checkout/v3.0.0-beta/guides/handle-payment-result"},{"title":"Apple Pay integration","sidebarTitle":"Apple Pay","href":"/sdk/ios-checkout/v3.0.0-beta/guides/apple-pay-integration"},{"title":"UIKit integration","sidebarTitle":"UIKit integration","href":"/sdk/ios-checkout/v3.0.0-beta/guides/uikit-integration"},{"title":"SwiftUI navigation","sidebarTitle":"SwiftUI navigation","href":"/sdk/ios-checkout/v3.0.0-beta/guides/swiftui-navigation"}]},{"group":"API Reference","pages":[{"title":"API Reference","sidebarTitle":"API Reference","href":"/sdk/ios-checkout/v3.0.0-beta/api/overview"},{"group":"Core API","pages":[{"title":"PrimerCheckout","sidebarTitle":"PrimerCheckout","href":"/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout"},{"title":"PrimerCheckoutSession","sidebarTitle":"PrimerCheckoutSession","href":"/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout-session"},{"title":"PrimerCheckoutPresenter","sidebarTitle":"PrimerCheckoutPresenter","href":"/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout-presenter"},{"title":"PrimerCheckoutState","sidebarTitle":"PrimerCheckoutState","href":"/sdk/ios-checkout/v3.0.0-beta/api/primer-checkout-state"}]},{"group":"Card Form","pages":[{"title":"PrimerCardForm","sidebarTitle":"PrimerCardForm","href":"/sdk/ios-checkout/v3.0.0-beta/api/card-form/primer-card-form"},{"title":"PrimerCardFormSession","sidebarTitle":"PrimerCardFormSession","href":"/sdk/ios-checkout/v3.0.0-beta/api/card-form/card-form-session"},{"title":"CardFormDefaults","sidebarTitle":"CardFormDefaults","href":"/sdk/ios-checkout/v3.0.0-beta/api/card-form/card-form-defaults"},{"title":"Card Field Components","sidebarTitle":"Card Field Components","href":"/sdk/ios-checkout/v3.0.0-beta/api/card-form/card-field-components"}]},{"group":"Payment Methods","pages":[{"title":"PrimerPaymentMethods","sidebarTitle":"PrimerPaymentMethods","href":"/sdk/ios-checkout/v3.0.0-beta/api/payment-methods/primer-payment-methods"},{"title":"PrimerSelectionSession","sidebarTitle":"PrimerSelectionSession","href":"/sdk/ios-checkout/v3.0.0-beta/api/payment-methods/payment-methods-session"},{"title":"PaymentMethodsDefaults","sidebarTitle":"PaymentMethodsDefaults","href":"/sdk/ios-checkout/v3.0.0-beta/api/payment-methods/payment-methods-defaults"},{"title":"PrimerVaultedPaymentMethods","sidebarTitle":"PrimerVaultedPaymentMethods","href":"/sdk/ios-checkout/v3.0.0-beta/api/payment-methods/vaulted-payment-methods"}]},{"group":"Theming","pages":[{"title":"PrimerCheckoutTheme","sidebarTitle":"PrimerCheckoutTheme","href":"/sdk/ios-checkout/v3.0.0-beta/api/theming/primer-theme"},{"title":"Color Tokens","sidebarTitle":"Color Tokens","href":"/sdk/ios-checkout/v3.0.0-beta/api/theming/color-tokens"},{"title":"Spacing Tokens","sidebarTitle":"Spacing Tokens","href":"/sdk/ios-checkout/v3.0.0-beta/api/theming/spacing-tokens"},{"title":"Typography Tokens","sidebarTitle":"Typography Tokens","href":"/sdk/ios-checkout/v3.0.0-beta/api/theming/typography-tokens"},{"title":"Shape Tokens","sidebarTitle":"Shape Tokens","href":"/sdk/ios-checkout/v3.0.0-beta/api/theming/shape-tokens"}]},{"group":"Common Objects","pages":[{"title":"PrimerSettings","sidebarTitle":"PrimerSettings","href":"/sdk/ios-checkout/v3.0.0-beta/api/common/primer-settings"},{"title":"PrimerError","sidebarTitle":"PrimerError","href":"/sdk/ios-checkout/v3.0.0-beta/api/common/primer-error"},{"title":"Validation","sidebarTitle":"Validation","href":"/sdk/ios-checkout/v3.0.0-beta/api/common/validation-result"},{"title":"PrimerCardNetwork","sidebarTitle":"PrimerCardNetwork","href":"/sdk/ios-checkout/v3.0.0-beta/api/common/primer-card-network"},{"title":"PrimerCountry","sidebarTitle":"PrimerCountry","href":"/sdk/ios-checkout/v3.0.0-beta/api/common/primer-country"}]}]}]}]}]},{"anchor":"Android","icon":"android","versions":[{"version":"3.0.0-beta","groups":[{"group":"Android","pages":[{"title":"Installation","sidebarTitle":"Installation","href":"/sdk/android-checkout/v3.0.0-beta/installation"},{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","href":"/sdk/android-checkout/v3.0.0-beta/troubleshooting"},{"group":"API Reference","pages":[{"title":"API Reference","sidebarTitle":"API Reference","href":"/sdk/android-checkout/v3.0.0-beta/api/overview"},{"group":"Core API","pages":[{"title":"PrimerCheckoutController","sidebarTitle":"PrimerCheckoutController","href":"/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-controller"},{"title":"PrimerCheckoutState","sidebarTitle":"PrimerCheckoutState","href":"/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-state"},{"title":"Payment outcomes","sidebarTitle":"Payment outcomes","href":"/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-event"},{"title":"PrimerCheckoutSheet","sidebarTitle":"PrimerCheckoutSheet","href":"/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-sheet"},{"title":"PrimerCheckoutHost","sidebarTitle":"PrimerCheckoutHost","href":"/sdk/android-checkout/v3.0.0-beta/api/primer-checkout-host"}]},{"group":"Card Form","pages":[{"title":"PrimerCardForm","sidebarTitle":"PrimerCardForm","href":"/sdk/android-checkout/v3.0.0-beta/api/card-form/primer-card-form"},{"title":"PrimerCardFormController","sidebarTitle":"PrimerCardFormController","href":"/sdk/android-checkout/v3.0.0-beta/api/card-form/card-form-controller"},{"title":"CardFormDefaults","sidebarTitle":"CardFormDefaults","href":"/sdk/android-checkout/v3.0.0-beta/api/card-form/card-form-defaults"},{"title":"Card Field Components","sidebarTitle":"Card Field Components","href":"/sdk/android-checkout/v3.0.0-beta/api/card-form/card-field-components"}]},{"group":"Payment Methods","pages":[{"title":"PrimerPaymentMethods","sidebarTitle":"PrimerPaymentMethods","href":"/sdk/android-checkout/v3.0.0-beta/api/payment-methods/primer-payment-methods"},{"title":"PrimerPaymentMethodsController","sidebarTitle":"PrimerPaymentMethodsController","href":"/sdk/android-checkout/v3.0.0-beta/api/payment-methods/payment-methods-controller"},{"title":"PaymentMethodsDefaults","sidebarTitle":"PaymentMethodsDefaults","href":"/sdk/android-checkout/v3.0.0-beta/api/payment-methods/payment-methods-defaults"},{"title":"PrimerVaultedPaymentMethodsController","sidebarTitle":"VaultedPaymentMethodsController","href":"/sdk/android-checkout/v3.0.0-beta/api/payment-methods/vaulted-payment-methods-controller"}]},{"group":"Theming","pages":[{"title":"PrimerTheme","sidebarTitle":"PrimerTheme","href":"/sdk/android-checkout/v3.0.0-beta/api/theming/primer-theme"},{"title":"Color Tokens","sidebarTitle":"Color Tokens","href":"/sdk/android-checkout/v3.0.0-beta/api/theming/color-tokens"},{"title":"SpacingTokens","sidebarTitle":"SpacingTokens","href":"/sdk/android-checkout/v3.0.0-beta/api/theming/spacing-tokens"},{"title":"TypographyTokens","sidebarTitle":"TypographyTokens","href":"/sdk/android-checkout/v3.0.0-beta/api/theming/typography-tokens"},{"title":"Shape Tokens","sidebarTitle":"Shape Tokens","href":"/sdk/android-checkout/v3.0.0-beta/api/theming/shape-tokens"}]},{"group":"Common Objects","pages":[{"title":"PrimerSettings","sidebarTitle":"PrimerSettings","href":"/sdk/android-checkout/v3.0.0-beta/api/common/primer-settings"},{"title":"PrimerError","sidebarTitle":"PrimerError","href":"/sdk/android-checkout/v3.0.0-beta/api/common/primer-error"},{"title":"Validation","sidebarTitle":"Validation","href":"/sdk/android-checkout/v3.0.0-beta/api/common/validation-result"},{"title":"PrimerCardNetwork","sidebarTitle":"PrimerCardNetwork","href":"/sdk/android-checkout/v3.0.0-beta/api/common/primer-card-network"},{"title":"PrimerCountry","sidebarTitle":"PrimerCountry","href":"/sdk/android-checkout/v3.0.0-beta/api/common/primer-country"}]}]}]}]}]},{"anchor":"React Native","icon":"react","versions":[{"version":"v2.x.x","groups":[{"group":"React Native SDK","pages":[{"title":"React Native installation","sidebarTitle":"Installation","href":"/sdk/react-native/v2.x.x/installation"},{"group":"Primer","pages":[{"group":"Methods","pages":[{"title":"configure","href":"/sdk/react-native/v2.x.x/primer/methods/configure"},{"title":"showUniversalCheckout","href":"/sdk/react-native/v2.x.x/primer/methods/showUniversalCheckout"},{"title":"showVaultManager","href":"/sdk/react-native/v2.x.x/primer/methods/showVaultManager"},{"title":"showPaymentMethod","href":"/sdk/react-native/v2.x.x/primer/methods/showPaymentMethod"},{"title":"dismiss","href":"/sdk/react-native/v2.x.x/primer/methods/dismiss"}]}]},{"group":"PrimerHeadlessCheckout","pages":[{"group":"Assets manager","pages":[{"title":"getPaymentMethodResource","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodResource"},{"title":"getPaymentMethodResources","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodResources"},{"title":"getPaymentMethodAssets","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodAssets"},{"title":"getPaymentMethodAsset","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodAsset"},{"title":"getCardNetworkImage","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/assets-manager/getCardNetworkImage"}]},{"group":"Native UI manager","pages":[{"title":"constructor","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/native-ui-manager/constructor"},{"title":"configure","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/native-ui-manager/configure"},{"title":"showPaymentMethod","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/native-ui-manager/showPaymentMethod"}]},{"group":"Raw data manager","pages":[{"title":"constructor","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/constructor"},{"title":"configure","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/configure"},{"title":"getRequiredInputElementTypes","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/getRequiredInputElementTypes"},{"title":"setRawData","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/setRawData"},{"title":"submit","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/submit"},{"title":"cleanUp","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/raw-data-manager/cleanup"}]},{"group":"Component with redirect manager","pages":[{"title":"constructor","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/component-with-redirect-manager/constructor"},{"title":"provide","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide"}]},{"group":"Klarna headless manager","pages":[{"title":"constructor","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/klarna-headless-manager/constructor"},{"title":"provide","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/klarna-headless-manager/provide"}]},{"group":"ACH headless manager","pages":[{"title":"constructor","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/ach-headless-manager/constructor"},{"title":"provide","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/ach-headless-manager/provide"}]},{"group":"Vault manager","pages":[{"title":"configure","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/configure"},{"title":"fetchVaultedPaymentMethods","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods"},{"title":"deleteVaultedPaymentMethod","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/deleteVaultedPaymentMethod"},{"title":"validate","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/validate"},{"title":"startPaymentFlow","href":"/sdk/react-native/v2.x.x/primer-headless-checkout/vault-manager/startPaymentFlow"}]}]},{"group":"Common objects","pages":[{"title":"PrimerSettings","href":"/sdk/react-native/v2.x.x/common-objects/PrimerSettings"},{"title":"PrimerCheckoutData","href":"/sdk/react-native/v2.x.x/common-objects/PrimerCheckoutData"},{"title":"PrimerPaymentMethodTokenData","href":"/sdk/react-native/v2.x.x/common-objects/PrimerPaymentMethodTokenData"},{"title":"PrimerError","href":"/sdk/react-native/v2.x.x/common-objects/PrimerError"}]}]}]}]},{"anchor":"Legacy SDKs","icon":"clock-rotate-left","groups":[{"group":"Web SDK (v2.x.x)","pages":[{"group":"Getting started","pages":[{"title":"Web installation","sidebarTitle":"Installation","href":"/sdk/web/v2.x.x/installation"},{"title":"Handle redirects \u0026 deep links","sidebarTitle":"Handle redirects \u0026 deep links","href":"/sdk/web/v2.x.x/handle-redirects-and-deeplinks"}]},{"group":"Primer","pages":[{"group":"Methods","pages":[{"title":"showUniversalCheckout","href":"/sdk/web/v2.x.x/primer/methods/showUniversalCheckout"},{"title":"createHeadless","href":"/sdk/web/v2.x.x/primer/methods/createHeadless"},{"title":"showVaultManager","href":"/sdk/web/v2.x.x/primer/methods/showVaultManager"}]}]},{"group":"PrimerCheckout","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/sdk/web/v2.x.x/primer-checkout/overview"},{"group":"Methods","pages":[{"title":"refreshClientSession","href":"/sdk/web/v2.x.x/primer-checkout/methods/refreshClientSession"},{"title":"setPaymentCreationEnabled","href":"/sdk/web/v2.x.x/primer-checkout/methods/setPaymentCreationEnabled"},{"title":"setTokenizationEnabled","href":"/sdk/web/v2.x.x/primer-checkout/methods/setTokenizationEnabled"},{"title":"submit","href":"/sdk/web/v2.x.x/primer-checkout/methods/submit"},{"title":"teardown","href":"/sdk/web/v2.x.x/primer-checkout/methods/teardown"}]}]},{"group":"PrimerHeadlessCheckout","pages":[{"group":"Methods","pages":[{"title":"start","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/start"},{"title":"refreshClientSession","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/refreshClientSession"},{"title":"createPaymentMethodManager","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/createPaymentMethodManager"},{"title":"getAssetsManager","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/getAssetsManager"},{"title":"createVaultManager","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/createVaultManager"},{"title":"configure","href":"/sdk/web/v2.x.x/primer-headless-checkout/methods/configure"}]},{"group":"Types","pages":[{"title":"HeadlessHostedInput","href":"/sdk/web/v2.x.x/primer-headless-checkout/types/HeadlessHostedInput"},{"title":"HeadlessPaymentMethodButton","href":"/sdk/web/v2.x.x/primer-headless-checkout/types/HeadlessPaymentMethodButton"}]}]},{"group":"CheckoutStyle","pages":[{"title":"Overview","sidebarTitle":"Overview","href":"/sdk/web/v2.x.x/checkout-style/Overview"},{"title":"InputStyle","href":"/sdk/web/v2.x.x/checkout-style/InputStyle"},{"title":"BaseInputStyle","href":"/sdk/web/v2.x.x/checkout-style/BaseInputStyle"},{"title":"TextStyle","href":"/sdk/web/v2.x.x/checkout-style/TextStyle"},{"title":"SavedPaymentMethodButtonStyle","href":"/sdk/web/v2.x.x/checkout-style/SavedPaymentMethodButtonStyle"},{"title":"BaseSavedPaymentMethodButtonStyle","href":"/sdk/web/v2.x.x/checkout-style/BaseSavedPaymentMethodButtonStyle"},{"title":"SubmitButtonStyle","href":"/sdk/web/v2.x.x/checkout-style/SubmitButtonStyle"},{"title":"BaseSubmitButtonStyle","href":"/sdk/web/v2.x.x/checkout-style/BaseSubmitButtonStyle"}]},{"group":"Common objects","pages":[{"title":"PrimerClientError","href":"/sdk/web/v2.x.x/common-objects/PrimerClientError"}]},{"group":"Constants","pages":[{"title":"Card networks","sidebarTitle":"Card networks","href":"/sdk/web/v2.x.x/constants/card-networks"},{"title":"Payment method types","sidebarTitle":"Payment method types","href":"/sdk/web/v2.x.x/constants/payment-method-types"},{"title":"Payment instrument types","sidebarTitle":"Payment instrument types","href":"/sdk/web/v2.x.x/constants/payment-instrument-types"}]}]},{"group":"iOS SDK (v2.x.x)","pages":[{"group":"Getting started","pages":[{"title":"iOS installation","sidebarTitle":"Installation","href":"/sdk/ios/v2.x.x/installation"},{"title":"Handle redirects \u0026 deep links","sidebarTitle":"Handle redirects \u0026 deep links","href":"/sdk/ios/v2.x.x/handle-redirects-and-deeplinks"}]},{"group":"Primer","pages":[{"group":"Methods","pages":[{"title":"configure","href":"/sdk/ios/v2.x.x/primer/methods/configure"},{"title":"showUniversalCheckout","href":"/sdk/ios/v2.x.x/primer/methods/showUniversalCheckout"},{"title":"showVaultManager","href":"/sdk/ios/v2.x.x/primer/methods/showVaultManager"},{"title":"dismiss","href":"/sdk/ios/v2.x.x/primer/methods/dismiss"}]},{"group":"Delegates","pages":[{"title":"PrimerDelegate","href":"/sdk/ios/v2.x.x/primer/delegates/PrimerDelegate"}]},{"group":"Properties","pages":[{"title":"logger","href":"/sdk/ios/v2.x.x/primer/properties/logger"}]}]},{"group":"PrimerHeadlessUniversalCheckout","pages":[{"group":"Properties","pages":[{"title":"delegate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/properties/delegate"}]},{"group":"Methods","pages":[{"title":"start","href":"/sdk/ios/v2.x.x/primer-headless-checkout/methods/start"},{"title":"cleanUp","href":"/sdk/ios/v2.x.x/primer-headless-checkout/methods/cleanUp"}]},{"group":"Delegates","pages":[{"title":"PrimerHeadlessUniversalCheckoutDelegate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/delegates/PrimerHeadlessUniversalCheckoutDelegate"},{"title":"PrimerHeadlessUniversalCheckoutUIDelegate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/delegates/PrimerHeadlessUniversalCheckoutUIDelegate"}]},{"group":"Assets manager","pages":[{"title":"getPaymentMethodAssets","href":"/sdk/ios/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodAssets"},{"title":"getPaymentMethodAsset","href":"/sdk/ios/v2.x.x/primer-headless-checkout/assets-manager/getPaymentMethodAsset"},{"title":"getCardNetworkAsset","href":"/sdk/ios/v2.x.x/primer-headless-checkout/assets-manager/getCardNetworkAsset"},{"title":"getCardNetworkImage","href":"/sdk/ios/v2.x.x/primer-headless-checkout/assets-manager/getCardNetworkImage"}]},{"group":"Native UI manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/native-ui-manager/init"},{"title":"showPaymentMethod","href":"/sdk/ios/v2.x.x/primer-headless-checkout/native-ui-manager/showPaymentMethod"}]},{"group":"Raw data manager","pages":[{"title":"delegate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager/delegate"},{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager/init"},{"title":"configure","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager/configure"},{"title":"listRequiredInputElementTypes","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager/listRequiredInputElementTypes"},{"title":"submit","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager/submit"}]},{"group":"Raw data manager delegate","pages":[{"title":"PrimerHeadlessUniversalCheckoutRawDataManagerDelegate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/raw-data-manager-delegate/PrimerHeadlessUniversalCheckoutRawDataManagerDelegate"}]},{"group":"NOL pay manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/init"},{"title":"provideNolPayLinkedCardsComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayLinkedCardsComponent"},{"title":"provideNolPayLinkCardComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayLinkCardComponent"},{"title":"provideNolPayUnlinkCardComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayUnlinkCardComponent"},{"title":"provideNolPayPaymentComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayPaymentComponent"},{"title":"PrimerNolPaymentCard","href":"/sdk/ios/v2.x.x/primer-headless-checkout/nol-pay-manager/PrimerNolPaymentCard"}]},{"group":"Component with redirect manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/init"},{"title":"provide","href":"/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide"},{"title":"provideBanksComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provideBanksComponent"},{"title":"provideComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provideComponent"},{"title":"PrimerHeadlessMainComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/component-with-redirect-manager/PrimerHeadlessMainComponent"}]},{"group":"Klarna headless manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/klarna-headless-manager/init"},{"title":"provideKlarnaComponent","href":"/sdk/ios/v2.x.x/primer-headless-checkout/klarna-headless-manager/provideKlarnaComponent"}]},{"group":"ACH headless manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/ach-headless-manager/init"},{"title":"provide","href":"/sdk/ios/v2.x.x/primer-headless-checkout/ach-headless-manager/provide"}]},{"group":"Vault manager","pages":[{"title":"init","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/init"},{"title":"configure","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/configure"},{"title":"fetchVaultedPaymentMethods","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods"},{"title":"deleteVaultedPaymentMethod","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/deleteVaultedPaymentMethod"},{"title":"validate","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/validate"},{"title":"startPaymentFlow","href":"/sdk/ios/v2.x.x/primer-headless-checkout/vault-manager/startPaymentFlow"}]}]},{"group":"Common objects","pages":[{"title":"PrimerSessionIntent","href":"/sdk/ios/v2.x.x/common-objects/PrimerSessionIntent"},{"title":"PrimerSettings","href":"/sdk/ios/v2.x.x/common-objects/PrimerSettings"},{"title":"PrimerPaymentMethodTokenData","href":"/sdk/ios/v2.x.x/common-objects/PrimerPaymentMethodTokenData"},{"title":"PaymentMethod","href":"/sdk/ios/v2.x.x/common-objects/PaymentMethod"},{"title":"PrimerError","href":"/sdk/ios/v2.x.x/common-objects/PrimerError"},{"title":"PrimerValidationError","href":"/sdk/ios/v2.x.x/common-objects/PrimerValidationError"}]}]},{"group":"Android SDK (v2.x.x)","pages":[{"title":"Android installation","sidebarTitle":"Installation","href":"/sdk/android/v2.x.x/installation"},{"group":"Primer","pages":[{"group":"Methods","pages":[{"title":"configure","href":"/sdk/android/v2.x.x/primer/methods/configure"},{"title":"showUniversalCheckout","href":"/sdk/android/v2.x.x/primer/methods/showUniversalCheckout"},{"title":"showVaultManager","href":"/sdk/android/v2.x.x/primer/methods/showVaultManager"},{"title":"showPaymentMethod","href":"/sdk/android/v2.x.x/primer/methods/showPaymentMethod"},{"title":"dismiss","href":"/sdk/android/v2.x.x/primer/methods/dismiss"},{"title":"cleanup","href":"/sdk/android/v2.x.x/primer/methods/cleanup"}]},{"group":"Listeners","pages":[{"title":"PrimerCheckoutListener","href":"/sdk/android/v2.x.x/primer/listeners/PrimerCheckoutListener"}]}]},{"group":"PrimerHeadlessUniversalCheckout","pages":[{"group":"Methods","pages":[{"title":"start","href":"/sdk/android/v2.x.x/primer-headless-checkout/methods/start"},{"title":"setCheckoutListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/methods/setCheckoutListener"},{"title":"setCheckoutUiListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/methods/setCheckoutUiListener"},{"title":"cleanup","href":"/sdk/android/v2.x.x/primer-headless-checkout/methods/cleanup"}]},{"group":"Listeners","pages":[{"title":"PrimerHeadlessUniversalCheckoutListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener"},{"title":"PrimerHeadlessUniversalCheckoutUiListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutUiListener"}]},{"group":"Assets Managers","pages":[{"title":"getPaymentMethodResources","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getPaymentMethodResources"},{"title":"getPaymentMethodResource","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getPaymentMethodResource"},{"title":"getPaymentMethodAssets","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getPaymentMethodAssets"},{"title":"getPaymentMethodAsset","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getPaymentMethodAsset"},{"title":"getCardNetworkAsset","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getCardNetworkAsset"},{"title":"getCardNetworkImage","href":"/sdk/android/v2.x.x/primer-headless-checkout/assets-managers/getCardNetworkImage"}]},{"group":"Native UI manager","pages":[{"title":"newInstance","href":"/sdk/android/v2.x.x/primer-headless-checkout/native-ui-manager/newInstance"},{"title":"showPaymentMethod","href":"/sdk/android/v2.x.x/primer-headless-checkout/native-ui-manager/showPaymentMethod"}]},{"group":"Raw Data manager","pages":[{"title":"newInstance","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/newInstance"},{"title":"configure","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/configure"},{"title":"getRequiredInputElementTypes","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/getRequiredInputElementTypes"},{"title":"setListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/setListener"},{"title":"setRawData","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/setRawData"},{"title":"submit","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/submit"},{"title":"cleanup","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager/cleanup"}]},{"group":"Raw Data Manager Listener","pages":[{"title":"PrimerHeadlessUniversalCheckoutRawDataManagerListener","href":"/sdk/android/v2.x.x/primer-headless-checkout/raw-data-manager-listener/PrimerHeadlessUniversalCheckoutRawDataManagerListener"}]},{"group":"NOL Pay manager","pages":[{"title":"init","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/init"},{"title":"provideNolPayLinkedCardsComponent","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayLinkedCardsComponent"},{"title":"provideNolPayNfcComponent","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayNfcComponent"},{"title":"provideNolPayLinkCardComponent","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayLinkCardComponent"},{"title":"provideNolPayUnlinkCardComponent","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayUnlinkCardComponent"},{"title":"provideNolPayPaymentComponent","sidebarTitle":"Provide nol Pay Payment Component","href":"/sdk/android/v2.x.x/primer-headless-checkout/nol-pay-manager/provideNolPayPaymentComponent"}]},{"group":"Component With Redirect manager","pages":[{"title":"init","href":"/sdk/android/v2.x.x/primer-headless-checkout/component-with-redirect-manager/init"},{"title":"provide","href":"/sdk/android/v2.x.x/primer-headless-checkout/component-with-redirect-manager/provide"}]},{"group":"Klarna Headless manager","pages":[{"title":"init","href":"/sdk/android/v2.x.x/primer-headless-checkout/klarna-headless-manager/init"},{"title":"provideKlarnaComponent","href":"/sdk/android/v2.x.x/primer-headless-checkout/klarna-headless-manager/provideKlarnaComponent"}]},{"group":"ACH Headless manager","pages":[{"title":"init","href":"/sdk/android/v2.x.x/primer-headless-checkout/ach-headless-manager/init"},{"title":"provide","href":"/sdk/android/v2.x.x/primer-headless-checkout/ach-headless-manager/provide"}]},{"group":"Vault manager","pages":[{"title":"newInstance","href":"/sdk/android/v2.x.x/primer-headless-checkout/vault-manager/newInstance"},{"title":"fetchVaultedPaymentMethods","href":"/sdk/android/v2.x.x/primer-headless-checkout/vault-manager/fetchVaultedPaymentMethods"},{"title":"deleteVaultedPaymentMethod","href":"/sdk/android/v2.x.x/primer-headless-checkout/vault-manager/deleteVaultedPaymentMethod"},{"title":"validate","href":"/sdk/android/v2.x.x/primer-headless-checkout/vault-manager/validate"},{"title":"startPaymentFlow","href":"/sdk/android/v2.x.x/primer-headless-checkout/vault-manager/startPaymentFlow"}]}]},{"group":"Logging","pages":[{"title":"PrimerLogger","href":"/sdk/android/v2.x.x/logging/PrimerLogger"}]},{"group":"Common objects","pages":[{"title":"PrimerSessionIntent","href":"/sdk/android/v2.x.x/common-objects/PrimerSessionIntent"},{"title":"PrimerSettings","href":"/sdk/android/v2.x.x/common-objects/PrimerSettings"},{"title":"PrimerCheckoutData","href":"/sdk/android/v2.x.x/common-objects/PrimerCheckoutData"},{"title":"PrimerPaymentMethodData","href":"/sdk/android/v2.x.x/common-objects/PrimerPaymentMethodData"},{"title":"PrimerPaymentMethodTokenData","href":"/sdk/android/v2.x.x/common-objects/PrimerPaymentMethodTokenData"},{"title":"PrimerError","href":"/sdk/android/v2.x.x/common-objects/PrimerError"},{"title":"PrimerValidationError","href":"/sdk/android/v2.x.x/common-objects/PrimerValidationError"},{"title":"PrimerInputValidationError","href":"/sdk/android/v2.x.x/common-objects/PrimerInputValidationError"}]}]}]},{"anchor":"Lifecycle","icon":"clock","groups":[{"group":"Lifecycle","pages":[{"title":"SDK lifecycle","sidebarTitle":"Overview","href":"/sdk/lifecycle"}]}]}]},{"tab":"Connections","pages":[{"title":"Connections","href":"/connections/processors/overview"}]},{"tab":"Changelogs","pages":[{"title":"Changelogs","href":"/changelogs/api-changelog"}]}]},"basePath":"","title":"Events guide - Primer","buildId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","deploymentId":"dpl_BSPUBxEoKhhK7HzXVDPxdPvWx4xc","dynamics":[],"chunks":[]}