removed debug log
This commit is contained in:
3
cb.jsonl
3
cb.jsonl
@@ -1,3 +0,0 @@
|
|||||||
{"rrn":"029650316530","masked_card":"444455XXXXXX1111","sender_cell_phone":"","sender_account":"","currency":"UAH","fee":"","reversal_amount":"0","settlement_amount":"0","actual_amount":"7133","response_description":"","sender_email":"panariga@gmail.com","order_status":"approved","response_status":"success","order_time":"02.06.2025 08:55:25","actual_currency":"UAH","order_id":"15#1748843725","tran_type":"purchase","eci":"5","settlement_date":"","payment_system":"card","approval_code":"013197","merchant_id":1700002,"settlement_currency":"","payment_id":100006586,"card_bin":444455,"response_code":"","card_type":"VISA","amount":"7133","signature":"b206a00794701fbc120c6f8b8433a4d9b6a09da2","product_id":"","merchant_data":"","rectoken":"","rectoken_lifetime":"","verification_status":"","parent_order_id":"","additional_info":"{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006502, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_test\": true}","response_signature_string":"**********|7133|UAH|{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006502, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_**********\": true}|7133|013197|444455|VISA|UAH|5|444455XXXXXX1111|1700002|15#1748843725|approved|02.06.2025 08:55:25|100006586|card|success|0|029650316530|panariga@gmail.com|0|purchase"}
|
|
||||||
{"rrn":"029650316530","masked_card":"444455XXXXXX1111","sender_cell_phone":"","sender_account":"","currency":"UAH","fee":"","reversal_amount":"1000","settlement_amount":"0","actual_amount":"7133","response_description":"","sender_email":"panariga@gmail.com","order_status":"approved","response_status":"success","order_time":"02.06.2025 08:55:25","actual_currency":"UAH","order_id":"15#1748843725","tran_type":"purchase","eci":"5","settlement_date":"","payment_system":"card","approval_code":"013197","merchant_id":1700002,"settlement_currency":"","payment_id":100006586,"card_bin":444455,"response_code":"","card_type":"VISA","amount":"7133","signature":"e0b1f119d57de3542f632b84e41e2c35c526ba05","product_id":"","merchant_data":"","rectoken":"","rectoken_lifetime":"","verification_status":"","parent_order_id":"","additional_info":"{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006504, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_test\": true}","response_signature_string":"**********|7133|UAH|{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006504, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_**********\": true}|7133|013197|444455|VISA|UAH|5|444455XXXXXX1111|1700002|15#1748843725|approved|02.06.2025 08:55:25|100006586|card|success|1000|029650316530|panariga@gmail.com|0|purchase"}
|
|
||||||
{"rrn":"029650316530","masked_card":"444455XXXXXX1111","sender_cell_phone":"","sender_account":"","currency":"UAH","fee":"","reversal_amount":"1500","settlement_amount":"0","actual_amount":"7133","response_description":"","sender_email":"panariga@gmail.com","order_status":"approved","response_status":"success","order_time":"02.06.2025 08:55:25","actual_currency":"UAH","order_id":"15#1748843725","tran_type":"purchase","eci":"5","settlement_date":"","payment_system":"card","approval_code":"013197","merchant_id":1700002,"settlement_currency":"","payment_id":100006586,"card_bin":444455,"response_code":"","card_type":"VISA","amount":"7133","signature":"321a0ba0c767b2951869cca1264a8acf5937b139","product_id":"","merchant_data":"","rectoken":"","rectoken_lifetime":"","verification_status":"","parent_order_id":"","additional_info":"{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006506, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_test\": true}","response_signature_string":"**********|7133|UAH|{\"capture_status\": null, \"capture_amount\": null, \"reservation_data\": \"{\\\"cms_name\\\": \\\"Prestashop\\\", \\\"cms_version\\\": \\\"8.2.1\\\", \\\"shop_domain\\\": \\\"ps8.panariga.com\\\", \\\"path\\\": \\\"https:\/\/ps8.panariga.com\/module\/hutko\/redirect\\\", \\\"phonemobile\\\": \\\"0670670670\\\", \\\"customer_country\\\": \\\"Ukrayina\\\", \\\"customer_state\\\": \\\"\\\", \\\"customer_name\\\": \\\"ok ok\\\", \\\"customer_city\\\": \\\"Kyiv\\\", \\\"customer_zip\\\": \\\"01011\\\", \\\"account\\\": \\\"3\\\", \\\"uuid\\\": \\\"61424bf8fa3296d92b199ca86a4b6536bdbfafb55ae59d0ac12262c6dae3e9e9\\\", \\\"products\\\": [{\\\"id\\\": \\\"2_9_0\\\", \\\"name\\\": \\\"Hummingbird printed sweater (\\\\u0420\\\\u043e\\\\u0437\\\\u043c\\\\u0456\\\\u0440: S)\\\", \\\"price\\\": 34.46, \\\"total_amount\\\": 68.93, \\\"quantity\\\": 2}, {\\\"id\\\": \\\"\\\\u041a\\\\u043e\\\\u0434 \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"name\\\": \\\"\\\\u041d\\\\u0430\\\\u0437\\\\u0432\\\\u0430 \\\\u0434\\\\u043b\\\\u044f \\\\u0434\\\\u043e\\\\u0441\\\\u0442\\\\u0430\\\\u0432\\\\u043a\\\\u0438\\\", \\\"price\\\": 2.4, \\\"total_amount\\\": 2.4, \\\"quantity\\\": 1}]}\", \"transaction_id\": 500006506, \"bank_response_code\": null, \"bank_response_description\": null, \"client_fee\": 0.0, \"settlement_fee\": 0.0, \"bank_name\": null, \"bank_country\": null, \"card_type\": \"VISA\", \"card_product\": \"empty_visa\", \"card_category\": \"\", \"timeend\": \"02.06.2025 08:55:31\", \"ipaddress_v4\": \"178.159.232.12\", \"payment_method\": \"card\", \"is_**********\": true}|7133|013197|444455|VISA|UAH|5|444455XXXXXX1111|1700002|15#1748843725|approved|02.06.2025 08:55:25|100006586|card|success|1500|029650316530|panariga@gmail.com|0|purchase"}
|
|
||||||
94
hutko.php
94
hutko.php
@@ -36,7 +36,8 @@ class Hutko extends PaymentModule
|
|||||||
'HUTKO_NEW_ORDER_STATUS_ID',
|
'HUTKO_NEW_ORDER_STATUS_ID',
|
||||||
'HUTKO_SUCCESS_STATUS_ID',
|
'HUTKO_SUCCESS_STATUS_ID',
|
||||||
'HUTKO_SHOW_CARDS_LOGO',
|
'HUTKO_SHOW_CARDS_LOGO',
|
||||||
'HUTKO_SAVE_LOGS'
|
'HUTKO_SAVE_LOGS',
|
||||||
|
'HUTKO_INCLUDE_DISCOUNT_TO_TOTAL'
|
||||||
];
|
];
|
||||||
public $postErrors = [];
|
public $postErrors = [];
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ class Hutko extends PaymentModule
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the configuration form
|
* Load the configuration form
|
||||||
@@ -119,7 +121,7 @@ class Hutko extends PaymentModule
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $err . $this->renderForm();
|
return $err . $this->renderForm() . $this->context->smarty->fetch('module:hutko/views/templates/admin/help.tpl').$this->displayLastDayLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -260,6 +262,24 @@ class Hutko extends PaymentModule
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->trans('Include fixed amount discounts to Payment amount calculation', array(), 'Modules.Hutko.Admin'),
|
||||||
|
'name' => 'HUTKO_INCLUDE_DISCOUNT_TO_TOTAL',
|
||||||
|
'is_bool' => true,
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'include_discount_to_total',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => $this->trans('Yes', array(), 'Modules.Hutko.Admin')
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'discard_discount_to_total',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => $this->trans('No', array(), 'Modules.Hutko.Admin')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'type' => 'radio',
|
'type' => 'radio',
|
||||||
'label' => $this->trans('Save Logs', array(), 'Modules.Hutko.Admin'),
|
'label' => $this->trans('Save Logs', array(), 'Modules.Hutko.Admin'),
|
||||||
@@ -426,6 +446,11 @@ class Hutko extends PaymentModule
|
|||||||
$amount = $order->total_products_wt;
|
$amount = $order->total_products_wt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Configuration::get('HUTKO_INCLUDE_DISCOUNT_TO_TOTAL')) {
|
||||||
|
$amount -= $order->total_discounts_tax_incl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$amountInt = round($amount * 100);
|
$amountInt = round($amount * 100);
|
||||||
// 5. Get the currency ISO code of the current cart.
|
// 5. Get the currency ISO code of the current cart.
|
||||||
@@ -1221,7 +1246,72 @@ class Hutko extends PaymentModule
|
|||||||
$logger->setFilename($logdirectory . 'dayly.log');
|
$logger->setFilename($logdirectory . 'dayly.log');
|
||||||
$logger->logInfo($data);
|
$logger->logInfo($data);
|
||||||
}
|
}
|
||||||
|
public function displayLastDayLog()
|
||||||
|
{
|
||||||
|
$baseLogDir = _PS_ROOT_DIR_ . '/var/modules/' . $this->name . '/logs/';
|
||||||
|
$daysToCheck = 300; // How many recent days to check for logs
|
||||||
|
|
||||||
|
$latestLogFile = false;
|
||||||
|
$logDate = null;
|
||||||
|
|
||||||
|
// Find the latest log file by iterating backward from today
|
||||||
|
for ($i = 0; $i < $daysToCheck; $i++) {
|
||||||
|
// Use \DateTime for clarity as we might be in a different namespace
|
||||||
|
$date = new \DateTime("-$i days");
|
||||||
|
$year = $date->format("Y");
|
||||||
|
$month = $date->format("m");
|
||||||
|
$day = $date->format("d");
|
||||||
|
|
||||||
|
$potentialDir = $baseLogDir . $year . '/' . $month . '/' . $day . '/';
|
||||||
|
$potentialFile = $potentialDir . 'dayly.log';
|
||||||
|
|
||||||
|
if (is_dir($potentialDir) && file_exists($potentialFile)) {
|
||||||
|
$latestLogFile = $potentialFile;
|
||||||
|
$logDate = $date; // Store the date of the found log
|
||||||
|
break; // Found the latest one, stop searching
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prepare HTML output
|
||||||
|
$html = '<div class="panel">';
|
||||||
|
// Use translation function for the heading
|
||||||
|
$html .= '<div class="panel-heading"><i class="icon-align-left"></i> ' . $this->trans('Hutko Module Logs', [], 'Modules.Hutko.Admin') . '</div>';
|
||||||
|
$html .= '<div class="panel-body">';
|
||||||
|
|
||||||
|
if ($latestLogFile) {
|
||||||
|
// Add a heading indicating the date of the log file
|
||||||
|
$html .= '<h4>' . sprintf($this->trans('Log file for %s', [], 'Modules.Hutko.Admin'), $logDate->format("Y-m-d")) . '</h4>';
|
||||||
|
|
||||||
|
// Read the file line by line into an array
|
||||||
|
// FILE_IGNORE_NEW_LINES: removes the trailing newline character from each element
|
||||||
|
// FILE_SKIP_EMPTY_LINES: skips empty lines
|
||||||
|
$lines = file($latestLogFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
|
||||||
|
if ($lines !== false) { // Check if file() succeeded
|
||||||
|
if (empty($lines)) {
|
||||||
|
$html .= '<p>' . $this->trans('The log file is empty.', [], 'Modules.Hutko.Admin') . '</p>';
|
||||||
|
} else {
|
||||||
|
// Output each line wrapped in a <p> tag
|
||||||
|
foreach ($lines as $line) {
|
||||||
|
// Use htmlspecialchars to prevent HTML injection and display characters correctly
|
||||||
|
// Add word-wrap style for long lines
|
||||||
|
$html .= '<p style="word-wrap: break-word;">' . htmlspecialchars($line, ENT_QUOTES, 'UTF-8') . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Error reading the file
|
||||||
|
$html .= '<div class="alert alert-warning">' . $this->trans('Could not read the log file:', [], 'Modules.Hutko.Admin') . ' ' . $latestLogFile . '</div>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// No log file found in the specified range
|
||||||
|
$html .= '<div class="alert alert-info">' . sprintf($this->trans('No log file found in the last %d days.', [], 'Modules.Hutko.Admin'), $daysToCheck) . '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$html .= '</div>'; // End panel-body
|
||||||
|
$html .= '</div>'; // End panel
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL-safe encodes a string using a Base64-like approach.
|
* URL-safe encodes a string using a Base64-like approach.
|
||||||
|
|||||||
80
views/templates/admin/help.tpl
Normal file
80
views/templates/admin/help.tpl
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<div class="panel">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<i class="icon-dollar"></i> {l s='Hutko Payments & Refunds' d='Modules.Hutko.Admin'}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div class="container">
|
||||||
|
<h2>Ласкаво просимо до платіжної системи Hutko.</h2>
|
||||||
|
<p>Цей модуль забезпечує зручне прийняття платежів від клієнтів, фіскалізацію та обробку повернень
|
||||||
|
безпосередньо
|
||||||
|
у вашому магазині PrestaShop.</p>
|
||||||
|
<hr>
|
||||||
|
<p class="h3">Як це працює:</p>
|
||||||
|
<p>
|
||||||
|
При виборі Hutko як методу оплати, замовлення автоматично створюється в PrestaShop <strong>до</strong>
|
||||||
|
фактичної оплати. Це дозволяє зберегти дані клієнта та не втратити потенційні продажі.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
У деталях цього замовлення автоматично додається запис про платіж із сумою 0. Цей запис містить
|
||||||
|
унікальний
|
||||||
|
<strong>ідентифікатор транзакції</strong>, який може бути корисним при зверненні до служби підтримки
|
||||||
|
Hutko.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
У деталях цього нульового платежу ви також знайдете <strong>посилання на сторінку оплати</strong>, яке
|
||||||
|
було
|
||||||
|
запропоновано клієнту. Це посилання можна використати, наприклад, для повторного надсилання клієнту.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p class="h3">Вартість доставки:</p>
|
||||||
|
<p>
|
||||||
|
Ви можете включити вартість доставки до суми платежу, або отримувати оплати лише за товари.
|
||||||
|
</p>
|
||||||
|
<p class="alert alert-warning">
|
||||||
|
<strong>Важливо:</strong> Платники єдиного податку
|
||||||
|
<strong>не мають права надавати послуги пошти</strong>. Проконсультуйтеся с бухгалтером та юристом щодо зазначення правильної назви послуги/товару.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p class="h3">Обробка повернень:</p>
|
||||||
|
<p>
|
||||||
|
Для зручного керування платежами, пов'язаними з Hutko, на сторінці замовлення доступний спеціальний
|
||||||
|
блок.
|
||||||
|
Через нього ви можете швидко оформити повне або часткове повернення коштів клієнту.
|
||||||
|
</p>
|
||||||
|
<p class="alert alert-warning">
|
||||||
|
<strong>Важливо:</strong> Фіскалізацію операцій повернення коштів необхідно проводити
|
||||||
|
<strong>самостійно</strong>. Система Hutko не здійснює автоматичну фіскалізацію повернень.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<p class="h3">Важливі примітки:</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<strong>Відображення повернень у PrestaShop:</strong> Залежно від версії PrestaShop, повернення
|
||||||
|
коштів
|
||||||
|
може відображатися у списку платежів замовлення як від'ємна або навіть позитивна сума. <strong>Не
|
||||||
|
використовуйте</strong> ці дані у панелі PrestaShop як остаточне підтвердження фактичного
|
||||||
|
зарахування коштів на рахунок.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Обмеження фіскалізації Hutko:</strong> Наразі система Hutko не фіскалізує платежі, де сума
|
||||||
|
до
|
||||||
|
сплати відрізняється від суми вартості товарів у кошику (наприклад, купон на фіксовану суму).
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Налаштування обробки знижок:</strong> Модуль має опцію врахування купонів на фіксовану суму.
|
||||||
|
При її
|
||||||
|
активації до Hutko передається для оплати сума замовлення з урахуванням знижки по купону на
|
||||||
|
фіксовану
|
||||||
|
суму. Це перешкоджає фіскалізації операції.
|
||||||
|
За замовчуванням до Hutko передається для оплати вартість товарів (з урахуванням відсоткових знижок)
|
||||||
|
та вартість доставки (якщо не вимкнено у налаштуванні).
|
||||||
|
Відсоткові знижки, які безпосередньо змінюють ціну товару, враховуються завжди.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<hr>
|
||||||
|
<p><a class="btn btn-danger btn-block" href="https://hutko.org/uk/support/"
|
||||||
|
target="_blank">{l s='Hutko Support' d='Modules.Hutko.Admin'}</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user