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