vibecash 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +788 -832
- package/package.json +12 -27
- package/README.md +0 -191
package/package.json
CHANGED
|
@@ -1,45 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibecash",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "VibeCash - Payment infrastructure for AI
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "VibeCash CLI - Payment infrastructure for the AI era. Accept cards, e-wallets, and QR payments in Southeast Asia.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
|
|
8
|
-
},
|
|
6
|
+
"bin": { "vibecash": "./dist/index.js" },
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"scripts": { "build": "tsup", "dev": "tsx src/index.ts" },
|
|
9
9
|
"keywords": [
|
|
10
|
-
"payment",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"subscription",
|
|
14
|
-
"billing",
|
|
15
|
-
"vibecash",
|
|
16
|
-
"ai-guardian"
|
|
10
|
+
"payment", "cli", "checkout", "subscription", "billing",
|
|
11
|
+
"vibecash", "ai-native", "southeast-asia", "singapore",
|
|
12
|
+
"wechat-pay", "alipay", "paynow"
|
|
17
13
|
],
|
|
14
|
+
"author": "VibeCash",
|
|
18
15
|
"license": "MIT",
|
|
16
|
+
"homepage": "https://vibecash.dev",
|
|
19
17
|
"repository": {
|
|
20
18
|
"type": "git",
|
|
21
19
|
"url": "https://github.com/vibecash/vibecash-cli"
|
|
22
20
|
},
|
|
23
|
-
"engines": {
|
|
24
|
-
"node": ">=20.0.0"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"dist",
|
|
28
|
-
"README.md"
|
|
29
|
-
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsup",
|
|
32
|
-
"dev": "tsup --watch",
|
|
33
|
-
"start": "tsx src/index.ts",
|
|
34
|
-
"prepublishOnly": "pnpm build",
|
|
35
|
-
"pack": "pnpm build && npm pack"
|
|
36
|
-
},
|
|
37
21
|
"dependencies": {
|
|
38
22
|
"commander": "^12.0.0"
|
|
39
23
|
},
|
|
40
24
|
"devDependencies": {
|
|
25
|
+
"@vibecash/shared": "workspace:*",
|
|
41
26
|
"tsup": "^8.0.0",
|
|
42
27
|
"tsx": "^4.7.0",
|
|
43
|
-
"typescript": "^5.
|
|
28
|
+
"typescript": "^5.5.0"
|
|
44
29
|
}
|
|
45
30
|
}
|
package/README.md
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
# vibecash
|
|
2
|
-
|
|
3
|
-
VibeCash - Payment infrastructure for AI agents.
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm install -g vibecash
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## TL;DR - Accept Payments in 30 Seconds
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# 1. Create wallet (one-time setup)
|
|
13
|
-
vibecash wallet create
|
|
14
|
-
# Saves credentials to ~/.vibecash/config.json
|
|
15
|
-
|
|
16
|
-
# 2. Create a payment link
|
|
17
|
-
vibecash link create 9.99 --name "My Product"
|
|
18
|
-
# Returns: { "url": "https://pay.vibecash.dev/p/plink_xxx", ... }
|
|
19
|
-
|
|
20
|
-
# 3. Send URL to customer, they pay, done!
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Quick Reference
|
|
26
|
-
|
|
27
|
-
### Payment Links (Recommended)
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
vibecash link create <amount> # Create reusable payment URL
|
|
31
|
-
vibecash link create 19.99 --name "Pro" --currency USD
|
|
32
|
-
vibecash link create 9.99 --success-url "https://myapp.com/thanks#session_id={CHECKOUT_SESSION_ID}"
|
|
33
|
-
vibecash link list # List all links
|
|
34
|
-
vibecash link get <id> # Get link details
|
|
35
|
-
vibecash link deactivate <id> # Disable a link
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Verify Payment
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
vibecash checkout get <session_id>
|
|
42
|
-
# Response: { "session": { "status": "complete", ... } }
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Wallet
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
vibecash wallet create # Create new wallet, get API key
|
|
49
|
-
vibecash wallet info # Show balance
|
|
50
|
-
vibecash wallet claim # Get dashboard access link
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### One-Time Checkout
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
vibecash create 25.00 -d "Consulting" # Quick one-time payment
|
|
57
|
-
vibecash checkout create --amount 50 --success-url URL # With redirect
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Subscriptions
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
vibecash create 9.99 --monthly -d "Pro Plan" # Monthly subscription
|
|
64
|
-
vibecash create 99 --yearly -d "Annual" --trial-days 14 # Yearly with trial
|
|
65
|
-
vibecash subscription list # List all
|
|
66
|
-
vibecash subscription cancel <id> # Cancel
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Products & Prices
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
vibecash product create "Plan Name" # Create product
|
|
73
|
-
vibecash price create <prod_id> 29.99 --type recurring --interval month
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Customers
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
vibecash customer create --email user@example.com
|
|
80
|
-
vibecash customer list
|
|
81
|
-
vibecash customer portal <id> # Self-service portal URL
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Environment Variables
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
VIBECASH_SECRET=sk_live_xxx # API key (or use ~/.vibecash/config.json)
|
|
90
|
-
VIBECASH_API_URL=https://api.vibecash.dev # Default API endpoint
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## Output Format
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
vibecash --json <command> # JSON (default, best for AI/scripts)
|
|
99
|
-
vibecash --human <command> # Human-readable tables
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Integration Example: Static Website Paywall
|
|
105
|
-
|
|
106
|
-
### Step 1: Create Payment Link with Redirect
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
vibecash link create 4.99 \
|
|
110
|
-
--name "Premium Access" \
|
|
111
|
-
--success-url "https://yoursite.com/unlock#session_id={CHECKOUT_SESSION_ID}"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Step 2: Verify Payment in JavaScript
|
|
115
|
-
|
|
116
|
-
```javascript
|
|
117
|
-
// After payment, user lands on: https://yoursite.com/unlock#session_id=cs_xxx
|
|
118
|
-
const sessionId = new URLSearchParams(location.hash.slice(1)).get('session_id');
|
|
119
|
-
|
|
120
|
-
if (sessionId) {
|
|
121
|
-
const res = await fetch(`https://api.vibecash.dev/v1/checkout/sessions/${sessionId}`);
|
|
122
|
-
const { session } = await res.json();
|
|
123
|
-
|
|
124
|
-
if (session.status === 'complete') {
|
|
125
|
-
localStorage.setItem('paid', 'true');
|
|
126
|
-
// Unlock content
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## API Endpoints
|
|
134
|
-
|
|
135
|
-
| Action | CLI Command | API Endpoint |
|
|
136
|
-
|--------|-------------|--------------|
|
|
137
|
-
| Create wallet | `wallet create` | `POST /v1/wallets` |
|
|
138
|
-
| Get wallet | `wallet info` | `GET /v1/wallets/current` |
|
|
139
|
-
| Create payment link | `link create` | `POST /v1/payment_links` |
|
|
140
|
-
| List payment links | `link list` | `GET /v1/payment_links` |
|
|
141
|
-
| Get checkout session | `checkout get` | `GET /v1/checkout/sessions/:id` |
|
|
142
|
-
| Create checkout | `checkout create` | `POST /v1/checkout/sessions` |
|
|
143
|
-
| List products | `product list` | `GET /v1/products` |
|
|
144
|
-
| List subscriptions | `subscription list` | `GET /v1/subscriptions` |
|
|
145
|
-
|
|
146
|
-
API Base URL: `https://api.vibecash.dev`
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Supported Payment Methods
|
|
151
|
-
|
|
152
|
-
| Method | One-time | Subscription |
|
|
153
|
-
|--------|----------|--------------|
|
|
154
|
-
| Credit/Debit Card | ✅ | ✅ |
|
|
155
|
-
| WeChat Pay | ✅ | ❌ |
|
|
156
|
-
| Alipay | ✅ | ❌ |
|
|
157
|
-
| PayNow (SGD only) | ✅ | ❌ |
|
|
158
|
-
|
|
159
|
-
## Supported Currencies
|
|
160
|
-
|
|
161
|
-
USD, EUR, GBP, CAD, AUD, SGD, CNY, JPY, HKD
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Common Patterns
|
|
166
|
-
|
|
167
|
-
### Create Subscription Product
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
vibecash product create "Pro Plan"
|
|
171
|
-
# Output: { "id": "prod_xxx", ... }
|
|
172
|
-
|
|
173
|
-
vibecash price create prod_xxx 19.99 --type recurring --interval month
|
|
174
|
-
# Output: { "id": "price_xxx", ... }
|
|
175
|
-
|
|
176
|
-
vibecash checkout create --price price_xxx --mode subscription
|
|
177
|
-
# Output: { "url": "https://pay.vibecash.dev/checkout/cs_xxx", ... }
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Poll for Payment Completion
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
vibecash checkout get cs_xxx --wait --timeout 60000
|
|
184
|
-
# Waits up to 60 seconds for payment to complete
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## License
|
|
190
|
-
|
|
191
|
-
MIT
|