Ejemplo n.º 1
0
 /// <summary>
 /// return the AmountType object from an amount string in following format:
 ///		$amt or (LBP)amt
 /// </summary>
 /// <param name="amtStr">an amount string</param>
 /// <returns>an AmountType</returns>
 public static AmountType GetAmountType(string amtStr)
 {
     if (amtStr == null || amtStr.Trim().Length == 0)
         return null;
     if (amtStr.StartsWith("$"))
     {
         string v = amtStr.Substring(1, amtStr.Length - 1);
         AmountType amt = new AmountType();
         amt.currencyID = CurrencyCodeType.USD;
         amt.Value = Convert.ToDouble(v);
         return amt;
     }
     else
     {
         int idx = amtStr.IndexOf(")");
         if (idx > 0)
         {
             string v = amtStr.Substring(idx + 1, amtStr.Length - idx - 1);
             AmountType amt = new AmountType();
             string symbol = amtStr.Substring(1, idx - 1);
             amt.currencyID = (CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), symbol);
             amt.Value = Convert.ToDouble(v);
             return amt;
         }
         else
         {
             AmountType amt = new AmountType();
             amt.currencyID = CurrencyCodeType.USD;
             amt.Value = Convert.ToDouble(amtStr);
             return amt;
         }
     }
 }
        public void SetShippingDiscountProfilesLibrary()
        {
            SetShippingDiscountProfilesCall api = new SetShippingDiscountProfilesCall(apiContext);
            CalculatedHandlingDiscountType calcHandlingDiscount = new CalculatedHandlingDiscountType();
            calcHandlingDiscount.DiscountName = HandlingNameCodeType.IndividualHandlingFee;
            AmountType amount = new AmountType();
            amount.Value = 123.45;
            calcHandlingDiscount.OrderHandlingAmount = amount;
            FlatShippingDiscountType flatShippingDiscount = new FlatShippingDiscountType();
            flatShippingDiscount.DiscountName = DiscountNameCodeType.IndividualItemWeight;
            //
            CalculatedShippingDiscountType calcShippingDiscount = new CalculatedShippingDiscountType();
            calcShippingDiscount.DiscountName = DiscountNameCodeType.EachAdditionalAmount;
            ShippingInsuranceType shipInsurType = new ShippingInsuranceType();
            shipInsurType.InsuranceOption = InsuranceOptionCodeType.Optional;
            ShippingInsuranceType internInsurType = shipInsurType;
            PromotionalShippingDiscountDetailsType promoShippingDiscountDetails = new PromotionalShippingDiscountDetailsType();
            promoShippingDiscountDetails.DiscountName = DiscountNameCodeType.MaximumShippingCostPerOrder;

            try
            {
                api.SetShippingDiscountProfiles(CurrencyCodeType.USD, CombinedPaymentPeriodCodeType.Days_14,
                                                ModifyActionCodeType.Add, flatShippingDiscount, calcShippingDiscount,
                                                calcHandlingDiscount, promoShippingDiscountDetails,
                                                shipInsurType, internInsurType);
            }
            catch(ApiException apie)
            {
                Console.WriteLine("ApiException: " + apie.Message);
            }
            catch(SdkException sdke)
            {
                Assert.Fail("SdkException: " + sdke.Message);
            }
        }
Ejemplo n.º 3
0
 public AmountInfo(string amountwithCurrency, string separator, AmountType? type)
 {
     CultureInfo ci = (CultureInfo)CultureInfo.InvariantCulture.Clone();
     ci.NumberFormat.CurrencyDecimalSeparator = separator;
     var numAmount = decimal.Parse(amountwithCurrency.Substring(0, amountwithCurrency.Length - 3).Trim(), ci);
     if (type != null)
     {
         Type = type.Value;
     }
     Amount = Math.Abs(numAmount);
     Currency = amountwithCurrency.Substring(amountwithCurrency.Length - 3);
 }
 public void AddTransactionConfirmationItem()
 {
     AddTransactionConfirmationItemCall api = new AddTransactionConfirmationItemCall(this.apiContext);
     ApiException gotException = null;
     try
     {
         AmountType a = new AmountType();
         a.Value = 2.0;
         a.currencyID = CurrencyCodeType.USD;
         api.AddTransactionConfirmationItem("apitest20", "true", "94566", RecipientRelationCodeType.Item1, a, SecondChanceOfferDurationCodeType.Days_7, "1111111111", "Comment");
     }
     catch (ApiException ex)
     {
         gotException = ex;
     }
     Assert.IsNotNull(gotException);
 }
Ejemplo n.º 5
0
        public AmountInfo(string amount, string currency, string separator, AmountType? type)
        {
            CultureInfo ci = (CultureInfo)CultureInfo.InvariantCulture.Clone();
            ci.NumberFormat.CurrencyDecimalSeparator = separator;
            var numAmount = decimal.Parse(amount.Trim());
            if (type != null)
            {
                Type = type.Value;
            }
            else
            {
                Type = numAmount >= 0 ? AmountType.Credit : AmountType.Debit;
            }
            {

            }
            Amount = Math.Abs(numAmount);
            Currency = currency;
        }
        public void SetShippingDiscountProfilesLibrary()
        {
            SetShippingDiscountProfilesCall api = new SetShippingDiscountProfilesCall(apiContext);
            CalculatedHandlingDiscountType  calcHandlingDiscount = new CalculatedHandlingDiscountType();

            calcHandlingDiscount.DiscountName = HandlingNameCodeType.IndividualHandlingFee;
            AmountType amount = new AmountType();

            amount.Value = 123.45;
            calcHandlingDiscount.OrderHandlingAmount = amount;
            FlatShippingDiscountType flatShippingDiscount = new FlatShippingDiscountType();

            flatShippingDiscount.DiscountName = DiscountNameCodeType.IndividualItemWeight;
            //
            CalculatedShippingDiscountType calcShippingDiscount = new CalculatedShippingDiscountType();

            calcShippingDiscount.DiscountName = DiscountNameCodeType.EachAdditionalAmount;
            ShippingInsuranceType shipInsurType = new ShippingInsuranceType();

            shipInsurType.InsuranceOption = InsuranceOptionCodeType.Optional;
            ShippingInsuranceType internInsurType = shipInsurType;
            PromotionalShippingDiscountDetailsType promoShippingDiscountDetails = new PromotionalShippingDiscountDetailsType();

            promoShippingDiscountDetails.DiscountName = DiscountNameCodeType.MaximumShippingCostPerOrder;

            try
            {
                api.SetShippingDiscountProfiles(CurrencyCodeType.USD, CombinedPaymentPeriodCodeType.Days_14,
                                                ModifyActionCodeType.Add, flatShippingDiscount, calcShippingDiscount,
                                                calcHandlingDiscount, promoShippingDiscountDetails,
                                                shipInsurType, internInsurType);
            }
            catch (ApiException apie)
            {
                Console.WriteLine("ApiException: " + apie.Message);
            }
            catch (SdkException sdke)
            {
                Assert.Fail("SdkException: " + sdke.Message);
            }
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteAttributeString("ItemID", ItemID);
     writer.WriteAttributeString("MinBuyout", MinBuyout.ToString());
     writer.WriteAttributeString("MaxBuyout", MaxBuyout.ToString());
     writer.WriteAttributeString("RunTime", RunTime.ToString());
     writer.WriteAttributeString("Amount", Amount.ToString());
     writer.WriteAttributeString("StackSize", StackSize.ToString());
     writer.WriteAttributeString("AmountType", AmountType.ToString());
     writer.WriteAttributeString("AutoFindAh", AutoFindAh.ToString());
     writer.WriteAttributeString("BidPrecent", BidPrecent.ToString(CultureInfo.InvariantCulture));
     writer.WriteAttributeString("UndercutPrecent", UndercutPrecent.ToString(CultureInfo.InvariantCulture));
     writer.WriteAttributeString("UseCategory", UseCategory.ToString());
     writer.WriteAttributeString("Category", Category.ToString());
     writer.WriteAttributeString("SubCategoryType", SubCategory.GetType().Name);
     writer.WriteAttributeString("SubCategory", SubCategory.ToString());
     writer.WriteAttributeString("X", loc.X.ToString());
     writer.WriteAttributeString("Y", loc.Y.ToString());
     writer.WriteAttributeString("Z", loc.Z.ToString());
     writer.WriteAttributeString("PostIfBelowMinBuyout", PostIfBelowMinBuyout.ToString());
 }
Ejemplo n.º 9
0
        public Account(
            int tenantId,
            ushort accountNumber,
            string name,
            string description,
            int accountTypeId,
            int assetTypeId,
            AmountType normalBalanceType,
            Guid createdById)
        {
            TenantId          = tenantId;
            AccountNumber     = accountNumber;
            Name              = name;
            Description       = description;
            AccountTypeId     = accountTypeId;
            AssetTypeId       = assetTypeId;
            NormalBalanceType = normalBalanceType;
            CreatedById       = createdById;

            CurrentBalance = 0.0m;
        }
        private void BtnGetItem_Click(object sender, System.EventArgs e)
        {
            FrmGetItem form = new FrmGetItem();

            form.Context = Context;
            form.ShowDialog();
            fetchedItem = form.getItem();
            if (fetchedItem != null)
            {
                TxtTitle.Text           = fetchedItem.Title;
                TxtPrimaryCategory.Text = fetchedItem.PrimaryCategory.CategoryID;
                CategoryType secondaryCategory = fetchedItem.SecondaryCategory;
                TxtSecondaryCategory.Text = (secondaryCategory != null)?secondaryCategory.CategoryID:"";
                TxtStartPrice.Text        = fetchedItem.SellingStatus.CurrentPrice.Value.ToString();
                AmountType amt = fetchedItem.ReservePrice;
                TxtReservePrice.Text = (amt == null)?"":amt.Value.ToString();
                amt = fetchedItem.BuyItNowPrice;
                TxtBuyItNowPrice.Text = (amt == null)?"":amt.Value.ToString();
                TxtItemID.Text        = fetchedItem.ItemID;
            }
        }
Ejemplo n.º 11
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);
        }
