Huifu DouGong Aggregation Order

v1.0.2

汇付支付聚合支付下单的斗拱SDK Skill:覆盖微信公众号/小程序/APP、支付宝 JS / 正扫、银联 JS / 正扫、微信 / 支付宝 / 银联付款码等全场景聚合支付下单。参数表和业务规则按协议字段组织,Java SDK 调用方式放在语言适配入口里。当开发者需要创建聚合支付订单时使用。触发词:聚合支付下单、...

3· 297·0 current·0 all-time
by青衫墨痕@codecodeing

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for codecodeing/huifu-dougong-aggregation-order.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Huifu DouGong Aggregation Order" (codecodeing/huifu-dougong-aggregation-order) from ClawHub.
Skill page: https://clawhub.ai/codecodeing/huifu-dougong-aggregation-order
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Config paths to check: HUIFU_PRODUCT_ID, HUIFU_SYS_ID, HUIFU_RSA_PRIVATE_KEY, HUIFU_RSA_PUBLIC_KEY, HUIFU_NOTIFY_URL
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install huifu-dougong-aggregation-order

ClawHub CLI

Package manager switcher

npx clawhub@latest install huifu-dougong-aggregation-order
Security Scan
Capability signals
CryptoCan make purchases
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The skill's name/description (Huifu aggregation payment order) matches the content and required config entries (HUIFU_PRODUCT_ID, HUIFU_SYS_ID, HUIFU_RSA_PRIVATE_KEY, HUIFU_RSA_PUBLIC_KEY, HUIFU_NOTIFY_URL). Those values are reasonable for signing/identifying payment requests. No unrelated credentials or binaries are requested.
Instruction Scope
SKILL.md contains API parameter references, request/response examples, and integration notes. It does not instruct the agent to read unrelated files, exfiltrate data, or call endpoints other than the documented Huifu API and callback mechanics. It explicitly warns not to guess runtime values like auth_code/sub_openid and to preserve req_seq_id/req_date.
Install Mechanism
There is no install spec and no code files — the skill is instruction-only. That minimizes on-disk install risk. The only declared dependency is another skill (huifu-dougong-aggregation-base), which is a logical modular split for shared runtime docs.
Credentials
The required config keys are limited to product/system identifiers, RSA key pair, and notify URL — all expected for signing requests and receiving asynchronous notifications. No unrelated tokens or broad system credentials are requested. The SKILL.md does not reference environment variables outside those declared config entries.
Persistence & Privilege
The skill is not set always:true and does not request elevated platform presence. It is user-invocable and allows autonomous invocation (platform default) but contains no instructions to modify other skills or system-wide agent settings.
Assessment
This appears to be an authentic documentation-only skill for integrating Huifu's v4/trade/payment/create API. Before installing: (1) confirm you trust the skill source (homepage matches Huifu official site and you control the merchant credentials you will provide); (2) only supply the required Huifu config values to an environment you control (keep RSA private key secret); (3) validate that the referenced base skill (huifu-dougong-aggregation-base) is also legitimate and review its SKILL.md for any additional credential use; (4) follow the docs' guidance to never let the model 'guess' user-scoped values (sub_openid, auth_code, buyer_id, customer_ip, devs_id); (5) test in a sandbox account / staging environment before using production credentials; and (6) configure notify_url to point to a server you control and verify signature/verify callbacks per the signing spec.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

ConfigHUIFU_PRODUCT_ID, HUIFU_SYS_ID, HUIFU_RSA_PRIVATE_KEY, HUIFU_RSA_PUBLIC_KEY, HUIFU_NOTIFY_URL
latestvk97375jq7jnjrj4146bex6jqgd84v6mn
297downloads
3stars
3versions
Updated 1w ago
v1.0.2
MIT-0

版权声明:本 Skill 内容来源于上海汇付支付有限公司官方开放平台文档,版权归属上海汇付支付有限公司。如有疑问可咨询汇付支付客服:400-820-2819 / cs@huifu.com

Source: Official Open Platform documentation of Shanghai Huifu Payment Co., Ltd.

Copyright: Shanghai Huifu Payment Co., Ltd.


聚合支付 - 下单

覆盖微信/支付宝/银联全场景聚合支付下单。

适配版本与复核信息

项目内容
Skill 版本1.1.0
当前适配 SDKdg-lightning-sdk 1.0.3
最后复核日期2026-04-08
官方文档来源汇付开放平台聚合支付下单接口文档、Java SDK 文档、加验签说明、异步消息说明

运行依赖与凭据边界

本 Skill 依赖 huifu-dougong-aggregation-base 提供公共运行时。凭据使用规则与存放边界见 credential-boundary.md

前置依赖:首次接入请先阅读 huifu-dougong-aggregation-base 完成 SDK 初始化。

