<?php
// c2b/c2b_config.php
require_once dirname(__DIR__) . '/includes/config_loader.php';

/**
 * C2B Configuration
 */

// Base domain for all callbacks
define('MPESA_BASE_URL', 'https://cbs.creativewebsolutions.co.ke');

// Environment and Site
define('C2B_MPESA_ENVIRONMENT', getenv('C2B_MPESA_ENVIRONMENT'));
define('C2B_SITE_NAME', getenv('C2B_MPESA_SITE_NAME'));

// API Credentials
define('C2B_MPESA_CONSUMER_KEY', getenv('C2B_MPESA_CONSUMER_KEY'));
define('C2B_MPESA_CONSUMER_SECRET', getenv('C2B_MPESA_CONSUMER_SECRET'));
define('C2B_MPESA_SHORTCODE', getenv('C2B_MPESA_SHORTCODE'));
define('C2B_MPESA_PASSKEY', getenv('C2B_MPESA_PASSKEY'));

// C2B URLs (all using direct file paths)
define('C2B_MPESA_CONFIRMATION_URL', MPESA_BASE_URL . '/c2b_confirmation.php');
define('C2B_MPESA_VALIDATION_URL', MPESA_BASE_URL . '/c2b_validation.php');
define('C2B_CALLBACK_URL', MPESA_BASE_URL . '/c2b_callback.php');

// STK Push Callback URL - ADD THIS LINE
define('C2B_MPESA_STK_CALLBACK_URL', getenv('C2B_MPESA_STK_CALLBACK_URL') ?: MPESA_BASE_URL . '/stk_callback.php');


// Ledger Configuration
define('C2B_MPESA_LEDGER_ID', getenv('C2B_MPESA_LEDGER_ID'));
define('C2B_MPESA_LEDGER_CODE', getenv('C2B_MPESA_LEDGER_CODE'));

// Logging
define(
    'C2B_MPESA_LOG_FILE',
    dirname(__DIR__) . getenv('C2B_MPESA_LOG_FILE')
);
