oneie 3.6.5 → 3.6.6
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/.claude/commands/one copy.md +565 -0
- package/.claude/hooks/README-knowledge-hooks.md +265 -0
- package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/.claude/hooks/check-filenames.py +40 -0
- package/.claude/hooks/clean-post.py +301 -0
- package/.claude/hooks/clean-pre.py +308 -0
- package/.claude/hooks/done.py +175 -0
- package/.claude/hooks/format-hook.sh +75 -0
- package/.claude/hooks/hook-logger.sh +59 -0
- package/.claude/hooks/knowledge-post.py +251 -0
- package/.claude/hooks/knowledge-pre.py +150 -0
- package/.claude/hooks/notification-hook.sh +112 -0
- package/.claude/hooks/security-hook.sh +157 -0
- package/.claude/hooks/tag-all-docs.py +338 -0
- package/.claude/hooks/todo.py +298 -0
- package/.claude/hooks/validate-ontology-structure.py +455 -0
- package/.claude/skills/astro/add-content-collection.md +30 -0
- package/.claude/skills/astro/check-build.md +29 -0
- package/.claude/skills/astro/create-component.md +29 -0
- package/.claude/skills/astro/create-page.md +30 -0
- package/.claude/skills/astro/optimize-performance.md +21 -0
- package/.claude/skills/convex/check-deployment.md +46 -0
- package/.claude/skills/convex/create-mutation.md +405 -0
- package/.claude/skills/convex/create-query.md +52 -0
- package/.claude/skills/convex/read-schema.md +373 -0
- package/.claude/skills/convex/test-function.md +50 -0
- package/.claude/skills/deployment/check-deployment-health.md +20 -0
- package/.claude/skills/deployment/create-release.md +21 -0
- package/.claude/skills/deployment/deploy-cloudflare.md +31 -0
- package/.claude/skills/deployment/deploy-convex.md +30 -0
- package/.claude/skills/deployment/sync-repositories.md +19 -0
- package/.claude/skills/design/check-accessibility.md +21 -0
- package/.claude/skills/design/create-component-spec.md +27 -0
- package/.claude/skills/design/generate-design-tokens.md +24 -0
- package/.claude/skills/design/generate-wireframe.md +30 -0
- package/.claude/skills/documentation/create-migration-guide.md +20 -0
- package/.claude/skills/documentation/generate-api-docs.md +27 -0
- package/.claude/skills/documentation/generate-readme.md +22 -0
- package/.claude/skills/documentation/update-knowledge.md +20 -0
- package/.claude/skills/integration/connect-external-system.md +21 -0
- package/.claude/skills/integration/implement-a2a.md +20 -0
- package/.claude/skills/integration/implement-acp.md +20 -0
- package/.claude/skills/integration/verify-integration.md +20 -0
- package/.claude/skills/ontology/README.md +255 -0
- package/.claude/skills/ontology/check-dimension.md +307 -0
- package/.claude/skills/ontology/generate-entity-type.md +339 -0
- package/.claude/skills/ontology/validate-schema.md +229 -0
- package/.claude/skills/ontology/verify-relationships.md +310 -0
- package/.claude/skills/problem-solving/analyze-test-failure.md +21 -0
- package/.claude/skills/problem-solving/identify-root-cause.md +20 -0
- package/.claude/skills/problem-solving/propose-solution.md +29 -0
- package/.claude/skills/problem-solving/verify-fix.md +21 -0
- package/.claude/skills/sales/generate-demo-script.md +21 -0
- package/.claude/skills/sales/qualify-lead.md +30 -0
- package/.claude/skills/sales/track-trial.md +20 -0
- package/.claude/skills/sales/verify-kyc.md +20 -0
- package/.claude/skills/testing/analyze-coverage.md +24 -0
- package/.claude/skills/testing/generate-tests.md +24 -0
- package/.claude/skills/testing/run-tests.md +27 -0
- package/.claude/skills/testing/validate-e2e.md +25 -0
- package/.mcp.json +30 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +3 -2
- package/dist/utils/launch-claude.d.ts.map +1 -1
- package/dist/utils/launch-claude.js +64 -29
- package/dist/utils/launch-claude.js.map +1 -1
- package/one/.obsidian/workspace.json +22 -22
- package/one/events/CREATE-WEBSITE.md +442 -0
- package/one/events/CUSTOM-DOMAIN.md +357 -0
- package/one/events/DEPLOYMENT copy.md +426 -0
- package/one/events/ECOMMERCE-BEFORE-AFTER.md +251 -0
- package/one/events/ECOMMERCE-ENHANCEMENTS.md +576 -0
- package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +421 -0
- package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +196 -0
- package/one/events/ECOMMERCE-SETUP-SUMMARY.md +396 -0
- package/one/events/INSTALLATION_FOLDERS.md +516 -0
- package/one/events/INSTALLATION_FOLDERS_FILES.md +205 -0
- package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +419 -0
- package/one/events/LICENSE.md +89 -0
- package/one/events/MCP-CONFIGURATION.md +336 -0
- package/one/events/MCP-SETUP-COMPLETE.md +205 -0
- package/one/events/NODE-UPGRADE.md +111 -0
- package/one/events/PACKAGE-STRUCTURE.md +310 -0
- package/one/events/PLAYBOOK-SETUP-SUMMARY.md +331 -0
- package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +567 -0
- package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +262 -0
- package/one/events/STRIPE-INTEGRATION.md +414 -0
- package/one/events/STRIPE-SETUP-GUIDE.md +462 -0
- package/one/events/TRANSPARENCY-FIXES.md +275 -0
- package/package.json +4 -2
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
# Stripe Integration Setup Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for setting up Stripe payments in the ONE Platform.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Get Your Stripe API Keys
|
|
8
|
+
|
|
9
|
+
1. Sign up for a Stripe account at https://stripe.com
|
|
10
|
+
2. Navigate to **Developers → API Keys**
|
|
11
|
+
3. Copy your **Publishable key** (starts with `pk_test_` for test mode)
|
|
12
|
+
4. Copy your **Secret key** (starts with `sk_test_` for test mode)
|
|
13
|
+
|
|
14
|
+
### 2. Add Keys to Environment Variables
|
|
15
|
+
|
|
16
|
+
Add to `.env.local`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Stripe Test Keys (for development)
|
|
20
|
+
PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51...
|
|
21
|
+
STRIPE_SECRET_KEY=sk_test_51...
|
|
22
|
+
|
|
23
|
+
# Course price (will be generated)
|
|
24
|
+
STRIPE_COURSE_PRICE_ID=price_...
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 3. Create Products and Prices
|
|
28
|
+
|
|
29
|
+
Run the automated setup script:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bun run stripe:setup
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This will:
|
|
36
|
+
- ✅ Create products in your Stripe account
|
|
37
|
+
- ✅ Generate price IDs for each product
|
|
38
|
+
- ✅ Save configuration to `.stripe-config.json`
|
|
39
|
+
- ✅ Output the environment variables you need
|
|
40
|
+
|
|
41
|
+
### 4. Add Generated Price IDs
|
|
42
|
+
|
|
43
|
+
Copy the output from the setup script and add to `.env.local`:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
STRIPE_COURSE_PRICE_ID=price_0SKcI6qs14Mpveu16vIPzJbH
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 5. Test the Integration
|
|
50
|
+
|
|
51
|
+
Start your dev server:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bun run dev
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Visit: http://localhost:4321/pay-course
|
|
58
|
+
|
|
59
|
+
You should be redirected to Stripe Checkout. Use test cards:
|
|
60
|
+
|
|
61
|
+
- **Success**: `4242 4242 4242 4242`
|
|
62
|
+
- **Decline**: `4000 0000 0000 0002`
|
|
63
|
+
- **3D Secure**: `4000 0025 0000 3155`
|
|
64
|
+
|
|
65
|
+
Use any future expiry date, any 3-digit CVC, and any ZIP code.
|
|
66
|
+
|
|
67
|
+
## Architecture
|
|
68
|
+
|
|
69
|
+
### Overview
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Frontend (Astro) → Stripe Checkout → Success/Cancel Pages
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Key Files:**
|
|
76
|
+
|
|
77
|
+
- `src/pages/pay-course.astro` - Checkout page (creates session)
|
|
78
|
+
- `src/pages/thankyou-course.astro` - Success page
|
|
79
|
+
- `src/lib/stripe.ts` - Stripe utilities
|
|
80
|
+
- `scripts/setup-stripe-products.ts` - Product setup script
|
|
81
|
+
- `.stripe-config.json` - Generated product configuration
|
|
82
|
+
|
|
83
|
+
### Checkout Flow
|
|
84
|
+
|
|
85
|
+
1. **User visits `/pay-course`**
|
|
86
|
+
- Server-side code creates Stripe Checkout Session
|
|
87
|
+
- Uses `STRIPE_COURSE_PRICE_ID` from environment
|
|
88
|
+
- Sets success/cancel URLs
|
|
89
|
+
|
|
90
|
+
2. **User redirected to Stripe**
|
|
91
|
+
- Secure Stripe Checkout UI
|
|
92
|
+
- Handles payment processing
|
|
93
|
+
- Validates card details
|
|
94
|
+
|
|
95
|
+
3. **Payment succeeds**
|
|
96
|
+
- User redirected to `/thankyou-course?session_id={CHECKOUT_SESSION_ID}`
|
|
97
|
+
- Session ID can be used to verify payment
|
|
98
|
+
|
|
99
|
+
4. **Payment fails or cancelled**
|
|
100
|
+
- User redirected to `/stripe` (cancel URL)
|
|
101
|
+
|
|
102
|
+
## Product Configuration
|
|
103
|
+
|
|
104
|
+
### Default Product
|
|
105
|
+
|
|
106
|
+
The setup script creates one product by default:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
{
|
|
110
|
+
name: 'ONE Platform Course',
|
|
111
|
+
description: 'Complete course on building with the ONE Platform',
|
|
112
|
+
price: $97.00 USD
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Adding More Products
|
|
117
|
+
|
|
118
|
+
Edit `scripts/setup-stripe-products.ts`:
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
const PRODUCTS = [
|
|
122
|
+
{
|
|
123
|
+
name: 'ONE Platform Course',
|
|
124
|
+
description: 'Complete course...',
|
|
125
|
+
images: ['https://one.ie/images/course.jpg'],
|
|
126
|
+
defaultPrice: {
|
|
127
|
+
currency: 'usd',
|
|
128
|
+
unitAmount: 9700, // $97.00
|
|
129
|
+
nickname: 'ONE Course - One-time Payment',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
// Add new product
|
|
133
|
+
{
|
|
134
|
+
name: 'Pro Membership',
|
|
135
|
+
description: 'Monthly pro membership',
|
|
136
|
+
images: ['https://one.ie/images/pro.jpg'],
|
|
137
|
+
defaultPrice: {
|
|
138
|
+
currency: 'usd',
|
|
139
|
+
unitAmount: 2900, // $29.00
|
|
140
|
+
nickname: 'Pro - Monthly',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Then run:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
bun run stripe:setup
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
This will create ALL products and output new environment variables.
|
|
153
|
+
|
|
154
|
+
### Recurring Subscriptions
|
|
155
|
+
|
|
156
|
+
To create a subscription product, modify the price configuration:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
defaultPrice: {
|
|
160
|
+
currency: 'usd',
|
|
161
|
+
unitAmount: 2900,
|
|
162
|
+
recurring: {
|
|
163
|
+
interval: 'month', // or 'year'
|
|
164
|
+
},
|
|
165
|
+
nickname: 'Pro - Monthly Subscription',
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Then update your checkout session:
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
session = await stripe.checkout.sessions.create({
|
|
173
|
+
mode: 'subscription', // Change from 'payment'
|
|
174
|
+
line_items: [
|
|
175
|
+
{
|
|
176
|
+
price: import.meta.env.STRIPE_PRO_PRICE_ID,
|
|
177
|
+
quantity: 1,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
success_url: `${origin}/thankyou?session_id={CHECKOUT_SESSION_ID}`,
|
|
181
|
+
cancel_url: `${origin}/pricing`,
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Environment Variables Reference
|
|
186
|
+
|
|
187
|
+
### Required
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Publishable key (client-side)
|
|
191
|
+
PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51...
|
|
192
|
+
|
|
193
|
+
# Secret key (server-side only, NEVER expose to client)
|
|
194
|
+
STRIPE_SECRET_KEY=sk_test_51...
|
|
195
|
+
|
|
196
|
+
# Product price IDs (generated by stripe:setup)
|
|
197
|
+
STRIPE_COURSE_PRICE_ID=price_...
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Optional
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Webhook signing secret (for production webhooks)
|
|
204
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
205
|
+
|
|
206
|
+
# Additional product price IDs
|
|
207
|
+
STRIPE_PRO_PRICE_ID=price_...
|
|
208
|
+
STRIPE_ENTERPRISE_PRICE_ID=price_...
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Security Best Practices
|
|
212
|
+
|
|
213
|
+
### ✅ DO
|
|
214
|
+
|
|
215
|
+
- **Use test keys in development** (`sk_test_...`)
|
|
216
|
+
- **Use live keys in production** (`sk_live_...`)
|
|
217
|
+
- **Keep secret keys in `.env.local`** (never commit)
|
|
218
|
+
- **Validate on server-side** (don't trust client data)
|
|
219
|
+
- **Use webhooks** to verify payments in production
|
|
220
|
+
- **Enable Stripe Radar** for fraud detection
|
|
221
|
+
|
|
222
|
+
### ❌ DON'T
|
|
223
|
+
|
|
224
|
+
- **Never expose secret keys** to client-side code
|
|
225
|
+
- **Never commit `.env.local`** to git
|
|
226
|
+
- **Never trust payment status** without server verification
|
|
227
|
+
- **Never skip webhook signature validation** in production
|
|
228
|
+
|
|
229
|
+
## Testing
|
|
230
|
+
|
|
231
|
+
### Test Card Numbers
|
|
232
|
+
|
|
233
|
+
Stripe provides test cards for various scenarios:
|
|
234
|
+
|
|
235
|
+
| Card Number | Scenario |
|
|
236
|
+
|-------------|----------|
|
|
237
|
+
| `4242 4242 4242 4242` | Success |
|
|
238
|
+
| `4000 0000 0000 0002` | Card declined |
|
|
239
|
+
| `4000 0025 0000 3155` | Requires 3D Secure authentication |
|
|
240
|
+
| `4000 0000 0000 9995` | Insufficient funds |
|
|
241
|
+
| `4000 0000 0000 0069` | Charge expired |
|
|
242
|
+
|
|
243
|
+
**Expiry**: Use any future date (e.g., `12/34`)
|
|
244
|
+
**CVC**: Use any 3 digits (e.g., `123`)
|
|
245
|
+
**ZIP**: Use any ZIP code (e.g., `12345`)
|
|
246
|
+
|
|
247
|
+
### Test Mode vs Live Mode
|
|
248
|
+
|
|
249
|
+
**Test Mode** (Development):
|
|
250
|
+
- Uses `sk_test_...` and `pk_test_...` keys
|
|
251
|
+
- No real money involved
|
|
252
|
+
- Data is isolated from production
|
|
253
|
+
- Can use test card numbers
|
|
254
|
+
|
|
255
|
+
**Live Mode** (Production):
|
|
256
|
+
- Uses `sk_live_...` and `pk_live_...` keys
|
|
257
|
+
- Real payments are processed
|
|
258
|
+
- Real money is transferred
|
|
259
|
+
- Must use real payment methods
|
|
260
|
+
|
|
261
|
+
**Toggle in Stripe Dashboard**: Top-left corner "View test data" switch
|
|
262
|
+
|
|
263
|
+
## Webhooks (Production)
|
|
264
|
+
|
|
265
|
+
For production, set up webhooks to handle payment events:
|
|
266
|
+
|
|
267
|
+
### 1. Create Webhook Endpoint
|
|
268
|
+
|
|
269
|
+
Create `src/pages/api/webhooks/stripe.ts`:
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
import type { APIRoute } from 'astro';
|
|
273
|
+
import Stripe from 'stripe';
|
|
274
|
+
|
|
275
|
+
const stripe = new Stripe(import.meta.env.STRIPE_SECRET_KEY!, {
|
|
276
|
+
apiVersion: '2025-02-24.acacia',
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
export const POST: APIRoute = async ({ request }) => {
|
|
280
|
+
const body = await request.text();
|
|
281
|
+
const sig = request.headers.get('stripe-signature')!;
|
|
282
|
+
|
|
283
|
+
let event: Stripe.Event;
|
|
284
|
+
|
|
285
|
+
try {
|
|
286
|
+
event = stripe.webhooks.constructEvent(
|
|
287
|
+
body,
|
|
288
|
+
sig,
|
|
289
|
+
import.meta.env.STRIPE_WEBHOOK_SECRET!
|
|
290
|
+
);
|
|
291
|
+
} catch (err) {
|
|
292
|
+
return new Response(`Webhook Error: ${err.message}`, { status: 400 });
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Handle the event
|
|
296
|
+
switch (event.type) {
|
|
297
|
+
case 'checkout.session.completed':
|
|
298
|
+
const session = event.data.object as Stripe.Checkout.Session;
|
|
299
|
+
// Fulfill order, grant access, etc.
|
|
300
|
+
console.log('Payment succeeded:', session.id);
|
|
301
|
+
break;
|
|
302
|
+
case 'payment_intent.payment_failed':
|
|
303
|
+
const failedPayment = event.data.object as Stripe.PaymentIntent;
|
|
304
|
+
console.log('Payment failed:', failedPayment.id);
|
|
305
|
+
break;
|
|
306
|
+
default:
|
|
307
|
+
console.log(`Unhandled event type ${event.type}`);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return new Response(JSON.stringify({ received: true }), { status: 200 });
|
|
311
|
+
};
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### 2. Configure Webhook in Stripe Dashboard
|
|
315
|
+
|
|
316
|
+
1. Go to **Developers → Webhooks**
|
|
317
|
+
2. Click **Add endpoint**
|
|
318
|
+
3. Enter URL: `https://yourdomain.com/api/webhooks/stripe`
|
|
319
|
+
4. Select events to listen to:
|
|
320
|
+
- `checkout.session.completed`
|
|
321
|
+
- `payment_intent.succeeded`
|
|
322
|
+
- `payment_intent.payment_failed`
|
|
323
|
+
5. Copy the **Signing secret** (starts with `whsec_`)
|
|
324
|
+
6. Add to `.env.local`:
|
|
325
|
+
```bash
|
|
326
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### 3. Test Webhooks Locally
|
|
330
|
+
|
|
331
|
+
Use Stripe CLI:
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
# Install Stripe CLI
|
|
335
|
+
brew install stripe/stripe-cli/stripe
|
|
336
|
+
|
|
337
|
+
# Login
|
|
338
|
+
stripe login
|
|
339
|
+
|
|
340
|
+
# Forward webhooks to local dev server
|
|
341
|
+
stripe listen --forward-to localhost:4321/api/webhooks/stripe
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
This gives you a webhook signing secret for testing.
|
|
345
|
+
|
|
346
|
+
## Troubleshooting
|
|
347
|
+
|
|
348
|
+
### Error: "No such price: price_..."
|
|
349
|
+
|
|
350
|
+
**Solution**: Run the setup script again:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
bun run stripe:setup
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Then copy the generated `STRIPE_COURSE_PRICE_ID` to `.env.local`.
|
|
357
|
+
|
|
358
|
+
### Error: "STRIPE_COURSE_PRICE_ID is not configured"
|
|
359
|
+
|
|
360
|
+
**Solution**: Add the price ID to `.env.local`:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
STRIPE_COURSE_PRICE_ID=price_0SKcI6qs14Mpveu16vIPzJbH
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Error: "Stripe secret key is not configured"
|
|
367
|
+
|
|
368
|
+
**Solution**: Add your Stripe secret key to `.env.local`:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
STRIPE_SECRET_KEY=sk_test_51...
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Get it from: https://dashboard.stripe.com/test/apikeys
|
|
375
|
+
|
|
376
|
+
### Checkout redirects immediately
|
|
377
|
+
|
|
378
|
+
**Cause**: Session creation is failing
|
|
379
|
+
**Solution**: Check server logs for detailed error message
|
|
380
|
+
|
|
381
|
+
### Payment succeeds but order not fulfilled
|
|
382
|
+
|
|
383
|
+
**Cause**: Webhook not configured or failing
|
|
384
|
+
**Solution**:
|
|
385
|
+
1. Check webhook logs in Stripe Dashboard
|
|
386
|
+
2. Verify webhook signature validation
|
|
387
|
+
3. Test webhook with Stripe CLI
|
|
388
|
+
|
|
389
|
+
### Using wrong API version
|
|
390
|
+
|
|
391
|
+
**Cause**: Stripe API version mismatch
|
|
392
|
+
**Solution**: Use the version specified in the code:
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
const stripe = new Stripe(key, {
|
|
396
|
+
apiVersion: '2025-02-24.acacia',
|
|
397
|
+
});
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Generated Files
|
|
401
|
+
|
|
402
|
+
The setup script generates:
|
|
403
|
+
|
|
404
|
+
### `.stripe-config.json`
|
|
405
|
+
|
|
406
|
+
Product and price configuration:
|
|
407
|
+
|
|
408
|
+
```json
|
|
409
|
+
{
|
|
410
|
+
"environment": "test",
|
|
411
|
+
"createdAt": "2025-10-21T09:55:43.049Z",
|
|
412
|
+
"products": [
|
|
413
|
+
{
|
|
414
|
+
"name": "ONE Platform Course",
|
|
415
|
+
"productId": "prod_THAdytWWNfieJ0",
|
|
416
|
+
"priceId": "price_0SKcI6qs14Mpveu16vIPzJbH",
|
|
417
|
+
"amount": 9700,
|
|
418
|
+
"currency": "usd"
|
|
419
|
+
}
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
**Purpose**: Reference for product IDs and configuration
|
|
425
|
+
|
|
426
|
+
**Location**: Project root (git-ignored)
|
|
427
|
+
|
|
428
|
+
## Support
|
|
429
|
+
|
|
430
|
+
### Stripe Dashboard
|
|
431
|
+
|
|
432
|
+
View all payments, customers, and events:
|
|
433
|
+
- **Test Mode**: https://dashboard.stripe.com/test/payments
|
|
434
|
+
- **Live Mode**: https://dashboard.stripe.com/payments
|
|
435
|
+
|
|
436
|
+
### Stripe Documentation
|
|
437
|
+
|
|
438
|
+
- [Checkout Documentation](https://stripe.com/docs/payments/checkout)
|
|
439
|
+
- [Testing Guide](https://stripe.com/docs/testing)
|
|
440
|
+
- [Webhooks Guide](https://stripe.com/docs/webhooks)
|
|
441
|
+
- [API Reference](https://stripe.com/docs/api)
|
|
442
|
+
|
|
443
|
+
### ONE Platform Support
|
|
444
|
+
|
|
445
|
+
For integration questions:
|
|
446
|
+
- GitHub Issues: https://github.com/one-ie/one/issues
|
|
447
|
+
- Documentation: https://one.ie/docs
|
|
448
|
+
|
|
449
|
+
## Next Steps
|
|
450
|
+
|
|
451
|
+
1. ✅ Set up Stripe account
|
|
452
|
+
2. ✅ Add API keys to `.env.local`
|
|
453
|
+
3. ✅ Run `bun run stripe:setup`
|
|
454
|
+
4. ✅ Test checkout flow
|
|
455
|
+
5. ⏭️ Add webhook handling
|
|
456
|
+
6. ⏭️ Integrate with Convex for order management
|
|
457
|
+
7. ⏭️ Add customer portal
|
|
458
|
+
8. ⏭️ Go live with live keys
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
**Built with Stripe Checkout for secure, reliable payments.**
|