Update: 2026-06-16 02:52:06

This commit is contained in:
Hamza-Ayed
2026-06-16 02:52:06 +03:00
parent 2c657fa0b4
commit c0fe990ebe
11 changed files with 162 additions and 324 deletions

View File

@@ -90,7 +90,14 @@ try {
'jti' => bin2hex(random_bytes(16)),
];
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key_pay'));
$payKeyPath = getenv('WALLET_SECRET_KEY_PATH');
$secretKey = '';
if ($payKeyPath && file_exists($payKeyPath)) {
$secretKey = trim(file_get_contents($payKeyPath));
}
if (!$secretKey) {
$secretKey = getenv('WALLET_SECRET_KEY') ?: '';
}
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
$hmac = hash_hmac('sha256', $id, getenv('SECRET_KEY_HMAC'));