示例#1
0
        public static ListingType GetTradelrSupportedType(ListingTypeCodeType ebayType)
        {
            switch (ebayType)
            {
            case ListingTypeCodeType.Chinese:
            case ListingTypeCodeType.Auction:
                return(ListingType.Chinese);

            case ListingTypeCodeType.FixedPriceItem:
            case ListingTypeCodeType.StoresFixedPrice:
                return(ListingType.FixedPriceItem);

            default:
            case ListingTypeCodeType.Unknown:
            case ListingTypeCodeType.Dutch:
            case ListingTypeCodeType.Live:
            case ListingTypeCodeType.AdType:
            case ListingTypeCodeType.PersonalOffer:
            case ListingTypeCodeType.Half:
            case ListingTypeCodeType.LeadGeneration:
            case ListingTypeCodeType.Express:
            case ListingTypeCodeType.Shopping:
            case ListingTypeCodeType.CustomCode:
                Syslog.Write("Unsupported listing: " + ebayType);
                return(ListingType.FixedPriceItem);

                break;
            }
        }
示例#2
0
        public ActionResult CategorySelector(ListingTypeCodeType type, SiteCodeType site, int?parentid, int?level)
        {
            Debug.Assert(parentid.HasValue || level.HasValue);

            var cats = db.ebay_categories.Where(x => x.siteid == site.ToString());

            if (parentid.HasValue)
            {
                cats = cats.Where(x => x.parentid == parentid.Value && x.categoryid != parentid.Value);
            }

            if (level.HasValue)
            {
                cats = cats.Where(x => x.level == level.Value);
            }

            var viewmodel = new EbayCategoryCondition();

            if (!cats.Any() && parentid.HasValue)
            {
                // we have reached a leaf, get item conditions
                var condition_category = db.ebay_categories.SingleOrDefault(x => x.siteid == site.ToString() &&
                                                                            x.categoryid == parentid.Value);
                if (condition_category != null)
                {
                    viewmodel.conditions = condition_category.ebay_conditions
                                           .Select(x => new IdName()
                    {
                        name = x.name,
                        id   = x.value.ToString()
                    });

                    viewmodel.durations = condition_category.ebay_listingdurations
                                          .Where(x => x.listingtypeid == type.ToString())
                                          .Select(x => new IdName()
                    {
                        name = EbayProductViewModel.DurationNames.ContainsKey(x.duration)?EbayProductViewModel.DurationNames[x.duration]:x.duration,
                        id   = x.duration
                    });
                }
            }
            else
            {
                viewmodel.categories = cats.Select(x => new IdName()
                {
                    id   = x.categoryid.ToString(),
                    name = x.name
                });
            }

            return(Json(viewmodel.ToJsonOKData(), JsonRequestBehavior.AllowGet));
        }
示例#3
0
        /// <summary>
        /// Retrieves the orders for which the authenticated user is a participant, either as the buyer
        /// or the seller. <b>Also for Half.com</b>. The call returns all the
        /// orders that meet the request specifications.
        /// </summary>
        ///
        /// <param name="OrderIDList">
        /// A container for eBay order IDs. If one or more order IDs are specified in this
        /// container, no other call-specific input fields are applicable.
        ///
        /// Not applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeFrom">
        /// The <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields
        /// specify a date range for retrieving orders. The <b>CreateTimeFrom</b> field is the
        /// starting date range. All eBay orders that were created within this date range are
        /// returned in the output. The maximum date range that may be specified with the
        /// <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields is 90
        /// days. <b>CreateTimeFrom</b>/<b>CreateTimeTo</b> date
        /// filters are ignored if the <b>NumberOfDays</b> date filter is used in the request, or if
        /// one or more order IDs are passed in the request.
        ///
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeTo">
        /// The <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields specify a date range for retrieving
        /// orders. The <b>CreateTimeTo</b> field is the ending date range. All eBay orders that were
        /// created within this date range are returned in the output. The maximum
        /// date range that may be specified with the <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields
        /// is 90 days. If the <b>CreateTimeFrom</b> field is used and the
        /// <b>CreateTimeTo</b> field is omitted, the "TimeTo" value defaults to the present time or
        /// to 90 days past the <b>CreateTimeFrom</b> value (if <b>CreateTimeFrom</b> value is more than 90
        /// days in the past). <b>CreateTimeFrom</b>/<b>CreateTimeTo</b> date filters are ignored if the
        /// <b>NumberOfDays</b> date filter is used in the request, or if one or more order IDs are
        /// passed in the request.
        ///
        /// <span class="tablenote"><strong>Note:</strong>
        /// If a GetOrders call is made within a few seconds after the creation of a multiple
        /// line item order, the caller runs the risk of retrieving orders that are in an
        /// inconsistent state, since the order consolidation involved in a multi-line item order
        /// may not have been completed. For
        /// this reason, it is recommended that sellers include the
        /// <b>CreateTimeTo</b> field in the call, and set its value to: <i>
        /// Current Time</i> - 2 minutes.
        ///
        /// Applicable to Half.com.
        /// </span>
        ///
        /// <param name="OrderRole">
        /// Filters the returned orders based on the role of the user. The user's role is
        /// either buyer or seller. If this field is used with a date filter, returned orders
        /// must satisfy both the date range and the OrderRole value.
        ///
        /// Applicable to eBay.com and Half.com.
        /// </param>
        ///
        /// <param name="OrderStatus">
        /// The field is used to retrieve orders that are in a specific state. If this field is used with a date filter, only orders that satisfy both the date range and the <b>OrderStatus</b> value are retrieved.
        ///
        /// For eBay orders, this field's value can be set to 'Active', 'Completed', 'Canceled' or 'Inactive' to retrieve orders in these states. The 'Shipped' value is only applicable for Half.com orders.
        ///
        /// To retrieve Half.com orders, this field's value should be set to 'Shipped', and the <b>ListingType</b> field should be included and set to 'Half'.
        ///
        /// If one or more <b>OrderID</b> values are specified through the <b>OrderIDArray</b> container, the <b>OrderStatus</b> field should not be used, and it is ignored if it is used.
        /// </param>
        ///
        /// <param name="ListingType">
        /// Specify Half to retrieve Half.com orders.
        ///
        /// <span class="tablenote"><strong>Note:</strong>
        /// Do not use this field if you are retrieving eBay orders.
        ///
        /// This field cannot be used as a listing type filter on eBay.com. If not
        /// provided, or if you specify any value other than Half, this field has
        /// no useful effect and the call retrieves eBay orders of all types. Also,
        /// you can't retrieve both eBay and Half.com orders in the same response.
        /// </span>
        /// </param>
        ///
        /// <param name="Pagination">
        /// If many orders are	available to retrieve, you may need to call GetOrders multiple times to retrieve all
        /// the data. Each result set is returned as a page of entries. Use the
        /// Pagination filters to control the maximum number of entries to
        /// retrieve per page (i.e., per call), the page number to retrieve, and
        /// other data.
        /// </param>
        ///
        /// <param name="ModTimeFrom">
        /// The ModTimeFrom and ModTimeTo fields specify a date range for retrieving
        /// existing orders that have been modified within this time window (for example,
        /// 'Incomplete' status to 'Pending' status or 'Pending' status to 'Complete' status). The
        /// ModTimeFrom field is the starting date range. All eBay orders that were last
        /// modified within this date range are returned in the output. The maximum date
        /// range that may be specified with the ModTimeFrom and ModTimeTo fields is 30
        /// days. ModTimeFrom/ModTimeTo date filters are ignored if the
        /// CreateTimeFrom/CreateTimeTo or NumberOfDays date filters are used in the
        /// request, or if one or more order IDs are passed in the request.
        ///
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="ModTimeTo">
        /// The ModTimeFrom and ModTimeTo fields specify a date range for retrieving
        /// existing orders that have been modified within this time window (for example,
        /// 'Incomplete' status to 'Pending' status or 'Pending' status to 'Complete'
        /// status). The ModTimeTo field is the ending date range. All eBay orders that were
        /// last modified within this date range are returned in the output. The maximum
        /// date range that may be specified with the ModTimeFrom and ModTimeTo fields is 30
        /// days. If the ModTimeFrom field is used and the ModTimeTo field is omitted, the
        /// "TimeTo" value defaults to the present time (if ModTimeFrom value is less than
        /// 30 days in the past) or to 30 days past the ModTimeFrom value.
        /// ModTimeFrom/ModTimeTo date filters are ignored if the
        /// CreateTimeFrom/CreateTimeTo or NumberOfDays date filters are used in the
        /// request, or if one or more order IDs are passed in the request.
        ///
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="NumberOfDays">
        /// This filter specifies the number of days (24-hour periods) in the past to search
        /// for orders. All eBay orders that were either created or modified within this
        /// period are returned in the output. This field cannot be used in conjunction with
        /// the CreateTimeFrom/CreateTimeTo or ModTimeFrom/ModTimeTo date filters. This date
        /// filter is ignored if one or more order IDs are passed in the request.
        ///
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="IncludeFinalValueFee">
        /// Indicates whether to include the Final Value Fee (FVF) for all Transaction objects in the
        /// response. The Final Value Fee is returned in Transaction.FinalValueFee. The Final
        /// Value Fee is assessed right after the creation of an eBay order line item.
        ///
        /// </param>
        ///
        /// <param name="SortingOrder">
        /// Specifies how orders returned by this call should be sorted (using <strong>LastModifiedTime</strong> as the sort key). A value of <code>Ascending</code> returns the earliest modified orders first, and a value of <code>Descending</code> returns the latest modified orders first.
        /// <br/><br/>
        /// Default: <code>Ascending</code>
        /// </param>
        public OrderTypeCollection GetOrders(StringCollection OrderIDList, DateTime CreateTimeFrom, DateTime CreateTimeTo, TradingRoleCodeType OrderRole, OrderStatusCodeType OrderStatus, ListingTypeCodeType ListingType, PaginationType Pagination, DateTime ModTimeFrom, DateTime ModTimeTo, int NumberOfDays, bool IncludeFinalValueFee, SortOrderCodeType SortingOrder)
        {
            this.OrderIDList          = OrderIDList;
            this.CreateTimeFrom       = CreateTimeFrom;
            this.CreateTimeTo         = CreateTimeTo;
            this.OrderRole            = OrderRole;
            this.OrderStatus          = OrderStatus;
            this.ListingType          = ListingType;
            this.Pagination           = Pagination;
            this.ModTimeFrom          = ModTimeFrom;
            this.ModTimeTo            = ModTimeTo;
            this.NumberOfDays         = NumberOfDays;
            this.IncludeFinalValueFee = IncludeFinalValueFee;
            this.SortingOrder         = SortingOrder;

            Execute();
            return(ApiResponse.OrderArray);
        }
