Skip to content

Commit

Permalink
Update to ASP.NET 5
Browse files Browse the repository at this point in the history
Update the sample application to target ASP.NET 5.
  • Loading branch information
martincostello committed Nov 10, 2020
1 parent 3ca0867 commit 0a4556a
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/src/ApplePayJS/bin/Debug/netcoreapp3.1/JustEat.ApplePayJS.dll",
"program": "${workspaceRoot}/src/ApplePayJS/bin/Debug/net5.0/JustEat.ApplePayJS.dll",
"args": [],
"cwd": "${workspaceRoot}/src/ApplePayJS",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
<VersionPrefix>3.1.0</VersionPrefix>
<VersionPrefix>5.0.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build status](https://github.com/justeat/ApplePayJSSample/workflows/build/badge.svg?branch=master&event=push)](https://github.com/justeat/ApplePayJSSample/actions?query=workflow%3Abuild+branch%3Amaster+event%3Apush)

This repository contains a sample implementation of [Apple Pay JS](https://developer.apple.com/reference/applepayjs/) using ASP.NET Core 3.1 written in C# and JavaScript.
This repository contains a sample implementation of [Apple Pay JS](https://developer.apple.com/reference/applepayjs/) using ASP.NET 5.0 written in C# and JavaScript.

## Overview

Expand All @@ -21,7 +21,7 @@ The key components to look at for the implementation are:

To setup the repository to run the sample, perform the steps below:

1. Install the latest [.NET Core 3.1 SDK](https://www.microsoft.com/net/download/core), Visual Studio 2019 or Visual Studio Code.
1. Install the latest [.NET 5.0 SDK](https://www.microsoft.com/net/download/core), Visual Studio 2019 or Visual Studio Code.
1. Fork this repository.
1. Clone the repository from your fork to your local machine: ```git clone https://github.com/{username}/ApplePayJSSample.git```
1. Restore the Bower, npm and NuGet packages.
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.402",
"version": "5.0.100",
"allowPrerelease": false
}
}
2 changes: 1 addition & 1 deletion src/ApplePayJS/ApplePayJS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageTags>applepay</PackageTags>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RootNamespace>JustEat.ApplePayJS</RootNamespace>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
<UserSecretsId>JustEat.ApplePayJS</UserSecretsId>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/ApplePayJS/Clients/MerchantCertificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private X509Certificate2 LoadCertificateFromDisk()
try
{
return new X509Certificate2(
_options.MerchantCertificateFileName,
_options.MerchantCertificateFileName ?? string.Empty,
_options.MerchantCertificatePassword);
}
catch (Exception ex)
Expand All @@ -84,7 +84,7 @@ private X509Certificate2 LoadCertificateFromStore()

var certificates = store.Certificates.Find(
X509FindType.FindByThumbprint,
_options.MerchantCertificateThumbprint?.Trim(),
_options.MerchantCertificateThumbprint?.Trim() ?? string.Empty,
validOnly: false);

if (certificates.Count < 1)
Expand Down
2 changes: 1 addition & 1 deletion src/ApplePayJS/package-lock.json

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

2 changes: 1 addition & 1 deletion src/ApplePayJS/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "justeatapplepayjs",
"private": true,
"version": "3.1.0",
"version": "5.0.0",
"devDependencies": {
"@types/applepayjs": "3.0.0",
"@types/jquery": "3.3.34",
Expand Down
6 changes: 3 additions & 3 deletions tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -10,8 +10,8 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="JustEat.HttpClientInterception" Version="3.0.0" />
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="85.0.4183.8700" />
Expand Down
2 changes: 1 addition & 1 deletion tests/ApplePayJS.Tests/TestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private async Task CreateHttpServer()
_host = builder.Build();

// Force creation of the Kestrel server and start it
var hostedService = _host.Services.GetService<IHostedService>();
var hostedService = _host.Services.GetRequiredService<IHostedService>();
await hostedService.StartAsync(default);
}

Expand Down

0 comments on commit 0a4556a

Please sign in to comment.