← Back to Skills Marketplace
codecodeing

Huifu DouGong HostingPay Cashier Refund

by 青衫墨痕 · GitHub ↗ · v1.0.3 · MIT-0
cross-platform ✓ Security Clean
300
Downloads
3
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install huifu-dougong-hostingpay-cashier-refund
Description
汇付支付斗拱统一收银台退款 Skill:覆盖托管交易退款申请和退款结果查询。参数表和业务规则按协议字段组织,Java SDK 调用方式放在语言适配入口里。当开发者需要对收银台托管订单发起退款或查询退款状态时使用。触发词:托管退款、收银台退款、托管退款查询、收银台退款查询。
README (SKILL.md)

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

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

Copyright: Shanghai Huifu Payment Co., Ltd.


统一收银台 - 退款

托管交易退款申请 + 退款结果查询。

适配版本与复核信息

项目 内容
Skill 版本 1.1.0
当前适配 SDK dg-java-sdk 3.0.34
最后复核日期 2026-04-08
官方文档来源 汇付开放平台托管支付退款/退款查询接口文档、Java SDK 文档、异步消息说明

运行依赖与凭据边界

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

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

进入本 Skill 前先确认:原交易标识已经在订单侧沉淀并可回查,且退款参数按 参数校验与 JSON 构造规范 做过必填 / 条件必填校验。

协议规则入口

语言适配入口

这份 Skill 的退款字段、定位键和状态说明,都是语言无关的。
具体语言怎么初始化和发请求,先看这里:

Java 适配说明

下面这一段是 Java 专属约束。
如果你用的是其他语言,字段规则还是按协议表理解,但不要照搬 Java 的 setter 细节。

[关键陷阱] 退款最重要的字段 org_req_seq_id(原交易流水号)没有独立的 setter 方法,必须通过 extendInfoMap 传入。调用 request.setOrgReqSeqId() 将导致编译错误。详见 refund.md

// ERROR: 不存在此方法,编译报错
request.setOrgReqSeqId("20240514...");

// OK: 通过 extendInfoMap 传入
extendInfoMap.put("org_req_seq_id", "20240514...");
request.setExtendInfo(extendInfoMap);

触发词

  • "托管退款"、"收银台退款"、"托管订单退款"、"收银台支付退款"
  • "托管退款查询"、"收银台退款查询"、"查询托管退款结果"

场景路由

用户意图 场景 详细说明
对已支付订单发起退款 托管交易退款 refund.md
查询退款结果 退款结果查询 refund-query.md

汇付 API 端点

场景 API 路径 请求方式
退款 v2/trade/hosting/payment/htRefund POST
退款查询 v2/trade/hosting/payment/queryRefundInfo POST

通用架构

接口层
  |- 接收退款和退款查询请求
  |- 校验原交易定位键、退款金额和通知地址

业务逻辑层
  |- 组装退款报文和退款查询报文
  |- 调用对应语言 SDK 或 HTTP 客户端
  +- 输出退款受理结果和退款最终状态

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

SDK Request 类对照

场景 SDK Request 类
退款 V2TradeHostingPaymentHtrefundRequest
退款查询 V2TradeHostingPaymentQueryrefundinfoRequest

device_type 映射表

退款时 device_type 应与原交易的预下单类型匹配:

原交易 pre_order_type 原交易场景 退款 device_type
1 H5 手机网页支付 手机 "1"
1 PC 网页支付 PC "4"
2 支付宝小程序 手机 "1"
3 微信小程序 手机 "1"

如果不确定原交易渠道,使用 "4" 作为默认值通常可以通过校验。

退款请求参数摘要

专属字段(有独立 setter):

参数 setter 类型 必填 说明
reqDate setReqDate() String(8) Y 本次退款的请求日期
reqSeqId setReqSeqId() String(128) Y 本次退款的请求流水号
huifuId setHuifuId() String(32) Y 商户号
ordAmt setOrdAmt() String(14) Y 退款金额,不超过原交易金额
orgReqDate setOrgReqDate() String(8) Y 原交易的请求日期
terminalDeviceData setTerminalDeviceData() String(2048) C 设备信息 JSON,线上退款必填
riskCheckData setRiskCheckData() String(2048) C 风控信息 JSON,线上退款必填
bankInfoData setBankInfoData() String(1024) C 银行信息 JSON,银行大额转账支付退款时必填

扩展字段(通过 setExtendInfo(Map) 传入,无独立 setter):

参数 必填 说明
org_req_seq_id C 原交易的请求流水号;与 org_hf_seq_id、org_party_order_id 三选一;拆单支付场景下不作为定位字段
org_party_order_id C 原交易微信/支付宝商户单号;与 org_hf_seq_id、org_req_seq_id 三选一;拆单支付场景下与 org_hf_seq_id 二选一
org_hf_seq_id C 原交易汇付全局流水号;与 org_req_seq_id、org_party_order_id 三选一;拆单支付场景下与 org_party_order_id 二选一
notify_url N 退款结果异步通知地址

