/// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public void SendInvoice(string ItemID, string TransactionID, ShippingServiceOptionsTypeCollection ShippingServiceOptionsList)
 {
     this.ItemID        = ItemID;
     this.TransactionID = TransactionID;
     this.ShippingServiceOptionsList = ShippingServiceOptionsList;
     Execute();
 }
Exemple #2
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;
        }
Exemple #3
0
 private EbayExporter(string hostname) : base(hostname)
 {
     this.hostname          = hostname;
     ebayProduct            = new ebay_product();
     shipping_domestic      = new ShippingServiceOptionsTypeCollection();
     shipping_international = new InternationalShippingServiceOptionsTypeCollection();
 }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public virtual ICollection GetShippingServiceOptions()
        {
            ShippingServiceOptionsTypeCollection ssos = new ShippingServiceOptionsTypeCollection();

            int row = this.Items.Count;
            int col = this.Items[0].SubItems.Count;

            int cnt = 0;

            for (int i = 0; i < row; i++)
            {
                ListViewItem lvi = this.Items[i];
                //ShippingService
                string text = lvi.SubItems[0].Text;
                if (text.Length > 0)
                {
                    if (!text.Equals("NotSelected"))
                    {
                        cnt++;
                        ShippingServiceOptionsType sso = new ShippingServiceOptionsType();
                        sso.ShippingService         = text;
                        sso.ShippingServicePriority = cnt;
                        ssos.Add(sso);
                        if (col > 1)
                        {
                            // ShippingServiceCost
                            text = lvi.SubItems[1].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceCost = CurrencyUtility.GetAmountType(text);
                            }
                            // ShippingServiceAdditioanlCost
                            text = lvi.SubItems[2].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceAdditionalCost = CurrencyUtility.GetAmountType(text);
                            }
                        }
                    }
                }
            }
            return(ssos);
        }
Exemple #5
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);
        }
Exemple #6
0
 /// <summary>
 /// For backward compatibility with old wrappers.
 /// </summary>
 public void SendInvoice(string ItemID, string TransactionID, ShippingServiceOptionsTypeCollection ShippingServiceOptionsList)
 {
     this.ItemID = ItemID;
     this.TransactionID = TransactionID;
     this.ShippingServiceOptionsList = ShippingServiceOptionsList;
     Execute();
 }
