Esempio n. 1
0
        protected static ShippingDetailsType GetShippingDetail()
        {
            ShippingDetailsType sd = new ShippingDetailsType();

            //sd.ApplyShippingDiscount = true;
            //sd.PaymentInstructions = "eBay .Net SDK test instruction.";
            //sd.ShippingRateType = ShippingRateTypeCodeType.StandardList;

            //adding domestic shipping

            ShippingServiceOptionsType domesticShipping1 = new ShippingServiceOptionsType();

            domesticShipping1.ShippingService     = ShippingServiceCodeType.ShippingMethodStandard.ToString();
            domesticShipping1.ShippingServiceCost = new AmountType {
                Value = 0, currencyID = CurrencyCodeType.USD
            };
            domesticShipping1.ShippingInsuranceCost = new AmountType {
                Value = 0, currencyID = CurrencyCodeType.USD
            };
            domesticShipping1.ShippingServicePriority = 4;
            domesticShipping1.LocalPickup             = false;
            domesticShipping1.FreeShipping            = true;
            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new[] { domesticShipping1 });
            sd.ShippingType           = ShippingTypeCodeType.Flat;

            return(sd);
        }
Esempio n. 2
0
        private ShippingDetailsType GetShippingDetails(int countOfArticles)
        {
            ShippingDetailsType sd = new ShippingDetailsType();

            sd.ShippingType = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = ShippingServiceCodeType.DE_Paket.ToString();
            st1.ShippingServiceAdditionalCost = new AmountType {
                Value = 0, currencyID = CurrencyCodeType.EUR
            };
            st1.ShippingServicePriority = 1;
            st1.ShippingServiceCost     = new AmountType {
                Value = 5.95, currencyID = CurrencyCodeType.EUR
            };

            if (countOfArticles > 1)
            {
                st1.ShippingServiceCost.Value = 0;
            }

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new[] { st1 });
            return(sd);
        }
Esempio n. 3
0
        public void AddShippingDetails(ShippingTypeCodeType type,
                                       ShippingServiceOptionsTypeCollection domestic_options,
                                       InternationalShippingServiceOptionsTypeCollection international_options
                                       )
        {
            // shipping details
            shippingDetails = new ShippingDetailsType();

            shippingDetails.ApplyShippingDiscount = false;

            shippingDetails.PaymentInstructions = "";

            // shipping insurance??

            // Shipping type and shipping service options
            shippingDetails.ShippingType = type;

            // domestic shipping options
            shippingDetails.ShippingServiceOptions = domestic_options;

            // international shipping options
            shippingDetails.InternationalShippingServiceOption = international_options;

            item.ShippingDetails = shippingDetails;
        }
Esempio n. 4
0
        //set shipping information
        private ShippingDetailsType getShippingDetails()
        {
            // Shipping details.
            ShippingDetailsType sd       = new ShippingDetailsType();
            SalesTaxType        salesTax = new SalesTaxType();

            salesTax.SalesTaxPercent = 0.0825f;
            salesTax.SalesTaxState   = "CA";
            sd.ApplyShippingDiscount = true;
            AmountType at = new AmountType();

            at.Value               = 2.8;
            at.currencyID          = CurrencyCodeType.USD;
            sd.InsuranceFee        = at;
            sd.InsuranceOption     = InsuranceOptionCodeType.Optional;
            sd.PaymentInstructions = "eBay DotNet SDK test instruction.";

            // Set calculated shipping.
            sd.ShippingType = ShippingTypeCodeType.Flat;
            //
            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = ShippingServiceCodeType.ShippingMethodStandard.ToString();
            at            = new AmountType();
            at.Value      = 2.0;
            at.currencyID = CurrencyCodeType.USD;
            st1.ShippingServiceAdditionalCost = at;
            at                          = new AmountType();
            at.Value                    = 1.0;
            at.currencyID               = CurrencyCodeType.USD;
            st1.ShippingServiceCost     = at;
            st1.ShippingServicePriority = 1;
            at                          = new AmountType();
            at.Value                    = 1.0;
            at.currencyID               = CurrencyCodeType.USD;
            st1.ShippingInsuranceCost   = at;

            ShippingServiceOptionsType st2 = new ShippingServiceOptionsType();

            st2.ExpeditedService = true;
            st2.ShippingService  = ShippingServiceCodeType.ShippingMethodExpress.ToString();
            at            = new AmountType();
            at.Value      = 2.0;
            at.currencyID = CurrencyCodeType.USD;
            st2.ShippingServiceAdditionalCost = at;
            at                          = new AmountType();
            at.Value                    = 1.0;
            at.currencyID               = CurrencyCodeType.USD;
            st2.ShippingServiceCost     = at;
            st2.ShippingServicePriority = 2;
            at                          = new AmountType();
            at.Value                    = 1.0;
            at.currencyID               = CurrencyCodeType.USD;
            st2.ShippingInsuranceCost   = at;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new ShippingServiceOptionsType[] { st1, st2 });

            return(sd);
        }
