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

# 3DS 原生 SDK（Android）

> 使用 Netcetera 的 3DS SDK，在您的 Android 应用中以原生方式运行 3D Secure 挑战。

> [!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 Android SDK 支持使用 **Netcetera 的 3DS SDK** 在您的应用内以原生方式运行 3D Secure（3DS）挑战。与基于 WebView 的后备方案相比，原生 3DS 可提供更流畅的用户体验（无需跳转到应用内浏览器），并且某些收单机构可能要求使用原生 3DS 来进行无摩擦认证。

> [!NOTE]
>
> 通过 Netcetera 实现的原生 3DS 同时适用于**支付**和**注册**流程（注册自 Yuno Android SDK 2.22.0 起支持）。

> [!NOTE]
>
> 原生 3DS 需要**主动启用**：只有当您的集成在应用内运行 3DS 挑战时，您才需要安装该服务提供商模块。如果您不启用 3DS，可以跳过本指南。

> [!NOTE]
>
> 这是一个独立的模块（约 3 至 4 MB），因此只有在需要原生 3DS 时才需添加。如果您的应用已经自定义了 Yuno SDK 的样式，这些样式会自动应用到挑战界面，无需额外的 UI 配置。

本指南介绍 Netcetera 特有的内容。安装和激活遵循与其他所有模块相同的规则，请参阅[外部原生模块（Android）](https://docs.y.uno/zh-hans/docs/sdks/external-native-modules/android-overview.md)。

## 要求

* Android **6.0（API 级别 23）** 或更高版本，这是 Yuno Android SDK 自 2.24.0 起的最低要求。
* 您的应用中已安装 **Yuno Payments SDK 2.16.0 或更高版本**（`com.yuno.payments:android-sdk`）。
* Netcetera 3DS 服务提供商模块（`com.yuno.payments:yuno-sdk-3ds-netcetera`），通过 Gradle 安装（见下文）。

## 兼容性

此模块的每个版本都针对 Yuno Payments SDK 的某个最低版本进行构建和测试。模块的 POM 不会固定特定的核心版本。低于最低版本的版本可能未提供此模块所依赖的 API，并可能在运行时因 `NoSuchMethodError` / `NoSuchFieldError` 而失败。

| Yuno 3DS Netcetera | 所需的 Yuno Payments SDK |
| - | - |
| `1.0.1` | `≥ 2.16.0` |

升级任一依赖项时，请同时升级两者，使组合保持在受支持的版本对范围内。

## 步骤 1：声明 Netcetera Maven 仓库

Netcetera 3DS SDK 托管在 Netcetera 的公共 Maven 服务器上。由于 Gradle 不会通过 POM 元数据传播传递性仓库，您的应用必须显式声明该仓库，才能解析 Netcetera SDK 依赖项。

在项目的 settings 文件中，将该条目添加到 `dependencyResolutionManagement.repositories` 内：

> [tab] Groovy DSL
>
> 在 `settings.gradle` 中：
>
> ```groovy theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> dependencyResolutionManagement {
>     repositories {
>         google()
>         mavenCentral()
>         maven { url "https://yunopayments.jfrog.io/artifactory/snapshots-libs-release" }
>         // Required by Yuno 3DS Netcetera module
>         maven { url "https://nexus.extranet.netcetera.biz/nexus/repository/public-repository-maven/" }
>     }
> }
> ```

> [tab] Kotlin DSL
>
> 在 `settings.gradle.kts` 中：
>
> ```kotlin theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> dependencyResolutionManagement {
>     repositories {
>         google()
>         mavenCentral()
>         maven { url = uri("https://yunopayments.jfrog.io/artifactory/snapshots-libs-release") }
>         // Required by Yuno 3DS Netcetera module
>         maven { url = uri("https://nexus.extranet.netcetera.biz/nexus/repository/public-repository-maven/") }
>     }
> }
> ```

> [!NOTE]
>
> 您可能仍在根目录的 `build.gradle` 中使用旧版 `allprojects { repositories { … } }` 代码块。如果是这样，请改为在该处添加相同的 Netcetera `maven { url "…" }` 行。

## 步骤 2：添加依赖项

将 Yuno 3DS Netcetera 依赖项添加到应用模块的构建文件中：

> [tab] Groovy DSL
>
> 在 `build.gradle` 中：
>
> ```groovy theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> dependencies {
>     implementation "com.yuno.payments:android-sdk:2.27.0"
>     implementation "com.yuno.payments:yuno-sdk-3ds-netcetera:1.0.1"
> }
> ```

> [tab] Kotlin DSL
>
> 在 `build.gradle.kts` 中：
>
> ```kotlin theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> dependencies {
>     implementation("com.yuno.payments:android-sdk:2.27.0")
>     implementation("com.yuno.payments:yuno-sdk-3ds-netcetera:1.0.1")
> }
> ```

`yuno-sdk-3ds-netcetera` 所封装的上游 Netcetera 3DS SDK 及其所需的 `androidx.startup` 依赖项会以传递方式引入。您无需自行声明它们。

## 激活 3DS 服务提供商

您的应用进程启动时，该模块会（通过 [Jetpack App Startup](https://developer.android.com/topic/libraries/app-startup)）**自动注册**到 Yuno Payments SDK。**无需额外代码**：只需照常初始化 Yuno SDK：

```kotlin theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
import com.yuno.sdk.Yuno

Yuno.initialize(
    applicationContext = this,
    apiKey = "YOUR_API_KEY",
)
```

> [!TIP]
>
> 注册后，Yuno Payments SDK 会自动通过 Netcetera 服务提供商处理 checkout 或注册期间的所有 3DS 挑战。

### 权限

`android.permission.INTERNET` 由模块的 manifest 声明，并会自动合并到您的应用中。无需任何操作。

## Sandbox 证书

在 Yuno sandbox 环境中测试时，Netcetera SDK 要求您的应用中包含卡组织证书。

> [!NOTE]
>
> **请联系您的 Yuno TAM（技术客户经理）获取该证书。** 该证书不公开分发。

此证书仅在 sandbox 测试时需要，生产环境中不需要。


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