diff --git a/README.md b/README.md index a8b01df..af9607d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ XeroApi .Net Library ==================== -![Project status](http://stillmaintained.com/XeroAPI/XeroAPI.Net.png) - +Unsupported - no longer under active development +------------ +This library is unsupported. Please see [https://github.com/XeroAPI/Xero-Net](https://github.com/XeroAPI/Xero-Net) for the updated and supported .Net library. Introduction ------------ diff --git a/source/XeroAPI.Net.nuspec b/source/XeroAPI.Net.nuspec index 41ef3c5..b75a0b4 100644 --- a/source/XeroAPI.Net.nuspec +++ b/source/XeroAPI.Net.nuspec @@ -1,16 +1,16 @@ - + XeroAPI.Net - 0.0.0.0 + 1.1.0.34 .Net wrapper library for Xero API XeroAPI https://github.com/XeroAPI/XeroAPI.Net https://secure.gravatar.com/avatar/7fff030fb8040a5157c3fd463858167f.png?s=128 false - .Net wrapper library for Xero API. This library allows you to perform GET/PUT/POST methods against the Xero API without needing to know the internals of xml serialisation, oauth signatures or character encodings. See http://developer.xero.com for more information. - .Net wrapper library for Xero API + Obsolete Xero SDK. See https://github.com/XeroAPI/Xero-NetStandard for the new dotnet standard SDK + Obsolete Xero SDK. See https://github.com/XeroAPI/Xero-NetStandard for the new dotnet standard SDK diff --git a/source/XeroApi.Tests/PauseTimeTests.cs b/source/XeroApi.Tests/PauseTimeTests.cs index 4089d45..4971049 100644 --- a/source/XeroApi.Tests/PauseTimeTests.cs +++ b/source/XeroApi.Tests/PauseTimeTests.cs @@ -18,7 +18,8 @@ public void it_can_pause_time() stopwatch.Stop(); - Assert.AreEqual(1000, stopwatch.ElapsedMilliseconds, 10, "Actual elapsed timespan is not within 50ms of the expected timespan"); + // Time delta was 10ms and exception said 50ms. Fixing delta. + Assert.AreEqual(1000, stopwatch.ElapsedMilliseconds, 50, "Actual elapsed timespan is not within 50ms of the expected timespan"); } } diff --git a/source/XeroApi/Model/BatchPayments.cs b/source/XeroApi/Model/BatchPayments.cs index f0f7bca..94a5f3b 100644 --- a/source/XeroApi/Model/BatchPayments.cs +++ b/source/XeroApi/Model/BatchPayments.cs @@ -10,6 +10,8 @@ public class BatchPayments public string BankAccountNumber { get; set; } public string BankAccountName { get; set; } public string Details { get; set; } + public string Code { get; set; } + public string Reference { get; set; } public override string ToString() { @@ -20,7 +22,11 @@ public override string ToString() sb.AppendFormat("Bank Account Name: {0} ", BankAccountName); sb.AppendFormat("Details: {0}", Details); - + + sb.AppendFormat("Code: {0}", Code); + + sb.AppendFormat("Reference: {0}", Reference); + return sb.ToString(); } } diff --git a/source/XeroApi/Model/Contact.cs b/source/XeroApi/Model/Contact.cs index c387b70..8f70750 100644 --- a/source/XeroApi/Model/Contact.cs +++ b/source/XeroApi/Model/Contact.cs @@ -24,6 +24,8 @@ public class Contact : EndpointModelBase public string EmailAddress { get; set; } public string SkypeUserName { get; set; } + + public ContactPersons ContactPersons { get; set; } public string BankAccountDetails { get; set; } diff --git a/source/XeroApi/Model/ContactPerson.cs b/source/XeroApi/Model/ContactPerson.cs new file mode 100644 index 0000000..1d919ce --- /dev/null +++ b/source/XeroApi/Model/ContactPerson.cs @@ -0,0 +1,36 @@ +using System; +using System.Text; + +namespace XeroApi.Model +{ + public class ContactPerson : ModelBase + { + public string FirstName { get; set; } + + public string LastName { get; set; } + + public string EmailAddress { get; set; } + + public bool IncludeInEmails { get; set; } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + if (!string.IsNullOrEmpty(FirstName)) + sb.Append(FirstName + Environment.NewLine); + + if (!string.IsNullOrEmpty(LastName)) + sb.Append(LastName + Environment.NewLine); + + if (!string.IsNullOrEmpty(EmailAddress)) + sb.Append(EmailAddress + Environment.NewLine); + + return sb.ToString().TrimEnd(' '); + } + } + + public class ContactPersons : ModelList + { + } +} diff --git a/source/XeroApi/Model/Invoice.cs b/source/XeroApi/Model/Invoice.cs index 5432dc7..d8aa09f 100644 --- a/source/XeroApi/Model/Invoice.cs +++ b/source/XeroApi/Model/Invoice.cs @@ -72,6 +72,10 @@ public class Invoice : EndpointModelBase, IAttachmentParent [ReadOnly] public DateTime? FullyPaidOnDate { get; set; } + public DateTime? ExpectedPaymentDate { get; set; } + + public DateTime? PlannedPaymentDate { get; set; } + public override string ToString() { return string.Format("Invoice:{0} Id:{1}", InvoiceNumber, InvoiceID); diff --git a/source/XeroApi/Model/LineItem.cs b/source/XeroApi/Model/LineItem.cs index 6ad8478..e90b453 100644 --- a/source/XeroApi/Model/LineItem.cs +++ b/source/XeroApi/Model/LineItem.cs @@ -22,6 +22,8 @@ public class LineItem : ModelBase public decimal? Quantity { get; set; } + public decimal? DiscountRate { get; set; } + public override string ToString() { return string.Format("LineItem:{0}", Description ?? ItemCode); diff --git a/source/XeroApi/OAuth/Consumer/ConsumerResponse.cs b/source/XeroApi/OAuth/Consumer/ConsumerResponse.cs index 58e13c7..801e5ee 100644 --- a/source/XeroApi/OAuth/Consumer/ConsumerResponse.cs +++ b/source/XeroApi/OAuth/Consumer/ConsumerResponse.cs @@ -57,7 +57,7 @@ public class ConsumerResponse : IConsumerResponse if (webResponse.Headers["Content-Type"] != string.Empty) ContentType = webResponse.Headers["Content-Type"]; - if (webResponse.Headers["Content-Length"] != string.Empty) + if (!string.IsNullOrEmpty(webResponse.Headers["Content-Length"])) ContentLength = int.Parse(webResponse.Headers["Content-Length"]); TimeTaken = timeTaken; diff --git a/source/XeroApi/OAuth/Framework/DateTimeUtility.cs b/source/XeroApi/OAuth/Framework/DateTimeUtility.cs index 6922d5c..1d6a876 100644 Binary files a/source/XeroApi/OAuth/Framework/DateTimeUtility.cs and b/source/XeroApi/OAuth/Framework/DateTimeUtility.cs differ diff --git a/source/XeroApi/OAuth/Framework/NonceGenerator.cs b/source/XeroApi/OAuth/Framework/NonceGenerator.cs index 0acec50..6327fa3 100644 Binary files a/source/XeroApi/OAuth/Framework/NonceGenerator.cs and b/source/XeroApi/OAuth/Framework/NonceGenerator.cs differ diff --git a/source/XeroApi/Properties/AssemblyInfo.cs b/source/XeroApi/Properties/AssemblyInfo.cs index 22ec967..e3d6b27 100644 --- a/source/XeroApi/Properties/AssemblyInfo.cs +++ b/source/XeroApi/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Xero")] [assembly: AssemblyProduct("XeroApi")] -[assembly: AssemblyCopyright("Copyright © Xero 2011")] +[assembly: AssemblyCopyright("Copyright © Xero 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,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.1.0.33")] -[assembly: AssemblyFileVersion("1.1.0.33")] +[assembly: AssemblyVersion("1.1.0.34")] +[assembly: AssemblyFileVersion("1.1.0.34")] diff --git a/source/XeroApi/XeroApi.csproj b/source/XeroApi/XeroApi.csproj index c5fbbcd..c92783e 100644 --- a/source/XeroApi/XeroApi.csproj +++ b/source/XeroApi/XeroApi.csproj @@ -70,6 +70,7 @@ +