示例#4
0
        private static ItemType NewItem(
            string title,
            string description,
            string category,
            int condition,
            string duration,
            string email,
            string photo1URL,
            string photo2URL,
            string zipCode,
            string shipService,
            ListingTypeCodeType type = ListingTypeCodeType.FixedPriceItem)
        {
            string htmlDescription =
                string.Format(@"<![CDATA[<table cellspacing ='28' cellpadding='0' width='100%'>
                                           <tbody>
                                             <tr>
                                               <td valign='top'>
                                               <hr size='6'>
                                               <br>
                                               <div align='left'>
                                                 <font size='4'><b>I T E M&nbsp;&nbsp;&nbsp; D E S C R I P T I O N:</b></font>
                                                 <br>
                                               </div>
                                               <font size='3'><br>%s<br><br>
                                                 <b>All of my items are stored in a clean and smoke free home.</b>
                                                 <br><br><br><hr><br><br>
                                                 <i><b>NOW OFFERING COMBINED SHIPPING!</b></i>
                                                 <br><br>
                                                 <i>Add items to your cart to see the HUGE savings! Shipping charges will be calculated automatically based on weight.</i>
                                                 <br><br><br><hr size='6'>
                                               </font>
                                             </td>
                                           </tr>
                                         </tbody>
                                       </table>]]>{0}", description);

            var item = new ItemType
            {
                Title           = title,
                Description     = htmlDescription,
                PrimaryCategory = new CategoryType {
                    CategoryID = category
                },
                StartPrice = new AmountType()
                {
                    Value = 0
                },
                CategoryMappingAllowed = true,
                Country            = CountryCodeType.US,
                ConditionID        = condition,
                Currency           = CurrencyCodeType.USD,
                DispatchTimeMax    = 3,
                ListingDuration    = duration,
                ListingType        = type,
                PaymentMethods     = { BuyerPaymentMethodCodeType.PayPal },
                PayPalEmailAddress = email,
                PictureDetails     = new PictureDetailsType()
                {
                    PictureURL = { photo1URL, photo2URL }
                },
                PostalCode   = zipCode,
                Quantity     = 0,
                ReturnPolicy = new ReturnPolicyType()
                {
                    ReturnsAcceptedOption    = "ReturnsAccepted",
                    RefundOption             = "MoneyBack",
                    ReturnsWithinOption      = "Days_30",
                    Description              = "If you are not satisfied, return the book for refund.",
                    ShippingCostPaidByOption = "Buyer"
                },
                SellerProfiles = new SellerProfilesType()
                {
                    SellerPaymentProfile = new SellerPaymentProfileType()
                    {
                        PaymentProfileName = "PayPal:Immediate pay"
                    },
                    SellerReturnProfile = new SellerReturnProfileType()
                    {
                        ReturnProfileName = "30 Day Return Policy"
                    },
                    SellerShippingProfile = new SellerShippingProfileType()
                    {
                        ShippingProfileName = ""
                    }
                },
                ShippingDetails = new ShippingDetailsType()
                {
                    ShippingType           = ShippingTypeCodeType.Calculated,
                    ShippingServiceOptions = new ShippingServiceOptionsTypeCollection()
                    {
                        new ShippingServiceOptionsType()
                        {
                            ShippingServicePriority = 1
                        },
                        new ShippingServiceOptionsType()
                        {
                            ShippingService = "USPSMedia"
                        }
                    },
                    CalculatedShippingRate = new CalculatedShippingRateType()
                    {
                        OriginatingPostalCode  = zipCode,
                        PackagingHandlingCosts = new AmountType()
                        {
                            Value = 0
                        }
                    }
                },
                ShippingPackageDetails = new ShipPackageDetailsType()
                {
                    ShippingPackage = ShippingPackageCodeType.PackageThickEnvelope,
                    WeightMajor     = new MeasureType()
                    {
                        Value = 0
                    },
                    WeightMinor = new MeasureType()
                    {
                        Value = 0
                    }
                },
                Site = SiteCodeType.US
            };

            return(item);
        }
示例#5
0
        /// <summary>
        /// Enables a seller to do various tasks after the creation of a single line item or
        /// multiple line item order. Typically, this call is used after the
        /// buyer has paid for the order, but it can be called by the
        /// seller beforehand. Typical post-payment tasks available to this call include
        /// marking the order as paid, marking the order as shipped, providing shipment tracking
        /// details, and leaving feedback for the buyer.
        /// </summary>
        /// 
        /// <param name="ItemID">
        /// Unique identifier for an eBay item listing. An <b>ItemID</b> can be paired up
        /// with a corresponding <b>TransactionID</b> and used in the <b>CompleteSale</b> request
        /// to identify a single line item order.
        /// 
        /// 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
        /// order, the <b>ItemID</b>/<b>TransactionID</b> pair must be
        /// specified. For a multiple line item 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="TransactionID">
        /// Unique identifier for an eBay order line item (transaction). The
        /// <b>TransactionID</b> can be paired up with the corresponding <b>ItemID</b> and used in
        /// the <b>CompleteSale</b> request to identify a single line item order.
        /// 
        /// 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
        /// order, the <b>ItemID</b>/<b>TransactionID</b> pair must be
        /// specified. For a multiple line item 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="FeedbackInfo">
        /// This container is used by the seller to leave feedback for the buyer for the
        /// order line item identified in the call request. The seller must include and
        /// specify all fields of this type, including the buyer's eBay User ID, the
        /// Feedback rating (a seller can only leave a buyer a "Positive" rating), and a
        /// comment, which helps justify the Feedback rating. The eBay User ID must match 
        /// the buyer who bought the order line item, or an error will occur. An error will 
        /// also occur if Feedback has already been left for the buyer (either through API 
        /// or the Web flow).
        /// 
        /// To determine if Feedback has already been left for an order line item, you can 
        /// call <b class="con">GetFeedback</b>, passing in the 
        /// <b class="con">OrderLineItemID</b> value in the call request.
        /// </param>
        ///
        /// <param name="Shipped">
        /// The seller includes and sets this field to true if the order has been
        /// shipped. If the call is successful, the order line item(s) are marked as
        /// Shipped in My eBay.
        /// 
        /// If the seller includes and sets this field to false, the order line item(s)
        /// are marked (or remain) as Not Shipped in My eBay.
        /// 
        /// If this field is not included, the shipped status of the order line
        /// item(s) remain unchanged in My eBay.
        /// 
        /// If shipment tracking information is provided for an order line item through
        /// the Shipment container in the same request, the order line item is marked as
        /// shipped automatically and the <b>Shipped</b> field is not
        /// required.
        /// </param>
        ///
        /// <param name="Paid">
        /// The seller includes and sets this field to true if the buyer has paid for
        /// the order. If the call is successful, the
        /// order line item(s) are marked as Paid in My eBay.
        /// 
        /// If the seller includes and sets this field to false, the order line item(s)
        /// are marked (or remain) as Not Paid in My eBay.
        /// 
        /// If this field is not included, the paid status of the order line
        /// item(s) remain unchanged in My eBay.
        /// </param>
        ///
        /// <param name="ListingType">
        /// This field is required if <b>CompleteSale</b> is being used for a Half.com
        /// order. The value should be set to <i>Half</i>, which is the only applicable
        /// <b>ListingType</b> value for this call.
        /// </param>
        ///
        /// <param name="Shipment">
        /// Container consisting of shipment tracking information, shipped time, and an
        /// optional text field to provide additional details to the buyer. Setting the
        /// tracking number and shipping carrier automatically marks the item as shipped
        /// and the <b>Shipped</b> field is not required.
        /// 
        /// (If you supply <b>ShipmentTrackingNumber</b> you must also supply 
        /// <b>ShippingCarrierUsed</b>, otherwise you will get an error.
        /// 
        /// To modify the shipping tracking number and/or carrier, supply the new number
        /// in <b>ShipmentTrackingNumber</b> or supply the value for
        /// <b>ShippingCarrierUsed</b> or both. The old number and carrier
        /// are deleted and the new ones are added.
        /// 
        /// To simply delete the current tracking details altogether, supply empty
        /// <b>Shipment</b> tags.
        ///  
        /// 
        /// <span class="tablenote"><b>Note:</b>
        /// Top-Rated sellers must have a record of uploading shipment tracking
        /// information (through site or through API) for at least 90 percent of their order line
        /// items (purchased by U.S. buyers) to keep their status as Top-Rated sellers. For more
        /// information on the requirements to becoming a Top-Rated Seller, see the 
        /// <a href="http://pages.ebay.com/help/sell/top-rated.html">Becoming a Top-Rated Seller and qualifying for Top-Rated Plus</a> 
        /// customer support page.
        /// </span>
        /// 
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line
        /// item 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 multiple line item orders, the <b>OrderID</b> value is created by eBay
        /// when the buyer is purchasing multiple order line items from the same seller at the same time.
        /// For multiple line item orders not going through the eBay Cart flow, a Combined Invoice order can be created by the seller
        /// through the <b>AddOrder</b> call. The <b>OrderID</b> can be used in the <b>CompleteSale</b>
        /// request to identify a single or multiple line item order.
        /// 
        /// <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="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 in the
        /// <b>CompleteSale</b> request.
        /// 
        /// 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 order, the <b>OrderLineItemID</b> must be specified.
        /// For a multiple line item order, <b>OrderID</b> must 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 CompleteSale(string ItemID, string TransactionID, FeedbackInfoType FeedbackInfo, bool Shipped, bool Paid, ListingTypeCodeType ListingType, ShipmentType Shipment, string OrderID, string OrderLineItemID)
        {
            this.ItemID = ItemID;
            this.TransactionID = TransactionID;
            this.FeedbackInfo = FeedbackInfo;
            this.Shipped = Shipped;
            this.Paid = Paid;
            this.ListingType = ListingType;
            this.Shipment = Shipment;
            this.OrderID = OrderID;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
        }
示例#6
0
        /// <summary>
        /// Enables a seller to do various tasks after the creation of a single line item or
        /// multiple line item (Combined Invoice) order. Typically, this call is used after the order has been paid
        /// by the buyer, but it can be called by the seller beforehand. Typical post-
        /// payment tasks available to this call include marking the order as paid, marking
        /// the order as shipped, providing shipment tracking details, and leaving feedback
        /// for the buyer.
        /// </summary>
        ///
        /// <param name="ItemID">
        /// Unique identifier for an eBay item listing. An <b>ItemID</b> can be paired up
        /// with a corresponding <b>TransactionID</b> and used in the <b>CompleteSale</b> request
        /// to identify a single line item order.
        ///
        /// 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="TransactionID">
        /// Unique identifier for an eBay order line item. The
        /// <b>TransactionID</b> can be paired up with the corresponding <b>ItemID</b> and used in
        /// the <b>CompleteSale</b> request to identify a single line item order.
        ///
        /// 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="FeedbackInfo">
        /// This container is used by the seller to leave feedback for the buyer for the order line item identified in the call request. The seller must include and specify all fields of this type, including the buyer's eBay User ID, the Feedback rating (a seller can only leave a buyer a 'Positive' rating), and a comment, which helps justify the Feedback rating. The eBay User ID must match the buyer who bought the order line item, or an error will occur. An error will also occur if Feedback has already been left for the buyer (either through API or the Web flow).
        ///
        /// To determine if Feedback has already been left for an order line item, you can call <b class="con">GetFeedback</b>, passing in the <b class="con">OrderLineItemID</b> value in the call request.
        /// </param>
        ///
        /// <param name="Shipped">
        /// The seller includes and sets this field to true if the order has been
        /// shipped. If the call is successful, the order line item(s) are marked as
        /// Shipped in My eBay.
        ///
        /// If the seller includes and sets this field to false, the order line item(s)
        /// are marked (or remain) as Not Shipped in My eBay.
        ///
        /// If this field is not included, the shipped status of the order line
        /// item(s) remain unchanged in My eBay.
        ///
        /// If shipment tracking information is provided through the Shipment
        /// container in the same request, the <b>Shipped</b> status is set to True
        /// automatically and the <b>Shipped</b> field is not required.
        /// </param>
        ///
        /// <param name="Paid">
        /// The seller includes and sets this field to true if the order has been
        /// paid for by the buyer. If the call is successful, the order line item(s)
        /// are marked as Paid in My eBay.
        ///
        /// If the seller includes and sets this field to false, the order line item(s)
        /// are marked (or remain) as Not Paid in My eBay.
        ///
        /// If this field is not included, the paid status of the order line
        /// item(s) remain unchanged in My eBay.
        /// </param>
        ///
        /// <param name="ListingType">
        /// <span class="tablenote"><b>Note: </b> DO NOT USE THIS FIELD. Previously, this field's only purpose was to classify the order to be updated as a Half.com order. However, since the Half.com site has been shut down, this field is no longer applicable.
        /// </span>
        /// </param>
        ///
        /// <param name="Shipment">
        /// Container consisting of shipment tracking information, shipped time, and an optional text field to provide additional details to the buyer. Setting the tracking number and shipping carrier automatically marks the item as shipped and the <b>Shipped</b> field is not required.
        /// If you supply <b>ShipmentTrackingNumber</b>, you must also supply <b>ShippingCarrierUsed</b>; otherwise you will get an error.
        ///
        /// To modify the shipping tracking number and/or carrier, supply the new number in <b>ShipmentTrackingNumber</b> or supply the value for <b>ShippingCarrierUsed</b>, or both. The old number and carrier are deleted and the new ones are added.
        ///
        /// To simply delete the current tracking details altogether, supply empty <b>Shipment</b> tags.
        ///
        /// <span class="tablenote"><b>Note:</b> Top-Rated sellers must have a record of uploading shipment tracking information (through site or through API) for at least 95 percent of their order line items (purchased by U.S. buyers) to keep their status as Top-Rated sellers. For more information on the requirements to becoming a Top-Rated Seller, see the <a href="http://pages.ebay.com/help/sell/top-rated.html">Becoming a Top-Rated Seller and qualifying for Top-Rated Plus</a> customer support page. </span>
        /// </param>
        ///
        /// <param name="OrderID">
        /// A unique identifier that identifies a single line item or multiple line item 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 multiple line item orders, the <b>OrderID</b> value is created by eBay when the buyer is purchasing multiple order line items from the same seller at the same time. For multiple line item orders not going through the eBay Cart flow, a Combined Invoice order can be created by the seller through the <b>AddOrder</b> call. The <b>OrderID</b> can be used in the <b>CompleteSale</b> request to identify a single or multiple line item order.
        ///  <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="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 in the
        /// <b>CompleteSale</b> request.
        ///
        /// 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> must 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 CompleteSale(string ItemID, string TransactionID, FeedbackInfoType FeedbackInfo, bool Shipped, bool Paid, ListingTypeCodeType ListingType, ShipmentType Shipment, string OrderID, string OrderLineItemID)
        {
            this.ItemID          = ItemID;
            this.TransactionID   = TransactionID;
            this.FeedbackInfo    = FeedbackInfo;
            this.Shipped         = Shipped;
            this.Paid            = Paid;
            this.ListingType     = ListingType;
            this.Shipment        = Shipment;
            this.OrderID         = OrderID;
            this.OrderLineItemID = OrderLineItemID;

            Execute();
        }