Ejemplo n.º 12
0
 public Experiencebar(Yat yat,
                      Texture2D cage,
                      Texture2D health,
                      SpriteFont font,
                      Vector2 position,
                      Resize resize,
                      int startValue,
                      int maxValue,
                      AmountType amountType)
 {
     this.yat        = yat;
     this.cage       = cage;
     this.health     = health;
     this.font       = font;
     this.Position   = position;
     this.resize     = resize;
     this.startValue = startValue;
     this.maxValue   = maxValue;
     this.Value      = maxValue;
     this.amountType = amountType;
     this.margin     = (cage.Width - health.Width) / 2;
 }
Ejemplo 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);
        }
		public void PlaceOfferFull()
		{
			string originalToken = this.apiContext.ApiCredential.eBayToken;

			try
			{

				Assert.IsNotNull(TestData.ChineseAuctionItem,"ChineseAuctionItem is null");
				ItemType item=TestData.ChineseAuctionItem;
				//change user
				this.apiContext.ApiCredential.eBayToken=TestData.BuyerToken;

				PlaceOfferCall api=new PlaceOfferCall(this.apiContext);
				api.ItemID=TestData.ChineseAuctionItem.ItemID;

				OfferType offer = new OfferType();
				offer.Action = BidActionCodeType.Bid;
				offer.Quantity = 1;
				AmountType at = new AmountType();
				at.Value = 1;
				offer.ConvertedPrice = at;
				at.Value=2;
				offer.MaxBid=at;
				api.Offer=offer;
                api.AbstractRequest.EndUserIP = "10.249.72.135";
			
				api.Execute();

				//check whether the call is success.
				Assert.IsTrue(api.ApiResponse.Ack==AckCodeType.Success || api.ApiResponse.Ack==AckCodeType.Warning,"do not success!");
			}
			finally
			{
				//reset token
				this.apiContext.ApiCredential.eBayToken=originalToken;
			}
			
		}
Ejemplo n.º 15
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);
        }
Ejemplo n.º 16
0
 public static string getAmountTypeText(AmountType type)
 {
     if (type == AmountType.P100)
     {
         return("100%최대");
     }
     else if (type == AmountType.P50)
     {
         return("50%");
     }
     else if (type == AmountType.P25)
     {
         return("25%");
     }
     else if (type == AmountType.P10)
     {
         return("10%");
     }
     else
     {
         return("");
     }
 }
Ejemplo n.º 17
0
        public void SetTotal(double total)
        {
            _total = total;
            AmountType typeInvoicesAmount = FileHeader.Batch.TotalInvoicesAmount ?? new AmountType
            {
            };

            typeInvoicesAmount.TotalAmount       = total;
            FileHeader.Batch.TotalInvoicesAmount = typeInvoicesAmount;

            AmountType typeTotalOutstandingAmount = FileHeader.Batch.TotalOutstandingAmount ?? new AmountType
            {
            };

            typeTotalOutstandingAmount.TotalAmount  = total;
            FileHeader.Batch.TotalOutstandingAmount = typeTotalOutstandingAmount;
            AmountType typeTotalExecutableAmount = FileHeader.Batch.TotalExecutableAmount ?? new AmountType
            {
            };

            typeTotalExecutableAmount.TotalAmount  = total;
            FileHeader.Batch.TotalExecutableAmount = typeTotalExecutableAmount;
        }
        Task <Order> IOrdersEndpoint.PlaceStopOrderAsync(
            OrderSide side,
            string productId, decimal amount, AmountType amountType, decimal stopPrice,
            Guid?clientOid,
            CancellationToken cancellationToken)
        {
            var mo = new CreateMarketOrder
            {
                Side      = side,
                ProductId = productId,
                Type      = OrderType.Market,
                StopPrice = stopPrice,
                ClientOid = clientOid
            };

            if (amountType == AmountType.UseFunds)
            {
                mo.Funds = amount;
            }
            else if (amountType == AmountType.UseSize)
            {
                mo.Size = amount;
            }


            if (side == OrderSide.Buy)
            {
                mo.Stop = StopType.Entry;
            }
            else if (side == OrderSide.Sell)
            {
                mo.Stop = StopType.Loss;
            }

            return(this.Orders.PlaceOrderAsync(mo, cancellationToken));
        }
        public void PlaceOfferFull()
        {
            string originalToken = this.apiContext.ApiCredential.eBayToken;

            try
            {
                Assert.IsNotNull(TestData.ChineseAuctionItem, "ChineseAuctionItem is null");
                ItemType item = TestData.ChineseAuctionItem;
                //change user
                this.apiContext.ApiCredential.eBayToken = TestData.BuyerToken;

                PlaceOfferCall api = new PlaceOfferCall(this.apiContext);
                api.ItemID = TestData.ChineseAuctionItem.ItemID;

                OfferType offer = new OfferType();
                offer.Action   = BidActionCodeType.Bid;
                offer.Quantity = 1;
                AmountType at = new AmountType();
                at.Value                      = 1;
                offer.ConvertedPrice          = at;
                at.Value                      = 2;
                offer.MaxBid                  = at;
                api.Offer                     = offer;
                api.AbstractRequest.EndUserIP = "10.249.72.135";

                api.Execute();

                //check whether the call is success.
                Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            }
            finally
            {
                //reset token
                this.apiContext.ApiCredential.eBayToken = originalToken;
            }
        }
Ejemplo n.º 20
0
 public Mustard(FlavorType flavor, AmountType amount) : base(flavor, "Mustard", amount)
 {
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Enables a seller can use this call to update the payment details, the shipping details,
        /// and the status of an order.
        /// </summary>
        /// 
        /// <param name="ItemID">
        /// Unique identifier for an eBay item listing. A listing can have multiple
        /// order line items (transactions), but only one <b>ItemID</b>. An <b>ItemID</b> can be
        /// paired up with a corresponding <b>TransactionID</b> and used as an input filter
        /// for <b>ReviseCheckoutStatus</b>.
        /// 
        /// Unless an <b>OrderLineItemID</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>ItemID</b>/<b>TransactionID</b> pair must be
        /// specified. For a multiple line item (Combined Invoice) order, <b>OrderID</b>
        /// should be used. If <b>OrderID</b> or <b>OrderLineItemID</b> are specified, the
        /// <b>ItemID</b>/<b>TransactionID</b> pair is ignored if present in the same request.
        /// <br />
        /// <br />
        /// It is also possible to identify a single line item order with a
        /// <b>ItemID</b>/<b>BuyerID</b> combination, but this is not the most ideal
        /// approach since an error is returned if there are multiple
        /// order line items for that combination.
        /// </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. Along with its corresponding <b>ItemID</b>, a
        /// <b>TransactionID</b> is used and referenced during an order checkout flow and
        /// after checkout has been completed. The <b>ItemID</b>/<b>TransactionID</b> pair can be
        /// used as an input filter for <b>ReviseCheckoutStatus</b>.
        /// 
        /// Unless an <b>OrderLineItemID</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>ItemID</b>/<b>TransactionID</b> pair must be
        /// specified. For a multiple line item (Combined Invoice) order, <b>OrderID</b>
        /// must be used. If <b>OrderID</b> or <b>OrderLineItemID</b> are specified, the
        /// <b>ItemID</b>/<b>TransactionID</b> pair is ignored if present in the same request.
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line
        /// item (Combined Invoice) order.
        /// 
        /// 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 through
        /// the eBay site. A Combined Invoice order can also be created by the
        /// seller through the <b>AddOrder</b> call. The <b>OrderID</b> can be used as an input
        /// filter for <b>ReviseCheckoutStatus</b>.
        /// 
        /// <b>OrderID</b> overrides an <b>OrderLineItemID</b> or <b>ItemID</b>/<b>TransactionID</b> pair if
        /// these fields are also specified in the same request.
        /// </param>
        ///
        /// <param name="AmountPaid">
        /// The total amount paid by the buyer. For a motor vehicle purchased on eBay Motors,
        /// <b>AmountPaid</b> is the total amount paid by the buyer for the deposit.
        /// <b>AmountPaid</b> is optional if <b>CheckoutStatus</b> is Incomplete and required if it
        /// is Complete.
        /// </param>
        ///
        /// <param name="PaymentMethodUsed">
        /// Payment method used by the buyer. This field is required if <b>
        /// CheckoutStatus</b> is Complete and the payment method is a trusted
        /// payment method other than PayPal. See eBay's
        /// <a href="http://pages.ebay.com/help/policies/accepted-payments-policy.html">Accepted Payments Policy</a>.
        /// If the payment method is PayPal, this field should not be used since only PayPal can set this field's
        /// value to "PayPal". ReviseCheckoutStatus cannot be used for a non-trusted
        /// payment method.
        /// <b>Note:</b>Required or allowed payment methods vary by site and category.
        /// </param>
        ///
        /// <param name="CheckoutStatus">
        /// The current checkout status of the order. Often, the seller or
        /// application will mark this value as 'Complete' if payment has been made. 
        /// </param>
        ///
        /// <param name="ShippingService">
        /// The shipping service selected by the buyer from among the shipping services
        /// offered by the seller (such as UPS Ground). For a list of valid values, call
        /// GeteBayDetails with DetailName set to ShippingServiceDetails. The
        /// ShippingServiceDetails.ValidForSellingFlow flag must also be present.
        /// Otherwise, that particular shipping service option is no longer valid and
        /// cannot be offered to buyers through a listing.
        /// <br/><br/>
        /// <span class="tablenote">
        /// <strong>Note:</strong> <strong>ReviseCheckoutStatus</strong> is not available for the Global Shipping program; specifying InternationalPriorityShipping as a value for this field will produce an error.
        /// </span>
        /// </param>
        ///
        /// <param name="ShippingIncludedInTax">
        /// An indicator of whether shipping costs were included in the
        /// taxable amount. .
        /// </param>
        ///
        /// <param name="CheckoutMethod">
        /// </param>
        ///
        /// <param name="InsuranceType">
        /// Enumeration value that indicates whether shipping insurance was offered to and
        /// selected by the buyer.
        /// </param>
        ///
        /// <param name="PaymentStatus">
        /// This field is used to mark the order as paid or awaiting payment in My eBay. If you specify 'Paid', My eBay displays an icon for each line item in the order to indicate that the order status is Paid. If you specify 'Pending', this indicates that the order is awaiting payment (some applications may use 'Pending' when the buyer has paid, but the funds have not yet been sent to the seller's financial institution).
        /// 
        /// 
        /// <b>ReviseCheckoutStatus</b> cannot be used to update payment and checkout
        /// status for a non-trusted payment method. See eBay's <a href="
        /// http://pages.ebay.com/help/policies/accepted-payments-policy.html">
        /// Accepted Payments Policy</a> for more information on trusted
        /// payment methods. If the payment method is PayPal, this field should not
        /// be used since PayPal automatically set this field's value to "Paid" upon
        /// receiving the buyer's payment.
        /// </param>
        ///
        /// <param name="AdjustmentAmount">
        /// Discount or charge agreed to by the buyer and seller. A positive value
        /// indicates that the amount is an extra charge being paid to the seller by
        /// the buyer. A negative value indicates that the amount is a discount given
        /// to the buyer by the seller.
        /// </param>
        ///
        /// <param name="ShippingAddress">
        /// For internal use.
        /// </param>
        ///
        /// <param name="BuyerID">
        /// eBay user ID for the order's buyer. A single line item order can
        /// actually be identified by a <b>BuyerID</b>/<b>ItemID</b> pair, but this approach is
        /// not recommended since an error is returned if there are multiple
        /// order line items for that combination. <b>BuyerID</b> is ignored if any other valid
        /// filter or filter combination is used in the same request.
        /// </param>
        ///
        /// <param name="ShippingInsuranceCost">
        /// The amount of money paid for shipping insurance.
        /// </param>
        ///
        /// <param name="SalesTax">
        /// The sales tax amount for the order. This field should be used if sales tax
        /// was applied to the order.
        /// </param>
        ///
        /// <param name="ShippingCost">
        /// The amount of money paid for shipping.
        /// </param>
        ///
        /// <param name="EncryptedID">
        /// Not supported.
        /// </param>
        ///
        /// <param name="ExternalTransaction">
        /// This container is used to identify the electronic payment (other than Paypal) of an order. 
        /// </param>
        ///
        /// <param name="MultipleSellerPaymentID">
        /// Not supported.
        /// </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>ReviseCheckoutStatus</b>
        /// request if 'COD' (cash-on-delivery) was the payment method selected by the buyer
        /// and it is included as the <b>PaymentMethodUsed</b> value in the same
        /// request.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// <b>OrderLineItemID</b> is a unique identifier for an eBay order line item and
        /// is based upon the concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a
        /// hyphen in between these two IDs. For a single line item order, the
        /// <b>OrderLineItemID</b> value can be passed into the <b>OrderID</b> field to revise the
        /// checkout status of the order.
        /// 
        /// Unless an <b>ItemID</b>/<b>TransactionID</b> pair 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, the <b>ItemID</b>/<b>TransactionID</b> pair are
        /// ignored if present in the same request.
        /// </param>
        ///
        public void ReviseCheckoutStatus(string ItemID, string TransactionID, string OrderID, AmountType AmountPaid, BuyerPaymentMethodCodeType PaymentMethodUsed, CompleteStatusCodeType CheckoutStatus, string ShippingService, bool ShippingIncludedInTax, CheckoutMethodCodeType CheckoutMethod, InsuranceSelectedCodeType InsuranceType, RCSPaymentStatusCodeType PaymentStatus, AmountType AdjustmentAmount, AddressType ShippingAddress, string BuyerID, AmountType ShippingInsuranceCost, AmountType SalesTax, AmountType ShippingCost, string EncryptedID, ExternalTransactionType ExternalTransaction, string MultipleSellerPaymentID, AmountType CODCost, string OrderLineItemID)
        {
            this.ItemID = ItemID;
            this.TransactionID = TransactionID;
            this.OrderID = OrderID;
            this.AmountPaid = AmountPaid;
            this.PaymentMethodUsed = PaymentMethodUsed;
            this.CheckoutStatus = CheckoutStatus;
            this.ShippingService = ShippingService;
            this.ShippingIncludedInTax = ShippingIncludedInTax;
            this.CheckoutMethod = CheckoutMethod;
            this.InsuranceType = InsuranceType;
            this.PaymentStatus = PaymentStatus;
            this.AdjustmentAmount = AdjustmentAmount;
            this.ShippingAddress = ShippingAddress;
            this.BuyerID = BuyerID;
            this.ShippingInsuranceCost = ShippingInsuranceCost;
            this.SalesTax = SalesTax;
            this.ShippingCost = ShippingCost;
            this.EncryptedID = EncryptedID;
            this.ExternalTransaction = ExternalTransaction;
            this.MultipleSellerPaymentID = MultipleSellerPaymentID;
            this.CODCost = CODCost;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
        }
Ejemplo n.º 22
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
        /// 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();
        }
