Skip to main content

Documentation Index

Fetch the complete documentation index at: https://waffo.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

waffo-integrate is Waffo’s official AI integration Skill. It helps developers automatically complete SDK integration through an interactive wizard. It supports AI coding tools such as Claude Code and Cursor.

Integration roadmap

1

Prepare your project

Open your project in Claude Code or Cursor.
2

Install the Skill

Run npx @waffo/waffo-integrate.
3

Trigger Waffo integration

Ask your AI assistant to integrate Waffo payment.
4

Answer business questions

Select the capabilities you need, such as payment, refund, subscription, Webhook, merchant configuration lookup, and payment method lookup.
5

Review and generate code

The AI tool previews the code, then generates SDK initialization, services, Webhook handlers, and tests after confirmation.
6

Run verification

The AI tool runs integration tests covering payment, refund, subscription, and Webhook flows.
7

Submit the test report

Send the generated test report to the Waffo technical support group for confirmation.

Why use waffo-integrate

MetricUsing the SkillManual integrationImprovement
Integration pass rate100%75%+25%
Average time128s192s-33%
Token usage58.8k66.3k-11%

Installation

npx @waffo/waffo-integrate

Integration flow

1

Trigger the Skill

Enter a trigger phrase in your AI assistant: 集成 Waffo 支付, integrate waffo, 接入waffo, waffo sdk, or waffo payment.
2

Language detection

The Skill automatically detects the project language: package.json → Node.js, pom.xml / build.gradle → Java, go.mod → Go.
3

Feature selection

Interactively select the features you need (prompted one by one): payments, refunds, subscriptions, Webhook, merchant configuration lookup, payment method lookup. Smart recommendations: if you select payments, it will suggest adding refunds; if you select subscriptions, it will suggest adding Webhook.
4

Framework selection (Webhook only)

LanguageRecommended frameworkOther options
Node.jsExpressNestJS, Fastify
JavaSpring Boot
GoGinEcho, Fiber, Chi
5

Code preview & generation

The Skill first displays the complete code for review, then generates it after confirmation: SDK initialization, payment/refund/subscription services, Webhook handling, test files, and .env.example.
6

Integration verification (optional)

Run 15 acceptance tests covering the full payments, refunds, and subscriptions flow. Includes HTTP endpoint tests + Playwright automated checkout operations + database state checks.
After verification, send the generated test report to your company and Waffo technical support group, such as the WeCom or Lark group, so Waffo can confirm the integration result.

13 built-in API rules

The Skill’s built-in rules automatically prevent common mistakes:
#RulePrevents
1Request ID max length is 32 charactersValues longer than the Waffo idempotency key limit
2Subscriptions use currency, not orderCurrencyField name confusion
3Subscriptions use amount, not orderAmountField name confusion
4Required-field checks for each operationMissing payMethodType, goodsInfo, etc.
5periodType is only DAILY/WEEKLY/MONTHLYInvalid enums YEARLY, MONTH
6periodInterval is String, not NumberType errors
7Subscriptions must include payMethodTypeSDK error A0003
8productName is only ONE_TIME_PAYMENT / SUBSCRIPTIONInvalid product type
9Use isSuccess() to check responsesMissing error handling
10Webhook must verify the signature + sign the responseSecurity vulnerability
11Java uses WaffoConfig.builder()SDK initialization failure
12Timestamps are auto-injected by the SDKIncorrect manual timestamp format
13merchantId is auto-injected by the SDKDuplicate setting

Generated code features

  • Error handling: distinguishes between WaffoUnknownStatusError (may have succeeded) and WaffoError (client error)
  • Security: Webhook signature verification + response signing, credential management via environment variables
  • Best practices: idempotent request IDs, service-layer separation, register Webhook before parsing JSON
  • Testing: sandbox integration test stubs, test card numbers
For detailed documentation, see waffo-integrate GitHub.