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

# Web SDK：迁移到 v1.1

> 在您的 checkout 中将 Yuno Web SDK 从 v1.0 升级到 v1.1.0

# 迁移到 Web SDK v1.1

1.1.0 版本将 `initialize()`、`mountCheckout()` 和 `startCheckout()` 改为异步，并引入 `continuePayment()`，作为动态支付流程（3DS、PayPal 重定向等）的必需步骤。

## 变更内容

* `Yuno.initialize()`、`yuno.mountCheckout()` 和 `yuno.startCheckout()` 现在返回 Promise，必须等待其完成。
* 当支付 API 返回 `checkout.sdk_action_required: true` 时，现在必须调用 `continuePayment()`。
* 不再需要单独调用 3DS 设置服务，3DS 设置现已集成到支付创建中。

## 步骤

### 更新脚本标签

```html theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
<script src="https://sdk-web.y.uno/v1.1/main.js"></script>
```

### 等待所有 SDK 方法调用完成

**之前**：

```js theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
const yuno = Yuno.initialize(publicApiKey, config)
yuno.mountCheckout({ checkoutSession, elementSelector: '#root', countryCode: 'US' })
yuno.startCheckout({ checkoutSession, countryCode: 'US' })
```

**之后**：

```js theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
const yuno = await Yuno.initialize(publicApiKey, config)
await yuno.mountCheckout({ checkoutSession, elementSelector: '#root', countryCode: 'US' })
await yuno.startCheckout({ checkoutSession, countryCode: 'US' })
```

### 为动态流程实现 `continuePayment`

通过您的 backend 创建支付后，检查 SDK 是否需要继续该流程（例如 3DS 质询、PayPal 重定向）：

```js theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// After payment creation
if (paymentResponse.checkout?.sdk_action_required) {
  const result = await yuno.continuePayment({
    checkoutSession,
    showPaymentStatus: true,
    yunoPaymentResult,
    yunoError,
    countryCode: 'US',
  })
  // result may contain a redirect object; handle appropriately
}
```

如果 `checkout.sdk_action_required` 不是 `true`，则无需调用 `continuePayment`。

### 移除单独的 3DS 设置调用

如果您的 v1.0 集成在创建支付之前单独调用了 3DS 设置服务，请移除该调用。在 v1.1 中，3DS 数据收集会在创建支付时自动完成。

## 检查清单

* [ ] 已将脚本标签更新到 v1.1
* [ ] 已为 `Yuno.initialize()`、`yuno.mountCheckout()` 和 `yuno.startCheckout()` 添加 `await`
* [ ] 已为动态流程实现 `continuePayment()` 处理
* [ ] 已确认 `yunoPaymentResult()` callback 配置正确
* [ ] 已移除所有单独的 3DS 设置服务调用


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