<?php
// public_html/assets/config/config.php
// ✅ Central config (constants + returned array)
// ✅ Adds SIGNATURE_KEY_B64 correctly inside the returned array
// ✅ Also sets it via putenv() for any code that uses getenv()

// Only define constants if they are not already defined
if (!defined('DB_HOST')) define('DB_HOST', getenv('DB_HOST') ?: 'localhost');
if (!defined('DB_USER')) define('DB_USER', getenv('DB_USER') ?: 'smartsync_bukata');
if (!defined('DB_PASS')) define('DB_PASS', getenv('DB_PASS') ?: 'Bukata2017*');
if (!defined('DB_NAME')) define('DB_NAME', getenv('DB_NAME') ?: 'smartsync_db_php');

// SMTP settings (you can later move these to a secure location)
if (!getenv('SMTP_USER')) putenv('SMTP_USER=gretbuyinfo@gmail.com');
if (!getenv('SMTP_PASS')) putenv('SMTP_PASS=aoljxfuytgjevcdp');

// ✅ Signature encryption key (32 bytes, base64-encoded)
// Best practice: keep this in a .env or outside web root.
// For now, it works for both getenv() and config array access.
if (!getenv('SIGNATURE_KEY_B64')) {
  putenv('SIGNATURE_KEY_B64=LZKqz4u0YHqYx6x9D8kFzZqXz2mF8b8P9c4YvYp0H7E=');
}

return [
  // Integrations
  'base_url'    => 'https://paymentservices.probasegroup.com/',
  'system_id'   => 'Pattio Media Limited-4745',
  'merchant_id' => 63,
  'password'    => 'azw4HEnUdrk%J6/vcjT@',
  'auth_token'  => 'YBhMxwhTGjvdcUD6zRMYRtwTbxkUadRVHFNmH8pf32Xxfw5EsCraZ9RbbpZbYyEXAvcz85TGxD49yJbCznVnhypD5GwgWQ2QxGhH7WgRBmh2Pj',

  // ✅ Signature encryption
  'SIGNATURE_KEY_B64' => getenv('SIGNATURE_KEY_B64'),
];
