function downloadReturnPolicyDetails($session, $site_id)
 {
     WPLE()->logger->info("downloadReturnPolicyDetails()");
     $this->initServiceProxy($session);
     // download ebay details
     $req = new GeteBayDetailsRequestType();
     $req->setDetailName('ReturnPolicyDetails');
     $res = $this->_cs->GeteBayDetails($req);
     // handle response and check if successful
     if ($this->handleResponse($res)) {
         // save array of ReturnsWithin options
         $ReturnsWithinOptions = array();
         foreach ($res->ReturnPolicyDetails->ReturnsWithin as $Detail) {
             $ReturnsWithinOptions[$Detail->ReturnsWithinOption] = $Detail->Description;
         }
         // update legacy option
         update_option('wplister_ReturnsWithinOptions', $ReturnsWithinOptions);
         // save array of ShippingCostPaidBy options
         $ShippingCostPaidByOptions = array();
         foreach ($res->ReturnPolicyDetails->ShippingCostPaidBy as $Detail) {
             $ShippingCostPaidByOptions[$Detail->ShippingCostPaidByOption] = $Detail->Description;
         }
         // update legacy option
         update_option('wplister_ShippingCostPaidByOptions', $ShippingCostPaidByOptions);
         // update site properties
         $Site = new WPLE_eBaySite($site_id);
         $Site->ReturnsWithinOptions = serialize($ReturnsWithinOptions);
         $Site->ShippingCostPaidByOptions = serialize($ShippingCostPaidByOptions);
         $Site->update();
     }
     // call successful
 }
 /**
  * sample_GeteBayDetails::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new GeteBayDetailsRequestType();
     $req->setDetailName($params['DetailName']);
     $res = $this->proxy->GeteBayDetails($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * @return GeteBayDetailsResponseType
  * @param GeteBayDetailsRequestType $request 
  */
 function GeteBayDetails($request)
 {
     $request->setVersion(EBAY_WSDL_VERSION);
     return $this->call('GeteBayDetails', $request);
 }
Exemple #4
0
 public function retrieveeBayDetails($params)
 {
     $account_id = $params['AccountID'];
     $this->session->setRequestToken($params['AuthToken']);
     $bean = BeanFactory::getBean('xeBayAccounts');
     if ($bean->retrieve($account_id) === null) {
         return false;
     }
     $req = new GeteBayDetailsRequestType();
     if (isset($params['DetailName'])) {
         $req->setDetailName($params['DetailName']);
     }
     $res = $this->proxy->GeteBayDetails($req);
     if ($this->testValid($res)) {
         $bean->ebay_details = $this->fill_ebay_details($res);
         $bean->ebay_detail_update_time = $res->getUpdateTime();
         $bean->save();
         return true;
     } else {
         $this->dumpObject($res);
         return false;
     }
 }
 function fetchDoesNotApplyText($session, $site_id)
 {
     WPLE()->logger->info("fetchDoesNotApplyText()");
     $this->initServiceProxy($session);
     // download ebay details
     $req = new GeteBayDetailsRequestType();
     $req->setDetailName('ProductDetails');
     $res = $this->_cs->GeteBayDetails($req);
     // handle response and check if successful
     if ($this->handleResponse($res)) {
         // get text - default is 'Does not apply'
         $DoesNotApplyText = $res->ProductDetails->ProductIdentifierUnavailableText;
         // update site property
         $Site = new WPLE_eBaySite($site_id);
         $Site->DoesNotApplyText = $DoesNotApplyText;
         $Site->update();
     }
     // call successful
 }