> ## 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 上设置 Yuno

> 按照这份端到端配置指南，开始在您的 VTEX 店铺上使用 Yuno 接受支付。

本页将引导您完成在 VTEX 店铺上开始使用 Yuno 接受支付所需的每一个步骤。设置在两个地方进行。在 **VTEX dashboard** 中，您将 Yuno 注册为支付服务提供商、安装 Payment App 并激活支付方式。在 **Yuno dashboard** 中，您配置用于保持订单状态同步的 webhook。

### 开始之前

请准备好以下内容：

* 一个拥有 VTEX dashboard 管理员权限的用户。
* 您的 Yuno 凭证，可在 Yuno dashboard 的 **Developers → API Credentials** 下找到：**Account ID**、**Public API Key** 和 **Private Secret Key**。

***

**1. 将 Yuno 配置为支付服务提供商**

1. 在 **VTEX dashboard** 中，打开左侧菜单并进入 **Store Settings → Payment → Providers**，然后点击右上角的 **New Provider**。

![VTEX 中的 New Provider](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-065c1400.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=8337a6566dd698dc04a51133a16a4429)

2. 在 **Select a provider** 对话框中，在搜索框中输入 `Yuno`，并从结果中选择 **Yuno**。

![搜索 Yuno 服务提供商](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-d4b7cb65.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=dbec2bacc93f98073c25116c82e6cb26)

3. 填写服务提供商配置表单并保存。保存后，服务提供商即完成注册，但尚未激活任何支付方式。

> [accordion] 字段参考
>
> 每个字段的完整说明和示例请参阅 [Affiliation 字段参考](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md)。
>
> | 字段 | 必填 | 作用 |
> | :- | :- | :- |
> | **Application Key / Application Token** | 是 | 插件用于代表您执行操作的 VTEX 管理员凭证。请参阅 VTEX 关于[生成 Application Keys](https://help.vtex.com/docs/tutorials/api-keys#generating-internal-application-keys) 的指南。 |
> | **Automatic Settlement** | 是 | 卡和钱包支付的捕获时间。请参阅下方的 **Settlement Options**。 |
> | **Affiliation Name** | 是 | 此 Yuno 集成的名称。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#affiliation-name) |
> | **Account ID** | 是 | 您的 Yuno Account ID。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#account-id) |
> | **Public API Key** | 是 | 您的 Yuno Public API Key；其前缀决定环境。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#public-api-key) |
> | **Private Secret Key** | 是 | 您的 Yuno Private Secret Key。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#private-secret-key) |
> | **Main Account Name** | 可选 | 在多账户设置中拥有订单的 VTEX 账户。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#main-account-name) |
> | **Main Account App key** | 可选 | 主 VTEX 账户的 Application Key。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#main-account-app-key) |
> | **Main Account App token** | 可选 | 主 VTEX 账户的 Application Token。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#main-account-app-token) |
> | **Soft Descriptor** | 可选 | 显示在购物者卡账单上的文本。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#soft-descriptor) |
> | **Create Customer** | 可选 | 为每位购物者在 Yuno 中创建客户记录。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#create-customer) |
> | **VTEX IO orderPlaced page URL** | 可选 | 支付后购物者被重定向到的位置。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#vtex-io-orderplaced-page-url) |
> | **Payment Mode** | 可选 | checkout 内的 Payment App，或 Legacy 重定向。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#payment-mode) |
> | **Transaction Identification From** | 可选 | 显示 Yuno 或服务提供商的交易 ID。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#transaction-identification-from) |
> | **Antifraud Providers for Split Orders** | 可选 | 在拆分订单中接收共享会话的反欺诈服务提供商。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#antifraud-providers-for-split-orders) |
> | **Vault Card for Order Modification** | 可选 | 在订单总额增加时收取差额。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#vault-card-for-order-modification) |
> | **Enable Network Tokens** | 可选 | 存储卡信息，以便重复购买时可以使用网络令牌。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#enable-network-tokens) |
> | **Use Corporate Buyer Data** | 可选 | 以公司名称和 CNPJ 支付公司订单（巴西）。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#use-corporate-buyer-data) |
> | **Headless Payment Handoff** | 可选 | 适用于由自身 headless checkout 创建支付的 marketplace。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#headless-payment-handoff) |
> | **Store Base Path** | 可选 | 不在域名根目录提供服务的店铺的 URL 路径前缀。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#store-base-path) |
> | **Send Order Sequence as Merchant Reference** | 可选 | 将 VTEX 订单序号作为支付参考发送。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#send-order-sequence-as-merchant-reference) |
> | **Sales Channel Domains** | 可选 | 将每个销售渠道映射到其店面域名。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#sales-channel-domains) |
> | **Delay To Cancel** | 可选 | VTEX 等待待处理支付的时长，按支付方式设置。[详情](https://docs.y.uno/zh-hans/docs/plugins/vtex/affiliation-fields.md#delay-to-cancel) |

> [accordion] Settlement Options
>
> **Automatic Settlement** 字段决定卡和钱包支付的捕获时机。
>
> | 选项 | 实际行为 |
> | :- | :- |
> | **Use behavior recommended by payment processor** | **立即捕获**：交易在授权后立即被捕获。（默认） |
> | **Automatic capture immediately after payment authorization** | **立即捕获**：交易在授权后立即被捕获。与默认相同。 |
> | **Automatic capture immediately after anti-fraud analysis** | **立即捕获**：交易在授权后立即被捕获。 |
> | **Disabled** | **仅授权**：交易仅被授权。捕获在订单**开具发票**后进行。 |

> [!NOTE]
>
> **环境**：Yuno 环境由您的 **Public API Key** 的前缀决定：`dev_`、`staging_`、`sandbox_` 或 `prod_`。

> [!TIP]
>
> 除非您的业务明确要求在开具发票后捕获，否则我们建议使用 **Use behavior recommended by payment processor**。

**2. 安装 Yuno Payment App**

保存服务提供商配置后，从您的 VTEX dashboard 安装 Yuno Payment App。

1. 在 **VTEX dashboard** 中，进入 **Apps → App Management**。
2. 搜索 **Yuno**，在可用应用列表中选择 **Yuno Payment App** 并打开其 **Settings**。

![安装 Yuno Payment App](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-c64bef9b.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=cb08f018fbbabe5978937d6ae2f3ec85)

3. 点击 **Install** 完成设置。

安装后，Payment App 将负责在您的 VTEX checkout 中呈现 Yuno checkout 体验。

**3. 激活支付方式**

现在选择您要向购物者提供的支付方式，并通过 Yuno 路由这些支付方式。

1. 在 **VTEX dashboard** 中，进入 **Store Settings → Payment → Settings → Payment Conditions**。点击 **+** 按钮添加支付条件。

![添加支付条件](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-68c9e7f2.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=113ff69653f5e2bc3516f474e8c950b2)

2. 选择您要激活的支付方式（例如 Visa、Mastercard、Pix、Apple Pay、Samsung Pay，或任何通用 **Yuno** 方式，如 Yuno Card 或 Yuno Wallet）。

![选择支付方式](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-309cec4b.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=1b231665433a72bc349afc1520d54446)

3. 在 **Process with provider** 字段中，选择您在步骤 1 中配置的 Yuno 关联。将 **Status** 设置为 **Active** 并保存。

![配置支付关联](https://mintcdn.com/yuno-3979e326/z8Jixp_IwgkBlbdW/images/plugins/vtex/image-73d8fe62.png?fit=max\&auto=format\&n=z8Jixp_IwgkBlbdW\&q=85\&s=68cb827a7c70b3c8b9b8e6b360a9e89d)

> [!NOTE]
>
> 对您要提供的每种支付方式重复此操作。您可以在[概览](https://docs.y.uno/zh-hans/docs/plugins/vtex.md)页面查看可用支付方式的完整列表。

**4. 在 Yuno dashboard 中配置 webhook**

webhook 使您的 VTEX 订单与 Yuno 的支付状态更新保持同步。

1. 在 **Yuno dashboard** 中，打开 **Developers → Webhooks** 并点击 **Add webhook**。
2. 填写表单：
   * **Name**：例如 `VTEX webhook`。
   * **Endpoint URL**：`https://{store_name}.myvtex.com/_v/yunopartnerbr.yuno/v4/webhook`，将 `{store_name}` 替换为您的 VTEX 账户名称。
   * **x-api-key** 和 **x-secret**：输入任意占位值（例如 `VTEX`）。
3. 选择所有事件并点击 **Add**。

***

## 高级场景

超出基本设置的场景（多关联、多账户、拆分订单、反欺诈会话、订单修改、网络令牌和企业采购）在单独的页面中介绍。

> [card] [高级功能](https://docs.y.uno/zh-hans/docs/plugins/vtex/advanced-features.md)
>
> 多关联、多账户、拆分订单、反欺诈会话、订单修改、网络令牌和企业采购。


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