58ca4e68db
- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics) - Rust analytics service with parallel report generation - C runtime with POSIX shared memory IPC - PostgreSQL schema with 30+ tables, full migrations - Redis cache, sessions, pub/sub - Kafka event streaming with Zookeeper - WebSocket hub for real-time updates - Automation engine with cron jobs, workflows, event triggers - JWT authentication, multi-tenant from start - Docker Compose with all services - Nginx reverse proxy with rate limiting - Integration tests passing - Feature gap analysis against Fortnox/Odoo/Visma Refs: BOC-001
3.1 KiB
3.1 KiB
Stripe Setup för quiXzoom Shop
1. Skapa Stripe-konto
- Gå till stripe.com
- Skapa konto (eller logga in på befintligt)
- Växla till "Test mode" för utveckling
2. Hämta API-nycklar
Gå till Developers → API keys:
| Nyckel | Miljö | Beskrivning |
|---|---|---|
Publishable key |
Test | pk_test_... — används i frontend |
Secret key |
Test | sk_test_... — används i backend |
3. Konfigurera Webhook
Gå till Developers → Webhooks:
- Klicka "Add endpoint"
- URL:
https://shop.quixzoom.com/api/payment/webhook - Välj events:
payment_intent.succeededpayment_intent.payment_failed
- Kopiera "Signing secret" (
whsec_...)
4. Uppdatera miljövariabler
sudo systemctl edit --full quixzoom-shop
Uppdatera dessa rader:
Environment=STRIPE_SECRET_KEY=sk_test_din_hemliga_nyckel
Environment=STRIPE_PUBLISHABLE_KEY=pk_test_din_publika_nyckel
Environment=STRIPE_WEBHOOK_SECRET=whsec_din_webhook_secret
För produktion, byt till live-nycklar (sk_live_, pk_live_):
Environment=STRIPE_SECRET_KEY=sk_live_din_hemliga_nyckel
Environment=STRIPE_PUBLISHABLE_KEY=pk_live_din_publika_nyckel
5. Starta om servicen
sudo systemctl daemon-reload
sudo systemctl restart quixzoom-shop
sudo systemctl status quixzoom-shop
6. Testa betalning
Använd Stripe's test-kort:
| Kortnummer | CVC | Datum | Resultat |
|---|---|---|---|
4242 4242 4242 4242 |
Any | Any future | Success |
4000 0000 0000 0002 |
Any | Any future | Declined |
4000 0000 0000 9995 |
Any | Any future | Insufficient funds |
7. Produktion
Innan du går live:
- ✅ Aktivera Stripe-konto (verifiera företag)
- ✅ Byt till live-nycklar
- ✅ Sätt upp webhook för produktion
- ✅ Konfigurera payout-konto (bankkonto)
- ✅ Testa hela flödet med riktiga betalningar i test-mode
- ✅ Sätt upp Stripe Connect om du vill dela intäkter
Arkitektur
Användare → quiXzoom App/Web → shop.quixzoom.com
↓
FastAPI (quixzoom-shop)
↓
┌─────────┴─────────┐
↓ ↓
PostgreSQL Stripe API
(ordrar, (betalningar)
produkter)
↓
Redis (cache)
Betalningsflöde
- Användare lägger produkter i kundvagn
- Klickar "Gå till kassan"
- Backend skapar order (status:
pending) - Backend skapar Stripe PaymentIntent
- Frontend visar Stripe Card Element
- Användare fyller i kortuppgifter
- Frontend bekräftar betalning med Stripe
- Stripe skickar webhook till backend
- Backend uppdaterar order till
paid - Användare ser bekräftelse
Priser
Alla priser i databasen är i öre (SEK):
- 129900 = 1 299,00 kr
- 49900 = 499,00 kr
Stripe hanterar alltid öre för SEK.