예제 #1
0
 public function ryi($params)
 {
     $this->session->setRequestToken($params['AuthToken']);
     $scope = $params['scope'];
     $req = new ReviseItemRequestType();
     $item = new ItemType();
     $item->setItemID($params['ItemID']);
     if (in_array('description', $scope)) {
         $item->setDescription($params['Description']);
     }
     if (in_array('sku', $scope)) {
         $item->setApplicationData($params['ApplicationData']);
         $item->setSKU($params['SKU']);
     }
     $item->setHitCounter("HiddenStyle");
     $req->setItem($item);
     $res = $this->proxy->ReviseItem($req);
     switch ($res->getAck()) {
         case AckCodeType::CodeType_Success:
             return true;
             break;
         case AckCodeType::CodeType_Warning:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             return true;
             break;
         default:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             $this->dumpObject($res);
             return false;
             break;
     }
 }
 /**
  * sample_VerifyAddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new VerifyAddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $req->setItem($item);
     $res = $this->proxy->VerifyAddItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_ReviseItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new ReviseItemRequestType();
     $item = new ItemType();
     $item->setItemID($params['ItemID']);
     $item->setDescription($params['Description']);
     $req->setItem($item);
     $res = $this->proxy->ReviseItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $a = new ShippingServiceOptionsType();
     $a->setShippingService('UPS2ndDay');
     $a->setShippingServicePriority('1');
     $a->setShippingServiceCost('5');
     $b = new ShippingDetailsType();
     //print '<pre>'.print_r(get_class_methods($b),true).'</pre><br>';
     $b->setShippingServiceOptions($a);
     //$b->setDefaultShippingCost(5);
     $b->setShippingType('Flat');
     $req = new AddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $item->ShippingService = 'UPS Ground';
     $item->setShippingDetails($b);
     //print '<pre>'.print_r(get_class_methods($a),true).'</pre><br>';
     //$this->dumpObject($a);
     //$this->dumpObject($item);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $req->setItem($item);
     $res = $this->proxy->AddItem($req);
     $this->dumpObject($res);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new AddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $item->setSubTitle($params['SubTitle']);
     $item->setHitCounter($params['HitCounter']);
     $item->setListingEnhancement($params['ListingEnhancement']);
     $listingDesigner = new ListingDesignerType();
     $listingDesigner->setLayoutID($params['LayoutID']);
     $listingDesigner->setThemeID($params['ThemeID']);
     $item->setListingDesigner($listingDesigner);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $secondaryCategory = new CategoryType();
     $secondaryCategory->setCategoryID($params['secondaryCategoryID']);
     $item->setSecondaryCategory($secondaryCategory);
     $picture = new PictureDetailsType();
     $picture->setPictureURL($params['PictureURL']);
     $item->setPictureDetails($picture);
     $req->setItem($item);
     $res = $this->proxy->AddItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  * 
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $reqPic = new UploadSiteHostedPicturesRequestType();
     $reqPic->setPictureData(file_get_contents("/var/www/apache2-default/playground/johann/php5/Fotolia.jpg"));
     $reqPic->setPictureSet(PictureSetCodeType::CodeType_Supersize);
     $resPic = $this->proxy->UploadSiteHostedPictures($reqPic);
     if ($this->testValid($resPic)) {
         $pictureUrl = $resPic->getSiteHostedPictureDetails()->getFullURL();
         $reqItem = new AddItemRequestType();
         $item = new ItemType();
         $item->setTitle('ipod');
         $item->setQuantity(1);
         $item->setCurrency('EUR');
         $item->setCountry('DE');
         $item->setStartPrice('5.00');
         $item->setListingDuration('Days_7');
         $item->setLocation('Cologne');
         $item->setPaymentMethods('CashOnPickup');
         $item->setListingType('Chinese');
         $item->setDescription('Neuer iPod mit Kopfhörer Ladekabel und Pc-Anschlusskabel.');
         $item->setSubTitle('Brandneuer iPod Mini!');
         $item->setHitCounter('BasicStyle');
         $item->setListingEnhancement('Highlight');
         $listingDesigner = new ListingDesignerType();
         $listingDesigner->setLayoutID('7710001');
         $listingDesigner->setThemeID('7730714');
         $item->setListingDesigner($listingDesigner);
         $primaryCategory = new CategoryType();
         $primaryCategory->setCategoryID(10610);
         $item->setPrimaryCategory($primaryCategory);
         $secondaryCategory = new CategoryType();
         $secondaryCategory->setCategoryID(8267);
         $item->setSecondaryCategory($secondaryCategory);
         $picture = new PictureDetailsType();
         $picture->setPictureURL($pictureUrl);
         $item->setPictureDetails($picture);
         $attSet = new AttributeSetType();
         $attSet->setTypeAttribute('attributeSetID', 1950);
         $att = new AttributeType();
         $att->setTypeAttribute('attributeID', 10244);
         $attValue = new ValType();
         $attValue->setValueID(10426);
         $att->setValue($attValue, 0);
         $attSet->setAttribute($att, 0);
         $atts = new AttributeSetArrayType();
         $atts->setAttributeSet($attSet, 0);
         $attSet2 = new AttributeSetType();
         $attSet2->setTypeAttribute('attributeSetID', 2136);
         $att2 = new AttributeType();
         $att2->setTypeAttribute('attributeID', 3803);
         $attValue2 = new ValType();
         $attValue2->setValueID(32040);
         $att2->setValue($attValue2, 0);
         $att3 = new AttributeType();
         $att3->setTypeAttribute('attributeID', 3806);
         $attValue3 = new ValType();
         $attValue3->setValueID(-3);
         $attValue3->setValueLiteral('siehe Artikelbeschreibung');
         $att3->setValue($attValue3, 0);
         $attSet2->setAttribute($att3, 1);
         $atts->setAttributeSet($attSet2, 1);
         $item->setAttributeSetArray($atts);
         $reqItem->setItem($item);
         $resItem = $this->proxy->AddItem($reqItem);
         if ($this->testValid($resItem)) {
             $this->dumpObject($resItem);
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }