Panel/modules/billing
copilot-swe-agent[bot] e13c00e89d
fix: address code review feedback - spacing and SQL comment
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/439845e0-926e-4b49-9cd0-810457b73c12

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2026-05-05 17:25:36 +00:00
..
_archived Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
api fix(billing): address code review feedback 2026-05-02 12:19:32 +00:00
classes fix(billing): address code review issues - ALTER TABLE syntax, null period handling, type detection 2026-05-02 12:23:23 +00:00
css document fixes 2025-11-10 20:12:52 -05:00
data Add billing data logs to gitignore 2025-11-10 03:17:50 +00:00
docs Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
images Website is completed working, moved into billing module 2025-10-23 18:19:06 -04:00
includes fix: billing DB safety, remove mapping table, sync services from game config 2026-05-02 15:22:13 +00:00
logs Website is completed working, moved into billing module 2025-10-23 18:19:06 -04:00
sql fix: address code review feedback - spacing and SQL comment 2026-05-05 17:25:36 +00:00
tools fix: address code review nits - table name escaping, prefix fallback, gamemanager default, admin.php site vars 2026-05-02 19:43:35 +00:00
add_override_price_column.sql fix: billing DB safety, remove mapping table, sync services from game config 2026-05-02 15:22:13 +00:00
add_paypal_data_column.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
add_remote_server_enabled_column.sql fix: billing DB safety, remove mapping table, sync services from game config 2026-05-02 15:22:13 +00:00
add_service_id_column.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
add_to_cart.php Merge branch 'Panel-unstable' of https://github.com/GameServerPanel/GSP into Panel-unstable 2025-11-10 07:23:04 -05:00
admin.php fix: address code review nits - table name escaping, prefix fallback, gamemanager default, admin.php site vars 2026-05-02 19:43:35 +00:00
admin_config.php fix: resolve 3 billing admin errors and normalize remote_servers query 2026-05-02 13:40:10 +00:00
admin_coupons.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
admin_invoices.php fix: resolve 3 billing admin errors and normalize remote_servers query 2026-05-02 13:40:10 +00:00
admin_orders.php fix: address code review comments (spelling, add comment to renewable_statuses) 2026-05-05 15:56:26 +00:00
admin_payments.php fix: resolve 3 billing admin errors and normalize remote_servers query 2026-05-02 13:40:10 +00:00
admin_xml_editor.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
adminserverlist.php fix: escape service_name in order.php to prevent XSS; modernize admin JS 2026-05-03 23:04:59 +00:00
ai.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
BILLING_FIX_SUMMARY.md Add comprehensive BILLING_FIX_SUMMARY documentation 2025-10-29 01:46:57 +00:00
bootstrap.php fix: billing game images - dropdown selector, auto-guess, proper URL resolution 2026-05-03 23:03:03 +00:00
cart.php fix(billing): address code review issues - ALTER TABLE syntax, null period handling, type detection 2026-05-02 12:23:23 +00:00
check_table.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
cleanupDB.sh No changes 2025-09-11 13:29:15 -04:00
COLUMN_RENAME_SUMMARY.md added invoiceing 2025-10-28 05:22:01 -04:00
COUPON_SYSTEM.md Add comprehensive documentation for coupon system and standalone billing 2025-10-29 11:05:26 +00:00
create_coupons_table.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
create_invoices_table.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
create_servers.php fix: improve script-only install messaging and add error logging for exec() calls 2026-05-02 15:09:43 +00:00
cron-shop.php fix: standardize billing order status values and apply full-day expiry grace rule 2026-05-05 17:24:41 +00:00
diag_remote.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
docs.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
fix_invoices_table_columns.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
FIXES_APPLIED.md site changes by codex 2025-11-20 08:10:31 -05:00
forgot_password.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
GAME_DOCS_TODO_REFERENCE.md document fixes 2025-11-10 20:12:52 -05:00
index.php changed the server listing 2026-03-13 17:47:00 -04:00
INVOICE_FIRST_FLOW.md added invoiceing 2025-10-28 05:22:01 -04:00
INVOICE_SYSTEM.md added invoiceing 2025-10-28 05:22:01 -04:00
invoices.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
logfile.txt Website is completed working, moved into billing module 2025-10-23 18:19:06 -04:00
LOGGING_CHANGES_SUMMARY.md Add summary documentation for logging changes 2025-10-29 21:42:26 +00:00
login.php fix: billing login fatal error (remove users_pass_hash UPDATE) and clean up DayZ Epoch XML post_install 2026-05-03 21:58:13 +00:00
logout.php site changes by codex 2025-11-20 08:10:31 -05:00
MIGRATION_SUMMARY.md added invoiceing 2025-10-28 05:22:01 -04:00
migration_to_invoices.sql Update table prefix from ogp_ to gsp_ in SQL files and config 2025-11-07 10:48:01 +00:00
module.php fix: FAQ PHP warnings, billing nav, XML fatal-skip, Steam Workshop user menu 2026-05-04 00:12:39 +00:00
my_account.php fix: address code review comments (spelling, add comment to renewable_statuses) 2026-05-05 15:56:26 +00:00
my_orders_panel.php feat: simplify billing status to Active/Invoiced/Expired with new SQL migration and cron rewrite 2026-05-01 22:17:22 +00:00
my_servers.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
navigation.xml added billing integration on panel 2025-11-15 11:04:48 -05:00
normalize_billing_order_status.sql fix: address code review comments (spelling, add comment to renewable_statuses) 2026-05-05 15:56:26 +00:00
order.php fix: billing order flow, steam_workshop lang key, workshop module install queries 2026-05-04 17:15:07 +00:00
PANEL_INTEGRATION.md added billing integration on panel 2025-11-15 11:04:48 -05:00
payment_cancel.php fixed missign config file and added check if xmlrpc istnt installed 2025-11-23 14:42:37 -05:00
PAYMENT_IMPLEMENTATION_SUMMARY.md copilot and cart updates 2025-11-05 11:55:31 -05:00
payment_success.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
PAYPAL_DEBUGGING_GUIDE.md Add comprehensive debugging documentation for PayPal payment flow 2025-10-29 21:40:01 +00:00
PHASE1_COMPLETE_SUMMARY.md document fixes 2025-11-10 20:12:52 -05:00
privacy.php style fixes 2025-10-23 19:44:24 -04:00
QUICK_DEBUG_REFERENCE.md Add comprehensive debugging documentation for PayPal payment flow 2025-10-29 21:40:01 +00:00
QUICK_START.md added billing integration on panel 2025-11-15 11:04:48 -05:00
README.md site changes by codex 2025-11-20 08:10:31 -05:00
README_COUPON_UPDATE.md Add comprehensive documentation for coupon system and standalone billing 2025-10-29 11:05:26 +00:00
RECENT_FIXES_SUMMARY.md site changes by codex 2025-11-20 08:10:31 -05:00
register.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
renew_server.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
reset_password.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
return.php Apply automated PHP8 safety transforms 2026-04-23 14:01:37 +00:00
server_status.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
serverlist.php fix: billing game images - dropdown selector, auto-guess, proper URL resolution 2026-05-03 23:03:03 +00:00
STATUS_REPORT.md Add comprehensive status report for billing module updates 2025-11-07 10:54:39 +00:00
test_db_connection.php fix: harden billing module for standalone portability 2026-05-02 13:15:50 +00:00
test_integration.php fix: standardize billing order status values and apply full-day expiry grace rule 2026-05-05 17:24:41 +00:00
TESTING_CHECKLIST.md Add comprehensive TESTING_CHECKLIST for billing fixes 2025-10-29 01:49:30 +00:00
timestamp.txt fix: billing order flow, steam_workshop lang key, workshop module install queries 2026-05-04 17:15:07 +00:00
tos.php Changes to be committed: 2025-10-23 19:25:29 -04:00
update_metadata_complete.ps1 document fixes 2025-11-10 20:12:52 -05:00
webhook.php fix(billing): address code review issues - ALTER TABLE syntax, null period handling, type detection 2026-05-02 12:23:23 +00:00

