“AI” on this page means using AI coding tools to complete SDK integration. If you want to accept stablecoin payments from AI Agents, see x402 stablecoin acquiring.
Integration roadmap
1
Prepare your project
Open your project in Codex, 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
Installation
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, pyproject.toml / requirements.txt / Pipfile / uv.lock / setup.py → Python.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)
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 Step 6 phased acceptance tests covering payments, refunds, and subscriptions. Includes HTTP endpoint tests + Playwright automated checkout operations + database state checks.
32 built-in code generation rules
The Skill’s built-in rules automatically prevent common mistakes. The complete list lives inreferences/code-generation-rules.md:
Generated code features
- Error handling: distinguishes between
WaffoUnknownStatusError(may have succeeded) andWaffoError(client error) - Security: Webhook signature verification and 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