Пример #1
0
 /**
  * Get FeedSubmiisonList full info
  * @param array $status
  * @param array $feedTypes
  * @param int $limit
  * @return array
  */
 public function getSubmissionList($status = array(), $feedTypes = array(), $limit = 20)
 {
     $request = new \MarketplaceWebService_Model_GetFeedSubmissionListRequest();
     $request->setMerchant($this->config['merchant_id']);
     $status = count($status) > 0 ? $status : $this->getPendingStatusList();
     $statusList = new \MarketplaceWebService_Model_StatusList($status);
     $request->setFeedProcessingStatusList($statusList);
     $feedTypes = count($feedTypes) > 0 ? $feedTypes : $this->getFeedTypes();
     $feedTypeList = new \MarketplaceWebService_Model_TypeList();
     foreach ($feedTypes as $feedType) {
         $feedTypeList->withType($feedType);
     }
     $request->setFeedTypeList($feedTypeList);
     $request->setMaxCount($limit);
     $response = $this->client->getFeedSubmissionList($request);
     $submissions = array();
     if ($response->isSetGetFeedSubmissionListResult()) {
         $getFeedSubmissionListResult = $response->getGetFeedSubmissionListResult();
         $feedSubmissionInfoList = $getFeedSubmissionListResult->getFeedSubmissionInfoList();
         foreach ($feedSubmissionInfoList as $feedSubmissionInfo) {
             $submissions[] = $this->getSubmission($feedSubmissionInfo->getFeedSubmissionId());
         }
         return $submissions;
     }
 }
Пример #2
0
 /**
  * Convert GetFeedSubmissionListRequest to name value pairs
  * @param MarketplaceWebService_Model_GetFeedSubmissionListRequest $request
  * @return array
  */
 private function convertGetFeedSubmissionList($request)
 {
     $parameters = array();
     $parameters['Action'] = 'GetFeedSubmissionList';
     if ($request->isSetMarketplace()) {
         $parameters['Marketplace'] = $request->getMarketplace();
     }
     if ($request->isSetMerchant()) {
         $parameters['Merchant'] = $request->getMerchant();
     }
     if ($request->isSetFeedSubmissionIdList()) {
         $feedSubmissionIdList = $request->getFeedSubmissionIdList();
         foreach ($feedSubmissionIdList->getId() as $idIndex => $id) {
             $parameters['FeedSubmissionIdList' . '.' . 'Id' . '.' . ($idIndex + 1)] = $id;
         }
     }
     if ($request->isSetMaxCount()) {
         $parameters['MaxCount'] = $request->getMaxCount();
     }
     if ($request->isSetFeedTypeList()) {
         $feedTypeList = $request->getFeedTypeList();
         foreach ($feedTypeList->getType() as $typeIndex => $type) {
             $parameters['FeedTypeList' . '.' . 'Type' . '.' . ($typeIndex + 1)] = $type;
         }
     }
     if ($request->isSetFeedProcessingStatusList()) {
         $feedProcessingStatusList = $request->getFeedProcessingStatusList();
         foreach ($feedProcessingStatusList->getStatus() as $statusIndex => $status) {
             $parameters['FeedProcessingStatusList' . '.' . 'Status' . '.' . ($statusIndex + 1)] = $status;
         }
     }
     if ($request->isSetSubmittedFromDate()) {
         $parameters['SubmittedFromDate'] = $this->getFormattedTimestamp($request->getSubmittedFromDate());
     }
     if ($request->isSetSubmittedToDate()) {
         $parameters['SubmittedToDate'] = $this->getFormattedTimestamp($request->getSubmittedToDate());
     }
     if ($request->isSetMWSAuthToken()) {
         $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
     }
     return array(CONVERTED_PARAMETERS_KEY => $parameters, CONVERTED_HEADERS_KEY => $this->defaultHeaders);
 }
Пример #3
0
    	 'FeedContent' => $feedHandle,
    	 'PurgeAndReplace' => false,
    	 'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true)),
    	 );
    
    	 rewind($feedHandle);
    
    	 $request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
    
    	 invokeSubmitFeed($service, $request);
    
    	 @fclose($feedHandle);*/
    /* submit feed - ends */
    $service = new MarketplaceWebService_Mock();
    $parameters = array('Merchant' => MERCHANT_ID, 'FeedProcessingStatusList' => array('Status' => array('_SUBMITTED_')));
    $request = new MarketplaceWebService_Model_GetFeedSubmissionListRequest($parameters);
    //$request = new MarketplaceWebService_Model_GetFeedSubmissionListRequest();
    //$request->setMerchant(MERCHANT_ID);
    $statusList = new MarketplaceWebService_Model_StatusList();
    $request->setFeedProcessingStatusList($statusList->withStatus('_SUBMITTED_'));
    invokeGetFeedSubmissionList($service, $request);
    die;
    /*
    	 if( Auth::check() ) {
    		return Redirect::to("home");
    		}
    		return View::make('auth.login');*/
});
function invokeSubmitFeed(MarketplaceWebService_Interface $service, $request)
{
    try {
 public function getFeedSubmissionList($FeedSubmissionId = false)
 {
     $this->initAPI();
     $request = new MarketplaceWebService_Model_GetFeedSubmissionListRequest();
     $request->setMerchant($this->SellerId);
     if ($FeedSubmissionId) {
         if (!is_array($FeedSubmissionId)) {
             $FeedSubmissionId = array($FeedSubmissionId);
         }
         // $request->setFeedSubmissionIdList( $FeedSubmissionId );
         $idList = new MarketplaceWebService_Model_IdList();
         // $idList->withId('<Feed Submission Id>');
         $idList->setId($FeedSubmissionId);
         $request->setFeedSubmissionIdList($idList);
     } else {
         $request->setMaxCount(50);
     }
     $result = $this->invokeGetFeedSubmissionList($this->service, $request);
     return $result;
 }