跳转到主要内容
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.

第 1 步:在项目中引入库

Swift Package Manager

YunoSDK 已不再在 CocoaPods 上发布;最后一个 CocoaPods 版本是 2.30.0。将该包添加为依赖项:
将 YunoSDK(动态)或 YunoSDK-Static(静态,即 CocoaPods 所提供的版本)添加到您的应用 target 中,切勿同时添加两者。

第 2 步:初始化 SDK

使用您的公共 API 密钥初始化 SDK:

第 3 步:采用 YunoPaymentDelegate

采用 YunoPaymentDelegate 协议:
Swift 6 并发要求如果您使用 Swift 6,则需要在实现 YunoPaymentDelegate 协议时考虑特定的并发事项。有关详细的实现选项和最佳实践,请参阅 Swift 6 并发指南。
重要提示请实现 yunoCreatePayment(with:) 或 yunoCreatePayment(with:information:) 其中之一,不要同时实现两者。SDK 会调用您实现的每个版本,因此同时实现两者会导致支付被创建两次。

第 4 步:发起支付流程

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

如果 API 返回 sdk_action_required: true,请调用:
演示应用有关完整的实现示例,请参阅 Yuno iOS SDK 代码仓库。