Accept payments with Paddle as merchant of record. Use when a user asks to add subscription billing without handling tax compliance, accept international payments, implement a payment system where Paddle handles VAT/sales tax, or build a SaaS billing system.
Paddle is a merchant of record — it handles payments, tax compliance (VAT, sales tax), invoicing, and fraud protection. Unlike Stripe, you don't need to register for tax in every country. Paddle sells on your behalf and remits taxes globally.
// components/Checkout.tsx — Paddle.js overlay checkout
declare global { interface Window { Paddle: any } }
export function PricingButton({ priceId }: { priceId: string }) {
const handleCheckout = () => {
window.Paddle.Checkout.open({
items: [{ priceId, quantity: 1 }],
customer: { email: 'user@example.com' },
customData: { userId: 'usr_123' },
})
}
return <button onClick={handleCheckout}>Subscribe</button>
}
// Add to layout:
// <script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
// Paddle.Initialize({ token: 'live_xxx' })
// api/paddle/webhook.ts — Process Paddle events
import { Paddle } from '@paddle/paddle-node-sdk'
const paddle = new Paddle(process.env.PADDLE_API_KEY!)
export async function POST(req: Request) {
const body = await req.text()
const signature = req.headers.get('paddle-signature')!
const event = paddle.webhooks.unmarshal(body, process.env.PADDLE_WEBHOOK_SECRET!, signature)
switch (event.eventType) {
case 'subscription.created':
await db.user.update({
where: { paddleCustomerId: event.data.customerId },
data: { plan: 'pro', subscriptionId: event.data.id },
})
break
case 'subscription.canceled':
await db.user.update({
where: { subscriptionId: event.data.id },
data: { plan: 'free', canceledAt: new Date() },
})
break
case 'transaction.completed':
// Payment received — update invoice records
break
}
return new Response('OK')
}
// lib/paddle.ts — Manage subscriptions server-side
import { Paddle } from '@paddle/paddle-node-sdk'
const paddle = new Paddle(process.env.PADDLE_API_KEY!)
// Create a customer
const customer = await paddle.customers.create({
email: 'user@example.com',
name: 'John Doe',
})
// List subscriptions
const subscriptions = await paddle.subscriptions.list({
customerId: [customer.id],
})
// Cancel subscription
await paddle.subscriptions.cancel(subscriptionId, {
effectiveFrom: 'next_billing_period',
})
npx skills add TerminalSkills/paddle下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer