Package Exports
- @fiddupay/fiddupay-node
- @fiddupay/fiddupay-node/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@fiddupay/fiddupay-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
FidduPay Node.js SDK
Official Node.js SDK for the FidduPay cryptocurrency payment gateway platform.
🚀 Quick Start
Installation
npm install fiddupay-nodeBasic Usage
import { FidduPay } from 'fiddupay-node';
const fiddupay = new FidduPay({
apiKey: 'your-api-key',
environment: 'sandbox' // or 'production'
});
// Create a payment
const payment = await fiddupay.payments.create({
amount: 100.50,
currency: 'USDT',
network: 'ethereum',
description: 'Order #12345'
});
console.log('Payment created:', payment.id);📚 Features
- 💳 Payment Processing: Create, retrieve, list, and cancel payments
- 🔔 Webhook Verification: Secure HMAC-SHA256 signature validation
- 🏪 Merchant Management: Profile, balance, and wallet configuration
- 💰 Refund Operations: Create and track refunds
- 📊 Analytics: Data retrieval and export
- 🔒 Security: Input validation, rate limiting, retry logic
- 📝 TypeScript: Full type definitions included
🔧 Configuration
const fiddupay = new FidduPay({
apiKey: 'your-api-key',
environment: 'sandbox', // 'sandbox' or 'production'
timeout: 30000, // Request timeout in milliseconds
retries: 3, // Number of retry attempts
baseURL: 'https://api.fiddupay.com' // Custom API base URL
});💳 Payment Operations
Create Payment
const payment = await fiddupay.payments.create({
amount: 100.50,
currency: 'USDT',
network: 'ethereum',
description: 'Order #12345',
metadata: {
orderId: '12345',
customerId: 'cust_123'
}
});Retrieve Payment
const payment = await fiddupay.payments.retrieve('pay_123');List Payments
const payments = await fiddupay.payments.list({
limit: 10,
status: 'completed'
});🔔 Webhook Handling
import express from 'express';
const app = express();
app.post('/webhooks/fiddupay', express.raw({type: 'application/json'}), (req, res) => {
const signature = req.headers['fiddupay-signature'] as string;
try {
const event = fiddupay.webhooks.constructEvent(
req.body,
signature,
'your-webhook-secret'
);
switch (event.type) {
case 'payment.completed':
console.log('Payment completed:', event.data);
break;
case 'payment.failed':
console.log('Payment failed:', event.data);
break;
}
res.status(200).send('OK');
} catch (error) {
console.error('Webhook error:', error);
res.status(400).send('Invalid signature');
}
});🏪 Merchant Operations
// Get merchant profile
const profile = await fiddupay.merchants.getProfile();
// Get account balance
const balance = await fiddupay.merchants.getBalance();
// Configure wallet
await fiddupay.merchants.configureWallet({
currency: 'USDT',
network: 'ethereum',
address: '0x742d35Cc6634C0532925a3b8D4C9db96590c6C87'
});💰 Refund Operations
// Create refund
const refund = await fiddupay.refunds.create({
paymentId: 'pay_123',
amount: 50.25,
reason: 'customer_request'
});
// List refunds
const refunds = await fiddupay.refunds.list({
paymentId: 'pay_123'
});📊 Analytics
// Get analytics data
const analytics = await fiddupay.analytics.getData({
startDate: '2026-01-01',
endDate: '2026-01-31',
metrics: ['revenue', 'transaction_count']
});
// Export data
const exportData = await fiddupay.analytics.exportData({
format: 'csv',
startDate: '2026-01-01',
endDate: '2026-01-31'
});🚨 Error Handling
import {
FidduPayError,
APIError,
AuthenticationError,
ValidationError,
RateLimitError
} from 'fiddupay-node';
try {
const payment = await fiddupay.payments.create({
amount: 100,
currency: 'USDT'
});
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid API key');
} else if (error instanceof ValidationError) {
console.error('Invalid parameters:', error.details);
} else if (error instanceof RateLimitError) {
console.error('Rate limit exceeded, retry after:', error.retryAfter);
} else if (error instanceof APIError) {
console.error('API error:', error.message);
}
}🔒 Security
- API Key Security: Never expose API keys in client-side code
- Webhook Verification: Always verify webhook signatures
- HTTPS Only: All API calls use HTTPS encryption
- Input Validation: All inputs are validated and sanitized
🌍 Supported Cryptocurrencies
5 Major Blockchain Networks:
- Solana - SOL + USDT (SPL)
- Ethereum - ETH + USDT (ERC-20)
- Binance Smart Chain - BNB + USDT (BEP-20)
- Polygon - MATIC + USDT
- Arbitrum - ARB + USDT
Total: 10 cryptocurrency options across 5 blockchains
📖 API Reference
For complete API documentation, visit: https://docs.fiddupay.com
🤝 Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🆘 Support
- Documentation: https://docs.fiddupay.com
- Issues: GitHub Issues
- Email: support@fiddupay.com
Made with ❤️ by the FidduPay Team