<?php

return [
    'environment' => env('GATEWAY_ENVIRONMENT', 'sandbox'),
    'blockchain_driver' => env('BLOCKCHAIN_DRIVER', 'disabled'),
    'tron' => ['node_url'=>env('TRON_NODE_URL'),'api_key'=>env('TRONGRID_API_KEY'),'signer_url'=>env('TRON_SIGNER_URL'),'signer_token'=>env('TRON_SIGNER_TOKEN'),'webhook_secret'=>env('TRON_WEBHOOK_SECRET'),'default_fee_atomic'=>env('TRON_DEFAULT_FEE_ATOMIC','1000000')],
    'clock_skew_seconds' => (int) env('GATEWAY_API_CLOCK_SKEW_SECONDS', 300),
    'nonce_ttl_seconds' => (int) env('GATEWAY_API_NONCE_TTL_SECONDS', 300),
    'checkout_url' => env('GATEWAY_CHECKOUT_URL', 'http://localhost:3000/pay'),
    'security' => [
        'payout_step_up_ttl_seconds' => (int) env('PAYOUT_STEP_UP_TTL_SECONDS', 300),
        'payout_daily_request_limit' => (int) env('PAYOUT_DAILY_REQUEST_LIMIT', 25),
        'allow_local_encryption_in_production' => (bool) env('GATEWAY_ALLOW_LOCAL_ENCRYPTION_IN_PRODUCTION', false),
        'metadata_max_bytes' => 8192,
        'metadata_max_depth' => 5,
    ],
    'observability' => [
        'stuck_confirmation_alert_minutes' => (int) env('STUCK_CONFIRMATION_ALERT_MINUTES', 60),
        'critical_queue_lag_seconds' => (int) env('CRITICAL_QUEUE_LAG_SECONDS', 30),
        'merchant_webhook_failure_threshold_percent' => (float) env('WEBHOOK_FAILURE_ALERT_PERCENT', 5),
    ],
    'processing_fee_bps' => (int) env('GATEWAY_PROCESSING_FEE_BPS', 50),
    'operator_emails' => env('GATEWAY_OPERATOR_EMAILS', ''),
    'webhooks' => [
        'max_attempts' => 7,
        'connect_timeout_seconds' => (int) env('WEBHOOK_CONNECT_TIMEOUT_SECONDS', 3),
        'read_timeout_seconds' => (int) env('WEBHOOK_READ_TIMEOUT_SECONDS', 10),
        'max_response_bytes' => (int) env('WEBHOOK_MAX_RESPONSE_BYTES', 65536),
    ],
    'rates' => [
        // No external rate API. For USDT/USD MVP use an operator-controlled fixed rate.
        'usdt_usd_rate' => env('GATEWAY_USDT_USD_RATE', '1.00000000'),
        'markup_bps' => (int) env('GATEWAY_RATE_MARKUP_BPS', 0),
        'ttl_seconds' => (int) env('GATEWAY_RATE_TTL_SECONDS', 60),
    ],
    'treasury' => [
        'collection_minimum_atomic' => env('TREASURY_COLLECTION_MINIMUM_ATOMIC', '1000000'),
        'auto_collection_enabled' => (bool) env('TREASURY_AUTO_COLLECTION_ENABLED', false),
        'collection_batch_limit' => (int) env('TREASURY_COLLECTION_BATCH_LIMIT', 25),
    ],
];

