diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 29677059a..f1fb42139 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @Aleffio @AlexandrosMor @martinsrenato @msilvagarcia @rikterbeek @deepu105
+* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek @deepu105
diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj
index 35ea9b359..235026765 100644
--- a/Adyen.Test/Adyen.Test.csproj
+++ b/Adyen.Test/Adyen.Test.csproj
@@ -5,11 +5,11 @@
false
- 7.1.0
+ 7.2.0
- 7.1.0
+ 7.2.0
- 7.1.0
+ 7.2.0
7.2
@@ -33,12 +33,12 @@
-
+
-
+
-
+
diff --git a/Adyen.Test/ApplePayDeserializationTest.cs b/Adyen.Test/ApplePayDeserializationTest.cs
deleted file mode 100644
index e79a4f72b..000000000
--- a/Adyen.Test/ApplePayDeserializationTest.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-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(response);
-
- Assert.IsNotNull(paymentMethod);
- Assert.AreEqual("applepay", paymentMethod.Type);
- Assert.AreEqual("VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...", paymentMethod.ApplePayToken);
- }
- }
-}
\ No newline at end of file
diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/BaseTest.cs
index f9f801c17..4c1454cc1 100644
--- a/Adyen.Test/BaseTest.cs
+++ b/Adyen.Test/BaseTest.cs
@@ -152,53 +152,8 @@ public Model.Checkout.PaymentRequest CreatePaymentRequestCheckout()
paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith");
return paymentsRequest;
}
-
- ///
- /// Check out Apple Pay payment request
- ///
- ///
- public Model.Checkout.PaymentRequest CreateApplePayPaymentRequestCheckout()
- {
- var amount = new Model.Checkout.Amount("USD", 1000);
- var applePay = new Model.Checkout.DefaultPaymentMethodDetails()
- {
- Type = "applepay",
- ApplePayToken = "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."
- };
- var paymentsRequest = new Model.Checkout.PaymentRequest
- {
- Amount = amount,
- Reference = "Your order number ",
- ReturnUrl = @"https://your-company.com/...",
- MerchantAccount = "MerchantAccount",
- PaymentMethod = applePay
- };
- return paymentsRequest;
- }
-
- ///
- /// Check out Google Pay payment request
- ///
- ///
- public Model.Checkout.PaymentRequest CreateGooglePayPaymentRequestCheckout()
- {
- var amount = new Model.Checkout.Amount("USD", 1000);
- var googlePay = new Model.Checkout.DefaultPaymentMethodDetails()
- {
- Type = "paywithgoogle",
- GooglePayToken = "==Payload as retrieved from Google Pay response=="
- };
- var paymentsRequest = new Model.Checkout.PaymentRequest
- {
- Amount = amount,
- Reference = "Your order number ",
- ReturnUrl = @"https://your-company.com/...",
- MerchantAccount = "MerchantAccount",
- PaymentMethod = googlePay
- };
- return paymentsRequest;
- }
-
+
+
///
/// 3DS2 payments request
///
diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs
index 6a39dbf87..adad28d8b 100644
--- a/Adyen.Test/CheckoutTest.cs
+++ b/Adyen.Test/CheckoutTest.cs
@@ -128,36 +128,6 @@ public async Task PaymentsAsyncAdditionalDataParsingTest()
Assert.AreEqual("NL", paymentResponse.AdditionalData["cardIssuingCountry"]);
}
- ///
- /// Test success flow for Apple Pay
- /// POST /payments
- ///
- [TestMethod]
- public void PaymentsApplePayTest()
- {
- var paymentRequest = CreateApplePayPaymentRequestCheckout();
- var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/payments-applepay-success.json");
- var checkout = new Checkout(client);
- var paymentResponse = checkout.Payments(paymentRequest);
- Assert.AreEqual("9035798957043214", paymentResponse.PspReference);
- Assert.AreEqual(ResultCodeEnum.Authorised, paymentResponse.ResultCode);
- }
-
- ///
- /// Test success flow for Google Pay
- /// POST /payments
- ///
- [TestMethod]
- public void PaymentsGooglePayTest()
- {
- var paymentRequest = CreateGooglePayPaymentRequestCheckout();
- var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/payments-googlepay-success.json");
- var checkout = new Checkout(client);
- var paymentResponse = checkout.Payments(paymentRequest);
- Assert.AreEqual("9035798960987345", paymentResponse.PspReference);
- Assert.AreEqual(ResultCodeEnum.Authorised, paymentResponse.ResultCode);
- }
-
///
/// Test success flow for 3DS2
/// POST /payments
diff --git a/Adyen.Test/MockPaymentData.cs b/Adyen.Test/MockPaymentData.cs
index 68438ebe1..d4bb17879 100644
--- a/Adyen.Test/MockPaymentData.cs
+++ b/Adyen.Test/MockPaymentData.cs
@@ -117,21 +117,6 @@ public static PaymentRequest3D CreateFullPaymentRequest3D()
return paymentRequest;
}
- public static Adyen.Model.Checkout.PaymentRequest CreateApplePayPaymentRequest()
- {
- var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
- {
- MerchantAccount = "MerchantAccount",
- Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"),
- PaymentMethod = new DefaultPaymentMethodDetails
- {
- Type = "applepay",
- ApplePayToken = "ApplePayToken"
- }
- };
-
- return paymentRequest;
- }
public static BrowserInfo CreateMockBrowserInfo()
{
diff --git a/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json b/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json
deleted file mode 100644
index 69fa4430b..000000000
--- a/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "type": "applepay",
- "applepay.token": "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..."
-}
\ No newline at end of file
diff --git a/Adyen.Test/Mocks/checkout/payments-applepay-success.json b/Adyen.Test/Mocks/checkout/payments-applepay-success.json
deleted file mode 100644
index 69ad5bac8..000000000
--- a/Adyen.Test/Mocks/checkout/payments-applepay-success.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "pspReference": "9035798957043214",
- "resultCode": "Authorised"
-}
\ No newline at end of file
diff --git a/Adyen.Test/Mocks/checkout/payments-googlepay-success.json b/Adyen.Test/Mocks/checkout/payments-googlepay-success.json
deleted file mode 100644
index aef83461b..000000000
--- a/Adyen.Test/Mocks/checkout/payments-googlepay-success.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "pspReference": "9035798960987345",
- "resultCode": "Authorised"
-}
\ No newline at end of file
diff --git a/Adyen.Test/Mocks/recurring/notifyShopper-success.json b/Adyen.Test/Mocks/recurring/notifyShopper-success.json
new file mode 100644
index 000000000..92c82e559
--- /dev/null
+++ b/Adyen.Test/Mocks/recurring/notifyShopper-success.json
@@ -0,0 +1,8 @@
+{
+ "displayedReference": "Example displayed reference",
+ "message": "Request processed successfully",
+ "pspReference": "8516167336214570",
+ "reference": "Example reference",
+ "resultCode": "Success",
+ "shopperNotificationReference": "IA0F7500002462"
+}
\ No newline at end of file
diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/RecurringTest.cs
index b28e9b830..6f2dc67b6 100644
--- a/Adyen.Test/RecurringTest.cs
+++ b/Adyen.Test/RecurringTest.cs
@@ -22,25 +22,23 @@
#endregion
using System;
-using Adyen.HttpClient;
using Adyen.Model.Enum;
using Adyen.Model.Recurring;
using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.Linq;
using Recurring = Adyen.Model.Recurring.Recurring;
using System.Threading.Tasks;
namespace Adyen.Test
{
[TestClass]
- public class RecurringTest:BaseTest
+ public class RecurringTest : BaseTest
{
[TestMethod]
public void TestListRecurringDetails()
{
var client = base.CreateMockTestClientNullRequiredFieldsRequest("Mocks/recurring/listRecurringDetails-success.json");
- var recurring=new Service.Recurring(client);
+ var recurring = new Service.Recurring(client);
var recurringDetailsRequest = this.CreateRecurringDetailsRequest();
var recurringDetailsResult = recurring.ListRecurringDetails(recurringDetailsRequest);
Assert.AreEqual(1L, (long)recurringDetailsResult.Details.Count);
@@ -71,7 +69,6 @@ public void TestDisable()
var recurring = new Service.Recurring(client);
var disableRequest = this.CreateDisableRequest();
var disableResult = recurring.Disable(disableRequest);
- Assert.AreEqual(1L, (long)disableResult.Details.Count);
Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response);
}
@@ -82,7 +79,6 @@ public async Task TestDisableAsync()
var recurring = new Service.Recurring(client);
var disableRequest = this.CreateDisableRequest();
var disableResult = await recurring.DisableAsync(disableRequest);
- Assert.AreEqual(1L, (long)disableResult.Details.Count);
Assert.AreEqual("[detail-successfully-disabled]", disableResult.Response);
}
@@ -91,7 +87,7 @@ public void TestDisable803()
{
try
{
- var client = base.CreateMockTestClientForErrors(422,"Mocks/recurring/disable-error-803.json");
+ var client = base.CreateMockTestClientForErrors(422, "Mocks/recurring/disable-error-803.json");
var recurring = new Service.Recurring(client);
var disableRequest = this.CreateDisableRequest();
@@ -101,9 +97,25 @@ public void TestDisable803()
catch (Exception exception)
{
Assert.AreNotEqual(200, exception);
-
+
}
-
+
+ }
+
+ [TestMethod]
+ public void NotifyShopperTest()
+ {
+ Client client = base.CreateMockTestClientNullRequiredFieldsRequest("Mocks/recurring/notifyShopper-success.json");
+ var recurring = new Service.Recurring(client);
+ NotifyShopperRequest request = CreateNotifyShopperRequest();
+ NotifyShopperResult result = recurring.NotifyShopper(request);
+ Assert.IsNotNull(result);
+ Assert.AreEqual("Example displayed reference", result.DisplayedReference);
+ Assert.AreEqual("8516167336214570", result.PspReference);
+ Assert.AreEqual("Request processed successfully", result.Message);
+ Assert.AreEqual("Example reference", result.Reference);
+ Assert.AreEqual("Success", result.ResultCode);
+ Assert.AreEqual("IA0F7500002462", result.ShopperNotificationReference);
}
private RecurringDetailsRequest CreateRecurringDetailsRequest()
@@ -111,8 +123,7 @@ private RecurringDetailsRequest CreateRecurringDetailsRequest()
var request = new RecurringDetailsRequest
{
ShopperReference = "test-123",
- MerchantAccount = "DotNetAlexandros",
- Recurring = new Recurring { Contract = Contract.Oneclick }
+ MerchantAccount = "DotNetAlexandros"
};
return request;
}
@@ -127,5 +138,17 @@ private DisableRequest CreateDisableRequest()
return request;
}
+ private NotifyShopperRequest CreateNotifyShopperRequest()
+ {
+ return new NotifyShopperRequest
+ {
+ MerchantAccount = "TestMerchant",
+ RecurringDetailReference = "8316158654144897",
+ Reference = "Example reference",
+ ShopperReference = "1234567",
+ BillingDate = "2021-03-31",
+ DisplayedReference = "Example displayed reference"
+ };
+ }
}
}
diff --git a/Adyen.Test/SaleToAcquirerDataTest.cs b/Adyen.Test/SaleToAcquirerDataTest.cs
index a329cfaa0..f5e3b7dab 100644
--- a/Adyen.Test/SaleToAcquirerDataTest.cs
+++ b/Adyen.Test/SaleToAcquirerDataTest.cs
@@ -39,7 +39,7 @@ public void SerializationTest()
{
SaleToAcquirerData saleToAcquirerData = new SaleToAcquirerData
{
- Metadata = new Dictionary { { "key", "value" } },
+ Metadata = new SortedDictionary { { "key", "value" } },
ShopperEmail = "myemail@mail.com",
ShopperReference = "13164308",
RecurringContract = "RECURRING,ONECLICK",
diff --git a/Adyen.Test/TerminalCommonNameValidatorTest.cs b/Adyen.Test/TerminalCommonNameValidatorTest.cs
index 2bad1d17c..85621dda8 100644
--- a/Adyen.Test/TerminalCommonNameValidatorTest.cs
+++ b/Adyen.Test/TerminalCommonNameValidatorTest.cs
@@ -34,11 +34,11 @@ public void TerminalCertificateCommonNameTest()
{
foreach (var terminalCNValidationParameter in GetTerminalCNValidationParameters())
{
- bool result = Security.TerminalCommonNameValidator.ValidateCertificate(terminalCNValidationParameter.CommonName, terminalCNValidationParameter.Environment);
- Assert.AreEqual(result, terminalCNValidationParameter.TestSuccess);
+ bool result = Security.TerminalCommonNameValidator.ValidateCertificate(terminalCNValidationParameter.CommonName, terminalCNValidationParameter.Environment);
+ Assert.AreEqual(result, terminalCNValidationParameter.TestSuccess);
}
}
-
+
private List GetTerminalCNValidationParameters()
{
return new List
@@ -48,12 +48,17 @@ private List GetTerminalCNValidationParameters()
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=legacy-terminal-certificate.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, true ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=P400-123456789.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, true ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=P400-123456789.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, true ),
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-000150123456789.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, true ),
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-000150123456789.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, true ),
// Wrong environment
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=legacy-terminal-certificate.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=P400-123456789.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=legacy-terminal-certificate.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=P400-123456789.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false),
- // Invalid CN
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-000150123456789.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, false ),
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-000150123456789.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
+
+ // Invalid CN
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=wrong-terminal-certificate.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=legacyy-terminal-certificate.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=legacy-terminaal-certificate.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
@@ -67,6 +72,9 @@ private List GetTerminalCNValidationParameters()
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=-123.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=www.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=ANY, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-0001501234567891.test.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false ),
+ new TerminalCNValidationParameters ( "EMAILADDRESS=mock@adyen.com, CN=S1E-0001501234567891.live.terminal.adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Live, false ),
+
// Missing CN
new TerminalCNValidationParameters( "EMAILADDRESS=mock@adyen.com, OU=Mock, O=Mock, L=Mock, ST=MO, C=MO", Adyen.Model.Enum.Environment.Test, false )
};
diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj
index fbdd8e368..e97b5dd9b 100644
--- a/Adyen/Adyen.csproj
+++ b/Adyen/Adyen.csproj
@@ -4,15 +4,15 @@
netstandard2.0
false
Adyen
- 7.1.0
- 7.1.0
- 7.1.0
+ 7.2.0
+ 7.2.0
+ 7.2.0
true
The Adyen API Library for .net core enables you to work with Adyen APIs, Hosted Payment Pages and terminal api with any .net application.
https://github.com/Adyen/adyen-dotnet-api-library
https://github.com/Adyen/adyen-dotnet-api-library
git
- 7.1.0
+ 7.2.0
MIT
Adyen
Adyen
diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs
index f7e80bf09..876d319ae 100644
--- a/Adyen/Constants/ClientConfig.cs
+++ b/Adyen/Constants/ClientConfig.cs
@@ -41,7 +41,7 @@ public class ClientConfig
public static string MarketPayFundApiVersion = "v5";
public static string MarketPayAccountApiVersion = "v5";
public static string HopApiVersion = "v1";
- public static string RecurringApiVersion = "v25";
+ public static string RecurringApiVersion = "v49";
public static string ApiVersion = "v51";
public static string PayoutApiVersion = "v51";
public static string CheckoutApiVersion = "v67";
@@ -53,6 +53,6 @@ public class ClientConfig
public static string BinLookupApiVersion = "v50";
public static string LibName = "adyen-dotnet-api-library";
- public static string LibVersion = "7.1.0";
+ public static string LibVersion = "7.2.0";
}
}
diff --git a/Adyen/Model/BinLookup/Recurring.cs b/Adyen/Model/BinLookup/Recurring.cs
index cd318673d..d5e298396 100644
--- a/Adyen/Model/BinLookup/Recurring.cs
+++ b/Adyen/Model/BinLookup/Recurring.cs
@@ -1,24 +1,24 @@
#region License
-// /*
-// * ######
-// * ######
-// * ############ ####( ###### #####. ###### ############ ############
-// * ############# #####( ###### #####. ###### ############# #############
-// * ###### #####( ###### #####. ###### ##### ###### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ######
-// * ############# ############# ############# ############# ##### ######
-// * ############ ############ ############# ############ ##### ######
-// * ######
-// * #############
-// * ############
-// *
-// * Adyen Dotnet API Library
-// *
-// * Copyright (c) 2020 Adyen B.V.
-// * This file is open source and available under the MIT license.
-// * See the LICENSE file for more info.
-// */
+ /*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
#endregion
using System;
diff --git a/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs b/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs
index 6ba297296..2938aad23 100644
--- a/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs
+++ b/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs
@@ -80,10 +80,7 @@ public class DefaultPaymentMethodDetails : IValidatableObject, IPaymentMethodDet
public string SepaIbanNumber { get; set; }
[DataMember(Name = "bankAccount", EmitDefaultValue = false)]
public BankAccount BankAccount { get; set; }
- [DataMember(Name = "applepay.token", EmitDefaultValue = false)]
- public string ApplePayToken { get; set; }
- [DataMember(Name = "paywithgoogle.token", EmitDefaultValue = false)]
- public string GooglePayToken { get; set; }
+
public override string ToString()
{
@@ -112,8 +109,6 @@ public override string ToString()
sb.Append(" SepaOwnerName: ").Append(SepaOwnerName).Append("\n");
sb.Append(" SepaIbanNumber: ").Append(SepaIbanNumber).Append("\n");
sb.Append(" BankAccount: ").Append(BankAccount).Append("\n");
- sb.Append(" ApplePayToken: ").Append(BankAccount).Append("\n");
- sb.Append(" GooglePayToken: ").Append(BankAccount).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@@ -254,16 +249,6 @@ public bool Equals(DefaultPaymentMethodDetails input)
this.BankAccount == input.BankAccount ||
(this.BankAccount != null &&
this.BankAccount.Equals(input.BankAccount))
- ) &&
- (
- this.ApplePayToken == input.ApplePayToken ||
- (this.ApplePayToken != null &&
- this.ApplePayToken.Equals(input.ApplePayToken))
- ) &&
- (
- this.GooglePayToken == input.GooglePayToken ||
- (this.GooglePayToken != null &&
- this.GooglePayToken.Equals(input.GooglePayToken))
);
}
@@ -332,10 +317,6 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.BankAccount.GetHashCode();
if (this.Issuer != null)
hashCode = hashCode * 59 + this.Issuer.GetHashCode();
- if (this.ApplePayToken != null)
- hashCode = hashCode * 59 + this.ApplePayToken.GetHashCode();
- if (this.GooglePayToken != null)
- hashCode = hashCode * 59 + this.GooglePayToken.GetHashCode();
return hashCode;
}
diff --git a/Adyen/Model/Checkout/Details/PayPalDetails.cs b/Adyen/Model/Checkout/Details/PayPalDetails.cs
index 55f5c8bfe..b19ec29e1 100644
--- a/Adyen/Model/Checkout/Details/PayPalDetails.cs
+++ b/Adyen/Model/Checkout/Details/PayPalDetails.cs
@@ -42,7 +42,7 @@ public enum SubtypeEnum
/// Enum SDK for value: SDK
///
[EnumMember(Value = "sdk")]
- SDK = 1,
+ SDK = 0,
///
/// Enum SDK for value: SDK
diff --git a/Adyen/Model/Checkout/Mandate.cs b/Adyen/Model/Checkout/Mandate.cs
new file mode 100644
index 000000000..09bbc79eb
--- /dev/null
+++ b/Adyen/Model/Checkout/Mandate.cs
@@ -0,0 +1,128 @@
+#region Licence
+//
+// ######
+// ######
+// ############ ####( ###### #####. ###### ############ ############
+// ############# #####( ###### #####. ###### ############# #############
+// ###### #####( ###### #####. ###### ##### ###### ##### ######
+// ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+// ###### ###### #####( ###### #####. ###### ##### ##### ######
+// ############# ############# ############# ############# ##### ######
+// ############ ############ ############# ############ ##### ######
+// ######
+// #############
+// ############
+//
+// Adyen Dotnet API Library
+//
+// Copyright (c) 2021 Adyen B.V.
+// This file is open source and available under the MIT license.
+// See the LICENSE file for more info.
+#endregion
+
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+
+namespace Adyen.Model.Checkout
+{///
+ ///
+ ///
+ [DataContract]
+ public class Mandate
+ {
+ ///
+ /// The billing amount of the recurring transactions.
+ ///
+ /// The billing amount of the recurring transactions.
+ [DataMember(Name = "amount", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "amount")]
+ public string Amount { get; set; }
+
+ ///
+ /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`.
+ ///
+ /// The limitation rule of the billing amount. Possible values: * **max**: The transaction amount can not exceed the `amount`. * **exact**: The transaction amount should be the same as the `amount`.
+ [DataMember(Name = "amountRule", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "amountRule")]
+ public string AmountRule { get; set; }
+
+ ///
+ /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date.
+ ///
+ /// The rule to specify the period, within which the recurring debit can happen, relative to the mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and on a specific date. * **after**: On and after a specific date.
+ [DataMember(Name = "billingAttemptsRule", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "billingAttemptsRule")]
+ public string BillingAttemptsRule { get; set; }
+
+ ///
+ /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`.
+ ///
+ /// The number of the day, on which the recurring debit can happen. Should be within the same calendar month as the mandate recurring date. Possible values: 1-31 based on the `frequency`.
+ [DataMember(Name = "billingDay", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "billingDay")]
+ public string BillingDay { get; set; }
+
+ ///
+ /// End date of the billing plan, in YYYY-MM-DD format.
+ ///
+ /// End date of the billing plan, in YYYY-MM-DD format.
+ [DataMember(Name = "endsAt", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "endsAt")]
+ public string EndsAt { get; set; }
+
+ ///
+ /// The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.
+ ///
+ /// The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**.
+ [DataMember(Name = "frequency", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "frequency")]
+ public string Frequency { get; set; }
+
+ ///
+ /// The message shown by UPI to the shopper on the approval screen.
+ ///
+ /// The message shown by UPI to the shopper on the approval screen.
+ [DataMember(Name = "remarks", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "remarks")]
+ public string Remarks { get; set; }
+
+ ///
+ /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.
+ ///
+ /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.
+ [DataMember(Name = "startsAt", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "startsAt")]
+ public string StartsAt { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Mandate {\n");
+ sb.Append(" Amount: ").Append(Amount).Append("\n");
+ sb.Append(" AmountRule: ").Append(AmountRule).Append("\n");
+ sb.Append(" BillingAttemptsRule: ").Append(BillingAttemptsRule).Append("\n");
+ sb.Append(" BillingDay: ").Append(BillingDay).Append("\n");
+ sb.Append(" EndsAt: ").Append(EndsAt).Append("\n");
+ sb.Append(" Frequency: ").Append(Frequency).Append("\n");
+ sb.Append(" Remarks: ").Append(Remarks).Append("\n");
+ sb.Append(" StartsAt: ").Append(StartsAt).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+ }
+}
diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs
index 7e730ebb6..ad633d506 100644
--- a/Adyen/Model/Checkout/PaymentDetailsResponse.cs
+++ b/Adyen/Model/Checkout/PaymentDetailsResponse.cs
@@ -122,6 +122,7 @@ public enum ResultCodeEnum
/// amount.
/// Donation Token containing payment details for Adyen Giving..
/// fraudResult.
+ /// Unique merchant reference for the payment.
/// order.
/// The payment method used in the transaction..
/// Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request..
@@ -130,12 +131,13 @@ public enum ResultCodeEnum
/// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state..
/// The shopperLocale..
/// threeDS2Result.
- public PaymentDetailsResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), CheckoutOrderResponse order = default(CheckoutOrderResponse), string paymentMethod = default(string), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), string shopperLocale = default(string), ThreeDS2Result threeDS2Result = default(ThreeDS2Result))
+ public PaymentDetailsResponse(Dictionary additionalData = default(Dictionary), Amount amount = default(Amount), string donationToken = default(string), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), CheckoutOrderResponse order = default(CheckoutOrderResponse), string paymentMethod = default(string), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), string shopperLocale = default(string), ThreeDS2Result threeDS2Result = default(ThreeDS2Result))
{
this.AdditionalData = additionalData;
this.Amount = amount;
this.DonationToken = donationToken;
this.FraudResult = fraudResult;
+ this.MerchantReference = merchantReference;
this.Order = order;
this.PaymentMethod = paymentMethod;
this.PspReference = pspReference;
@@ -178,6 +180,13 @@ public enum ResultCodeEnum
[DataMember(Name = "order", EmitDefaultValue = false)]
public CheckoutOrderResponse Order { get; set; }
+ ///
+ /// A unique value that you provided in the initial `/payments` request.
+ ///
+ /// A unique value that you provided in the initial `/payments` request.
+ [DataMember(Name = "merchantReference", EmitDefaultValue = false)]
+ public string MerchantReference { get; set; }
+
///
/// The payment method used in the transaction.
///
@@ -232,6 +241,7 @@ public override string ToString()
sb.Append(" Amount: ").Append(Amount).Append("\n");
sb.Append(" DonationToken: ").Append(DonationToken).Append("\n");
sb.Append(" FraudResult: ").Append(FraudResult).Append("\n");
+ sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n");
sb.Append(" Order: ").Append(Order).Append("\n");
sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n");
sb.Append(" PspReference: ").Append(PspReference).Append("\n");
@@ -294,6 +304,11 @@ public bool Equals(PaymentDetailsResponse input)
this.FraudResult == input.FraudResult ||
(this.FraudResult != null &&
this.FraudResult.Equals(input.FraudResult))
+ ) &&
+ (
+ this.MerchantReference == input.MerchantReference ||
+ (this.MerchantReference != null &&
+ this.MerchantReference.Equals(input.MerchantReference))
) &&
(
this.Order == input.Order ||
@@ -352,6 +367,8 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Amount.GetHashCode();
if (this.DonationToken != null)
hashCode = hashCode * 59 + this.DonationToken.GetHashCode();
+ if (this.MerchantReference != null)
+ hashCode = hashCode * 59 + this.MerchantReference.GetHashCode();
if (this.FraudResult != null)
hashCode = hashCode * 59 + this.FraudResult.GetHashCode();
if (this.Order != null)
diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs
index 743b2b80a..81568f6d9 100644
--- a/Adyen/Model/Checkout/PaymentRequest.cs
+++ b/Adyen/Model/Checkout/PaymentRequest.cs
@@ -1,5 +1,4 @@
#region Licence
-
//
// ######
// ######
@@ -16,10 +15,9 @@
//
// Adyen Dotnet API Library
//
-// Copyright (c) 2020 Adyen B.V.
+// Copyright (c) 2021 Adyen B.V.
// This file is open source and available under the MIT license.
// See the LICENSE file for more info.
-
#endregion
using System;
@@ -244,7 +242,7 @@ public PaymentRequest()
bool? enableOneClick = default(bool?), bool? enablePayOut = default(bool?),
bool? enableRecurring = default(bool?), EntityTypeEnum? entityType = default(EntityTypeEnum?),
int? fraudOffset = default(int?), Installments installments = default(Installments),
- List lineItems = default(List), string mcc = default(string),
+ List lineItems = default(List), Mandate mandate = default(Mandate), string mcc = default(string),
string merchantAccount = default(string), string merchantOrderReference = default(string),
MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator),
Dictionary metadata = default(Dictionary),
@@ -338,6 +336,7 @@ public PaymentRequest()
this.FraudOffset = fraudOffset;
this.Installments = installments;
this.LineItems = lineItems;
+ this.Mandate = mandate;
this.Mcc = mcc;
this.MerchantOrderReference = merchantOrderReference;
this.MerchantRiskIndicator = merchantRiskIndicator;
@@ -739,6 +738,13 @@ public PaymentRequest()
[DataMember(Name = "trustedShopper", EmitDefaultValue = false)]
public bool? TrustedShopper { get; set; }
+ ///
+ /// Gets or Sets Mandate
+ ///
+ [DataMember(Name = "mandate", EmitDefaultValue = false)]
+ public Mandate Mandate { get; set; }
+
+
public void AddCardData(string cardNumber, string expiryMonth, string expiryYear, string securityCode, string holderName)
{
var defaultPaymentMethodDetails = new DefaultPaymentMethodDetails
@@ -799,6 +805,7 @@ public override string ToString()
sb.Append(" FraudOffset: ").Append(FraudOffset).Append("\n");
sb.Append(" Installments: ").Append(Installments).Append("\n");
sb.Append(" LineItems: ").Append(LineItems).Append("\n");
+ sb.Append(" Mandate: ").Append(Mandate).Append("\n");
sb.Append(" Mcc: ").Append(Mcc).Append("\n");
sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n");
sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n");
@@ -982,6 +989,11 @@ public bool Equals(PaymentRequest input)
this.LineItems != null &&
input.LineItems != null &&
this.LineItems.SequenceEqual(input.LineItems)
+ ) &&
+ (
+ this.Mandate == input.Mandate ||
+ this.Mandate != null &&
+ this.Mandate.Equals(input.Mandate)
) &&
(
this.Mcc == input.Mcc ||
@@ -1212,6 +1224,8 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Installments.GetHashCode();
if (this.LineItems != null)
hashCode = hashCode * 59 + this.LineItems.GetHashCode();
+ if (this.Mandate != null)
+ hashCode = hashCode * 59 + this.Mandate.GetHashCode();
if (this.Mcc != null)
hashCode = hashCode * 59 + this.Mcc.GetHashCode();
if (this.MerchantAccount != null)
diff --git a/Adyen/Model/MarketPay/Account.cs b/Adyen/Model/MarketPay/Account.cs
index e94c704fa..c29b891f8 100644
--- a/Adyen/Model/MarketPay/Account.cs
+++ b/Adyen/Model/MarketPay/Account.cs
@@ -34,75 +34,102 @@ namespace Adyen.Model.MarketPay
/// Account
///
[DataContract]
- public partial class Account : IEquatable, IValidatableObject
+ public partial class Account : IEquatable, IValidatableObject
{
///
/// Initializes a new instance of the class.
///
/// The code of the account..
+ /// The bankAccountUUID of the bank account held by the account holder to couple the account with.
/// The beneficiary of the account..
/// The reason that a beneficiary has been set up for this account. This may have been supplied during the setup of a beneficiary at the discretion of the executing user..
/// A description of the account..
/// A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs..
+ /// The payout method code held by the account holder to couple the account with. Scheduled card payouts will be sent using this payout method code.
/// payoutSchedule.
+ /// Speed with which payouts for this account are processed. Permitted values: STANDARD, SAME_DAY.
/// The status of the account. Possible values: `Active`, `Inactive`, `Suspended`, `Closed`..
- public Account(string accountCode = default(string), string beneficiaryAccount = default(string), string beneficiaryMerchantReference = default(string), string description = default(string), Object metadata = default(Object), PayoutScheduleResponse payoutSchedule = default(PayoutScheduleResponse), string status = default(string))
+ public Account(string accountCode = default(string), string bankAccountUUID = default(string), string beneficiaryAccount = default(string), string beneficiaryMerchantReference = default(string), string description = default(string), Object metadata = default(Object), string payoutMethodCode = default(string), PayoutScheduleResponse payoutSchedule = default(PayoutScheduleResponse), string payoutSpeed = default(string), string status = default(string))
{
this.AccountCode = accountCode;
+ this.BankAccountUUID = bankAccountUUID;
this.BeneficiaryAccount = beneficiaryAccount;
this.BeneficiaryMerchantReference = beneficiaryMerchantReference;
this.Description = description;
this.Metadata = metadata;
+ this.PayoutMethodCode = payoutMethodCode;
this.PayoutSchedule = payoutSchedule;
+ this.PayoutSpeed = payoutSpeed;
this.Status = status;
}
-
+
///
/// The code of the account.
///
/// The code of the account.
- [DataMember(Name="accountCode", EmitDefaultValue=false)]
+ [DataMember(Name = "accountCode", EmitDefaultValue = false)]
public string AccountCode { get; set; }
+ ///
+ /// The bankAccountUUID of the bank account held by the account holder to couple the account with. Scheduled payouts in currencies matching the currency of this bank account will be sent to this bank account. Payouts in different currencies will be sent to a matching bank account of the account holder.
+ ///
+ /// The bankAccountUUID of the bank account held by the account holder to couple the account with. Scheduled payouts in currencies matching the currency of this bank account will be sent to this bank account. Payouts in different currencies will be sent to a matching bank account of the account holder.
+ [DataMember(Name = "bankAccountUUID", EmitDefaultValue = false)]
+ public string BankAccountUUID { get; set; }
+
///
/// The beneficiary of the account.
///
/// The beneficiary of the account.
- [DataMember(Name="beneficiaryAccount", EmitDefaultValue=false)]
+ [DataMember(Name = "beneficiaryAccount", EmitDefaultValue = false)]
public string BeneficiaryAccount { get; set; }
///
/// The reason that a beneficiary has been set up for this account. This may have been supplied during the setup of a beneficiary at the discretion of the executing user.
///
/// The reason that a beneficiary has been set up for this account. This may have been supplied during the setup of a beneficiary at the discretion of the executing user.
- [DataMember(Name="beneficiaryMerchantReference", EmitDefaultValue=false)]
+ [DataMember(Name = "beneficiaryMerchantReference", EmitDefaultValue = false)]
public string BeneficiaryMerchantReference { get; set; }
///
/// A description of the account.
///
/// A description of the account.
- [DataMember(Name="description", EmitDefaultValue=false)]
+ [DataMember(Name = "description", EmitDefaultValue = false)]
public string Description { get; set; }
///
/// A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
///
/// A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
- [DataMember(Name="metadata", EmitDefaultValue=false)]
+ [DataMember(Name = "metadata", EmitDefaultValue = false)]
public Object Metadata { get; set; }
+ ///
+ /// The payout method code held by the account holder to couple the account with. Scheduled card payouts will be sent using this payout method code.
+ ///
+ /// The payout method code held by the account holder to couple the account with. Scheduled card payouts will be sent using this payout method code.
+ [DataMember(Name = "payoutMethodCode", EmitDefaultValue = false)]
+ public string PayoutMethodCode { get; set; }
+
///
/// Gets or Sets PayoutSchedule
///
- [DataMember(Name="payoutSchedule", EmitDefaultValue=false)]
+ [DataMember(Name = "payoutSchedule", EmitDefaultValue = false)]
public PayoutScheduleResponse PayoutSchedule { get; set; }
+ ///
+ /// Speed with which payouts for this account are processed. Permitted values: STANDARD, SAME_DAY.
+ ///
+ /// Speed with which payouts for this account are processed. Permitted values: STANDARD, SAME_DAY.
+ [DataMember(Name = "payoutSpeed", EmitDefaultValue = false)]
+ public string PayoutSpeed { get; set; }
+
///
/// The status of the account. Possible values: `Active`, `Inactive`, `Suspended`, `Closed`.
///
/// The status of the account. Possible values: `Active`, `Inactive`, `Suspended`, `Closed`.
- [DataMember(Name="status", EmitDefaultValue=false)]
+ [DataMember(Name = "status", EmitDefaultValue = false)]
public string Status { get; set; }
///
@@ -114,16 +141,19 @@ public override string ToString()
var sb = new StringBuilder();
sb.Append("class Account {\n");
sb.Append(" AccountCode: ").Append(AccountCode).Append("\n");
+ sb.Append(" BankAccountUUID: ").Append(BankAccountUUID).Append("\n");
sb.Append(" BeneficiaryAccount: ").Append(BeneficiaryAccount).Append("\n");
sb.Append(" BeneficiaryMerchantReference: ").Append(BeneficiaryMerchantReference).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Metadata: ").Append(Metadata).Append("\n");
+ sb.Append(" PayoutMethodCode: ").Append(PayoutMethodCode).Append("\n");
sb.Append(" PayoutSchedule: ").Append(PayoutSchedule).Append("\n");
+ sb.Append(" PayoutSpeed: ").Append(PayoutSpeed).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
-
+
///
/// Returns the JSON string presentation of the object
///
@@ -153,36 +183,51 @@ public bool Equals(Account input)
if (input == null)
return false;
- return
+ return
(
this.AccountCode == input.AccountCode ||
(this.AccountCode != null &&
this.AccountCode.Equals(input.AccountCode))
- ) &&
+ ) &&
+ (
+ this.BankAccountUUID == input.BankAccountUUID ||
+ (this.BankAccountUUID != null &&
+ this.BankAccountUUID.Equals(input.BankAccountUUID))
+ ) &&
(
this.BeneficiaryAccount == input.BeneficiaryAccount ||
(this.BeneficiaryAccount != null &&
this.BeneficiaryAccount.Equals(input.BeneficiaryAccount))
- ) &&
+ ) &&
(
this.BeneficiaryMerchantReference == input.BeneficiaryMerchantReference ||
(this.BeneficiaryMerchantReference != null &&
this.BeneficiaryMerchantReference.Equals(input.BeneficiaryMerchantReference))
- ) &&
+ ) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
- ) &&
+ ) &&
(
this.Metadata == input.Metadata ||
(this.Metadata != null &&
this.Metadata.Equals(input.Metadata))
- ) &&
+ ) &&
+ (
+ this.PayoutMethodCode == input.PayoutMethodCode ||
+ (this.PayoutMethodCode != null &&
+ this.PayoutMethodCode.Equals(input.PayoutMethodCode))
+ ) &&
(
this.PayoutSchedule == input.PayoutSchedule ||
- (this.PayoutSchedule != null )
- ) &&
+ (this.PayoutSchedule != null)
+ ) &&
+ (
+ this.PayoutSpeed == input.PayoutSpeed ||
+ (this.PayoutSpeed != null &&
+ this.PayoutSpeed.Equals(input.PayoutSpeed))
+ ) &&
(
this.Status == input.Status ||
(this.Status != null &&
@@ -201,6 +246,8 @@ public override int GetHashCode()
int hashCode = 41;
if (this.AccountCode != null)
hashCode = hashCode * 59 + this.AccountCode.GetHashCode();
+ if (this.BankAccountUUID != null)
+ hashCode = hashCode * 59 + this.BankAccountUUID.GetHashCode();
if (this.BeneficiaryAccount != null)
hashCode = hashCode * 59 + this.BeneficiaryAccount.GetHashCode();
if (this.BeneficiaryMerchantReference != null)
@@ -209,8 +256,12 @@ public override int GetHashCode()
hashCode = hashCode * 59 + this.Description.GetHashCode();
if (this.Metadata != null)
hashCode = hashCode * 59 + this.Metadata.GetHashCode();
+ if (this.PayoutMethodCode != null)
+ hashCode = hashCode * 59 + this.PayoutMethodCode.GetHashCode();
if (this.PayoutSchedule != null)
hashCode = hashCode * 59 + this.PayoutSchedule.GetHashCode();
+ if (this.PayoutSpeed != null)
+ hashCode = hashCode * 59 + this.PayoutSpeed.GetHashCode();
if (this.Status != null)
hashCode = hashCode * 59 + this.Status.GetHashCode();
return hashCode;
diff --git a/Adyen/Model/Recurring/DisableResult.cs b/Adyen/Model/Recurring/DisableResult.cs
index b33445114..7110ae29a 100644
--- a/Adyen/Model/Recurring/DisableResult.cs
+++ b/Adyen/Model/Recurring/DisableResult.cs
@@ -1,24 +1,24 @@
#region License
-// /*
-// * ######
-// * ######
-// * ############ ####( ###### #####. ###### ############ ############
-// * ############# #####( ###### #####. ###### ############# #############
-// * ###### #####( ###### #####. ###### ##### ###### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ######
-// * ############# ############# ############# ############# ##### ######
-// * ############ ############ ############# ############ ##### ######
-// * ######
-// * #############
-// * ############
-// *
-// * Adyen Dotnet API Library
-// *
-// * Copyright (c) 2020 Adyen B.V.
-// * This file is open source and available under the MIT license.
-// * See the LICENSE file for more info.
-// */
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
#endregion
using System.Collections.Generic;
@@ -33,16 +33,7 @@ public class DisableResult
[DataMember(Name = "response", EmitDefaultValue = false)]
public string Response { get; set; }
- [DataMember(Name = "details", EmitDefaultValue = false)]
- public List Details { get; set; }
-
- [DataMember(Name = "shopperReference", EmitDefaultValue = false)]
- public string ShopperReference { get; set; }
-
- [DataMember(Name = "invalidOneclickContracts", EmitDefaultValue = false)]
- public string InvalidOneclickContracts { get; set; }
-
-
+
///
/// Returns the string presentation of the object
///
@@ -52,7 +43,6 @@ public override string ToString()
var sb = new StringBuilder();
sb.Append("class DisableRequest {\n");
sb.Append(" response: ").Append(Response).Append("\n");
- sb.Append(" details: ").Append(Details).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
diff --git a/Adyen/Model/Recurring/NotifyShopperRequest.cs b/Adyen/Model/Recurring/NotifyShopperRequest.cs
new file mode 100644
index 000000000..7fab50e57
--- /dev/null
+++ b/Adyen/Model/Recurring/NotifyShopperRequest.cs
@@ -0,0 +1,137 @@
+#region License
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
+#endregion
+using System.Text;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Adyen.Model.Recurring
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class NotifyShopperRequest
+ {
+ ///
+ /// Gets or Sets Amount
+ ///
+ [DataMember(Name = "amount", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "amount")]
+ public Amount Amount { get; set; }
+
+ ///
+ /// Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format
+ ///
+ /// Date on which the subscription amount will be debited from the shopper. In YYYY-MM-DD format
+ [DataMember(Name = "billingDate", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "billingDate")]
+ public string BillingDate { get; set; }
+
+ ///
+ /// Sequence of the debit. Depends on Frequency and Billing Attempts Rule.
+ ///
+ /// Sequence of the debit. Depends on Frequency and Billing Attempts Rule.
+ [DataMember(Name = "billingSequenceNumber", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "billingSequenceNumber")]
+ public string BillingSequenceNumber { get; set; }
+
+ ///
+ /// Reference of Pre-debit notification that is displayed to the shopper. Optional field. Maps to reference if missing
+ ///
+ /// Reference of Pre-debit notification that is displayed to the shopper. Optional field. Maps to reference if missing
+ [DataMember(Name = "displayedReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "displayedReference")]
+ public string DisplayedReference { get; set; }
+
+ ///
+ /// The merchant account identifier with which you want to process the transaction.
+ ///
+ /// The merchant account identifier with which you want to process the transaction.
+ [DataMember(Name = "merchantAccount", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "merchantAccount")]
+ public string MerchantAccount { get; set; }
+
+ ///
+ /// This is the `recurringDetailReference` returned in the response when you created the token.
+ ///
+ /// This is the `recurringDetailReference` returned in the response when you created the token.
+ [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "recurringDetailReference")]
+ public string RecurringDetailReference { get; set; }
+
+ ///
+ /// Pre-debit notification reference sent by the merchant. This is a mandatory field
+ ///
+ /// Pre-debit notification reference sent by the merchant. This is a mandatory field
+ [DataMember(Name = "reference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "reference")]
+ public string Reference { get; set; }
+
+ ///
+ /// The ID that uniquely identifies the shopper. This `shopperReference` must be the same as the `shopperReference` used in the initial payment.
+ ///
+ /// The ID that uniquely identifies the shopper. This `shopperReference` must be the same as the `shopperReference` used in the initial payment.
+ [DataMember(Name = "shopperReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "shopperReference")]
+ public string ShopperReference { get; set; }
+
+ ///
+ /// This is the `recurringDetailReference` returned in the response when you created the token.
+ ///
+ /// This is the `recurringDetailReference` returned in the response when you created the token.
+ [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "storedPaymentMethodId")]
+ public string StoredPaymentMethodId { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class NotifyShopperRequest {\n");
+ sb.Append(" Amount: ").Append(Amount).Append("\n");
+ sb.Append(" BillingDate: ").Append(BillingDate).Append("\n");
+ sb.Append(" BillingSequenceNumber: ").Append(BillingSequenceNumber).Append("\n");
+ sb.Append(" DisplayedReference: ").Append(DisplayedReference).Append("\n");
+ sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n");
+ sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n");
+ sb.Append(" Reference: ").Append(Reference).Append("\n");
+ sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n");
+ sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+ }
+}
diff --git a/Adyen/Model/Recurring/NotifyShopperResult.cs b/Adyen/Model/Recurring/NotifyShopperResult.cs
new file mode 100644
index 000000000..790780053
--- /dev/null
+++ b/Adyen/Model/Recurring/NotifyShopperResult.cs
@@ -0,0 +1,121 @@
+#region License
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
+#endregion
+using System.Text;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Adyen.Model.Recurring
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class NotifyShopperResult
+ {
+ ///
+ /// Reference of Pre-debit notification that is displayed to the shopper
+ ///
+ /// Reference of Pre-debit notification that is displayed to the shopper
+ [DataMember(Name = "displayedReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "displayedReference")]
+ public string DisplayedReference { get; set; }
+
+ ///
+ /// A simple description of the `resultCode`.
+ ///
+ /// A simple description of the `resultCode`.
+ [DataMember(Name = "message", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "message")]
+ public string Message { get; set; }
+
+ ///
+ /// The unique reference that is associated with the request.
+ ///
+ /// The unique reference that is associated with the request.
+ [DataMember(Name = "pspReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "pspReference")]
+ public string PspReference { get; set; }
+
+ ///
+ /// Reference of Pre-debit notification sent in my the merchant
+ ///
+ /// Reference of Pre-debit notification sent in my the merchant
+ [DataMember(Name = "reference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "reference")]
+ public string Reference { get; set; }
+
+ ///
+ /// The code indicating the status of notification.
+ ///
+ /// The code indicating the status of notification.
+ [DataMember(Name = "resultCode", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "resultCode")]
+ public string ResultCode { get; set; }
+
+ ///
+ /// The unique reference for the request sent downstream.
+ ///
+ /// The unique reference for the request sent downstream.
+ [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "shopperNotificationReference")]
+ public string ShopperNotificationReference { get; set; }
+
+ ///
+ /// This is the recurringDetailReference returned in the response when token was created
+ ///
+ /// This is the recurringDetailReference returned in the response when token was created
+ [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)]
+ [JsonProperty(PropertyName = "storedPaymentMethodId")]
+ public string StoredPaymentMethodId { get; set; }
+
+
+ ///
+ /// Get the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class NotifyShopperResult {\n");
+ sb.Append(" DisplayedReference: ").Append(DisplayedReference).Append("\n");
+ sb.Append(" Message: ").Append(Message).Append("\n");
+ sb.Append(" PspReference: ").Append(PspReference).Append("\n");
+ sb.Append(" Reference: ").Append(Reference).Append("\n");
+ sb.Append(" ResultCode: ").Append(ResultCode).Append("\n");
+ sb.Append(" ShopperNotificationReference: ").Append(ShopperNotificationReference).Append("\n");
+ sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Get the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+
+ }
+}
diff --git a/Adyen/Model/Recurring/Recurring.cs b/Adyen/Model/Recurring/Recurring.cs
index 2d6bdb2af..db0933647 100644
--- a/Adyen/Model/Recurring/Recurring.cs
+++ b/Adyen/Model/Recurring/Recurring.cs
@@ -21,8 +21,8 @@
// */
#endregion
-using Adyen.Model.Enum;
using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -35,43 +35,101 @@ namespace Adyen.Model.Recurring
/// Recurring
///
[DataContract]
- public partial class Recurring : IEquatable, IValidatableObject
+ public partial class Recurring : IEquatable, IValidatableObject
{
-
+ ///
+ /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
+ ///
+ /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum ContractEnum
+ {
+ ///
+ /// Enum ONECLICK for value: ONECLICK
+ ///
+ [EnumMember(Value = "ONECLICK")]
+ ONECLICK = 1,
+ ///
+ /// Enum RECURRING for value: RECURRING
+ ///
+ [EnumMember(Value = "RECURRING")]
+ RECURRING = 2,
+ ///
+ /// Enum PAYOUT for value: PAYOUT
+ ///
+ [EnumMember(Value = "PAYOUT")]
+ PAYOUT = 3
+ }
+ ///
+ /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
+ ///
+ /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
+ [DataMember(Name = "contract", EmitDefaultValue = false)]
+ public ContractEnum? Contract { get; set; }
///
/// The name of the token service.
///
/// The name of the token service.
- [DataMember(Name="tokenService", EmitDefaultValue=false)]
- public TokenServiceEnum? TokenService { get; set; }
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum TokenServiceEnum
+ {
+ ///
+ /// Enum VISATOKENSERVICE for value: VISATOKENSERVICE
+ ///
+ [EnumMember(Value = "VISATOKENSERVICE")]
+ VISATOKENSERVICE = 1,
+ ///
+ /// Enum MCTOKENSERVICE for value: MCTOKENSERVICE
+ ///
+ [EnumMember(Value = "MCTOKENSERVICE")]
+ MCTOKENSERVICE = 2
+ }
///
- /// The type of recurring contract to be used. Possible values: * `ONECLICK` – The shopper opts to store their card details for future use. The shopper is present for the subsequent transaction, for cards the security code (CVC/CVV) is required. * `RECURRING` – Payment details are stored for future use. For cards, the security code (CVC/CVV) is not required for subsequent payments. This is used for shopper not present transactions. * `ONECLICK, RECURRING` – Payment details are stored for future use. This allows the use of the stored payment details regardless of whether the shopper is on your site or not.
+ /// The name of the token service.
///
- /// The type of recurring contract to be used. Possible values: * `ONECLICK` – The shopper opts to store their card details for future use. The shopper is present for the subsequent transaction, for cards the security code (CVC/CVV) is required. * `RECURRING` – Payment details are stored for future use. For cards, the security code (CVC/CVV) is not required for subsequent payments. This is used for shopper not present transactions. * `ONECLICK, RECURRING` – Payment details are stored for future use. This allows the use of the stored payment details regardless of whether the shopper is on your site or not.
- [DataMember(Name="contract", EmitDefaultValue=false)]
- public Contract? Contract { get; set; }
+ /// The name of the token service.
+ [DataMember(Name = "tokenService", EmitDefaultValue = false)]
+ public TokenServiceEnum? TokenService { get; set; }
///
/// Initializes a new instance of the class.
///
- /// The name of the token service..
- /// The type of recurring contract to be used. Possible values: * `ONECLICK` – The shopper opts to store their card details for future use. The shopper is present for the subsequent transaction, for cards the security code (CVC/CVV) is required. * `RECURRING` – Payment details are stored for future use. For cards, the security code (CVC/CVV) is not required for subsequent payments. This is used for shopper not present transactions. * `ONECLICK, RECURRING` – Payment details are stored for future use. This allows the use of the stored payment details regardless of whether the shopper is on your site or not..
- /// A descriptive name for this detail..
- public Recurring(TokenServiceEnum? TokenService = default(TokenServiceEnum?), Contract? Contract = default(Contract?), string RecurringDetailName = default(string))
+ /// The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts)..
+ /// A descriptive name for this detail..
+ /// Date after which no further authorisations shall be performed. Only for 3D Secure 2..
+ /// Minimum number of days between authorisations. Only for 3D Secure 2..
+ /// The name of the token service..
+ public Recurring(ContractEnum? contract = default(ContractEnum?), string recurringDetailName = default(string), DateTime? recurringExpiry = default(DateTime?), string recurringFrequency = default(string), TokenServiceEnum? tokenService = default(TokenServiceEnum?))
{
- this.TokenService = TokenService;
- this.Contract = Contract;
- this.RecurringDetailName = RecurringDetailName;
+ this.Contract = contract;
+ this.RecurringDetailName = recurringDetailName;
+ this.RecurringExpiry = recurringExpiry;
+ this.RecurringFrequency = recurringFrequency;
+ this.TokenService = tokenService;
}
-
///
/// A descriptive name for this detail.
///
/// A descriptive name for this detail.
- [DataMember(Name="recurringDetailName", EmitDefaultValue=false)]
+ [DataMember(Name = "recurringDetailName", EmitDefaultValue = false)]
public string RecurringDetailName { get; set; }
+ ///
+ /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.
+ ///
+ /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.
+ [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)]
+ public DateTime? RecurringExpiry { get; set; }
+
+ ///
+ /// Minimum number of days between authorisations. Only for 3D Secure 2.
+ ///
+ /// Minimum number of days between authorisations. Only for 3D Secure 2.
+ [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)]
+ public string RecurringFrequency { get; set; }
+
+
///
/// Returns the string presentation of the object
///
@@ -80,18 +138,20 @@ public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Recurring {\n");
- sb.Append(" TokenService: ").Append(TokenService).Append("\n");
sb.Append(" Contract: ").Append(Contract).Append("\n");
sb.Append(" RecurringDetailName: ").Append(RecurringDetailName).Append("\n");
+ sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n");
+ sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n");
+ sb.Append(" TokenService: ").Append(TokenService).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
-
+
///
/// Returns the JSON string presentation of the object
///
/// JSON string presentation of the object
- public string ToJson()
+ public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
@@ -99,40 +159,48 @@ public string ToJson()
///
/// Returns true if objects are equal
///
- /// Object to be compared
+ /// Object to be compared
/// Boolean
- public override bool Equals(object obj)
+ public override bool Equals(object input)
{
- // credit: http://stackoverflow.com/a/10454552/677735
- return this.Equals(obj as Recurring);
+ return this.Equals(input as Recurring);
}
///
/// Returns true if Recurring instances are equal
///
- /// Instance of Recurring to be compared
+ /// Instance of Recurring to be compared
/// Boolean
- public bool Equals(Recurring other)
+ public bool Equals(Recurring input)
{
- // credit: http://stackoverflow.com/a/10454552/677735
- if (other == null)
+ if (input == null)
return false;
- return
+ return
+ (
+ this.Contract == input.Contract ||
+ (this.Contract != null &&
+ this.Contract.Equals(input.Contract))
+ ) &&
(
- this.TokenService == other.TokenService ||
- this.TokenService != null &&
- this.TokenService.Equals(other.TokenService)
- ) &&
+ this.RecurringDetailName == input.RecurringDetailName ||
+ (this.RecurringDetailName != null &&
+ this.RecurringDetailName.Equals(input.RecurringDetailName))
+ ) &&
(
- this.Contract == other.Contract ||
- this.Contract != null &&
- this.Contract.Equals(other.Contract)
- ) &&
+ this.RecurringExpiry == input.RecurringExpiry ||
+ (this.RecurringExpiry != null &&
+ this.RecurringExpiry.Equals(input.RecurringExpiry))
+ ) &&
(
- this.RecurringDetailName == other.RecurringDetailName ||
- this.RecurringDetailName != null &&
- this.RecurringDetailName.Equals(other.RecurringDetailName)
+ this.RecurringFrequency == input.RecurringFrequency ||
+ (this.RecurringFrequency != null &&
+ this.RecurringFrequency.Equals(input.RecurringFrequency))
+ ) &&
+ (
+ this.TokenService == input.TokenService ||
+ (this.TokenService != null &&
+ this.TokenService.Equals(input.TokenService))
);
}
@@ -142,18 +210,20 @@ public bool Equals(Recurring other)
/// Hash code
public override int GetHashCode()
{
- // credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
- int hash = 41;
- // Suitable nullity checks etc, of course :)
- if (this.TokenService != null)
- hash = hash * 59 + this.TokenService.GetHashCode();
+ int hashCode = 41;
if (this.Contract != null)
- hash = hash * 59 + this.Contract.GetHashCode();
+ hashCode = hashCode * 59 + this.Contract.GetHashCode();
if (this.RecurringDetailName != null)
- hash = hash * 59 + this.RecurringDetailName.GetHashCode();
- return hash;
+ hashCode = hashCode * 59 + this.RecurringDetailName.GetHashCode();
+ if (this.RecurringExpiry != null)
+ hashCode = hashCode * 59 + this.RecurringExpiry.GetHashCode();
+ if (this.RecurringFrequency != null)
+ hashCode = hashCode * 59 + this.RecurringFrequency.GetHashCode();
+ if (this.TokenService != null)
+ hashCode = hashCode * 59 + this.TokenService.GetHashCode();
+ return hashCode;
}
}
@@ -166,6 +236,6 @@ public override int GetHashCode()
{
yield break;
}
- }
-}
+ }
+}
\ No newline at end of file
diff --git a/Adyen/Model/Recurring/RecurringDetail.cs b/Adyen/Model/Recurring/RecurringDetail.cs
index 5f7086a08..2834f05b5 100644
--- a/Adyen/Model/Recurring/RecurringDetail.cs
+++ b/Adyen/Model/Recurring/RecurringDetail.cs
@@ -40,7 +40,6 @@ public partial class RecurringDetail : IEquatable, IValidatabl
///
/// Initializes a new instance of the class.
///
- /// TokenDetails.
/// SocialSecurityNumber.
/// FirstPspReference.
/// CreationDate.
@@ -58,9 +57,8 @@ public partial class RecurringDetail : IEquatable, IValidatabl
/// BillingAddress.
/// AdditionalData.
/// Card.
- public RecurringDetail(TokenDetails TokenDetails = default(TokenDetails), string SocialSecurityNumber = default(string), string FirstPspReference = default(string), DateTime? CreationDate = default(DateTime?), string Acquirer = default(string), BankAccount Bank = default(BankAccount), Name ShopperName = default(Name), string AcquirerAccount = default(string), string AliasType = default(string), string Name = default(string), string Variant = default(string), string RecurringDetailReference = default(string), string Alias = default(string), List ContractTypes = default(List), string PaymentMethodVariant = default(string), Address BillingAddress = default(Address), Dictionary AdditionalData = default(Dictionary), Card Card = default(Card))
+ public RecurringDetail(string SocialSecurityNumber = default(string), string FirstPspReference = default(string), DateTime? CreationDate = default(DateTime?), string Acquirer = default(string), BankAccount Bank = default(BankAccount), Name ShopperName = default(Name), string AcquirerAccount = default(string), string AliasType = default(string), string Name = default(string), string Variant = default(string), string RecurringDetailReference = default(string), string Alias = default(string), List ContractTypes = default(List), string PaymentMethodVariant = default(string), Address BillingAddress = default(Address), Dictionary AdditionalData = default(Dictionary), Card Card = default(Card))
{
- this.TokenDetails = TokenDetails;
this.SocialSecurityNumber = SocialSecurityNumber;
this.FirstPspReference = FirstPspReference;
this.CreationDate = CreationDate;
@@ -81,12 +79,6 @@ public partial class RecurringDetail : IEquatable, IValidatabl
this.Card = Card;
}
- ///
- /// Gets or Sets TokenDetails
- ///
- [DataMember(Name="tokenDetails", EmitDefaultValue=false)]
- public TokenDetails TokenDetails { get; set; }
-
///
/// Gets or Sets SocialSecurityNumber
///
@@ -201,7 +193,6 @@ public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class RecurringDetail {\n");
- sb.Append(" TokenDetails: ").Append(TokenDetails).Append("\n");
sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n");
sb.Append(" FirstPspReference: ").Append(FirstPspReference).Append("\n");
sb.Append(" CreationDate: ").Append(CreationDate).Append("\n");
@@ -256,11 +247,6 @@ public bool Equals(RecurringDetail other)
return false;
return
- (
- this.TokenDetails == other.TokenDetails ||
- this.TokenDetails != null &&
- this.TokenDetails.Equals(other.TokenDetails)
- ) &&
(
this.SocialSecurityNumber == other.SocialSecurityNumber ||
this.SocialSecurityNumber != null &&
@@ -360,8 +346,6 @@ public override int GetHashCode()
{
int hash = 41;
// Suitable nullity checks etc, of course :)
- if (this.TokenDetails != null)
- hash = hash * 59 + this.TokenDetails.GetHashCode();
if (this.SocialSecurityNumber != null)
hash = hash * 59 + this.SocialSecurityNumber.GetHashCode();
if (this.FirstPspReference != null)
diff --git a/Adyen/Model/Recurring/RecurringDetailsResult.cs b/Adyen/Model/Recurring/RecurringDetailsResult.cs
index 8e99ee04a..caf52c3c5 100644
--- a/Adyen/Model/Recurring/RecurringDetailsResult.cs
+++ b/Adyen/Model/Recurring/RecurringDetailsResult.cs
@@ -21,6 +21,7 @@
// */
#endregion
+using Adyen.Util;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -39,17 +40,16 @@ public partial class RecurringDetailsResult : IEquatable
///
/// Initializes a new instance of the class.
///
- /// the most recent email for this shopper (if available).
- /// a list of one or more recurring payment details.
- /// the creation date when the shopper record was created.
- /// InvalidOneclickContracts.
- /// the reference you use to uniquely identify the shopper (e.g. user ID or account ID).
- public RecurringDetailsResult(string LastKnownShopperEmail = default(string), DateTime? CreationDate = default(DateTime?), bool? InvalidOneclickContracts = default(bool?), string ShopperReference = default(string))
+ /// The date when the recurring details were created..
+ /// Payment details stored for recurring payments..
+ /// The most recent email for this shopper (if available)..
+ /// The reference you use to uniquely identify the shopper (e.g. user ID or account ID)..
+ public RecurringDetailsResult(DateTime? creationDate = default(DateTime?), List details = default(List), string lastKnownShopperEmail = default(string), string shopperReference = default(string))
{
- this.LastKnownShopperEmail = LastKnownShopperEmail;
- this.CreationDate = CreationDate;
- this.InvalidOneclickContracts = InvalidOneclickContracts;
- this.ShopperReference = ShopperReference;
+ this.CreationDate = creationDate;
+ this.Details = details;
+ this.LastKnownShopperEmail = lastKnownShopperEmail;
+ this.ShopperReference = shopperReference;
}
///
@@ -68,11 +68,6 @@ public partial class RecurringDetailsResult : IEquatable
[DataMember(Name = "creationDate", EmitDefaultValue = false)]
public DateTime? CreationDate { get; set; }
- ///
- /// Gets or Sets InvalidOneclickContracts
- ///
- [DataMember(Name = "invalidOneclickContracts", EmitDefaultValue = false)]
- public bool? InvalidOneclickContracts { get; set; }
///
/// the reference you use to uniquely identify the shopper (e.g. user ID or account ID)
@@ -87,7 +82,7 @@ public partial class RecurringDetailsResult : IEquatable
///
/// details of the result
[DataMember(Name = "details", EmitDefaultValue = false)]
- public List Details=new List();
+ public List Details = new List();
///
/// Returns the string presentation of the object
@@ -99,7 +94,7 @@ public override string ToString()
sb.Append("class RecurringDetailsResult {\n");
sb.Append(" LastKnownShopperEmail: ").Append(LastKnownShopperEmail).Append("\n");
sb.Append(" CreationDate: ").Append(CreationDate).Append("\n");
- sb.Append(" InvalidOneclickContracts: ").Append(InvalidOneclickContracts).Append("\n");
+ sb.Append(" Details: ").Append(Details.ObjectListToString()).Append("\n");
sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -148,9 +143,10 @@ public bool Equals(RecurringDetailsResult other)
this.CreationDate.Equals(other.CreationDate)
) &&
(
- this.InvalidOneclickContracts == other.InvalidOneclickContracts ||
- this.InvalidOneclickContracts != null &&
- this.InvalidOneclickContracts.Equals(other.InvalidOneclickContracts)
+ this.Details == other.Details ||
+ this.Details != null &&
+ other.Details != null &&
+ this.Details.Equals(other.Details)
) &&
(
this.ShopperReference == other.ShopperReference ||
@@ -174,8 +170,8 @@ public override int GetHashCode()
hash = hash * 59 + this.LastKnownShopperEmail.GetHashCode();
if (this.CreationDate != null)
hash = hash * 59 + this.CreationDate.GetHashCode();
- if (this.InvalidOneclickContracts != null)
- hash = hash * 59 + this.InvalidOneclickContracts.GetHashCode();
+ if (this.Details != null)
+ hash = hash * 59 + this.Details.GetHashCode();
if (this.ShopperReference != null)
hash = hash * 59 + this.ShopperReference.GetHashCode();
return hash;
diff --git a/Adyen/Model/Recurring/TokenDetails.cs b/Adyen/Model/Recurring/TokenDetails.cs
deleted file mode 100644
index 18bf31703..000000000
--- a/Adyen/Model/Recurring/TokenDetails.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-#region License
-// /*
-// * ######
-// * ######
-// * ############ ####( ###### #####. ###### ############ ############
-// * ############# #####( ###### #####. ###### ############# #############
-// * ###### #####( ###### #####. ###### ##### ###### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ######
-// * ############# ############# ############# ############# ##### ######
-// * ############ ############ ############# ############ ##### ######
-// * ######
-// * #############
-// * ############
-// *
-// * Adyen Dotnet API Library
-// *
-// * Copyright (c) 2020 Adyen B.V.
-// * This file is open source and available under the MIT license.
-// * See the LICENSE file for more info.
-// */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Text;
-using Newtonsoft.Json;
-
-namespace Adyen.Model.Recurring
-{
- ///
- /// TokenDetails
- ///
- [DataContract]
- public partial class TokenDetails : IEquatable, IValidatableObject
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// TokenData.
- /// TokenDataType.
- public TokenDetails(Dictionary TokenData = default(Dictionary), string TokenDataType = default(string))
- {
- this.TokenData = TokenData;
- this.TokenDataType = TokenDataType;
- }
-
- ///
- /// Gets or Sets TokenData
- ///
- [DataMember(Name="tokenData", EmitDefaultValue=false)]
- public Dictionary TokenData { get; set; }
-
- ///
- /// Gets or Sets TokenDataType
- ///
- [DataMember(Name="tokenDataType", EmitDefaultValue=false)]
- public string TokenDataType { get; set; }
-
- ///
- /// Returns the string presentation of the object
- ///
- /// String presentation of the object
- public override string ToString()
- {
- var sb = new StringBuilder();
- sb.Append("class TokenDetails {\n");
- sb.Append(" TokenData: ").Append(TokenData).Append("\n");
- sb.Append(" TokenDataType: ").Append(TokenDataType).Append("\n");
- sb.Append("}\n");
- return sb.ToString();
- }
-
- ///
- /// Returns the JSON string presentation of the object
- ///
- /// JSON string presentation of the object
- public string ToJson()
- {
- return JsonConvert.SerializeObject(this, Formatting.Indented);
- }
-
- ///
- /// Returns true if objects are equal
- ///
- /// Object to be compared
- /// Boolean
- public override bool Equals(object obj)
- {
- // credit: http://stackoverflow.com/a/10454552/677735
- return this.Equals(obj as TokenDetails);
- }
-
- ///
- /// Returns true if TokenDetails instances are equal
- ///
- /// Instance of TokenDetails to be compared
- /// Boolean
- public bool Equals(TokenDetails other)
- {
- // credit: http://stackoverflow.com/a/10454552/677735
- if (other == null)
- return false;
-
- return
- (
- this.TokenData == other.TokenData ||
- this.TokenData != null &&
- this.TokenData.SequenceEqual(other.TokenData)
- ) &&
- (
- this.TokenDataType == other.TokenDataType ||
- this.TokenDataType != null &&
- this.TokenDataType.Equals(other.TokenDataType)
- );
- }
-
- ///
- /// Gets the hash code
- ///
- /// Hash code
- public override int GetHashCode()
- {
- // credit: http://stackoverflow.com/a/263416/677735
- unchecked // Overflow is fine, just wrap
- {
- int hash = 41;
- // Suitable nullity checks etc, of course :)
- if (this.TokenData != null)
- hash = hash * 59 + this.TokenData.GetHashCode();
- if (this.TokenDataType != null)
- hash = hash * 59 + this.TokenDataType.GetHashCode();
- return hash;
- }
- }
-
- ///
- /// To validate all properties of the instance
- ///
- /// Validation context
- /// Validation Result
- IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
- {
- yield break;
- }
- }
-
-}
diff --git a/Adyen/Model/Terminal/SaleToAcquirerData.cs b/Adyen/Model/Terminal/SaleToAcquirerData.cs
index 7859997d1..2d22a1a55 100644
--- a/Adyen/Model/Terminal/SaleToAcquirerData.cs
+++ b/Adyen/Model/Terminal/SaleToAcquirerData.cs
@@ -31,7 +31,7 @@ namespace Adyen.Model.Terminal
public class SaleToAcquirerData
{
[JsonProperty(PropertyName = "metadata")]
- public Dictionary Metadata { get; set; }
+ public SortedDictionary Metadata { get; set; }
[JsonProperty(PropertyName = "shopperEmail")]
public string ShopperEmail { get; set; }
[JsonProperty(PropertyName = "shopperReference")]
diff --git a/Adyen/Security/Exceptions/NexoCryptoException.cs b/Adyen/Security/Exceptions/NexoCryptoException.cs
new file mode 100644
index 000000000..bad88de8c
--- /dev/null
+++ b/Adyen/Security/Exceptions/NexoCryptoException.cs
@@ -0,0 +1,34 @@
+#region License
+ /*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
+#endregion
+
+using System;
+
+namespace Adyen.Security.Exceptions
+{
+ public class NexoCryptoException : Exception
+ {
+ public NexoCryptoException(string message) : base(message)
+ {
+ }
+ }
+}
diff --git a/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs b/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs
index cf0926443..3964f0c4c 100644
--- a/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs
+++ b/Adyen/Security/SaleToPoiMessageSecuredEncryptor.cs
@@ -25,6 +25,8 @@
using System;
using System.Text;
using Adyen.Model.Nexo;
+using System.Security.Cryptography;
+using Adyen.Security.Exceptions;
namespace Adyen.Security
{
@@ -84,7 +86,42 @@ public string Decrypt(SaleToPoiMessageSecured saleToPoiMessageSecured, Encryptio
var decryptedSaleToPoiMessageByteArray = _aesEncryptor.Decrypt(encryptedSaleToPoiMessageByteArray,
encryptionDerivedKey,
saleToPoiMessageSecured.SecurityTrailer.Nonce);
+ var receivedHmac = saleToPoiMessageSecured.SecurityTrailer.Hmac;
+ ValidateHmac(receivedHmac, decryptedSaleToPoiMessageByteArray, encryptionDerivedKey);
return System.Text.Encoding.UTF8.GetString(decryptedSaleToPoiMessageByteArray);
}
+
+ ///
+ /// Validate the hmac from a received message
+ ///
+ ///
+ ///
+ ///
+ private void ValidateHmac(byte[] receivedHmac, byte[] decryptedSaleToPoiMessageByteArray, EncryptionDerivedKey encryptionDerivedKey)
+ {
+ var hmacSha256Wrapper = new HmacSha256Wrapper();
+ byte[] hmac = hmacSha256Wrapper.HMac(decryptedSaleToPoiMessageByteArray, encryptionDerivedKey.HmacKey);
+
+ bool isValid = true;
+ if (receivedHmac.Length == hmac.Length)
+ {
+ for (int i = 0; i < hmac.Length; i++)
+ {
+ if (receivedHmac[i] != hmac[i])
+ {
+ isValid = false;
+ }
+ }
+ }
+ else
+ {
+ isValid = false;
+ }
+
+ if (!isValid)
+ {
+ throw new NexoCryptoException("Hmac validation failed");
+ }
+ }
}
}
diff --git a/Adyen/Security/TerminalCommonNameValidator.cs b/Adyen/Security/TerminalCommonNameValidator.cs
index 7da2b8c77..677e9dfee 100644
--- a/Adyen/Security/TerminalCommonNameValidator.cs
+++ b/Adyen/Security/TerminalCommonNameValidator.cs
@@ -1,24 +1,24 @@
#region License
-// /*
-// * ######
-// * ######
-// * ############ ####( ###### #####. ###### ############ ############
-// * ############# #####( ###### #####. ###### ############# #############
-// * ###### #####( ###### #####. ###### ##### ###### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ######
-// * ############# ############# ############# ############# ##### ######
-// * ############ ############ ############# ############ ##### ######
-// * ######
-// * #############
-// * ############
-// *
-// * Adyen Dotnet API Library
-// *
-// * Copyright (c) 2020 Adyen B.V.
-// * This file is open source and available under the MIT license.
-// * See the LICENSE file for more info.
-// */
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
#endregion
using System.Linq;
@@ -29,7 +29,7 @@ namespace Adyen.Security
public static class TerminalCommonNameValidator
{
private static readonly string _environmentWildcard = "{environment}";
- private static string _terminalApiCnRegex = "[a-zA-Z0-9]{4,}-[0-9]{9}\\." + _environmentWildcard + "\\.terminal\\.adyen\\.com";
+ private static string _terminalApiCnRegex = "[a-zA-Z0-9]{3,}-[0-9]{9,15}\\." + _environmentWildcard + "\\.terminal\\.adyen\\.com";
private static string _terminalApiLegacy = "legacy-terminal-certificate." + _environmentWildcard + ".terminal.adyen.com";
public static bool ValidateCertificate(string certificateSubject, Model.Enum.Environment environment)
diff --git a/Adyen/Service/Recurring.cs b/Adyen/Service/Recurring.cs
index 5d90ff725..0851cf1b8 100644
--- a/Adyen/Service/Recurring.cs
+++ b/Adyen/Service/Recurring.cs
@@ -1,24 +1,24 @@
#region License
-// /*
-// * ######
-// * ######
-// * ############ ####( ###### #####. ###### ############ ############
-// * ############# #####( ###### #####. ###### ############# #############
-// * ###### #####( ###### #####. ###### ##### ###### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
-// * ###### ###### #####( ###### #####. ###### ##### ##### ######
-// * ############# ############# ############# ############# ##### ######
-// * ############ ############ ############# ############ ##### ######
-// * ######
-// * #############
-// * ############
-// *
-// * Adyen Dotnet API Library
-// *
-// * Copyright (c) 2020 Adyen B.V.
-// * This file is open source and available under the MIT license.
-// * See the LICENSE file for more info.
-// */
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
#endregion
using Adyen.Model.Recurring;
@@ -31,11 +31,13 @@ public class Recurring : AbstractService
{
private readonly ListRecurringDetails _listRecurringDetails;
private Disable _disable;
+ private NotifyShopper _notifyShopper;
public Recurring(Client client) : base(client)
{
_listRecurringDetails = new ListRecurringDetails(this);
_disable = new Disable(this);
+ _notifyShopper = new NotifyShopper(this);
}
public RecurringDetailsResult ListRecurringDetails(RecurringDetailsRequest request)
@@ -65,5 +67,29 @@ public async Task DisableAsync(DisableRequest disableRequest)
var jsonResponse = await _disable.RequestAsync(jsonRequest);
return Util.JsonOperation.Deserialize(jsonResponse);
}
+
+ ///
+ /// send a pre-debit notification to your shopper
+ ///
+ ///
+ /// NotifyShopperResult
+ public NotifyShopperResult NotifyShopper(NotifyShopperRequest notifyShopperRequest)
+ {
+ var jsonRequest = Util.JsonOperation.SerializeRequest(notifyShopperRequest);
+ var jsonResponse = _notifyShopper.Request(jsonRequest);
+ return Util.JsonOperation.Deserialize(jsonResponse);
+ }
+
+ ///
+ /// async send a pre-debit notification to your shopper
+ ///
+ ///
+ /// Task
+ public async Task NotifyShopperAsync(NotifyShopperRequest notifyShopperRequest)
+ {
+ var jsonRequest = Util.JsonOperation.SerializeRequest(notifyShopperRequest);
+ var jsonResponse = await _notifyShopper.RequestAsync(jsonRequest);
+ return Util.JsonOperation.Deserialize(jsonResponse);
+ }
}
}
diff --git a/Adyen/Service/Resource/Recurring/NotifyShopper.cs b/Adyen/Service/Resource/Recurring/NotifyShopper.cs
new file mode 100644
index 000000000..eb93457bd
--- /dev/null
+++ b/Adyen/Service/Resource/Recurring/NotifyShopper.cs
@@ -0,0 +1,46 @@
+#region License
+/*
+ * ######
+ * ######
+ * ############ ####( ###### #####. ###### ############ ############
+ * ############# #####( ###### #####. ###### ############# #############
+ * ###### #####( ###### #####. ###### ##### ###### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
+ * ###### ###### #####( ###### #####. ###### ##### ##### ######
+ * ############# ############# ############# ############# ##### ######
+ * ############ ############ ############# ############ ##### ######
+ * ######
+ * #############
+ * ############
+ *
+ * Adyen Dotnet API Library
+ *
+ * Copyright (c) 2021 Adyen B.V.
+ * This file is open source and available under the MIT license.
+ * See the LICENSE file for more info.
+ */
+#endregion
+using System.Collections.Generic;
+
+namespace Adyen.Service.Resource.Recurring
+{
+ public class NotifyShopper : Resource
+ {
+ ///
+ /// To send a pre-debit notification to your shopper, make a POST call to notifyShopper
+ ///
+ ///
+ public NotifyShopper(AbstractService abstractService)
+ : base(abstractService, abstractService.Client.Config.Endpoint + "/pal/servlet/Recurring/" + abstractService.Client.RecurringApiVersion + "/notifyShopper",
+ new List
+ {
+ "merchantAccount",
+ "shopperReference",
+ "amount",
+ "reference"
+ })
+ {
+
+ }
+ }
+}
diff --git a/Adyen/Util/HMACValidator.cs b/Adyen/Util/HMACValidator.cs
index b148392c6..c08acf126 100644
--- a/Adyen/Util/HMACValidator.cs
+++ b/Adyen/Util/HMACValidator.cs
@@ -130,6 +130,7 @@ public bool IsValidHmac(NotificationRequestItem notificationRequestItem, string
return string.Equals(expectedSign, merchantSign);
}
+
private string EscapeVal(string val)
{
if (val == null)
diff --git a/README.md b/README.md
index afc70b8fc..56e2f0f36 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ The library supports all APIs under the following services:
* [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview): Our latest integration for accepting online payments. Current supported version: **v67**
* [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v51/overview): Our classic integration for online payments. Current supported version: **v51**
-* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v25/overview): Endpoints for managing saved payment details. Current supported version: **v49**
+* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v49/overview): Endpoints for managing saved payment details. Current supported version: **v49**
* [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v51/overview): Endpoints for sending funds to your customers. Current supported version: **v51**
* [Adyen BinLookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v50/overview): Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version: **v50**
* [Utility API](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/post/originKeys): This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. Current supported version: **v67**