๐Ÿ“‹ System Overview

Complete Revolut Pro payment webhook receiver system with multi-seller marketplace integration.

๐Ÿš€ Active Services

  • โ€ข FastAPI Webhook Receiver (Port 8000)
  • โ€ข Telegram Analytics Bot
  • โ€ข Seller #04 Bot [@TianTianApp_bot]
  • โ€ข PostgreSQL Database
  • โ€ข Caddy Reverse Proxy

๐ŸŒ Domains

  • โ€ข revolut.thevirtum.com (Webhook)
  • โ€ข obfuscated.thevirtum.com (Docs)
  • โ€ข Main domain: thevirtum.com

๐Ÿ—๏ธ System Architecture

๐Ÿ“ Directory Structure

/home/deployer/projects/
โ”œโ”€โ”€ revolut-webhook/          # Main webhook system
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py          # FastAPI application
โ”‚   โ”‚   โ”œโ”€โ”€ database.py      # Database operations
โ”‚   โ”‚   โ”œโ”€โ”€ telegram.py      # Telegram bot handlers
โ”‚   โ”‚   โ”œโ”€โ”€ seller_integration.py  # Seller logic
โ”‚   โ”‚   โ””โ”€โ”€ models.py        # Data models
โ”‚   โ”œโ”€โ”€ .env                 # Environment variables
โ”‚   โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”‚   โ””โ”€โ”€ revolut-webhook.service  # Systemd service
โ”œโ”€โ”€ seller-04-bot/           # Seller #04 bot
โ”‚   โ”œโ”€โ”€ handlers/
โ”‚   โ”‚   โ”œโ”€โ”€ shop.py         # Shop functionality
โ”‚   โ”‚   โ”œโ”€โ”€ admin.py        # Admin panel
โ”‚   โ”‚   โ””โ”€โ”€ payments.py     # Payment processing
โ”‚   โ”œโ”€โ”€ config.py           # Bot configuration
โ”‚   โ”œโ”€โ”€ main.py            # Bot entry point
โ”‚   โ””โ”€โ”€ keyboards.py       # Telegram keyboards
โ””โ”€โ”€ obfuscated-docs/        # This documentation
    โ””โ”€โ”€ index.html

๐Ÿ”„ Data Flow

  1. Revolut sends payment webhook to revolut.thevirtum.com/revolut
  2. Tasker on Android intercepts Revolut notifications
  3. Tasker sends parsed data to /tasker/notification
  4. System identifies seller by last 2 cents (01-09)
  5. Payment stored in PostgreSQL database
  6. Telegram notification sent to analytics bot
  7. Seller bot notified if applicable

๐Ÿ—„๏ธ Database Schema

๐Ÿ” Database Credentials

Host: 127.0.0.1:5432
Database: revolut_db
Username: revolut_user
Password: xK9#mN2$pL7@qR4w
Connection URL: postgresql://revolut_user:xK9%23mN2%24pL7%40qR4w@127.0.0.1:5432/revolut_db

๐Ÿ“Š Tables Structure

payment_events

