diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aae2da..c7effdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### v2.3.3 от 18.02.2022 +* Исправлен баг при формировании второго чека +* Исправлен баг неверного определения версии при обновлении Joomla! до версии >4.0 +* Добавлена отправка письма при получении уведомления payment.waiting_for_capture + ### v2.3.2 от 14.02.2022 * Отключен способ оплаты Webmoney * Обноление SDK до версии 2.2.6 diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/JVersionDependenciesHelper.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/JVersionDependenciesHelper.php index c721a2f..732ec41 100644 --- a/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/JVersionDependenciesHelper.php +++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/JVersionDependenciesHelper.php @@ -12,7 +12,8 @@ class JVersionDependenciesHelper public function __construct() { $this->joomlaVersion = (version_compare(JVERSION, '3.0', '<') == 1) ? 2 : 3; - $this->joomlaVersion = (version_compare(JVERSION, '4.0', '<') == 1) ? $this->joomlaVersion : 4; + $this->joomlaVersion = + (version_compare(JVERSION, '4.0', '<') == 1) ? $this->joomlaVersion : 4; } /** @@ -46,7 +47,7 @@ public function getJsDate() */ public function getAddonTableObj() { - if (JVERSION == 4) { + if ($this->getJoomlaVersion() == 4) { $app = \JFactory::getApplication(); /** @var MVCFactoryInterface $factory */ diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/TransactionHelper.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/TransactionHelper.php index cb74c02..5e8d1c5 100644 --- a/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/TransactionHelper.php +++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Helpers/TransactionHelper.php @@ -263,6 +263,17 @@ private function processWaitingForCaptureNtfctn($pmConfigs, $order, $payment, $k $order->order_created = 1; $order->order_status = $onHoldStatus; $order->store(); + + $jshopConfig = \JSFactory::getConfig(); + + try { + if ($jshopConfig->send_order_email) { + $checkout->sendOrderEmail($order->order_id); + } + } catch (\Exception $exception) { + $this->logger->log('debug', $exception->getMessage()); + } + $checkout->changeStatusOrder($order->order_id, $onHoldStatus, 0); $this->orderHelper->saveOrderHistory( $order, diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php index f00fe11..1147630 100644 --- a/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php +++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php @@ -21,7 +21,7 @@ require_once JPATH_ROOT.'/components/com_jshopping/payments/pm_yoomoney_sbbol/SbbolException.php'; if (!defined(_JSHOP_YOO_VERSION)) { - define('_JSHOP_YOO_VERSION', '2.3.2'); + define('_JSHOP_YOO_VERSION', '2.3.3'); } diff --git a/src/components/com_jshopping/payments/pm_yoomoney/pm_yoomoney.php b/src/components/com_jshopping/payments/pm_yoomoney/pm_yoomoney.php index d78cf2a..fe76011 100644 --- a/src/components/com_jshopping/payments/pm_yoomoney/pm_yoomoney.php +++ b/src/components/com_jshopping/payments/pm_yoomoney/pm_yoomoney.php @@ -29,7 +29,7 @@ require_once dirname(__FILE__).'/lib/autoload.php'; -define('_JSHOP_YOO_VERSION', '2.3.2'); +define('_JSHOP_YOO_VERSION', '2.3.3'); class pm_yoomoney extends PaymentRoot { diff --git a/src/plugins/jshoppingadmin/pm_yoomoney/pm_yoomoney.php b/src/plugins/jshoppingadmin/pm_yoomoney/pm_yoomoney.php index 7910879..5188f34 100644 --- a/src/plugins/jshoppingadmin/pm_yoomoney/pm_yoomoney.php +++ b/src/plugins/jshoppingadmin/pm_yoomoney/pm_yoomoney.php @@ -36,7 +36,7 @@ public function onBeforeChangeOrderStatusAdmin($order_id, &$status) $pm_yoomoney = new pm_yoomoney(); $kassa = $pm_yoomoney->getKassaPaymentMethod($pmconfig); - $pm_yoomoney->sendSecondReceipt($order_id, $pmconfig, $status); + $pm_yoomoney->sendSecondReceipt($order_id, $kassa, $status); if (!$kassa->isEnableHoldMode()) { return; @@ -90,7 +90,7 @@ public function onBeforeChangeOrderStatusAdmin($order_id, &$status) $pm_yoomoney->saveOrderHistory($order, _JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS); - $pm_yoomoney->sendSecondReceipt($order_id, $pmconfig, $completeStatus); + $pm_yoomoney->sendSecondReceipt($order_id, $kassa, $completeStatus); } diff --git a/yoomoney-cms-joomshopping.zip b/yoomoney-cms-joomshopping.zip index c5f8f86..bd97a0c 100644 Binary files a/yoomoney-cms-joomshopping.zip and b/yoomoney-cms-joomshopping.zip differ