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 815628af authored by Alessio Zampatti's avatar Alessio Zampatti Committed by GitHub

Merge pull request #428 from Adyen/storeid_fix

PW-1200: Always pass storeid to initializeAdyenClient when available 
parents 96bee34c d9bbd3e7
...@@ -50,13 +50,11 @@ class TransactionAuthorization implements ClientInterface ...@@ -50,13 +50,11 @@ class TransactionAuthorization implements ClientInterface
\Magento\Framework\Model\Context $context, \Magento\Framework\Model\Context $context,
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
......
...@@ -37,7 +37,6 @@ class TransactionCancel implements ClientInterface ...@@ -37,7 +37,6 @@ class TransactionCancel implements ClientInterface
* @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType * @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data * @param array $data
*/ */
...@@ -45,13 +44,11 @@ class TransactionCancel implements ClientInterface ...@@ -45,13 +44,11 @@ class TransactionCancel implements ClientInterface
\Magento\Framework\Model\Context $context, \Magento\Framework\Model\Context $context,
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
......
...@@ -55,7 +55,6 @@ class TransactionPayment implements ClientInterface ...@@ -55,7 +55,6 @@ class TransactionPayment implements ClientInterface
public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject) public function placeRequest(\Magento\Payment\Gateway\Http\TransferInterface $transferObject)
{ {
$request = $transferObject->getBody(); $request = $transferObject->getBody();
$client = $this->adyenHelper->initializeAdyenClient(); $client = $this->adyenHelper->initializeAdyenClient();
$service = new \Adyen\Service\Checkout($client); $service = new \Adyen\Service\Checkout($client);
......
...@@ -37,7 +37,6 @@ class TransactionRefund implements ClientInterface ...@@ -37,7 +37,6 @@ class TransactionRefund implements ClientInterface
* @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper * @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param \Adyen\Payment\Model\RecurringType $recurringType * @param \Adyen\Payment\Model\RecurringType $recurringType
* @param array $data * @param array $data
*/ */
...@@ -45,13 +44,11 @@ class TransactionRefund implements ClientInterface ...@@ -45,13 +44,11 @@ class TransactionRefund implements ClientInterface
\Magento\Framework\Model\Context $context, \Magento\Framework\Model\Context $context,
\Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Adyen\Payment\Model\RecurringType $recurringType, \Adyen\Payment\Model\RecurringType $recurringType,
array $data = [] array $data = []
) { ) {
$this->_encryptor = $encryptor; $this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_recurringType = $recurringType; $this->_recurringType = $recurringType;
$this->_appState = $context->getAppState(); $this->_appState = $context->getAppState();
......
...@@ -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