From 91a63a780f71ae71e5df0e283c086f2a19afe7e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:52:32 +0000 Subject: [PATCH] Fix PayPal capture_order.php to use standalone database connection Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- .github/copilot-instructions.md | 3 +-- modules/billing/api/capture_order.php | 10 ++++---- modules/billing/includes/config.inc.php | 32 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 modules/billing/includes/config.inc.php diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 50fa810e..066b6ccb 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -67,8 +67,7 @@ header('Location: /modules/billing/cart.php'); ## 3) Scope & principles - **Website ↔ Panel on the same host.** Website uses the **panel DB for authentication** and the **panel’s internal APIs** for provisioning. **Sessions remain separate** (website session ≠ panel session). -- **Billing module flexibility.** The `modules/billing/` frontend can run on the **same machine as the panel** or on an **external web host**, interfacing primarily via MySQL table edits. All interaction with panel DB happens through direct MySQL queries using credentials in `modules/billing/includes/config.inc.php`. -- **Billing module flexibility.** The `modules/billing/` frontend can run on the **same machine as the panel** or on an **external web host**, interfacing primarily via MySQL table edits. All interaction with panel DB happens through direct MySQL queries using credentials in `modules/billing/includes/config.inc.php`. +- **Billing module is STANDALONE.** The `modules/billing/` frontend is a **standalone product** that can run on the **same machine as the panel** or on an **external web host**. It must **NEVER** use `require_once` to include panel files like `includes/database_mysqli.php` or any panel helper functions. Instead, it connects directly to the MySQL database using standard `mysqli_connect()` with credentials from `modules/billing/includes/config.inc.php`. All database operations must use native mysqli functions (mysqli_query, mysqli_real_escape_string, etc.), NOT panel-specific helper functions like `$db->query()` or `createDatabaseConnection()`. - **Catalog = XML.** Enable **every game** present under `modules/config_games/server_configs/`. The website reads those XMLs for ports, params, install/update metadata. New XMLs should become available without code changes. - **Regions/Nodes = panel DB.** Regions and nodes are configured in the panel and must be **queried live** from the panel DB. Never hardcode or mirror region lists on the website. - **Slotless model.** Pricing/UX must not enforce slot caps. If an engine requires a player count parameter, set a safe high default and surface engine limits transparently if they exist. diff --git a/modules/billing/api/capture_order.php b/modules/billing/api/capture_order.php index 38a946ea..ef0087ae 100644 --- a/modules/billing/api/capture_order.php +++ b/modules/billing/api/capture_order.php @@ -1,6 +1,7 @@ 'db_connection_failed', 'status' => $captureStatus]); exit; } diff --git a/modules/billing/includes/config.inc.php b/modules/billing/includes/config.inc.php new file mode 100644 index 00000000..41a6df6b --- /dev/null +++ b/modules/billing/includes/config.inc.php @@ -0,0 +1,32 @@ +