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 7e95d1ca authored by attilak's avatar attilak Committed by Rik ter Beek

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

parent d5f1bab2
......@@ -1373,7 +1373,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);
}
}
......@@ -1385,10 +1386,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(
......@@ -1396,7 +1398,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