/** * @param CardInterface $cardInterface * @return bool * @throws LocalizedException */ public function delete(CardInterface $cardInterface) { $cardId = $cardInterface->getCardId(); $customerId = $cardInterface->getCustomerId(); try { $deleted = $this->cardAdapter->delete($customerId, $cardId); } catch (OpenpayException $e) { throw new LocalizedException(__($e->getDescription()), $e); } $cacheIdentifier = $this->getCacheIdentifier($customerId); $this->cache->remove($cacheIdentifier); return $deleted; }
/** * Set url class name for store 'admin' * * @param \Magento\Framework\Event\Observer $observer * @return $this */ public function setUrlClassName(\Magento\Framework\Event\Observer $observer) { /** @var $storeCollection \Magento\Store\Model\Resource\Store\Collection */ $storeCollection = $observer->getEvent()->getStoreCollection(); /** @var $store \Magento\Store\Model\Store */ foreach ($storeCollection as $store) { if ($store->getId() == 0) { $store->setUrlClassName('Magento\\Backend\\Model\\UrlInterface'); break; } } $this->cache->remove(\Magento\AdminNotification\Model\System\Message\Security::VERIFICATION_RESULT_CACHE_KEY); return $this; }
/** * @param string $openpayCustomerId * @return bool */ public function clearCustomerCache($openpayCustomerId) { $cacheIdentifier = $this->getCacheIdentifier($openpayCustomerId); return $this->cache->remove($cacheIdentifier); }