完整字段说明见 refund.md

退款返回参数摘要

参数 类型 说明
resp_code String(8) 00000000 表示退款请求已受理
trans_stat String(1) 退款状态:P=处理中、S=成功、F=失败
ord_amt String(14) 退款金额
org_req_seq_id String(128) 原交易请求流水号
req_seq_id String(128) 本次退款的请求流水号

退款查询请求参数摘要

参数 setter 类型 必填 说明
reqDate setReqDate() String(8) Y 本次查询的请求日期
reqSeqId setReqSeqId() String(128) Y 本次查询的请求流水号
huifuId setHuifuId() String(32) Y 商户号
orgReqDate setOrgReqDate() String(8) Y 退款交易的请求日期
orgReqSeqId setOrgReqSeqId() String(128) C 退款交易的请求流水号(非原支付流水号,与 orgHfSeqId 二选一)
orgHfSeqId setOrgHfSeqId() String(128) C 退款交易的全局流水号(与 orgReqSeqId 二选一)

注意:退款查询的 orgReqSeqId退款请求的流水号,不是原支付交易的流水号。trans_stat=I 属于罕见初始态,查询到后需联系汇付技术。分账对象、分账手续费、垫资信息和渠道报文见 refund-query.md

退款期限

渠道 最大退款期限
微信(小程序/公众号) 360天
支付宝(小程序/JS) 360天
H5/PC 网页支付 360天

流水号关系图

退款涉及三层流水号,容易混淆:

预下单: req_seq_id = "A001" (原支付交易流水号)
  ->
退款: req_seq_id = "B001" (退款请求流水号), org_req_seq_id = "A001"
  ->
退款查询: req_seq_id = "C001" (本次查询流水号), org_req_seq_id = "B001" (退款流水号)

退款查询查的是 B001(退款流水号),不是 A001(原支付流水号)。

异步通知参数

退款结果通过异步通知回调 notify_url,关键字段:

参数 类型 说明
resp_code String(8) 业务响应码
huifu_id String(32) 商户号
req_seq_id String(128) 退款请求流水号
trans_stat String(1) 退款状态:S=成功、F=失败
ord_amt String(14) 退款金额
actual_ref_amt String(14) 实际退款金额
total_ref_amt String(14) 累计退款金额
org_req_seq_id String(128) 原交易流水号
org_ord_amt String(14) 原订单金额

退款流程

1. 确认原交易已支付成功(trans_stat=S)
2. 调用退款接口发起退款(org_req_seq_id 通过 extendInfoMap 传入)
3. 退款状态为 P(处理中)时,等待异步通知或轮询退款查询接口
4. 退款成功(trans_stat=S)后执行业务退款逻辑

常见错误与排查

错误码 场景 说明 排查方法
00000000 退款/查询 处理成功(退款仅表示已受理) 等待异步通知确认最终状态
00000100 退款 退款处理中 正常状态,等待异步通知或轮询查询
10000000 退款/查询 无效参数 检查必填字段,特别是 extendInfoMap 中的 org_req_seq_id
20000004 退款/查询 交易不存在 检查 org_req_date 和 org_req_seq_id
编译错误 退款 setOrgReqSeqId() 方法不存在 改用 extendInfoMap 传入 org_req_seq_id

注意事项

  1. org_req_seq_id 无专属 setter,必须通过 extendInfoMap 传入
  2. 退款金额不能超过原交易金额,汇付会在 API 侧校验
  3. 退款接口需要 terminal_device_data(设备信息),线上交易退款必填
  4. resp_code=00000000 仅表示退款请求已受理,最终结果以异步通知或查询为准
  5. 重复退款请求会被拒绝,需做好幂等校验
  6. device_type 根据原交易渠道选择,不确定时用 "4"
  7. 退款查询的 orgReqSeqId退款流水号,不是原支付流水号
  8. 线上交易退款除 terminal_device_data 外,risk_check_data 也要一并准备;银行大额转账退款还需补齐 bank_info_data
  9. 拆单支付退款定位原交易时,优先使用 org_hf_seq_idorg_party_order_id,不要再按普通场景只传 org_req_seq_id

快速接入代码示例见 quickstart.md


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