GameServers.World - Billing Module

Overview

The billing module is a complete standalone website for selling game servers. It can be deployed on the same machine as the GSP panel or on a completely separate external web host.

Documentation System

Visual TODO System

As of December 19, 2024, all game documentation includes completion tracking:

  • Complete Documentation: Displays with normal name (e.g., "Minecraft Server")
  • Incomplete Documentation: Displays with "TODO: " prefix (e.g., "TODO: Arma 3")

Current Status

  • Complete: 1 game (Minecraft - comprehensive template)
  • Incomplete: 146 games (marked with TODO prefix)

Documentation Template Standard

All complete documentation should match the Minecraft template:

  • Comprehensive ports table (ALL ports with purposes)
  • Firewall configurations (UFW, FirewallD, Windows, iptables)
  • Startup parameters with detailed explanations
  • Troubleshooting sections with specific solutions
  • Performance optimization tips
  • Security best practices
  • Resource links with citations

Viewing Documentation

  • Browse to docs.php to see all game documentation
  • Games with "TODO: " prefix need comprehensive research and writing
  • Click any game to view its documentation page

Marking Documentation Complete

When game documentation is finished:

  1. Edit docs/{game}/metadata.json
  2. Change "complete": false to "complete": true
  3. The TODO prefix will automatically disappear

