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

# Seamless SDK

> Yuno 的 Seamless SDK 提供简单高效的集成，同时让您完全控制支付体验。

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

与 [Lite SDK](https://docs.y.uno/zh-hans/docs/sdks/overview/quickstart.md) 一样，Seamless SDK 让您可以获取可用的支付方式，并决定在 checkout 期间展示哪些方式。完成选择后，只需一次 API 和 SDK 调用即可完成支付流程，带来与 Lite SDK 相同的体验。

使用 Seamless SDK 时，您可以：

* 执行支付流程。
* 在创建支付时设置 `vault_on_success: true`，从而在付款的同时注册信用卡。
* 使用已注册支付方式的存储令牌完成支付。

请使用以下指南实现每个流程。

![Seamless SDK 概览](https://files.readme.io/bb2c987a467228d113d98035f453a459aedfb41554aad3eb49fc50fed8dbf0a0-Screenshot_2025-06-04_at_10.45.05_AM.png)

## 支付工作流程

下图展示了完整的支付工作流程：

![Seamless SDK 支付工作流程](https://files.readme.io/aa0edc30b1470562f8cc1380856aacb410d41aa6417d863e2c65476d26481fa4-image1.png)

### SDK Headless 支付流程

此图展示了使用 SDK 的 headless 支付过程，详细说明了商户客户端、商户服务器、Yuno 服务器和 Yuno SDK 之间的交互。它概述了从发起 checkout、请求支付方式到创建并接收支付结果的各个步骤。

#### 商户客户端

商户客户端代表与您的 backend 服务器和 Yuno SDK 交互的应用。它负责支付流程中面向用户的部分，包括：

* 列出支付方式
* 用户选择支付方式
* 使用结账会话和 `payment_method` 初始化 SDK

#### 商户服务器

商户服务器代表负责服务器端操作并与 Yuno 服务器通信的应用。其主要职责包括：

* 创建 `checkout_session`
* 接收包含支付结果的 webhook

#### Yuno 服务器

Yuno 服务器负责与客户管理、结账会话和支付处理相关的所有 backend 操作。其主要职责包括：

* 创建 `checkout_session`
* 创建支付
* 发送包含支付结果的 webhook

#### Yuno SDK

Yuno SDK 负责客户端的用户界面和支付流程，管理支付方式选择、令牌生成和支付完成。其主要职责包括：

* 使用 `checkout_session` 和 `payment_method` 初始化 SDK
* 生成 OTT
* 必要时自动继续支付
* 显示供用户完成注册的界面
* 显示支付方式结果（可选）

#### 流程

以下步骤概述了 SDK Headless 支付集成中所有组件之间的完整交互流程，详细说明每个请求和响应如何在系统中流转：

1. 商户服务器：创建 `checkout_session` --> Yuno 服务器：创建 `checkout_session`
2. 商户客户端：使用结账会话和 `payment_method` 初始化 SDK --> Yuno SDK：使用 `checkout_session` 和 `payment_method` 初始化 SDK
3. Yuno 服务器：创建支付 --> Yuno SDK：生成 OTT

## 平台专属 SDK 设置

若要实现 Full SDK 集成，请按照以下平台专属指南操作：

> [card] [Web](https://docs.y.uno/zh-hans/docs/sdks/seamless-sdk/web-payments.md)
>
> 为 Web 应用集成 Seamless SDK。

> [card] [iOS](https://docs.y.uno/zh-hans/docs/sdks/seamless-sdk/ios-payments.md)
>
> 为 iOS 应用集成 Seamless SDK。

> [card] [Android](https://docs.y.uno/zh-hans/docs/sdks/seamless-sdk/android-payments.md)
>
> 为 Android 应用集成 Seamless SDK。


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