Skip to content

Commit

Permalink
Merge branch 'pr/342' into 1.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin-Magmodules committed Jan 19, 2021
2 parents 49f3a87 + 15ba539 commit ed5c396
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Service/Mollie/GetIssuers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\Framework\App\CacheInterface;
use Magento\Framework\Serialize\SerializerInterface;
use Magento\Framework\Locale\Resolver;
use Mollie\Api\MollieApiClient;
use Mollie\Payment\Model\Mollie as MollieModel;

Expand All @@ -30,14 +31,21 @@ class GetIssuers
*/
private $mollieModel;

/**
* @var Resolver
*/
private $resolver;

public function __construct(
CacheInterface $cache,
SerializerInterface $serializer,
MollieModel $mollieModel
MollieModel $mollieModel,
Resolver $resolver
) {
$this->cache = $cache;
$this->serializer = $serializer;
$this->mollieModel = $mollieModel;
$this->resolver = $resolver;
}

/**
Expand All @@ -48,7 +56,7 @@ public function __construct(
*/
public function execute(MollieApiClient $mollieApi, $method, $type)
{
$identifier = static::CACHE_IDENTIFIER_PREFIX . $method . $type;
$identifier = static::CACHE_IDENTIFIER_PREFIX . $method . $type . $this->resolver->getLocale();
$result = $this->cache->load($identifier);
if ($result) {
return $this->serializer->unserialize($result);
Expand Down

0 comments on commit ed5c396

Please sign in to comment.