Usage Guidance
This skill is a documentation-only adapter for Huifu refund APIs and looks internally coherent. Before installing: (1) Verify you trust the source and the homepage (https://paas.huifu.com). (2) Keep the RSA private key in a secure secret store—do not paste it into chat or unsecured files. (3) Confirm how your platform maps the listed config paths (HUIFU_*) to environment/secret storage and check the referenced base skill (huifu-dougong-hostingpay-base) because SDK initialization and signing live there. (4) Note a small metadata mismatch: SKILL.md shows version 1.1.0 while registry metadata lists 1.0.3—confirm you have the intended version. (5) If you allow autonomous invocation of skills in your agents, be mindful that this skill would be able to initiate refund-related actions using any credentials you supply; restrict credentials and permissions (e.g., use a test account or limited-scope keys) when possible.
Capability Analysis
Type: OpenClaw Skill Name: huifu-dougong-hostingpay-cashier-refund Version: 1.0.3 This skill bundle provides instructions and documentation for integrating Huifu Payment (DouGong) refund and query APIs. It contains standard API documentation, Java SDK code snippets, and configuration requirements for payment credentials (RSA keys) in files like SKILL.md and references/refund.md. The content is strictly aligned with its stated purpose of facilitating financial transactions and lacks any indicators of malicious behavior, data exfiltration, or prompt injection.
Capability Tags
cryptocan-make-purchases
Capability Assessment
Purpose & Capability
Name/description (refund + refund-query for Huifu 收银台托管交易) match the files and declared requirements. The listed config items (product_id/sys_id, RSA key pair, notify URL) are expected for signing requests and receiving async notifications from a payment provider.
Instruction Scope
SKILL.md and reference files are implementation documentation and Java SDK examples; they do not instruct the agent to read unrelated system files or to exfiltrate data. The skill repeatedly delegates SDK init to the base skill and points to signing/async docs; scope stays within refund/query functionality.
Install Mechanism
Instruction-only skill with no install spec and no code files — nothing is downloaded or written to disk by the skill itself, which is the lowest-risk install model.
Credentials
The skill requires access to sensitive config entries (HUIFU_PRODUCT_ID, HUIFU_SYS_ID, HUIFU_RSA_PRIVATE_KEY, HUIFU_RSA_PUBLIC_KEY, HUIFU_REFUND_NOTIFY_URL). Those are expected and proportionate for a payment integration (signing and notify URL), but they are high-value secrets (especially the private key) and should be stored and provisioned securely. The skill does not declare a single primaryEnv variable; config is expressed as required config paths — this is consistent but worth confirming with the base skill's credential boundary docs.
Persistence & Privilege
always:false and user-invocable are set; the skill does not request permanent/always-on privilege. There is no evidence it modifies other skills or system-wide settings.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install huifu-dougong-hostingpay-cashier-refund
  3. After installation, invoke the skill by name or use /huifu-dougong-hostingpay-cashier-refund
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
**huifu-dougong-hostingpay-cashier-refund v1.1.0** — 新版本协议适配和文档规范更新 - Skill 名称、依赖、协议与文档组织规范全面迭代,更贴合“汇付支付斗拱统一收银台退款”定位 - 适配 dg-java-sdk 3.0.34,添加版本与复核信息,兼容 2026 年文档 - 依赖及凭据管理规范整理,指向新 base Skill 和凭据边界文档 - 退款/退款查询参数表、业务规则、接口字段结构以协议为中心编排,语言 sdk 适配说明分离 - 版权协议与使用范围说明强化;license 修改为 CC-BY-NC-4.0 - 文件与触发词、关键陷阱等内容逻辑不变,表述更清晰,便于多语言适配和后续维护
v1.0.2
- No code or configuration changes were detected in this release. - Documentation author information in SKILL.md updated. - Formatting and clarifications were made in documentation, with no change to functionality. - Version remains at 1.0.0 in SKILL.md despite version input as 1.0.2; this is a metadata/documentation-only update.
v1.0.1
- Added display_name, author, and homepage fields; reorganized metadata for clarity. - Clarified the role of external configuration and credential boundaries in the documentation. - Improved structure and readability of the SKILL.md introduction and metadata sections. - No functional or code changes; documentation and metadata enhancements only.
v1.0.0
Initial release of dougong-hostingpay-cashier-refund. - Adds refund application and refund result query capabilities for Huifu Hosting Payment. - Supports essential API endpoints for refund and refund status queries. - Documents all required parameters, triggers, and common pitfalls (notably org_req_seq_id usage). - Provides integration guidance, error codes, and sample code references. - Emphasizes compliance with official Huifu documentation and support channels.
Metadata
Slug huifu-dougong-hostingpay-cashier-refund
Version 1.0.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is Huifu DouGong HostingPay Cashier Refund?

汇付支付斗拱统一收银台退款 Skill:覆盖托管交易退款申请和退款结果查询。参数表和业务规则按协议字段组织,Java SDK 调用方式放在语言适配入口里。当开发者需要对收银台托管订单发起退款或查询退款状态时使用。触发词:托管退款、收银台退款、托管退款查询、收银台退款查询。 It is an AI Agent Skill for Claude Code / OpenClaw, with 300 downloads so far.

How do I install Huifu DouGong HostingPay Cashier Refund?

Run "/install huifu-dougong-hostingpay-cashier-refund" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Huifu DouGong HostingPay Cashier Refund free?

Yes, Huifu DouGong HostingPay Cashier Refund is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Huifu DouGong HostingPay Cashier Refund support?

Huifu DouGong HostingPay Cashier Refund is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Huifu DouGong HostingPay Cashier Refund?

It is built and maintained by 青衫墨痕 (@codecodeing); the current version is v1.0.3.

💬 Comments