Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit 02f226b

Browse files
authored
Merge branch 'master' into bugfix-batchpayments
2 parents 093c573 + ac9ceba commit 02f226b

10 files changed

Lines changed: 53 additions & 8 deletions

File tree

CoreTests/Integration/Contacts/Find.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ public void find_by_id()
2828
Assert.AreEqual(expected, id);
2929
}
3030

31+
[Test]
32+
public void find_by_id_list()
33+
{
34+
var created = Given_a_contact();
35+
var contacts = Api.Contacts.Ids(new[] { created.Id }).Find().ToList();
36+
37+
Assert.AreEqual(1, contacts.Count());
38+
Assert.AreEqual(created.Id, contacts.First().Id);
39+
}
40+
3141
[Test]
3242
public void find_by_value()
3343
{

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
Xero-Net
22
========
3+
4+
## Looking for OAuth 2.0?
5+
Please checkout [Xero-NetStandard SDK for OAuth 2.0](https://github.com/XeroAPI/Xero-NetStandard) and it's companion [sample app](https://github.com/XeroAPI/xero-netstandard-oauth2-samples)
6+
7+
## What about updating Xero-Net to OAuth 2.0?
8+
We are devoting resources towards building and improving our new OAuth 2.0 SDKs which don't share a code base with this library. For those using Xero-Net, you have the option of forking the Xero-Net.
9+
10+
Xero-Net maintenance for OAuth 1.0a
11+
-----------------------
12+
We will continue to periodically review pull requests to fix small issues and watch for secruity issues until December 2020. Maintenance **does not** include adding new features, oauth 2 support or large refactoring of the code base.
13+
314
[![xero-api-sdk MyGet Build Status](https://www.myget.org/BuildSource/Badge/xero-api-sdk?identifier=045754d8-de3f-4f0c-960a-ae6e16608e24)](https://www.myget.org/)
415
[![Build status](https://ci.appveyor.com/api/projects/status/087ia0i385l506bn/branch/master?svg=true)](https://ci.appveyor.com/project/XeroAPI/xero-net/branch/master)
516

Xero.Api/Common/XeroReadEndpoint.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ private IEnumerable<TResult> Get(string endpoint, string child)
172172
Client.ModifiedSince = _modifiedSince;
173173
Client.Parameters = Parameters;
174174

175-
return Client.Get<TResult, TResponse>(endpoint + (child ?? string.Empty));
175+
var result = Client.Get<TResult, TResponse>(endpoint + (child ?? string.Empty));
176+
return result;
176177
}
177178
finally
178179
{

Xero.Api/Core/Endpoints/ContactsEndpoint.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using Xero.Api.Common;
45
using Xero.Api.Core.Endpoints.Base;
@@ -15,6 +16,7 @@ public interface IContactsEndpoint
1516
{
1617
IContactsEndpoint IncludeArchived(bool include);
1718
ContactCisSetting GetCisSettings(Guid id);
19+
IContactsEndpoint Ids(IEnumerable<Guid> ids);
1820
}
1921

2022
public class ContactsEndpoint
@@ -52,6 +54,13 @@ public override void ClearQueryString()
5254
{
5355
base.ClearQueryString();
5456
Page(1);
57+
}
58+
59+
public IContactsEndpoint Ids(IEnumerable<Guid> ids)
60+
{
61+
AddParameter("ids", string.Join(",", ids));
62+
63+
return this;
5564
}
5665
}
5766
}

Xero.Api/Core/Model/Organisation.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class Organisation
5454
[DataMember(EmitDefaultValue = false)]
5555
public int? FinancialYearEndMonth { get; set; }
5656

57+
[DataMember(EmitDefaultValue = false)]
58+
public string EmployerIdentificationNumber { get; set; }
59+
5760
[DataMember(EmitDefaultValue = false)]
5861
public DateTime? PeriodLockDate { get; set; }
5962

@@ -75,12 +78,18 @@ public class Organisation
7578
[DataMember(EmitDefaultValue = false)]
7679
public PaymentTerms PaymentTerms { get; set; }
7780

78-
[DataMember(EmitDefaultValue = false)]
81+
[DataMember(Name = "SalesTaxBasis", EmitDefaultValue = false)]
7982
public SalesTaxBasisType SalesTaxBasisType { get; set; }
8083

8184
[DataMember(EmitDefaultValue = false)]
8285
public SalesTaxPeriodType SalesTaxPeriod { get; set; }
8386

87+
[DataMember(EmitDefaultValue = false)]
88+
public string DefaultSalesTax { get; set; }
89+
90+
[DataMember(EmitDefaultValue = false)]
91+
public string DefaultPurchasesTax { get; set; }
92+
8493
[DataMember(EmitDefaultValue = false)]
8594
public List<Address> Addresses { get; set; }
8695

Xero.Api/Core/Model/Types/SalesTaxBasisType.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ public enum SalesTaxBasisType
77
{
88
[EnumMember(Value = "NONE")]
99
None,
10+
[EnumMember(Value = "ACCRUALS")]
11+
Accurals=1,
1012
[EnumMember(Value = "ACCRUAL")]
11-
Accural,
13+
Accural = 1,
1214
[EnumMember(Value = "CASH")]
1315
Cash,
1416
[EnumMember(Value = "INVOICE")]

Xero.Api/Infrastructure/Http/Response.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ internal Response(HttpWebResponse inner)
1515
StatusCode = inner.StatusCode;
1616
ContentLength = (int) inner.ContentLength;
1717
ContentType = inner.ContentType;
18-
19-
var stream = inner.GetResponseStream();
18+
HttpWebRequest.DefaultMaximumErrorResponseLength = ContentLength;
19+
var stream = inner.GetResponseStream();
2020
if (stream != null)
2121
{
2222
Stream = new MemoryStream();

Xero.Api/Infrastructure/RateLimiter/RateLimiter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public RateLimiter() : this(TimeSpan.FromMinutes(1), 60) { }
3131
/// </summary>
3232
public void WaitUntilLimit()
3333
{
34-
while (rateLimiter.Count >= _qty)
34+
if (rateLimiter.Count == _qty)
3535
{
3636
var diff = rateLimiter.Peek().Add(_duration) - DateTime.UtcNow;
3737
if (diff.TotalMilliseconds > 0)
@@ -47,7 +47,7 @@ public void WaitUntilLimit()
4747
/// <returns>True if we're over the limit, false if we've got some allocation left</returns>
4848
public bool CheckLimit()
4949
{
50-
return (rateLimiter.Count >= _qty && rateLimiter.Peek().Add(_duration) > DateTime.UtcNow);
50+
return (rateLimiter.Count == _qty && rateLimiter.Peek().Add(_duration) > DateTime.UtcNow);
5151
}
5252
}
5353
}

Xero.Api/Payroll/Australia/Model/Employee.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class Employee : HasUpdatedDate
2929

3030
[DataMember(EmitDefaultValue = false)]
3131
public string Gender { get; set; }
32+
33+
[DataMember(EmitDefaultValue = false)]
34+
public string JobTitle { get; set; }
3235

3336
[DataMember(EmitDefaultValue = false)]
3437
public HomeAddress HomeAddress { get; set; }

Xero.Api/Xero.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<Reference Include="System.Data.Linq" />
4343
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
4444
<Reference Include="System.Runtime.Serialization" />
45-
<Reference Include="System.XML" />
45+
<Reference Include="System.Xml" />
4646
</ItemGroup>
4747
<ItemGroup>
4848
<Compile Include="Common\IHasAttachment.cs" />

0 commit comments

Comments
 (0)