Switched to purely reading secret_key_pay via environment variables

This commit is contained in:
Hamza-Ayed
2026-04-28 13:45:55 +03:00
parent 1005bc11b8
commit 76d06a4140

View File

@@ -77,9 +77,8 @@ try {
'jti' => bin2hex(random_bytes(16)),
];
$secretKey = file_exists('/home/intaleq-api/.secret_key_pay')
? trim(file_get_contents('/home/intaleq-api/.secret_key_pay'))
: trim(file_get_contents('/home/intaleq-api/.secret_key'));
$keyPathPay = getenv('SECRET_KEY_PAY_PATH');
$secretKey = trim(file_get_contents($keyPathPay));
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
$hmac = hash_hmac('sha256', $id, getenv('SECRET_KEY_HMAC'));