|
1 | | -<div align="center"> |
2 | | -<img src="https://images.blackroad.io/pixel-art/road-logo.png" alt="BlackRoad OS" width="80" /> |
3 | | - |
4 | 1 | # RoadPay |
5 | 2 |
|
6 | | -**Own your billing. D1 subscriptions, plans, invoices. Stripe is the card charger — you are the bank.** |
7 | | - |
8 | | -[](https://blackroad.io) |
9 | | -[](./LICENSE) |
10 | | -</div> |
| 3 | +Billing and subscription management. Stripe handles the cards. Your data stays in your database. |
11 | 4 |
|
12 | | ---- |
| 5 | +**Live at [pay.blackroad.io](https://pay.blackroad.io)** |
13 | 6 |
|
14 | | -## Architecture |
15 | | - |
16 | | -``` |
17 | | -User → RoadPay (D1) → Stripe (card processing only) |
18 | | - ↓ |
19 | | - Plans, Invoices, Subscriptions |
20 | | - stored in YOUR database |
21 | | -``` |
| 7 | +## What It Does |
22 | 8 |
|
23 | | -RoadPay is BlackRoad's own billing system. Stripe handles card charging — nothing else. All subscription logic, plan management, invoicing, and metering lives in D1 (Cloudflare's serverless SQL). |
| 9 | +RoadPay manages plans, subscriptions, invoices, and customer records. Stripe is used only for card processing. All billing logic and data live in D1. |
24 | 10 |
|
25 | 11 | ## Plans |
26 | 12 |
|
27 | | -| Plan | Price | Agents | Requests/Day | Support | |
28 | | -|------|-------|--------|-------------|---------| |
29 | | -| Starter | Free | 1 | 100 | Community | |
30 | | -| Pro | $29/mo | 5 | 10K | Priority | |
31 | | -| Team | $99/mo | 25 | 100K | Dedicated | |
32 | | -| Enterprise | Custom | Unlimited | Unlimited | SLA | |
33 | | - |
34 | | -## Add-ons |
35 | | - |
36 | | -| Add-on | Price | Description | |
37 | | -|--------|-------|-------------| |
38 | | -| Extra TOPS | $19/mo | Additional AI compute | |
39 | | -| Custom Models | $49/mo | Fine-tune your own | |
40 | | -| Priority Inference | $9/mo | Skip the queue | |
41 | | -| Dedicated Node | $149/mo | Your own Pi 5 | |
| 13 | +| Plan | Price | For | |
| 14 | +|------|-------|-----| |
| 15 | +| **Starter** | Free | Getting started, 1 agent, 100 req/day | |
| 16 | +| **Pro** | $29/mo | Individuals, 5 agents, 10K req/day | |
| 17 | +| **Team** | $99/mo | Small teams, 25 agents, 100K req/day | |
| 18 | +| **Enterprise** | Custom | Unlimited agents and requests, SLA | |
42 | 19 |
|
43 | 20 | ## API |
44 | 21 |
|
45 | | -```bash |
46 | | -# Create checkout session |
47 | | -curl -X POST https://roadpay.blackroad.io/api/checkout \ |
48 | | - -H "Content-Type: application/json" \ |
49 | | - -d '{"plan": "pro", "billing_cycle": "monthly"}' |
50 | | - |
51 | | -# Check subscription |
52 | | -curl https://roadpay.blackroad.io/api/subscription \ |
53 | | - -H "Authorization: Bearer $TOKEN" |
54 | | -``` |
| 22 | +| Endpoint | Method | Description | |
| 23 | +|----------|--------|-------------| |
| 24 | +| `/api/checkout` | POST | Create a checkout session for a plan | |
| 25 | +| `/api/subscription` | GET | Check current subscription status | |
| 26 | +| `/plans` | GET | List available plans and pricing | |
| 27 | +| `/customers` | GET/POST | Manage customer records | |
| 28 | +| `/invoices` | GET | View invoice history | |
| 29 | +| `/webhook` | POST | Stripe event receiver | |
55 | 30 |
|
56 | 31 | ## Stack |
57 | 32 |
|
58 | | -- **Runtime**: Cloudflare Workers |
59 | | -- **Database**: D1 (SQLite at the edge) |
| 33 | +- **Runtime**: Cloudflare Worker |
| 34 | +- **Database**: D1 (customers, invoices, subscriptions) |
60 | 35 | - **Payments**: Stripe (card processing only) |
61 | | -- **Auth**: JWT via blackroad-auth |
| 36 | +- **Auth**: JWT tokens |
62 | 37 |
|
63 | | -## Development |
| 38 | +## Deploy |
64 | 39 |
|
65 | 40 | ```bash |
66 | 41 | npm install |
67 | | -npm run dev # Wrangler dev server |
68 | | -npm run deploy # Deploy to Cloudflare |
| 42 | +npm run dev # Local dev server |
| 43 | +npm run deploy # Deploy to production |
69 | 44 | ``` |
70 | 45 |
|
| 46 | +Set Stripe keys: |
| 47 | + |
| 48 | +```bash |
| 49 | +wrangler secret put STRIPE_SECRET_KEY |
| 50 | +wrangler secret put STRIPE_WEBHOOK_SECRET |
| 51 | +``` |
| 52 | + |
| 53 | +## How It Works |
| 54 | + |
| 55 | +1. Customer picks a plan and checks out |
| 56 | +2. RoadPay creates the Stripe subscription |
| 57 | +3. Invoice and subscription state is stored locally in D1 |
| 58 | +4. Webhooks keep D1 in sync with Stripe events |
| 59 | +5. All queries (plan changes, invoices, status) hit your database, not Stripe |
| 60 | + |
| 61 | +Your customer records. Your invoice history. Your database. Stripe only touches the card. |
| 62 | + |
| 63 | +## License |
| 64 | + |
| 65 | +Proprietary. Copyright (c) 2024-2026 BlackRoad OS, Inc. All rights reserved. |
| 66 | + |
71 | 67 | --- |
72 | 68 |
|
73 | | -*Copyright (c) 2024-2026 BlackRoad OS, Inc. All rights reserved.* |
| 69 | +*Remember the Road. Pave Tomorrow.* |
0 commit comments