/** * List or a single Asin * @param array|string $ASIN */ public function getCompetitivePriceForASIN($ASIN) { if (is_string($ASIN)) { $asinArray = array($ASIN); } else { if (is_array($ASIN)) { $asinArray = $ASIN; } else { return null; } } $asin_list = new \RaffW\MwsProductApi\Model\ASINListType(); $asin_list->setASIN($asinArray); //print_r($asin_list); $request = new \RaffW\MwsProductApi\Model\GetCompetitivePricingForASINRequest(); $request->setSellerId($this->config->getMerchantId()); $request->setMarketplaceId($this->config->getMarketPlaceId()); $request->setASINList($asin_list); $response = $this->service->GetCompetitivePricingForASIN($request); $dom = new \DOMDocument(); $dom->loadXML($response->toXML()); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; echo $dom->saveXML(); var_dump($response->getGetCompetitivePricingForASINResult()); }
/** * @param ReportListItem $report * @return string */ public function getReport(ReportListItem $report) { $request = new \MarketplaceWebService_Model_GetReportRequest(); $request->setReport(@fopen('php://memory', 'rw+')); $request->setReportId($report->getReportId()); $request->setMerchant($this->config->getMerchantId()); $request->setMarketplace($this->config->getMarketPlaceId()); $this->service->getReport($request); $reportData = stream_get_contents($request->getReport()); return $reportData; }
public function sendTestMessageToDestination($sqsUrl) { $request = new \MWSSubscriptionsService_Model_SendTestNotificationToDestinationInput(); $request->setSellerId($this->config->getMerchantId()); $request->setMarketplaceId($this->config->getMarketPlaceId()); $request->setDestination($this->createDestination($sqsUrl)); $response = $this->service->SendTestNotificationToDestination($request); return $response; }