Skip to content

Commit e97bfb5

Browse files
Merge branch 'release/1.12.1'
2 parents 5b21242 + cac985e commit e97bfb5

File tree

6 files changed

+81
-9
lines changed

6 files changed

+81
-9
lines changed

BunqSdk/BunqSdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageId>Bunq.Sdk</PackageId>
99
</PropertyGroup>
1010
<PropertyGroup>
11-
<VersionPrefix>1.12.0</VersionPrefix>
11+
<VersionPrefix>1.12.1</VersionPrefix>
1212
</PropertyGroup>
1313
<PropertyGroup>
1414
<RootNamespace>Bunq.Sdk</RootNamespace>

BunqSdk/Http/ApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class ApiClient
6464
/// Values for the default headers
6565
/// </summary>
6666
private const string CACHE_CONTROL_NONE = "no-cache";
67-
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.12.0";
67+
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.12.1";
6868
private const string LANGUAGE_EN_US = "en_US";
6969
private const string REGION_NL_NL = "nl_NL";
7070
private const string GEOLOCATION_ZERO = "0 0 0 0 NL";

BunqSdk/Json/BunqContractResolver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public BunqContractResolver(IReadOnlyCollection<Type> typesToExclude=null)
3232
RegisterConverter(typeof(float?), new NonIntegerNumberConverter());
3333
RegisterConverter(typeof(Pagination), new PaginationConverter());
3434
RegisterConverter(typeof(IAnchorObjectInterface), new AnchorObjectConverter());
35+
RegisterConverter(typeof(BunqMeTabResultInquiry), new BunqMeTabResultInquiryConverter());
3536

3637
if (typesToExclude == null)
3738
{
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Reflection;
4+
using Bunq.Sdk.Model.Core;
5+
using Bunq.Sdk.Model.Generated.Endpoint;
6+
using Newtonsoft.Json;
7+
using Newtonsoft.Json.Linq;
8+
using Newtonsoft.Json.Serialization;
9+
10+
namespace Bunq.Sdk.Json
11+
{
12+
public class BunqMeTabResultInquiryConverter: JsonConverter
13+
{
14+
/// <summary>
15+
/// Field constants.
16+
/// </summary>
17+
protected const String FIELD_PAYMENT = "payment";
18+
19+
/// <summary>
20+
/// Object type constants.
21+
/// </summary>
22+
protected const String OBJECT_TYPE_PAYMENT = "Payment";
23+
24+
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
25+
{
26+
new JsonSerializer().Serialize(writer, value);
27+
}
28+
29+
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
30+
{
31+
JObject jsonObject = JObject.Load(reader);
32+
33+
BunqMeTabResultInquiry tabResultInquiry = JsonConvert.DeserializeObject<BunqMeTabResultInquiry>(
34+
jsonObject.ToString(),
35+
GetSerializerSettingsWithoutTabResultInquiryResolver()
36+
);
37+
38+
JObject paymentJsonObjectWrapped = (JObject) jsonObject.GetValue(FIELD_PAYMENT);
39+
JObject paymentJsonObject = (JObject) paymentJsonObjectWrapped.GetValue(OBJECT_TYPE_PAYMENT);
40+
41+
Payment paymentObject = Payment.CreateFromJsonString(paymentJsonObject.ToString());
42+
tabResultInquiry.Payment = paymentObject;
43+
44+
return tabResultInquiry;
45+
}
46+
47+
public override bool CanConvert(Type objectType)
48+
{
49+
return typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType);
50+
}
51+
52+
private JsonSerializerSettings GetSerializerSettingsWithoutTabResultInquiryResolver()
53+
{
54+
return new JsonSerializerSettings()
55+
{
56+
ContractResolver = new DefaultContractResolver()
57+
};
58+
}
59+
}
60+
}

CHANGELOG.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
## [Unreleased](https://github.com/bunq/sdk_csharp/tree/HEAD)
44

5-
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.10.16...HEAD)
5+
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.12.0...HEAD)
6+
7+
**Closed issues:**
8+
9+
- BunqMeTab result\_inquiries empty [\#129](https://github.com/bunq/sdk_csharp/issues/129)
10+
11+
**Merged pull requests:**
12+
13+
- Added custom object deserializer for BunqMeTabResultInquiry [\#130](https://github.com/bunq/sdk_csharp/pull/130) ([NickvandeGroes](https://github.com/NickvandeGroes))
14+
15+
## [1.12.0](https://github.com/bunq/sdk_csharp/tree/1.12.0) (2019-09-10)
16+
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.10.16...1.12.0)
617

718
**Closed issues:**
819

@@ -89,7 +100,6 @@
89100
**Merged pull requests:**
90101

91102
- Added travis config. \(bunq/sdk\_csharp\#90\) [\#110](https://github.com/bunq/sdk_csharp/pull/110) ([OGKevin](https://github.com/OGKevin))
92-
- Change Java to Csharp in readme. \(bunq/sdk\_csharp\#97\) [\#98](https://github.com/bunq/sdk_csharp/pull/98) ([robinvanpoppel](https://github.com/robinvanpoppel))
93103
- Oauth bunq/sdk\_csharp\#112 [\#113](https://github.com/bunq/sdk_csharp/pull/113) ([OGKevin](https://github.com/OGKevin))
94104
- Auto reload context bunq/sdk\_csharp\#72 [\#111](https://github.com/bunq/sdk_csharp/pull/111) ([OGKevin](https://github.com/OGKevin))
95105
- Updated the examples on readme. \(bunq/sdk\_csharp\#91\) [\#109](https://github.com/bunq/sdk_csharp/pull/109) ([OGKevin](https://github.com/OGKevin))
@@ -102,6 +112,10 @@
102112
## [0.13.1](https://github.com/bunq/sdk_csharp/tree/0.13.1) (2018-05-30)
103113
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/0.13.0...0.13.1)
104114

115+
**Merged pull requests:**
116+
117+
- Change Java to Csharp in readme. \(bunq/sdk\_csharp\#97\) [\#98](https://github.com/bunq/sdk_csharp/pull/98) ([robinvanpoppel](https://github.com/robinvanpoppel))
118+
105119
## [0.13.0](https://github.com/bunq/sdk_csharp/tree/0.13.0) (2018-03-20)
106120
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/0.12.4...0.13.0)
107121

@@ -117,6 +131,7 @@
117131
- Token request ideal is missing id attribute in response. [\#76](https://github.com/bunq/sdk_csharp/issues/76)
118132
- Field ID is missing from MasterCardAction [\#52](https://github.com/bunq/sdk_csharp/issues/52)
119133
- TokenQrRequestIdeal returns the wrong type [\#51](https://github.com/bunq/sdk_csharp/issues/51)
134+
- Fix SessionServerConverter, bump up to 0.9.2.0-beta \[\#7\] [\#8](https://github.com/bunq/sdk_csharp/pull/8) ([dnl-blkv](https://github.com/dnl-blkv))
120135

121136
**Closed issues:**
122137

@@ -251,10 +266,6 @@
251266

252267
- \#5 Introduce BunqResponse [\#6](https://github.com/bunq/sdk_csharp/pull/6) ([dnl-blkv](https://github.com/dnl-blkv))
253268

254-
**Fixed bugs:**
255-
256-
- Fix SessionServerConverter, bump up to 0.9.2.0-beta \[\#7\] [\#8](https://github.com/bunq/sdk_csharp/pull/8) ([dnl-blkv](https://github.com/dnl-blkv))
257-
258269
## [0.9.1](https://github.com/bunq/sdk_csharp/tree/0.9.1) (2017-08-07)
259270
**Implemented enhancements:**
260271

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# bunq C# SDK
2-
Version 1.12.0
2+
Version 1.12.1
33

44
## Introduction
55
Hi developers!

0 commit comments

Comments
 (0)