> ## 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 Lite 模式

> 将 React Native Seamless Lite 集成（YunoSdk.startPaymentSeamlessLite）迁移到统一的 Transaction API。

Seamless Lite 在您这一侧预先选择支付方式，其余工作交由 SDK 完成：表单、令牌化、支付创建、3DS 和结果。`YunoSdk.startPaymentSeamlessLite` 以最终的 `YunoStatus` resolve。在统一 API 中，这是控制器中没有 `createPayment` 时 `Transaction.start(paymentSelected)` 的**默认行为**：SDK 会创建支付，并通过 `onStatus` 报告结果。

## 开始之前

* 将 `@yuno-payments/yuno-sdk-react-native` 升级到 2.0.0 并运行 `pod install`。您的公共 API 密钥保持不变（[开始之前](https://docs.y.uno/zh-hans/docs/yuno-sdk/get-started.md#before-you-begin)）。
* 在 Android 上，`minSdkVersion` 现在为 23。如果您的 `android/build.gradle` 对 Yuno 模块应用了 Compose 编译器插件（1.x 的一种变通做法），请删除该代码块：使用 2.0.0 时，构建会失败并提示“The Compose Compiler requires the Compose Runtime to be on the class path”。
* 使用 `workflow: "SDK_SEAMLESS"` 创建结账会话，与您在 Seamless Lite 中的做法相同。正是它让 SDK 能够创建支付；没有它，交易会以 `INTERNAL_ERROR` 结束。请参阅 [`workflow` 字段](https://docs.y.uno/zh-hans/reference/checkout-sessions/create-checkout-session#body-workflow)。

## 对照

```tsx Before. Seamless Lite mode theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
import { YunoSdk, YunoStatus } from '@yuno-payments/yuno-sdk-react-native';

await YunoSdk.initialize({
  apiKey: 'your-public-api-key',
  countryCode: 'CO',
  yunoConfig: { language: 'en' },
});

const status = await YunoSdk.startPaymentSeamlessLite({
  checkoutSession,
  methodSelected: { paymentMethodType: 'CARD', vaultedToken: savedToken },
  showPaymentStatus: true,
  countryCode: 'CO',
});

if (status === YunoStatus.SUCCEEDED) {
  console.log('Success');
}
```

```tsx After. Unified Transaction theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
import { SdkPayments, Transaction } from '@yuno-payments/yuno-sdk-react-native';

await SdkPayments.initialize('your-public-api-key');

const transaction = new Transaction({
  checkoutSession,
  countryCode: 'CO',
  language: 'en',
  showStatusScreen: true,
  controller: {
    onStatus: (status) => {
      if (status.status === 'SUCCEEDED') {
        console.log('Success');
      }
    },
  },
});

await transaction.start({ type: 'CARD', vaultedToken: savedToken });
```

## 变更内容

按您编辑代码的顺序分组。**已重命名**：作用相同，名称不同。**已移动**：值相同，归属不同。**已移除**：无需调用任何内容。**新增**：没有旧版对应项。最后一列是除重命名之外您唯一需要做的事情。

### 初始化与配置

| Seamless Lite | 统一 API | 变更 | 操作 |
| - | - | - | - |
| `YunoSdk.initialize({ apiKey, countryCode, yunoConfig, iosConfig, androidConfig })` | `SdkPayments.initialize(apiKey)` | 已重命名 | 现在它只接收密钥。其他参数移至 `TransactionConfig` 或不再存在（见后续各行）。 |
| `initialize` 和 `startPaymentSeamlessLite` 的 `countryCode` | `TransactionConfig.countryCode` | 已移动 | 每笔交易传入一次。 |
| `yunoConfig.language`、`yunoConfig.saveCardEnabled` | `TransactionConfig.language`、`TransactionConfig.saveCardEnabled` | 已移动 | 按每笔交易传入，而不是在启动时传入一次。 |
| `yunoConfig.keepLoader`、`isDynamicViewEnabled`、`cardFormDeployed`、`iosConfig`、`androidConfig`、`CardFlow` 枚举 | *（已移除）* | 已移除 | 删除它们。除非您实现 `showLoading`，否则 SDK 会保留其加载指示器；SDK 只有一个卡片表单。 |
| `startPaymentSeamlessLite` 的 `checkoutSession` | `TransactionConfig.checkoutSession` | 已移动 | 调用的参数变为配置字段。 |
| `startPaymentSeamlessLite` 的 `showPaymentStatus` | `TransactionConfig.showStatusScreen` | 已移动 | 现在默认关闭：设置 `showStatusScreen: true` 即可保留 SDK 结果页面。 |

### 控制器

| Seamless Lite | 统一 API | 变更 | 操作 |
| - | - | - | - |
| `startPaymentSeamlessLite` resolve 时返回的 `YunoStatus` | `onStatus(status)` | 已移动 | 现在结果通过控制器送达，每笔交易一次。`status` 和 `substatus` 来自 backend：请处理 `DECLINED`、`REJECTED`、`ERROR` 和 `PENDING`，而不是 1.x 的 `FAILED` 和 `PROCESSING`；并处理 `USER_CANCEL`，而不是 `CANCELLED_BY_USER`。SDK 本身只会发出 `INTERNAL_ERROR` 和 `USER_CANCEL`。请参阅 [`Status`](https://docs.y.uno/zh-hans/docs/yuno-sdk/reference/objects-you-receive#status)。 |
| *（无）* | `createPayment(token)` | 新增 | 省略它：没有它时，由 SDK 创建支付，这就是 Seamless 行为。如果只想针对部分支付方式在您的 backend 上创建支付，请实现它，并对其余支付方式返回 `SdkPayments.defaultCreatePayment(token)`。请参阅 [`createPayment`](https://docs.y.uno/zh-hans/docs/yuno-sdk/controllers/create-payment)。 |
| *（无）* | `showLoading`、`showView` | 新增 | 可选。显示您自己的加载指示器，或将 SDK 的表单嵌入您自己的屏幕。请参阅[接管 SDK](https://docs.y.uno/docs/yuno-sdk/controllers/take-over-the-sdk)。 |

### 入口点

| Seamless Lite | 统一 API | 变更 | 操作 |
| - | - | - | - |
| `YunoSdk.startPaymentSeamlessLite({ checkoutSession, methodSelected, showPaymentStatus, countryCode })` | `new Transaction(config).start(paymentSelected)` | 已重命名 | 构建配置，然后调用 `start`。Promise 在交易启动后即 resolve，而不是携带结果 resolve：请在 `onStatus` 中读取结果。 |
| `methodSelected: { paymentMethodType, vaultedToken }` | `PaymentMethodSelected`：`{ type, vaultedToken }` | 已重命名 | `paymentMethodType` 现在为 `type`。 |
| `YunoSdk.receiveDeeplink(url)` | `transaction.handleDeeplink(url)` | 已重命名 | 请参阅[处理 deeplink](https://docs.y.uno/zh-hans/docs/yuno-sdk/features/handle-deeplinks.md)。 |

## 相关内容

* [快速入门](https://docs.y.uno/zh-hans/docs/yuno-sdk/get-started.md)。统一 API 的完整演练。
* [`createPayment`](https://docs.y.uno/zh-hans/docs/yuno-sdk/controllers/create-payment)。为什么不实现它就意味着由 SDK 创建支付。
* [`Status`](https://docs.y.uno/zh-hans/docs/yuno-sdk/reference/objects-you-receive#status)。取值与 substatus。


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