示例#7
0
        /// <summary>
        /// Retrieves the orders for which the authenticated user is a participant, either as the buyer
        /// or the seller.&nbsp;<b>Also for Half.com</b>. The call returns all the
        /// orders that meet the request specifications.
        /// </summary>
        /// 
        /// <param name="OrderIDList">
        /// A container for eBay order IDs. If one or more order IDs are specified in this
        /// container, no other call-specific input fields are applicable.
        /// 
        /// Not applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeFrom">
        /// The <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields
        /// specify a date range for retrieving orders. The <b>CreateTimeFrom</b> field is the
        /// starting date range. All eBay orders that were created within this date range are
        /// returned in the output. The maximum date range that may be specified with the
        /// <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields is 90 
        /// days. <b>CreateTimeFrom</b>/<b>CreateTimeTo</b> date
        /// filters are ignored if the <b>NumberOfDays</b> date filter is used in the request, or if
        /// one or more order IDs are passed in the request.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeTo">
        /// The <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields specify a date range for retrieving
        /// orders. The <b>CreateTimeTo</b> field is the ending date range. All eBay orders that were
        /// created within this date range are returned in the output. The maximum
        /// date range that may be specified with the <b>CreateTimeFrom</b> and <b>CreateTimeTo</b> fields
        /// is 90 days. If the <b>CreateTimeFrom</b> field is used and the
        /// <b>CreateTimeTo</b> field is omitted, the "TimeTo" value defaults to the present time or
        /// to 90 days past the <b>CreateTimeFrom</b> value (if <b>CreateTimeFrom</b> value is more than 90
        /// days in the past). <b>CreateTimeFrom</b>/<b>CreateTimeTo</b> date filters are ignored if the
        /// <b>NumberOfDays</b> date filter is used in the request, or if one or more order IDs are
        /// passed in the request.
        /// 
        /// <span class="tablenote"><strong>Note:</strong>
        /// If a GetOrders call is made within a few seconds after the creation of a multiple
        /// line item order, the caller runs the risk of retrieving orders that are in an
        /// inconsistent state, since the order consolidation involved in a multi-line item order
        /// may not have been completed. For
        /// this reason, it is recommended that sellers include the
        /// <b>CreateTimeTo</b> field in the call, and set its value to: <i>
        /// Current Time</i> - 2 minutes.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="OrderRole">
        /// Filters the returned orders based on the role of the user. The user's role is
        /// either buyer or seller. If this field is used with a date filter, returned orders
        /// must satisfy both the date range and the OrderRole value.
        /// 
        /// Applicable to eBay.com and Half.com.
        /// </param>
        ///
        /// <param name="OrderStatus">
        /// The field is used to retrieve orders that are in a specific state. If this field is used with a date filter, only orders that satisfy both the date range and the <b>OrderStatus</b> value are retrieved. 
        /// 
        /// For eBay orders, this field's value can be set to 'Active', 'Completed', 'Canceled' or 'Inactive' to retrieve orders in these states. The 'Shipped' value is only applicable for Half.com orders. 
        /// 
        /// To retrieve Half.com orders, this field's value should be set to 'Shipped', and the <b>ListingType</b> field should be included and set to 'Half'. 
        /// 
        /// If one or more <b>OrderID</b> values are specified through the <b>OrderIDArray</b> container, the <b>OrderStatus</b> field should not be used, and it is ignored if it is used. 
        /// </param>
        ///
        /// <param name="ListingType">
        /// Specify Half to retrieve Half.com orders.
        /// 
        /// <span class="tablenote"><strong>Note:</strong>
        /// Do not use this field if you are retrieving eBay orders.
        /// 
        /// This field cannot be used as a listing type filter on eBay.com. If not
        /// provided, or if you specify any value other than Half, this field has
        /// no useful effect and the call retrieves eBay orders of all types. Also,
        /// you can't retrieve both eBay and Half.com orders in the same response.
        /// </span>
        /// </param>
        ///
        /// <param name="Pagination">
        /// If many orders are	available to retrieve, you may need to call GetOrders multiple times to retrieve all
        /// the data. Each result set is returned as a page of entries. Use the
        /// Pagination filters to control the maximum number of entries to
        /// retrieve per page (i.e., per call), the page number to retrieve, and
        /// other data.
        /// </param>
        ///
        /// <param name="ModTimeFrom">
        /// The ModTimeFrom and ModTimeTo fields specify a date range for retrieving
        /// existing orders that have been modified within this time window (for example,
        /// 'Incomplete' status to 'Pending' status or 'Pending' status to 'Complete' status). The
        /// ModTimeFrom field is the starting date range. All eBay orders that were last
        /// modified within this date range are returned in the output. The maximum date
        /// range that may be specified with the ModTimeFrom and ModTimeTo fields is 30
        /// days. ModTimeFrom/ModTimeTo date filters are ignored if the
        /// CreateTimeFrom/CreateTimeTo or NumberOfDays date filters are used in the
        /// request, or if one or more order IDs are passed in the request.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="ModTimeTo">
        /// The ModTimeFrom and ModTimeTo fields specify a date range for retrieving
        /// existing orders that have been modified within this time window (for example,
        /// 'Incomplete' status to 'Pending' status or 'Pending' status to 'Complete'
        /// status). The ModTimeTo field is the ending date range. All eBay orders that were
        /// last modified within this date range are returned in the output. The maximum
        /// date range that may be specified with the ModTimeFrom and ModTimeTo fields is 30
        /// days. If the ModTimeFrom field is used and the ModTimeTo field is omitted, the
        /// "TimeTo" value defaults to the present time (if ModTimeFrom value is less than
        /// 30 days in the past) or to 30 days past the ModTimeFrom value.
        /// ModTimeFrom/ModTimeTo date filters are ignored if the
        /// CreateTimeFrom/CreateTimeTo or NumberOfDays date filters are used in the
        /// request, or if one or more order IDs are passed in the request.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="NumberOfDays">
        /// This filter specifies the number of days (24-hour periods) in the past to search
        /// for orders. All eBay orders that were either created or modified within this
        /// period are returned in the output. This field cannot be used in conjunction with
        /// the CreateTimeFrom/CreateTimeTo or ModTimeFrom/ModTimeTo date filters. This date 
        /// filter is ignored if one or more order IDs are passed in the request.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="IncludeFinalValueFee">
        /// Indicates whether to include the Final Value Fee (FVF) for all Transaction objects in the
        /// response. The Final Value Fee is returned in Transaction.FinalValueFee. The Final
        /// Value Fee is assessed right after the creation of an eBay order line item.
        /// 
        /// </param>
        ///
        /// <param name="SortingOrder">
        /// Specifies how orders returned by this call should be sorted (using <strong>LastModifiedTime</strong> as the sort key). A value of <code>Ascending</code> returns the earliest modified orders first, and a value of <code>Descending</code> returns the latest modified orders first.
        /// <br/><br/>
        /// Default: <code>Ascending</code>
        /// </param>
        ///
        public OrderTypeCollection GetOrders(StringCollection OrderIDList, DateTime CreateTimeFrom, DateTime CreateTimeTo, TradingRoleCodeType OrderRole, OrderStatusCodeType OrderStatus, ListingTypeCodeType ListingType, PaginationType Pagination, DateTime ModTimeFrom, DateTime ModTimeTo, int NumberOfDays, bool IncludeFinalValueFee, SortOrderCodeType SortingOrder)
        {
            this.OrderIDList = OrderIDList;
            this.CreateTimeFrom = CreateTimeFrom;
            this.CreateTimeTo = CreateTimeTo;
            this.OrderRole = OrderRole;
            this.OrderStatus = OrderStatus;
            this.ListingType = ListingType;
            this.Pagination = Pagination;
            this.ModTimeFrom = ModTimeFrom;
            this.ModTimeTo = ModTimeTo;
            this.NumberOfDays = NumberOfDays;
            this.IncludeFinalValueFee = IncludeFinalValueFee;
            this.SortingOrder = SortingOrder;

            Execute();
            return ApiResponse.OrderArray;
        }
