diff --git a/.vscode/launch.json b/.vscode/launch.json index a51d215a..7919da9c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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, diff --git a/Directory.Build.props b/Directory.Build.props index 338eee34..f983eb5e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,7 +14,7 @@ git $(PackageProjectUrl).git latest - 3.1.0 + 5.0.0 diff --git a/README.md b/README.md index 7b5f13b3..bc8ab040 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. diff --git a/global.json b/global.json index 94eb7bb6..fd0ce940 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "3.1.402", + "version": "5.0.100", "allowPrerelease": false } } diff --git a/src/ApplePayJS/ApplePayJS.csproj b/src/ApplePayJS/ApplePayJS.csproj index 6765926b..47db48de 100644 --- a/src/ApplePayJS/ApplePayJS.csproj +++ b/src/ApplePayJS/ApplePayJS.csproj @@ -11,7 +11,7 @@ applepay true JustEat.ApplePayJS - netcoreapp3.1 + net5.0 latest JustEat.ApplePayJS diff --git a/src/ApplePayJS/Clients/MerchantCertificate.cs b/src/ApplePayJS/Clients/MerchantCertificate.cs index 4e4ac73a..3971b00a 100644 --- a/src/ApplePayJS/Clients/MerchantCertificate.cs +++ b/src/ApplePayJS/Clients/MerchantCertificate.cs @@ -63,7 +63,7 @@ private X509Certificate2 LoadCertificateFromDisk() try { return new X509Certificate2( - _options.MerchantCertificateFileName, + _options.MerchantCertificateFileName ?? string.Empty, _options.MerchantCertificatePassword); } catch (Exception ex) @@ -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) diff --git a/src/ApplePayJS/package-lock.json b/src/ApplePayJS/package-lock.json index 2200b0e2..bb0d45ea 100644 --- a/src/ApplePayJS/package-lock.json +++ b/src/ApplePayJS/package-lock.json @@ -1,6 +1,6 @@ { "name": "justeatapplepayjs", - "version": "3.1.0", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/ApplePayJS/package.json b/src/ApplePayJS/package.json index 5570e403..26cea5d8 100644 --- a/src/ApplePayJS/package.json +++ b/src/ApplePayJS/package.json @@ -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", diff --git a/tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj b/tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj index a9209bde..cb4b56f5 100644 --- a/tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj +++ b/tests/ApplePayJS.Tests/ApplePayJS.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 false @@ -10,8 +10,8 @@ - - + + diff --git a/tests/ApplePayJS.Tests/TestFixture.cs b/tests/ApplePayJS.Tests/TestFixture.cs index 19247fb2..1f877f00 100644 --- a/tests/ApplePayJS.Tests/TestFixture.cs +++ b/tests/ApplePayJS.Tests/TestFixture.cs @@ -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(); + var hostedService = _host.Services.GetRequiredService(); await hostedService.StartAsync(default); }