Commit graph

3 commits

Author SHA1 Message Date
copilot-swe-agent[bot]
3066d9c75c
fix(billing): address code review issues - ALTER TABLE syntax, null period handling, type detection
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e8da2cb7-dbf1-4296-b25d-766f8e099581

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2026-05-02 12:23:23 +00:00
copilot-swe-agent[bot]
4a1b5bc725
fix(billing): address code review feedback
- Use DECIMAL instead of FLOAT for monetary columns in ALTER TABLE
- Simplify bind_param type string from concatenated to single literal
- Validate payment_status against ENUM values before CSS class injection
- Add provisioning failure logging when panel bootstrap fails
- Add comment explaining total_due/amount legacy fallback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
2026-05-02 12:19:32 +00:00
copilot-swe-agent[bot]
986a4e53b4
refactor(billing): clean architecture with payment gateway abstraction
- 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>
2026-05-02 12:17:36 +00:00