diff --git a/MailChimp.Net/Core/Requests/OrderRequest.cs b/MailChimp.Net/Core/Requests/OrderRequest.cs new file mode 100644 index 00000000..e86aa439 --- /dev/null +++ b/MailChimp.Net/Core/Requests/OrderRequest.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MailChimp.Net.Core +{ + public class OrderRequest : QueryableBaseRequest + { + [QueryString("customer_id")] + public string CustomerId { get; set; } + } +} diff --git a/MailChimp.Net/Interfaces/IBatchLogic.cs b/MailChimp.Net/Interfaces/IBatchLogic.cs index 9ae7d659..f3cb71fe 100644 --- a/MailChimp.Net/Interfaces/IBatchLogic.cs +++ b/MailChimp.Net/Interfaces/IBatchLogic.cs @@ -23,5 +23,8 @@ public interface IBatchLogic Task GetResponseAsync(QueryableBaseRequest request = null); Task GetBatchStatus(string batchId); + + Task DeleteAsync(string batchId); + } } \ No newline at end of file diff --git a/MailChimp.Net/Interfaces/IEcommerceOrderLogic.cs b/MailChimp.Net/Interfaces/IEcommerceOrderLogic.cs index b72654d0..8fa421a8 100644 --- a/MailChimp.Net/Interfaces/IEcommerceOrderLogic.cs +++ b/MailChimp.Net/Interfaces/IEcommerceOrderLogic.cs @@ -34,7 +34,7 @@ public interface IECommerceOrderLogic /// /// /// - Task> GetAllAsync(QueryableBaseRequest request = null); + Task> GetAllAsync(OrderRequest request = null); /// /// The get async. @@ -59,7 +59,7 @@ public interface IECommerceOrderLogic /// /// The . /// - Task GetResponseAsync(QueryableBaseRequest request = null); + Task GetResponseAsync(OrderRequest request = null); /// /// The update async. diff --git a/MailChimp.Net/Logic/BatchLogic.cs b/MailChimp.Net/Logic/BatchLogic.cs index b08883ca..3d57b142 100644 --- a/MailChimp.Net/Logic/BatchLogic.cs +++ b/MailChimp.Net/Logic/BatchLogic.cs @@ -69,6 +69,16 @@ public async Task GetResponseAsync(QueryableBaseRequest request = } } + public async Task DeleteAsync(string batchId) + { + using (var client = this.CreateMailClient("batches/")) + { + var response = await client.DeleteAsync($"{batchId}").ConfigureAwait(false); + await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); + } + } + + public async Task GetBatchStatus(string batchId) { using (var client = this.CreateMailClient($"batches/{batchId}")) diff --git a/MailChimp.Net/Logic/ECommerceOrderLogic.cs b/MailChimp.Net/Logic/ECommerceOrderLogic.cs index d4bccba2..93416b8f 100644 --- a/MailChimp.Net/Logic/ECommerceOrderLogic.cs +++ b/MailChimp.Net/Logic/ECommerceOrderLogic.cs @@ -82,7 +82,7 @@ public async Task DeleteAsync(string orderId) /// /// /// - public async Task> GetAllAsync(QueryableBaseRequest request = null) + public async Task> GetAllAsync(OrderRequest request = null) { return (await GetResponseAsync(request).ConfigureAwait(false))?.Orders; } @@ -122,7 +122,7 @@ public async Task GetAsync(string orderId, BaseRequest request = null) /// /// The . /// - public async Task GetResponseAsync(QueryableBaseRequest request = null) + public async Task GetResponseAsync(OrderRequest request = null) { var requestUrl = string.Format(BaseUrl, StoreId); using (var client = CreateMailClient(requestUrl)) diff --git a/MailChimp.Net/MailChimp.Net.csproj b/MailChimp.Net/MailChimp.Net.csproj index c58b7642..1127449f 100644 --- a/MailChimp.Net/MailChimp.Net.csproj +++ b/MailChimp.Net/MailChimp.Net.csproj @@ -75,6 +75,7 @@ + diff --git a/MailChimp.Net/Models/Order.cs b/MailChimp.Net/Models/Order.cs index 6e5f044b..9846f92c 100644 --- a/MailChimp.Net/Models/Order.cs +++ b/MailChimp.Net/Models/Order.cs @@ -37,12 +37,25 @@ public Order() [JsonProperty("tax_total")] public double TaxTotal { get; set; } + [JsonProperty("shipping_total")] + public double ShippingTotal { get; set; } + + [JsonProperty("tracking_code")] + public string TrackingCode { get; set; } + [JsonProperty("processed_at_foreign")] public string ProcessedAtForeign { get; set; } [JsonProperty("cancelled_at_foreign")] public string CancelledAtForeign { get; set; } + [JsonProperty("shipping_address")] + public Address ShippingAddress { get; set; } + + [JsonProperty("billing_address")] + public Address BillingAddress { get; set; } + + [JsonProperty("updated_at_foreign")] public string UpdatedAtForeign { get; set; } diff --git a/MailChimp.Net/Properties/AssemblyInfo.cs b/MailChimp.Net/Properties/AssemblyInfo.cs index be36acba..8243bc4f 100644 --- a/MailChimp.Net/Properties/AssemblyInfo.cs +++ b/MailChimp.Net/Properties/AssemblyInfo.cs @@ -37,5 +37,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.5.2")] +[assembly: AssemblyVersion("1.5.3")] [assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file