> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Lite SDK (Payment iOS)

> Intégrez le Lite SDK sur iOS pour une expérience de checkout de paiement par carte simplifiée

> [!NOTE]
>
> **This page documents a legacy SDK.** Starting a new integration? Use the [Yuno SDK](https://docs.y.uno/docs/yuno-sdk/get-started.md). Already on a legacy SDK? Follow the [migration guide](https://docs.y.uno/docs/yuno-sdk/migration/overview.md).
>
> The new **Yuno SDK** (Web v2.x, iOS v3.x, Android v3.x, React Native v2.x) replaces the Full, Lite, Seamless, Render, Headless, and Secure Fields SDKs with one API across every platform. Legacy SDKs remain supported side by side during the transition and are scheduled for deprecation in **2027**. Contact your Account Manager for migration planning.

> [!WARNING]
>
> **Orientation: Choosing Your Integration Flow**, before you begin, please review the [Official Integration Flow](https://docs.y.uno/docs/sdks/overview/understanding-flows.md).
>
> * **Standard Flow ([Full Checkout](https://docs.y.uno/docs/sdks/full-checkout/web-payments))**: Recommended for most merchants. Yuno handles the UI, security, and automatic updates for payment methods.
> * **Custom Flow (This SDK)**: Use this only if you require full control over the UX. **Note**: You will be responsible for manually handling payment statuses, 3DS transitions, and fraud routing data collection.

## Étape 1 : inclure la bibliothèque dans votre projet

### Swift Package Manager

YunoSDK n'est plus publié sur CocoaPods ; la dernière version CocoaPods est la 2.30.0. Ajoutez le package comme dépendance :

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
.package(url: "https://github.com/yuno-payments/yuno-sdk-ios.git", .upToNextMajor(from: "2.31.0"))
```

Ajoutez `YunoSDK` (dynamique) ou `YunoSDK-Static` (statique, ce que CocoaPods distribuait) à la cible de votre application, jamais les deux.

## Étape 2 : initialiser le SDK

Initialisez le SDK avec votre clé d'API publique :

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
import YunoSDK

Yuno.initialize(
    apiKey: "PUBLIC_API_KEY",
    config: YunoConfig(),
    callback: { print("Yuno SDK initialized") }
)
```

## Étape 3 : adopter YunoPaymentDelegate

Adoptez le protocole `YunoPaymentDelegate` :

> [!NOTE]
>
> **Exigences de concurrence de Swift 6**
>
> Si vous utilisez Swift 6, vous devrez implémenter le protocole `YunoPaymentDelegate` en tenant compte de contraintes de concurrence spécifiques. Consultez le guide [Swift 6 Concurrency](https://docs.y.uno/fr/docs/sdks/resources/swift-6-concurrency.md) pour les options d'implémentation détaillées et les bonnes pratiques.

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
class ViewController: UIViewController, @preconcurrency YunoPaymentDelegate {
    var checkoutSession: String { "checkout_session" }
    var countryCode: String { "US" }
    var viewController: UIViewController? { self }

    func yunoCreatePayment(with token: String) {
        // Call your backend to create a payment
    }

    func yunoCreatePayment(with token: String, information: [String: Any]) {
        // Call your backend to create a payment using the additional token information
    }

    func yunoPaymentResult(_ result: Yuno.Result) {
        // Handle final payment state
    }
}
```

| Méthode | Description |
| :- | :- |
| `yunoCreatePayment(with:)` | Appelée lorsqu'un jeton à usage unique est généré. Créez le paiement sur votre backend. |
| `yunoCreatePayment(with:information:)` | Callback alternatif qui inclut aussi des informations supplémentaires sur le jeton à usage unique, comme les données de la carte (BIN du DPAN, marque, quatre derniers chiffres). Consultez [OTT additional information](https://docs.y.uno/docs/sdks/full-checkout/ios-payments#ott-additional-information) pour les clés disponibles. |
| `yunoPaymentResult(_:)` | Appelée lorsque le processus de paiement se termine. Reçoit une valeur `Yuno.Result`. |

> [!CAUTION]
>
> **Remarque importante**
>
> Implémentez soit `yunoCreatePayment(with:)` **soit** `yunoCreatePayment(with:information:)`, pas les deux. Le SDK appelle chaque version que vous implémentez : implémenter les deux crée donc le paiement deux fois.

## Étape 4 : lancer le processus de paiement

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
Yuno.startPaymentLite(
    with: self,
    paymentSelected: paymentSelected,
    showPaymentStatus: true
)
```

## Étape 5 : poursuivre le paiement (obligatoire)

Si l'API retourne `sdk_action_required: true`, appelez :

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
Yuno.continuePayment()
```

> [!NOTE]
>
> **Application de démonstration**
>
> Consultez le [dépôt du Yuno iOS SDK](https://github.com/yuno-payments/yuno-sdk-ios) pour des exemples d'implémentation complets.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.