Exemple #7
0
        /// <summary>
        /// Enables a seller to send an order invoice to a buyer. Where applicable, updates to shipping, payment methods, and sales tax made in this request are applied to the specified order as a whole and to the individual order line items whose data are stored in individual <b>Transaction</b> objects.
        /// </summary>
        /// 
        /// <param name="ItemID">
        /// Unique identifier for an eBay item listing. Unless <b>OrderID</b> or
        /// <b>OrderLineItemID</b> is provided in the request, the <b>ItemID</b> (or <b>SKU</b>) is
        /// required and must be paired with the corresponding <b>TransactionID</b> to
        /// identify a single line item order. For a multiple line item (Combined Invoice) order, <b>OrderID</b> should be used.
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for an eBay order line item (transaction). An order
        /// line item is created once there is a commitment from a buyer to purchase
        /// an item. Since an auction listing can only have one order line item
        /// during the duration of the listing, the <b>TransactionID</b> for
        /// auction listings is always 0. Unless <b>OrderID</b> or <b>OrderLineItemID</b> is
        /// provided in the request, the <b>TransactionID</b> is required and must be
        /// paired with the corresponding <b>ItemID</b> to identify a single line item
        /// order. For a multiple line item (Combined Invoice) order, <b>OrderID</b> should
        /// be used.
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line
        /// item (Combined Invoice) orders.
        /// 
        /// For a single line item order, the <b>OrderID</b> value is identical to the
        /// <b>OrderLineItemID</b> value that is generated upon creation of the order line
        /// item. For a Combined Invoice order, the <b>OrderID</b> value is created by eBay
        /// when the buyer or seller (sharing multiple, common order line items)
        /// combines multiple order line items into a Combined Invoice order. A
        /// Combined Invoice order can also be created by the seller through the
        /// <b>AddOrder</b> call.
        /// 
        /// Unless the <b>ItemID</b> (or SKU) and corresponding <b>TransactionID</b>, or the
        /// <b>OrderLineItemID</b> is provided in the request to identify a single line
        /// item order, the <b>OrderID</b> must be specified. If <b>OrderID</b> is specified,
        /// <b>OrderLineItemID</b>, <b>ItemID</b>, <b>TransactionID</b>, and <b>SKU</b> are ignored if present
        /// in the same request.
        /// </param>
        ///
        /// <param name="InternationalShippingServiceOptionsList">
        /// If the buyer has an International shipping address, use this container
        /// to offer up to three International shipping services. If International
        /// shipping services are offered, (domestic) <b>ShippingServiceOptions</b> should
        /// not be included in the request.
        /// 
        /// </param>
        ///
        /// <param name="ShippingServiceOptionsList">
        /// If the buyer has a domestic shipping address, use this container
        /// to offer up to three domestic shipping services. If domestic
        /// shipping services are offered, <b>InternationalShippingServiceOptions</b> should
        /// not be included in the request.
        /// 
        /// </param>
        ///
        /// <param name="SalesTax">
        /// Container consisting of sales tax details. The amount of sales tax to
        /// add to the price of an order is dependent on the sales tax rate in the
        /// buyer's state and whether sales tax is being applied to the cost of the
        /// order only or the cost of the order plus shipping.
        /// </param>
        ///
        /// <param name="InsuranceOption">
        /// Specifies whether an insurance fee is required. An <b>InsuranceOption</b> value of
        /// <b>IncludedInShippingHandling</b> cannot be used if the item will use calculated
        /// shipping. Some shipping carriers automatically include shipping insurance
        /// for qualifying items.
        /// </param>
        ///
        /// <param name="InsuranceFee">
        /// Insurance cost, as set by seller, if ShippingType = 1.
        /// Specify if <b>InsuranceOption</b> is optional or required. Must
        /// be greater than zero value if a value of Optional or Required is passed in
        /// <b>InsuranceOption</b>. Value specified should be the total cost of insuring the
        /// item.
        /// </param>
        ///
        /// <param name="PaymentMethodsList">
        /// This optional field allows a US or German seller to add specific payment
        /// methods that were not in the original item listing. The only valid values
        /// for this field are 'PayPal' for a US listing, or
        /// 'MoneyXferAcceptedInCheckout' (CIP+) for a DE listing.
        /// </param>
        ///
        /// <param name="PayPalEmailAddress">
        /// If the <b>PaymentMethods</b> field is used and set to PayPal, the seller
        /// provides his/her PayPal email address in this field.
        /// </param>
        ///
        /// <param name="CheckoutInstructions">
        /// This field allows the seller to provide a message or instructions
        /// regarding checkout/payment or the return policy.
        /// </param>
        ///
        /// <param name="EmailCopyToSeller">
        /// Flag indicating whether or not the seller wishes to receive an email copy of
        /// the invoice sent to the buyer.
        /// </param>
        ///
        /// <param name="CODCost">
        /// This dollar value indicates the money due from the buyer upon delivery of the item.
        /// 
        /// This field should only be specified in the <b>SendInvoice</b> request if 'COD' 
        /// (cash-on-delivery) was the payment method selected by the buyer and it is included
        /// as the <b>PaymentMethods</b> value in the same request.
        /// </param>
        ///
        /// <param name="SKU">
        /// The seller's unique identifier for an item that is being tracked by this
        /// SKU. If <b>OrderID</b> or <b>OrderLineItemID</b> are not provided, both <b>SKU</b> (or
        /// <b>ItemID</b>) and corresponding <b>TransactionID</b> must be provided to uniquely
        /// identify a single line item order. For a multiple line item (Combined Invoice) order, <b>OrderID</b> must be used.
        /// 
        /// 
        /// This field can only be used if the <b>Item.InventoryTrackingMethod</b> field
        /// (set with the <b>AddFixedPriceItem</b> or <b>RelistFixedPriceItem</b> calls) is set to
        /// SKU.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// A unique identifier for an eBay order line item. This field is created
        /// as soon as there is a commitment to buy from the seller, and its value
        /// is based upon the concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a
        /// hyphen in between these two IDs.
        /// 
        /// 
        /// Unless the <b>ItemID</b> (or <b>SKU</b>) and corresponding <b>TransactionID</b> is used to
        /// identify a single line item order, or the <b>OrderID</b> is used to identify a
        /// single or multiple line item (Combined Invoice) order, the
        /// <b>OrderLineItemID</b> must be specified. For a multiple line item (Combined Invoice) order, <b>OrderID</b> should be used. If <b>OrderLineItemID</b> is specified,
        /// <b>ItemID</b>, <b>TransactionID</b>, and <b>SKU</b> are ignored if present in the same
        /// request.
        /// </param>
        ///
        /// <param name="AdjustmentAmount">
        /// This field allows the seller to adjust the total cost of the order to account
        /// for an extra charge or to pass down a discount to the buyer. 
        /// 
        /// The currency used in this field must be the same currency of the listing site.
        /// A positive value in this field indicates that the amount is an extra charge
        /// being paid to the seller by the buyer, and a negative value indicates that the
        /// amount is a discount given to the buyer by the seller. 
        /// </param>
        ///
        public void SendInvoice(string ItemID, string TransactionID, string OrderID, InternationalShippingServiceOptionsTypeCollection InternationalShippingServiceOptionsList, ShippingServiceOptionsTypeCollection ShippingServiceOptionsList, SalesTaxType SalesTax, InsuranceOptionCodeType InsuranceOption, AmountType InsuranceFee, BuyerPaymentMethodCodeTypeCollection PaymentMethodsList, string PayPalEmailAddress, string CheckoutInstructions, bool EmailCopyToSeller, AmountType CODCost, string SKU, string OrderLineItemID, AmountType AdjustmentAmount)
        {
            this.ItemID = ItemID;
            this.TransactionID = TransactionID;
            this.OrderID = OrderID;
            this.InternationalShippingServiceOptionsList = InternationalShippingServiceOptionsList;
            this.ShippingServiceOptionsList = ShippingServiceOptionsList;
            this.SalesTax = SalesTax;
            this.InsuranceOption = InsuranceOption;
            this.InsuranceFee = InsuranceFee;
            this.PaymentMethodsList = PaymentMethodsList;
            this.PayPalEmailAddress = PayPalEmailAddress;
            this.CheckoutInstructions = CheckoutInstructions;
            this.EmailCopyToSeller = EmailCopyToSeller;
            this.CODCost = CODCost;
            this.SKU = SKU;
            this.OrderLineItemID = OrderLineItemID;
            this.AdjustmentAmount = AdjustmentAmount;

            Execute();
        }
        /// <summary>
        /// Enables a seller to send an order invoice to a buyer. Where applicable, updates to shipping, payment methods, and sales tax made in this request are applied to the specified order as a whole and to the individual order line items whose data are stored in individual <b>Transaction</b> objects.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for an eBay item listing. Unless <b>OrderID</b> or
        /// <b>OrderLineItemID</b> is provided in the request, the <b>ItemID</b> (or <b>SKU</b>) is
        /// required and must be paired with the corresponding <b>TransactionID</b> to
        /// identify a single line item order. For a multiple line item (Combined
        /// Payment) order, <b>OrderID</b> should be used.
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for an eBay order line item (transaction). An order
        /// line item is created once there is a commitment from a buyer to purchase
        /// an item. Since an auction listing can only have one order line item
        /// during the duration of the listing, the <b>TransactionID</b> for
        /// auction listings is always 0. Unless <b>OrderID</b> or <b>OrderLineItemID</b> is
        /// provided in the request, the <b>TransactionID</b> is required and must be
        /// paired with the corresponding <b>ItemID</b> to identify a single line item
        /// order. For a multiple line item (Combined Payment) order, <b>OrderID</b> should
        /// be used.
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line
        /// item (Combined Payment) orders.
        ///
        /// For a single line item order, the <b>OrderID</b> value is identical to the
        /// <b>OrderLineItemID</b> value that is generated upon creation of the order line
        /// item. For a Combined Payment order, the <b>OrderID</b> value is created by eBay
        /// when the buyer or seller (sharing multiple, common order line items)
        /// combines multiple order line items into a Combined Payment order. A
        /// Combined Payment order can also be created by the seller through the
        /// <b>AddOrder</b> call.
        ///
        /// Unless the <b>ItemID</b> (or SKU) and corresponding <b>TransactionID</b>, or the
        /// <b>OrderLineItemID</b> is provided in the request to identify a single line
        /// item order, the <b>OrderID</b> must be specified. If <b>OrderID</b> is specified,
        /// <b>OrderLineItemID</b>, <b>ItemID</b>, <b>TransactionID</b>, and <b>SKU</b> are ignored if present
        /// in the same request.
        /// </param>
        ///
        /// <param name="InternationalShippingServiceOptionsList">
        /// If the buyer has an International shipping address, use this container
        /// to offer up to three International shipping services. If International
        /// shipping services are offered, (domestic) <b>ShippingServiceOptions</b> should
        /// not be included in the request.
        ///
        /// </param>
        ///
        /// <param name="ShippingServiceOptionsList">
        /// If the buyer has a domestic shipping address, use this container
        /// to offer up to three domestic shipping services. If domestic
        /// shipping services are offered, <b>InternationalShippingServiceOptions</b> should
        /// not be included in the request.
        ///
        /// </param>
        ///
        /// <param name="SalesTax">
        /// Container consisting of sales tax details. The amount of sales tax to
        /// add to the price of an order is dependent on the sales tax rate in the
        /// buyer's state and whether sales tax is being applied to the cost of the
        /// order only or the cost of the order plus shipping.
        /// </param>
        ///
        /// <param name="InsuranceOption">
        /// Specifies whether an insurance fee is required. An <b>InsuranceOption</b> value of
        /// <b>IncludedInShippingHandling</b> cannot be used if the item will use calculated
        /// shipping. Some shipping carriers automatically include shipping insurance
        /// for qualifying items.
        /// </param>
        ///
        /// <param name="InsuranceFee">
        /// Insurance cost, as set by seller, if ShippingType = 1.
        /// Specify if <b>InsuranceOption</b> is optional or required. Must
        /// be greater than zero value if a value of Optional or Required is passed in
        /// <b>InsuranceOption</b>. Value specified should be the total cost of insuring the
        /// item.
        /// </param>
        ///
        /// <param name="PaymentMethodsList">
        /// This optional field allows a US or German seller to add specific payment
        /// methods that were not in the original item listing. The only valid values
        /// for this field are 'PayPal' for a US listing, or
        /// 'MoneyXferAcceptedInCheckout' (CIP+) for a DE listing.
        /// </param>
        ///
        /// <param name="PayPalEmailAddress">
        /// If the <b>PaymentMethods</b> field is used and set to PayPal, the seller
        /// provides his/her PayPal email address in this field.
        /// </param>
        ///
        /// <param name="CheckoutInstructions">
        /// This field allows the seller to provide a message or instructions
        /// regarding checkout/payment or the return policy.
        /// </param>
        ///
        /// <param name="EmailCopyToSeller">
        /// Flag indicating whether or not the seller wishes to receive an email copy of
        /// the invoice sent to the buyer.
        /// </param>
        ///
        /// <param name="CODCost">
        /// This dollar value indicates the money due from the buyer upon delivery of the item.
        ///
        /// This field should only be specified in the <b>SendInvoice</b> request if 'COD'
        /// (cash-on-delivery) was the payment method selected by the buyer and it is included
        /// as the <b>PaymentMethods</b> value in the same request.
        /// </param>
        ///
        /// <param name="SKU">
        /// The seller's unique identifier for an item that is being tracked by this
        /// SKU. If <b>OrderID</b> or <b>OrderLineItemID</b> are not provided, both <b>SKU</b> (or
        /// <b>ItemID</b>) and corresponding <b>TransactionID</b> must be provided to uniquely
        /// identify a single line item order. For a multiple line item (Combined
        /// Payment) order, <b>OrderID</b> must be used.
        ///
        ///
        /// This field can only be used if the <b>Item.InventoryTrackingMethod</b> field
        /// (set with the <b>AddFixedPriceItem</b> or <b>RelistFixedPriceItem</b> calls) is set to
        /// SKU.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// A unique identifier for an eBay order line item. This field is created
        /// as soon as there is a commitment to buy from the seller, and its value
        /// is based upon the concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a
        /// hyphen in between these two IDs.
        ///
        ///
        /// Unless the <b>ItemID</b> (or <b>SKU</b>) and corresponding <b>TransactionID</b> is used to
        /// identify a single line item order, or the <b>OrderID</b> is used to identify a
        /// single or multiple line item (Combined Payment) order, the
        /// <b>OrderLineItemID</b> must be specified. For a multiple line item (Combined
        /// Payment) order, <b>OrderID</b> should be used. If <b>OrderLineItemID</b> is specified,
        /// <b>ItemID</b>, <b>TransactionID</b>, and <b>SKU</b> are ignored if present in the same
        /// request.
        /// </param>
        ///
        /// <param name="AdjustmentAmount">
        /// This field allows the seller to adjust the total cost of the order to account
        /// for an extra charge or to pass down a discount to the buyer.
        ///
        /// The currency used in this field must be the same currency of the listing site.
        /// A positive value in this field indicates that the amount is an extra charge
        /// being paid to the seller by the buyer, and a negative value indicates that the
        /// amount is a discount given to the buyer by the seller.
        /// </param>
        ///
        public void SendInvoice(string ItemID, string TransactionID, string OrderID, InternationalShippingServiceOptionsTypeCollection InternationalShippingServiceOptionsList, ShippingServiceOptionsTypeCollection ShippingServiceOptionsList, SalesTaxType SalesTax, InsuranceOptionCodeType InsuranceOption, AmountType InsuranceFee, BuyerPaymentMethodCodeTypeCollection PaymentMethodsList, string PayPalEmailAddress, string CheckoutInstructions, bool EmailCopyToSeller, AmountType CODCost, string SKU, string OrderLineItemID, AmountType AdjustmentAmount)
        {
            this.ItemID        = ItemID;
            this.TransactionID = TransactionID;
            this.OrderID       = OrderID;
            this.InternationalShippingServiceOptionsList = InternationalShippingServiceOptionsList;
            this.ShippingServiceOptionsList = ShippingServiceOptionsList;
            this.SalesTax             = SalesTax;
            this.InsuranceOption      = InsuranceOption;
            this.InsuranceFee         = InsuranceFee;
            this.PaymentMethodsList   = PaymentMethodsList;
            this.PayPalEmailAddress   = PayPalEmailAddress;
            this.CheckoutInstructions = CheckoutInstructions;
            this.EmailCopyToSeller    = EmailCopyToSeller;
            this.CODCost          = CODCost;
            this.SKU              = SKU;
            this.OrderLineItemID  = OrderLineItemID;
            this.AdjustmentAmount = AdjustmentAmount;

            Execute();
        }