开发前先补两步:先核对 客户前置准备清单,再按 参数校验与 JSON 构造规范 建模。sub_openidbuyer_idauth_codedevs_idcustomer_ip 这些值都不能让模型自行猜测。

官方开发指引补充约束:接入前还要完成渠道业务开通、应用配置或授权绑定。微信公众号 / 小程序场景的 sub_openid、支付宝 JS 的 buyer_id、银联 JS 的 user_id、各类反扫的 auth_code,都必须来自真实获取链路;前端支付完成回调也不等于最终交易成功。

协议规则入口

真正跨语言共用的协议规则,统一看共享资料:

语言适配入口

这份 Skill 里的 trade_type、参数表、返回字段和状态说明,都是语言无关的。
具体语言怎么初始化和发请求,先看这里:

端到端支付流程

[1] 下单 (本 Skill)
  -> [2] 用户支付 (前端处理)
  -> [3] 异步通知 (回调 notify)
  -> [4] 查询确认 (二次校验)
  -> [5] 退款 (可选)

步骤 1:下单(本 Skill)

调用 v4/trade/payment/create 创建支付订单,根据 trade_type 返回不同结果:

  • 正扫(NATIVE):返回 qr_code(二维码 URL)
  • JS 支付(JSAPI/MINIAPP):返回 pay_info(JS 调起参数)
  • 反扫(MICROPAY):同步返回支付结果

同时保存 req_seq_idreq_date(后续所有操作都需要)。

步骤 2:用户支付

  • 正扫:前端将 qr_code 生成二维码展示,用户扫码支付
  • JS 支付:前端使用 pay_info 调起微信/支付宝/银联支付;pay_info 是语言无关的返回结果,Java SDK 只是其中一种接法
  • 反扫:无需用户操作,商户扫描用户付款码后同步完成

步骤 3:接收异步通知

汇付将交易结果 POST 到 notify_url

  • 返回 RECV_ORD_ID_ + req_seq_id(5 秒内)
  • hf_seq_id 为幂等键
  • 详见 tech-spec.md

步骤 4:二次查询确认

huifu-dougong-aggregation-query。官方微信 / 支付宝 / 银联开发指引都明确要求:用户前端页面收到支付完成回调后,后端仍需调用查询订单 API 确认最终状态。

步骤 5:退款(可选)

huifu-dougong-aggregation-refund


触发词

  • "聚合支付下单"、"创建支付订单"、"发起支付"
  • "微信支付下单"、"微信公众号支付"、"微信小程序支付"
  • "支付宝下单"、"支付宝JS支付"、"支付宝正扫"
  • "银联下单"、"银联JS"、"银联正扫"
  • "付款码支付"、"反扫支付"、"扫码支付"
  • "二维码支付"、"正扫支付"

场景路由

根据支付场景选择对应 trade_type:

用户意图trade_type返回关键字段详细说明
微信公众号内支付T_JSAPIpay_infoaggregate-order-method-wechat.md
微信小程序支付T_MINIAPPpay_info同上
微信APP支付T_APPpay_info同上
微信付款码(反扫)T_MICROPAY同步结果同上
支付宝JS支付A_JSAPIpay_infoaggregate-order-method-alipay.md
支付宝正扫A_NATIVEqr_code同上
支付宝付款码(反扫)A_MICROPAY同步结果同上
银联JS支付U_JSAPIpay_infoaggregate-order-method-unionpay.md
银联正扫U_NATIVEqr_code同上
银联付款码(反扫)U_MICROPAY同步结果同上

官方场景前置条件

场景开发前必须完成什么关键运行时值
微信公众号支付准备公众号、完成商户进件并开通微信业务、配置支付授权目录sub_openid
微信小程序支付准备小程序、完成商户进件并开通微信业务、确认 sub_appid 绑定关系sub_openid
支付宝 JS 支付完成商户进件并开通支付宝业务buyer_id / buyer_logon_id
银联 JS 支付完成商户进件并开通银联业务、准备网页授权回调链路user_idcustomer_ip
微信 / 支付宝 / 银联付款码准备扫码设备或收银终端auth_code

汇付 API 端点

属性
API 路径v4/trade/payment/create
请求方式POST
Content-Typeapplication/json

通用架构

接口层
  +- 接收业务系统的下单请求
  +- 校验交易金额、支付类型、通知地址和渠道特有参数

业务逻辑层
  +- 根据 trade_type 选择具体支付场景
  +- 组装聚合支付报文
  +- 调用对应语言 SDK 或 HTTP 客户端发起 `v4/trade/payment/create`
  +- 保存 req_seq_id / req_date / hf_seq_id 供查单和退款复用

请求对象
  |- huifu_id
  |- req_seq_id
  |- trade_type
  |- trans_amt
  |- goods_desc
  +- method_expand / acct_split_bunch / terminal_device_data / combinedpay_data / combinedpay_data_fee_info / trans_fee_allowance_info / tx_metadata 等扩展字段

