Skip to content

Commit

Permalink
Update dependencies (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkjenn authored Oct 14, 2024
1 parent 6577c17 commit 530853b
Show file tree
Hide file tree
Showing 24 changed files with 96 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.22.1",
"version": "0.29.2",
"commands": [
"dotnet-csharpier"
]
},
"husky": {
"version": "0.5.4",
"version": "0.7.1",
"commands": [
"husky"
]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id-token: write
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
dotnet-version: [ '8.0.x' ]
steps:
- name: Get repo
uses: actions/checkout@v3
Expand All @@ -43,7 +43,7 @@ jobs:
dotnet tool restore --tool-manifest src/.config/dotnet-tools.json
cd src
dotnet csharpier . --check
# - name: Install dependencies for IntegrationTests
# run: dotnet restore src/Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj
# - name: Run Integration Tests
# run: dotnet test src/Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj --no-restore --verbosity normal --environment vmp_net_sdk_CLIENT_ID=${{ secrets.CLIENT_ID }} --environment vmp_net_sdk_CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} --environment vmp_net_sdk_SUBSCRIPTION_KEY=${{ secrets.SUBSCRIPTION_KEY }} --environment vmp_net_sdk_MERCHANT_SERIAL_NUMBER=${{ secrets.MERCHANT_SERIAL_NUMBER }}
- name: Install dependencies for IntegrationTests
run: dotnet restore src/Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj
- name: Run Integration Tests
run: dotnet test src/Tests/Vipps.net.IntegrationTests/Vipps.net.IntegrationTests.csproj --no-restore --verbosity normal --environment vmp_net_sdk_CLIENT_ID=${{ secrets.CLIENT_ID }} --environment vmp_net_sdk_CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} --environment vmp_net_sdk_SUBSCRIPTION_KEY=${{ secrets.SUBSCRIPTION_KEY }} --environment vmp_net_sdk_MERCHANT_SERIAL_NUMBER=${{ secrets.MERCHANT_SERIAL_NUMBER }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
contents: write # needed to push tag
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
dotnet-version: [ '8.0.x' ]
steps:
- name: Get repo with depth
uses: actions/checkout@v3
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

# [2.0.1] - October 2024
Update dependencies

# [2.0.0] - October 2024
This is a re-release of the 0.9.x to supersede the 1.x.x versions. This release is a major release and includes breaking changes.

# [1.0.x] - October 2024 - DEPRECATED
This release is a major release and includes breaking changes.

# [0.9.x] - 2023
8 changes: 4 additions & 4 deletions src/Tests/Vipps.net.IntegrationTests/CheckoutServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public async Task Can_Create_And_Get_Session()
MerchantInfo = new Models.Checkout.PaymentMerchantInfo
{
CallbackAuthorizationToken = Guid.NewGuid().ToString(),
CallbackUrl = "https://no.where.com/callback",
ReturnUrl = "https://no.where.com/return",
TermsAndConditionsUrl = "https://no.where.com/terms"
}
CallbackUrl = "https://apitest.vipps.no/does-not-exist-callback",
ReturnUrl = "https://apitest.vipps.no/does-not-exist-return",
TermsAndConditionsUrl = "https://apitest.vipps.no/does-not-exist-terms",
},
};

var sessionResponse = await vippsApi.CheckoutService.InitiateSession(
Expand Down
6 changes: 4 additions & 2 deletions src/Tests/Vipps.net.IntegrationTests/EpaymentServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ private static CreatePaymentRequest GetCreatePaymentRequest(string reference)
Amount = new Amount
{
Currency = Currency.NOK,
Value = 100 // 100 øre = 1 KR
Value =
100 // 100 øre = 1 KR
,
},
PaymentMethod = new PaymentMethod { Type = PaymentMethodType.WALLET },
UserFlow = CreatePaymentRequestUserFlow.WEB_REDIRECT,
Reference = reference,
PaymentDescription = nameof(CheckoutServiceTests.Can_Create_And_Get_Session),
ReturnUrl = $"https://no.where.com/{reference}",
Customer = new Customer { }
Customer = new Customer { },
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/Vipps.net.IntegrationTests/TestSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static IVippsApi CreateVippsAPI()
UseTestMode = true,
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
PluginVersion =
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0"
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0",
};

// The following line configures vipps with custom settings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -27,14 +27,17 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.12.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Vipps.net.AspCoreDemo/Controllers/CheckoutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public async Task<ActionResult<InitiateSessionResponse>> CreateSession()
{
Amount = new Amount { Currency = "NOK", Value = 10000 },
PaymentDescription = "test",
Reference = Guid.NewGuid().ToString()
}
Reference = Guid.NewGuid().ToString(),
},
};

_logger.LogInformation(
Expand Down
10 changes: 5 additions & 5 deletions src/Vipps.net.AspCoreDemo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public void ConfigureServices(IServiceCollection services)
{
var vippsConfigurationOptions = new VippsConfigurationOptions
{
ClientId = Configuration.GetValue<string>("CLIENT-ID")!,
ClientSecret = Configuration.GetValue<string>("CLIENT-SECRET")!,
MerchantSerialNumber = Configuration.GetValue<string>("MERCHANT-SERIAL-NUMBER")!,
SubscriptionKey = Configuration.GetValue<string>("SUBSCRIPTION-KEY")!,
ClientId = Configuration["CLIENT-ID"],
ClientSecret = Configuration["CLIENT-SECRET"],
MerchantSerialNumber = Configuration["MERCHANT-SERIAL-NUMBER"],
SubscriptionKey = Configuration["SUBSCRIPTION-KEY"],
UseTestMode = true,
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
PluginVersion =
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0"
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0",
};

services.AddTransient(_ => vippsConfigurationOptions);
Expand Down
8 changes: 4 additions & 4 deletions src/Vipps.net.AspCoreDemo/Vipps.net.AspCoreDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<UserSecretsId>5fcb55b3-f577-4b73-a82a-f13b33796367</UserSecretsId>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.12.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Vipps.net.AspDemo/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static void RegisterRoutes(RouteCollection routes)
{
controller = "Home",
action = "Index",
id = UrlParameter.Optional
id = UrlParameter.Optional,
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Vipps.net.AspDemo/App_Start/VippsApiConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void Configure()
UseTestMode = bool.Parse(ConfigurationManager.AppSettings["UseTestMode"]),
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
PluginVersion =
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0"
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0",
};

_vippsApi = new VippsApi(configurationOptions);
Expand Down
4 changes: 2 additions & 2 deletions src/Vipps.net.AspDemo/Services/CheckoutSessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ internal static async Task<string> CreateSession()
{
Amount = new Amount { Currency = "NOK", Value = 10000 },
PaymentDescription = "test",
Reference = Guid.NewGuid().ToString()
}
Reference = Guid.NewGuid().ToString(),
},
};

var result = await VippsApiConfig.VippsApi.CheckoutService.InitiateSession(request);
Expand Down
4 changes: 2 additions & 2 deletions src/Vipps.net.Demo/Controllers/CheckoutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public async Task<ActionResult<InitiateSessionResponse>> CreateSession()
{
Amount = new Amount { Currency = "NOK", Value = 10000 },
PaymentDescription = "test",
Reference = Guid.NewGuid().ToString()
}
Reference = Guid.NewGuid().ToString(),
},
};

_logger.LogInformation(
Expand Down
3 changes: 2 additions & 1 deletion src/Vipps.net.Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ private static void Main(string[] args)
SubscriptionKey = builder.Configuration.GetValue<string>("SUBSCRIPTION-KEY")!,
UseTestMode = true,
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
PluginVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0"
PluginVersion =
Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "1.0.0",
};

builder.Services.AddTransient(_ => vippsConfigurationOptions);
Expand Down
8 changes: 4 additions & 4 deletions src/Vipps.net.Demo/Vipps.net.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>e1850619-4f06-4444-b271-437c887123f0</UserSecretsId>
Expand All @@ -10,9 +10,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.2" />
<PackageReference Include="Azure.Identity" Version="1.8.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageReference Include="Azure.Identity" Version="1.12.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Vipps.net/Helpers/PolicyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ string errorMessage
)
{
return Policy
.HandleResult<HttpResponseMessage>(
r => (int)r.StatusCode >= (int)HttpStatusCode.InternalServerError
.HandleResult<HttpResponseMessage>(r =>
(int)r.StatusCode >= (int)HttpStatusCode.InternalServerError
)
.FallbackAsync(
new HttpResponseMessage(HttpStatusCode.InternalServerError),
async (result, context) =>
{
var responseString = await result.Result.Content
.ReadAsStringAsync()
var responseString = await result
.Result.Content.ReadAsStringAsync()
.ConfigureAwait(false);
logger?.LogError(
$"{errorMessage}{CommonErrorMessagePart}",
Expand Down
2 changes: 1 addition & 1 deletion src/Vipps.net/Helpers/VippsRequestSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal static class VippsRequestSerializer
{
NullValueHandling = NullValueHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.Include,
Converters = new[] { new Newtonsoft.Json.Converters.StringEnumConverter() }
Converters = new[] { new Newtonsoft.Json.Converters.StringEnumConverter() },
};

internal static string SerializeVippsRequest<T>(T vippsRequest)
Expand Down
2 changes: 1 addition & 1 deletion src/Vipps.net/Infrastructure/AccessTokenServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CancellationToken cancellationToken
{
{ Constants.HeaderNameClientId, _vippsConfigurationOptions.ClientId },
{ Constants.HeaderNameClientSecret, _vippsConfigurationOptions.ClientSecret },
{ Constants.SubscriptionKey, _vippsConfigurationOptions.SubscriptionKey }
{ Constants.SubscriptionKey, _vippsConfigurationOptions.SubscriptionKey },
}
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Vipps.net/Infrastructure/BaseServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ CancellationToken cancellationToken
{
#pragma warning disable IDE0079 // Remove unnecessary suppression. This is caused by us building multiple targets. In some (net 6, 7), the overload with the cancellationToken is preferred. In the others, it does not exist.
#pragma warning disable CA2016 // Forward the 'CancellationToken' parameter to methods
var responseContent = await response.Content
.ReadAsStringAsync()
var responseContent = await response
.Content.ReadAsStringAsync()
.ConfigureAwait(false);
#pragma warning restore CA2016 // Forward the 'CancellationToken' parameter to methods
#pragma warning restore IDE0079 // Remove unnecessary suppression
Expand Down
2 changes: 1 addition & 1 deletion src/Vipps.net/Infrastructure/EpaymentServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CancellationToken cancellationToken
$"{Constants.AuthorizationSchemeNameBearer} {authToken.Token}"
},
{ "Idempotency-Key", Guid.NewGuid().ToString() },
{ Constants.SubscriptionKey, _vippsConfigurationOptions.SubscriptionKey }
{ Constants.SubscriptionKey, _vippsConfigurationOptions.SubscriptionKey },
};
return headers;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Vipps.net/Infrastructure/VippsHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private HttpClient CreateDefaultHttpClient()
var httpClient = new HttpClient()
{
Timeout = DefaultTimeOut,
BaseAddress = new Uri(UrlHelper.GetBaseUrl(_options.UseTestMode))
BaseAddress = new Uri(UrlHelper.GetBaseUrl(_options.UseTestMode)),
};

return httpClient;
Expand All @@ -93,7 +93,7 @@ private Dictionary<string, string> GetHeaders()
string.IsNullOrWhiteSpace(_options.PluginVersion)
? "0.0.1"
: _options.PluginVersion
}
},
};
}
}
Expand Down
26 changes: 21 additions & 5 deletions src/Vipps.net/Vipps.net.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;netcoreapp3.1;netstandard2.0;net48</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0;net48</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<Product>Vipps.net</Product>
<Description>Vipps.net SDK</Description>
<PackageId>Vipps.net</PackageId>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<Authors>Vipps Mobilepay AS</Authors>
<Company>Vipps Mobilepay AS</Company>
<Title>Vipps SDK .Net</Title>
Expand Down Expand Up @@ -34,13 +34,29 @@
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.32" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.27.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.2" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Update="Polly">
<Version>8.4.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>
<Target Name="Husky" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(HUSKY)' != 0">
<Exec Command="dotnet tool restore" StandardOutputImportance="Low" StandardErrorImportance="High" />
Expand Down

0 comments on commit 530853b

Please sign in to comment.