Skip to content

Commit

Permalink
Merge pull request #379 from Adyen/develop
Browse files Browse the repository at this point in the history
[PW-3899] Release 6.1.0
  • Loading branch information
AlexandrosMor authored Jan 27, 2021
2 parents d6d4b14 + 074be94 commit 8082ba6
Show file tree
Hide file tree
Showing 206 changed files with 15,098 additions and 6,823 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: ['2.0.0','2.2.103']
dotnet: ['2.1.811','2.2.103']
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.vs/
TestResults/

.vagrant/
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions Adyen.Test/Adyen.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

<IsPackable>false</IsPackable>

<AssemblyVersion>5.7.0</AssemblyVersion>
<AssemblyVersion>6.1.0</AssemblyVersion>

<FileVersion>5.7.0</FileVersion>
<FileVersion>6.1.0</FileVersion>

<Version>5.7.0</Version>
<Version>6.1.0</Version>

<LangVersion>7.2</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -33,7 +35,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />

<PackageReference Include="Moq" Version="4.14.5" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
</ItemGroup>
Expand Down
23 changes: 23 additions & 0 deletions Adyen.Test/ApplePayDeserializationTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Adyen.Model.Checkout;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;

namespace Adyen.Test
{
[TestClass]
public class ApplePayDeserializationTest : BaseTest
{
[TestMethod]
public void Can_deserialize_applepay_paymentmethod_request()
{
var mockPath = GetMockFilePath("Mocks/checkout/paymentmethod-applepay-request.json");
var response = MockFileToString(mockPath);

var paymentMethod = JsonConvert.DeserializeObject<DefaultPaymentMethodDetails>(response);

Assert.IsNotNull(paymentMethod);
Assert.AreEqual("applepay", paymentMethod.Type);
Assert.AreEqual("VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...", paymentMethod.ApplePayToken);
}
}
}
50 changes: 15 additions & 35 deletions Adyen.Test/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
using Amount = Adyen.Model.Amount;
using PaymentResult = Adyen.Model.PaymentResult;
using Adyen.Model.Checkout;
using System.Threading.Tasks;

namespace Adyen.Test
{
Expand Down Expand Up @@ -211,7 +212,6 @@ public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2()
Amount = amount,
ReturnUrl = @"https://your-company.com/...",
MerchantAccount = "MerchantAccount",
AdditionalData = new Dictionary<string, string>() { { "allow3DS2", "true" } },
Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web
};
paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith");
Expand All @@ -222,15 +222,15 @@ public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2()
///Checkout Details request
/// </summary>
/// <returns>Returns a sample PaymentsDetailsRequest object with test data</returns>
protected Model.Checkout.PaymentsDetailsRequest CreateDetailsRequest()
protected PaymentsDetailsRequest CreateDetailsRequest()
{
string paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...";
var details = new Dictionary<string, string>
var paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...";
var details = new PaymentCompletionDetails()
{
{ "MD", "sdfsdfsdf..." },
{ "PaRes", "sdfsdfsdf..." }
MD= "sdfsdfsdf...",
PaReq = "sdfsdfsdf..."
};
var paymentsDetailsRequest = new Model.Checkout.PaymentsDetailsRequest(Details: details, PaymentData: paymentData);
var paymentsDetailsRequest = new PaymentsDetailsRequest(details: details, paymentData: paymentData);

return paymentsDetailsRequest;
}
Expand All @@ -250,19 +250,19 @@ protected PaymentMethodsRequest CreatePaymentMethodRequest(string merchantAccoun
/// <returns></returns>
protected PaymentSessionRequest CreatePaymentSessionRequest()
{
return new PaymentSessionRequest(MerchantAccount: "MerchantAccount", Reference: "MerchantReference",
Amount: new Model.Checkout.Amount("EUR", 1200), ReturnUrl: @"https://your-company.com/...", CountryCode: "NL",
Channel: PaymentSessionRequest.ChannelEnum.Web, SdkVersion: "1.3.0");
return new PaymentSessionRequest(merchantAccount: "MerchantAccount", reference: "MerchantReference",
amount: new Model.Checkout.Amount("EUR", 1200), returnUrl: @"https://your-company.com/...", countryCode: "NL",
channel: PaymentSessionRequest.ChannelEnum.Web, sdkVersion: "1.3.0");
}

/// <summary>
/// Checkout paymentResultRequest
/// </summary>
/// <returns></returns>
protected Model.Checkout.PaymentResultRequest CreatePaymentResultRequest()
protected PaymentResultRequest CreatePaymentResultRequest()
{
string payload = @"Ab0oCC2/wy96FiEMLvoI8RfayxEmZHQZcw...riRbNBzP3pQscLYBHN/MfZkgfGHdqy7JfQoQbRUmA==";
return new Model.Checkout.PaymentResultRequest(Payload: payload);
var payload = @"Ab0oCC2/wy96FiEMLvoI8RfayxEmZHQZcw...riRbNBzP3pQscLYBHN/MfZkgfGHdqy7JfQoQbRUmA==";
return new PaymentResultRequest(payload: payload);
}

#endregion
Expand Down Expand Up @@ -303,6 +303,8 @@ protected Client CreateMockTestClientNullRequiredFieldsRequest(string fileName)
var confMock = MockPaymentData.CreateConfingMock();

clientInterfaceMock.Setup(x => x.Request(It.IsAny<string>(), It.IsAny<string>(), confMock)).Returns(response);
clientInterfaceMock.Setup(x => x.Request(It.IsAny<string>(), It.IsAny<string>(), confMock, It.IsAny<bool>(), It.IsAny<RequestOptions>())).Returns(response);
clientInterfaceMock.Setup(x => x.RequestAsync(It.IsAny<string>(), It.IsAny<string>(), confMock, It.IsAny<bool>(), It.IsAny<RequestOptions>())).Returns(Task.FromResult(response));
var clientMock = new Client(It.IsAny<Config>())
{
HttpClient = clientInterfaceMock.Object,
Expand Down Expand Up @@ -519,28 +521,6 @@ protected AuthenticationResultRequest CreateAuthenticationResultRequest()
};
}


/// <summary>
/// Create dummy CreatePaymentLinkRequest
/// </summary>
/// <returns>CreatePaymentLinkRequest</returns>
protected CreatePaymentLinkRequest CreatePaymentLinkRequestSuccess()
{
return new CreatePaymentLinkRequest()
{
Reference = "YOUR_REFERENCE_NUMBER",
Amount = new Model.Checkout.Amount("EUR", 100),
CountryCode = "GR",
MerchantAccount = "MerchantAccount",
ShopperReference = "ShopperReference",
ShopperEmail = "info@ShopperEmail.com",
ShopperLocale = "GR",
ExpiresAt = "2019-12-17T10:59:29",
BillingAddress = new Model.Checkout.Address(Country: "GR"),
DeliveryAddress = new Model.Checkout.Address(Country: "GR"),
};
}

private PaymentResult GetAdditionaData(PaymentResult paymentResult)
{
var paymentResultAdditionalData = paymentResult.AdditionalData;
Expand Down
Loading

0 comments on commit 8082ba6

Please sign in to comment.