AI Agent Hub
Back to skills
AllinPay Agreement Payment Flow icon

AllinPay Agreement Payment Flow

Business Operations Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md and install @user_0512de0a/allinpay-sft-skill.

About this skill

Problem It Solves

Integrating AllinPay agreement payments is less about calling one API and more about handling a state machine: signing, debit, refund, and query depend on different sequence numbers; response codes are scattered; 0000 and 4000 can both mean success; 2000, 2007, 2008, 1108, and 1000 require follow-up query; HTTPS timeouts must not be treated as failure. This skill targets backend Java projects and turns AllinPay SDK docs, examples, and response-code rules into implementable call code.

How It Works

The skill generates code along the business chain rather than isolated interface snippets:

  • Signing: call 310001 to trigger the SMS verification, save REQ_SN; then call 310002 to validate the code and obtain AGRMNO.
  • Payment: use 310011 with the agreement number to start debit, save the transaction sequence, and decide whether 200004 query is needed.
  • Query: use 200004 for both payment and refund, with special handling for 1002, processing states, and detail return codes.
  • Refund: use REFUND, keeping refund business codes separate from agreement-payment business codes.

Generated code should prefer SDK helpers such as isTrxSuccess(), isTrxFailed(), and getErrMsg(); for query responses in SDK 1.0.2, use QueryDetail.isSuccess() for each detail record.

Boundaries and Caveats

This is suitable for Java projects that already have the AllinPay SDK, merchant code, business codes, and key files. Do not treat merchant IDs, card numbers, or verification codes in examples as real credentials. The test-environment SMS code is fixed as 111111 and only for integration testing; production must use real SMS, real keys, and real business codes. For SM2 or RSA signatures, the signature type must match the key format, and p12 private keys require a password.

Use Cases

  • When integrating AllinPay in Java, generate code for signing SMS, signing confirmation, and agreement debit.
  • After payment returns processing or HTTPS times out, generate 200004 query and polling state-check code.
  • During refund integration, generate RefundRequest and refund query calls while using the correct refund business code.
  • Convert SDK docs into Java calls for 310001, 310002, 310011, 200004, and REFUND with response-code handling.

Best For

  • Java backend engineers integrating AllinPay signing, debit, query, and refund into a project.
  • Transaction-system engineers handling response codes such as 0000, 4000, and 2000 plus the 1002 rule.
  • Payment-business engineers needing to verify the original transaction and generate RefundRequest calls.
  • Backend engineers adopting a new payment channel who want SDK docs turned into working Java code.