We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 0433c8c9 authored by alessio's avatar alessio

add storeid to helper

parent 78c71646
...@@ -51,7 +51,6 @@ class TransactionAuthorization implements ClientInterface ...@@ -51,7 +51,6 @@ class TransactionAuthorization implements ClientInterface
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
...@@ -59,8 +58,7 @@ class TransactionAuthorization implements ClientInterface ...@@ -59,8 +58,7 @@ class TransactionAuthorization implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$storeId = $storeManager->getStore()->getId(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
$this->_client = $this->_adyenHelper->initializeAdyenClient($storeId);
} }
/** /**
......
...@@ -45,15 +45,14 @@ class TransactionCancel implements ClientInterface ...@@ -45,15 +45,14 @@ class TransactionCancel implements ClientInterface
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$storeId = $storeManager->getStore()->getId();
$this->_client = $this->_adyenHelper->initializeAdyenClient($storeId); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
......
...@@ -47,7 +47,6 @@ class TransactionCapture implements ClientInterface ...@@ -47,7 +47,6 @@ class TransactionCapture implements ClientInterface
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
...@@ -55,8 +54,8 @@ class TransactionCapture implements ClientInterface ...@@ -55,8 +54,8 @@ class TransactionCapture implements ClientInterface
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$storeId = $storeManager->getStore()->getId();
$this->_client = $this->_adyenHelper->initializeAdyenClient($storeId); $this->_client = $this->_adyenHelper->initializeAdyenClient();
} }
/** /**
......
...@@ -46,8 +46,6 @@ class TransactionPayment implements ClientInterface ...@@ -46,8 +46,6 @@ class TransactionPayment implements ClientInterface
\Magento\Store\Model\StoreManagerInterface $storeManager \Magento\Store\Model\StoreManagerInterface $storeManager
) { ) {
$this->adyenHelper = $adyenHelper; $this->adyenHelper = $adyenHelper;
$storeId = $storeManager->getStore()->getId();
$this->_client = $this->adyenHelper->initializeAdyenClient($storeId);
} }
/** /**
......
...@@ -45,7 +45,6 @@ class TransactionRefund implements ClientInterface ...@@ -45,7 +45,6 @@ class TransactionRefund implements ClientInterface
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
...@@ -53,8 +52,7 @@ class TransactionRefund implements ClientInterface ...@@ -53,8 +52,7 @@ class TransactionRefund implements ClientInterface
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
$storeId = $storeManager->getStore()->getId(); $this->_client = $this->_adyenHelper->initializeAdyenClient();
$this->_client = $this->_adyenHelper->initializeAdyenClient($storeId);
} }
/** /**
......
...@@ -1343,6 +1343,10 @@ class Data extends AbstractHelper ...@@ -1343,6 +1343,10 @@ class Data extends AbstractHelper
public function initializeAdyenClient($storeId = null, $apiKey = null) public function initializeAdyenClient($storeId = null, $apiKey = null)
{ {
// initialize client // initialize client
if (empty($storeId)) {
$storeId = $this->storeManager->getStore()->getId();
}
if (empty($apiKey)) { if (empty($apiKey)) {
$apiKey = $this->getAPIKey($storeId); $apiKey = $this->getAPIKey($storeId);
} }
......
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