mapperFactory = $mapperFactory; } /** * Convert a Tax Quote Request into a string for caching * * @param RequestInterface $request * @param string|null $scopeCode Store ID * @param string $scopeType Scope Type * @return string * @throws \Vertex\Exception\ValidationException * @throws \Vertex\Exception\ConfigurationException */ public function generateCacheKey( RequestInterface $request, $scopeCode = null, $scopeType = ScopeInterface::SCOPE_STORE ) { /** @var QuoteRequestMapperInterface $mapper */ $mapper = $this->mapperFactory->getForClass(RequestInterface::class, $scopeCode, $scopeType); return sha1(json_encode($mapper->map($request))); } }