Exemple #1
0
        private static void EndFixedPriceItem(string itemID)
        {
            //create the context
            ApiContext context = new ApiContext();

            //set the User token
            string token = AppSettingsHelper.Token;

            context.ApiCredential.eBayToken = token;

            //set the server url
            string endpoint = AppSettingsHelper.Endpoint;

            context.SoapApiServerUrl = endpoint;

            //enable logging
            context.ApiLogManager = new ApiLogManager();
            context.ApiLogManager.ApiLoggerList.Add(new FileLogger("log.txt", true, true, true));
            context.ApiLogManager.EnableLogging = true;

            //set the version
            context.Version = "817";
            context.Site    = SiteCodeType.US;

            EndFixedPriceItemCall endFP = new EndFixedPriceItemCall(context);

            endFP.ItemID       = itemID;
            endFP.EndingReason = EndReasonCodeType.NotAvailable;

            endFP.Execute();
            Console.WriteLine(endFP.ApiResponse.Ack + " Ended ItemID " + endFP.ItemID);
        }
        public void EndFixedPriceItem()
        {
            Assert.IsNotNull(TestData.NewFixedPriceItem, "Failed because no item available -- requires successful AddFixedPriceItem test");

            ItemType item             = TestData.NewFixedPriceItem;
            EndFixedPriceItemCall api = new EndFixedPriceItemCall(this.apiContext);

            // Set the item to be ended.
            api.ItemID       = item.ItemID;
            api.EndingReason = EndReasonCodeType.NotAvailable;
            api.Execute();

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            TestData.EndedFixedPriceItem = TestData.NewFixedPriceItem;

            Assert.IsNotNull(TestData.EndedFixedPriceItem);
        }