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

# 钱包增强体验

> 在 VTEX checkout 上启用直接的钱包体验，并解锁 Apple Pay、Google Pay 和 Samsung Pay 分期付款。

钱包增强体验是面向已在使用 Yuno VTEX 插件的商店的可选附加功能。它通过移除 VTEX checkout 与设备原生钱包界面之间的中间屏幕来改善购物者的 checkout 体验，而这个中间屏幕已知会降低钱包支付的转化率。

![默认钱包体验](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-20260422-170119.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=32c0b3a72e19dd8dcf254d05610885f1)

默认体验（带中间屏幕）

![增强钱包体验](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-20260422-170132.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=78db6548835bd4c98618e7596722dd89)

增强体验（直接打开原生界面）

## 功能简介

默认情况下，当购物者选择钱包支付（Apple Pay、Google Pay 或 Samsung Pay）时，Yuno Payment App 会在设备的原生确认界面（Face ID、fingerprint 或 PIN）出现之前，先在 VTEX checkout 内打开一个中间屏幕。

**增强体验**移除了该中间屏幕：钱包按钮**直接显示在 VTEX checkout 的支付步骤中**，点击按钮会立即打开设备的原生界面。

此集成还解锁了可选的 **Apple Pay、Google Pay 和 Samsung Pay 分期付款**。

## 工作原理

当购物者进入 checkout 时，Yuno SDK 会在后台悄悄准备支付会话。当购物者到达支付步骤时，钱包按钮会立即显示。

* **快速确认**：点击按钮会立即打开原生钱包界面。
* **自动重新计算**：如果购物者更改了购物车（添加商品、使用优惠券、更改配送方式），SDK 会自动重新计算会话。
* **错误处理**：如果支付失败，购物者无需重新加载页面即可重试。

***

## 集成指南

设置增强体验需要在您的 VTEX checkout 中添加一小段 JavaScript 代码，并找到需要填入其中的值。

**1. 将代码段添加到您的 VTEX checkout**

代码段通过 VTEX Dashboard 添加到您商店的 `checkout6-custom.js` 文件中。

1. 在 **VTEX Dashboard** 中，在顶部栏搜索 **Checkout**。

![VTEX Checkout 设置](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-snippet-1.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=1c91cd38a8d5e044c3e3260e86e02541)

2. 选择您的商店使用的网站（通常为 **Default**）。

![选择网站](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-snippet-2.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=3b5d4da3eb2890fc2b4beb9665f90808)

3. 打开 **Code** 选项卡，并从右侧的文件列表中选择 `checkout6-custom.js`。

![打开 checkout6-custom.js](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-snippet-3.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=5f0c09f4c74f06d5a106db79204ee3af)

4. 将下方的代码段添加到文件末尾，然后点击 **Save**。

![保存代码段](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-snippet-4.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=5eafbaa0f7d8528278e59ab45b11076c)

```javascript theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
(function () {
  window.addEventListener('yuno-sdk-vtex-io-ready', function (event) {
    var YunoVTEXIO = event.detail.YunoVTEXIO;
    YunoVTEXIO.initialConfiguration({
      paymentMethods: ['Apple Pay', 'Google Pay', 'Samsung Pay'],
      affiliationName: 'YOUR_AFFILIATION_NAME'
    });
  });

  var script = document.createElement('script');
  script.src = 'https://sdk-web-vtex-io.y.uno/v1/main.js';
  document.head.appendChild(script);
})();
```

> [!NOTE]
>
> 将 `YOUR_AFFILIATION_NAME` 替换为您的 Yuno 服务提供商配置中的关联名称。在 `paymentMethods` 中，列出您要启用的钱包：`'Apple Pay'`、`'Google Pay'`、`'Samsung Pay'` 或其任意组合。

**2. 查找关联名称**

`affiliationName` 的值与您将 Yuno 配置为支付服务提供商时设置的值相同。

1. 在 **VTEX Dashboard** 搜索栏中，输入 `providers` 并选择 **Providers** 结果。

![VTEX Providers](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-affiliation-1.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=349fbce5142242452997f8e8d2089a84)

2. 找到为此商店配置的 Yuno 服务提供商并将其打开。

![选择 Yuno 服务提供商](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-affiliation-2.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=40b45cc111f4fdb6d56dfab6294f765b)

