objectManager = $objectManager; $this->coreHelper = $coreHelper; $this->instanceName = $instanceName; $this->logger = $logger; } /** * {@inheritDoc} */ public function create($scopeId = null, $scope = ScopeInterface::SCOPE_STORE) { $config = [ $this->coreHelper->getClientPath('secretkey') => $this->coreHelper->getSecretKey($scope, $scopeId), $this->coreHelper->getClientPath('accesskey') => $this->coreHelper->getAccessKey($scope, $scopeId), $this->coreHelper->getClientPath('merchantid') => $this->coreHelper->getMerchantId($scope, $scopeId), $this->coreHelper->getClientPath('amazonregion') => $this->coreHelper->getRegion($scope, $scopeId), $this->coreHelper->getClientPath('amazonsandbox') => $this->coreHelper->isSandboxEnabled($scope, $scopeId), $this->coreHelper->getClientPath('clientid') => $this->coreHelper->getClientId($scope, $scopeId) ]; $client = $this->objectManager->create($this->instanceName, ['amazonConfig' => $config]); if ($client instanceof LoggerAwareInterface && $this->coreHelper->isLoggingEnabled($scope, $scopeId)) { $client->setLogger($this->logger); } return $client; } }