Ejemplo n.º 23
0
 protected Condiment(FlavorType flavor, string name, AmountType amount)
 {
     Flavor = flavor;
     Name   = name;
     Amount = amount;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// return the string representation of the AmountType
 /// </summary>
 /// <param name="amt">amount</param>
 /// <returns>string representation of the amount</returns>
 public static string GetAmountString(AmountType amt)
 {
     if (amt == null) return "";
     string currencySymbol = GetCurrencySymbol(amt.currencyID);
     return currencySymbol + amt.Value;
 }
Ejemplo n.º 25
0
        /// <summary>
        /// Build a sample item
        /// </summary>
        /// <returns>ItemType object</returns>
        static ItemType BuildItem()
        {
            ItemType item = new ItemType();

            // item title
            item.Title = "Test Item";
            // item description
            item.Description = "eBay SDK sample test item";

            // listing type
            item.ListingType = ListingTypeCodeType.Chinese;
            // listing price
            item.Currency = CurrencyCodeType.USD;
            item.StartPrice = new AmountType();
            item.StartPrice.Value = 20;
            item.StartPrice.currencyID = CurrencyCodeType.USD;

            // listing duration
            item.ListingDuration = "Days_3"; 

            // item location and country
            item.Location = "San Jose";
            item.Country = CountryCodeType.US;

            // listing category, 
            CategoryType category = new CategoryType();
            category.CategoryID = "11104"; //CategoryID = 11104 (CookBooks) , Parent CategoryID=267(Books)
            item.PrimaryCategory = category;
             
            // item quality
            item.Quantity = 1;

            // item condition, New
            item.ConditionID = 1000;

            // item specifics
            item.ItemSpecifics = buildItemSpecifics();
            
            Console.WriteLine("Do you want to use Business policy profiles to list this item? y/n");
            String input = Console.ReadLine();
            if (input.ToLower().Equals("y"))
            {
                item.SellerProfiles = BuildSellerProfiles();
            }
            else
            {
                // payment methods
                item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection();
                item.PaymentMethods.AddRange(
                    new BuyerPaymentMethodCodeType[] { BuyerPaymentMethodCodeType.PayPal }
                    );
                // email is required if paypal is used as payment method
                item.PayPalEmailAddress = "*****@*****.**";

                // handling time is required
                item.DispatchTimeMax = 1;
                // shipping details
                item.ShippingDetails = BuildShippingDetails();

                // return policy
                item.ReturnPolicy = new ReturnPolicyType();
                item.ReturnPolicy.ReturnsAcceptedOption = "ReturnsAccepted";
            }
            //item Start Price
            AmountType amount = new AmountType();
            amount.Value = 2.8;
            amount.currencyID = CurrencyCodeType.USD;
            item.StartPrice = amount;

            
            return item;
        }
Ejemplo n.º 26
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;
        }
        /// <summary>
        /// Ends the eBay Motors listing specified by ItemID and creates a new Transaction
        /// Confirmation Request (TCR) for the item, thus enabling the TCR recipient to
        /// purchase the item. You can also use this call to see if a new TCR can be created
        /// for the specified item.
        /// </summary>
        /// 
        /// <param name="RecipientUserID">
        /// Specifies the user to whom the seller is offering the Transaction
        /// Confirmation Request.
        /// </param>
        ///
        /// <param name="VerifyEligibilityOnly">
        /// If true, specifies that the seller is verifying whether a new Transaction
        /// Confirmation Request (TCR) can be created. Thus, if this value is passed
        /// as true, then no Transaction Confirmation Request is actually made. If
        /// VerifyEligibilityOnly is not passed, or is false, a Transaction
        /// Confirmation Request is actually made.
        /// </param>
        ///
        /// <param name="RecipientPostalCode">
        /// Specifies the postal code of the user to whom the seller is offering the
        /// Transaction Confirmation Request. Required only if the user does not meet
        /// the other options listed in RecipientRelationCodeType. An error is
        /// returned if RecipientUserID and RecipientPostalCode do not match for more
        /// than 3 times for a seller per day.
        /// </param>
        ///
        /// <param name="RecipientRelationType">
        /// Specifies the current relationship between the seller and the potential
        /// buyer. A seller can make a Transaction Confirmation Request (TCR) for an
        /// item to a potential buyer if the buyer meets one of several criteria. A
        /// TCR is sent by a seller to one of the following: a bidder, a best offer
        /// buyer, a member with an ASQ question, or any member with a postal code.
        /// See the values and annotations in RecipientRelationCodeType.
        /// </param>
        ///
        /// <param name="NegotiatedPrice">
        /// The amount the offer recipient must pay to buy the item
        /// specified in the Transaction Confirmation Request (TCR).
        /// A negotiated amount between the buyer and the seller.
        /// </param>
        ///
        /// <param name="ListingDuration">
        /// Specifies the length of time the item in the Transaction Confirmation
        /// Request (TCR) will be available for purchase.
        /// </param>
        ///
        /// <param name="ItemID">
        /// The ItemID of the item that the seller wants to end in order to create a
        /// Transaction Confirmation Request (TCR).
        /// </param>
        ///
        /// <param name="Comments">
        /// Comments the seller wants to send to the recipient (bidder, best offer
        /// buyer, member with an ASQ question, or member with a postal code).
        /// </param>
        ///
        public string AddTransactionConfirmationItem(string RecipientUserID, string VerifyEligibilityOnly, string RecipientPostalCode, RecipientRelationCodeType RecipientRelationType, AmountType NegotiatedPrice, SecondChanceOfferDurationCodeType ListingDuration, string ItemID, string Comments)
        {
            this.RecipientUserID = RecipientUserID;
            this.VerifyEligibilityOnly = VerifyEligibilityOnly;
            this.RecipientPostalCode = RecipientPostalCode;
            this.RecipientRelationType = RecipientRelationType;
            this.NegotiatedPrice = NegotiatedPrice;
            this.ListingDuration = ListingDuration;
            this.ItemID = ItemID;
            this.Comments = Comments;

            Execute();
            return ApiResponse.ItemID;
        }
