Merge pull request #80 from GameServerPanel/copilot/fix-billing-integration-error
This commit is contained in:
commit
147f63083a
2 changed files with 2 additions and 11 deletions
|
|
@ -25,7 +25,7 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "billing";
|
$module_title = "billing";
|
||||||
$module_version = "3.0";
|
$module_version = "3.0";
|
||||||
$db_version = 2;
|
$db_version = 1;
|
||||||
$module_required = FALSE;
|
$module_required = FALSE;
|
||||||
// Module description
|
// Module description
|
||||||
$module_description = "Billing storefront / provisioning integration. Public ordering runs as a standalone site; panel pages provide provisioning and admin order management.";
|
$module_description = "Billing storefront / provisioning integration. Public ordering runs as a standalone site; panel pages provide provisioning and admin order management.";
|
||||||
|
|
@ -85,7 +85,6 @@ $install_queries[0] = array(
|
||||||
`payment_txid` VARCHAR(255) NULL,
|
`payment_txid` VARCHAR(255) NULL,
|
||||||
`paid_ts` DATETIME NULL,
|
`paid_ts` DATETIME NULL,
|
||||||
`coupon_id` INT(11) NOT NULL DEFAULT 0,
|
`coupon_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
`created_by_admin` TINYINT(1) NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (`order_id`),
|
PRIMARY KEY (`order_id`),
|
||||||
KEY `user_id` (`user_id`),
|
KEY `user_id` (`user_id`),
|
||||||
KEY `status` (`status`),
|
KEY `status` (`status`),
|
||||||
|
|
@ -125,11 +124,4 @@ $install_queries[0] = array(
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Version 2: Add created_by_admin column to billing_orders for existing installs
|
|
||||||
$install_queries[1] = array(
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders`
|
|
||||||
ADD COLUMN IF NOT EXISTS `created_by_admin` TINYINT(1) NOT NULL DEFAULT 0
|
|
||||||
COMMENT 'Set to 1 when an admin manually created this server via the panel';"
|
|
||||||
);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* Shared helper for recording admin-created game servers in the billing tables,
|
* Shared helper for recording admin-created game servers in the billing tables,
|
||||||
* so they are treated identically to FREE website orders:
|
* so they are treated identically to FREE website orders:
|
||||||
* billing_invoices (status='paid', amount=0)
|
* billing_invoices (status='paid', amount=0)
|
||||||
* billing_orders (status='installed', price=0, created_by_admin=1, set in INSERT)
|
* billing_orders (status='installed', price=0)
|
||||||
*
|
*
|
||||||
* This does NOT re-provision the server — the caller (add_home.php) already
|
* This does NOT re-provision the server — the caller (add_home.php) already
|
||||||
* created the server via the panel DB layer. We only write the billing ledger
|
* created the server via the panel DB layer. We only write the billing ledger
|
||||||
|
|
@ -134,7 +134,6 @@ if (!function_exists('admin_register_server_in_billing')) {
|
||||||
'payment_txid' => 'admin-created',
|
'payment_txid' => 'admin-created',
|
||||||
'paid_ts' => $now,
|
'paid_ts' => $now,
|
||||||
'coupon_id' => 0,
|
'coupon_id' => 0,
|
||||||
'created_by_admin' => 1,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$order_id = $db->resultInsertId('billing_orders', $order_fields);
|
$order_id = $db->resultInsertId('billing_orders', $order_fields);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue