Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #15 from benc-wp/tls-clean-1
Browse files Browse the repository at this point in the history
TLS v1.2 support
  • Loading branch information
peterfich authored May 29, 2018
2 parents cc7e1ed + 322d9fd commit d527285
Show file tree
Hide file tree
Showing 537 changed files with 81,381 additions and 44,312 deletions.
82 changes: 71 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,74 @@
# worldpay-lib-dotnet
worldpay-lib-dotnet
===================

This repository consists of four related projects:
* worldpay-lib-dotnet-3-5 and worldpay-lib-dotnet-2-0, the SDKs for .NET 3.5+ and .NET 2.0
* worldpay-sample-dotnet-3-5 and worldpay-sample-dotnet-2-0, the sample applications for the SDKs
This repository consists of following related projects:
* worldpay-lib-dotnet-3-5 for .NET 3.5 and sample application worldpay-sample-dotnet-3-5
* worldpay-lib-dotnet-4-0 for .NET 4.0 and sample application worldpay-sample-dotnet-4-0
* worldpay-lib-dotnet-4-6 for .NET 4.6 and sample application worldpay-sample-dotnet-4-6

Each of these is contained in a separate directory / VS solution.
Each is a VS solution you can open separately.

#### Issues
Please see our [support contact information]( https://developer.worldpay.com/jsonapi/faq/articles/how-can-i-contact-you-for-support) to raise an issue.
TLS v1.2 support
----------------

TLS version 1.0 and 1.1 are no longer supported by this SDK from 4th June, 2018.
Any customers continuing to use TLS 1.0 or 1.1 will be unable to transact.

Please follow the instructions below to update your application to ensure you are using TLS 1.2.

.NET 2.0 is no longer supported due to this change. Please update to .NET 3.5 or later to be compatible.

To test your integration, we have created an endpoint and please use: ```https://api-test.worldpay.com/v1``` instead.

### .NET 3.5

#### Step 1: Install Patch
.NET 3.5 did not initially support TLS 1.2. However, there has been a recent patch available which enables TLS 1.2 support.
Please ensure the appropriate patch below is installed in your application environment:


| OS | Patch |
|---------------------------|-----------------------------------------------------|
| Win7 SP1/Win 2008 R2 SP1 | KB3154518 - Reliability Rollup HR-1605 – NDP 2.0 SP2|
| Win8 RTM/Win 2012 RTM | KB3154519 - Reliability Rollup HR-1605 – NDP 2.0 SP2|
| Win8.1RTM/Win 2012 R2 RTM | KB3154520 - Reliability Rollup HR-1605 – NDP 2.0 SP2|
| Windows 10 | KB3156421 - 1605 HotFix Rollup through Windows Update|

#### 

Step 2: Replace DLL
You should replace your current ```Worldpay.Sdk.dll``` with the new version 1.2.0.1 for .NET 3.5.

#### 

Step 3: Add line to code base
The following line should be added to your code. This line explicitly sets the program to use TLS1.2.

```ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;```

worldpay-lib-dotnet-3-5 & 2-0
### .NET 4.0

#### Step 1: Ensure .NET 4.5 is installed
.NET 4.0 does not support TLS 1.2, but if you have .NET 4.5 (or above) installed on your system you can use TLS 1.2 even if the application framework your are using does not support it.
Please ensure you install .NET 4.5 or above.


#### 

Step 2: Replace DLL
You should replace you current ```Worldpay.Sdk.dll``` with the new version 1.2.0.1 for .NET 4.0.

#### 

Step 3: Add line to code base
The following line should be added to your code. This line explicitly sets the program to use TLS1.2.

```ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;```

### .NET 4.6 and above

#### Step 1: Replace DLL
You should replace your current ```Worldpay.Sdk.dll``` with the new version 1.2.0.1 for .NET 4.6.

#### Step 2: Make TLS 1.2 default
.NET 4.6 and above supports TLS 1.2, but it is not a default protocol. You will need to add the following line to your code base to ensure the connection uses TLS 1.2.

```ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12```

worldpay-lib-dotnet
-------------------

DotNet Library for Worldpay REST API (.NET 3.5+, .NET 2.0)
DotNet Library for Worldpay REST API (.NET 3.5+)

## Usage

Expand Down Expand Up @@ -50,15 +106,15 @@ try {
}
```

worldpay-sample-dotnet-3-5 & 2-0
worldpay-sample-dotnet
-------------------

C# ASP .NET sample application which demonstrates integration with Worldpay API.

### Prerequisites

- A .NET-enabled development environment, such as Visual Studio or SharpDevelop. These below instructions assume you're using Visual Studio.
- .NET Framework 3.5
- .NET Framework 3.5+

### Instructions

Expand All @@ -68,3 +124,7 @@ C# ASP .NET sample application which demonstrates integration with Worldpay API.
- Also in Web.config, set OrderLog to a location on your server which has read/write access permissions for your web server. In IIS on Windows, this usually means granting access to IUSR and IIS_IUSRS via the Windows Explorer folder properties dialog.
- Visual Studio users can now be able to run the application simply by opening the page 'CreateOrder.aspx' and clicking the 'run' button from the toolbar.
- To test credit card transactions via the IDE, simply fill out the details on the page and submit.

Issues
------
Please see our [support contact information]( https://developer.worldpay.com/jsonapi/faq/articles/how-can-i-contact-you-for-support) to raise an issue.
Binary file removed Release.24.1.2017.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion worldpay-lib-dotnet-3-5/Worldpay.Sdk.Test/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="TokenUrl" value="https://api.worldpay.com/v1/tokens"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -26,6 +26,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -34,6 +35,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="TokenUrl" value="https://api.worldpay.com/v1/tokens"/>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="TokenUrl" value="https://api.worldpay.com/v1/tokens"/>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
32 changes: 24 additions & 8 deletions worldpay-lib-dotnet-3-5/Worldpay.Sdk/App.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="TokenUrl" value="http://api.worldpay.com/v1/tokens"/>
<add key="BaseUrl" value="https://api.worldpay.com/v1"/>
<add key="ServiceKey" value="MyServiceKey"/>
<add key="ClientKey" value="MyClientKey"/>
<add key="MerchantId" value="MyMerchantId"/>
<add key="WebhookUrl" value="MyWebookUrl"/>
<add key="OrderLog" value="MyWebhookLog"/>
<add key="TokenUrl" value="http://api.worldpay.com/v1/tokens" />
<add key="BaseUrl" value="https://api.worldpay.com/v1" />
<add key="ServiceKey" value="MyServiceKey" />
<add key="ClientKey" value="MyClientKey" />
<add key="MerchantId" value="MyMerchantId" />
<add key="WebhookUrl" value="MyWebookUrl" />
<add key="OrderLog" value="MyWebhookLog" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
2 changes: 2 additions & 0 deletions worldpay-lib-dotnet-3-5/Worldpay.Sdk/Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ private HttpWebRequest CreateRequest(string api, RequestMethod method, object da
request.Accept = ApplicationJson;
request.Timeout = ConnectionTimeout;

request.Headers.Add("x-wp-client-user-agent", "NET-Client-3_5");

switch (method)
{
case RequestMethod.Get:
Expand Down
Empty file modified worldpay-lib-dotnet-3-5/Worldpay.Sdk/Json/EntryConvertcs.cs
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.2.0.1")]
[assembly: AssemblyFileVersion("1.2.0.1")]
Empty file modified worldpay-lib-dotnet-3-5/Worldpay.Sdk/Worldpay.Sdk.csproj
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion worldpay-lib-dotnet-3-5/Worldpay.Sdk/Worldpay.Sdk35.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -41,6 +41,7 @@
<Reference Include="System.Configuration" />
<Reference Include="System.Web" />
<Reference Include="System.Data" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file modified worldpay-lib-dotnet-3-5/Worldpay.Sdk/bin/Worldpay.Sdk.dll
Binary file not shown.
32 changes: 24 additions & 8 deletions worldpay-lib-dotnet-3-5/Worldpay.Sdk/bin/Worldpay.Sdk.dll.config
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="TokenUrl" value="http://api.worldpay.com/v1/tokens"/>
<add key="BaseUrl" value="https://api.worldpay.com/v1"/>
<add key="ServiceKey" value="MyServiceKey"/>
<add key="ClientKey" value="MyClientKey"/>
<add key="MerchantId" value="MyMerchantId"/>
<add key="WebhookUrl" value="MyWebookUrl"/>
<add key="OrderLog" value="MyWebhookLog"/>
<add key="TokenUrl" value="http://api.worldpay.com/v1/tokens" />
<add key="BaseUrl" value="https://api.worldpay.com/v1" />
<add key="ServiceKey" value="MyServiceKey" />
<add key="ClientKey" value="MyClientKey" />
<add key="MerchantId" value="MyMerchantId" />
<add key="WebhookUrl" value="MyWebookUrl" />
<add key="OrderLog" value="MyWebhookLog" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
Binary file modified worldpay-lib-dotnet-3-5/Worldpay.Sdk/bin/Worldpay.Sdk.pdb
Binary file not shown.
Empty file modified worldpay-lib-dotnet-3-5/Worldpay.Sdk/lib/Newtonsoft.Json.dll
100755 → 100644
Empty file.
File renamed without changes.
Loading

0 comments on commit d527285

Please sign in to comment.