コード例 #1
0
 public function listSubscriptions()
 {
     $request = new \MWSSubscriptionsService_Model_ListSubscriptionsInput();
     $request->setSellerId($this->config->getMerchantId());
     $request->setMarketplaceId($this->config->getMarketPlaceId());
     $response = $this->service->ListSubscriptions($request);
     //echo $this->debugResponse($response);
     /*  @var \MWSSubscriptionsService_Model_ListSubscriptionsResult $result */
     $result = $response->getListSubscriptionsResult();
     /* @var \MWSSubscriptionsService_Model_SubscriptionList $subscriptionList */
     $subscriptionList = $result->getSubscriptionList();
     $destinationArray = array();
     /*  @var \MWSSubscriptionsService_Model_Subscription $subscription */
     foreach ($subscriptionList->getmember() as $subscription) {
         /*  @var \MWSSubscriptionsService_Model_Destination $destination */
         $destination = $subscription->getDestination();
         //echo $destination->getDeliveryChannel();
         //echo $subscription->getIsEnabled();
         $destinationArray[] = $this->getDestinationLink($destination);
     }
     return $destinationArray;
 }
コード例 #2
0
ファイル: Client.php プロジェクト: mallerp/amazon-mws-sdk
 /**
  * List Subscriptions
  * List all the subscriptions for the specified seller created by the current developer.
  *
  * @param mixed $request array of parameters for MWSSubscriptionsService_Model_ListSubscriptions request or MWSSubscriptionsService_Model_ListSubscriptions object itself
  * @see MWSSubscriptionsService_Model_ListSubscriptionsInput
  * @return MWSSubscriptionsService_Model_ListSubscriptionsResponse
  *
  * @throws MWSSubscriptionsService_Exception
  */
 public function listSubscriptions($request)
 {
     if (!$request instanceof MWSSubscriptionsService_Model_ListSubscriptionsInput) {
         require_once dirname(__FILE__) . '/Model/ListSubscriptionsInput.php';
         $request = new MWSSubscriptionsService_Model_ListSubscriptionsInput($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'ListSubscriptions';
     $httpResponse = $this->_invoke($parameters);
     require_once dirname(__FILE__) . '/Model/ListSubscriptionsResponse.php';
     $response = MWSSubscriptionsService_Model_ListSubscriptionsResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
コード例 #3
0
 * 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 Subscriptions Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as MWSSubscriptionsService_Model_ListSubscriptions
$request = new MWSSubscriptionsService_Model_ListSubscriptionsInput();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeListSubscriptions($service, $request);
/**
 * Get List Subscriptions 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_ListSubscriptions or array of parameters
 */
function invokeListSubscriptions(MWSSubscriptionsService_Interface $service, $request)
{
    try {
        $response = $service->ListSubscriptions($request);