We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 0d06f645 authored by attilak's avatar attilak Committed by Rik ter Beek

Changes based on code review

parent 14b4cb63
......@@ -36,11 +36,6 @@ class APIKeyMessage implements \Magento\Framework\Notification\MessageInterface
*/
protected $_inboxFactory;
/**
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
protected $scopeConfigInterface;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
......@@ -58,18 +53,15 @@ class APIKeyMessage implements \Magento\Framework\Notification\MessageInterface
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Magento\AdminNotification\Model\InboxFactory $inboxFactory
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface
*/
public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\AdminNotification\Model\InboxFactory $inboxFactory,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
\Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
\Magento\Backend\Model\Auth\Session $authSession
) {
$this->_adyenHelper = $adyenHelper;
$this->_inboxFactory = $inboxFactory;
$this->scopeConfigInterface = $scopeConfigInterface;
$this->storeManagerInterface = $storeManagerInterface;
$this->authSession = $authSession;
}
......@@ -95,17 +87,12 @@ class APIKeyMessage implements \Magento\Framework\Notification\MessageInterface
if ($this->authSession->isFirstPageAfterLogin() && empty($this->_adyenHelper->getAPIKey())) {
try {
$title = "Adyen extension requires the API KEY!";
if (!empty($this->_adyenHelper->getWsUsername())) {
$description = "Please provide API-KEY for the webservice user " . $this->_adyenHelper->getWsUsername() . " for default/store " . $this->storeManagerInterface->getStore()->getName();
}else{
$description = "Please provide API-KEY for default/store " . $this->storeManagerInterface->getStore()->getName();
}
$messageData[] = array(
'severity' => $this->getSeverity(),
'date_added' => date("Y-m-d"),
'title' => $title,
'description' => $description,
'description' => $this->getText(),
'url' => "https://docs.adyen.com/developers/plug-ins-and-partners/magento-2/set-up-the-plugin-in-magento#step3configuretheplugininmagento",
);
......@@ -131,8 +118,13 @@ class APIKeyMessage implements \Magento\Framework\Notification\MessageInterface
*/
public function getText()
{
$message = __("Please provide API-KEY for the webserver user " . $this->_adyenHelper->getWsUsername() . " for default/store" . $this->storeManagerInterface->getStore()->getName());
return __($message);
if (!empty($this->_adyenHelper->getWsUsername())) {
$message = "Please provide API-KEY for the webservice user " . $this->_adyenHelper->getWsUsername() . " for default/store " . $this->storeManagerInterface->getStore()->getName();
}else{
$message = "Please provide API-KEY for default/store " . $this->storeManagerInterface->getStore()->getName();
}
return $message;
}
/**
......
......@@ -36,7 +36,6 @@ class TransactionPayment implements ClientInterface
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data
*/
......@@ -44,13 +43,11 @@ class TransactionPayment implements ClientInterface
\Magento\Framework\Model\Context $context,
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType,
array $data = []
) {
$this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType;
$this->_appState = $context->getAppState();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment