Skip to content

Commit

Permalink
Crankshaft[BU000004AR920C] .NET client @ 2017-09-01 14:24:20 UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
Crankshaft Robot committed Sep 1, 2017
1 parent ef68f17 commit bcaf269
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
10 changes: 9 additions & 1 deletion GoCardless.Tests/FunctionalityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
3 changes: 3 additions & 0 deletions GoCardless.Tests/GoCardless.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
<None Update="fixtures\unused\validation_failed.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="fixtures\mock_response.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions GoCardless.Tests/fixtures/mock_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"foo": {
"direct": "debit",
"amount": 1,
"dotnet": true,
"request_id": "abc-123",
"code": 200
}
}
4 changes: 2 additions & 2 deletions GoCardless/GoCardless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>GoCardless</PackageId>
<PackageVersion>2.0.5</PackageVersion>
<PackageVersion>2.0.6</PackageVersion>
<Authors>GoCardless Ltd</Authors>
<Description>Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -11,7 +11,7 @@
<Copyright>GoCardless Ltd</Copyright>
<PackageTags>gocardless payments rest api direct debit</PackageTags>
<PackageLicenseUrl>https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt</PackageLicenseUrl>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.0.5</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.0.6</PackageReleaseNotes>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>
Expand Down
6 changes: 4 additions & 2 deletions GoCardless/GoCardlessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ private HttpRequestMessage BuildHttpRequestMessage<T>(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);
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bcaf269

Please sign in to comment.