Esempio n. 5
0
        private static ShippingDetailsType getShippingDetails()
        {
            // Shipping details.
            ShippingDetailsType sd       = new ShippingDetailsType();
            SalesTaxType        salesTax = new SalesTaxType();

            salesTax.SalesTaxPercent          = 0.0825F;
            salesTax.SalesTaxPercentSpecified = true;
            salesTax.SalesTaxState            = "CA";
            sd.SalesTax                       = salesTax;
            sd.AllowPaymentEdit               = false;
            sd.AllowPaymentEditSpecified      = true;
            sd.ApplyShippingDiscount          = true;
            sd.ApplyShippingDiscountSpecified = true;
            sd.InsuranceFee                   = new AmountType();
            sd.InsuranceFee.Value             = 0.1;
            sd.InsuranceFee.currencyID        = CurrencyCodeType.USD;
            sd.InsuranceOption                = InsuranceOptionCodeType.Optional;
            sd.PaymentInstructions            = "eBay Java SDK test instruction.";
            sd.ShippingType                   = ShippingTypeCodeType.Flat;
            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = ShippingServiceCodeType.USPSPriority.ToString();
            st1.ShippingServiceAdditionalCost            = new AmountType();
            st1.ShippingServiceAdditionalCost.Value      = 0.1;
            st1.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;
            st1.ShippingServiceCost            = new AmountType();
            st1.ShippingServiceCost.Value      = 0.1;
            st1.ShippingServiceCost.currencyID = CurrencyCodeType.USD;

            st1.ShippingServicePriority          = 1;
            st1.ShippingServicePrioritySpecified = true;
            st1.ShippingInsuranceCost            = new AmountType();
            st1.ShippingInsuranceCost.Value      = 0.1;
            st1.ShippingInsuranceCost.currencyID = CurrencyCodeType.USD;
            ShippingServiceOptionsType st2 = new ShippingServiceOptionsType();

            st2.ExpeditedService                         = true;
            st2.ExpeditedServiceSpecified                = true;
            st2.ShippingService                          = ShippingServiceCodeType.USPSFirstClass.ToString();
            st2.ShippingServiceAdditionalCost            = new AmountType();
            st2.ShippingServiceAdditionalCost.Value      = 0.1;
            st2.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;

            st2.ShippingServiceCost              = new AmountType();
            st2.ShippingServiceCost.Value        = 0.1;
            st2.ShippingServiceCost.currencyID   = CurrencyCodeType.USD;
            st2.ShippingServicePriority          = 2;
            st2.ShippingServicePrioritySpecified = true;
            st2.ShippingInsuranceCost            = new AmountType();
            st2.ShippingInsuranceCost.Value      = 0.1;
            st2.ShippingInsuranceCost.currencyID = CurrencyCodeType.USD;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();
            sd.ShippingServiceOptions.Add(st1);
            sd.ShippingServiceOptions.Add(st2);
            return(sd);
        }
Esempio n. 6
0
 private void UpdateListingPostageRule(ShippingDetailsType shippingDetails, D_Listing listing)
 {
     if (shippingDetails != null && shippingDetails.ShippingServiceOptions != null)
     {
         var shippingServiceOption = shippingDetails.ShippingServiceOptions.ToArray().FirstOrDefault();
         if (shippingServiceOption != null)
         {
             if (shippingServiceOption.ShippingService == "AU_StandardDelivery")
             {
                 listing.ListingPostageRuleID = 1;//FreeShipping
             }
         }
     }
 }
Esempio n. 7
0
        public void GetItemShipping()
        {
            Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
            //
            GetItemShippingCall api = new GetItemShippingCall(this.apiContext);

            string          itemID       = TestData.NewItem.ItemID;
            string          postalCode   = "95125";
            int             quantitySold = 1;
            CountryCodeType countryCode  = CountryCodeType.US;
            // Make API call.

            ShippingDetailsType shippingDetails = api.GetItemShipping(itemID, quantitySold, postalCode, countryCode);

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            Assert.IsNotNull(shippingDetails);
        }
Esempio n. 8
0
        /// <summary>
        /// Set the item's shipping information
        /// </summary>
        /// <returns></returns>
        private static ShippingDetailsType createShippingDetails(eBayProductFeed eBayInfo)
        {
            // let's determine the shipping type
            var shippingType = EnumHelper.ParseEnum <ShippingTypeCodeType>(eBayInfo.ShippingType, ShippingTypeCodeType.Free);

            // create shipping details and set its shipping type
            var shippingDetails = new ShippingDetailsType();
            var serviceOption   = new ShippingServiceOptionsType();

            if (shippingType == ShippingTypeCodeType.Flat)
            {
                shippingDetails.ShippingType = ShippingTypeCodeType.Flat;

                // create the shipping service
                serviceOption.ShippingService         = eBayInfo.ShippingService;
                serviceOption.ShippingServicePriority = 1;
                serviceOption.ShippingServiceCost     = new AmountType
                {
                    currencyID = CurrencyCodeType.USD,
                    Value      = eBayInfo.ShippingServiceCost
                };
            }
            else // shipping type is free
            {
                // force it to flat but this is for free shipping
                //shippingDetails.ShippingType = ShippingTypeCodeType.Free;

                // create the shipping service and let's set the shipping cost to 0
                serviceOption.ShippingService         = ShippingServiceCodeType.ShippingMethodStandard.ToString(); // this is just arbitrary shippng service only
                serviceOption.ShippingServicePriority = 1;
                serviceOption.ShippingServiceCost     = new AmountType
                {
                    currencyID = CurrencyCodeType.USD,
                    Value      = 0 // eBayInfo.ShippingServiceCost
                };
            }

            // set the shipping service type
            shippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(
                new ShippingServiceOptionsType[] { serviceOption });

            return(shippingDetails);
        }
Esempio n. 9
0
        private ShippingDetailsType getShippingDetails(String shippingService)
        {
            // Shipping details.
            SiteCodeType        site     = this.controller.ApiContext.Site;
            ShippingDetailsType sd       = new ShippingDetailsType();
            SalesTaxType        salesTax = new SalesTaxType();

            salesTax.SalesTaxPercent = 0.0825f;
            salesTax.SalesTaxState   = "CA";
            sd.ApplyShippingDiscount = true;
            AmountType at = new AmountType();

            at.Value      = 0.1;
            at.currencyID = this.getCurrencyType(site);
            //sd.InsuranceFee = at;
            //sd.InsuranceOption = InsuranceOptionCodeType.Optional;
            sd.PaymentInstructions = "eBay DotNet SDK test instruction.";

            // Set calculated shipping.
            sd.ShippingType = ShippingTypeCodeType.Flat;
            //
            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = shippingService;
            at            = new AmountType();
            at.Value      = 0.1;
            at.currencyID = this.getCurrencyType(site);
            st1.ShippingServiceAdditionalCost = at;
            at                          = new AmountType();
            at.Value                    = 0.1;
            at.currencyID               = this.getCurrencyType(site);
            st1.ShippingServiceCost     = at;
            st1.ShippingServicePriority = 1;
            at                          = new AmountType();
            at.Value                    = 0.1;
            at.currencyID               = this.getCurrencyType(site);
            st1.ShippingInsuranceCost   = at;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new ShippingServiceOptionsType[] { st1 });

            return(sd);
        }