CREATE TABLE payment_events (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    event_type VARCHAR(50) NOT NULL,
    amount DECIMAL(10,2),
    currency VARCHAR(3),
    merchant_name VARCHAR(255),
    payment_method VARCHAR(100),
    sender_name VARCHAR(255),
    net_amount DECIMAL(10,2),
    fee_amount DECIMAL(10,2),
    raw_data JSONB,
    fingerprint VARCHAR(64) UNIQUE,
    seller_code VARCHAR(2),
    tasker_data JSONB,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

sellers

CREATE TABLE sellers (
    id SERIAL PRIMARY KEY,
    seller_code VARCHAR(2) UNIQUE NOT NULL,
    name VARCHAR(100) NOT NULL,
    bot_token VARCHAR(255),
    chat_id BIGINT,
    description TEXT,
    is_active BOOLEAN DEFAULT true,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

orders (Seller Bot)

CREATE TABLE orders (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id BIGINT NOT NULL,
    username VARCHAR(255),
    first_name VARCHAR(255),
    last_name VARCHAR(255),
    product_code VARCHAR(10) NOT NULL,
    currency VARCHAR(3) NOT NULL,
    amount DECIMAL(10,2) NOT NULL,
    status VARCHAR(20) DEFAULT 'pending',
    payment_url TEXT,
    created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    completed_at TIMESTAMP WITH TIME ZONE
);

๐Ÿ“ˆ Current Data Status

  • โ€ข payment_events: 0 records
  • โ€ข sellers: 1 record (Seller #04)
  • โ€ข seller_transactions: 0 records
  • โ€ข orders: Variable (seller bot orders)
  • โ€ข products: 10 products (1b-10b)

๐Ÿ”Œ API Endpoints

POST /revolut

Main webhook endpoint for Revolut payments

Headers:
  Content-Type: application/json
  Authorization: Bearer revolutProOrder

Body: Revolut webhook JSON payload

POST /tasker/notification

Tasker Android app notification receiver

{
  "source": "tasker",
  "event": "notification",
  "app": {"name": "Revolut"},
  "notification": {
    "title": "โ‚ฌ2.04 from John Doe",
    "text": "Received via Revolut"
  },
  "timestamp": "2025-09-18 03:45:12"
}

POST /seller/notify

Notify seller bots about completed payments

{
  "seller_code": "04",
  "user_id": 123456789,
  "amount": 2.04,
  "currency": "EUR",
  "order_id": "uuid-here"
}

GET /health

Health check endpoint

Response: {"status": "healthy", "timestamp": "..."}

๐Ÿ’ฌ Telegram Integration

๐Ÿค– Analytics Bot

Token: 7853823106:AAE1MiljeIChLBzuxa6BTSFK1-4oXhqD5uw
Chat ID: 877659798 (Main admin)
Webhook Secret: RevolutWebhookSecret2024

๐Ÿ“ฑ Bot Commands

Analytics Bot

  • โ€ข /start - Main menu
  • โ€ข /last - Last 10 payments
  • โ€ข /today - Today's statistics
  • โ€ข /find [amount] - Find payment
  • โ€ข Inline buttons for periods
  • โ€ข Currency filtering (EUR/USD)
  • โ€ข Seller statistics

Seller #04 Bot

  • โ€ข /start - Welcome message
  • โ€ข /admin - Admin panel
  • โ€ข Shop catalog (10 products)
  • โ€ข Payment processing
  • โ€ข Order management
  • โ€ข Statistics for admin

๐ŸŽ›๏ธ Inline Keyboard Features

  • โ€ข Period Selection: Today, Week, Month, All Time
  • โ€ข Currency Filters: EUR, USD, All
  • โ€ข Seller Analytics: Individual seller stats
  • โ€ข Payment Details: Expandable payment info
  • โ€ข Shop Navigation: Product catalog, cart, checkout
  • โ€ข Admin Panel: Statistics, orders, product management

๐Ÿช Multi-Seller System

๐Ÿ”ข Seller Identification Logic

Sellers are identified by the last 2 cents of payment amounts:

01ยข โ†’ Seller #01
02ยข โ†’ Seller #02
03ยข โ†’ Seller #03
04ยข โ†’ Seller #04 โœ…
05ยข โ†’ Seller #05
06ยข โ†’ Seller #06
07ยข โ†’ Seller #07
08ยข โ†’ Seller #08
09ยข โ†’ Seller #09

Example: โ‚ฌ12.04 โ†’ Seller #04, $15.07 โ†’ Seller #07

๐Ÿ›๏ธ Seller #04 Bot Details

Bot Token: 8140594673:AAEAcE_sDUSp_EbEWjAiSzARTPgYggf8XlM
Chat ID: 7948563551
Username: @TianTianApp_bot
Name: ็”œ็”œ&Virtum

๐Ÿ“ฆ Product Catalog

1b: Basic package - $2.04 / โ‚ฌ2.54
2b: Standard package - $4.04 / โ‚ฌ4.54
3b: Enhanced package - $6.04 / โ‚ฌ7.04
4b: Premium package - $8.04 / โ‚ฌ9.04
5b: Advanced package - $10.04 / โ‚ฌ11.54
6b: Professional package - $12.04 / โ‚ฌ14.04
7b: Enterprise package - $14.04 / โ‚ฌ16.04
8b: Ultimate package - $16.04 / โ‚ฌ18.04
9b: Elite package - $18.04 / โ‚ฌ21.04
10b: Exclusive package - $19.54 / โ‚ฌ23.04

๐Ÿ”ง Support Contacts

  • โ€ข Seller: @FF080033
  • โ€ข Payment Issues: @PrivatniTelegram
  • โ€ข Live Chat: 24/7 Support Available

โš™๏ธ System Configuration

๐ŸŒ Caddy Configuration

# /etc/caddy/Caddyfile
revolut.thevirtum.com {
    @revolut_get {
        path /revolut
        method GET PUT DELETE PATCH
    }
    respond @revolut_get "Method not allowed" 405

    reverse_proxy 127.0.0.1:8000

    log {
        output file /var/log/caddy/revolut.log
        format json
    }

    header {
        -Server
        X-Content-Type-Options nosniff
        X-Frame-Options DENY
        X-XSS-Protection "1; mode=block"
        Referrer-Policy strict-origin-when-cross-origin
    }
}

obfuscated.thevirtum.com {
    root * /home/deployer/projects/obfuscated-docs
    file_server
}

๐Ÿ” Environment Variables

# /home/deployer/projects/revolut-webhook/.env
REV_PUSH_TOKEN=revolutProOrder
DATABASE_URL=postgresql://revolut_user:xK9%23mN2%24pL7%40qR4w@127.0.0.1:5432/revolut_db
TG_BOT_TOKEN=7853823106:AAE1MiljeIChLBzuxa6BTSFK1-4oXhqD5uw
TG_CHAT_ID=877659798
TG_WEBHOOK_SECRET=RevolutWebhookSecret2024

# Seller configuration
SELLER_04_BOT_TOKEN=8140594673:AAEAcE_sDUSp_EbEWjAiSzARTPgYggf8XlM
SELLER_04_CHAT_ID=7948563551

๐Ÿ”„ Systemd Services

# revolut-webhook.service
[Unit]
Description=Revolut Webhook Receiver
After=network.target postgresql.service

[Service]
Type=simple
User=deployer
WorkingDirectory=/home/deployer/projects/revolut-webhook
Environment=PATH=/home/deployer/projects/revolut-webhook/venv/bin
ExecStart=/home/deployer/projects/revolut-webhook/venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 8000
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

๐Ÿ“ฑ Tasker Configuration

Android Tasker app configuration for Revolut notifications:

Trigger: Notification from "Revolut" app
Action: HTTP POST to revolut.thevirtum.com/tasker/notification

Body Template:
{
  "source": "tasker",
  "event": "notification",
  "app": {"name": "%anapp"},
  "notification": {
    "title": "%antitle",
    "text": "%antext"
  },
  "timestamp": "%DATE %TIME"
}

๐Ÿ”ง Management Commands

# Service management
sudo systemctl start revolut-webhook
sudo systemctl stop revolut-webhook
sudo systemctl restart revolut-webhook
sudo systemctl status revolut-webhook

# Caddy management
sudo systemctl reload caddy
sudo caddy fmt --overwrite /etc/caddy/Caddyfile

# Database access
PGPASSWORD='xK9#mN2$pL7@qR4w' psql -U revolut_user -d revolut_db -h localhost

# Log monitoring
tail -f /var/log/caddy/revolut.log
journalctl -u revolut-webhook -f

# Bot management (seller #04)
cd /home/deployer/projects/seller-04-bot
python3 main.py