fix typos

This commit is contained in:
O K
2025-12-14 12:42:04 +02:00
parent 16c44827c8
commit 514db47091
4 changed files with 3 additions and 126 deletions

View File

@@ -291,34 +291,7 @@ class Hutko extends \Opencart\System\Engine\Controller {
$this->response->setOutput(json_encode($json));
}
private function sign(array $data): string {
$key = $this->config->get('payment_hutko_secret_key');
$filtered = array_filter($data, function ($v) { return $v !== '' && $v !== null; });
ksort($filtered);
$str = $key;
foreach ($filtered as $v) $str .= '|' . $v;
return sha1($str);
}
private function api(string $url, array $data): array {
if ($this->config->get('payment_hutko_save_logs')) $this->logOC('Req: ' . json_encode($data));
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['request' => $data]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$res = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);
if ($this->config->get('payment_hutko_save_logs')) {
$this->logOC('Res: ' . $res);
if ($error) $this->logOC('CURL: ' . $error);
}
return json_decode($res, true) ?: [];
}
private function displayLastDayLog() {
if (!$this->config->get('payment_hutko_save_logs')) return $this->language->get('text_logs_disabled');