Compare commits

...

2 Commits

Author SHA1 Message Date
O K
bab4d43a44 improve orders message 2025-06-02 14:42:33 +03:00
O K
8194e18e85 fixed PS version compability 2025-06-02 14:36:03 +03:00
2 changed files with 8 additions and 7 deletions

View File

@@ -71,6 +71,7 @@ class HutkoCallbackModuleFrontController extends ModuleFrontController
$amountFloat = round($callbackAmount / 100, 2); $amountFloat = round($callbackAmount / 100, 2);
$order->addOrderPayment($amountFloat, $this->module->displayName, $calbackContent['order_id'], $this->context->currency); $order->addOrderPayment($amountFloat, $this->module->displayName, $calbackContent['order_id'], $this->context->currency);
$order->setCurrentState($expectedState); $order->setCurrentState($expectedState);
$this->module->addOrderMessage($order, $this->trans('Pay via Hutko: ', [], 'Modules.Hutko.Admin') . ' ' . $calbackContent['currency'] . $amountFloat);
} }
} }
exit('OK'); exit('OK');

View File

@@ -44,7 +44,7 @@ class Hutko extends PaymentModule
{ {
$this->name = 'hutko'; $this->name = 'hutko';
$this->tab = 'payments_gateways'; $this->tab = 'payments_gateways';
$this->version = '1.2.0'; $this->version = '1.3.0';
$this->author = 'Hutko'; $this->author = 'Hutko';
$this->bootstrap = true; $this->bootstrap = true;
parent::__construct(); parent::__construct();
@@ -68,13 +68,13 @@ class Hutko extends PaymentModule
// We only need to check if the *required* hook for this version was successfully registered. // We only need to check if the *required* hook for this version was successfully registered.
$conditionalHookSuccess = true; // Assume success until we try to register one and it fails $conditionalHookSuccess = true; // Assume success until we try to register one and it fails
// Check if PrestaShop version is 1.7.x (>= 1.7 and < 8.0) // Check if PrestaShop version is 1.7.x (>= 1.7 and < 1.7.7)
if (version_compare(_PS_VERSION_, '1.7', '>=') && version_compare(_PS_VERSION_, '8.0', '<')) { if (version_compare(_PS_VERSION_, '1.7', '>=') && version_compare(_PS_VERSION_, '1.7.7', '<')) {
// Register the 1.7 hook // Register the 1.7 hook
$conditionalHookSuccess = $this->registerHook('displayAdminOrderContentOrder'); $conditionalHookSuccess = $this->registerHook('displayAdminOrderContentOrder');
} }
// Check if PrestaShop version is 8.x or 9.x (>= 8.0 and < 10.0) // Check if PrestaShop version is 1.7.7 or 9.x (>= 1.7.7 and < 10.0)
elseif (version_compare(_PS_VERSION_, '8.0', '>=') && version_compare(_PS_VERSION_, '10.0', '<')) { elseif (version_compare(_PS_VERSION_, '1.7.7', '>=') && version_compare(_PS_VERSION_, '10.0', '<')) {
// Register the 8.x/9.x hook // Register the 8.x/9.x hook
$conditionalHookSuccess = $this->registerHook('displayAdminOrderTabContent'); $conditionalHookSuccess = $this->registerHook('displayAdminOrderTabContent');
} }
@@ -969,7 +969,7 @@ class Hutko extends PaymentModule
} }
$amountFloat = round((int)$response['response']['reversal_amount'] / 100, 2); $amountFloat = round((int)$response['response']['reversal_amount'] / 100, 2);
$this->addOrderMessage($order, $this->trans('Refund success.', [], 'Modules.Hutko.Admin') . ' ' . $currency->iso_code . $amountFloat); $this->addOrderMessage($order, $this->trans('Refund success.', [], 'Modules.Hutko.Admin') . ' ' . $currency->iso_code . $amountFloat . '. [' . $comment . ']');
$order->addOrderPayment($amountFloat, $this->displayName, $orderPayment->transaction_id . '_refund', $currency); $order->addOrderPayment($amountFloat, $this->displayName, $orderPayment->transaction_id . '_refund', $currency);
$order->setCurrentState((int)Configuration::get('PS_OS_REFUND')); $order->setCurrentState((int)Configuration::get('PS_OS_REFUND'));