* Uncomment to try out Mock Service that simulates MarketplaceWebServiceProducts
 * responses without calling MarketplaceWebServiceProducts service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under MarketplaceWebServiceProducts/Mock tree
 *
 ***********************************************************************/
// $service = new MwsProductsMock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get My Price For SKU Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as GetMyPriceForSKU
$request = new GetMyPriceForSKURequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetMyPriceForSKU($service, $request);
/**
 * Get Get My Price For SKU Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param MwsProductsInterface $service instance of MwsProductsInterface
 * @param mixed                                   $request GetMyPriceForSKU or array of parameters
 */
function invokeGetMyPriceForSKU(MwsProductsInterface $service, $request)
{
    try {
        $response = $service->GetMyPriceForSKU($request);
Пример #2
0
 /**
  * Get My Price For SKU
  * <!-- Wrong doc in current code -->
  *
  * @param mixed $request array of parameters for GetMyPriceForSKU request or GetMyPriceForSKU object itself
  *
  * @see GetMyPriceForSKURequest
  * @return Model\GetMyPriceForSKUResponse
  *
  * @throws MwsProductsException
  */
 public function getMyPriceForSKU($request)
 {
     if (!$request instanceof Model\GetMyPriceForSKURequest) {
         $request = new Model\GetMyPriceForSKURequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetMyPriceForSKU';
     $httpResponse = $this->_invoke($parameters);
     $response = Model\GetMyPriceForSKUResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }