<?php

defined( 'ABSPATH' ) || exit;

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
// -- Justification: T4A_ (Twint4All) is the historical, stable prefix of this
// plugin used across ~60 constants and dozens of files since 1.0.0. Renaming
// to PAY4ALL_TWINT_* would touch every consumer for zero user-facing benefit
// and no realistic collision risk (no other plugin uses T4A_).

//define( 'T4A_DEBUG', false );

use Twnt4All\Engine\EnvironmentConfig;

define( 'T4A_LOGGER_CLASS', 'Twnt4All\\Engine\\Adapter\\DirectLogger' );
define( 'T4A_REST_HELPER_CLASS', 'Twnt4All\\Engine\\Adapter\\RestClient' );
define( 'T4A_MAILER_CLASS', 'Twnt4All\\Engine\\Adapter\\DirectMailer' );
define( 'T4A_DB_LOCK_CLASS', 'Twnt4All\\Support\\WooOrderLock' );

define( 'T4A_TIMEOUT', 180 );
define( 'T4A_SOAP_INTERVAL', 2 );
define( 'T4A_LOCKFILES_LOCATION', EnvironmentConfig::get_locks_dir() );
//define( 'T4A_OPENSSL_ACTIVE', extension_loaded( 'openssl' ) );

// Historical filename kept for backward-compat only. New installs mint
// a random per-site name via EnvironmentConfig::get_certificate_filename().
define( 'T4A_CERTIFICATE_NAME', 'twint.pem' );
define( 'T4A_CASHREGISTER_ID', EnvironmentConfig::get_cash_register_id() );
// Resolved at boot to whatever the current file is (legacy `twint.pem`
// on pre-existing installs, random `[a-f0-9]{48}.pem` after any re-save).
define( 'T4A_CERTIFICATE_PATH', EnvironmentConfig::get_certificate_file_path() );
define( 'T4A_CERTIFICATE_PASS', EnvironmentConfig::get_certificate_password() );
define( 'T4A_MERCHANT_UUID', EnvironmentConfig::get_merchant_uuid() );
define( 'T4A_CONNECTION_TIMEOUT', EnvironmentConfig::get_connection_timeout() );
define( 'T4A_MAX_LOCK_TIME', 120 ); // seconds
define( 'T4A_MAX_EXEC_TIME', 30 );

define( 'T4A_PROXY_HOST', get_option( 't4a_twint_settings_prget_optionoxyhost' ) );
define( 'T4A_PROXY_PORT', get_option( 't4a_twint_settings_proxyport' ) );

define( 'T4A_TWINT_PM_PAGE', true );