> ## 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.

# iOS 参考

> 查阅所有 iOS SDK 参数、YunoConfig 选项和注册 delegate 配置

> [!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.

所有 Yuno iOS SDK 流程的参数、自定义项和高级功能。有关集成设置，请参阅[支付流程（iOS）](https://docs.y.uno/docs/sdks/full-checkout/ios-payments)、[注册流程（iOS）](https://docs.y.uno/zh-hans/docs/sdks/card-enrollment/ios-enrollment.md)和[集成模式](https://docs.y.uno/zh-hans/docs/sdks/overview/choose-integration.md)。

## 关键参数（创建结账会话）

在您的 backend 上为支付流程创建结账会话时，以下参数在各 iOS SDK 中较为常用：

| 参数 | 必填 | 描述 |
| - | - | - |
| `amount` | 是 | 主要交易金额对象，包含 `currency`（ISO 4217 代码）和 `value`（以该币种表示的数值金额）。 |
| `alternative_amount` | 否 | 交易金额的另一种币种表示，结构与 `amount` 相同（`currency` 和 `value`）。适用于多币种场景。例如，您可以用客户偏好的币种（例如 USD）向其展示价格，同时以本地币种（例如 COP）处理支付。 |

## 支付参数（完整参考）

支付流程的参数。[支付流程（iOS）](https://docs.y.uno/docs/sdks/full-checkout/ios-payments)中使用的所有参数都在此处详细列出。

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `checkoutSession` | string | 是 | 来自您 backend 的结账会话 ID（创建结账会话 API）。所有支付流程均需要。 |
| `countryCode` | string | 是 | 支付发生地的 ISO 国家/地区代码（例如 `BR`、`US`）。决定可用的支付方式和合规要求。 |
| `language` | string | 否 | SDK UI 的语言代码（例如 `en`、`pt-BR`）。可选。请参阅[支持的语言](https://docs.y.uno/zh-hans/docs/sdks/resources/languages-supported.md)（如可用）。 |
| `viewController` | UIViewController | 是\* | 呈现支付流程的视图控制器。SDK 使用它来呈现模态框并捕获结果。 |
| `yunoCreatePayment(with:)` | delegate | 是 | Delegate 方法：使用 SDK 提供的一次性令牌在您的 backend 上创建支付。通过 API 创建支付后，通知 SDK，使其能够继续流程。 |
| `yunoPaymentResult(_:)` | delegate | 否 | Delegate 方法：在支付流程结束时调用。接收一个 `Yuno.Result` 枚举值（`.succeeded`、`.fail`、`.processing`、`.reject`、`.userCancelled`、`.internalError`）。这些值对应[支付状态](https://docs.y.uno/reference/getting-started/response-codes.md)。用于 UI 更新或导航。 |

## YunoConfig 选项（初始化）

调用 `Yuno.initialize(apiKey:config:)` 时，通过 `YunoConfig` 配置运行时行为和外观。iOS 支付和注册流程中使用的所有参数如下所列。有关视觉样式（字体、颜色、按钮），请参阅 [SDK 自定义（iOS）](https://docs.y.uno/zh-hans/docs/sdks/customization/ios.md)。

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `appearance` | Appearance | 否 | 自定义外观（字体、颜色、按钮）。使用 `Yuno.Appearance(...)` 设置 `fontFamily`、`accentColor`、`buttonBackgroundColor`、`buttonTitleColor` 及相关字段。有关所有选项，请参阅 [SDK 自定义（iOS）](https://docs.y.uno/zh-hans/docs/sdks/customization/ios.md)。 |
| `saveCardEnabled` | boolean | 否 | 为 `true` 时，允许用户在支付过程中保存或注册卡片。需要 backend 支持卡片存储。 |

## 注册参数（完整参考）

注册流程的参数。[注册流程（iOS）](https://docs.y.uno/zh-hans/docs/sdks/card-enrollment/ios-enrollment.md)中使用的所有参数都在此处详细列出。

| 参数 | 类型 | 必填 | 描述 |
| - | - | - | - |
| `customerSession` | string | 是 | 来自创建客户会话 API 的客户会话 ID。必填。将注册的支付方式与特定客户关联。 |
| `countryCode` | string | 是 | ISO 国家/地区代码（例如 `BR`、`US`）。注册时必填。 |
| `language` | string | 否 | SDK UI 的语言代码。可选。 |
| `viewController` | UIViewController | 是\* | 呈现注册流程的视图控制器。基于 delegate 的注册必填。 |
| `yunoEnrollmentResult(_:)` | delegate | 否 | Delegate 方法：在注册结束时调用。接收结果（例如存储令牌、状态）。用于 UI 更新或导航。 |
| `YunoConfig` | YunoConfig | 否 | 与支付相同的选项（例如 `appearance`、`saveCardEnabled`、`keepLoader`）。请参阅前文的 [YunoConfig 选项（初始化）](#yunoconfig-options-initialize)。 |

## 注册支付方式

您可以在支付流程中注册支付方式（存储卡片以供将来使用），也可以通过专用的注册流程进行注册。对于支付流程，请在 `YunoConfig` 中启用保存卡片，并在支持的情况下于创建结账会话时设置 `payment_method.vault_on_success`（或等效参数）。有关专用注册，请参阅[注册流程（iOS）](https://docs.y.uno/zh-hans/docs/sdks/card-enrollment/ios-enrollment.md)。


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