Xiaodou Open Platform Integration logo

Xiaodou Open Platform Integration

Organization
xiaodou-official
xiaodou-open-platform-integration

小豆支付开放平台商家接入 Skill。用于帮助商家开发者(及其 AI 编码助手)把开放平台支付接起来:RSA2 请求签名(XD-Signature-v1)、下单/重拉起/查单/关单/退款、收银页终端能力矩阵(PC 扫码 / 手机支付宝手势主按钮 / 手机微信外推荐路径 / 微信内零点击)、平台事件通知验签(XD-Webhook-v1)与 eventId 去重、**平台响应验签(XD-Response-v1)**、错误码排障、上线检查清单与凭证轮换(含密钥标识 kid 格式与本地派生)。触发词:开放平台接入、商家 API、XD-Signature-v1、XD-Response-v1、XD-Webhook-v1、qrCode 渲染、payUrl 中转链、收银页分端、多到账账号、比例分账、上线检查清单、密钥轮换、kid 密钥标识、公钥指纹、notifyUrl 回调地址、returnUrl 返回商家、商家小票、配置提交即生效、feeProjection 费率投影、易支付/彩虹支付插件兼容、submit.php、mapi.php、api.php、Sub2API、New API。

Overview

Publisherxiaodou-official
Repositoryxiaodou-open-platform
Skill namexiaodou-open-platform-integration
Stars
319
Forks
9
Bundled files
7
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xiaodou-official on GitHub. Read the source before you install it.

Installation

Install the Xiaodou Open Platform Integration AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/xiaodou-official/xiaodou-open-platform/tree/main/skill
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xiaodou-official/xiaodou-open-platform.git /tmp/xiaodou-open-platform
mkdir -p .claude/skills
cp -r /tmp/xiaodou-open-platform/skill .claude/skills/xiaodou-open-platform-integration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Xiaodou Open Platform Integration in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Xiaodou Open Platform Integration on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Xiaodou Open Platform Integration is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

小豆支付开放平台 · 商家接入 Skill

本 Skill 与同仓 docs/ 是同一份内容源的两个形态:docs/ 给人读,本目录给 AI 编码助手直接消费。两者同属一个 skillVersion——但两个下载包各有各的 contentHash(文档包 ≠ Skill 包),且 Skill 包内不含 MANIFEST.json。核对版本请以门户下载页/发布记录登记的那一对(包 ↔ hash)为准,不要拿一个包的 hash 去对另一个包。 术语:本 Skill 是给商家开发者用的接入资料;「支付机构官方 Skill」是另一件东西,不要混用。

何时用

商家要「把开放平台支付接进自己的服务端/页面」时用。典型任务:

  • 写一个能通过验签的下单请求(六头 + 规范串)。
  • 决定收款页怎么呈现(自渲染官方收款码 / 渲染收银页二维码 / 302 跳转)。
  • 接平台事件通知并做去重与幂等落账。
  • 排一个 401/403/409/422/429/503。
  • 上线前逐条自检;或轮换签名密钥。
  • 系统里已经装了易支付 / 彩虹支付类插件(Sub2API、New API 等),只填网关地址 / 商家 ID / 商户密钥,不想改代码。

已有易支付 / 彩虹支付插件(Sub2API、New API 等)

如果商家系统里已经装了易支付/彩虹支付类插件,不要按本 Skill 的 RSA2 七接口重写,走协议兼容面即可:

  • 建单:submit.php(GET/POST 表单)或 mapi.php(GET/POST,JSON)。
  • 查单:api.php,act=order 查单笔、act=query 查商户状态;GET/POST 表单均可,参数放 query、body 或同值镜像到两处(同键不同值会被拒绝)。
  • 通知:平台用 GET 请求商家 notify_url;商家返回纯文本 success(大小写不敏感,SUCCESS 也接受)。
  • 签名:MD5(剔除 sign/sign_type/空值 → ASCII 排序 → k=v&… → 直接接密钥 → 小写 hex)。
  • 明确不做:act=orders 批量、act=change、qrcode.php、JSON body 建单。
  • 实测客户端:独角数卡(GET submit)、V2Board(GET submit)、Sub2API(POST mapi / POST api,参数镜像 query+body)、New API(go-epay v0.0.5,POST submit 表单、device=pc,notify_url/return_url 必须是 https 完整地址)。
  • 人读版:docs/13-epay-compat-integration.md(不在 Skill 包内,按本文「路径基准」另取)。

铁律(先记这七条,能避免绝大多数事故)

  1. 签名只认规范串:请求 11 行、响应 8 行、事件 7 行,三套不同,不要复用同一段拼串代码。请求与响应两侧的 Content-Type 都取「小写去 ; 参数」后的值——没带这个头时该行是空行(GET 且无请求体就是这样);所有 POST 必须带 Content-Type: application/json(含无请求体的重拉起/关单)。
  2. 重试复用同一个 requestId 与同一份请求体(body 逐字节相同,含「不传 body」本身),但 nonce 必须换新;409 的正确动作是查单,不是换单号重下单。业务摘要成员见 references/api-workflow.md §2——returnUrl 在摘要内,改了再重试就是 409。
  3. 收银页打开 / 回跳 / 用户点完成都不是支付终态;终态只认查单与经验签的事件。
  4. UNKNOWN 不判死:不重新下单、不重发退款、不提示买家失败,等事件或查单收敛。
  5. 收款材料只从响应取:payUrl/qrCode 用原值,不拼接、不转发第三方、不进日志;查询接口两者恒为空,需要新码走重拉起。
  6. 事件必须用原始字节验签 + 按 eventId 去重,成功才回 2xx 且 body 字节正好是 success。
  7. 私钥永不进浏览器、不进仓库、不进日志;费率不要写死进代码:入账以每单 feeProjection 为准(对外统一档与手续费见仓库 README.md),单独约定过的费率与限额以门户「费率说明」页/平台答复为准。

