{"id":34827329,"url":"https://github.com/profullstack/coinpayportal","last_synced_at":"2025-12-25T15:20:26.612Z","repository":{"id":326893942,"uuid":"1104634812","full_name":"profullstack/coinpayportal","owner":"profullstack","description":"A non-custodial payment gateway for crypto e-commerce payments","archived":false,"fork":false,"pushed_at":"2025-12-20T05:44:32.000Z","size":1224,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-22T13:26:44.443Z","etag":null,"topics":["api","blockchain","cryptocurrency","payments","webhooks"],"latest_commit_sha":null,"homepage":"https://coinpayportal.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/profullstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T13:29:53.000Z","updated_at":"2025-12-20T05:44:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/profullstack/coinpayportal","commit_stats":null,"previous_names":["profullstack/coinpayportal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/profullstack/coinpayportal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fcoinpayportal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fcoinpayportal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fcoinpayportal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fcoinpayportal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profullstack","download_url":"https://codeload.github.com/profullstack/coinpayportal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Fcoinpayportal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28031591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blockchain","cryptocurrency","payments","webhooks"],"created_at":"2025-12-25T15:20:25.471Z","updated_at":"2025-12-25T15:20:26.602Z","avatar_url":"https://github.com/profullstack.png","language":"TypeScript","readme":"# CoinPay 🚀\n\nA non-custodial cryptocurrency payment gateway for e-commerce that enables merchants to accept crypto payments with automatic fee handling and real-time transaction monitoring.\n\n## 🌟 Features\n\n### Core Payment Features\n- **Multi-Chain Support**: Bitcoin, Bitcoin Cash, Ethereum, Polygon, Solana, and USDC across major blockchains\n- **Non-Custodial**: Merchants maintain full control of their funds\n- **Real-Time Processing**: Instant payment detection and forwarding (no batching)\n- **Automatic Fee Handling**: 0.5% platform fee automatically deducted during forwarding\n- **Multi-Business Support**: Manage multiple businesses under one merchant account\n- **Wallet Integration**: Connect MetaMask, WalletConnect, or Phantom wallet\n- **QR Code Payments**: Easy-to-integrate payment QR codes\n- **Webhook Notifications**: Real-time payment callbacks for your system\n- **CLI \u0026 SDK**: Command-line interface and ESM module for programmatic integration\n- **Exchange Rates**: Real-time crypto/fiat rates via Tatum API\n\n### Subscription Plans \u0026 Entitlements\n- **Starter Plan (Free)**: Up to 100 transactions/month, all supported chains, basic API access, email support\n- **Professional Plan ($49/month)**: Unlimited transactions, priority support, advanced analytics, custom webhooks, white-label option\n- **Crypto Payments for Subscriptions**: Pay for upgrades using BTC, BCH, ETH, POL, or SOL\n- **Usage Tracking**: Real-time transaction counting with automatic limit enforcement\n- **Feature Gating**: API-level enforcement of plan-specific features\n\n### Business Collection\n- **Platform Payments**: Collect subscription fees and service charges from businesses\n- **100% Forwarding**: Business collection payments forward entirely to platform wallets\n- **Multiple Blockchains**: Support for BTC, BCH, ETH, POL, SOL\n\n## 🏗️ Architecture\n\nCoinPay uses a modern, scalable architecture:\n\n- **Frontend**: Next.js 14+ with TypeScript and TailwindCSS\n- **Backend**: Next.js API Routes (serverless)\n- **Database**: Supabase (PostgreSQL)\n- **Blockchain**: Self-hosted wallet generation with RPC provider monitoring\n- **Testing**: Vitest for unit and integration tests\n\nSee [Architecture Documentation](./docs/ARCHITECTURE.md) for detailed system design.\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+ and npm/yarn/pnpm\n- Supabase account (free tier available)\n- RPC provider accounts (Alchemy, Infura, or public nodes)\n- Tatum API key (for exchange rates)\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/coinpayportal.git\ncd coinpayportal\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Copy environment variables:\n```bash\ncp .env.example .env.local\n```\n\n4. Configure your `.env.local` file with required credentials:\n```env\n# Supabase\nNEXT_PUBLIC_SUPABASE_URL=your_supabase_url\nNEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key\nSUPABASE_SERVICE_ROLE_KEY=your_service_role_key\n\n# Encryption\nENCRYPTION_KEY=your_32_byte_encryption_key\n\n# RPC Providers\nBITCOIN_RPC_URL=https://your-bitcoin-rpc\nETHEREUM_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY\nPOLYGON_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY\nSOLANA_RPC_URL=https://api.mainnet-beta.solana.com\n\n# Platform Fee Wallets\nPLATFORM_FEE_WALLET_BTC=your_btc_address\nPLATFORM_FEE_WALLET_ETH=your_eth_address\nPLATFORM_FEE_WALLET_POL=your_pol_address\nPLATFORM_FEE_WALLET_SOL=your_sol_address\n\n# Tatum API\nTATUM_API_KEY=your_tatum_api_key\n\n# Webhook\nWEBHOOK_SIGNING_SECRET=your_webhook_secret\n```\n\n5. Set up the database:\n```bash\nnpm run db:setup\n```\n\n6. Run the development server:\n```bash\nnpm run dev\n```\n\n7. Open [http://localhost:3000](http://localhost:3000) in your browser.\n\n## 📖 Documentation\n\n- [Architecture Overview](./docs/ARCHITECTURE.md)\n- [API Documentation](./docs/API.md)\n- [Database Schema](./docs/DATABASE.md)\n- [Subscriptions \u0026 Entitlements](./docs/SUBSCRIPTIONS.md)\n- [Business Collection](./docs/BUSINESS_COLLECTION.md)\n- [Security Best Practices](./docs/SECURITY.md)\n\n## 💻 Usage Examples\n\n### Creating a Payment Request (API)\n\n```typescript\nconst response = await fetch('/api/payments/create', {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Authorization': `Bearer ${token}`\n  },\n  body: JSON.stringify({\n    businessId: 'your-business-id',\n    amount: 100.00,\n    currency: 'USD',\n    blockchain: 'eth',\n    merchantWalletAddress: '0x...',\n    metadata: {\n      orderId: 'ORDER-123',\n      customerEmail: 'customer@example.com'\n    }\n  })\n});\n\nconst payment = await response.json();\n// Returns: { id, address, qrCode, amount, expiresAt }\n```\n\n### Using the CLI\n\n```bash\n# Create a payment\ncoinpay payment create \\\n  --business-id abc123 \\\n  --amount 100 \\\n  --currency USD \\\n  --blockchain eth \\\n  --wallet 0x...\n\n# Check payment status\ncoinpay payment status --id payment_xyz\n\n# List businesses\ncoinpay business list\n\n# Configure webhook\ncoinpay webhook set --url https://yoursite.com/webhook\n```\n\n### Using the SDK\n\n```typescript\nimport { CoinPay } from '@coinpayportal/sdk';\n\nconst client = new CoinPay({\n  apiKey: 'your-api-key',\n  environment: 'production'\n});\n\n// Create payment\nconst payment = await client.payments.create({\n  businessId: 'your-business-id',\n  amount: 100,\n  currency: 'USD',\n  blockchain: 'eth',\n  merchantWalletAddress: '0x...'\n});\n\n// Monitor payment\nclient.payments.on('confirmed', (payment) =\u003e {\n  console.log('Payment confirmed:', payment.id);\n});\n```\n\n### Embedding Payment QR Code\n\n```html\n\u003c!-- Simple integration --\u003e\n\u003cdiv id=\"coinpay-widget\"\n     data-business-id=\"your-business-id\"\n     data-amount=\"100\"\n     data-currency=\"USD\"\n     data-blockchain=\"eth\"\u003e\n\u003c/div\u003e\n\u003cscript src=\"https://coinpayportal.com/widget.js\"\u003e\u003c/script\u003e\n```\n\n## 🔐 Security\n\n- Private keys are encrypted at rest using AES-256\n- All API routes require authentication\n- Rate limiting on all endpoints\n- Webhook signatures for verification\n- Multi-confirmation requirements before forwarding\n- See [Security Documentation](./docs/SECURITY.md) for details\n\n## 🧪 Testing\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Run tests with coverage\nnpm run test:coverage\n\n# Run E2E tests\nnpm run test:e2e\n```\n\n## 📦 Project Structure\n\n```\ncoinpayportal/\n├── docs/                    # Documentation\n│   ├── ARCHITECTURE.md\n│   ├── API.md\n│   ├── DATABASE.md\n│   ├── SUBSCRIPTIONS.md    # Subscription plans \u0026 entitlements\n│   ├── BUSINESS_COLLECTION.md\n│   └── SECURITY.md\n├── src/\n│   ├── app/                # Next.js app directory\n│   │   ├── api/           # API routes\n│   │   │   ├── auth/      # Authentication endpoints\n│   │   │   ├── payments/  # Payment endpoints\n│   │   │   ├── businesses/ # Business management\n│   │   │   ├── business-collection/ # Platform payments\n│   │   │   ├── subscriptions/ # Subscription management\n│   │   │   └── entitlements/ # Entitlements API\n│   │   ├── dashboard/     # Merchant dashboard\n│   │   ├── pricing/       # Pricing \u0026 upgrade page\n│   │   ├── docs/          # API documentation page\n│   │   └── page.tsx       # Landing page\n│   ├── components/        # React components\n│   │   ├── business/      # Business management components\n│   │   └── docs/          # Documentation components\n│   ├── lib/              # Utility libraries\n│   │   ├── auth/         # Authentication services\n│   │   ├── blockchain/   # Blockchain services\n│   │   ├── business/     # Business services\n│   │   ├── entitlements/ # Entitlements \u0026 usage tracking\n│   │   ├── payments/     # Payment processing\n│   │   ├── subscriptions/ # Subscription management\n│   │   ├── supabase/     # Supabase client\n│   │   └── crypto/       # Encryption utilities\n│   └── types/            # TypeScript types\n├── supabase/\n│   └── migrations/       # Database migrations\n├── cli/                   # CLI package\n├── sdk/                   # SDK package\n└── package.json\n```\n\n## 🛣️ Roadmap\n\n- [x] Core payment processing\n- [x] Multi-chain support (BTC, BCH, ETH, POL, SOL, USDC)\n- [x] Merchant dashboard\n- [x] Webhook system\n- [x] Subscription plans (Starter/Professional)\n- [x] Entitlements \u0026 usage tracking\n- [x] Business collection payments\n- [x] Crypto-based subscription payments\n- [ ] Mobile SDK\n- [ ] WooCommerce plugin\n- [ ] Shopify app\n- [ ] Recurring payments (auto-renewal)\n- [ ] Fiat off-ramp\n- [ ] Advanced analytics dashboard\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n## 🆘 Support\n\n- Documentation: [coinpayportal.com/docs](https://coinpayportal.com/docs)\n- Email: support@coinpayportal.com\n- Discord: [Join our community](https://discord.gg/w5nHdzpQ29)\n- GitHub Issues: [Report a bug](https://github.com/profullstack/coinpayportal/issues)\n\n## 🙏 Acknowledgments\n\n- [Next.js](https://nextjs.org/) - React framework\n- [Supabase](https://supabase.com/) - Backend as a service\n- [Tatum](https://tatum.io/) - Blockchain API and exchange rates\n- [Alchemy](https://www.alchemy.com/) - Blockchain infrastructure\n- [WalletConnect](https://walletconnect.com/) - Wallet connection protocol\n\n---\n\nBuilt with ❤️ by the CoinPay team","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Fcoinpayportal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofullstack%2Fcoinpayportal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Fcoinpayportal/lists"}