payzap
v1.0.0
Published
Accept crypto payments in your app. One line of code. Multi-chain. Non-custodial.
Downloads
11
Maintainers
Readme
PayZap
Accept crypto payments in your app. One line of code.
PayZap is the simplest way to accept stablecoin payments (USDT, USDC, DAI) across EVM chains, TON, Tron, and Solana. Non-custodial — payments go directly to your wallet.
npm install payzapQuick Start
Option A: Widget (1 line of HTML)
<script src="https://payzap.cc/v1.js" data-product="YOUR_PRODUCT_ID"></script>That's it. A "Pay with Crypto" button appears. Users pick a chain, scan/copy the address, and pay.
Option B: SDK (Node.js / TypeScript)
import { PayZap } from 'payzap';
const payzap = new PayZap('sp_YOUR_API_KEY');
const session = await payzap.createSession({
productId: 'YOUR_PRODUCT_ID',
chain: 'evm',
asset: 'USDT',
});
// Redirect to hosted payment page
console.log(session.paymentUrl);
// → https://payzap.cc/pay/SESSION_ID
// Or poll for real-time status
session
.on('completed', (data) => console.log('Paid!', data.txHash))
.poll();Option C: Just a link
Send users to https://payzap.cc/pay/SESSION_ID — they'll see a payment page.
Features
- Multi-chain — Ethereum, BSC, Polygon, Arbitrum, Base, TON, Tron, Solana
- Multi-stablecoin — USDT, USDC, DAI, BUSD
- Non-custodial — payments go directly to your wallet
- Zero dependencies — uses native
fetch, no bloat - TypeScript-first — full type definitions included
- Real-time polling — event-based status updates
- Webhook notifications — with HMAC-SHA256 verification helper
- AI-ready — Claude Code skill included
Works with Claude Code
Install the skill for AI-assisted integration:
# In your project, Claude Code will auto-detect the skill
# Or manually: copy skill/SKILL.md to .claude/skills/payzap/SKILL.mdThen just ask Claude: "Add crypto payments to my app" — it knows exactly what to do.
Webhook Verification
import { verifyWebhookSignature } from 'payzap';
app.post('/webhooks/payzap', (req, res) => {
const isValid = verifyWebhookSignature(
JSON.stringify(req.body),
req.headers['x-payzap-signature'],
process.env.PAYZAP_WEBHOOK_SECRET!,
);
if (!isValid) return res.status(401).send('Invalid signature');
if (req.body.event === 'payment.completed') {
// Fulfill the order
}
res.status(200).send('ok');
});API Reference
new PayZap(apiKey) / new PayZap({ apiKey, baseUrl? })
Create a client instance.
payzap.createSession(options)
Create a payment session. Returns a PaymentSession.
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| productId | string | ✅ | Your product ID from the dashboard |
| chain | 'evm' \| 'ton' \| 'tron' \| 'solana' | ✅ | Blockchain family |
| asset | 'USDT' \| 'USDC' \| 'DAI' \| 'BUSD' | — | Default: 'USDT' |
| customerRef | string | — | Your internal user/order reference |
| metadata | object | — | Passed back in webhooks |
session.paymentUrl
Hosted payment page URL. Redirect the user here.
session.poll(intervalMs?)
Start polling for status updates (default: 3s). Auto-stops on terminal state.
session.on(event, callback)
Listen for events: 'confirming', 'completed', 'failed', 'expired'
session.check()
Check status once without polling.
verifyWebhookSignature(body, signature, secret)
Verify incoming webhook signatures. Returns boolean.
Environment Variables
PAYZAP_API_KEY=sp_... # Dashboard → Settings → API Keys
PAYZAP_WEBHOOK_SECRET=whsec_... # Dashboard → WebhooksExamples
examples/widget.html— Standalone HTML with payment widgetexamples/nextjs/— Next.js App Router with checkout & webhooksexamples/express/— Express webhook handler
Dashboard
Create products, manage wallets, view payments, and get API keys at:
https://payzap.cc/dashboard
License
MIT — Moon One LLC