能力事实(2026-10-17 口径):微信 JSAPI 已开放——仅限买家在微信内打开收银页时调起;微信外手机浏览器与商家 App 内没有「直接拉起」形态。比例分账已支持:SINGLE / ROUND_ROBIN / RATIO 三种方式,RATIO 为 2–4 个参与账号、配置面每项 0 < shareBps < 10000、合计 10000bps,RENORMALIZE 后单笔生效腿可只剩 1 条;查询接口只读返回 routing.ratios 配置快照,写面在商家后台。

工作流

text
① 读 references/signature-spec.md   → 用 examples/ 里对应语言实现签名,先跑通 golden 向量
② 读 references/api-workflow.md     → 下单 → (需要新材料时)重拉起 → 查单;幂等三层怎么用
③ 读 references/terminal-matrix.md  → 决定收款页形态(PC 扫码 / 手机分端 / 微信推荐路径 / 宿主内跳浏览器)
④ 读 references/webhook-verification.md → 接事件、验签、去重、幂等落账、返回 success
⑤ 读 references/error-codes.md      → 按 code 分派错误,不要按 message 判错
⑥ 读 references/go-live-checklist.md → 上线前逐条自检(平台不提供沙箱)
⑦ 读 references/key-management.md   → 生成/轮换/停用/应急吊销;注意轮换是原子的

资产

资产路径在 Skill 包里可取到?说明
四语言签名示例examples/{node,java,php,python}/(索引见 examples/README.md)✅ 在包内与 docs/ 同源的参考实现:请求签名四语言 + 事件验签 / 响应验签(Node),含 golden 向量
人读文档(14 篇)docs/❌ 不在包内含 API 参考与终端能力矩阵;用门户「开发者文档」页的「下载文档包」或公开仓的 docs/
本地收银 demodemo/h5-cashier/❌ 不在包内零依赖,loopback + mock,全链可跑(含负向用例);用公开仓全量目录

路径基准(别踩这个坑):本 Skill 有两种落地形态,可用路径不一样——

  • Skill 下载包(门户「开发者文档」页的「下载接入包(含示例与 Skill)」按钮打出的 .tar.gz):按登记文件集只含 skill/** 与 examples/**,docs/、demo/ 与仓库根 README.md 不在包内。所以本文档、references/ 与 examples/README.md 里所有指向 docs/…、demo/…、README.md 的引用在这个形态下都取不到——请如实告诉用户「人读文档要另外下载」,不要凭路径猜文件位置、更不要因此编造内容。
  • 公开仓(完整目录):skill/ 与 examples/、docs/、demo/ 同级存在,三者都能取到。
  • 只把 skill/ 目录单独拷进编码助手的技能目录时,连 examples/ 也会取不到(skill/examples/ 里的相对引用按包根解析);这时把 examples/ 一并带上。

不要把示例代码复制进 skill/ 内形成第二份源——那一定会漂移。

边界(不要做的事)

  • 不要照抄 demo 的样式去仿造平台收银页;真实收银页由平台承载且品牌中立。
  • 不要为「微信在手机浏览器直接拉起支付」「微信 PC 原生扫码直出付款码」写代码——平台没有这些形态(微信支付只能在微信内调起;PC 扫码是中转链)。
  • 不要在自有 App 的 WebView 内嵌收银页;必须跳系统浏览器。
  • 不要把 mock 全绿当成「生产可用」:mock 只证明签名与解析没错,生产首单必须真实验证。
  • 不要把易支付兼容面当成 RSA2 七接口:两者的端点、签名(MD5 vs RSA2)与回调形态不同;已有插件走兼容面,不要重写。
  • 平台暂不提供沙箱/测试应用/回调模拟器;替代路径=本地 demo + 上线检查清单 + 首单人工陪跑(不承诺 SLA)。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Xiaodou Open Platform Integration AI skill do?

小豆支付开放平台商家接入 Skill。用于帮助商家开发者(及其 AI 编码助手)把开放平台支付接起来:RSA2 请求签名(XD-Signature-v1)、下单/重拉起/查单/关单/退款、收银页终端能力矩阵(PC 扫码 / 手机支付宝手势主按钮 / 手机微信外推荐路径 / 微信内零点击)、平台事件通知验签(XD-Webhook-v1)与 eventId 去重、**平台响应验签(XD-Response-v1)**、错误码排障、上线检查清单与凭证轮换(含密钥标识 kid 格式与本地派生)。触发词:开放平台接入、商家 API、XD-Signature-v1、XD-Response-v1、XD-Webhook-v1、qrCode 渲染、payUrl 中转链、收银页分端、多到账账号、比例分账、上线检查清单、密钥轮换、kid 密钥标识、公钥指纹、notifyUrl 回调地址、returnUrl 返回商家、商家小票、配置提交即生效、feeProjection 费率投影、易支付/彩虹支付插件兼容、submit.php、mapi.php、api.php、Sub2API、New API。

Why use Xiaodou Open Platform Integration on TypingMind?

Because you install it once and use it with any model. Xiaodou Open Platform Integration is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Xiaodou Open Platform Integration in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xiaodou-official/xiaodou-open-platform/tree/main/skill. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Xiaodou Open Platform Integration?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Xiaodou Open Platform Integration?

As many as you like. As long as a model supports skills, you can use Xiaodou Open Platform Integration with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Xiaodou Open Platform Integration AI skill free?

It is published on GitHub by xiaodou-official. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