Preface¶
When integrating with Allinpay SFT (收付通), protocol payments often involve stringing together contract signing SMS, signing confirmation, fund deduction, order querying, and refunds. Given the multitude of transaction codes and business codes, and the fact that official documentation is scattered across various chapters, manually digging through docs to write SftClient calls can lead to pitfalls regarding state judgment, businessCode mixing, and whether to query orders after timeouts. Below is an introduction to the community Skill on SkillHub: “Allinpay Pay & Collect Skill” (通联支付收付产品skill). It organizes the common conventions, single interface descriptions, and the entire business chain of the SFT Java SDK into a skill package routable by Agents, facilitating the generation of integration code via natural language in environments like Cursor and Claude Code.
What is this¶
“Allinpay Pay & Collect Skill” (Coordinate: @user_0512de0a/allinpay-sft-skill, current version 1.0.3, source: community, publisher: user_0512de0a) is an SFT skill package designed for Agents. Its main entry corresponds to the Allinpay SFT Java SDK allinpay-sft-sdk-java 1.0.3. The Skill page intro states that it covers the full workflow of signing SMS 310001, signing confirmation 310002, protocol payment 310011, transaction query 200004, and refund REFUND. The package also extends to scenarios like batch protocol payments, real-time payments, accounts, and reconciliation via flow/ and api/ directories.
On SkillHub, this Skill is categorized under dev-programming and tagged with requires_api_key=false (Installing the Skill itself does not require a separate SkillHub API Key; Allinpay merchant and SDK environment configurations must still be prepared according to SFT integration specifications). Page statistics (based on crawled data): Rating 100000, Downloads 783, Installs 4.
Core Functions¶
The Skill root directory SKILL.md acts as the routing entry point. Before generating code, it requires adherence to common/SKILL.md first, followed by specific business instructions.
Protocol Payment Main Link¶
The complete link for “Protocol Payment” on the payee side is defined in flow/agreement-pay.md as:
310001 (Signing SMS) → 310002 (Signing Confirmation) → 310011 (Protocol Payment) → 200004 (Transaction Query) → REFUND (Refund) → 200004 (Refund Query)
The process documentation provides table-format explanations for each step’s corresponding SDK methods, success judgments, and database fields. For example, signing confirmation uses isSigned(), while fund-related steps use the isTrx* series for judgment. If the status is “processing” or a timeout occurs, one must proceed with 200004 to query the order rather than judging it as a failure directly.
Broader Product and Interface Coverage¶
Beyond the five steps of protocol payment in the intro, the same skill package also provides:
| Type | Examples |
|---|---|
Full workflow flow/*.md |
Batch protocol payment, single real-time payment, batch payment, repayment, joint loan, account types, file tools, etc. |
Single interface api/*.md |
24 interface descriptions split by transaction codes (including order query trx-query, refund refund, etc.) |
Common common/ |
SftConfig / SftClient, state machine, return codes, timeout & DEBUG, Java skeleton classes |
Trigger descriptions (from SKILL.md) include keywords such as: SFT (收付通), Allinpay (通联支付), SftClient, protocol payment, collection & payment (代收代付), repayment, account withdrawal/recharge, reconciliation receipts, refund, order query, return codes, etc. The Agent will select sub-instructions under common/, flow/, or api/ based on these terms.
Hard Constraints Aligned with SDK¶
The skill package unifies the following requirements:
- Maven dependency
com.allinpay.cus.sdk:allinpay-sft-sdk-java:1.0.3, package namecom.allinpay.cus.sdk.sft - Amount unit is in cents;
businessCodemust not be mixed in scenarios like payment and refund (Protocol payment test example is19900, refund is09200; production values depend on the business party). - Success judgment for fund/verification businesses must not rely solely on
isSuccess(). - When
HttpTimeoutExceptionor a “processing” status occurs, perform an order query; do not treat it as a failure directly.
Installation and Activation¶
Via SkillHub CLI (Recommended)¶
First, confirm that skillhub is installed on your machine (see SkillHub Installation Instructions for installation methods). When installing the skill, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized.
command -v skillhub && skillhub --version
skillhub install allinpay-sft-skill --namespace user_0512de0a --dir ~/.cursor/skills/
Common Agent skills paths (excerpted from SkillHub installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
You can also ask the Agent to install it via dialogue following official prompts:
Please install `@user_0512de0a/allinpay-sft-skill` according to https://skillhub.cn/install/skillhub.md.
Manual Directory Copy¶
The skill package README explains: The standard Agent Skills form is “one directory + entry SKILL.md”, which needs to contain SKILL.md, README.md, as well as common/, api/, and flow/. Example (bash):
DEST="$HOME/.cursor/skills/allinpay-sft-skills"
mkdir -p "$DEST"
cp SKILL.md README.md "$DEST/"
cp -r common api flow "$DEST/"
After installation, mention words like “Protocol Payment”, “SFT”, “310001” in the conversation to confirm that the Agent has loaded the Skill.
Project-side SDK Dependency¶
The Maven coordinates depended on by the generated code (consistent with the skill package version):
<dependency>
<groupId>com.allinpay.cus.sdk</groupId>
<artifactId>allinpay-sft-sdk-java</artifactId>
<version>1.0.3</version>
</dependency>
Typical Usage¶
Usage is primarily based on describing scenarios in natural language. The Agent routes to the corresponding flow or api documentation via SKILL.md and then generates Java串联 (chained) code. Examples from the README are as follows.
Full link:
I need to integrate Allinpay SFT protocol payment
Split by steps:
I need to integrate the Allinpay SFT protocol payment signing SMS interface
I need to integrate the Allinpay SFT protocol payment signing confirmation interface
I need to integrate the Allinpay SFT protocol payment deduction interface
I need to query Allinpay SFT transaction results
I need to initiate a refund for an Allinpay SFT order
Other domains can be described similarly, e.g., “Single real-time payment 100014”, “Account withdrawal 300003”, “Reconciliation file download”.
The protocol payment process documentation also outlines key data dependency points: The REQ_SN returned by 310001 is used as srcReqSn for 310002; the agrmNo after successful signing needs to be persisted and used for 310011; the payment REQ_SN is used for order queries and as orgBatchId for refunds, etc. The test environment signing SMS verification code is noted as 111111 in the process description (subject to the official Allinpay environment).
Applicable Scenarios and Notes¶
Who it is for
- Java backend or full-stack developers currently integrating Allinpay SFT using allinpay-sft-sdk-java 1.0.3
- Those needing standard chaining for protocol payment from signing to refund, or just fields and call examples for a specific transaction code
- Those hoping to generate code with an Agent in an IDE while uniformly adhering to SFT state machines, return codes, and order query rules
Limitations and Notes
- The skill package focuses on SDK integration and code generation specifications; it cannot replace Allinpay merchant onboarding, key management, or production environment configuration. See the package README for official documentation entry points (e.g., SFT Open Platform, Technical Documentation).
- This is a community-sourced Skill. Before integration, it is recommended to verify transaction codes,
businessCodevalues, and return code tables (incommon/RETURN_CODES.mdwithin the package) in the test environment. - Skill generation constraints require: Code comments delivered to merchants should not contain internal skill package numbers or terms like
SKILL.md; when modifying the integrator’s project, existing configuration items should only be appended, not deleted or modified, and key conflicts must be explained first.
Conclusion¶
“Allinpay Pay & Collect Skill” packs the core SFT protocol payment transaction codes and more complete flow/api documentation into a routable Agent skill package. It binds the initialization, success judgment, and timeout query rules of SDK 1.0.3, making it suitable as a conversational side reference for SFT Java joint testing.
- SkillHub Page: https://www.skillhub.cn/skills/user_0512de0a/allinpay-sft-skill
- API Coordinate Page: https://api.skillhub.cn/user_0512de0a/allinpay-sft-skill