Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21fec6bee3 | |||
| 4bfc5535ee | |||
| e555010cce | |||
| 49368507cc | |||
| c9d3cf5570 | |||
| dcf5656dff |
@@ -2,7 +2,7 @@
|
|||||||
<modification>
|
<modification>
|
||||||
<name>Hutko Payment Gateway</name>
|
<name>Hutko Payment Gateway</name>
|
||||||
<code>f70d167190</code>
|
<code>f70d167190</code>
|
||||||
<version>1.0.1</version>
|
<version>1.0.3</version>
|
||||||
<author>Panariga/Hutko</author>
|
<author>Panariga/Hutko</author>
|
||||||
<link>https://hutko.org</link>
|
<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>
|
<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>
|
||||||
|
|||||||
@@ -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') {
|
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);
|
$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);
|
$this->addOrderHistory($order_id, $this->config->get('payment_hutko_refunded_status_id'), $history_comment_text, true);
|
||||||
$json['success'] = $this->language->get('text_refund_success');
|
$json['success'] = $this->language->get('text_refund_success');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ class ControllerExtensionPaymentHutko extends Controller
|
|||||||
if ($current_order_status_id != $target_status_id) {
|
if ($current_order_status_id != $target_status_id) {
|
||||||
$callbackAmount = $callbackContent['actual_amount'] ?? $callbackContent['amount'];
|
$callbackAmount = $callbackContent['actual_amount'] ?? $callbackContent['amount'];
|
||||||
$amountFloat = round($callbackAmount / 100, 2);
|
$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);
|
$this->model_checkout_order->addOrderHistory($order_id, $target_status_id, $comment, $notify_customer);
|
||||||
}
|
}
|
||||||
echo "OK"; // Hutko expects "OK" on success
|
echo "OK"; // Hutko expects "OK" on success
|
||||||
@@ -204,6 +205,7 @@ class ControllerExtensionPaymentHutko extends Controller
|
|||||||
$total_products += $product['total_amount'];
|
$total_products += $product['total_amount'];
|
||||||
}
|
}
|
||||||
$total = (float)$order_info['total'];
|
$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']);
|
$order_totals = $this->model_checkout_order->getOrderTotals($order_info['order_id']);
|
||||||
$total_shipping_cost = 0;
|
$total_shipping_cost = 0;
|
||||||
// we need update shipping cost only if shipping was not included in products array already
|
// 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')) {
|
if ($this->config->get('payment_hutko_include_discount_to_total')) {
|
||||||
$amount = $total_products + $total_discounts;
|
$amount = $total_products + $total_discounts;
|
||||||
} else {
|
} 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 = [
|
$data = [
|
||||||
'order_id' => $hutko_order_id,
|
'order_id' => $hutko_order_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user