跳转到主要内容
This page documents a legacy SDK. Starting a new integration? Use the Yuno SDK. Already on a legacy SDK? Follow the migration guide.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.
Orientation: Choosing Your Integration Flow, before you begin, please review the Official Integration Flow.
  • Standard Flow (Full Checkout): 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.
本页面介绍适用于 Android 支付的 Yuno Lite SDK。此 SDK 提供简化的集成流程和基本的支付功能,非常适合符合以下情况的商户:
  • 需要快速实现,且定制化需求极少
  • 希望主要专注于卡支付处理
  • 倾向于使用可处理支付流程的现成界面
Lite SDK 包含以下核心功能:
  • 预构建的支付界面组件
  • 卡支付处理
  • 基本的支付状态处理
  • 必要的错误管理
如果商户需要更高级的功能,例如多种支付方式、自定义界面或高级欺诈防范,请考虑改用 Yuno 的 Full SDK。

要求

在开始集成 Yuno Android SDK 之前,请确保您的项目满足技术要求。此外,请确保满足以下前提条件:
  • 您必须拥有一个有效的 Yuno 账户。
  • 您需要 Yuno API 凭证(account_id、public-api-key 和 private-secret-key),可从 Yuno Dashboard 的开发者凭证部分获取。

第 1 步:创建客户

在发起支付之前,使用 Create customer endpoint 创建客户。此 endpoint 返回的客户 ID 将在创建 checkout_session 时使用。

第 2 步:创建结账会话

使用 Create checkout session endpoint 创建新的 checkout_session,以初始化支付流程。

第 3 步:在项目中引入库

通过 Gradle 在您的项目中引入 Yuno SDK 文件。添加仓库源:
在 build.gradle 文件中加入以下代码,以添加 Yuno SDK 依赖项:

第 4 步:使用公钥初始化 SDK

在您应用的 onCreate() 方法中调用 Yuno.initialize(),以初始化 SDK:

YunoConfig 自定义

第 5 步:启动 checkout 流程

在您的 activity 中调用 startCheckout 方法:

Callback 状态

第 6 步:发起支付流程

调用 startPaymentLite 以启动流程:

第 7 步:创建支付

获取一次性令牌(OTT)后,通过您的 backend 使用 Create Payment API 创建支付。

第 8 步:继续支付(必需)

如果 API 响应包含 sdk_action_required: true,请调用 continuePayment():
演示应用有关完整的实现示例,请参阅 Yuno Android SDK 代码仓库。