diff --git a/CLAUDE.md b/CLAUDE.md index bf88f5d..fc2ce88 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,8 +1,18 @@ # LittleShop Development Progress > ๐Ÿ“‹ **See [ROADMAP.md](./ROADMAP.md) for development priorities and security fixes** +> ๐Ÿ“Œ **See [WORKING_BASELINE_2024-09-24.md](./WORKING_BASELINE_2024-09-24.md) for current working configuration** -## Project Status: โœ… PRODUCTION DEPLOYMENT WITH SILVERPAY - SEPTEMBER 20, 2025 +## Project Status: โœ… FULLY OPERATIONAL BASELINE - SEPTEMBER 24, 2024 + +### ๐ŸŽฏ **WORKING BASELINE ESTABLISHED (September 24, 2024, 20:15 UTC)** + +**All systems operational and integrated:** +- โœ… **TeleBot**: Fixed checkout flow (single address message), no duplicate commands +- โœ… **LittleShop Admin**: CSRF tokens fixed, Pending Payment tab added, rebranded to TeleShop +- โœ… **SilverPay**: Payment creation fixed (fiat_amount field), currency conversion working +- โœ… **Integration**: All containers on same network, DNS resolution working +- โœ… **Payments**: GBP โ†’ Crypto conversion with live rates (ยฃ10 = 0.00011846 BTC @ ยฃ84,415/BTC) ### ๐Ÿš€ **FULL SYSTEM DEPLOYMENT (September 20, 2025)** โœ… diff --git a/WORKING_BASELINE_2024-09-24.md b/WORKING_BASELINE_2024-09-24.md new file mode 100644 index 0000000..491beb7 --- /dev/null +++ b/WORKING_BASELINE_2024-09-24.md @@ -0,0 +1,162 @@ +# Working Baseline - September 24, 2024 + +## ๐ŸŽฏ System Status: FULLY OPERATIONAL + +This document captures the current working state of the LittleShop/TeleBot/SilverPay integrated system. + +## โœ… All Systems Working + +### 1. **TeleBot** - Telegram Bot Interface +- **Status**: โœ… Operational +- **Container**: `telebot:latest` +- **Bot**: @Littleshop_tom_bot +- **Key Fixes Applied**: + - โœ… Checkout flow collects all address details in one message (not Step 1/5) + - โœ… No duplicate `/review` commands + - โœ… Currency display shows proper conversion notes + - โœ… Connected to LittleShop API successfully + - โœ… Tor proxy available via `telebot-tor` container + +### 2. **LittleShop Admin** - E-commerce Backend +- **Status**: โœ… Operational +- **URL**: https://admin.thebankofdebbie.giize.com +- **Container**: `littleshop-admin` +- **Key Fixes Applied**: + - โœ… CSRF tokens on all forms (delete, update status) + - โœ… Pending Payment orders tab + - โœ… Rebranded to "TeleShop Admin" + - โœ… SilverPay integration fixed (fiat_amount field) + - โœ… Connected to both `littleshop-network` and `bridge` networks + +### 3. **SilverPay** - Cryptocurrency Payment Gateway +- **Status**: โœ… Operational +- **URL**: https://pay.thebankofdebbie.giize.com +- **Container**: `silverpay-api` +- **Key Fixes Applied**: + - โœ… Connected to `littleshop-network` for container name resolution + - โœ… API accepting orders with correct field names + - โœ… Currency conversion working (GBP โ†’ BTC/ETH) + - โœ… Generating payment addresses successfully + +## ๐Ÿ”ง Critical Configuration + +### Docker Networks +All containers must be on `littleshop-network` for inter-container communication: +```bash +docker network connect littleshop-network [container-name] +``` + +### Environment Variables (LittleShop) +``` +SilverPay__BaseUrl=http://silverpay-api:8000 +SilverPay__ApiKey=7703aa7a62fa4b40a87e9cfd867f5407147515c0986116ea54fc00c0a0bc30d8 +SilverPay__WebhookSecret=Thefa1r1esd1d1twebhooks2024 +``` + +### API Field Names (SilverPay) +Request must include: +- `fiat_amount` (not `amount`) +- `fiat_currency` (e.g., "GBP") +- `currency` (crypto: "BTC", "ETH") +- `external_id` +- `webhook_url` + +## ๐Ÿ“Š Recent Fixes (Git Commits) + +1. **7809b6e** - Fix SilverPay payment creation - use fiat_amount instead of amount +2. **5013e60** - Fix TeleBot compilation errors - use RequiredAmount property +3. **ddff649** - Fix TeleBot checkout flow and currency display +4. **bc708bb** - Fix missing CSRF tokens in all delete forms +5. **6e3c11a** - Add Pending Payment tab and rebrand to TeleShop Admin + +## ๐Ÿงช Verification Tests + +### Test 1: Payment Creation +```bash +curl -X POST http://silverpay-api:8000/api/v1/orders \ + -H "Content-Type: application/json" \ + -H "X-API-Key: 7703aa7a62fa4b40a87e9cfd867f5407147515c0986116ea54fc00c0a0bc30d8" \ + -d '{ + "external_id": "test-001", + "fiat_amount": 10.00, + "fiat_currency": "GBP", + "currency": "BTC", + "webhook_url": "https://admin.thebankofdebbie.giize.com/webhook" + }' +``` +**Expected**: 200 OK with crypto_amount and payment_address + +### Test 2: Container Connectivity +```bash +docker exec littleshop-admin curl http://silverpay-api:8000/health +``` +**Expected**: {"status":"healthy"...} + +### Test 3: TeleBot Order Flow +1. Message @Littleshop_tom_bot +2. Browse products and add to cart +3. Checkout - provides all address details in one message +4. Select payment method (BTC/ETH) +5. Receive payment address with converted crypto amount + +## ๐Ÿš€ Deployment Commands + +### Restart All Services +```bash +# On Hostinger server (srv1002428.hstgr.cloud) +docker restart littleshop-admin +docker restart telebot +docker restart silverpay-api +``` + +### Check Status +```bash +docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "littleshop|telebot|silverpay" +``` + +### View Logs +```bash +docker logs --tail 50 littleshop-admin +docker logs --tail 50 telebot +docker logs --tail 50 silverpay-api +``` + +## ๐Ÿ“ Known Working Configuration + +### Container Versions (as of Sept 24, 2024) +- **LittleShop**: Built from commit 7809b6e +- **TeleBot**: Built from commit 7809b6e +- **SilverPay**: localhost:5000/silverpay:latest + +### Database +- **LittleShop**: SQLite at `/opt/littleshop/data/littleshop-production.db` +- **SilverPay**: PostgreSQL (silverpay-postgres container) + +### File Permissions +- LittleShop data: owned by UID 1654 +- TeleBot data: owned by UID 1001 +- Use `chown -R [uid]:[uid] /path` to fix permission issues + +## โš ๏ธ Critical Points to Remember + +1. **Network Connectivity**: Containers must be on the same Docker network +2. **Field Names**: SilverPay expects `fiat_amount`, not `amount` +3. **CSRF Tokens**: All forms need `@Html.AntiForgeryToken()` +4. **Currency Display**: Shows GBP with conversion note for amounts > 1.0 +5. **Checkout Flow**: Single message for address, not multi-step + +## ๐ŸŽ‰ System Capabilities + +Users can now: +1. โœ… Browse products via TeleBot +2. โœ… Add items to cart +3. โœ… Complete checkout with single address entry +4. โœ… Select cryptocurrency for payment +5. โœ… Receive correct crypto amounts with live exchange rates +6. โœ… Get unique payment addresses for each order +7. โœ… Admin can manage orders through TeleShop Admin panel +8. โœ… View pending payments in dedicated tab + +## ๐Ÿ“… Baseline Date: September 24, 2024, 20:15 UTC + +All systems confirmed working at this timestamp. \ No newline at end of file