/** * List Registered Destinations * List all the destinations for the specified seller created by the developer. * * @param mixed $request array of parameters for MWSSubscriptionsService_Model_ListRegisteredDestinations request or MWSSubscriptionsService_Model_ListRegisteredDestinations object itself * @see MWSSubscriptionsService_Model_ListRegisteredDestinationsInput * @return MWSSubscriptionsService_Model_ListRegisteredDestinationsResponse * * @throws MWSSubscriptionsService_Exception */ public function listRegisteredDestinations($request) { if (!$request instanceof MWSSubscriptionsService_Model_ListRegisteredDestinationsInput) { require_once dirname(__FILE__) . '/Model/ListRegisteredDestinationsInput.php'; $request = new MWSSubscriptionsService_Model_ListRegisteredDestinationsInput($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'ListRegisteredDestinations'; $httpResponse = $this->_invoke($parameters); require_once dirname(__FILE__) . '/Model/ListRegisteredDestinationsResponse.php'; $response = MWSSubscriptionsService_Model_ListRegisteredDestinationsResponse::fromXML($httpResponse['ResponseBody']); $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']); return $response; }
* Uncomment to try out Mock Service that simulates MWSSubscriptionsService * responses without calling MWSSubscriptionsService service. * * Responses are loaded from local XML files. You can tweak XML files to * experiment with various outputs during development * * XML files available under MWSSubscriptionsService/Mock tree * ***********************************************************************/ // $service = new MWSSubscriptionsService_Mock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for List Registered Destinations Action ***********************************************************************/ // @TODO: set request. Action can be passed as MWSSubscriptionsService_Model_ListRegisteredDestinations $request = new MWSSubscriptionsService_Model_ListRegisteredDestinationsInput(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeListRegisteredDestinations($service, $request); /** * Get List Registered Destinations Action Sample * Gets competitive pricing and related information for a product identified by * the MarketplaceId and ASIN. * * @param MWSSubscriptionsService_Interface $service instance of MWSSubscriptionsService_Interface * @param mixed $request MWSSubscriptionsService_Model_ListRegisteredDestinations or array of parameters */ function invokeListRegisteredDestinations(MWSSubscriptionsService_Interface $service, $request) { try { $response = $service->ListRegisteredDestinations($request);
public function listDestinations() { $request = new \MWSSubscriptionsService_Model_ListRegisteredDestinationsInput(); $request->setSellerId($this->config->getMerchantId()); $request->setMarketplaceId($this->config->getMarketPlaceId()); $response = $this->service->ListRegisteredDestinations($request); /* @var \MWSSubscriptionsService_Model_ListRegisteredDestinationsResult $result */ $result = $response->getListRegisteredDestinationsResult(); /* @var \MWSSubscriptionsService_Model_DestinationList $destinationsList */ $destinationsList = $result->getDestinationList(); /* @var \MWSSubscriptionsService_Model_Destination $destination */ $destinationArray = array(); foreach ($destinationsList->getmember() as $destination) { /* @var \MWSSubscriptionsService_Model_Destination $destination */ $destinationArray[] = $this->getDestinationLink($destination); } return $destinationArray; }