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.

Choose an integration path

Choose one path before you start. Both paths end with sandbox testing and submitting acceptance materials to the Waffo technical support group.

API integration

Use this path if you already have your own checkout, need full server-side control, or want to integrate manually with the API Reference.
1

Choose the payment product

Use one-time payment for single-charge orders, or subscription payment for recurring billing.
2

Integrate the required APIs

Follow the API direct roadmap and implement the required APIs.
3

Check API Reference details

Use API Reference for fields, requests, responses, and signing details.
4

Complete extra payment setup

If you need Apple Pay or Google Pay, complete the extra testing and configuration in Sandbox and testing.
5

Submit acceptance results

Finish sandbox testing, download and fill in the acceptance case template, then submit the results to the Waffo technical support group.

AI integration tool

Use this path if you want an AI coding tool to generate SDK integration code, tests, and a test report.
1

Install waffo-integrate

Run npx @waffo/waffo-integrate.
2

Trigger the integration

Trigger Waffo integration in Claude Code or Cursor.
3

Answer business questions

Answer the AI’s business questions, such as product type, refund, subscription, and whether Webhook integration is required.
4

Review code and test report

The AI generates code, runs integration tests, and outputs a test report.
5

Submit the test report

Submit the test report to the Waffo technical support group for confirmation.
waffo-integrate is Waffo’s official AI integration Skill. It uses an interactive wizard to automatically generate production-ready code — 33% faster than manual integration, with a 100% success rate.

Installation

npx @waffo/waffo-integrate

Usage

After installation, trigger it in your AI assistant:
  • Type integrate waffo
  • The Skill will guide you through: selecting a feature (payment / refund / subscription / Webhook) → detecting your language → generating code → running validation tests

Supported languages and features

LanguageSDKFrameworks
Node.js@waffo/waffo-nodeExpress, NestJS, Fastify
Javacom.waffo:waffo-javaSpring Boot
Gogithub.com/waffo-com/waffo-goGin, Echo, Fiber, Chi
All features can be integrated automatically via the Skill: payments, refunds, subscriptions (including upgrades and downgrades), Webhooks, merchant config queries, and payment method queries.

Advantages

MetricUsing the SkillManual integration
Pass rate100% (16/16 assertions)75% (12/16)
Integration time~128 seconds~192 seconds
13 built-in API rulesAuto error prevention (field names, enum values, required fields)Must consult docs manually
For full documentation, see waffo-integrate on GitHub.

Manual integration

If you prefer not to use an AI tool, follow these steps to integrate manually.

Prerequisites

1

Install the SDK

npm install @waffo/waffo-node
2

Initialize the client

import { Waffo, Environment } from '@waffo/waffo-node';

const waffo = new Waffo({
  apiKey: process.env.WAFFO_API_KEY,
  privateKey: process.env.WAFFO_PRIVATE_KEY,
  waffoPublicKey: process.env.WAFFO_PUBLIC_KEY,
  merchantId: process.env.WAFFO_MERCHANT_ID,
  environment: Environment.SANDBOX,
});
3

Create a payment

import { randomUUID } from 'crypto';

const paymentRequestId = randomUUID().replace(/-/g, '');

const response = await waffo.order().create({
  paymentRequestId,
  merchantOrderId: `ORDER_${Date.now()}`,
  orderCurrency: 'HKD',
  orderAmount: '100.00',
  orderDescription: 'Test Payment',
  notifyUrl: 'https://your-site.com/webhook/waffo',
  userInfo: {
    userId: 'user_123',
    userEmail: 'user@example.com',
    userTerminal: 'WEB',
  },
  paymentInfo: { productName: 'ONE_TIME_PAYMENT' },
  goodsInfo: { goodsUrl: 'https://your-site.com/product/001' },
});

if (response.isSuccess()) {
  const data = response.getData();
  // Redirect the user to the Waffo checkout page
  redirect(data.orderAction);
}
4

Handle the Webhook callback

See the Webhook section.

Next steps