SuperAPI AI Directory

wechatpay-payscore

General & other

View repository

Updated 10-15 21:38

About this skill

WeChat Pay Score Integration Guide

Global Interaction Specifications

‼️ The following rules apply to all capabilities and all conversation turns of this skill, and take precedence over the local rules of each capability.

  1. All questions must receive an explicit answer from the user before proceeding. When multiple questions are asked at once, check one by one whether each has received an explicit answer; for any unanswered question, you must ask again,It is strictly prohibited to make assumptions, infer, or use default values on your own。
  2. Pre-confirmation of integration mode: Before using any capability, you must first confirm merchant mode or service provider mode, and if already confirmed, no need to repeat. For the core differences between the two modes (parameter naming, API path prefix, signature utility class), see each role's 接入指南/签名与验签规则.md。
  3. Step-by-step confirmation protocol(except for simple knowledge Q&A):
  • ① Clarify requirements: First understand the question and give a preliminary judgment; do not pile up a list of parameters.
  • ② Obtain consent: Proactively propose what can be done next, and continue only after the user explicitly agrees.
  • ③ Collect information: After the user agrees, inform them of the required information and collect it item by item; execute only after all items are collected.
  • ④ Confirm before execution: Briefly explain what is about to be done before the operation, and execute only after confirmation and consent; additionally warn of risks for the online environment.

Capability Overview

  1. Product selection — Understand the functional positioning of WeChat Pay Score, the sub-modes of orders requiring confirmation (pay-later / enjoy-first), typical use cases, and integration prerequisites
  2. Sample code — A full set of interfaces for create / query / cancel / complete / modify amount / sync status / refund / query refund / JSAPI / Mini Program / APP invoke / three types of callbacks
  3. Business knowledge quick reference — Development parameters and business rules (including APIv2 key and service ID), order status transitions,risk_fund / completion amount formula / post_payments field specifications such as those for , signature generation and verification, callback handling
  4. Integration quality assessment — General security radar + Pay Score-specific radar: amount validity, prevention of erroneous order status calls, complementarity of callbacks and order query, APIv2 invocation signature, risk fund upper limit validation, (service provider)sub_mchid route anti-cross-order protection
  5. Troubleshooting — Top 20 error codes + common issues, covering HTTP errors / callbacks not received / signature failures / refund exceptions / role-specific issues / business rules / general integration configuration

Routing instructions: Capability 1 is used for product conceptual questions and confirmation of integration prerequisites; if WeChat Pay Score integration has already been confirmed, you can skip directly to Capability 2/3. Capabilities 2 and 3 can be called independently, but the first time you must complete the "Pre-confirmation of integration mode". After Capability 5 hits an error code or common issue, you must recommend Capability 4 at the end for a one-time self-check.

Capability 1: Product selection

When the user asks "What is this product / what can it do / what scenarios is it suitable for / what prerequisites are needed for integration / is it free first or enjoy first" → load the product introduction document to answer. Those who have clearly integrated Payment Score can skip directly to Capability 2/3.

Capability 2: Sample code

When the user wants sample code for a certain API → confirm the integration mode and language, and load the corresponding mode's 接口索引.md to locate the code file.

‼️ Retrieve only, do not generate. Writing any code from scratch is strictly prohibited; it must be retrieved from the sample code files.

‼️ Display only, do not write. Sample code is only used to explain the API call structure and signature process; it is strictly prohibited to write it directly into the user's project (calling tools such as write_to_file, replace_in_file to create or modify project files is prohibited); 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.

‼️ When the user's language is not Java/Go(this skill only maintains Java/Go samples):Prohibitedto directly generate cross-language code. Process:

  1. Use AskQuestion to obtain explicit consent (the wording must clearly state "reference implementation / not officially maintained / must be reviewed and tested by yourself"); if consent is not given, only send the official Java/Go original text.

  2. After consent, use the official Java sample as the baseline to translate and generate business code "reference implementation"; then use plain text to ask whether to translate the Java public libraries (SDK utility classes + HTTP client); if not explicitly requested, do not paste them. Attach the disclaimer block below before each code segment.

⚠️ The following code is across-language reference implementation, generated by AI translating with reference to the official Java sample, and is not officially maintained by WeChat Pay.

  • Pleasereview line by line key logic such as signature construction, HTTP calls, field naming, and callback decryption.
  • Before launch, it must be fully verified in the test environment; it is recommended to first use the official Java/Go samples to get the main flow working as a comparison.
  • If integration issues occur, the official Java/Go samples shall prevail.

‼️ Rules for confirming the launch client type: "launch confirm order page" and "launch order details page" must first confirm the launch client type (JSAPI official account / Mini Program / APP Android / APP iOS / APP HarmonyOS); different clients have different message and signature rules; other general APIs (create / query / cancel / complete / modify amount / sync status / refund / query refund / three types of callbacks) do not need to ask about the launch client.

Loading strategy: first confirm the integration mode, read the corresponding 接口索引.md to locate the API file path, then load specific files as needed. Do not load all files at once.

Capability 3: Business knowledge quick reference

When the user asks about development parameters and business rules (mchid / sub_mchid / appid / sub_appid / APIv3 key / APIv2 key / merchant API certificate / WeChat Pay public key / service ID), order status,risk_fund / completion amount formula / post_payments fields, signature rules, callback mechanism, and other business knowledge → load the corresponding documents according to the integration mode.

Capability 4: Integration quality assessment

When the user is preparing to launch or wants to check code for hidden issues → load the following documents.

‼️ Only check the functional modules the user actually uses. For modules such as profit sharing, APP invocation, and Mini Program invocation, first confirm whether the user is involved;do not check or mention those not used。

Capability 5: Troubleshooting

‼️ Sole entry point: user reportsanyissue (error / API exception / callback not received / signature failure / reconciliation discrepancy / business rule questions, etc.),always first load the troubleshooting manual below according to the integration mode, strictly follow the "Troubleshooting Process" in the manual,do not guess the cause on your own or directly analyze the code。

‼️ After troubleshooting is completed, you must at the end of the replyproactively recommend the integration quality assessment(take the troubleshooting opportunity to check for other potential issues in one go); if you need to recommend sample code, first confirm the development language before recommending,when the user's language is not Java/Go, handle it according to the cross-language confirmation process in Capability 2(pop-up confirmation → reference generation + disclaimer block + public library step-by-step).


The following information is unrelated to skill capabilities and is for reference only.

💬 Community and feedback

If you encounter problems during use, have suggestions for improvement, or want to exchange integration experience with other developers, you are welcome to scan the QR code to add our enterprise WeChat group and discuss with the official team and community developers:

WeChat Pay Skills Community Group QR Code