fixed icon and status

This commit is contained in:
O K
2025-12-14 14:01:00 +02:00
parent 924e6a9fe0
commit d9f349db3b
3 changed files with 102 additions and 122 deletions

View File

@@ -9,7 +9,7 @@ class Hutko extends \Opencart\System\Engine\Controller {
return $this->load->view('extension/hutko/payment/hutko', ['language' => $this->config->get('config_language')]);
}
public function confirm(): void {
public function confirm(): void {
$this->load->language('extension/hutko/payment/hutko');
$this->load->model('checkout/order');
@@ -52,13 +52,20 @@ class Hutko extends \Opencart\System\Engine\Controller {
]
);
// FIX: Ensure status is not 0 (Voided). Default to 1 (Pending) if config is missing.
if ($order_info['order_status_id'] == 0) {
$this->model_checkout_order->addHistory($order_info['order_id'], $this->config->get('payment_hutko_new_order_status_id'), $this->language->get('text_initiated_payment'), false);
$new_status_id = (int)$this->config->get('payment_hutko_new_order_status_id');
if ($new_status_id <= 0) {
$new_status_id = 1; // Default to Pending
}
$this->model_checkout_order->addHistory($order_info['order_id'], $new_status_id, $this->language->get('text_initiated_payment'), false);
}
$json['redirect'] = $url;
} else {
$err = $response['response']['error_message'] ?? $this->language->get('error_api_communication');
// ... error handling (same as before) ...
$err = $response['response']['error_message'] ?? $this->language->get('error_api_communication');
$json['error'] = $err;
$this->model_extension_hutko_payment_hutko->logTransaction(
$order_info['order_id'],
@@ -77,7 +84,6 @@ class Hutko extends \Opencart\System\Engine\Controller {
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
public function callback(): void {
$this->load->language('extension/hutko/payment/hutko');