# adyen/adyen-ios architecture

> Architecture diagram of the GitHub repository adyen/adyen-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adyen/adyen-ios
- Repository: https://github.com/adyen/adyen-ios

## Overview

Adyen iOS is a Swift SDK for building shopper checkout flows from individual payment components. The documented session workflow starts with merchant configuration and a backend-created session, sets up Checkout, creates a component for a payment method, and reports completion or failure through callbacks; Adyen manages submission and returned actions in this flow. The graph also preserves card entry, shared UI/theming, and action handling. Several relationships are documented in the README; source excerpts are limited, so unsampled integrations are not inferred.

Main entry points: [`AdyenCheckout/Flows/SessionCheckout.swift`](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Flows/SessionCheckout.swift) (Checkout setup), [`AdyenCheckout/Component/CheckoutComponentBuilder.swift`](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Component/CheckoutComponentBuilder.swift) (Component creation), [`Adyen/Core/Core Protocols/PaymentComponent.swift`](https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/Core%20Protocols/PaymentComponent.swift) (Payment component), [`AdyenCard/Components/Card/CardViewController.swift`](https://github.com/adyen/adyen-ios/blob/develop/AdyenCard/Components/Card/CardViewController.swift) (Card entry form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout["Checkout flow"]
  node_checkout_setup["Checkout setup"]
  node_configuration["Checkout configuration"]
  node_session["Session response"]
  node_component_creation["Component creation"]
  node_callbacks["Flow callbacks"]
  node_result["Checkout result"]
end

subgraph group_payments["Payment components"]
  node_payment_methods["Payment methods"]
  node_payment_component["Payment component"]
  node_card_component["Card component"]
  node_card_form["Card entry form"]
  node_other_components["Other components"]
end

subgraph group_actions["Payment actions"]
  node_action_handling["Action handling"]
  node_action_components["Action components"]
end

subgraph group_shared["Shared platform"]
  node_core_context["Core context<br/>[AdyenContext.swift]"]
  node_api_client["Session API client"]
  node_shared_ui["Shared UI"]
  node_theme["Checkout theme"]
end

node_merchant(("Merchant app"))
node_shopper(("Shopper"))
node_backend(("Merchant backend"))

node_merchant -->|"configures"| node_configuration
node_backend -->|"creates session"| node_session
node_merchant -->|"sets up"| node_checkout_setup
node_configuration -->|"configures"| node_checkout_setup
node_session -->|"initializes"| node_checkout_setup
node_checkout_setup -->|"creates"| node_component_creation
node_merchant -->|"selects method"| node_component_creation
node_payment_methods -.->|"provides choices"| node_payment_component
node_component_creation -->|"returns component"| node_payment_component
node_payment_component -.->|"specializes as"| node_card_component
node_shopper -.->|"enters details"| node_card_form
node_card_component -->|"renders"| node_card_form
node_card_form -->|"uses form"| node_shared_ui
node_component_creation -->|"creates payment UI"| node_other_components
node_payment_component -->|"handles returned action"| node_action_handling
node_action_handling -.->|"dispatches action"| node_action_components
node_checkout_setup -.->|"uses shared context"| node_core_context
node_session -.->|"supports session flow"| node_api_client
node_merchant -->|"customizes"| node_theme
node_shared_ui -.->|"applies styling"| node_theme
node_checkout_setup -->|"registers callbacks"| node_callbacks
node_callbacks -->|"reports completion"| node_result
node_checkout_setup -->|"submits payment"| node_backend

click node_checkout_setup "https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Flows/SessionCheckout.swift"
click node_configuration "https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/CheckoutConfiguration/CheckoutConfiguration.swift"
click node_component_creation "https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Component/CheckoutComponentBuilder.swift"
click node_callbacks "https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Callbacks/CheckoutCallbackHandlers.swift"
click node_payment_methods "https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/Payment%20Methods/Abstract/PaymentMethods.swift"
click node_payment_component "https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/Core%20Protocols/PaymentComponent.swift"
click node_card_component "https://github.com/adyen/adyen-ios/blob/develop/AdyenCard/Components/Card/CardComponent.swift"
click node_card_form "https://github.com/adyen/adyen-ios/blob/develop/AdyenCard/Components/Card/CardViewController.swift"
click node_other_components "https://github.com/adyen/adyen-ios/tree/develop/AdyenComponents"
click node_action_handling "https://github.com/adyen/adyen-ios/blob/develop/AdyenActions/CheckoutActionComponent.swift"
click node_action_components "https://github.com/adyen/adyen-ios/tree/develop/AdyenActions/Components"
click node_core_context "https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/AdyenContext/AdyenContext.swift"
click node_api_client "https://github.com/adyen/adyen-ios/blob/develop/AdyenSession/API/SessionAPIClient.swift"
click node_shared_ui "https://github.com/adyen/adyen-ios/blob/develop/AdyenUI/UI/Form/FormViewController.swift"
click node_theme "https://github.com/adyen/adyen-ios/blob/develop/AdyenUI/CheckoutTheme.swift"
click node_result "https://github.com/adyen/adyen-ios/blob/develop/Adyen/ResponseModels/SessionCheckoutResult.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_checkout_setup,node_configuration,node_session,node_component_creation,node_callbacks,node_result toneBlue
class node_payment_methods,node_payment_component,node_card_component,node_card_form,node_other_components toneAmber
class node_action_handling,node_action_components toneMint
class node_core_context,node_api_client,node_shared_ui,node_theme toneRose
class node_merchant,node_shopper,node_backend toneIndigo
```

## Components

### Checkout flow

- [Checkout setup](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Flows/SessionCheckout.swift): `AdyenCheckout/Flows/SessionCheckout.swift`
- [Checkout configuration](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/CheckoutConfiguration/CheckoutConfiguration.swift): `AdyenCheckout/CheckoutConfiguration/CheckoutConfiguration.swift`
- **Session response**
- [Component creation](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Component/CheckoutComponentBuilder.swift): `AdyenCheckout/Component/CheckoutComponentBuilder.swift`
- [Flow callbacks](https://github.com/adyen/adyen-ios/blob/develop/AdyenCheckout/Callbacks/CheckoutCallbackHandlers.swift): `AdyenCheckout/Callbacks/CheckoutCallbackHandlers.swift`
- [Checkout result](https://github.com/adyen/adyen-ios/blob/develop/Adyen/ResponseModels/SessionCheckoutResult.swift): `Adyen/ResponseModels/SessionCheckoutResult.swift`

### Payment components

- [Payment methods](https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/Payment%20Methods/Abstract/PaymentMethods.swift): `Adyen/Core/Payment Methods/Abstract/PaymentMethods.swift`
- [Payment component](https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/Core%20Protocols/PaymentComponent.swift): `Adyen/Core/Core Protocols/PaymentComponent.swift`
- [Card component](https://github.com/adyen/adyen-ios/blob/develop/AdyenCard/Components/Card/CardComponent.swift): `AdyenCard/Components/Card/CardComponent.swift`
- [Card entry form](https://github.com/adyen/adyen-ios/blob/develop/AdyenCard/Components/Card/CardViewController.swift): `AdyenCard/Components/Card/CardViewController.swift`
- [Other components](https://github.com/adyen/adyen-ios/tree/develop/AdyenComponents): `AdyenComponents`

### Payment actions

- [Action handling](https://github.com/adyen/adyen-ios/blob/develop/AdyenActions/CheckoutActionComponent.swift): `AdyenActions/CheckoutActionComponent.swift`
- [Action components](https://github.com/adyen/adyen-ios/tree/develop/AdyenActions/Components): `AdyenActions/Components`

### Shared platform

- [Core context](https://github.com/adyen/adyen-ios/blob/develop/Adyen/Core/AdyenContext/AdyenContext.swift): `Adyen/Core/AdyenContext/AdyenContext.swift`
- [Session API client](https://github.com/adyen/adyen-ios/blob/develop/AdyenSession/API/SessionAPIClient.swift): `AdyenSession/API/SessionAPIClient.swift`
- [Shared UI](https://github.com/adyen/adyen-ios/blob/develop/AdyenUI/UI/Form/FormViewController.swift): `AdyenUI/UI/Form/FormViewController.swift`
- [Checkout theme](https://github.com/adyen/adyen-ios/blob/develop/AdyenUI/CheckoutTheme.swift): `AdyenUI/CheckoutTheme.swift`

### Other components

- **Merchant app**
- **Shopper**
- **Merchant backend**

## Connections

- Merchant app → Checkout configuration: configures
- Merchant backend → Session response: creates session
- Merchant app → Checkout setup: sets up
- Checkout configuration → Checkout setup: configures
- Session response → Checkout setup: initializes
- Checkout setup → Component creation: creates
- Merchant app → Component creation: selects method
- Payment methods → Payment component: provides choices
- Component creation → Payment component: returns component
- Payment component → Card component: specializes as
- Shopper → Card entry form: enters details
- Card component → Card entry form: renders (evidence: `AdyenCard/Components/Card/CardViewController.swift`)
- Card entry form → Shared UI: uses form (evidence: `AdyenCard/Components/Card/CardViewController.swift`)
- Component creation → Other components: creates payment UI
- Payment component → Action handling: handles returned action
- Action handling → Action components: dispatches action
- Checkout setup → Core context: uses shared context
- Session response → Session API client: supports session flow
- Merchant app → Checkout theme: customizes
- Shared UI → Checkout theme: applies styling (evidence: `AdyenUI/UI/Form/FormViewController.swift`)
- Checkout setup → Flow callbacks: registers callbacks
- Flow callbacks → Checkout result: reports completion
- Checkout setup → Merchant backend: submits payment