下面出现的 SDK Request 类和包路径,是 Java 适配层的写法。
如果你不是 Java 项目,参数结构仍按本 Skill 的协议字段来实现。

通用请求参数

参数类型必填说明
huifu_idString(32)Y商户号
req_dateString(8)N请求日期 yyyyMMdd;官方表标非必填,但实务上建议始终传
req_seq_idString(128)Y请求流水号,当天唯一
trade_typeString(16)Y支付类型(见场景路由表)
trans_amtString(14)Y交易金额,单位元,保留两位小数,最低 0.01
goods_descString(128)Y商品描述
method_expandStringC交易类型扩展参数(JSON),是否必填取决于 trade_type;JSON 内容直接是当前场景对象本身
notify_urlString(504)N异步通知地址
time_expireString(14)N交易失效时间 yyyyMMddHHmmss
delay_acct_flagString(1)N是否延迟入账,Y=延迟、N=不延迟
fee_flagString(1)N手续费标记
acct_split_bunchStringN分账对象,顶层请求字段
terminal_device_dataStringN设备信息,顶层请求字段
combinedpay_dataStringN补贴支付信息,顶层扩展字段
combinedpay_data_fee_infoStringN补贴支付手续费承担方信息,顶层扩展字段
trans_fee_allowance_infoStringN手续费补贴信息,顶层扩展字段
tx_metadataStringN扩展参数集合(JSON),保留为顶层扩展入口,但不要混塞已确认属于顶层的补贴类字段
remarkString(255)N备注,原样返回

通用同步返回参数

参数类型说明
resp_codeString(8)业务响应码
resp_descString(512)业务响应信息
huifu_idString(32)商户号
req_dateString(8)请求日期
req_seq_idString(128)请求流水号
hf_seq_idString(128)汇付全局流水号
trade_typeString(16)支付类型
trans_amtString(14)交易金额
trans_statString(1)交易状态:P=处理中、S=成功、F=失败
qr_codeString二维码 URL(正扫场景返回)
pay_infoStringJS 支付调起参数(JS/小程序场景返回)
out_trans_idString(64)用户账单交易订单号
party_order_idString(64)用户账单商户订单号
delay_acct_flagString(1)是否延迟交易
tx_metadataString返回扩展参数集合(补贴、分账、设备、手续费补贴等),与请求侧边界不同
payment_feeString手续费对象

重要:调用成功后务必保存 req_seq_idreq_date,后续查询、退款、关单均需使用。

method_expand 各场景必填字段

trade_type必填字段说明
T_JSAPIsub_appid, sub_openid微信公众号 AppID + 用户 OpenID
T_MINIAPPsub_appid, sub_openid微信小程序 AppID + 用户 OpenID
T_APPsub_appid微信 APP 场景通常至少传子商户应用 ID
T_MICROPAYauth_code用户微信付款码(18位数字)
A_JSAPIbuyer_id 或 buyer_logon_id二选一;直连模式下还常传 subject 等支付宝扩展参数
A_NATIVE按场景可选官方给了完整支付宝扩展结构,营销/直连场景可能会传
A_MICROPAYauth_code用户支付宝付款码
U_JSAPIuser_id, qr_code, customer_ip官方开发指引要求先通过授权流程拿到 user_id,且 JS 支付必传持卡人 IP
U_NATIVE按场景可选官方给了与 U_JSAPI 同结构的银联扩展参数
U_MICROPAYauth_code用户云闪付付款码;银联侧还有 pid_info 等扩展字段

SDK Request 类

Request 类包路径
TradePaymentCreateRequestcom.huifu.dg.lightning.models.payment

常见错误与排查

错误码原因排查方法
10000000参数校验失败检查必填字段格式
20000000重复交易确认 req_seq_id 当天唯一
22000000产品号不存在检查 product_id 配置
22000002商户信息不存在检查 huifu_id
22000005分账/费率/入驻配置有误检查多通道、分账、贴息和费率配置
90000000业务执行失败查看 resp_desc 详情

网络/系统错误:未收到响应或超时时,调用查询接口确认状态,切勿直接判定为失败。

Reference 地图

文件内容
references/aggregate-order.md总览与阅读导航
references/aggregate-order-request.md公共请求参数与顶层字段
references/aggregate-order-method-wechat.md微信请求与回调字段
references/aggregate-order-method-alipay.md支付宝请求与回调字段
references/aggregate-order-method-unionpay.md银联请求与回调字段
references/aggregate-order-tx-metadata.md分账、补贴、设备、手续费对象
references/aggregate-order-response.md同步返回、异步回调、解冻通知
references/aggregate-order-errors.md返回码与文档勘误
references/quickstart.md快速接入摘要

版权声明与联系方式见 copyright-notice.md

Comments

Loading comments...