-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d3c1bd
commit 673b1cc
Showing
14 changed files
with
198 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using EbaySharp.Entities.TraditionalSelling.Trading; | ||
using EbaySharp.Source; | ||
using System.Text; | ||
using System.Xml.Linq; | ||
|
||
namespace EbaySharp.Controllers | ||
{ | ||
class TradingController | ||
{ | ||
private string accessToken; | ||
public TradingController(string accessToken) | ||
{ | ||
this.accessToken = accessToken; | ||
} | ||
public async Task<GetSellerListResponse> GetItems(int pageNumber, int entriesPerPage, string endTimeFrom, string endTimeTo) | ||
{ | ||
XNamespace ns = "urn:ebay:apis:eBLBaseComponents"; | ||
XDocument xmlDocument = new XDocument( | ||
new XDeclaration("1.0", "utf-8", "yes"), | ||
new XElement(ns + "GetSellerListRequest", new XAttribute("xmlns", ns), | ||
new XElement("RequesterCredentials", | ||
new XElement("eBayAuthToken", accessToken) | ||
), | ||
new XElement("GranularityLevel", "Coarse"), | ||
new XElement("EndTimeFrom", endTimeFrom), | ||
new XElement("EndTimeTo", endTimeTo), | ||
new XElement("Pagination", | ||
new XElement("EntriesPerPage", entriesPerPage), | ||
new XElement("PageNumber", pageNumber) | ||
) | ||
) | ||
); | ||
var memory = new MemoryStream(); | ||
xmlDocument.Save(memory); | ||
string xmlText = Encoding.UTF8.GetString(memory.ToArray()).Replace("xmlns=\"\"", ""); | ||
|
||
return await new RequestExecuter().ExecuteLegacyPostRequest<GetSellerListResponse>(Constants.TRADIONAL.CALLS.GetSellerList, xmlText); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class Errors | ||
{ | ||
public string ShortMessage { get; set; } | ||
public string LongMessage { get; set; } | ||
public int ErrorCode { get; set; } | ||
public string SeverityCode { get; set; } | ||
public string ErrorClassification { get; set; } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
EbaySharp/Entities/TraditionalSelling/Trading/GetSellerListRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class GetSellerListRequest | ||
{ | ||
public List<LegacyItem> ItemArray { get; set; } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
EbaySharp/Entities/TraditionalSelling/Trading/GetSellerListResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using EbaySharp.Entities.Common; | ||
|
||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
//[System.SerializableAttribute()] | ||
//[System.ComponentModel.DesignerCategoryAttribute("code")] | ||
//[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "urn:ebay:apis:eBLBaseComponents")] | ||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "urn:ebay:apis:eBLBaseComponents", IsNullable = false)] | ||
public partial class GetSellerListResponse | ||
{ | ||
[System.Xml.Serialization.XmlArrayItemAttribute("Item", IsNullable = false)] | ||
public List<LegacyItem> ItemArray { get; set; } | ||
public string Ack { get; set; } | ||
public bool HasMoreItems { get; set; } | ||
public int ItemsPerPage { get; set; } | ||
public PaginationResult PaginationResult { get; set; } | ||
public Errors Errors { get; set; } | ||
|
||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
EbaySharp/Entities/TraditionalSelling/Trading/LegacyItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using EbaySharp.Entities.Common; | ||
|
||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class LegacyItem | ||
{ | ||
public string ItemID { get; set; } | ||
public string SKU { get; set; } | ||
public int Quantity { get; set; } | ||
public SellingStatus SellingStatus { get; set; } | ||
public CountryCodeEnum Country { get; set; } | ||
public ListingDetails ListingDetails { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
EbaySharp/Entities/TraditionalSelling/Trading/ListingDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class ListingDetails | ||
{ | ||
public DateTime StartTime { get; set; } | ||
public DateTime EndTime { get; set; } | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
EbaySharp/Entities/TraditionalSelling/Trading/PaginationResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class PaginationResult | ||
{ | ||
public int TotalNumberOfPages { get; set; } | ||
public int TotalNumberOfEntries { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
EbaySharp/Entities/TraditionalSelling/Trading/SellingStatus.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace EbaySharp.Entities.TraditionalSelling.Trading | ||
{ | ||
public class SellingStatus | ||
{ | ||
public int QuantitySold { get; set; } | ||
public double CurrentPrice { get; set; } | ||
public string ListingStatus { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters