protected function buildRequestInstance() { $request = parent::buildRequestInstance(); $requestData = $request->getData(); if (!is_null($this->marketplace)) { $requestData['marketplace'] = $this->marketplace->getNativeId(); } if (!is_null($this->account)) { $requestData['account'] = $this->account->getChildObject()->getServerHash(); } $request->setData($requestData); return $request; }
protected function receiveFromAmazon(\Ess\M2ePro\Model\Marketplace $marketplace) { $dispatcherObj = $this->modelFactory->getObject('Amazon\\Connector\\Dispatcher'); $connectorObj = $dispatcherObj->getVirtualConnector('marketplace', 'get', 'info', array('include_details' => true, 'marketplace' => $marketplace->getNativeId()), 'info', NULL); $dispatcherObj->process($connectorObj); $details = $connectorObj->getResponseData(); if (is_null($details)) { return array(); } $details['details']['last_update'] = $details['last_update']; return $details['details']; }
protected function receiveFromAmazon(\Ess\M2ePro\Model\Marketplace $marketplace, $partNumber) { $dispatcherObject = $this->modelFactory->getObject('Amazon\\Connector\\Dispatcher'); $connectorObj = $dispatcherObject->getVirtualConnector('marketplace', 'get', 'specifics', array('part_number' => $partNumber, 'marketplace' => $marketplace->getNativeId())); $dispatcherObject->process($connectorObj); $response = $connectorObj->getResponseData(); if (is_null($response) || empty($response['data'])) { $response = array(); } $dataCount = isset($response['data']) ? count($response['data']) : 0; $this->getActualOperationHistory()->addText("Total received specifics from Amazon: {$dataCount}"); return $response; }