Ejemplo n.º 28
0
        private void BtnRespondToBestOffer_Click(object sender, System.EventArgs e)
        {
            try
            {
                if(TxtBestOfferID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input best offer id!");
                    return;
                }

                if(TxtItemID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input item id!");
                    return;
                }

                TxtStatus.Text = "";
                RespondToBestOfferCall apicall = new RespondToBestOfferCall(Context);

                StringCollection BestOfferIDList = new StringCollection();
                BestOfferIDList.Add(TxtBestOfferID.Text);
                string cboActionChoice = CboAction.SelectedItem.ToString();
                if(cboActionChoice == "Counter")
                {
                        if(txtCounterOfferPrice.Text.Trim().Length == 0)
                        {
                            MessageBox.Show("Please counter offer price!");
                            return;
                        }

                        if(txtCounterOfferQuantity.Text.Trim().Length == 0)
                        {
                            MessageBox.Show("Please input counter offer quanity!");
                            return;
                        }

                        AmountType CounterOfferPrice = new AmountType();
                        CounterOfferPrice.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                        CounterOfferPrice.Value = Convert.ToDouble(txtCounterOfferPrice.Text);
                        int quantity = Convert.ToInt32(txtCounterOfferQuantity.Text);
                        apicall.RespondToBestOffer(TxtItemID.Text,
                                                    BestOfferIDList,
                                                    (BestOfferActionCodeType) Enum.Parse(typeof(BestOfferActionCodeType),
                                                    CboAction.SelectedItem.ToString()),
                                                    TxtSellerResponse.Text,
                                                    CounterOfferPrice,
                                                    quantity);
                }
                else
                {
                    apicall.RespondToBestOffer(TxtItemID.Text,
                                           BestOfferIDList,
                                           (BestOfferActionCodeType) Enum.Parse(typeof(BestOfferActionCodeType),
                                            CboAction.SelectedItem.ToString()),
                                            TxtSellerResponse.Text);
                }
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();

            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 29
0
 public Ranch(FlavorType flavor, AmountType amount) : base(flavor, "Ranch", amount)
 {
 }
Ejemplo n.º 30
0
        private void BtnRespondToBestOffer_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (TxtBestOfferID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input best offer id!");
                    return;
                }

                if (TxtItemID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input item id!");
                    return;
                }


                TxtStatus.Text = "";
                RespondToBestOfferCall apicall = new RespondToBestOfferCall(Context);

                StringCollection BestOfferIDList = new StringCollection();
                BestOfferIDList.Add(TxtBestOfferID.Text);
                string cboActionChoice = CboAction.SelectedItem.ToString();
                if (cboActionChoice == "Counter")
                {
                    if (txtCounterOfferPrice.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Please counter offer price!");
                        return;
                    }

                    if (txtCounterOfferQuantity.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Please input counter offer quanity!");
                        return;
                    }

                    AmountType CounterOfferPrice = new AmountType();
                    CounterOfferPrice.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                    CounterOfferPrice.Value      = Convert.ToDouble(txtCounterOfferPrice.Text);
                    int quantity = Convert.ToInt32(txtCounterOfferQuantity.Text);
                    apicall.RespondToBestOffer(TxtItemID.Text,
                                               BestOfferIDList,
                                               (BestOfferActionCodeType)Enum.Parse(typeof(BestOfferActionCodeType),
                                                                                   CboAction.SelectedItem.ToString()),
                                               TxtSellerResponse.Text,
                                               CounterOfferPrice,
                                               quantity);
                }
                else
                {
                    apicall.RespondToBestOffer(TxtItemID.Text,
                                               BestOfferIDList,
                                               (BestOfferActionCodeType)Enum.Parse(typeof(BestOfferActionCodeType),
                                                                                   CboAction.SelectedItem.ToString()),
                                               TxtSellerResponse.Text);
                }
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 31
0
 public BoostView(BoosterType boosterType, double amount, AmountType amountType = AmountType.PERCENT)
 {
     Type       = boosterType;
     Amount     = amount;
     AmountType = amountType;
 }
Ejemplo n.º 32
0
        //
        // GetMyeBaySelling
        //  Use this call to return information from the All Selling section of the authenticated user's My eBay account.
        //      http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyeBaySelling.html
        //

        public static List <EbayActiveListingType> GetMyActiveListing(AccountType account)
        {
            if (account.SellerApiContext == null)
            {
                Logger.WriteSystemLog("Invalid API context in GetMyActiveListing.");
                return(null);
            }

            GetMyeBaySellingCall getMyeBaySellingApiCall = new GetMyeBaySellingCall(account.SellerApiContext);

            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll };
            getMyeBaySellingApiCall.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);

            getMyeBaySellingApiCall.SellingSummary         = new eBay.Service.Core.Soap.ItemListCustomizationType();
            getMyeBaySellingApiCall.SellingSummary.Include = true;

            getMyeBaySellingApiCall.ActiveList              = new eBay.Service.Core.Soap.ItemListCustomizationType();
            getMyeBaySellingApiCall.ActiveList.Include      = true;
            getMyeBaySellingApiCall.ActiveList.IncludeNotes = true;
            //getMyeBaySellingApiCall.ActiveList.ListingType = ListingTypeCodeType.FixedPriceItem;
            getMyeBaySellingApiCall.ActiveList.Pagination = new PaginationType();
            getMyeBaySellingApiCall.ActiveList.Pagination.EntriesPerPage = 25; // max 200 default 25
            getMyeBaySellingApiCall.ActiveList.Pagination.PageNumber     = 1;



            //getMyeBaySellingApiCall.BidList = new ItemListCustomizationType();
            //getMyeBaySellingApiCall.BidList.Include = true;
            //getMyeBaySellingApiCall.BidList.Pagination = new PaginationType();
            //getMyeBaySellingApiCall.BidList.Pagination.EntriesPerPage = 25;
            //getMyeBaySellingApiCall.BidList.Pagination.PageNumber = 1;

            getMyeBaySellingApiCall.GetMyeBaySelling();

            AmountType amountLimitRemaining   = getMyeBaySellingApiCall.Summary.AmountLimitRemaining;
            long       quantityLimitRemaining = getMyeBaySellingApiCall.Summary.QuantityLimitRemaining;

            PaginatedItemArrayType paginatedItemArray = getMyeBaySellingApiCall.ActiveListReturn;

            if (paginatedItemArray == null || paginatedItemArray.ItemArray == null)
            {
                return(null);
            }

            List <EbayActiveListingType> activeListings = new List <EbayActiveListingType>();

            foreach (ItemType item in paginatedItemArray.ItemArray)
            {
                EbayActiveListingType activeListing = new EbayActiveListingType();
                activeListing.ListId     = 0; // to be set
                activeListing.SellerName = account.ebayAccount;
                activeListing.ItemID     = StringUtil.GetSafeString(item.ItemID);
                activeListing.Title      = StringUtil.GetSafeString(item.Title);
                if (item.ListingTypeSpecified)
                {
                    if (ListingTypeCodeType.FixedPriceItem == item.ListingType)
                    {
                        activeListing.ListingType = "FixedPriceItem";
                    }
                    else if (ListingTypeCodeType.Auction == item.ListingType ||
                             ListingTypeCodeType.Chinese == item.ListingType)
                    {
                        activeListing.ListingType = "Auction";
                    }
                    else
                    {
                        activeListing.ListingType = "Unknown";
                    }
                }
                else
                {
                    activeListing.ListingType = "Unknown";
                }
                if (item.PictureDetails != null)
                {
                    activeListing.GalleryURL = StringUtil.GetSafeString(item.PictureDetails.GalleryURL);
                }
                else
                {
                    activeListing.GalleryURL = "";
                }

                if (item.BiddingDetails != null)
                {
                    activeListing.QuantityBid = StringUtil.GetSafeInt(item.BiddingDetails.QuantityBid);
                    if (item.BiddingDetails.MaxBid != null)
                    {
                        activeListing.MaxBid = StringUtil.GetSafeDouble(item.BiddingDetails.MaxBid.Value);
                    }
                    else
                    {
                        activeListing.MaxBid = 0.0;
                    }
                }
                else
                {
                    activeListing.QuantityBid = 0;
                    activeListing.MaxBid      = 0.0;
                }

                if (item.StartPrice != null)
                {
                    activeListing.StartPrice = StringUtil.GetSafeDouble(item.StartPrice.Value);
                }
                else
                {
                    activeListing.StartPrice = 0.0;
                }


                if (item.BuyItNowPrice != null)
                {
                    activeListing.BuyItNowPrice = StringUtil.GetSafeDouble(item.BuyItNowPrice.Value);
                    activeListing.CurrencyID    = StringUtil.GetSafeString(item.BuyItNowPrice.currencyID);
                }
                else
                {
                    activeListing.BuyItNowPrice = 0.0;
                    activeListing.CurrencyID    = "";
                }

                if (item.ListingDetails != null)
                {
                    activeListing.StartTime   = StringUtil.GetSafeDateTime(item.ListingDetails.StartTime);
                    activeListing.EndTime     = StringUtil.GetSafeDateTime(item.ListingDetails.EndTime);
                    activeListing.ViewItemURL = StringUtil.GetSafeString(item.ListingDetails.ViewItemURL);
                }

                activeListing.ListDuration      = StringUtil.GetSafeInt(StringUtil.GetSafeListDurationDays(item.ListingDuration));
                activeListing.PrivateListing    = StringUtil.GetSafeBool(item.PrivateListing);
                activeListing.Quantity          = StringUtil.GetSafeInt(item.Quantity);
                activeListing.QuantityAvailable = StringUtil.GetSafeInt(item.QuantityAvailable);
                if (item.SellingStatus != null)
                {
                    if (item.SellingStatus.ListingStatus == ListingStatusCodeType.Active)
                    {
                        activeListing.SellingStatus = "Active";
                    }
                    else if (item.SellingStatus.ListingStatus == ListingStatusCodeType.Completed)
                    {
                        activeListing.SellingStatus = "Completed";
                    }
                    else if (item.SellingStatus.ListingStatus == ListingStatusCodeType.Ended)
                    {
                        activeListing.SellingStatus = "Ended";
                    }
                    else
                    {
                        activeListing.SellingStatus = "Unknown";
                    }

                    if (item.SellingStatus.BidCountSpecified)
                    {
                        activeListing.BidCount = item.SellingStatus.BidCount;
                    }
                    else
                    {
                        activeListing.BidCount = 0;
                    }

                    if (item.SellingStatus.BidderCountSpecified)
                    {
                        activeListing.BidderCount = (int)item.SellingStatus.BidderCount;
                    }
                    else
                    {
                        activeListing.BidderCount = 0;
                    }

                    if (item.SellingStatus.CurrentPrice != null)
                    {
                        activeListing.CurrentPrice = item.SellingStatus.CurrentPrice.Value;
                    }
                    else
                    {
                        activeListing.CurrentPrice = 0.0;
                    }
                }
                else
                {
                    activeListing.SellingStatus = "Unknown";
                }
                activeListing.SKU        = StringUtil.GetSafeString(item.SKU);
                activeListing.TimeLeft   = StringUtil.GetSafeString(item.TimeLeft);
                activeListing.WatchCount = StringUtil.GetSafeInt(item.WatchCount);

                activeListings.Add(activeListing);
            }

            Logger.WriteSystemLog(string.Format("Successfully called GetMyActiveListing, returns {0} entries", activeListings.Count));
            return(activeListings);
        } // GetMyActiveListing
