/** * Register Destination * Create a new destination. * * @param mixed $request array of parameters for MWSSubscriptionsService_Model_RegisterDestination request or MWSSubscriptionsService_Model_RegisterDestination object itself * @see MWSSubscriptionsService_Model_RegisterDestinationInput * @return MWSSubscriptionsService_Model_RegisterDestinationResponse * * @throws MWSSubscriptionsService_Exception */ public function registerDestination($request) { if (!$request instanceof MWSSubscriptionsService_Model_RegisterDestinationInput) { require_once dirname(__FILE__) . '/Model/RegisterDestinationInput.php'; $request = new MWSSubscriptionsService_Model_RegisterDestinationInput($request); } $parameters = $request->toQueryParameterArray(); $parameters['Action'] = 'RegisterDestination'; $httpResponse = $this->_invoke($parameters); require_once dirname(__FILE__) . '/Model/RegisterDestinationResponse.php'; $response = MWSSubscriptionsService_Model_RegisterDestinationResponse::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 Register Destination Action ***********************************************************************/ // @TODO: set request. Action can be passed as MWSSubscriptionsService_Model_RegisterDestination $request = new MWSSubscriptionsService_Model_RegisterDestinationInput(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeRegisterDestination($service, $request); /** * Get Register Destination 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_RegisterDestination or array of parameters */ function invokeRegisterDestination(MWSSubscriptionsService_Interface $service, $request) { try { $response = $service->RegisterDestination($request);
public function registerDestination($sqsUrl) { $request = new \MWSSubscriptionsService_Model_RegisterDestinationInput(); $request->setSellerId($this->config->getMerchantId()); $request->setMarketplaceId($this->config->getMarketPlaceId()); $destination = $this->createDestination($sqsUrl); $request->setDestination($destination); $response = $this->service->RegisterDestination($request); }