Skip to content

Commit

Permalink
Merge branch 'release/1.12.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvandegroes committed Sep 16, 2019
2 parents 5b21242 + cac985e commit e97bfb5
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BunqSdk/BunqSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageId>Bunq.Sdk</PackageId>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.12.0</VersionPrefix>
<VersionPrefix>1.12.1</VersionPrefix>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Bunq.Sdk</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Http/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class ApiClient
/// Values for the default headers
/// </summary>
private const string CACHE_CONTROL_NONE = "no-cache";
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.12.0";
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.12.1";
private const string LANGUAGE_EN_US = "en_US";
private const string REGION_NL_NL = "nl_NL";
private const string GEOLOCATION_ZERO = "0 0 0 0 NL";
Expand Down
1 change: 1 addition & 0 deletions BunqSdk/Json/BunqContractResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public BunqContractResolver(IReadOnlyCollection<Type> typesToExclude=null)
RegisterConverter(typeof(float?), new NonIntegerNumberConverter());
RegisterConverter(typeof(Pagination), new PaginationConverter());
RegisterConverter(typeof(IAnchorObjectInterface), new AnchorObjectConverter());
RegisterConverter(typeof(BunqMeTabResultInquiry), new BunqMeTabResultInquiryConverter());

if (typesToExclude == null)
{
Expand Down
60 changes: 60 additions & 0 deletions BunqSdk/Json/BunqMeTabResultInquiryConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Bunq.Sdk.Model.Core;
using Bunq.Sdk.Model.Generated.Endpoint;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;

namespace Bunq.Sdk.Json
{
public class BunqMeTabResultInquiryConverter: JsonConverter
{
/// <summary>
/// Field constants.
/// </summary>
protected const String FIELD_PAYMENT = "payment";

/// <summary>
/// Object type constants.
/// </summary>
protected const String OBJECT_TYPE_PAYMENT = "Payment";

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
new JsonSerializer().Serialize(writer, value);
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jsonObject = JObject.Load(reader);

BunqMeTabResultInquiry tabResultInquiry = JsonConvert.DeserializeObject<BunqMeTabResultInquiry>(
jsonObject.ToString(),
GetSerializerSettingsWithoutTabResultInquiryResolver()
);

JObject paymentJsonObjectWrapped = (JObject) jsonObject.GetValue(FIELD_PAYMENT);
JObject paymentJsonObject = (JObject) paymentJsonObjectWrapped.GetValue(OBJECT_TYPE_PAYMENT);

Payment paymentObject = Payment.CreateFromJsonString(paymentJsonObject.ToString());
tabResultInquiry.Payment = paymentObject;

return tabResultInquiry;
}

public override bool CanConvert(Type objectType)
{
return typeof(IAnchorObjectInterface).GetTypeInfo().IsAssignableFrom(objectType);
}

private JsonSerializerSettings GetSerializerSettingsWithoutTabResultInquiryResolver()
{
return new JsonSerializerSettings()
{
ContractResolver = new DefaultContractResolver()
};
}
}
}
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

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

[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.10.16...HEAD)
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.12.0...HEAD)

**Closed issues:**

- BunqMeTab result\_inquiries empty [\#129](https://github.com/bunq/sdk_csharp/issues/129)

**Merged pull requests:**

- Added custom object deserializer for BunqMeTabResultInquiry [\#130](https://github.com/bunq/sdk_csharp/pull/130) ([NickvandeGroes](https://github.com/NickvandeGroes))

## [1.12.0](https://github.com/bunq/sdk_csharp/tree/1.12.0) (2019-09-10)
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/1.10.16...1.12.0)

**Closed issues:**

Expand Down Expand Up @@ -89,7 +100,6 @@
**Merged pull requests:**

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

**Merged pull requests:**

- Change Java to Csharp in readme. \(bunq/sdk\_csharp\#97\) [\#98](https://github.com/bunq/sdk_csharp/pull/98) ([robinvanpoppel](https://github.com/robinvanpoppel))

## [0.13.0](https://github.com/bunq/sdk_csharp/tree/0.13.0) (2018-03-20)
[Full Changelog](https://github.com/bunq/sdk_csharp/compare/0.12.4...0.13.0)

Expand All @@ -117,6 +131,7 @@
- Token request ideal is missing id attribute in response. [\#76](https://github.com/bunq/sdk_csharp/issues/76)
- Field ID is missing from MasterCardAction [\#52](https://github.com/bunq/sdk_csharp/issues/52)
- TokenQrRequestIdeal returns the wrong type [\#51](https://github.com/bunq/sdk_csharp/issues/51)
- 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))

**Closed issues:**

Expand Down Expand Up @@ -251,10 +266,6 @@

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

**Fixed bugs:**

- 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))

## [0.9.1](https://github.com/bunq/sdk_csharp/tree/0.9.1) (2017-08-07)
**Implemented enhancements:**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# bunq C# SDK
Version 1.12.0
Version 1.12.1

## Introduction
Hi developers!
Expand Down

0 comments on commit e97bfb5

Please sign in to comment.