Ejemplo n.º 33
0
 public GetPurchaseInfoQuery(decimal amount, AmountType amountType, decimal vatRate)
 {
     Amount     = amount;
     AmountType = amountType;
     VatRate    = vatRate;
 }
Ejemplo n.º 34
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;
        }
Ejemplo n.º 35
0
    public string ReviseEbayItem(string ItemID, double Price, string userToken)
    {
        string callname = "ReviseItem";

        #region Initialise Needed Variables

        //Get the Server to use (Sandbox or Production)
        string serverUrl = ConfigurationManager.AppSettings["TradingService"];

        //SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
        //string siteID = "0";

        eBayAPIInterfaceService service = new eBayAPIInterfaceService();
        string requestURL = serverUrl + "?callname=" + callname + "&siteid=" + siteID
                            + "&appid=" + AppID + "&version=833&routing=default";
        service.Url = requestURL;

        // Set credentials
        service.RequesterCredentials = new CustomSecurityHeaderType();
        service.RequesterCredentials.Credentials = new UserIdPasswordType();
        service.RequesterCredentials.Credentials.AppId = AppID;
        service.RequesterCredentials.Credentials.DevId = DevID;
        service.RequesterCredentials.Credentials.AuthCert = CertID;
        service.RequesterCredentials.eBayAuthToken = userToken;
        #endregion

        ReviseItemRequestType requestType = new ReviseItemRequestType();
        ItemType itemType = new ItemType();
        itemType.ItemID = ItemID;

        AmountType price = new AmountType();
        price.Value = Price;
        price.currencyID = CurrencyCodeType.AUD;

        itemType.StartPrice = price;
        requestType.Item = itemType;
        requestType.Version = "833";

        try
        {
            ReviseItemResponseType response = service.ReviseItem(requestType);
            if (response.Ack == AckCodeType.Success)
                return null;
            else
                return response.Errors.First().ShortMessage;
        }
        catch (Exception ex)
        {
            if (ex.Message.ToLower().Contains("auth token"))
                throw new InvalidEbayCredentialsException();
            else
                throw ex;
        }
    }
		/// <summary>
		/// Enables the seller of a Best Offer item to accept, decline, or counter offers
		/// made by bidders. Best offers can be declined in bulk, using the same message
		/// from the seller to the bidders of all rejected offers.
		/// </summary>
		/// 
		/// <param name="ItemID">
		/// Specifies the item for which the BestOffer data is to be returned.
		/// </param>
		///
		/// <param name="BestOfferIDList">
		/// The ID of a Best Offer for the item.
		/// </param>
		///
		/// <param name="Action">
		/// The action taken on the Best Offer by the seller (e.g.,
		/// Accept, Decline, or Counter). Bulk Accept and Bulk
		/// Counter are not supported. That is, you cannot accept or
		/// counter multiple offers in a single call. You can,
		/// however, decline multiple offers in a single call.
		/// </param>
		///
		/// <param name="SellerResponse">
		/// A comment from the seller to the buyer.
		/// </param>
		///
		/// <param name="CounterOfferPrice">
		/// The counter offer price. When Action is set to Counter,
		/// you must specify the amount for the counter offer with
		/// CounterOfferPrice. The value of CounterOfferPrice cannot
		/// exceed the Buy It Now price for a single quantity item.
		/// The value of CounterOfferPrice may exceed the Buy It Now
		/// price if the value for CounterOfferQuantity is greater
		/// than 1.
		/// </param>
		///
		/// <param name="CounterOfferQuantity">
		/// The quantity of items in the counter offer. When Action is set to
		/// Counter you must specify the quantity of items for the
		/// counter offer with CounterOfferQuantity.
		/// </param>
		///
		public BestOfferTypeCollection RespondToBestOffer(string ItemID, StringCollection BestOfferIDList, BestOfferActionCodeType Action, string SellerResponse, AmountType CounterOfferPrice, int CounterOfferQuantity)
		{
			this.ItemID = ItemID;
			this.BestOfferIDList = BestOfferIDList;
			this.Action = Action;
			this.SellerResponse = SellerResponse;
			this.CounterOfferPrice = CounterOfferPrice;
			this.CounterOfferQuantity = CounterOfferQuantity;

			Execute();
			return ApiResponse.RespondToBestOffer;
		}
        /// <summary>
        /// Base request of the <b>AddTransactionConfirmationItem</b> call, which is used to end an eBay Motors listing and creates a new Transaction Confirmation Request (TCR) for the motor vehichle, thus enabling the TCR recipient to purchase the item. You can also use this call to see if a new TCR can be created for the specified item.
        /// </summary>
        ///
        /// <param name="RecipientUserID">
        /// This field is used to specify the recipient of the Transaction
        /// Confirmation Request (TCR).
        /// </param>
        ///
        /// <param name="VerifyEligibilityOnly">
        /// This field is included and set to <code>true</code> if the seller wants to verify whether or not a new Transaction
        /// Confirmation Request (TCR) can be created for the item. If this field is included and its value set to <code>true</code>, no TCR is actually created. If this field is included and its value set to <code>false</code>, or if it is omitted, a Transaction
        /// Confirmation Request is actually created.
        /// </param>
        ///
        /// <param name="RecipientPostalCode">
        /// This field is used to specify the postal code of the user to whom the seller is offering the Transaction Confirmation Request. This field is only required if the user does not meet the other options listed in <b>RecipientRelationCodeType</b>.
        /// </param>
        ///
        /// <param name="RecipientRelationType">
        /// The enumeration value supplied in this field specifies the current relationship between the seller and the potential
        /// buyer. A Transaction Confirmation Request (TCR) for an
        /// item can be sent to a potential buyer who has at least one of the following criteria: is an active bidder on the auction listing; has made a Best Offer on the fixed-price listing, is an eBay user who has used the Ask Seller a Question feature, or is an eBay user whose postal code is known.
        /// </param>
        ///
        /// <param name="NegotiatedPrice">
        /// The amount in this field is the price that the seller is asking for to purchase the motor vehicle.
        /// </param>
        ///
        /// <param name="ListingDuration">
        /// The enumeration value specified in this field will control how many days that the recipient of the offer has to purchase the motor vehicle at the price listed in the <b>NegotiatedPrice</b> field.
        /// </param>
        ///
        /// <param name="ItemID">
        /// This field is used to identify the eBay Motors listing using the unique identifier of the listing (<b>ItemID</b>).
        /// </param>
        ///
        /// <param name="Comments">
        /// This is optional free-form string field that can be used by the seller to provide any comments or additional information about the Transaction Confirmation Item.
        /// </param>
        ///
        public string AddTransactionConfirmationItem(string RecipientUserID, string VerifyEligibilityOnly, string RecipientPostalCode, RecipientRelationCodeType RecipientRelationType, AmountType NegotiatedPrice, SecondChanceOfferDurationCodeType ListingDuration, string ItemID, string Comments)
        {
            this.RecipientUserID       = RecipientUserID;
            this.VerifyEligibilityOnly = VerifyEligibilityOnly;
            this.RecipientPostalCode   = RecipientPostalCode;
            this.RecipientRelationType = RecipientRelationType;
            this.NegotiatedPrice       = NegotiatedPrice;
            this.ListingDuration       = ListingDuration;
            this.ItemID   = ItemID;
            this.Comments = Comments;

            Execute();
            return(ApiResponse.ItemID);
        }
		/// <summary>
		/// For backward compatibility with old wrappers.
		/// </summary>
		public void VerifyAddSecondChanceItem(string RecipientBidderUserID, AmountType BuyItNowPrice, bool CopyEmailToSeller, SecondChanceOfferDurationCodeType Duration, string ItemID)
		{
			this.RecipientBidderUserID = RecipientBidderUserID;
			this.BuyItNowPrice = BuyItNowPrice;
			this.Duration = Duration;
			this.ItemID = ItemID;

			Execute();
		}