示例#8
0
        // startprice = starting price for auctions, selling price for fixeditems
        public ItemType BuildItem(SiteCodeType site, ListingTypeCodeType listingType, string title, string description,
                                  CurrencyCodeType currency, double?buynowPrice, double startPrice, double?reservePrice, string location, CountryCodeType country,
                                  int categoryid, int quantity, int?conditionID, ReturnsAccepted returns, string listingDuration,
                                  string refund_policy, string return_within, int dispatch_time, string paypal_email)
        {
            item = new ItemType();

            item.Site = site;

            // item title
            item.Title = title;

            // item description
            // append powered by tradelr
            if (description.IndexOf("http://wwww.tradelr.com/Content/img/tradelr.png") == -1)
            {
                item.Description =
                    string.Format("{0}<p>&nbsp;</p><p><center><img src='http://wwww.tradelr.com/Content/img/tradelr.png' /><div>powered by <a target='_blank' href='http://www.tradelr.com'>tradelr</a></div></center></p>",
                                  description);
            }
            else
            {
                item.Description = description;
            }

            // http://developer.ebay.com/DevZone/xml/docs/Reference/ebay/types/ListingTypeCodeType.html
            item.ListingType = listingType;

            // prices
            item.Currency   = currency;
            item.StartPrice = new AmountType
            {
                Value      = startPrice,
                currencyID = currency
            };

            if (buynowPrice.HasValue)
            {
                item.BuyItNowPrice = new AmountType
                {
                    Value      = buynowPrice.Value,
                    currencyID = currency
                };
            }

            if (reservePrice.HasValue)
            {
                item.ReservePrice = new AmountType()
                {
                    Value      = reservePrice.Value,
                    currencyID = currency
                };
            }

            // listing duration
            item.ListingDuration = listingDuration;

            // item location and country
            item.Location = location;
            item.Country  = country;

            // listing category, Photography Software
            var category = new CategoryType();

            category.CategoryID  = categoryid.ToString();
            item.PrimaryCategory = category;

            // item quality
            item.Quantity = quantity;

            // payment methods
            item.PaymentMethods = paymentOptions;

            // email is required if paypal is used as payment method
            item.PayPalEmailAddress = paypal_email;

            // http://developer.ebay.com/devzone/finding/callref/Enums/conditionIdList.html
            if (conditionID.HasValue)
            {
                item.ConditionID = conditionID.Value;
            }

            item.DispatchTimeMax = dispatch_time;

            // return policy
            var policy = new ReturnPolicyType
            {
                ReturnsAcceptedOption    = returns.ToString(),
                ShippingCostPaidByOption = "Buyer"
            };

            if (returns == ReturnsAccepted.ReturnsAccepted)
            {
                policy.Refund = refund_policy;
                policy.ReturnsWithinOption = return_within;
            }

            item.ReturnPolicy = policy;

            return(item);
        }
