From b0e91aeb74009c47702556d33c62e22235bf1e47 Mon Sep 17 00:00:00 2001 From: Saulius Usonis Date: Fri, 2 Sep 2022 12:09:20 +0300 Subject: [PATCH] Release 4.1.2 --- README.md | 8 ++++---- src/Wallee/Client/ApiClient.cs | 16 ++++++++++++++-- src/Wallee/Client/Configuration.cs | 8 ++++---- src/Wallee/Wallee.csproj | 6 +++--- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 580d415..6099204 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ NOTE: RestSharp versions greater than 106.2.1 have a bug which causes file uploa ## Installation ``` # Package Manager -Install-Package Wallee -Version 4.1.1 +Install-Package Wallee -Version 4.1.2 # .NET CLI -dotnet add package Wallee --version 4.1.1 +dotnet add package Wallee --version 4.1.2 # Paket CLI -paket add Wallee --version 4.1.1 +paket add Wallee --version 4.1.2 # PackageReference - + ``` Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: diff --git a/src/Wallee/Client/ApiClient.cs b/src/Wallee/Client/ApiClient.cs index 2d199ab..e08ba60 100644 --- a/src/Wallee/Client/ApiClient.cs +++ b/src/Wallee/Client/ApiClient.cs @@ -90,7 +90,7 @@ public ApiClient(String basePath = "https://app-wallee.com:443/api") // Creates and sets up a RestRequest prior to a call. private RestRequest PrepareRequest( String path, RestSharp.Method method, List> queryParams, Object postBody, - Dictionary headerParams, Dictionary formParams, + Dictionary headerParams, Dictionary defaultHeaderParams, Dictionary formParams, Dictionary fileParams, Dictionary pathParams, String contentType) { @@ -104,6 +104,10 @@ private RestRequest PrepareRequest( foreach(var param in headerParams) request.AddHeader(param.Key, param.Value); + // add default header parameters + foreach(var param in defaultHeaderParams) + request.AddHeader(param.Key, param.Value); + // add authentication headers foreach (var param in AuthenticationHeaders(method, path, queryParams)) request.AddHeader(param.Key, param.Value); @@ -149,8 +153,16 @@ public Object CallApi( Dictionary fileParams, Dictionary pathParams, String contentType) { + + Dictionary defaultHeaderParams = new Dictionary() { + {"x-meta-sdk-version", "4.1.2"}, + {"x-meta-sdk-language", "csharp"}, + {"x-meta-sdk-provider", "wallee"}, + {"x-meta-sdk-language-version", Environment.Version.ToString()} + }; + var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, + path, method, queryParams, postBody, headerParams, defaultHeaderParams, formParams, fileParams, pathParams, contentType); // set user agent diff --git a/src/Wallee/Client/Configuration.cs b/src/Wallee/Client/Configuration.cs index ec48d42..96f0f8b 100644 --- a/src/Wallee/Client/Configuration.cs +++ b/src/Wallee/Client/Configuration.cs @@ -19,7 +19,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "4.1.1"; + public const string Version = "4.1.2"; /// /// Identifier for ISO 8601 DateTime Format @@ -90,7 +90,7 @@ public Configuration(string applicationUserID, string authenticationKey) } _authenticationKey = authenticationKey; _applicationUserID = applicationUserID; - UserAgent = "Wallee/4.1.1/csharp"; + UserAgent = "Wallee/4.1.2/csharp"; BasePath = "https://app-wallee.com:443/api"; DefaultHeader = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -338,8 +338,8 @@ public static String ToDebugReport() String report = "C# SDK (Wallee) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 4.1.1\n"; - report += " SDK Package Version: 4.1.1\n"; + report += " Version of the API: 4.1.2\n"; + report += " SDK Package Version: 4.1.2\n"; return report; } diff --git a/src/Wallee/Wallee.csproj b/src/Wallee/Wallee.csproj index 800a23a..48373a7 100644 --- a/src/Wallee/Wallee.csproj +++ b/src/Wallee/Wallee.csproj @@ -20,12 +20,12 @@ Wallee https://www.apache.org/licenses/LICENSE-2.0.txt https://github.com/wallee-payment/csharp-sdk - 4.1.1 - 4.1.1 + 4.1.2 + 4.1.2 Wallee;payment;sdk;Payment Integration Library customweb - 4.1.1 + 4.1.2 git https://github.com/wallee-payment/csharp-sdk.git Wallee