Exemple #9
0
        private void BtnSendInvoice_Click(object sender, System.EventArgs e)
        {
            try
            {
                SendInvoiceCall apicall = new SendInvoiceCall(Context);

                TxtStatus.Text = "";
                string ItemID        = TxtItemId.Text;
                string TransactionID = TxtTransactionId.Text;

                ShippingServiceOptionsType ShippingServiceOption = new ShippingServiceOptionsType();

                ShippingServiceOption.ShippingInsuranceCost            = new AmountType();
                ShippingServiceOption.ShippingInsuranceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingInsuranceCost.Value      = Convert.ToDouble(TxtShippingInsuranceCost.Text);

                ShippingServiceOption.ShippingService = CboShippingService.SelectedItem.ToString();

                ShippingServiceOption.ShippingServiceCost            = new AmountType();
                ShippingServiceOption.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingServiceCost.Value      = Convert.ToDouble(TxtShippingServiceCost.Text);


                ShippingServiceOption.ShippingServiceAdditionalCost = new AmountType();

                ShippingServiceOption.ShippingServiceAdditionalCost.Value      = Convert.ToDouble(TxtShippingServiceAdditionalCost.Text);
                ShippingServiceOption.ShippingServiceAdditionalCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingServicePriority = Int32.Parse(TxtShippingServicePriority.Text);

                //SaleTaxType related
                apicall.SalesTax = new SalesTaxType();
                apicall.SalesTax.SalesTaxPercent       = (float)Convert.ToDouble(TxtSalesTaxPercent.Text);
                apicall.SalesTax.SalesTaxState         = TxtSalesTaxState.Text;
                apicall.SalesTax.ShippingIncludedInTax = ChkShippingIncludedInTax.Checked;

                apicall.SalesTax.SalesTaxAmount            = new AmountType();
                apicall.SalesTax.SalesTaxAmount.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                apicall.SalesTax.SalesTaxAmount.Value      = Convert.ToDouble(TxtSalesTaxAmount.Text);


                apicall.InsuranceOption = (InsuranceOptionCodeType)Enum.Parse(typeof(InsuranceOptionCodeType), CboInsuranceOption.SelectedItem.ToString());

                apicall.InsuranceFee            = new AmountType();
                apicall.InsuranceFee.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                apicall.InsuranceFee.Value      = Convert.ToDouble(TxtInsuranceFee.Text);

                apicall.PaymentMethodsList = new BuyerPaymentMethodCodeTypeCollection();
                apicall.PaymentMethodsList.Add((BuyerPaymentMethodCodeType)Enum.Parse(typeof(BuyerPaymentMethodCodeType), CboPaymentMethod.SelectedItem.ToString()));

                apicall.PayPalEmailAddress   = TxtPayPalEmailAddress.Text;
                apicall.CheckoutInstructions = TxtCheckoutInstructions.Text;
                apicall.EmailCopyToSeller    = ChkEmailCopyToSeller.Checked;

                ShippingServiceOptionsTypeCollection ShippingServiceOptionsList = new ShippingServiceOptionsTypeCollection();
                ShippingServiceOptionsList.Add(ShippingServiceOption);

                apicall.SendInvoice(ItemID, TransactionID, ShippingServiceOptionsList);
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
		private void BtnSendInvoice_Click(object sender, System.EventArgs e)
		{
			try
			{
				SendInvoiceCall apicall = new SendInvoiceCall(Context);

				TxtStatus.Text = "";
				string ItemID = TxtItemId.Text;
				string TransactionID = TxtTransactionId.Text;

				ShippingServiceOptionsType ShippingServiceOption = new ShippingServiceOptionsType();
				
				ShippingServiceOption.ShippingInsuranceCost = new AmountType();
				ShippingServiceOption.ShippingInsuranceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingInsuranceCost.Value = Convert.ToDouble(TxtShippingInsuranceCost.Text);
					
				ShippingServiceOption.ShippingService = CboShippingService.SelectedItem.ToString();

				ShippingServiceOption.ShippingServiceCost = new AmountType();
				ShippingServiceOption.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingServiceCost.Value=Convert.ToDouble(TxtShippingServiceCost.Text);

				
				ShippingServiceOption.ShippingServiceAdditionalCost = new AmountType();

				ShippingServiceOption.ShippingServiceAdditionalCost.Value=Convert.ToDouble(TxtShippingServiceAdditionalCost.Text);
				ShippingServiceOption.ShippingServiceAdditionalCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingServicePriority = Int32.Parse(TxtShippingServicePriority.Text);

				//SaleTaxType related
				apicall.SalesTax = new SalesTaxType();
				apicall.SalesTax.SalesTaxPercent = (float)Convert.ToDouble(TxtSalesTaxPercent.Text);
				apicall.SalesTax.SalesTaxState = TxtSalesTaxState.Text;
				apicall.SalesTax.ShippingIncludedInTax = ChkShippingIncludedInTax.Checked;

				apicall.SalesTax.SalesTaxAmount = new AmountType();
				apicall.SalesTax.SalesTaxAmount.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				apicall.SalesTax.SalesTaxAmount.Value = Convert.ToDouble(TxtSalesTaxAmount.Text);
				
        
				apicall.InsuranceOption = (InsuranceOptionCodeType)Enum.Parse(typeof(InsuranceOptionCodeType), CboInsuranceOption.SelectedItem.ToString());
				
				apicall.InsuranceFee = new AmountType();
				apicall.InsuranceFee.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				apicall.InsuranceFee.Value = Convert.ToDouble(TxtInsuranceFee.Text);

				apicall.PaymentMethodsList = new BuyerPaymentMethodCodeTypeCollection();
				apicall.PaymentMethodsList.Add((BuyerPaymentMethodCodeType)Enum.Parse(typeof(BuyerPaymentMethodCodeType), CboPaymentMethod.SelectedItem.ToString()));
				
				apicall.PayPalEmailAddress = TxtPayPalEmailAddress.Text;
				apicall.CheckoutInstructions = TxtCheckoutInstructions.Text;
				apicall.EmailCopyToSeller = ChkEmailCopyToSeller.Checked;

				ShippingServiceOptionsTypeCollection ShippingServiceOptionsList= new ShippingServiceOptionsTypeCollection();
				ShippingServiceOptionsList.Add(ShippingServiceOption);

				apicall.SendInvoice(ItemID, TransactionID, ShippingServiceOptionsList);
				TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public virtual ICollection GetShippingServiceOptions()
        {
            ShippingServiceOptionsTypeCollection ssos = new ShippingServiceOptionsTypeCollection();

            int row = this.Items.Count;
            int col = this.Items[0].SubItems.Count;

            int cnt = 0;
            for (int i = 0; i < row; i++)
            {
                ListViewItem lvi = this.Items[i];
                //ShippingService
                string text = lvi.SubItems[0].Text;
                if (text.Length > 0)
                {
                    if (!text.Equals("NotSelected"))
                    {
                        cnt++;
                        ShippingServiceOptionsType sso = new ShippingServiceOptionsType();
                        sso.ShippingService = text;
                        sso.ShippingServicePriority = cnt;
                        ssos.Add(sso);
                        if (col > 1)
                        {
                            // ShippingServiceCost
                            text = lvi.SubItems[1].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceCost = CurrencyUtility.GetAmountType(text);
                            }
                            // ShippingServiceAdditioanlCost
                            text = lvi.SubItems[2].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceAdditionalCost = CurrencyUtility.GetAmountType(text);
                            }
                        }
                    }
                }
            }
            return ssos;
        }
Exemple #12
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;
        }