Skip to content

Commit

Permalink
Merge branch 'release/1.14.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
angelomelonas committed Aug 5, 2020
2 parents a502315 + 62cb1cb commit 01e8ccf
Show file tree
Hide file tree
Showing 249 changed files with 8,325 additions and 10,075 deletions.
48 changes: 36 additions & 12 deletions .idea/.idea.BunqSdk/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions BunqSdk.Tests/BunqSdk.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
<ItemGroup>
<Folder Include="Resources\NotificationUrlJsons" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\chain.cert" />
<None Remove="Resources\bunq-psd2-test.conf" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion BunqSdk.Tests/BunqSdkTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class BunqSdkTestBase
protected const string PathAttachment = "../../../Resources";
protected const string ContentType = "image/png";
protected const string AttachmentDescription = "C# sdk image test.";
protected const string AttachmentPathIn = "/bunq_App_Icon_Square@4x.png";
protected const string AttachmentPathIn = "/vader.png";

/// <summary>
/// Device registration constants.
Expand Down
4 changes: 2 additions & 2 deletions BunqSdk.Tests/Http/PaginationScenarioTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Bunq.Sdk.Context;
using Bunq.Sdk.Http;
using Bunq.Sdk.Json;
using Bunq.Sdk.Model.Generated.Endpoint;
Expand All @@ -18,6 +17,7 @@ public class PaginationScenarioTest : BunqSdkTestBase
/// Constants for scenario testing.
/// </summary>
private const int PaymentListingPageSize = 2;

private const int PaymentRequiredCountMinimum = PaymentListingPageSize * 2;
private const int NumberZero = 0;

Expand Down Expand Up @@ -81,4 +81,4 @@ private static void CreatePayment()
Payment.Create(new Amount(PaymentAmountEur, PaymentCurrency), GetPointerBravo(), PaymentDescription);
}
}
}
}
Binary file removed BunqSdk.Tests/Resources/[email protected]
Binary file not shown.
23 changes: 0 additions & 23 deletions BunqSdk.Tests/Resources/chain.cert

This file was deleted.

2 changes: 1 addition & 1 deletion BunqSdk.Tests/Resources/config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"AttachmentPublicTest": {
"CONTENT_TYPE": "image/png",
"DESCRIPTION": "TEST PNG PHP",
"PATH_IN": "/bunq_App_Icon_Square@4x.png"
"PATH_IN": "/vader.png"
},
"TabUsageSingleTest": {
"CASH_REGISTER_ID": "XXX"
Expand Down
Binary file added BunqSdk.Tests/Resources/vader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions 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.13.0</VersionPrefix>
<VersionPrefix>1.14.0</VersionPrefix>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Bunq.Sdk</RootNamespace>
Expand All @@ -19,7 +19,7 @@
<RepositoryUrl>https://github.com/bunq/sdk_csharp</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyTitle>bunq SDK</AssemblyTitle>
<Copyright>bunq 2017</Copyright>
<Copyright>bunq 2020</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3-*" />
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.13.0";
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.14.0";
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
11 changes: 5 additions & 6 deletions BunqSdk/Json/BunqContractResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Bunq.Sdk.Model.Generated.Endpoint;
using Bunq.Sdk.Model.Generated.Object;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;

namespace Bunq.Sdk.Json
Expand All @@ -19,7 +18,7 @@ public class BunqContractResolver : DefaultContractResolver
{
protected readonly Dictionary<Type, JsonConverter> converterRegistry = new Dictionary<Type, JsonConverter>();

public BunqContractResolver(IReadOnlyCollection<Type> typesToExclude=null)
public BunqContractResolver(IReadOnlyCollection<Type> typesToExclude = null)
{
RegisterConverter(typeof(ApiEnvironmentType), new ApiEnvironmentTypeConverter());
RegisterConverter(typeof(Geolocation), new GeolocationConverter());
Expand All @@ -36,9 +35,9 @@ public BunqContractResolver(IReadOnlyCollection<Type> typesToExclude=null)

if (typesToExclude == null)
{
return;
return;
}

foreach (var type in typesToExclude)
{
converterRegistry.Remove(type);
Expand Down Expand Up @@ -71,8 +70,8 @@ private JsonConverter GetCustomConverterOrNull(Type objectType)
? converterRegistry[typeof(IAnchorObjectInterface)]
: null;
}

return converterRegistry.ContainsKey(objectType) ? converterRegistry[objectType] : null;
}
}
}
}
11 changes: 5 additions & 6 deletions BunqSdk/Json/BunqMeTabResultInquiryConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Bunq.Sdk.Model.Core;
using Bunq.Sdk.Model.Generated.Endpoint;
Expand All @@ -9,7 +8,7 @@

namespace Bunq.Sdk.Json
{
public class BunqMeTabResultInquiryConverter: JsonConverter
public class BunqMeTabResultInquiryConverter : JsonConverter
{
/// <summary>
/// Field constants.
Expand All @@ -31,16 +30,16 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
JObject jsonObject = JObject.Load(reader);

BunqMeTabResultInquiry tabResultInquiry = JsonConvert.DeserializeObject<BunqMeTabResultInquiry>(
jsonObject.ToString(),
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;
}

Expand All @@ -57,4 +56,4 @@ private JsonSerializerSettings GetSerializerSettingsWithoutTabResultInquiryResol
};
}
}
}
}
4 changes: 2 additions & 2 deletions BunqSdk/Model/Core/OauthAccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class OauthAccessToken : BunqModel
/// <summary>
/// Token constants.
/// </summary>
protected const String TOKEN_URI_FORMAT_SANDBOX = "https://api.oauth.sandbox.bunq.com/v1/token?{0}";
protected const String TOKEN_URI_FORMAT_SANDBOX = "https://api-oauth.sandbox.bunq.com/v1/token?{0}";
protected const String TOKEN_URI_FORMAT_PRODUCTION = "https://api.oauth.bunq.com/v1/token?{0}";

[JsonProperty(PropertyName = "access_token")]
Expand Down Expand Up @@ -125,4 +125,4 @@ private static String DetermineTokenUriFormat()
return TOKEN_URI_FORMAT_MAP[BunqContext.ApiContext.EnvironmentType.TypeString];
}
}
}
}
Loading

0 comments on commit 01e8ccf

Please sign in to comment.