Ejemplo n.º 39
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }
            ((fhirCsR4.Models.BackboneElement) this).SerializeJson(writer, options, false);

            if (Target != null)
            {
                writer.WritePropertyName("target");
                Target.SerializeJson(writer, options);
            }

            if (Type != null)
            {
                writer.WritePropertyName("type");
                Type.SerializeJson(writer, options);
            }

            if (Interaction != null)
            {
                writer.WritePropertyName("interaction");
                Interaction.SerializeJson(writer, options);
            }

            if (Organism != null)
            {
                writer.WritePropertyName("organism");
                Organism.SerializeJson(writer, options);
            }

            if (OrganismType != null)
            {
                writer.WritePropertyName("organismType");
                OrganismType.SerializeJson(writer, options);
            }

            if (AmountQuantity != null)
            {
                writer.WritePropertyName("amountQuantity");
                AmountQuantity.SerializeJson(writer, options);
            }

            if (AmountRange != null)
            {
                writer.WritePropertyName("amountRange");
                AmountRange.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(AmountString))
            {
                writer.WriteString("amountString", (string)AmountString !);
            }

            if (_AmountString != null)
            {
                writer.WritePropertyName("_amountString");
                _AmountString.SerializeJson(writer, options);
            }

            if (AmountType != null)
            {
                writer.WritePropertyName("amountType");
                AmountType.SerializeJson(writer, options);
            }

            if ((Source != null) && (Source.Count != 0))
            {
                writer.WritePropertyName("source");
                writer.WriteStartArray();

                foreach (Reference valSource in Source)
                {
                    valSource.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Ejemplo n.º 40
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;
		}
Ejemplo n.º 41
0
 public void AddBudgetItem(decimal amount, AmountType amountType, BudgetCategory category)
 {
     _budgetDetails.Add(new BudgetDetail(amount, amountType, category));
 }
Ejemplo n.º 42
0
        public void Can_limit_only_relative_rewards(int amount, int maxLimit, decimal expected, AmountType type)
        {
            var currency = new Currency(new Language("en-US"), "USD (840)");
            var money    = new Money(100m, currency);
            //Arrange
            var reward = new PromotionReward()
            {
                Amount     = amount,
                AmountType = type,
                MaxLimit   = maxLimit,
                Promotion  = new Promotion()
                {
                    Id          = "id",
                    Description = ""
                }
            };

            //Act
            var discount = new Discount();

            discount = reward.ToDiscountModel(money);

            //Assert
            var expectedAmount = new Money(expected, currency);

            Assert.Equal(discount.Amount, expectedAmount);
        }
		/// <summary>
		/// Simulates the creation of a new Second Chance Offer
		/// listing of an item without actually creating a listing.
		/// </summary>
		/// 
		/// <param name="RecipientBidderUserID">
		/// Specifies the bidder from the original, ended listing to whom the seller
		/// is extending the second chance offer. Specify only one
		/// RecipientBidderUserID per call. If multiple users are specified (each in a
		/// RecipientBidderUserID node), only the last one specified receives the
		/// offer.
		/// </param>
		///
		/// <param name="BuyItNowPrice">
		/// Specifies the amount the offer recipient must pay to purchase the item
		/// from the second chance offer listing. Use only when the original item was
		/// an eBay Motors (or in some categories on U.S. and international sites for
		/// high-priced items, such as items in many U.S. and Canada Business and
		/// Industrial categories) and it ended unsold because the reserve price was
		/// not met. Call fails with an error for any other item conditions.
		/// </param>
		///
		/// <param name="Duration">
		/// Specifies the length of time the second chance offer listing will be
		/// active. The recipient bidder has that much time to purchase the item or
		/// the listing expires.
		/// </param>
		///
		/// <param name="ItemID">
		/// Specifies the item ID for the original, ended listing from which the
		/// second chance offer item comes. A new ItemID is returned for the second
		/// chance offer item.
		/// </param>
		///
		/// <param name="SellerMessage">
		/// Message content. Cannot contain HTML, asterisks, or quotes. This content
		/// is included in the second chance offer email sent to the recipient, which
		/// can be retrieved with GetMyMessages.
		/// </param>
		///
		public DateTime VerifyAddSecondChanceItem(string RecipientBidderUserID, AmountType BuyItNowPrice, SecondChanceOfferDurationCodeType Duration, string ItemID, string SellerMessage)
		{
			this.RecipientBidderUserID = RecipientBidderUserID;
			this.BuyItNowPrice = BuyItNowPrice;
			this.Duration = Duration;
			this.ItemID = ItemID;
			this.SellerMessage = SellerMessage;

			Execute();
			return ApiResponse.StartTime;
		}
Ejemplo n.º 44
0
		/// <summary>
		/// <b>Half.com only.</b>&nbsp;Issues a refund for a specific
		/// Half.com order line item. This can only be called by a seller. Sellers do not
		/// have the ability to issue a general refund (a refund not tied to an order line
		/// item) to a buyer.
		/// </summary>
		/// 
		/// <param name="ItemID">
		/// Unique identifier for the Half.com item listing. Unless an
		/// <b>OrderLineItemID</b> is specified in the <b>IssueRefund</b> request, the <b>ItemID</b> is
		/// required along with the corresponding <b>TransactionID</b> to identify the
		/// order line item that will be refunded. You can use <b>GetSellerPayments</b> to
		/// retrieve the <b>ItemID</b> and/or <b>TransactionID</b> associated with the order line
		/// item.
		/// </param>
		///
		/// <param name="TransactionID">
		/// Unique identifier for a Half.com order line item (transaction). An order
		/// line item is created once there is a commitment from a buyer to purchase
		/// an item. Along with its corresponding <b>ItemID</b>, a <b>TransactionID</b> is used to
		/// identify the order line item that will be refunded. Unless an
		/// <b>OrderLineItemID</b> is specified in the <b>IssueRefund</b> request, the
		/// <b>TransactionID</b> is required along with the corresponding <b>ItemID</b>. You can
		/// use <b>GetSellerPayments</b> to retrieve the <b>ItemID</b> and/or <b>TransactionID</b>
		/// associated with the order line item.
		/// </param>
		///
		/// <param name="RefundReason">
		/// Explanation of the reason that the refund is being issued.
		/// </param>
		///
		/// <param name="RefundType">
		/// Explanation of the costs that the refund amount covers.
		/// </param>
		///
		/// <param name="RefundAmount">
		/// The amount the seller wants to refund to the buyer, in US Dollars (USD).
		/// Must be greater than 0.00. Half.com allows a maximum of the original item
		/// sale price (order line item price plus original shipping reimbursement) plus
		/// return shipping costs (the amount the buyer paid to return the item).
		/// Typically, the return shipping cost is based on the current cost of
		/// shipping the individual item (not the discounted cost calculated during
		/// the original checkout for a Combined Payment order). You can also issue a
		/// partial refund for the amount you want the buyer to receive. If
		/// RefundType=Full or RefundType=FullPlusShipping and you do not pass
		/// <b>RefundAmount</b> in the request, Half.com will calculate the refund amount for
		/// you. If you pass <b>RefundAmount</b> in the request, the amount you specify will
		/// override Half.com's calculated value. Required if RefundType=
		/// CustomOrPartial.
		/// </param>
		///
		/// <param name="RefundMessage">
		/// Note to the buyer. Cannot include HTML.
		/// </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. The <b>OrderLineItemID</b> value is used to
		/// identify the order line item that will be refunded. Unless an
		/// <b>ItemID</b>/<b>TransactionID</b> pair is specified in the <b>IssueRefund</b> request, the
		/// <b>OrderLineItemID</b> is required. You can use <b>GetSellerPayments</b> to retrieve
		/// the <b>OrderLineItemID</b> associated with the order line item.
		/// 
		/// </param>
		///
		public AmountType IssueRefund(string ItemID, string TransactionID, RefundReasonCodeType RefundReason, RefundTypeCodeType RefundType, AmountType RefundAmount, string RefundMessage, string OrderLineItemID)
		{
			this.ItemID = ItemID;
			this.TransactionID = TransactionID;
			this.RefundReason = RefundReason;
			this.RefundType = RefundType;
			this.RefundAmount = RefundAmount;
			this.RefundMessage = RefundMessage;
			this.OrderLineItemID = OrderLineItemID;

			Execute();
			return ApiResponse.RefundFromSeller;
		}
Ejemplo n.º 45
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;
        }
Ejemplo n.º 46
0
 public SpawnRule WithAmountType(AmountType amountType)
 {
     this.amountType = amountType;
     return(this);
 }
Ejemplo n.º 47
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();
        }
Ejemplo n.º 48
0
        /// <summary>
        /// <b>Half.com only.</b>&nbsp;Issues a refund for a specific
        /// Half.com order line item. This can only be called by a seller. Sellers do not
        /// have the ability to issue a general refund (a refund not tied to an order line
        /// item) to a buyer.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for the Half.com item listing. Unless an
        /// <b>OrderLineItemID</b> is specified in the <b>IssueRefund</b> request, the <b>ItemID</b> is
        /// required along with the corresponding <b>TransactionID</b> to identify the
        /// order line item that will be refunded. You can use <b>GetSellerPayments</b> to
        /// retrieve the <b>ItemID</b> and/or <b>TransactionID</b> associated with the order line
        /// item.
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for a Half.com order line item (transaction). An order
        /// line item is created once there is a commitment from a buyer to purchase
        /// an item. Along with its corresponding <b>ItemID</b>, a <b>TransactionID</b> is used to
        /// identify the order line item that will be refunded. Unless an
        /// <b>OrderLineItemID</b> is specified in the <b>IssueRefund</b> request, the
        /// <b>TransactionID</b> is required along with the corresponding <b>ItemID</b>. You can
        /// use <b>GetSellerPayments</b> to retrieve the <b>ItemID</b> and/or <b>TransactionID</b>
        /// associated with the order line item.
        /// </param>
        ///
        /// <param name="RefundReason">
        /// Explanation of the reason that the refund is being issued.
        /// </param>
        ///
        /// <param name="RefundType">
        /// Explanation of the costs that the refund amount covers.
        /// </param>
        ///
        /// <param name="RefundAmount">
        /// The amount the seller wants to refund to the buyer, in US Dollars (USD).
        /// Must be greater than 0.00. Half.com allows a maximum of the original item
        /// sale price (order line item price plus original shipping reimbursement) plus
        /// return shipping costs (the amount the buyer paid to return the item).
        /// Typically, the return shipping cost is based on the current cost of
        /// shipping the individual item (not the discounted cost calculated during
        /// the original checkout for a Combined Payment order). You can also issue a
        /// partial refund for the amount you want the buyer to receive. If
        /// RefundType=Full or RefundType=FullPlusShipping and you do not pass
        /// <b>RefundAmount</b> in the request, Half.com will calculate the refund amount for
        /// you. If you pass <b>RefundAmount</b> in the request, the amount you specify will
        /// override Half.com's calculated value. Required if RefundType=
        /// CustomOrPartial.
        /// </param>
        ///
        /// <param name="RefundMessage">
        /// Note to the buyer. Cannot include HTML.
        /// </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. The <b>OrderLineItemID</b> value is used to
        /// identify the order line item that will be refunded. Unless an
        /// <b>ItemID</b>/<b>TransactionID</b> pair is specified in the <b>IssueRefund</b> request, the
        /// <b>OrderLineItemID</b> is required. You can use <b>GetSellerPayments</b> to retrieve
        /// the <b>OrderLineItemID</b> associated with the order line item.
        ///
        /// </param>
        ///
        public AmountType IssueRefund(string ItemID, string TransactionID, RefundReasonCodeType RefundReason, RefundTypeCodeType RefundType, AmountType RefundAmount, string RefundMessage, string OrderLineItemID)
        {
            this.ItemID          = ItemID;
            this.TransactionID   = TransactionID;
            this.RefundReason    = RefundReason;
            this.RefundType      = RefundType;
            this.RefundAmount    = RefundAmount;
            this.RefundMessage   = RefundMessage;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
            return(ApiResponse.RefundFromSeller);
        }