Esempio n. 10
0
        public static ShippingDetailsType BuildShippingDetailsType()
        {
            ShippingDetailsType sd = new ShippingDetailsType();

            /*sd.InternationalShippingServiceOption = new InternationalShippingServiceOptionsTypeCollection(
             *  new InternationalShippingServiceOptionsType[] {
             *      new InternationalShippingServiceOptionsType()
             *      {
             *          ShippingService = ShippingTypeCodeType.Flat.ToString(),
             *          ShippingServiceAdditionalCost = new AmountType() { Value = 3.8, currencyID = CurrencyCodeType.USD },
             *          ShippingServiceCost = new AmountType() { Value = 3.8, currencyID = CurrencyCodeType.USD},
             *          ShippingServicePriority = 1,
             *          ShippingInsuranceCost = new AmountType() { Value = 5.02, currencyID = CurrencyCodeType.USD }
             *      }
             *  });
             */
            sd.ApplyShippingDiscount  = true;
            sd.ShippingType           = ShippingTypeCodeType.Flat;
            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(
                new ShippingServiceOptionsType[] {
                new ShippingServiceOptionsType()
                {
                    ShippingService = ShippingServiceCodeType.ShippingMethodStandard.ToString(),
                    ShippingServiceAdditionalCost = new AmountType()
                    {
                        Value = 0.01, currencyID = CurrencyCodeType.USD
                    },
                    ShippingServiceCost = new AmountType()
                    {
                        Value = 1.99, currencyID = CurrencyCodeType.USD
                    },
                    ShippingServicePriority = 1,
                    ShippingInsuranceCost   = new AmountType()
                    {
                        Value = 5.01, currencyID = CurrencyCodeType.USD
                    }
                }
            }
                );
            return(sd);
        }
Esempio n. 11
0
        /// <summary>
        /// Build sample shipping details
        /// </summary>
        /// <returns>ShippingDetailsType object</returns>
        #region BuildShippingDetails
        ShippingDetailsType BuildShippingDetails()
        {
            // Shipping details
            ShippingDetailsType sd = new ShippingDetailsType();

            sd.ApplyShippingDiscount = false;
            sd.PaymentInstructions   = "eBay .Net SDK test instruction.";
            sd.ShippingType          = ShippingTypeCodeType.Flat;
            ShippingServiceOptionsType shippingOptions = new ShippingServiceOptionsType();

            shippingOptions.ShippingService = ShippingServiceCodeType.DE_StandardDispatch.ToString();
            AmountType amountType = new AmountType();

            amountType.currencyID = CurrencyCodeType.EUR;
            amountType.Value      = 0;
            shippingOptions.ShippingServiceCost           = amountType;
            shippingOptions.ShippingServiceAdditionalCost = amountType;
            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new ShippingServiceOptionsType[] { shippingOptions });

            return(sd);
        }
Esempio n. 12
0
        /// <summary>
        /// Build sample shipping details
        /// </summary>
        /// <returns>ShippingDetailsType object</returns>
        private ShippingDetailsType BuildShippingDetails()
        {
            // Shipping details
            ShippingDetailsType sd = new ShippingDetailsType();

            sd.ApplyShippingDiscount = true;
            AmountType amount = new AmountType();

            amount.Value           = 20;
            amount.currencyID      = CurrencyCodeType.AUD;
            sd.PaymentInstructions = "Please do the payment via Paypal.";

            // Shipping type and shipping service options
            sd.ShippingType = ShippingTypeCodeType.Flat;
            ShippingServiceOptionsType shippingOptions = new ShippingServiceOptionsType();

            shippingOptions.ShippingService =
                ShippingServiceCodeType.ShippingMethodStandard.ToString();

            amount            = new AmountType();
            amount.Value      = 2.0;
            amount.currencyID = CurrencyCodeType.AUD;
            shippingOptions.ShippingServiceAdditionalCost = amount;
            amount            = new AmountType();
            amount.Value      = 10;
            amount.currencyID = CurrencyCodeType.AUD;
            shippingOptions.ShippingServiceCost     = amount;
            shippingOptions.ShippingServicePriority = 1;
            amount            = new AmountType();
            amount.Value      = 1.0;
            amount.currencyID = CurrencyCodeType.AUD;
            shippingOptions.ShippingInsuranceCost = amount;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(
                new ShippingServiceOptionsType[] { shippingOptions }
                );

            return(sd);
        }