3. 在服务提供商的详情视图中，复制 **Affiliation Name** 字段的值，并在代码段中使用它。

![复制关联名称](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/vtex-checkout-affiliation-3.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=0581aea80c9bb8ef8fb7f591892d8e96)

保存代码段后，增强体验即会生效。您配置的钱包按钮将
直接显示在 VTEX checkout 的支付步骤中。

***

## Apple Pay 分期付款

Apple Pay 分期付款是增强体验中的一项可选功能，让购物者可以将购买金额拆分为分期付款。

### 购物者看到的内容

启用后，Apple Pay 按钮上方会显示 **Installments** 选择器。点击它会打开一个列出所有分期付款选项的面板。

![分期付款选择器](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-20260422-175803.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=ede479b5ab84cc70d2fed3f7d5313154)

分期付款选择器

![选项面板](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-20260422-175811.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=9b07f8a3848027a1ab26fb3bd0d4caaa)

分期付款选项面板

如果方案包含利息，下方会显示 **Payment details** 面板，展示明细（分期期数、融资成本等）。

![融资明细](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-20260422-175858.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=11fcb1059464a724df20da71c4af04ad)

### 如何启用

Apple Pay 分期付款通过在 Yuno Dashboard 中为 Apple Pay 支付方式
创建分期付款方案来启用。**代码段无需更改**：运行增强体验且
在 `paymentMethods` 中包含 `'Apple Pay'` 的商店，已经会在每个订单上向 Yuno 请求可用方案。

**1. 创建 Apple Pay 分期付款方案**

1. 在 **Yuno Dashboard** 中，前往 **Installments** 并点击 **Create installment**。
2. 在 **Payment method type** 中，选择 **Apple Pay**。
3. 设置分期期数、费率、金额范围和可用时间窗口。

