コード例 #1
0
ファイル: EbayTest.php プロジェクト: rtconner/services_ebay
 function test_AddFixedPriceItem()
 {
     $session = \Services\Ebay::getSession($this->devId, $this->appId, $this->certId);
     $session->setToken($this->token);
     $ebay = new \Services\Ebay($session);
     $item = \Services\Ebay::loadModel('Item', null, $session);
     $item->PrimaryCategory = array('CategoryID' => 57882);
     $item->ConditionID = 1000;
     $item->Title = 'Supergirls\'s cape';
     $item->Description = 'Another test item';
     $item->Location = 'At my home';
     $item->StartPrice = '10';
     $item->PaymentMethods = 'PayPal';
     $item->PayPalEmailAddress = '*****@*****.**';
     $item->Quantity = 1;
     $item->ListingDuration = 'Days_7';
     $item->ListingType = 'FixedPriceItem';
     $item->DispatchTimeMax = 3;
     $item->Currency = 'USD';
     $item->Country = 'US';
     $item->Site = 'US';
     $item->PictureDetails = array('PictureURL' => array('http://i12.ebayimg.com/03/i/04/8a/5f/a1_1_sbl.JPG', 'http://i22.ebayimg.com/01/i/04/8e/53/69_1_sbl.JPG', 'http://i4.ebayimg.ebay.com/01/i/000/77/3c/d88f_1_sbl.JPG'));
     $item->ReturnPolicy = array('ReturnsAcceptedOption' => 'ReturnsAccepted', 'RefundOption' => 'MoneyBack', 'ReturnsWithinOption' => 'Days_30', 'Description' => 'If you are not satisfied, return the book for refund.', 'ShippingCostPaidByOption' => 'Buyer');
     $item->ShippingDetails = array('ShippingType' => 'Flat', 'ShippingServiceOptions' => array(array('ShippingServicePriority' => 1, 'ShippingService' => 'UPSGround', 'FreeShipping' => 'true', 'ShippingServiceAdditionalCost' => 0.0)));
     $result = $ebay->AddFixedPriceItem($item);
     print_r($result);
     $this->assertNotEmpty($result['ItemID']);
 }