chore: cleanup unused code, update docs for payment integration

This commit is contained in:
2026-02-06 16:23:23 +01:00
parent 52634f84bf
commit 3c7d475d36
7 changed files with 97 additions and 108 deletions

View File

@@ -50,15 +50,30 @@
- **Provider**: BTCpay Server (self-hosted)
- **URL**: https://pay.xmr.rocks/
- **Proxy**: `pow.dgray.io` — alle API-Aufrufe laufen über den PHP-Proxy (BTCPay API-Key bleibt serverseitig)
- **Primär**: Monero (XMR)
- **Alternativ**: Andere Kryptos via Trocador-Plugin (automatischer Swap zu XMR)
- **Preisumrechnung**: Live XMR-Kurs via Kraken API
- EUR: `https://api.kraken.com/0/public/Ticker?pair=XMREUR`
- USD: `https://api.kraken.com/0/public/Ticker?pair=XMRUSD`
- CHF: `https://api.kraken.com/0/public/Ticker?pair=XMRCHF`
- GBP: `https://api.kraken.com/0/public/Ticker?pair=XMRGBP`
- JPY: `https://api.kraken.com/0/public/Ticker?pair=XMRJPY`
- **Bestätigung**: Nach 1-2 Blockchain-Confirmations
- EUR, USD, CHF, GBP, JPY
- **Bestätigung**: Nach 1 Blockchain-Confirmation (via Webhook)
### Flow: Draft → Processing → Published
1. User erstellt Listing → wird als `draft` mit `payment_status: unpaid` gespeichert
2. BTCPay Invoice wird über `pow.dgray.io/btcpay/invoice` erstellt
3. BTCPay Checkout-Modal öffnet sich im Frontend (`js/services/btcpay.js`)
4. Nach Zahlung:
- **Frontend**: Prüft Status via `pow.dgray.io/btcpay/status` nach Modal-Close
- **Webhook**: `pow.dgray.io/btcpay/webhook` empfängt BTCPay Events, setzt `status: published` + `payment_status: paid` nach 1 Confirmation
5. Listing wird veröffentlicht (30 Tage Laufzeit, `expires_at` wird gesetzt)
### Endpunkte (pow.dgray.io)
| Endpoint | Methode | Beschreibung |
|----------|---------|-------------|
| `/btcpay/invoice` | POST | Invoice erstellen (listingId, currency) |
| `/btcpay/status?id={id}` | GET | Invoice-Status abfragen |
| `/btcpay/webhook` | POST | BTCPay Webhook (auto-publish nach Confirmation) |
## Offene Fragen
@@ -66,3 +81,5 @@
- [x] ~~XMR-Kurs API für Umrechnung~~ → Kraken API
- [x] ~~Anzahl Deals für Power-User Status~~ → 5/15/50 Stufen
- [x] ~~Captcha-Lösung~~ → Eigenes PoW-Captcha (keine Lizenzkosten)
- [x] ~~Payment-Proxy~~`pow.dgray.io` (PHP, API-Key serverseitig)
- [x] ~~Webhook für Auto-Publish~~`btcpay-webhook.php` auf `pow.dgray.io`