// Complete a order: e.g., // 1) mark item as paid, // 2) mark item as shipped, // 3) leave feedback for user // Unique identifier for an eBay order line item (transaction). // The TransactionID can be paired up with the corresponding ItemID and used in the CompleteSale request // to identify a single line item order. // Unless an OrderLineItemID is used to identify a single line item order, // or the OrderID is used to identify a single or multiple line item order, // the ItemID/TransactionID pair must be specified. // For a multiple line item order, OrderID must be used. // If OrderID or OrderLineItemID are specified, the ItemID/TransactionID pair is ignored if present in the same request. public static bool CompleteSale(AccountType account, string orderId, string buyerId, string itemId, string ebayTransId, bool setIsPaid, bool isPaid, bool setIsShipped, bool isShipped) { Logger.WriteSystemLog(string.Format("buyerId={0} orderId={1} :Mark item as shipped.", buyerId, orderId)); FeedbackInfoType feedback = new FeedbackInfoType(); feedback.CommentText = "Great Buyer, fast payment, thanks for purchasing!"; feedback.CommentType = CommentTypeCodeType.Positive; feedback.TargetUser = buyerId; CompleteSaleCall completeSaleApiCall = new CompleteSaleCall(account.SellerApiContext); completeSaleApiCall.FeedbackInfo = feedback; if (setIsPaid) { completeSaleApiCall.Paid = isPaid; } if (setIsShipped) { completeSaleApiCall.Shipped = isShipped; } //completeSaleApiCall.ItemID = itemId; //completeSaleApiCall.TransactionID = ebayTransId; completeSaleApiCall.OrderID = orderId; completeSaleApiCall.Execute(); return(true); }
// Complete a order: e.g., // 1) mark item as paid, // 2) mark item as shipped, // 3) leave feedback for user // Unique identifier for an eBay order line item (transaction). // The TransactionID can be paired up with the corresponding ItemID and used in the CompleteSale request // to identify a single line item order. // Unless an OrderLineItemID is used to identify a single line item order, // or the OrderID is used to identify a single or multiple line item order, // the ItemID/TransactionID pair must be specified. // For a multiple line item order, OrderID must be used. // If OrderID or OrderLineItemID are specified, the ItemID/TransactionID pair is ignored if present in the same request. public static bool CompleteSale(AccountType account, string orderId, string buyerId, string itemId, string ebayTransId, bool setIsPaid, bool isPaid, bool setIsShipped, bool isShipped) { Logger.WriteSystemLog(string.Format("buyerId={0} orderId={1} :Mark item as shipped.", buyerId, orderId)); FeedbackInfoType feedback = new FeedbackInfoType(); feedback.CommentText = "Great Buyer, fast payment, thanks for purchasing!"; feedback.CommentType = CommentTypeCodeType.Positive; feedback.TargetUser = buyerId; CompleteSaleCall completeSaleApiCall = new CompleteSaleCall(account.SellerApiContext); completeSaleApiCall.FeedbackInfo = feedback; if (setIsPaid) completeSaleApiCall.Paid = isPaid; if (setIsShipped) completeSaleApiCall.Shipped = isShipped; //completeSaleApiCall.ItemID = itemId; //completeSaleApiCall.TransactionID = ebayTransId; completeSaleApiCall.OrderID = orderId; completeSaleApiCall.Execute(); return true; }
public void Feedback(FeedbackInfoType infoType, string message) { FeedbackInfo info = new FeedbackInfo() { Owner = this, InfoType = infoType, Message = StringHelper.ToSingleEmptyLine(message) }; this.Feedback(info); }
public void Feedback(FeedbackInfoType infoType, string message) { FeedbackInfo info = new FeedbackInfo() { Owner = this, InfoType = infoType, Message = StringHelper.ToSingleEmptyLine(message) }; if (this.observer != null) { FeedbackHelper.Feedback(this.observer, info); } }
public void Feedback(FeedbackInfoType infoType, string message) { if (this.m_Observer != null) { this.m_Observer.OnNext(new FeedbackInfo() { Owner = this.GetType().Name, InfoType = infoType, Message = message }); } }
/// <summary> /// For backward compatibility with old wrappers. /// </summary> public void CompleteSale(string ItemID, string TransactionID, FeedbackInfoType FeedbackInfo, bool Shipped, bool Paid) { this.ItemID = ItemID; this.TransactionID = TransactionID; this.FeedbackInfo = FeedbackInfo; this.Shipped = Shipped; this.Paid = Paid; Execute(); }
/// <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(); }
public void Feedback(object owner, string content, FeedbackInfoType infoType = FeedbackInfoType.Info, bool enableLog = true, bool suppressError = false) { FeedbackInfo info = new FeedbackInfo() { InfoType = infoType, Message = StringHelper.ToSingleEmptyLine(content), Owner = owner }; FeedbackHelper.Feedback(suppressError ? null : this.observer, info, enableLog); if (this.OnFeedback != null) { this.OnFeedback(info); } }
public ActionResult ShipEbay(long id, string shippingService, string trackingno, string feedbackComment) { if (string.IsNullOrEmpty(feedbackComment)) { return(Json("Please enter a feedback".ToJsonFail())); } if (string.IsNullOrEmpty(shippingService)) { return(Json("Please specify a shipping service".ToJsonFail())); } var order = repository.GetOrder(subdomainid.Value, id); if (order == null) { return(Json("Order not found".ToJsonFail())); } var transaction = new Transaction(order, repository, sessionid.Value); // update local order transaction.UpdateOrderAsShipped(shippingService, trackingno); // update ebay order var token = repository.GetOAuthToken(subdomainid.Value, OAuthTokenType.EBAY, true); var ebayservice = new OrderService(token.token_key); // create feedback entry var feedback = new FeedbackInfoType(); feedback.CommentText = feedbackComment; feedback.CommentType = CommentTypeCodeType.Positive; // create shipment entry var shipment = new ShipmentType(); shipment.ShipmentTrackingNumber = trackingno; shipment.ShippingCarrierUsed = shippingService; // complete sale has to be called for each orderitem foreach (var ebayOrderitem in order.ebay_order.ebay_orderitems) { ebayservice.CompleteSale(order.ebay_order.orderid, ebayOrderitem.lineid, true, true, feedback, shipment); } return(Json("Order shipped".ToJsonOKMessage())); }
// Leave feedback for an order. public static bool LeaveFeedback(AccountType account, string orderId, string buyerId, string itemId, string ebayTransId) { CompleteSaleCall completeSaleApiCall = new CompleteSaleCall(account.SellerApiContext); FeedbackInfoType feedback = new FeedbackInfoType(); feedback.CommentText = "Great Buyer, fast payment, thanks for purchasing!"; feedback.CommentType = CommentTypeCodeType.Positive; feedback.TargetUser = buyerId; completeSaleApiCall.FeedbackInfo = feedback; completeSaleApiCall.ItemID = itemId; completeSaleApiCall.TransactionID = ebayTransId; completeSaleApiCall.Execute(); return(true); }
// https://developer.ebay.com/DevZone/XML/docs/Reference/ebay/CompleteSale.html public void CompleteSale(string orderid, string orderlineitemid, bool paid, bool shipped, FeedbackInfoType feedback, ShipmentType shipment) { var call = new CompleteSaleCall(api); call.DetailLevelList.Add(DetailLevelCodeType.ReturnAll); call.CompleteSale("", "", feedback, shipped, paid, ListingTypeCodeType.CustomCode, shipment, orderid, orderlineitemid); }
/// <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(); }
// Leave feedback for an order. public static bool LeaveFeedback(AccountType account, string orderId, string buyerId, string itemId, string ebayTransId) { CompleteSaleCall completeSaleApiCall = new CompleteSaleCall(account.SellerApiContext); FeedbackInfoType feedback = new FeedbackInfoType(); feedback.CommentText = "Great Buyer, fast payment, thanks for purchasing!"; feedback.CommentType = CommentTypeCodeType.Positive; feedback.TargetUser = buyerId; completeSaleApiCall.FeedbackInfo = feedback; completeSaleApiCall.ItemID = itemId; completeSaleApiCall.TransactionID = ebayTransId; completeSaleApiCall.Execute(); return true; }