diff --git a/Block/CustomLogo.php b/Block/CustomLogo.php deleted file mode 100644 index ac33080..0000000 --- a/Block/CustomLogo.php +++ /dev/null @@ -1,66 +0,0 @@ -_storeManager = $storeManager; - $this->_urlInterface = $urlInterface; - $this->moduleReader = $moduleReader; - $this->scopeConfig = $scopeConfig; - parent::__construct($context, $data); - } - - /** - * @return bool - */ - public function getShowLogo(): bool - { - return $this->scopeConfig->isSetFlag( - static::CUSTOM_LOGO_SHOW, - ScopeInterface::SCOPE_STORE - ); - } -} diff --git a/Controller/Standard/PaymentCreated.php b/Controller/Standard/PaymentCreated.php index 350a98f..129532d 100644 --- a/Controller/Standard/PaymentCreated.php +++ b/Controller/Standard/PaymentCreated.php @@ -40,36 +40,39 @@ public function execute() if (!in_array($params['type'], self::ALLOWED_WEBHOOK_TYPES)) { $result->setContents('invalid_webhook_type'); + + return $result; } - $order = $this->fintectureHelper->getOrderBySessionId($params['sessionId']); + $isRefund = !empty($params['refundedSessionId']); + + $sessionId = $isRefund ? $params['refundedSessionId'] : $params['sessionId']; + + $order = $this->fintectureHelper->getOrderBySessionId($sessionId); if (!$order) { $this->fintectureLogger->error('Webhook', [ 'message' => 'No order found', 'state' => $params['state'], 'status' => $params['status'], - 'sessionId' => $params['sessionId'], + 'sessionId' => $sessionId, ]); - $result->setHttpResponseCode(400); $result->setContents('invalid_order'); return $result; } try { - $isRefund = !empty($params['refundedSessionId']); if ($isRefund) { $decodedState = json_decode(base64_decode($params['state'])); if (property_exists($decodedState, 'creditmemo_transaction_id')) { return $this->refund($order, $params['status'], $decodedState->creditmemo_transaction_id); } else { $this->fintectureLogger->error('Webhook', [ - 'message' => 'No order found', + 'message' => 'No credit memo id found', 'state' => $params['state'], 'status' => $params['status'], 'sessionId' => $params['sessionId'], ]); - $result->setHttpResponseCode(400); $result->setContents('invalid_refund'); } } else { @@ -184,7 +187,6 @@ private function refund(Order $order, string $status, string $creditmemoTransact $result->setContents('refund_not_applied'); } } else { - $result->setHttpResponseCode(400); $result->setContents('invalid_refund_status'); } diff --git a/Gateway/Config/Config.php b/Gateway/Config/Config.php index e2bed60..6bc29d4 100644 --- a/Gateway/Config/Config.php +++ b/Gateway/Config/Config.php @@ -7,7 +7,7 @@ class Config extends BaseConfig { const CODE = 'fintecture'; - const VERSION = '3.4.0'; + const VERSION = '3.4.1'; const KEY_SHOP_NAME = 'general/store_information/name'; const KEY_ACTIVE = 'active'; diff --git a/composer.json b/composer.json index 483de7b..7bc8ceb 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "email": "contact@fintecture.com" }, "type": "magento2-module", - "version": "3.4.0", + "version": "3.4.1", "license": [ "GPL-3.0" ], diff --git a/etc/module.xml b/etc/module.xml index 870df93..128eaef 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,7 +1,7 @@ - +