Recent Updates

December 19, 2024 - Visual TODO System

  • Implemented completion tracking for all 148 game folders
  • Created PowerShell automation script (update_metadata_complete.ps1)
  • Updated docs.php with automatic TODO prefix display
  • Minecraft documentation completed as template example

November 10, 2025 - Critical Fixes

  • Fixed PayPal payment capture session issue
  • Removed cart debug logging code
  • Fixed cart page header/footer consistency
  • Implemented AJAX invoice removal with Font Awesome icons

Key Files

Documentation System

  • docs.php - Documentation browser with TODO system
  • docs/*/index.php - Individual game documentation pages
  • docs/*/metadata.json - Game metadata with completion status
  • update_metadata_complete.ps1 - Batch metadata update script

Reference Documents

  • PHASE1_COMPLETE_SUMMARY.md - Phase 1 implementation summary
  • GAME_DOCS_TODO_REFERENCE.md - Complete reference for documentation system
  • RECENT_FIXES_SUMMARY.md - All recent fixes and enhancements

Payment Integration

  • api/capture_order.php - PayPal payment capture (fixed session handling)
  • payment_success.php - Payment success redirect
  • payment_cancel.php - Payment cancellation handler

Shopping Cart

  • cart.php - Shopping cart UI with PayPal integration (cleaned up)
  • add_to_cart.php - Add items to cart
  • remove_from_cart.php - AJAX removal endpoint

Development Guidelines

Adding New Game Documentation

  1. Create folder: docs/{game-slug}/
  2. Create metadata.json:
    {
      "name": "Game Name",
      "description": "Brief description",
      "category": "game",
      "order": 100,
      "complete": false
    }
    
  3. Create index.php following Minecraft template
  4. Add optional icon.png or icon.jpg
  5. When complete, set "complete": true in metadata

Research Sources for Game Documentation

  • Official game wikis and documentation
  • LGSM (LinuxGSM) scripts and configuration files
  • Steam Community Guides (highly-rated)
  • Reddit communities (r/gameservers, game-specific)
  • GitHub repositories with server configurations
  • Official game forums
  • User-contributed solutions and fixes

Documentation Quality Standards

  • Comprehensive Ports: List ALL ports with purposes (TCP/UDP)
  • Startup Parameters: Full parameter explanations with examples
  • Troubleshooting: Specific common issues with tested solutions
  • Firewall Configs: Multiple platform examples (Linux + Windows)
  • Citations: Link to all sources used in research
  • Testing: Verify all commands and configurations are accurate

Next Priorities

Phase 2: ARMA Family + DayZ (HIGH PRIORITY)

  1. Arma 3
  2. Arma 2: Operation Arrowhead
  3. Arma 2: Combined Operations
  4. DayZ Standalone
  5. DayZ Mod
  • Counter-Strike family (1.6, Source, CS2, CS:GO)
  • Survival/Building (Rust, Terraria, Valheim, ARK)
  • Co-op Shooters (L4D series, Killing Floor series, TF2)
  • Tactical Shooters (Insurgency series, Squad)

Phase 4: Remaining Games

  • All other 50+ game folders in alphabetical order

Testing Checklist

PayPal Integration

  • User can add servers to cart
  • PayPal checkout button works
  • Payment completes successfully
  • Success page displays correctly
  • No NO_USER_SESSION errors in logs

Documentation System

  • docs.php displays all games correctly
  • TODO prefix shows for incomplete docs
  • Complete docs show without TODO prefix
  • Individual game pages load correctly
  • Navigation links work within documentation

Cart Functionality

  • Cart displays all items correctly
  • Remove button deletes items (AJAX)
  • Header and footer display consistently
  • Fonts match other billing pages

Technical Notes

Session Management

  • CRITICAL: Always use session_name("opengamepanel_web") before session_start()
  • Sessions are separate from panel sessions
  • User authentication stored in $_SESSION['website_user_id']

Database Connection

  • Uses mysqli with credentials from includes/config.inc.php
  • All database operations use native mysqli functions
  • Never use panel-specific functions

Standalone Design

  • Module must work on external hosting
  • No dependencies on panel files
  • All paths use __DIR__ relative references
  • MySQL connection direct (not through panel)

Support & Resources

  • Main project: GameServerPanel/GSP
  • Branch: Panel-unstable
  • Documentation: Browse docs.php for game-specific guides
  • Issues: Check logs in modules/billing/logs/

Last Updated: December 19, 2024
Version: 2.0 (with Visual TODO System)