fix typos
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user