Ejemplo n.º 49
0
 public AmountInfo(decimal? amount, string currency, AmountType? type)
     : this(amount.ToString(), currency, ".", type)
 {
 }
Ejemplo n.º 50
0
        /// <summary>
        /// This call enables the seller to accept or decline a buyer's Best Offer on an item, or make a counter offer to the buyer's Best Offer. A seller can decline multiple Best Offers with one call, but the seller cannot accept or counter offer multiple Best Offers with one call. Best Offers are not applicable to auction listings.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// The unique identifier of the listing to which the seller is responding. Specifies the item for which the BestOffer data is to be returned.
        /// </param>
        ///
        /// <param name="BestOfferIDList">
        /// The unique identifier of a buyer's Best Offer for the item. This ID is created once the buyer makes a Best Offer. It is possible that a seller will get multiple Best Offers for an item, and if that seller would like to decline multiple/all of the Best Offers with one <b>RespondToBestOffer</b> call, the seller would pass in each of these identifiers in a separate <b>BestOfferID</b> field. However, the seller can only accept or counter offer one Best Offer at a time.
        /// </param>
        ///
        /// <param name="Action">
        /// The enumeration value that the seller passes in to this field will control whether the seller accepts or make a counter offer to a single buyer's Best Offer, or declines one or more buyers' Best Offers. A seller can decline multiple Best Offers with one call, but the seller cannot accept or counter offer multiple Best Offers with one call.
        /// </param>
        ///
        /// <param name="SellerResponse">
        /// This optional text field allows the seller to provide more details to the buyer about the action being taken against the buyer's Best Offer.
        /// </param>
        ///
        /// <param name="CounterOfferPrice">
        /// The seller inserts counter offer price into this field. This field is conditionally required and only applicable when the <b>Action</b> value is set to <code>Counter</code>, The counter offer price cannot exceed the Buy It Now price for a single quantity item. However, the dollar value in this field may exceed the Buy It Now price if the buyer is requesting or the seller is offering multiple quantity of the item (in a multiple-quantity listing). The quantity of the item must be specified in the <b>CounterOfferQuantity</b> field if the seller is making a counter offer.
        /// </param>
        ///
        /// <param name="CounterOfferQuantity">
        /// The seller inserts the quantity of items in the counter offer into this field. This field is conditionally required and only applicable when the <b>Action</b> value is set to <code>Counter</code>, The counter offer price must be specified in the <b>CounterOfferPrice</b> field if the seller is making a counter offer. This price should reflect the quantity of items in the counter offer. So, if the seller's counter offer 'unit' price is 15 dollars, and the item quantity is '2', the dollar value passed into the <b>CounterOfferPrice</b> field would be <code>30.0</code>.
        /// </param>
        ///
        public BestOfferTypeCollection RespondToBestOffer(string ItemID, StringCollection BestOfferIDList, BestOfferActionCodeType Action, string SellerResponse, AmountType CounterOfferPrice, int CounterOfferQuantity)
        {
            this.ItemID               = ItemID;
            this.BestOfferIDList      = BestOfferIDList;
            this.Action               = Action;
            this.SellerResponse       = SellerResponse;
            this.CounterOfferPrice    = CounterOfferPrice;
            this.CounterOfferQuantity = CounterOfferQuantity;

            Execute();
            return(ApiResponse.RespondToBestOffer);
        }
        /// <summary>
        /// Enables a seller to update the payment details, the shipping details,
        /// and the status of an order.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for an eBay listing. A listing can have multiple order line items, but only one <b>ItemID</b>. An <b>ItemID</b> can be paired up with a corresponding <b>TransactionID</b> and used as an input filter for <b>ReviseCheckoutStatus</b>.  Unless an <b>OrderLineItemID</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>ItemID</b>/<b>TransactionID</b> pair must be specified. For a multiple line item (Combined Invoice) order, <b>OrderID</b> should be used. If <b>OrderID</b> or <b>OrderLineItemID</b> are specified, the <b>ItemID</b>/<b>TransactionID</b> pair is ignored if present in the same request.
        /// <br/>
        /// <br/>
        /// It is also possible to identify a single line item order with a
        /// <b>ItemID</b>/<b>BuyerID</b> combination, but this is not the most ideal approach since an error is returned if there are multiple order line items for that combination.
        /// <br/>
        /// </param>
        ///
        /// <param name="TransactionID">
        /// Unique identifier for an eBay order line item. 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 <code>0</code>. Along with its corresponding <b>ItemID</b>, a
        /// <b>TransactionID</b> is used and referenced during an order checkout flow and
        /// after checkout has been completed. The <b>ItemID</b>/<b>TransactionID</b> pair can be
        /// used as an input filter for <b>ReviseCheckoutStatus</b>.
        ///
        /// Unless an <b>OrderLineItemID</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>ItemID</b>/<b>TransactionID</b> pair must be
        /// specified. For a multiple line item (Combined Invoice) order, <b>OrderID</b>
        /// must be used. If <b>OrderID</b> or <b>OrderLineItemID</b> are specified, the
        /// <b>ItemID</b>/<b>TransactionID</b> pair is ignored if present in the same request.
        ///
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line
        /// item (Combined Invoice) order.
        ///
        /// 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 through
        /// the eBay site. A Combined Invoice order can also be created by the
        /// seller through the <b>AddOrder</b> call. The <b>OrderID</b> can be used as an input
        /// filter for <b>ReviseCheckoutStatus</b>.
        ///
        /// <b>OrderID</b> overrides an <b>OrderLineItemID</b> or <b>ItemID</b>/<b>TransactionID</b> pair if
        /// these fields are also specified in the same request.
        /// </param>
        ///
        /// <param name="AmountPaid">
        /// The total amount paid by the buyer. For a US eBay Motors item,
        /// <b>AmountPaid</b> is the total amount paid by the buyer for the deposit.
        /// <b>AmountPaid</b> is optional if <b>CheckoutStatus</b> is Incomplete and required if it
        /// is Complete.
        /// </param>
        ///
        /// <param name="PaymentMethodUsed">
        /// Payment method used by the buyer. This field is required if <b>
        /// CheckoutStatus</b> is Complete and the payment method is a trusted
        /// payment method other than PayPal. See eBay's
        /// <a href="http://pages.ebay.com/help/policies/accepted-payments-policy.html">Accepted Payments Policy</a>.
        /// If the payment method is PayPal, this field should not be used since only PayPal can set this field's
        /// value to "PayPal". ReviseCheckoutStatus cannot be used for a non-trusted
        /// payment method.
        /// <b>Note:</b>Required or allowed payment methods vary by site and category.
        /// </param>
        ///
        /// <param name="CheckoutStatus">
        /// This field is included and its value is set to <code>Complete</code> if the seller is using the <b>ReviseCheckoutStatus</b> call to mark the order as 'Paid' by including the <b>PaymentStatus</b> field and setting its value to <code>Paid</code>.
        /// </param>
        ///
        /// <param name="ShippingService">
        /// The shipping service selected by the buyer from among the shipping services offered by the seller (such as UPS Ground). For a list of valid values, call GeteBayDetails with DetailName set to ShippingServiceDetails. The ShippingServiceDetails.ValidForSellingFlow flag must also be present. Otherwise, that particular shipping service option is no longer valid and cannot be offered to buyers through a listing. <br/><br/> <span class="tablenote"> <strong>Note:</strong> <strong>ReviseCheckoutStatus</strong> is not available for the Global Shipping program; specifying <code>InternationalPriorityShipping</code> as a value for this field will produce an error. </span>
        /// </param>
        ///
        /// <param name="ShippingIncludedInTax">
        /// An indicator of whether shipping costs were included in the
        /// taxable amount.
        /// </param>
        ///
        /// <param name="CheckoutMethod">
        /// This field is deprecated.
        /// </param>
        ///
        /// <param name="InsuranceType">
        /// This field is no longer applicable as it is not longer possible for a seller to offer a buyer shipping insurance.
        /// </param>
        ///
        /// <param name="PaymentStatus">
        /// This field is used to mark the order as paid or awaiting payment in My eBay. If you specify 'Paid', My eBay displays an icon for each line item in the order to indicate that the order status is Paid. If you specify 'Pending', this indicates that the order is awaiting payment (some applications may use 'Pending' when the buyer has paid, but the funds have not yet been sent to the seller's financial institution).
        ///
        ///
        /// <b>ReviseCheckoutStatus</b> cannot be used to update payment and checkout
        /// status for a non-trusted payment method. See eBay's <a href="
        /// http://pages.ebay.com/help/policies/accepted-payments-policy.html">
        /// Accepted Payments Policy</a> for more information on trusted
        /// payment methods. If the payment method is PayPal, this field should not
        /// be used since PayPal automatically set this field's value to "Paid" upon
        /// receiving the buyer's payment.
        /// </param>
        ///
        /// <param name="AdjustmentAmount">
        /// Discount or charge agreed to by the buyer and seller. A positive value
        /// indicates that the amount is an extra charge being paid to the seller by
        /// the buyer. A negative value indicates that the amount is a discount given
        /// to the buyer by the seller.
        /// </param>
        ///
        /// <param name="ShippingAddress">
        /// For internal use only. Do not use.
        /// </param>
        ///
        /// <param name="BuyerID">
        /// eBay user ID for the order's buyer. A single line item order can
        /// actually be identified by a <b>BuyerID</b>/<b>ItemID</b> pair, but this approach is
        /// not recommended since an error is returned if there are multiple
        /// order line items for that combination. <b>BuyerID</b> is ignored if any other valid
        /// filter or filter combination is used in the same request.
        /// </param>
        ///
        /// <param name="ShippingInsuranceCost">
        /// This field is no longer applicable as it is not longer possible for a seller to offer a buyer shipping insurance.
        /// </param>
        ///
        /// <param name="SalesTax">
        /// The sales tax amount for the order. This field should be used if sales tax
        /// was applied to the order.
        /// </param>
        ///
        /// <param name="ShippingCost">
        /// Amount of money paid for shipping.
        /// </param>
        ///
        /// <param name="EncryptedID">
        /// Not supported.
        /// </param>
        ///
        /// <param name="ExternalTransaction">
        /// This container is used if payment for the order occurred off of eBay, and the seller wants to pass in the external payment reference ID.
        /// </param>
        ///
        /// <param name="MultipleSellerPaymentID">
        /// Not supported.
        /// </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>ReviseCheckoutStatus</b> request if 'COD' (cash-on-delivery) was the payment method selected by the buyer and it is included as the <b>PaymentMethodUsed</b> value in the same request.
        /// </param>
        ///
        /// <param name="OrderLineItemID">
        /// <b>OrderLineItemID</b> is a unique identifier for an eBay order line item and
        /// is based upon the concatenation of <b>ItemID</b> and <b>TransactionID</b>, with a
        /// hyphen in between these two IDs. For a single line item order, the
        /// <b>OrderLineItemID</b> value can be passed into the <b>OrderID</b> field to revise the
        /// checkout status of the order.
        ///
        /// Unless an <b>ItemID</b>/<b>TransactionID</b> pair 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, the <b>ItemID</b>/<b>TransactionID</b> pair are ignored if present in the same request.
        /// </param>
        ///
        public void ReviseCheckoutStatus(string ItemID, string TransactionID, string OrderID, AmountType AmountPaid, BuyerPaymentMethodCodeType PaymentMethodUsed, CompleteStatusCodeType CheckoutStatus, string ShippingService, bool ShippingIncludedInTax, CheckoutMethodCodeType CheckoutMethod, InsuranceSelectedCodeType InsuranceType, RCSPaymentStatusCodeType PaymentStatus, AmountType AdjustmentAmount, AddressType ShippingAddress, string BuyerID, AmountType ShippingInsuranceCost, AmountType SalesTax, AmountType ShippingCost, string EncryptedID, ExternalTransactionType ExternalTransaction, string MultipleSellerPaymentID, AmountType CODCost, string OrderLineItemID)
        {
            this.ItemID                  = ItemID;
            this.TransactionID           = TransactionID;
            this.OrderID                 = OrderID;
            this.AmountPaid              = AmountPaid;
            this.PaymentMethodUsed       = PaymentMethodUsed;
            this.CheckoutStatus          = CheckoutStatus;
            this.ShippingService         = ShippingService;
            this.ShippingIncludedInTax   = ShippingIncludedInTax;
            this.CheckoutMethod          = CheckoutMethod;
            this.InsuranceType           = InsuranceType;
            this.PaymentStatus           = PaymentStatus;
            this.AdjustmentAmount        = AdjustmentAmount;
            this.ShippingAddress         = ShippingAddress;
            this.BuyerID                 = BuyerID;
            this.ShippingInsuranceCost   = ShippingInsuranceCost;
            this.SalesTax                = SalesTax;
            this.ShippingCost            = ShippingCost;
            this.EncryptedID             = EncryptedID;
            this.ExternalTransaction     = ExternalTransaction;
            this.MultipleSellerPaymentID = MultipleSellerPaymentID;
            this.CODCost                 = CODCost;
            this.OrderLineItemID         = OrderLineItemID;

            Execute();
        }
