* 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 Update Subscription Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MWSSubscriptionsService_Model_UpdateSubscription
$request = new MWSSubscriptionsService_Model_UpdateSubscriptionInput();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeUpdateSubscription($service, $request);
/**
 * Get Update Subscription 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_UpdateSubscription or array of parameters
 */
function invokeUpdateSubscription(MWSSubscriptionsService_Interface $service, $request)
{
    try {
        $response = $service->UpdateSubscription($request);
Exemple #2
0
 /**
  * Update Subscription
  * Update a subscription.
  *
  * @param mixed $request array of parameters for MWSSubscriptionsService_Model_UpdateSubscription request or MWSSubscriptionsService_Model_UpdateSubscription object itself
  * @see MWSSubscriptionsService_Model_UpdateSubscriptionInput
  * @return MWSSubscriptionsService_Model_UpdateSubscriptionResponse
  *
  * @throws MWSSubscriptionsService_Exception
  */
 public function updateSubscription($request)
 {
     if (!$request instanceof MWSSubscriptionsService_Model_UpdateSubscriptionInput) {
         require_once dirname(__FILE__) . '/Model/UpdateSubscriptionInput.php';
         $request = new MWSSubscriptionsService_Model_UpdateSubscriptionInput($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'UpdateSubscription';
     $httpResponse = $this->_invoke($parameters);
     require_once dirname(__FILE__) . '/Model/UpdateSubscriptionResponse.php';
     $response = MWSSubscriptionsService_Model_UpdateSubscriptionResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }