Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

using NewtonsoftJsonSerializer, to fix failing test (decimal -> "40" …

…instead or "40.0")
  • Loading branch information...
commit 128f1164a63acfb17250a9553d65724f1d8f0cd8 1 parent e47b5bf
@timiles timiles authored
View
3  GoCardlessSdk.Net2/GoCardlessSdk.Net2.csproj
@@ -88,6 +88,9 @@
<Compile Include="..\GoCardlessSdk\GoCardless.cs">
<Link>GoCardless.cs</Link>
</Compile>
+ <Compile Include="..\GoCardlessSdk\Helpers\NewtonsoftJsonSerializer.cs">
+ <Link>Helpers\NewtonsoftJsonSerializer.cs</Link>
+ </Compile>
<Compile Include="..\GoCardlessSdk\Helpers\UnderscoreToCamelCasePropertyResolver.cs">
<Link>Helpers\UnderscoreToCamelCasePropertyResolver.cs</Link>
</Compile>
View
15 GoCardlessSdk/Api/ApiClient.cs
@@ -5,8 +5,9 @@
using System.Net.Mime;
using GoCardlessSdk.Helpers;
using Newtonsoft.Json.Linq;
-using RestSharp;
-
+using RestSharp;
+using RestSharp.Serializers;
+
namespace GoCardlessSdk.Api
{
public class ApiClient
@@ -84,9 +85,13 @@ public PreAuthorizationResponse CancelPreAuthorization(string id)
}
- private static RestRequest GetRestRequest(string resource, Method method, object options = null)
- {
- var request = new RestRequest(resource, method) {RequestFormat = DataFormat.Json};
+ private static RestRequest GetRestRequest(string resource, Method method, object options = null)
+ {
+ var request = new RestRequest(resource, method)
+ {
+ RequestFormat = DataFormat.Json,
+ JsonSerializer = new NewtonsoftJsonSerializer()
+ };
if (options != null)
{
foreach (var arg in ToHash(options).Where(arg => arg.Value != null))
View
3  GoCardlessSdk/GoCardlessSdk.csproj
@@ -52,6 +52,9 @@
<Compile Include="Api\ApiClient.cs" />
<Compile Include="Api\BillResponse.cs" />
<Compile Include="Helpers\NewtonsoftJsonDeserializer.cs" />
+ <Compile Include="Helpers\NewtonsoftJsonSerializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="Helpers\UnderscoreToCamelCasePropertyResolver.cs" />
<Compile Include="Api\MerchantResponse.cs" />
<Compile Include="Api\PreAuthorizationResponse.cs" />

0 comments on commit 128f116

Please sign in to comment.
Something went wrong with that request. Please try again.