Skip to content

Commit

Permalink
Release 3.2.1 (#137)
Browse files Browse the repository at this point in the history
* [PW-1535]Add CheckoutPaymentAction (#132)

* Add CheckoutPaymentAction

* Fix issues in CheckoutPaymentsAction

* Change additionaldata type to dictionary (#134)

* Adyen Outputtext variable is named 'Text'; for correct serialization, class should have same variable name. (#133)

Caused problems in PaymentResponse.PaymentReceipt[] where the content values of the receipts were all set to null.

* [PW-1583] Add Sepa fields and Bank Account (#136)

* Add Sepa fields

* Correct equals

* Add Bank account field

* Correct ToString fields

* Correct comments

* Update version 3.2.1
  • Loading branch information
AlexandrosMor authored Aug 6, 2019
1 parent a6097bc commit 8cc96e5
Show file tree
Hide file tree
Showing 16 changed files with 456 additions and 109 deletions.
6 changes: 3 additions & 3 deletions Adyen.Test/Adyen.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<IsPackable>false</IsPackable>

<AssemblyVersion>3.2.0</AssemblyVersion>
<AssemblyVersion>3.2.1</AssemblyVersion>

<FileVersion>3.2.0</FileVersion>
<FileVersion>3.2.1</FileVersion>

<Version>3.2.0</Version>
<Version>3.2.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
9 changes: 7 additions & 2 deletions Adyen.Test/BinLookupTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Adyen.Service;
using Adyen.Service.Resource.BinLookup;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Text;

namespace Adyen.Test
{
Expand All @@ -20,9 +21,14 @@ public void Get3dsAvailabilitySuccessMockedTest()
CardNumber = "4111111111111111"
};
var threeDsAvailabilityResponse = binLookup.ThreeDsAvailability(threeDsAvailabilityRequest);
Assert.AreEqual("F013371337", threeDsAvailabilityResponse.DsPublicKeys[0].DirectoryServerId);
Assert.AreEqual("visa", threeDsAvailabilityResponse.DsPublicKeys[0].Brand);
Assert.AreEqual("visa", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].BrandCode);
Assert.AreEqual("411111111111", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].StartRange);
Assert.AreEqual("411111111111", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].EndRange);
Assert.AreEqual("2.1.0", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].ThreeDS2Version);
Assert.AreEqual("https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml", threeDsAvailabilityResponse.ThreeDS2CardRangeDetails[0].ThreeDSMethodURL);
Assert.AreEqual(true, threeDsAvailabilityResponse.ThreeDS1Supported);
Assert.AreEqual(true, threeDsAvailabilityResponse.ThreeDS2supported);
}

[TestMethod]
Expand Down Expand Up @@ -65,7 +71,6 @@ public void GetCostEstimateSuccessGenerateShopperInteractionFromEnum()
var ecommerce = Util.JsonOperation.SerializeRequest(ShopperInteraction.Ecommerce);
var contAuth = Util.JsonOperation.SerializeRequest(ShopperInteraction.ContAuth);
var moto = Util.JsonOperation.SerializeRequest(ShopperInteraction.Moto);

Assert.AreEqual("\"Ecommerce\"", ecommerce);
Assert.AreEqual("\"ContAuth\"", contAuth);
Assert.AreEqual("\"Moto\"", moto);
Expand Down
34 changes: 28 additions & 6 deletions Adyen.Test/CheckoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,26 @@ public void CheckoutEndpointLiveErrorTest()
/// POST /payments
/// </summary>
[TestMethod]
public void PaymentsTest()
public void PaymentsAdditionalDataParsingTest()
{
var paymentRequest = CreatePaymentRequestCheckout();
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/payments-success.json");

var checkout = new Checkout(client);
var paymentResponse = checkout.Payments(paymentRequest);
Assert.AreEqual("8535296650153317", paymentResponse.PspReference);
Assert.AreEqual(ResultCodeEnum.Authorised, paymentResponse.ResultCode);
Assert.IsNotNull(paymentResponse.AdditionalData);
Assert.AreEqual(9, paymentResponse.AdditionalData.Count);
Assert.AreEqual("8/2018", paymentResponse.AdditionalData["expiryDate"]);
Assert.AreEqual("GREEN", paymentResponse.AdditionalData["fraudResultType"]);
Assert.AreEqual("411111", paymentResponse.AdditionalData["cardBin"]);
Assert.AreEqual("1111", paymentResponse.AdditionalData["cardSummary"]);
Assert.AreEqual("false", paymentResponse.AdditionalData["fraudManualReview"]);
Assert.AreEqual("Default", paymentResponse.AdditionalData["aliasType"]);
Assert.AreEqual("H167852639363479", paymentResponse.AdditionalData["alias"]);
Assert.AreEqual("visa", paymentResponse.AdditionalData["cardPaymentMethod"]);
Assert.AreEqual("NL", paymentResponse.AdditionalData["cardIssuingCountry"]);
}

/// <summary>
/// Test success flow for 3DS2
/// POST /payments
Expand All @@ -83,7 +88,23 @@ public void Payments3DS2Test()
Assert.AreEqual(paymentResponse.ResultCode, ResultCodeEnum.IdentifyShopper);
Assert.IsFalse(string.IsNullOrEmpty(paymentResponse.PaymentData));
}


/// <summary>
/// Test 3ds success flow for
/// POST /payments/result
/// </summary>
[TestMethod]
public void PaymentsAuthorise3ds2ResultSuccessTest()
{
var paymentResultRequest = CreatePaymentResultRequest();
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/threedsecure2/authorise3ds2-success.json");
var checkout = new Checkout(client);
var paymentResultResponse = checkout.PaymentsResult(paymentResultRequest);
Assert.IsNotNull(paymentResultResponse.AdditionalData);
Assert.AreEqual(paymentResultResponse.AdditionalData["cvcResult"], "1 Matches");
Assert.AreEqual(paymentResultResponse.ResultCode, Model.Checkout.PaymentResultResponse.ResultCodeEnum.Authorised);
}

/// <summary>
/// Test error flow for
/// POST /payments
Expand All @@ -107,7 +128,7 @@ public void PaymentDetailsTest()
{
var detailsRequest = CreateDetailsRequest();
detailsRequest.Details.Add("payload", "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ");
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-sucess.json");
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-success.json");
var checkout = new Checkout(client);
var paymentResponse = checkout.PaymentDetails(detailsRequest);
Assert.AreEqual("8515232733321252", paymentResponse.PspReference);
Expand Down Expand Up @@ -191,11 +212,12 @@ public void PaymentSessionErrorTest()
public void PaymentsResultSuccessTest()
{
var paymentResultRequest = CreatePaymentResultRequest();
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsresult-sucess.json");
var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsresult-success.json");
var checkout = new Checkout(client);
var paymentResultResponse = checkout.PaymentsResult(paymentResultRequest);
Assert.AreEqual(paymentResultResponse.ResultCode, Model.Checkout.PaymentResultResponse.ResultCodeEnum.Authorised);
}

/// <summary>
/// Test success flow for
/// POST /payments/result
Expand Down
8 changes: 4 additions & 4 deletions Adyen/Adyen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Adyen</Copyright>
<Version>3.2.0</Version>
<AssemblyVersion>3.2.0</AssemblyVersion>
<FileVersion>3.2.0</FileVersion>
<Version>3.2.1</Version>
<AssemblyVersion>3.2.1</AssemblyVersion>
<FileVersion>3.2.1</FileVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>The Adyen API Library for .net core enables you to work with Adyen APIs, Hosted Payment Pages and terminal api with any .net application.</Description>
<PackageProjectUrl>https://github.com/Adyen/adyen-dotnet-api-library</PackageProjectUrl>
<RepositoryUrl>https://github.com/Adyen/adyen-dotnet-api-library</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>3.2.0</PackageTags>
<PackageTags>3.2.1</PackageTags>
<PackageLicenseUrl>https://github.com/Adyen/adyen-dotnet-api-library/blob/master/LICENSE</PackageLicenseUrl>
<Authors>Adyen</Authors>
<Company>Adyen</Company>
Expand Down
2 changes: 1 addition & 1 deletion Adyen/Constants/ClientConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public class ClientConfig
public static string BinLookupApiVersion = "v50";

public static string LibName = "adyen-dotnet-api-library";
public static string LibVersion = "3.2.0";
public static string LibVersion = "3.2.1";
}
}
146 changes: 75 additions & 71 deletions Adyen/Model/BinLookup/ThreeDSAvailabilityRequest.cs
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;

namespace Adyen.Model.BinLookup {
namespace Adyen.Model.BinLookup
{

/// <summary>
///
/// </summary>
[DataContract]
public class ThreeDSAvailabilityRequest {
/// <summary>
/// This field contains additional data, which may be required for a particular request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).
/// ThreeDSAvailabilityRequest
/// </summary>
/// <value>This field contains additional data, which may be required for a particular request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).</value>
[DataMember(Name="additionalData", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "additionalData")]
public Object AdditionalData { get; set; }
[DataContract]
public class ThreeDSAvailabilityRequest
{

/// <summary>
/// List of brands.
/// </summary>
/// <value>List of brands.</value>
[DataMember(Name="brands", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "brands")]
public List<string> Brands { get; set; }
/// <summary>
/// This field contains additional data, which may be required for a particular request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).
/// </summary>
/// <value>This field contains additional data, which may be required for a particular request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).</value>
[DataMember(Name = "additionalData", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "additionalData")]
public Dictionary<string, string> AdditionalData { get; set; }

/// <summary>
/// Card number or BIN.
/// </summary>
/// <value>Card number or BIN.</value>
[DataMember(Name="cardNumber", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "cardNumber")]
public string CardNumber { get; set; }
/// <summary>
/// List of brands.
/// </summary>
/// <value>List of brands.</value>
[DataMember(Name = "brands", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "brands")]
public List<string> Brands { get; set; }

/// <summary>
/// The merchant account identifier.
/// </summary>
/// <value>The merchant account identifier.</value>
[DataMember(Name="merchantAccount", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "merchantAccount")]
public string MerchantAccount { get; set; }
/// <summary>
/// Card number or BIN.
/// </summary>
/// <value>Card number or BIN.</value>
[DataMember(Name = "cardNumber", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "cardNumber")]
public string CardNumber { get; set; }

/// <summary>
/// A recurring detail reference corresponding to a card.
/// </summary>
/// <value>A recurring detail reference corresponding to a card.</value>
[DataMember(Name="recurringDetailReference", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "recurringDetailReference")]
public string RecurringDetailReference { get; set; }
/// <summary>
/// The merchant account identifier.
/// </summary>
/// <value>The merchant account identifier.</value>
[DataMember(Name = "merchantAccount", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "merchantAccount")]
public string MerchantAccount { get; set; }

/// <summary>
/// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).
/// </summary>
/// <value>The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).</value>
[DataMember(Name="shopperReference", EmitDefaultValue=false)]
[JsonProperty(PropertyName = "shopperReference")]
public string ShopperReference { get; set; }
/// <summary>
/// A recurring detail reference corresponding to a card.
/// </summary>
/// <value>A recurring detail reference corresponding to a card.</value>
[DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "recurringDetailReference")]
public string RecurringDetailReference { get; set; }

/// <summary>
/// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).
/// </summary>
/// <value>The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).</value>
[DataMember(Name = "shopperReference", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "shopperReference")]
public string ShopperReference { get; set; }

/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString() {
var sb = new StringBuilder();
sb.Append("class ThreeDSAvailabilityRequest {\n");
sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n");
sb.Append(" Brands: ").Append(Brands).Append("\n");
sb.Append(" CardNumber: ").Append(CardNumber).Append("\n");
sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n");
sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n");
sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson() {
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Get the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ThreeDSAvailabilityRequest {\n");
sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n");
sb.Append(" Brands: ").Append(Brands).Append("\n");
sb.Append(" CardNumber: ").Append(CardNumber).Append("\n");
sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n");
sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n");
sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

}
/// <summary>
/// Get the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}

}
}
Loading

0 comments on commit 8cc96e5

Please sign in to comment.