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 b1532469 authored by attilak's avatar attilak

Add storeId as a parameter in the get origin keys client initialization

parent f7a15e90
...@@ -1229,7 +1229,8 @@ class Data extends AbstractHelper ...@@ -1229,7 +1229,8 @@ class Data extends AbstractHelper
if (!$originKey = $this->cache->load("Adyen_origin_key_for_" . $domain)) { if (!$originKey = $this->cache->load("Adyen_origin_key_for_" . $domain)) {
$originKey = ""; $originKey = "";
if ($originKey = $this->getOriginKeyForUrl($domain)) { $storeId = $this->storeManager->getStore()->getId();
if ($originKey = $this->getOriginKeyForUrl($domain, $storeId)) {
$this->cache->save($originKey, "Adyen_origin_key_for_" . $domain, array(), 60 * 60 * 24); $this->cache->save($originKey, "Adyen_origin_key_for_" . $domain, array(), 60 * 60 * 24);
} }
} }
...@@ -1241,10 +1242,11 @@ class Data extends AbstractHelper ...@@ -1241,10 +1242,11 @@ class Data extends AbstractHelper
* Get origin key for a specific url using the adyen api library client * Get origin key for a specific url using the adyen api library client
* *
* @param $url * @param $url
* @return mixed * @param int|null $storeId
* @return string
* @throws \Adyen\AdyenException * @throws \Adyen\AdyenException
*/ */
private function getOriginKeyForUrl($url) private function getOriginKeyForUrl($url, $storeId = null)
{ {
$params = array( $params = array(
"originDomains" => array( "originDomains" => array(
...@@ -1252,7 +1254,7 @@ class Data extends AbstractHelper ...@@ -1252,7 +1254,7 @@ class Data extends AbstractHelper
) )
); );
$client = $this->initializeAdyenClient(); $client = $this->initializeAdyenClient($storeId);
$service = $this->createAdyenCheckoutUtilityService($client); $service = $this->createAdyenCheckoutUtilityService($client);
$respone = $service->originKeys($params); $respone = $service->originKeys($params);
......
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