示例#9
0
        /// <summary>
        /// Retrieves the orders for which the authenticated user is a participant, either as
        /// the buyer or the seller. The call returns all the orders that meet the request
        /// specifications.
        /// </summary>
        /// 
        /// <param name="OrderIDList">
        /// A set of orders to retrieve.
        /// 
        /// Not applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeFrom">
        /// The starting date of the date range for the orders to retrieve.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="CreateTimeTo">
        /// The ending date of the date range for the orders to retrieve.
        /// 
        /// Applicable to Half.com.
        /// </param>
        ///
        /// <param name="OrderRole">
        /// Filters orders based on the role of the user making the GetOrders request.
        /// 
        /// Not applicable to Half.com.
        /// </param>
        ///
        /// <param name="OrderStatus">
        /// Filters the returned orders by order status (Active or Completed).
        /// To retrieve orders with a status of Inactive or Cancelled, you must
        /// specify the order IDs (OrderIDArray.OrderID). When you specify
        /// OrderIDArray.OrderID, no other filters are used.
        /// 
        /// For Half.com, you can get some, but not all orders.
        /// Orders on Half.com have different order status values from
        /// eBay orders. When you set ListingType to Half, set OrderStatus
        /// to Shipped. Otherwise, GetOrders may return incomplete information
        /// or have indeterminate results.
        /// </param>
        ///
        /// <param name="ListingType">
        /// Specify Half to retrieve Half.com orders.
        /// 
        /// <span class="tablenote"><strong>Note:</strong>
        /// Do not use this field if you are retrieving eBay orders.
        /// 
        /// This field cannnot be used as a listing type filter on eBay.com. If not
        /// provided, or if you specify any value other than Half, this field has
        /// no useful effect and the call retrieves eBay orders of all types. Also,
        /// you can't retrieve both eBay and Half.com orders in the same response.
        /// </span>
        /// </param>
        ///
        /// <param name="Pagination">
        /// Not applicable to eBay.com. Applicable to Half.com. If many orders are
        /// available, you may need to call GetOrders multiple times to retrieve all
        /// the data. Each result set is returned as a page of entries. Use this
        /// Pagination information to indicate the maximum number of entries to
        /// retrieve per page (i.e., per call), the page number to retrieve, and
        /// other data.
        /// </param>
        ///
        public OrderTypeCollection GetOrders(StringCollection OrderIDList, DateTime CreateTimeFrom, DateTime CreateTimeTo, TradingRoleCodeType OrderRole, OrderStatusCodeType OrderStatus, ListingTypeCodeType ListingType, PaginationType Pagination)
        {
            this.OrderIDList = OrderIDList;
            this.CreateTimeFrom = CreateTimeFrom;
            this.CreateTimeTo = CreateTimeTo;
            this.OrderRole = OrderRole;
            this.OrderStatus = OrderStatus;
            this.ListingType = ListingType;
            this.Pagination = Pagination;

            Execute();
            return ApiResponse.OrderArray;
        }