![创建 Payment method type 设置为 Apple Pay 的分期付款](https://mintcdn.com/yuno-3979e326/4g1NApwlhsr6lf1y/images/plugins/vtex/vtex-installments-plan-apple-pay.png?fit=max\&auto=format\&n=4g1NApwlhsr6lf1y\&q=85\&s=3c1e06e6e5d33f83f6f5560705f6f9a1)

> [!WARNING]
>
> 卡方案不会被复用。Apple Pay 只能看到为 Apple Pay 支付方式创建的方案，因此
> 已为卡设置了分期付款方案的商店仍需要单独的 Apple Pay 方案。

**2. 在列表中检查方案**

该方案在 **Payment method** 列中显示为 **Apple Pay**。如果您希望为不同的购物车金额提供不同选项，
请为每个金额区间创建一个方案。

![按金额区间显示 Apple Pay 方案的分期付款列表](https://mintcdn.com/yuno-3979e326/4g1NApwlhsr6lf1y/images/plugins/vtex/vtex-installments-plans-list-apple-pay.png?fit=max\&auto=format\&n=4g1NApwlhsr6lf1y\&q=85\&s=7ef91cf93f3b53c8eb0b0a9e93f34fc8)

**3. 在您的 checkout 中确认**

使用金额在方案范围内的购物车打开支付步骤，并选择 Apple Pay。
**Installments** 选择器会显示在按钮上方。

您也可以使用 [Create Installments Plan](https://docs.y.uno/reference/installments/create-installments-plan.md)
endpoint 创建方案，发送 `payment_method_type: APPLE_PAY`。

### 资格规则

Yuno 根据购物车总额为每个订单确定方案，因此购物者始终看到
适用于其购物车内容的选项。如果购物车发生变化，选项会重新计算。

您创建的每个方案定义：

* **Payment method type**：必须为 Apple Pay。
* **货币和国家**：必须与订单匹配。
* **金额范围**：方案涵盖的最低和最高订单总额。
* **可用时间窗口**：方案的开始和结束日期。

选择器对每个分期期数显示一个条目。如果两个方案涵盖同一订单且
提供相同的期数，则只会使用其中一个，因此如果您希望结果可预测，
请让金额范围互不重叠。

如果没有方案涵盖该订单，选择器会被隐藏，Apple Pay 显示为普通按钮，
支付仍会以一期完成。

> [!WARNING]
>
> 请将您最低方案的最低金额与您的典型订单总额进行比较。如果方案的起始金额
> 高于该总额，大多数购物者永远不会看到选择器，该功能看起来像是出了故障，而实际上只是超出了
> 范围。

***

## Google Pay 分期付款

Google Pay 分期付款的工作方式与 Apple Pay 分期付款相同：购物者可以直接通过 Google Pay 支付选项
将购买金额拆分为分期付款。每个钱包各自确定其方案，
因此您可以在其中一个钱包、另一个钱包或两者上提供分期付款。

### 购物者看到的内容

启用后，Google Pay 按钮上方会显示 **Installments** 选择器。点击它会打开一个
列出所有分期付款选项的面板。

![Google Pay 按钮上方的分期付款选择器](https://mintcdn.com/yuno-3979e326/YcgdVMpdBS1BXBKt/images/plugins/vtex/vtex-google-pay-installments-selector.png?fit=max\&auto=format\&n=YcgdVMpdBS1BXBKt\&q=85\&s=a31ef8abadb41382571180b03556f8f2)

分期付款选择器

![Google Pay 分期付款选项面板](https://mintcdn.com/yuno-3979e326/YcgdVMpdBS1BXBKt/images/plugins/vtex/vtex-google-pay-installments-options.png?fit=max\&auto=format\&n=YcgdVMpdBS1BXBKt\&q=85\&s=8941d5c80ac9dc06df934db2d1a5f299)

分期付款选项面板

如果方案包含利息，下方会显示 **Payment details** 面板，展示明细
（分期期数、融资成本等），与 Apple Pay 完全相同。

### 如何启用

Google Pay 分期付款通过在 Yuno Dashboard 中为 Google Pay 支付方式
创建分期付款方案来启用。**代码段无需更改**：运行增强体验且
在 `paymentMethods` 中包含 `'Google Pay'` 的商店，已经会在每个订单上向 Yuno 请求可用方案。

**1. 创建 Google Pay 分期付款方案**

1. 在 **Yuno Dashboard** 中，前往 **Installments** 并点击 **Create installment**。
2. 在 **Payment method type** 中，选择 **Google Pay**。
3. 设置分期期数、费率、金额范围和可用时间窗口。

![创建 Payment method type 设置为 Google Pay 的分期付款](https://mintcdn.com/yuno-3979e326/YcgdVMpdBS1BXBKt/images/plugins/vtex/vtex-installments-plan-google-pay.png?fit=max\&auto=format\&n=YcgdVMpdBS1BXBKt\&q=85\&s=5825098727d02f0dc5669d88515c8802)

> [!WARNING]
>
> 方案严格按支付方式区分。Google Pay 只能看到为 Google Pay
> 支付方式创建的方案：卡方案和 Apple Pay 方案都不会被复用。在两个或更多钱包上
> 提供分期付款的商店，需要为每个钱包设置一组方案。

**2. 在列表中检查方案**

该方案在 **Payment method** 列中显示为 **Google Pay**。如果您希望为不同的购物车金额提供不同选项，
请为每个金额区间创建一个方案。

![按金额区间显示 Google Pay 方案的分期付款列表](https://mintcdn.com/yuno-3979e326/YcgdVMpdBS1BXBKt/images/plugins/vtex/vtex-installments-plans-list-google-pay.png?fit=max\&auto=format\&n=YcgdVMpdBS1BXBKt\&q=85\&s=72687cd3d0f5a2fd395b751080a5b8f4)

**3. 在您的 checkout 中确认**

使用金额在方案范围内的购物车打开支付步骤，并选择 Google Pay。
**Installments** 选择器会显示在按钮上方。

您也可以使用 [Create Installments Plan](https://docs.y.uno/reference/installments/create-installments-plan.md)
endpoint 创建方案，发送 `payment_method_type: GOOGLE_PAY`。

### 资格规则

Google Pay 遵循与 [Apple Pay 相同的资格规则](#eligibility-rules)：Yuno 根据购物车总额
为每个订单确定方案，在购物车变化时重新计算，并按
货币、国家、金额范围和可用时间窗口匹配方案。唯一的区别在于支付方式
类型：只有当方案的 **Payment method type** 为 **Google Pay** 时，该方案才适用于 Google Pay。

如果没有方案涵盖该订单，选择器会被隐藏，Google Pay 显示为普通按钮，
支付仍会以一期完成。

***

## Samsung Pay 分期付款

Samsung Pay 分期付款的工作方式与 Apple Pay 和 Google Pay 分期付款相同：购物者可以
直接通过 Samsung Pay 支付选项将购买金额拆分为分期付款。

### 购物者看到的内容

启用后，Samsung Pay 按钮上方会显示 **Installments** 选择器。点击它会打开一个列出所有分期付款选项的面板，下方附有完整的融资明细。

![显示生物识别确认、分期付款选择器和支付详情的 Samsung Pay checkout 页面](https://mintcdn.com/yuno-3979e326/NyQXrSTq_qEgQGLB/images/plugins/vtex/vtex-samsung-pay-checkout-staging.png?fit=max\&auto=format\&n=NyQXrSTq_qEgQGLB\&q=85\&s=8897b503e1fc0c56c9dac1d403eeff8b)

带分期付款的 Samsung Pay checkout

### 如何启用

Samsung Pay 分期付款通过在 Yuno Dashboard 中为 Samsung Pay 支付方式
创建分期付款方案来启用。**代码段无需更改**：运行增强体验且
在 `paymentMethods` 中包含 `'Samsung Pay'` 的商店，已经会在每个订单上向 Yuno 请求可用方案。

**1. 创建 Samsung Pay 分期付款方案**

1. 在 **Yuno Dashboard** 中，前往 **Installments** 并点击 **Create installment**。
2. 在 **Payment method type** 中，选择 **Samsung Pay**。
3. 设置分期期数、费率、金额范围和可用时间窗口。

![创建 Payment method type 设置为 Samsung Pay 的分期付款](https://mintcdn.com/yuno-3979e326/NyQXrSTq_qEgQGLB/images/plugins/vtex/vtex-installments-plan-samsung-pay.png?fit=max\&auto=format\&n=NyQXrSTq_qEgQGLB\&q=85\&s=e2de6f41fbe63c171be537da9ccdba4a)

> [!WARNING]
>
> 方案严格按支付方式区分。Samsung Pay 只能看到为 Samsung Pay
> 支付方式创建的方案：卡方案、Apple Pay 方案和 Google Pay 方案都不会被复用。在多个钱包上
> 提供分期付款的商店，需要为每个钱包设置一组方案。

**2. 在列表中检查方案**

该方案在 **Payment method** 列中显示为 **Samsung Pay**。如果您希望为不同的购物车金额提供不同选项，
请为每个金额区间创建一个方案。

![按金额区间显示 Samsung Pay 方案的分期付款列表](https://mintcdn.com/yuno-3979e326/NyQXrSTq_qEgQGLB/images/plugins/vtex/vtex-installments-plans-list-samsung-pay.png?fit=max\&auto=format\&n=NyQXrSTq_qEgQGLB\&q=85\&s=f6a5042bf69cc7d8a037332cce36a565)

**3. 在您的 checkout 中确认**

使用金额在方案范围内的购物车打开支付步骤，并选择 Samsung Pay。
**Installments** 选择器会显示在按钮上方。

您也可以使用 [Create Installments Plan](https://docs.y.uno/reference/installments/create-installments-plan.md)
endpoint 创建方案，发送 `payment_method_type: SAMSUNG_PAY`。

### 资格规则

Samsung Pay 遵循与 [Apple Pay 相同的资格规则](#eligibility-rules)：Yuno 根据购物车总额
为每个订单确定方案，在购物车变化时重新计算，并按
货币、国家、金额范围和可用时间窗口匹配方案。唯一的区别在于支付方式
类型：只有当方案的 **Payment method type** 为 **Samsung Pay** 时，该方案才适用于 Samsung Pay。

如果没有方案涵盖该订单，选择器会被隐藏，Samsung Pay 显示为普通按钮，
支付仍会以一期完成。

### VTEX 订单显示

> [!WARNING]
>
> VTEX 目前在订单摘要和管理面板中将 Samsung Pay 订单显示为**一次性全额支付**。
> VTEX 中尚不存在原生的 Samsung Pay 分期付款设置：VTEX 工单 1453437
> 将其作为未来改进进行跟踪。
>
> 分期付款明细*以 Yuno 为准*：正确的分期期数、
> 每期金额以及任何利息都可以在 Yuno Dashboard 和
> 交易详情中查看。VTEX 的显示仅为外观呈现，不影响支付的处理
> 或结算方式。


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