Ejemplo n.º 52
0
        /// <summary>
        /// Build a sample item
        /// </summary>
        /// <returns>ItemType object</returns>
        private ItemType BuildItem(string sneakerID)
        {
            ItemType item = new ItemType();

            // item title
            item.Title = SQLConnect.Select("Select ShoeName from Shoe where ShoeID = '" + sneakerID + "';");
            // item description
            item.Description = "";
            // display description + photos on window form.
            //string rootPath = @"C:\Users\Viet\Documents\Visual Studio 2017\Projects\SnkrBot\target list-desc-images\";
            string rootPath = @"C:\SnkrBot\target list-desc-images";

            //string rootPath = @"C: \Users\Administrator\Desktop\target list-desc-images\";
            // scan sundirectories of rootPath
            string[] subdirectoryEntries = Directory.GetDirectories(rootPath);

            string folder = "";

            // check to find the right directory for the shoe
            foreach (string subdirectory in subdirectoryEntries)
            {
                if (subdirectory.Contains(sneakerID))
                {
                    folder = subdirectory;
                    break;
                }
            }

            try
            {
                // Only get files end .txt
                string[] txtFile = Directory.GetFiles(folder, "*.txt");
                //MessageBox.Show("The number of files .txt is" +txtFile.Length+".");
                foreach (string dir in txtFile)
                {
                    var fileStream = new FileStream(dir, FileMode.Open, FileAccess.Read);
                    using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
                    {
                        item.Description = streamReader.ReadToEnd();
                    }
                }
                // Only get files end .jpeg
                string[] imgFile = Directory.GetFiles(folder, "*.jpeg");
                //MessageBox.Show("The number of files .jpeg is" + imgFile.Length + ".");
                foreach (string dir in imgFile)
                {
                }
                //pb1.ImageLocation = imgFile[0];
                apiContext.EPSServerUrl = @"https://api.sandbox.ebay.com/ws/api.dll";
                eBayPictureService pictureService = new eBayPictureService(new ApiContext());
                // pictureService.ApiContext.EPSServerUrl = @"https://api.sandbox.ebay.com/ws/api.dll";
                string[] picURLs = pictureService.UpLoadPictureFiles(PhotoDisplayCodeType.SuperSize, imgFile);
                //To specify a Gallery Image
                item.PictureDetails = new PictureDetailsType();
                //The first picture is used for Gallery URL
                item.PictureDetails.GalleryType = GalleryTypeCodeType.Gallery;
            }
            catch (Exception e)
            {
                //MessageBox.Show("Reading file Unsuccessful");
            }



            // listing duration
            item.ListingDuration = "Days_7";


            // listing category,
            CategoryType category = new CategoryType();

            category.CategoryID  = "153008"; //CategoryID = 11104 (CookBooks) , Parent CategoryID=267(Books), 153008 (shoe)
            item.PrimaryCategory = category;

            // item quality
            item.Quantity = 1;

            // item condition, New
            item.ConditionID = 1000;

            // item specifics
            item.ItemSpecifics = buildItemSpecifics(sneakerID);
            // listing type
            item.ListingType = ListingTypeCodeType.Chinese;



            // item location and country
            item.Location = "Melbourne";
            item.Country  = CountryCodeType.AU;
            item.Currency = CurrencyCodeType.AUD;
            // listing price
            //item Start Price
            AmountType amount = new AmountType();

            amount.Value      = 20;
            amount.currencyID = CurrencyCodeType.AUD;
            item.StartPrice   = amount;

            //Console.WriteLine("Do you want to use Business policy profiles to list this item? y/n");
            String input = "n";//Console.ReadLine();

            if (input.ToLower().Equals("y"))
            {
                item.SellerProfiles = BuildSellerProfiles();
            }
            else
            {
                // payment methods
                item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection();
                item.PaymentMethods.AddRange(
                    new BuyerPaymentMethodCodeType[] { BuyerPaymentMethodCodeType.PayPal }
                    );
                // email is required if paypal is used as payment method
                item.PayPalEmailAddress = "*****@*****.**";
                item.PostalCode         = "3000";
                // handling time is required
                item.DispatchTimeMax = 1;
                // shipping details
                //item.ShippingDetails = BuildShippingDetails();
                item.ShippingDetails = new ShippingDetailsType();
                item.ShippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();

                // return policy
                item.ReturnPolicy = new ReturnPolicyType();
                item.ReturnPolicy.ReturnsAcceptedOption = "ReturnsAccepted";
                ShippingServiceOptionsType shipservice1 = new ShippingServiceOptionsType();
                shipservice1.ShippingService                = "AU_Regular";
                shipservice1.ShippingServicePriority        = 1;
                shipservice1.ShippingServiceCost            = new AmountType();
                shipservice1.ShippingServiceCost.currencyID = CurrencyCodeType.AUD;
                shipservice1.ShippingServiceCost.Value      = 1.0;

                shipservice1.ShippingServiceAdditionalCost            = new AmountType();
                shipservice1.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.AUD;
                shipservice1.ShippingServiceAdditionalCost.Value      = 1.0;

                item.ShippingDetails.ShippingServiceOptions.Add(shipservice1);

                ShippingServiceOptionsType shipservice2 = new ShippingServiceOptionsType();
                shipservice2.ShippingService                = "AU_Express";
                shipservice2.ShippingServicePriority        = 2;
                shipservice2.ShippingServiceCost            = new AmountType();
                shipservice2.ShippingServiceCost.currencyID = CurrencyCodeType.AUD;
                shipservice2.ShippingServiceCost.Value      = 4.0;

                shipservice2.ShippingServiceAdditionalCost            = new AmountType();
                shipservice2.ShippingServiceAdditionalCost.currencyID = CurrencyCodeType.AUD;
                shipservice2.ShippingServiceAdditionalCost.Value      = 1.0;

                item.ShippingDetails.ShippingServiceOptions.Add(shipservice2);
            }



            return(item);
        }