Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes deprecated dotnet core #128

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/dotnet_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ jobs:
run: dotnet build -c Release Iyzipay
- name: NET45 Tests
run: dotnet test -c Release Iyzipay.Tests -f net45
- name: NETCORE2 Tests
run: dotnet test -c Release Iyzipay.Tests -f netcoreapp2.0
#- name: NETCORE1 Tests
#run: dotnet test -c Release Iyzipay.Tests -f netcoreapp1.1
20 changes: 1 addition & 19 deletions Iyzipay.Samples/Iyzipay.Samples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.0;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net45</TargetFrameworks>
<Authors />
<Company />
</PropertyGroup>
Expand All @@ -28,25 +28,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Iyzipay\Iyzipay.csproj" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<DefineConstants>$(DefineConstants);NETCORE2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<DefineConstants>$(DefineConstants);NETCORE1</DefineConstants>
</PropertyGroup>
</Project>
5 changes: 0 additions & 5 deletions Iyzipay.Samples/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ public void Initialize()

protected void PrintResponse<T>(T resource)
{
#if NETCORE1 || NETCORE2
TraceListener consoleListener = new TextWriterTraceListener(System.Console.Out);
#else
TraceListener consoleListener = new ConsoleTraceListener();
#endif

Trace.Listeners.Add(consoleListener);
Trace.WriteLine(JsonConvert.SerializeObject(resource, new JsonSerializerSettings()
{
Expand Down
9 changes: 0 additions & 9 deletions Iyzipay.Tests/Functional/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ public void Initialize()

protected void PrintResponse<T>(T resource)
{
#if RELEASE
return;
#endif

#if NETCORE1 || NETCORE2
TraceListener consoleListener = new TextWriterTraceListener(System.Console.Out);
#else
TraceListener consoleListener = new ConsoleTraceListener();
#endif

Trace.Listeners.Add(consoleListener);
Trace.WriteLine(JsonConvert.SerializeObject(resource, new JsonSerializerSettings()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public static CreatePaymentRequestBuilder Create()
return new CreatePaymentRequestBuilder();
}

public new CreatePaymentRequestBuilder Locale(string locale)
public CreatePaymentRequestBuilder Locale(string locale)
{
base._locale = locale;
return this;
}

public new CreatePaymentRequestBuilder ConversationId(string conversationId)
public CreatePaymentRequestBuilder ConversationId(string conversationId)
{
base._conversationId = conversationId;
return this;
Expand Down
19 changes: 1 addition & 18 deletions Iyzipay.Tests/Iyzipay.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.0;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net45</TargetFrameworks>
<!-- When compiling .NET SDK 2.0 projects targeting .NET 4.x on Mono using 'dotnet build' you -->
<!-- have to teach MSBuild where the Mono copy of the reference asssemblies is -->
<TargetIsMono Condition="$(TargetFramework.StartsWith('net4')) and '$(OS)' == 'Unix'">true</TargetIsMono>
Expand Down Expand Up @@ -37,25 +37,8 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Iyzipay\Iyzipay.csproj" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<DefineConstants>$(DefineConstants);NETCORE2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<DefineConstants>$(DefineConstants);NETCORE1</DefineConstants>
</PropertyGroup>
</Project>
4 changes: 0 additions & 4 deletions Iyzipay/HashGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ private HashGenerator()

public static String GenerateHash(String apiKey, String secretKey, String randomString, BaseRequest request)
{
#if NETSTANDARD
SHA1 algorithm = SHA1.Create();
#else
HashAlgorithm algorithm = new SHA1Managed();
#endif
string hashStr = apiKey + randomString + secretKey + request.ToPKIRequestString();
byte[] computeHash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(hashStr));
return Convert.ToBase64String(computeHash);
Expand Down
3 changes: 0 additions & 3 deletions Iyzipay/HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ public class HttpClient : System.Net.Http.HttpClient
{

public HttpClient()
#if NETSTANDARD
: base(new HttpClientHandler(){ SslProtocols = SslProtocols.Tls12 } )
#endif
{
}
}
Expand Down
16 changes: 2 additions & 14 deletions Iyzipay/Iyzipay.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.1</TargetFrameworks>
<AssemblyName>Iyzipay</AssemblyName>
<RootNamespace>Iyzipay</RootNamespace>
<Version>2.1.49</Version>
Expand Down Expand Up @@ -29,20 +29,8 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);NETSTANDARD2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
</Project>
3 changes: 0 additions & 3 deletions Iyzipay/RestHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ public class RestHttpClient
private static readonly HttpClient HttpClient;
static RestHttpClient()
{
#if !NETSTANDARD
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#endif

HttpClient = new HttpClient();
}

Expand Down
3 changes: 0 additions & 3 deletions Iyzipay/RestHttpClientV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ class RestHttpClientV2
private static readonly HttpClient HttpClient;
static RestHttpClientV2()
{
#if !NETSTANDARD
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
#endif

HttpClient = new HttpClient();
}

Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ You can sign up for an iyzico account at https://iyzico.com
# Requirements
One of the runtime environment is required from below
* .NET Framework 4.5
* .NET Core 1.1
* .NET Core 2.0

# Installation

Expand All @@ -22,13 +20,9 @@ Install-Package Iyzipay
Or you can download the latest .dll from: https://github.com/iyzico/iyzipay-dotnet/releases/latest

For .NET Framework:
* Newtonsoft.Json 8.0.2 from http://www.newtonsoft.com/json#
* Newtonsoft.Json 13.0.2 from http://www.newtonsoft.com/json#

For .NET Standard 1.3:
* Newtonsoft.Json 11.0.2 from http://www.newtonsoft.com/json#
* System.Security.Cryptography.Algorithms 4.3.0

For .NET Standard 2.0:
For .NET Standard 2.1:
* Newtonsoft.Json 11.0.2 from http://www.newtonsoft.com/json#


Expand Down
12 changes: 0 additions & 12 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@ echo --------------------

dotnet test -c Release ./Iyzipay.Tests -f net45

echo --------------------
echo Running NETCORE2 Tests
echo --------------------

dotnet test -c Release ./Iyzipay.Tests -f netcoreapp2.0

echo --------------------
echo Running NETCORE1 Tests
echo --------------------

dotnet test -c Release ./Iyzipay.Tests -f netcoreapp1.1

dotnet pack -c Release ./Iyzipay
14 changes: 1 addition & 13 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,4 @@ echo --------------------
echo Running NET45 Tests
echo --------------------

mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./Iyzipay.Tests/bin/Release/net45/Iyzipay.Tests.dll

echo --------------------
echo Running NETCORE2 Tests
echo --------------------

dotnet test ./Iyzipay.Tests -c Release -f netcoreapp2.0

echo --------------------
echo Running NETCORE1 Tests
echo --------------------

dotnet test ./Iyzipay.Tests -c Release -f netcoreapp1.1
mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./Iyzipay.Tests/bin/Release/net45/Iyzipay.Tests.dll