- admin_config.php: guard session_start() — was firing Notice because
admin_auth.php → session_bridge.php already started the session
- includes/menu.php: check mysqli_thread_id() before reusing $db so a
closed handle does not cause 'mysqli object is already closed' fatal
- admin_invoices.php / admin_payments.php: set $db = null after
mysqli_close() so menu.php's reuse-check correctly falls through to
opening a fresh connection
- adminserverlist.php: use col_exists() to detect missing 'enabled'
column in gsp_remote_servers; fall back to constant 1 and display a
schema-notice banner; guard UPDATE accordingly; also add missing
price_daily / price_year columns to the services SELECT; remove
duplicate 'Update Enabled Servers' button
- add_remote_server_enabled_column.sql: idempotent migration to add the
'enabled' INT column to gsp_remote_servers on older installs
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/988997ed-7568-48bf-96ef-889fb5d91fec
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
- Add PaymentGatewayInterface contract for all payment providers
- Add PayPalGateway (reads credentials from config, not hardcoded)
- Add ManualGateway for admin-triggered payments
- Add StripeGateway stub for future implementation
- Add GatewayFactory for gateway instantiation by name
- Add BillingRepository: parameterized-SQL data layer
- Add BillingService: pricing, invoice creation, payment processing
- Add gsp_billing_transactions table (DB version 2) for audit trail
- Add new columns to gsp_billing_invoices (home_id, rate_type, players, period_start/end, subtotal, total_due, payment_status)
- Add gsp_billing_service_remote_servers mapping table
- Move PayPal credentials from api files into config.inc.php
- Fix double session_start() bug in capture_order.php
- Replace raw SQL with prepared statements throughout
- Refactor admin_invoices.php to use billing_invoices + BillingRepository
- Refactor admin_payments.php to read from gsp_billing_transactions
- Update admin.php with links to Transaction Log and Manage Invoices
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>