6 Commits

Author SHA1 Message Date
21fec6bee3 Update install.xml 2026-06-09 14:59:53 +03:00
4bfc5535ee fixed double currency conversion in log 2026-06-09 14:50:14 +03:00
e555010cce double conversion fixed 2026-06-09 14:49:26 +03:00
49368507cc Update install.xml 2025-07-17 19:42:16 +03:00
c9d3cf5570 remove :void for PHP 7.0 compability 2025-07-17 19:40:35 +03:00
dcf5656dff remove :void for PHP 7.0 compability 2025-07-17 19:40:06 +03:00
3 changed files with 7 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<modification>
<name>Hutko Payment Gateway</name>
<code>f70d167190</code>
<version>1.0.1</version>
<version>1.0.3</version>
<author>Panariga/Hutko</author>
<link>https://hutko.org</link>
<description><![CDATA[Installs the Hutko Payment Gateway files. No core OpenCart files are modified by this particular OCMOD. Configuration is done via Extensions > Extensions > Payments.]]></description>

View File

@@ -344,7 +344,7 @@ class ControllerExtensionPaymentHutko extends Controller
if (isset($response['response']['reverse_status']) && $response['response']['reverse_status'] === 'approved' && isset($response['response']['response_status']) && $response['response']['response_status'] === 'success') {
$refund_amount_returned = round((int)$response['response']['reversal_amount'] / 100, 2);
$history_comment_text = sprintf($this->language->get('text_refund_success_comment'), $hutko_transaction_ref, $this->currency->format($refund_amount_returned, $order_info['currency_code'], $order_info['currency_value'], true), $comment);
$history_comment_text = sprintf($this->language->get('text_refund_success_comment'), $hutko_transaction_ref, $this->currency->format($refund_amount_returned, $order_info['currency_code'], 1.0, true), $comment);
$this->addOrderHistory($order_id, $this->config->get('payment_hutko_refunded_status_id'), $history_comment_text, true);
$json['success'] = $this->language->get('text_refund_success');
} else {

View File

@@ -143,7 +143,8 @@ class ControllerExtensionPaymentHutko extends Controller
if ($current_order_status_id != $target_status_id) {
$callbackAmount = $callbackContent['actual_amount'] ?? $callbackContent['amount'];
$amountFloat = round($callbackAmount / 100, 2);
$comment = $this->language->get('text_payment_approved') . " " . $this->currency->format($amountFloat, $callbackContent['currency'], '', false) . ". " . $comment_details;
// do not convert callback currency
$comment = $this->language->get('text_payment_approved') . " " . $this->currency->format($amountFloat, $callbackContent['currency'], 1.0, true) . ". " . $comment_details;
$this->model_checkout_order->addOrderHistory($order_id, $target_status_id, $comment, $notify_customer);
}
echo "OK"; // Hutko expects "OK" on success
@@ -204,6 +205,7 @@ class ControllerExtensionPaymentHutko extends Controller
$total_products += $product['total_amount'];
}
$total = (float)$order_info['total'];
$total_converted = (float)$this->currency->format($total, $order_info['currency_code'], $order_info['currency_value'], false);
$order_totals = $this->model_checkout_order->getOrderTotals($order_info['order_id']);
$total_shipping_cost = 0;
// we need update shipping cost only if shipping was not included in products array already
@@ -215,7 +217,7 @@ class ControllerExtensionPaymentHutko extends Controller
}
}
}
$total_discounts = $total - $total_shipping_cost - $total_products;
$total_discounts = $total_converted - $total_shipping_cost - $total_products;
if ($this->config->get('payment_hutko_include_discount_to_total')) {
$amount = $total_products + $total_discounts;
} else {
@@ -223,7 +225,7 @@ class ControllerExtensionPaymentHutko extends Controller
}
$amount_int = (int)round($this->currency->format($amount, $order_info['currency_code'], $order_info['currency_value'], false) * 100);
$amount_int = (int)round($amount * 100);
$data = [
'order_id' => $hutko_order_id,