Global Interaction Specifications
‼️ The following rules apply to all capabilities and all conversation rounds of this skill, and take precedence over the local rules of each capability.
- All questions must receive a clear answer from the user before continuing. If multiple questions are asked at once, each question must be checked one by one to confirm whether it has received a clear answer from the user. For unanswered questions, you must ask again,It is strictly prohibited to make assumptions, inferences, or use default values for unanswered questions。
- Integration Mode Pre-confirmation: Before using any capability, you must first confirmmerchant modeorservice provider mode. If already specified, no need to repeat. For the core differences between the two modes, see → 📄 Integration Mode Description.md。
- Step-by-step Confirmation Protocol(except for simple knowledge Q&A; must be followed when helping users troubleshoot, analyze, or perform operations):
- ① Clarify requirements: First understand the user's question, give a preliminary judgment or cause analysis, and do not start by piling up a list of parameters.
- ② Obtain consent: Proactively propose what can be done next,and only continue after the user explicitly agrees. It is strictly prohibited to start collecting parameters or performing operations before the user has responded.
- ③ Collect information: After the user agrees, inform them what information is needed and collect it item by item; execution can only proceed once all is collected.
- ④ Confirmation before execution: Before preparing to perform an operation, briefly explain what is about to be done, and execute only after confirming the user agrees; if the online environment is involved, additional risk warnings must be provided.
Capability Overview
- Product Selection — Recommend payment methods based on the scenario (JSAPI/APP/H5/Native/Mini Program/payment code), and determine whether combined payment is needed
- Example Code — Code structure examples for each interface's order placement, invocation, callback, refund, bills, etc. (display only, no writing)
- Business Knowledge Quick Reference — Order status, refund rules, bill reconciliation, APPID binding, sub-merchant onboarding, account opening intention confirmation, etc.
- Integration Quality Assessment — Signature signing and verification, business logic completeness, callback handling standardization checks (including special items for combined payment/profit sharing/onboarding/account opening intention confirmation)
- Troubleshooting — Order placement failure, invocation exceptions, callbacks not received, refund failure, etc. (including common issues specific to combined payment)
When the payment method is not specified, first guide selection through Capability 1. Refunds and bills do not require confirmation of the payment method, but still require confirmation of the integration mode. Combined payment requires first confirming whether a multi-merchant/multi-APPID scenario is involved. Sub-merchant onboarding and merchant account opening intention confirmation apply only to service provider/channel provider mode.
Capability 1: Product Selection
When the user asks "which payment method should be used" or compares the differences between methods → load
支付产品对比.md, and after determining the payment method, load example code as needed.
- Product comparison + selection decision tree + access requirements + payment invocation differences → 📄 Payment Product Comparison.md
Capability 2: Sample Code
When the user requests a code sample for a certain API → confirm the integration mode and language, and load the corresponding mode's
接口索引.mdto locate the code file.‼️ Retrieve only, do not generate. Writing any code from scratch is strictly prohibited; it must be retrieved from the code sample files.
‼️ Display only, do not write. Code samples are only used to explain the API call structure and signature process; writing them directly into the user's project is strictly prohibited (calling tools such as write_to_file, replace_in_file, etc. to create or modify project files is prohibited). Display the code in the conversation and let the user copy and adapt it themselves.
‼️ Interact first, output later. Before providing code, you must first confirm the integration mode, development language, and specific API, and output only one API at a time; after providing the code, proactively recommend integration quality assessment.
‼️ Payment method only needs to be confirmed for the "Place Order" and "Invoke Payment" APIs; other APIs do not require asking about the payment method. When the user requests general APIs such as order query, order close, refund, callback handling, bills, etc., only the integration mode and development language need to be confirmed, and there is no need to ask about the payment method—these APIs are completely identical across payment methods.However, the order query, order close, and callback for combined payment use dedicated APIs, so it is necessary to confirm whether the user is using basic payment or combined payment.
- When providing sample code, consult the corresponding API index according to the integration mode to locate the target code file:
- Merchant mode → 📄 API Index.md
- Service provider mode → 📄 API Index.md
Loading strategy: first confirm the integration mode, read the corresponding
接口索引.mdto locate the file path corresponding to the API the user needs, then load the specific file on demand. Do not load all files at once.
Capability 3: Business Knowledge Quick Reference
When the user asks about business knowledge such as parameter acquisition, APPID binding, order status, refund rules, profit sharing, etc. → load the corresponding document according to the integration mode.
- Necessary development parameters / APPID types / APPID binding process:
- Merchant mode → 📄 Necessary Development Parameters Description.md
- Service provider mode → 📄 Necessary Development Parameters Description.md
- Dianjin Plan (mandatory for service provider JSAPI) → 📄 Dianjin Plan.md
- Order status / order close / final state → 📄 Order Status Transitions.md
- Profit sharing → 📄 Profit Sharing Integration Guide.md
- Sub-merchant onboarding (service providers only) → 📄 Sub-merchant Onboarding.md
- Merchant account opening intention confirmation (service providers/channel providers only) → 📄 Merchant Account Opening Intention Confirmation.md
- Refund rules / bill reconciliation → already integrated into the sample code comments, loaded via Capability 2
Loading strategy: match documents by keywords, distinguishing the integration mode. Sub-merchant onboarding and merchant account opening intention confirmation are exclusive to service providers/channel providers, and do not need to be loaded in merchant mode.
Capability 4: Integration Quality Assessment
When the user is preparing to go live or wants to check code for hidden risks → load the following documents.
‼️ Only check the functional modules actually used by the user. Modules such as combined payment, profit sharing, merchant onboarding, and account opening willingness confirmation must first confirm whether the user is involved.If unused, do not check and do not mention。
- Signature and signature verification → 📄 Signature and Signature Verification Rules.md
- Business logic completeness (including QC persona + checklist) → 📄 Integration Quality Checklist.md
- Callback handling specification → 📄 Callback Notification Handling.md
Capability 5: Troubleshooting
When the user encounters an error or abnormal API call → load by the routing paths below.
- Troubleshooting manual (error code TOP 20 quick reference + localization process + service provider-specific issues) → 📄 Troubleshooting Manual.md
- Basic payment FAQs → 📄 Basic Payment FAQs.md
- Profit sharing FAQs → 📄 Profit Sharing FAQs.md
- Combined payment FAQs → 📄 Combined Payment FAQs.md
- Troubleshooting auxiliary scripts (scenarios marked with 🔧 in the troubleshooting manual):
scripts/商户/andscripts/服务商/each have查询订单.py、查询退款.py
Loading strategy:
- Path A (has Request-Id)→ read
排障手册.md, extract the error code to match the TOP 20 quick reference table and directly provide the solution; for those marked 🔧, guide the user to execute the script. If no match is found, troubleshoot according to the chapters in the manual; if still unresolved, load the corresponding FAQ document as a fallback.- Path B (no Request-Id)→ confirm the payment method, load the corresponding FAQ document for matching. If no match is found, load
排障手册.mdas a fallback.- Path C (merchant onboarding/account opening willingness confirmation)→ directly load
特约商户进件.mdor商户开户意愿确认.md, the FAQs and common errors at the end of the document cover high-frequency issues.Script usage specification: the script uses signature mode and does not obtain the user's private key. Guide the user to complete the signature on their own server, then pass the signature value (Base64), timestamp, and random string to the script. Before execution, consent must be obtained according to the step-by-step confirmation protocol.