Esempio n. 13
0
        /// <summary>
        /// Build sample shipping details
        /// </summary>
        /// <returns>ShippingDetailsType object</returns>
        static ShippingDetailsType BuildShippingDetails()
        {
            // Shipping details
            ShippingDetailsType sd = new ShippingDetailsType();

            sd.ApplyShippingDiscount = true;
            AmountType amount = new AmountType();

            amount.Value           = 2.8;
            amount.currencyID      = CurrencyCodeType.USD;
            sd.PaymentInstructions = "eBay .Net SDK test instruction.";

            // Shipping type and shipping service options
            sd.ShippingType = ShippingTypeCodeType.Flat;
            ShippingServiceOptionsType shippingOptions = new ShippingServiceOptionsType();

            shippingOptions.ShippingService =
                ShippingServiceCodeType.ShippingMethodStandard.ToString();
            amount            = new AmountType();
            amount.Value      = 2.0;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingServiceAdditionalCost = amount;
            amount            = new AmountType();
            amount.Value      = 1;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingServiceCost     = amount;
            shippingOptions.ShippingServicePriority = 1;
            amount            = new AmountType();
            amount.Value      = 1.0;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingInsuranceCost = amount;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(
                new ShippingServiceOptionsType[] { shippingOptions }
                );

            return(sd);
        }
Esempio n. 14
0
        private ShippingDetailsType getShippingDetails()
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            AmountType          at = new AmountType();

            sd.PaymentInstructions = eBayLister.UserSettings.Default.paymentInstructions;
            sd.ShippingType        = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = ShippingServiceCodeType.IN_Express.ToString();

            at            = new AmountType();
            at.currencyID = CurrencyCodeType.INR;
            at.Value      = Convert.ToDouble(eBayLister.UserSettings.Default.shippingCost) *
                            Convert.ToDouble(eBayLister.UserSettings.Default.ConversionRate);
            st1.ShippingServiceCost = at;
            ShippingServiceOptionsTypeCollection serviceOptions = new ShippingServiceOptionsTypeCollection();

            serviceOptions.Add(st1);
            sd.ShippingServiceOptions = serviceOptions;
            return(sd);
        }
