diff --git a/GoCardless.Tests/FunctionalityTests.cs b/GoCardless.Tests/FunctionalityTests.cs index 7ca26ab..302280a 100644 --- a/GoCardless.Tests/FunctionalityTests.cs +++ b/GoCardless.Tests/FunctionalityTests.cs @@ -172,6 +172,14 @@ public async Task RequestRetriesWithCustomValues(int numberOfFailures, bool shou } - + [Test] + public async Task BooleansAreDowncasedInQueryString() + { + var responseFixture = "fixtures/mock_response.json"; + http.EnqueueResponse(200, responseFixture); + var listRequest = new CustomerBankAccountListRequest(){ Enabled = true }; + var listResponse = await client.CustomerBankAccounts.ListAsync(listRequest); + http.AssertRequestMade("GET", "/customer_bank_accounts?enabled=true"); + } } } diff --git a/GoCardless.Tests/GoCardless.Tests.csproj b/GoCardless.Tests/GoCardless.Tests.csproj index ac96de5..242c228 100644 --- a/GoCardless.Tests/GoCardless.Tests.csproj +++ b/GoCardless.Tests/GoCardless.Tests.csproj @@ -92,6 +92,9 @@ PreserveNewest + + PreserveNewest + \ No newline at end of file diff --git a/GoCardless.Tests/fixtures/mock_response.json b/GoCardless.Tests/fixtures/mock_response.json new file mode 100644 index 0000000..e97696e --- /dev/null +++ b/GoCardless.Tests/fixtures/mock_response.json @@ -0,0 +1,9 @@ +{ + "foo": { + "direct": "debit", + "amount": 1, + "dotnet": true, + "request_id": "abc-123", + "code": 200 + } +} diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index 1b13295..564c47e 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 2.0.5 + 2.0.6 GoCardless Ltd Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments false @@ -11,7 +11,7 @@ GoCardless Ltd gocardless payments rest api direct debit https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt - https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.0.5 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.0.6 netcoreapp1.1;net452 True diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index c33054b..21bf3f2 100644 --- a/GoCardless/GoCardlessClient.cs +++ b/GoCardless/GoCardlessClient.cs @@ -213,9 +213,9 @@ private HttpRequestMessage BuildHttpRequestMessage(string method, string path var httpMethod = new HttpMethod(method); var requestMessage = new HttpRequestMessage(httpMethod, new Uri(_baseUrl, path)); - requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/2.0.5"); + requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/2.0.6"); requestMessage.Headers.Add("GoCardless-Version", "2015-07-06"); - requestMessage.Headers.Add("GoCardless-Client-Version", "2.0.5"); + requestMessage.Headers.Add("GoCardless-Client-Version", "2.0.6"); requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet"); requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken); @@ -266,6 +266,8 @@ class Helpers { internal static string Stringify(object value) { + if (value is bool) + return value.ToString().ToLower(); if (value is DateTimeOffset) return ((DateTimeOffset?) value).Value.ToString("o"); var typeInfo = value.GetType().GetTypeInfo(); diff --git a/README.md b/README.md index 1be6427..623f4b9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ For full details of the GoCardless API, see the [API docs](https://developer.goc To install `GoCardless`, run the following command in the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console) -`Install-Package GoCardless -Version 2.0.5` +`Install-Package GoCardless -Version 2.0.6` ## Usage