From 3b9b843330b726b455186911c2ce97921a36fe57 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Fri, 28 Feb 2020 10:21:22 -0800 Subject: [PATCH] Drop support for .NET Standard 1.2 --- README.md | 2 +- appveyor.yml | 4 ++-- .../FormEncoding/MultipartFormDataContent.cs | 2 -- .../Public/StripeConfiguration.cs | 18 +++------------ .../Public/SystemNetHttpClient.cs | 2 -- src/Stripe.net/Stripe.net.csproj | 23 +------------------ src/StripeTests/StripeTests.csproj | 2 +- 7 files changed, 8 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 7bd7f1b300..d1ca611b51 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Build Status](https://ci.appveyor.com/api/projects/status/rg0pg5tlr1a6f8tf/branch/master?svg=true)](https://ci.appveyor.com/project/stripe/stripe-dotnet) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-dotnet/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-dotnet?branch=master) -The official [Stripe][stripe] .NET library, supporting .NET Standard 1.2+, .NET Core 1.0+, and .NET Framework 4.5+. +The official [Stripe][stripe] .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.5+. ## Installation diff --git a/appveyor.yml b/appveyor.yml index 3c90ea31fb..9fb6ab0c14 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,12 +55,12 @@ test_script: after_test: - ps: Write-Host $("`n RUNNING COVERAGE `n") -BackgroundColor DarkCyan - - dotnet test -c Debug -f netcoreapp3.0 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated + - dotnet test -c Debug -f netcoreapp3.1 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated - ps: | # Secure env vars are not available on all branches, so make sure the # token is available before invoking Coveralls. if (Test-Path env:COVERALLS_REPO_TOKEN) { - .\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.netcoreapp3.0.opencover.xml --useRelativePaths + .\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.netcoreapp3.1.opencover.xml --useRelativePaths } artifacts: diff --git a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs index d5ae231d28..d7ff9b3427 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs @@ -46,14 +46,12 @@ private static StreamContent CreateStreamContent(Stream value, string name) var fileName = "blob"; var extension = string.Empty; -#if NET45 || NETSTANDARD2_0 FileStream fileStream = value as FileStream; if ((fileStream != null) && (!string.IsNullOrEmpty(fileStream.Name))) { fileName = fileStream.Name; extension = Path.GetExtension(fileName); } -#endif var content = new StreamContent(value); content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") diff --git a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs index 9eff7611eb..261e161682 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs @@ -2,12 +2,10 @@ namespace Stripe { using System; using System.Collections.Generic; + using System.Configuration; using System.Reflection; using Newtonsoft.Json; using Stripe.Infrastructure; -#if NET45 || NETSTANDARD2_0 - using System.Configuration; -#endif /// /// Global configuration class for Stripe.net settings. @@ -34,26 +32,21 @@ static StripeConfiguration() /// API version used by Stripe.net. public static string ApiVersion => "2019-12-03"; -#if NET45 || NETSTANDARD2_0 /// Gets or sets the API key. /// /// You can also set the API key using the StripeApiKey key in /// . /// -#else - /// Gets or sets the API key. -#endif public static string ApiKey { get { -#if NET45 || NETSTANDARD2_0 if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(ConfigurationManager.AppSettings["StripeApiKey"])) { apiKey = ConfigurationManager.AppSettings["StripeApiKey"]; } -#endif + return apiKey; } @@ -68,26 +61,21 @@ public static string ApiKey } } -#if NET45 || NETSTANDARD2_0 /// Gets or sets the client ID. /// /// You can also set the client ID using the StripeClientId key in /// . /// -#else - /// Gets or sets the client ID. -#endif public static string ClientId { get { -#if NET45 || NETSTANDARD2_0 if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(ConfigurationManager.AppSettings["StripeClientId"])) { clientId = ConfigurationManager.AppSettings["StripeClientId"]; } -#endif + return clientId; } diff --git a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs index f242ef1afe..9124a859fc 100644 --- a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs +++ b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs @@ -219,8 +219,6 @@ private string BuildStripeClientUserAgentString() var stripeNetTargetFramework = #if NET45 "net45" -#elif NETSTANDARD1_2 - "netstandard1.2" #elif NETSTANDARD2_0 "netstandard2.0" #else diff --git a/src/Stripe.net/Stripe.net.csproj b/src/Stripe.net/Stripe.net.csproj index d283514962..5d59800cb6 100644 --- a/src/Stripe.net/Stripe.net.csproj +++ b/src/Stripe.net/Stripe.net.csproj @@ -7,7 +7,7 @@ 34.26.0 34.26.0 Stripe, Jayme Davis - netstandard1.2;netstandard2.0;net45 + netstandard2.0;net45 Stripe.net Stripe.net stripe;payment;credit;cards;money;gateway;paypal;braintree @@ -16,8 +16,6 @@ https://raw.github.com/stripe/stripe-dotnet/master/LICENSE true win10-x64 - $(PackageTargetFallback);netcoreapp1.0 - 1.6.1 True true true @@ -27,21 +25,6 @@ snupkg - - - - - @@ -70,10 +53,6 @@ - - - - diff --git a/src/StripeTests/StripeTests.csproj b/src/StripeTests/StripeTests.csproj index 2837ef94e3..1a029a1327 100644 --- a/src/StripeTests/StripeTests.csproj +++ b/src/StripeTests/StripeTests.csproj @@ -2,7 +2,7 @@ - netcoreapp1.1;netcoreapp2.1;netcoreapp3.0;net452 + netcoreapp2.0;netcoreapp3.1;net452 StripeTests StripeTests win10-x64