Esempio n. 15
0
        private void BtnGetItemShipping_Click(object sender, EventArgs e)
        {
            try
            {
                LstShipSvc.Items.Clear();
                TxtShipZip.Text      = "";
                TxtHandlingCost.Text = "";
                TxtShipType.Text     = "";
                TxtPackage.Text      = "";
                TxtWeight.Text       = "";

                GetItemShippingCall apicall = new GetItemShippingCall(apiContext);

                if (TxtQuantity.Text != string.Empty)
                {
                    apicall.QuantitySold = Convert.ToInt32(TxtQuantity.Text);
                }
                if (CboCountry.SelectedIndex != 0)
                {
                    apicall.DestinationCountryCode = (CountryCodeType)Enum.Parse(typeof(CountryCodeType), CboCountry.SelectedItem.ToString());
                }

                ShippingDetailsType shipdetails = apicall.GetItemShipping(TxtItemId.Text, TxtDestination.Text);
                TxtShipType.Text = shipdetails.ShippingType.ToString();

                if (shipdetails.CalculatedShippingRate != null)
                {
                    TxtShipType.Text     = shipdetails.CalculatedShippingRate.OriginatingPostalCode;
                    TxtHandlingCost.Text = shipdetails.CalculatedShippingRate.PackagingHandlingCosts.Value.ToString();
                    TxtPackage.Text      = shipdetails.CalculatedShippingRate.ShippingPackage.ToString();
                    TxtWeight.Text       = shipdetails.CalculatedShippingRate.WeightMajor.Value.ToString() + " " + shipdetails.CalculatedShippingRate.WeightMajor.unit + " - " + shipdetails.CalculatedShippingRate.WeightMinor.Value.ToString() + " " + shipdetails.CalculatedShippingRate.WeightMinor.unit;
                }

                foreach (ShippingServiceOptionsType shipopt in shipdetails.ShippingServiceOptions)
                {
                    string[] listparams = new string[5];
                    listparams[0] = shipopt.ShippingService.ToString();
                    if (shipopt.ShippingServiceCost != null)
                    {
                        listparams[1] = shipopt.ShippingServiceCost.Value.ToString();
                    }
                    if (shipopt.ShippingInsuranceCost != null)
                    {
                        listparams[2] = shipopt.ShippingInsuranceCost.Value.ToString();
                    }
                    if (shipopt.ShippingServiceAdditionalCost != null)
                    {
                        listparams[3] = shipopt.ShippingServiceAdditionalCost.Value.ToString();
                    }

                    ListViewItem vi = new ListViewItem(listparams);
                    this.LstShipSvc.Items.Add(vi);
                }

                foreach (InternationalShippingServiceOptionsType shipopt in shipdetails.InternationalShippingServiceOption)
                {
                    string[] listparams = new string[5];
                    listparams[0] = shipopt.ShippingService.ToString();
                    if (shipopt.ShippingServiceCost != null)
                    {
                        listparams[1] = shipopt.ShippingServiceCost.Value.ToString();
                    }
                    if (shipopt.ShippingServiceAdditionalCost != null)
                    {
                        listparams[3] = shipopt.ShippingServiceAdditionalCost.Value.ToString();
                    }
                    listparams[4] = String.Join(", ", shipopt.ShipToLocation.ToArray());

                    ListViewItem vi = new ListViewItem(listparams);
                    this.LstShipSvc.Items.Add(vi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 16
0
		private static ShippingDetailsType getShippingDetails()
		{
			// Shipping details.
			ShippingDetailsType sd = new ShippingDetailsType();
			SalesTaxType salesTax = new SalesTaxType();
			salesTax.SalesTaxPercent = 0.0825F;
			salesTax.SalesTaxPercentSpecified = true;
			salesTax.SalesTaxState = "CA";
			sd.SalesTax = salesTax;
			sd.AllowPaymentEdit = false;
			sd.AllowPaymentEditSpecified = true;
			sd.ApplyShippingDiscount = true;
			sd.ApplyShippingDiscountSpecified = true;
			sd.InsuranceFee = new AmountType();
			sd.InsuranceFee.Value = 0.1;
			sd.InsuranceFee.currencyID = CurrencyCodeType.USD;
			sd.InsuranceOption = InsuranceOptionCodeType.Optional;
			sd.PaymentInstructions = "eBay Java SDK test instruction.";
			sd.ShippingType = ShippingTypeCodeType.Flat;
			ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
			st1.ShippingService = ShippingServiceCodeType.USPSPriority.ToString();
			st1.ShippingServiceAdditionalCost = new AmountType();
			st1.ShippingServiceAdditionalCost.Value = 0.1;
			st1.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;
			st1.ShippingServiceCost = new AmountType();
			st1.ShippingServiceCost.Value = 0.1;
			st1.ShippingServiceCost.currencyID = CurrencyCodeType.USD;

			st1.ShippingServicePriority = 1;
			st1.ShippingServicePrioritySpecified = true;
			st1.ShippingInsuranceCost = new AmountType();
			st1.ShippingInsuranceCost.Value = 0.1;
			st1.ShippingInsuranceCost.currencyID = CurrencyCodeType.USD;
			ShippingServiceOptionsType st2 = new ShippingServiceOptionsType();
			st2.ExpeditedService = true;
			st2.ExpeditedServiceSpecified = true;
			st2.ShippingService = ShippingServiceCodeType.USPSFirstClass.ToString();
			st2.ShippingServiceAdditionalCost = new AmountType();
			st2.ShippingServiceAdditionalCost.Value = 0.1;
			st2.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.USD;

			st2.ShippingServiceCost = new AmountType();
			st2.ShippingServiceCost.Value = 0.1;
			st2.ShippingServiceCost.currencyID = CurrencyCodeType.USD;
			st2.ShippingServicePriority = 2;
			st2.ShippingServicePrioritySpecified = true;
			st2.ShippingInsuranceCost = new AmountType();
			st2.ShippingInsuranceCost.Value = 0.1;
			st2.ShippingInsuranceCost.currencyID = CurrencyCodeType.USD;

			sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();
			sd.ShippingServiceOptions.Add(st1);
			sd.ShippingServiceOptions.Add(st2);
			return sd;
			
		}
Esempio n. 17
0
		//set shipping information
		private ShippingDetailsType getShippingDetails()
		{
			// Shipping details.
			ShippingDetailsType sd = new ShippingDetailsType();
			SalesTaxType salesTax = new SalesTaxType();
			salesTax.SalesTaxPercent=0.0825f;
			salesTax.SalesTaxState="CA";
			sd.ApplyShippingDiscount=true;
			AmountType at =new AmountType();
			at.Value=2.8;
			at.currencyID=CurrencyCodeType.USD;
			sd.InsuranceFee=at;
			sd.InsuranceOption=InsuranceOptionCodeType.Optional;
			sd.PaymentInstructions="eBay DotNet SDK test instruction.";

			// Set calculated shipping.
			sd.ShippingType=ShippingTypeCodeType.Flat;
			//
			ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
			st1.ShippingService=ShippingServiceCodeType.ShippingMethodStandard.ToString();
			at = new AmountType();
			at.Value=2.0;
			at.currencyID=CurrencyCodeType.USD;
			st1.ShippingServiceAdditionalCost=at;
			at = new AmountType();
			at.Value=1.0;
			at.currencyID=CurrencyCodeType.USD;
			st1.ShippingServiceCost=at;
			st1.ShippingServicePriority=1;
			at = new AmountType();
			at.Value=1.0;
			at.currencyID=CurrencyCodeType.USD;
			st1.ShippingInsuranceCost=at;

			ShippingServiceOptionsType st2 = new ShippingServiceOptionsType();
			st2.ExpeditedService=true;
			st2.ShippingService=ShippingServiceCodeType.ShippingMethodExpress.ToString();
			at = new AmountType();
			at.Value=2.0;
			at.currencyID=CurrencyCodeType.USD;
			st2.ShippingServiceAdditionalCost=at;
			at = new AmountType();
			at.Value=1.0;
			at.currencyID=CurrencyCodeType.USD;
			st2.ShippingServiceCost=at;
			st2.ShippingServicePriority=2;
			at = new AmountType();
			at.Value=1.0;
			at.currencyID=CurrencyCodeType.USD;
			st2.ShippingInsuranceCost=at;

			sd.ShippingServiceOptions=new ShippingServiceOptionsTypeCollection(new ShippingServiceOptionsType[]{st1, st2});

			return sd;
		}
Esempio n. 18
0
        private ShippingDetailsType getShippingDetails(String shippingService)
        {
            // Shipping details.
            SiteCodeType site = (SiteCodeType)Session[Global.SITE];
            ShippingDetailsType sd = new ShippingDetailsType();
            SalesTaxType salesTax = new SalesTaxType();
            salesTax.SalesTaxPercent=0.0825f;
            salesTax.SalesTaxState="CA";
            sd.ApplyShippingDiscount=true;
            AmountType at =new AmountType();
            at.Value=0.1;
            at.currencyID=Global.GetCurrencyType(site);
            sd.InsuranceFee=at;
            sd.InsuranceOption=InsuranceOptionCodeType.Optional;
            sd.PaymentInstructions="eBay DotNet SDK test instruction.";

            // Set calculated shipping.
            sd.ShippingType=ShippingTypeCodeType.Flat;
            //
            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
            st1.ShippingService=shippingService;
            at = new AmountType();
            at.Value=0.1;
            at.currencyID=Global.GetCurrencyType(site);
            st1.ShippingServiceAdditionalCost=at;
            at = new AmountType();
            at.Value=0.1;
            at.currencyID=Global.GetCurrencyType(site);
            st1.ShippingServiceCost=at;
            st1.ShippingServicePriority=1;
            at = new AmountType();
            at.Value=0.1;
            at.currencyID=Global.GetCurrencyType(site);
            st1.ShippingInsuranceCost=at;

            sd.ShippingServiceOptions=new ShippingServiceOptionsTypeCollection(new ShippingServiceOptionsType[]{st1});

            return sd;
        }
Esempio n. 19
0
        private void SetShippingServiceOptions(ItemType item)
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            item.ShippingDetails = sd;

            if (this.rbtnFlatShippingRates.Checked)
            {
                sd.ShippingServiceOptions =
                    (ShippingServiceOptionsTypeCollection)this.listViewDomesticShippingService.GetShippingServiceOptions();
                sd.InternationalShippingServiceOption =
                    (InternationalShippingServiceOptionsTypeCollection)this.listViewIntlShippingService.GetShippingServiceOptions();
            }
            else if (this.rbtnCalculatedShippingRates.Checked)
            {
                sd.ShippingServiceOptions =
                    (ShippingServiceOptionsTypeCollection)this.listViewCalcShippingService.GetShippingServiceOptions();
            }
        }
Esempio n. 20
0
        private ShippingDetailsType GetShippingDetails(int countOfArticles)
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            sd.ShippingType = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
            st1.ShippingService = ShippingServiceCodeType.DE_Paket.ToString();
            st1.ShippingServiceAdditionalCost = new AmountType { Value = 0, currencyID = CurrencyCodeType.EUR };
            st1.ShippingServicePriority = 1;
            st1.ShippingServiceCost = new AmountType { Value = 5.95, currencyID = CurrencyCodeType.EUR };

            if (countOfArticles > 1)
            {
                st1.ShippingServiceCost.Value = 0;
            }

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(new[] { st1});
            return sd;
        }
Esempio n. 21
0
        /// <summary>
        /// Build sample shipping details
        /// </summary>
        /// <returns>ShippingDetailsType object</returns>
        static ShippingDetailsType BuildShippingDetails()
        {
            // Shipping details
            ShippingDetailsType sd = new ShippingDetailsType();

            sd.ApplyShippingDiscount = true;
            AmountType amount = new AmountType();
            amount.Value = 2.8;
            amount.currencyID = CurrencyCodeType.USD;
            sd.PaymentInstructions = "eBay .Net SDK test instruction.";

            // Shipping type and shipping service options
            sd.ShippingType = ShippingTypeCodeType.Flat;
            ShippingServiceOptionsType shippingOptions = new ShippingServiceOptionsType();
            shippingOptions.ShippingService = 
                ShippingServiceCodeType.ShippingMethodStandard.ToString();
            amount = new AmountType();
            amount.Value = 2.0;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingServiceAdditionalCost = amount;
            amount = new AmountType();
            amount.Value = 1;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingServiceCost = amount;
            shippingOptions.ShippingServicePriority = 1;
            amount = new AmountType();
            amount.Value = 1.0;
            amount.currencyID = CurrencyCodeType.USD;
            shippingOptions.ShippingInsuranceCost = amount;

            sd.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection(
                new ShippingServiceOptionsType[] { shippingOptions }
                );

            return sd;
        }
Esempio n. 22
0
        private ShippingDetailsType getShippingDetails()
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            AmountType at = new AmountType();
            sd.PaymentInstructions = eBayLister.UserSettings.Default.paymentInstructions;
            sd.ShippingType = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
            st1.ShippingService = ShippingServiceCodeType.IN_Express.ToString();

            at = new AmountType();
            at.currencyID = CurrencyCodeType.INR;
            at.Value = Convert.ToDouble(eBayLister.UserSettings.Default.shippingCost) *
                                        Convert.ToDouble(eBayLister.UserSettings.Default.ConversionRate);
            st1.ShippingServiceCost = at;
            ShippingServiceOptionsTypeCollection serviceOptions = new ShippingServiceOptionsTypeCollection();
            serviceOptions.Add(st1);
            sd.ShippingServiceOptions = serviceOptions;
            return sd;
        }