diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index db57f3265..806d36255 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet: ['2.0.0','2.2.103'] + dotnet: ['2.1.811','2.2.103'] steps: - uses: actions/checkout@v2 - name: Setup .NET Core diff --git a/.gitignore b/.gitignore index 3cbef3e36..d14924768 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .vs/ TestResults/ - +.vagrant/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6bcf21151..000000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: csharp -dist: xenial -mono: none -dotnet: 2.0.0 -install: -- dotnet restore -script: -- dotnet build /p:TargetFrameworks=netcoreapp2.0 -- dotnet test Adyen.Test/Adyen.Test.csproj \ No newline at end of file diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index 9b19e0e56..5fbb563a0 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -5,11 +5,13 @@ false - 5.7.0 + 6.1.0 - 5.7.0 + 6.1.0 - 5.7.0 + 6.1.0 + + 7.2 @@ -33,7 +35,7 @@ - + diff --git a/Adyen.Test/ApplePayDeserializationTest.cs b/Adyen.Test/ApplePayDeserializationTest.cs new file mode 100644 index 000000000..e79a4f72b --- /dev/null +++ b/Adyen.Test/ApplePayDeserializationTest.cs @@ -0,0 +1,23 @@ +using Adyen.Model.Checkout; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; + +namespace Adyen.Test +{ + [TestClass] + public class ApplePayDeserializationTest : BaseTest + { + [TestMethod] + public void Can_deserialize_applepay_paymentmethod_request() + { + var mockPath = GetMockFilePath("Mocks/checkout/paymentmethod-applepay-request.json"); + var response = MockFileToString(mockPath); + + var paymentMethod = JsonConvert.DeserializeObject(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 2f2485091..f2817ec8f 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/BaseTest.cs @@ -39,6 +39,7 @@ using Amount = Adyen.Model.Amount; using PaymentResult = Adyen.Model.PaymentResult; using Adyen.Model.Checkout; +using System.Threading.Tasks; namespace Adyen.Test { @@ -211,7 +212,6 @@ public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2() Amount = amount, ReturnUrl = @"https://your-company.com/...", MerchantAccount = "MerchantAccount", - AdditionalData = new Dictionary() { { "allow3DS2", "true" } }, Channel = Model.Checkout.PaymentRequest.ChannelEnum.Web }; paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith"); @@ -222,15 +222,15 @@ public Model.Checkout.PaymentRequest CreatePaymentRequest3DS2() ///Checkout Details request /// /// Returns a sample PaymentsDetailsRequest object with test data - protected Model.Checkout.PaymentsDetailsRequest CreateDetailsRequest() + protected PaymentsDetailsRequest CreateDetailsRequest() { - string paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj..."; - var details = new Dictionary + var paymentData = "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj..."; + var details = new PaymentCompletionDetails() { - { "MD", "sdfsdfsdf..." }, - { "PaRes", "sdfsdfsdf..." } + MD= "sdfsdfsdf...", + PaReq = "sdfsdfsdf..." }; - var paymentsDetailsRequest = new Model.Checkout.PaymentsDetailsRequest(Details: details, PaymentData: paymentData); + var paymentsDetailsRequest = new PaymentsDetailsRequest(details: details, paymentData: paymentData); return paymentsDetailsRequest; } @@ -250,19 +250,19 @@ protected PaymentMethodsRequest CreatePaymentMethodRequest(string merchantAccoun /// protected PaymentSessionRequest CreatePaymentSessionRequest() { - return new PaymentSessionRequest(MerchantAccount: "MerchantAccount", Reference: "MerchantReference", - Amount: new Model.Checkout.Amount("EUR", 1200), ReturnUrl: @"https://your-company.com/...", CountryCode: "NL", - Channel: PaymentSessionRequest.ChannelEnum.Web, SdkVersion: "1.3.0"); + return new PaymentSessionRequest(merchantAccount: "MerchantAccount", reference: "MerchantReference", + amount: new Model.Checkout.Amount("EUR", 1200), returnUrl: @"https://your-company.com/...", countryCode: "NL", + channel: PaymentSessionRequest.ChannelEnum.Web, sdkVersion: "1.3.0"); } /// /// Checkout paymentResultRequest /// /// - protected Model.Checkout.PaymentResultRequest CreatePaymentResultRequest() + protected PaymentResultRequest CreatePaymentResultRequest() { - string payload = @"Ab0oCC2/wy96FiEMLvoI8RfayxEmZHQZcw...riRbNBzP3pQscLYBHN/MfZkgfGHdqy7JfQoQbRUmA=="; - return new Model.Checkout.PaymentResultRequest(Payload: payload); + var payload = @"Ab0oCC2/wy96FiEMLvoI8RfayxEmZHQZcw...riRbNBzP3pQscLYBHN/MfZkgfGHdqy7JfQoQbRUmA=="; + return new PaymentResultRequest(payload: payload); } #endregion @@ -303,6 +303,8 @@ protected Client CreateMockTestClientNullRequiredFieldsRequest(string fileName) var confMock = MockPaymentData.CreateConfingMock(); clientInterfaceMock.Setup(x => x.Request(It.IsAny(), It.IsAny(), confMock)).Returns(response); + clientInterfaceMock.Setup(x => x.Request(It.IsAny(), It.IsAny(), confMock, It.IsAny(), It.IsAny())).Returns(response); + clientInterfaceMock.Setup(x => x.RequestAsync(It.IsAny(), It.IsAny(), confMock, It.IsAny(), It.IsAny())).Returns(Task.FromResult(response)); var clientMock = new Client(It.IsAny()) { HttpClient = clientInterfaceMock.Object, @@ -519,28 +521,6 @@ protected AuthenticationResultRequest CreateAuthenticationResultRequest() }; } - - /// - /// Create dummy CreatePaymentLinkRequest - /// - /// CreatePaymentLinkRequest - protected CreatePaymentLinkRequest CreatePaymentLinkRequestSuccess() - { - return new CreatePaymentLinkRequest() - { - Reference = "YOUR_REFERENCE_NUMBER", - Amount = new Model.Checkout.Amount("EUR", 100), - CountryCode = "GR", - MerchantAccount = "MerchantAccount", - ShopperReference = "ShopperReference", - ShopperEmail = "info@ShopperEmail.com", - ShopperLocale = "GR", - ExpiresAt = "2019-12-17T10:59:29", - BillingAddress = new Model.Checkout.Address(Country: "GR"), - DeliveryAddress = new Model.Checkout.Address(Country: "GR"), - }; - } - private PaymentResult GetAdditionaData(PaymentResult paymentResult) { var paymentResultAdditionalData = paymentResult.AdditionalData; diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index 690c46565..38ba3dde0 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -1,34 +1,37 @@ #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) 2020 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ #endregion -using Adyen.HttpClient; using Adyen.Model.ApplicationInformation; using Adyen.Model.Checkout; +using Adyen.Model.Checkout.Details; +using Adyen.Model.Checkout.Action; using Adyen.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Threading.Tasks; -using static Adyen.Model.Checkout.PaymentsResponse; +using static Adyen.Model.Checkout.PaymentResponse; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace Adyen.Test { @@ -183,7 +186,8 @@ public void PaymentsAuthorise3ds2ResultSuccessTest() var paymentResultResponse = checkout.PaymentsResult(paymentResultRequest); Assert.IsNotNull(paymentResultResponse.AdditionalData); Assert.AreEqual(paymentResultResponse.AdditionalData["cvcResult"], "1 Matches"); - Assert.AreEqual(paymentResultResponse.ResultCode, Model.Checkout.PaymentResultResponse.ResultCodeEnum.Authorised); + Assert.AreEqual(paymentResultResponse.MerchantReference, "your_merchantReference"); + Assert.AreEqual(paymentResultResponse.ResultCode, PaymentResultResponse.ResultCodeEnum.Authorised); } /// @@ -208,7 +212,7 @@ public void PaymentsErrorTest() public void PaymentDetailsTest() { var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details.Add("payload", "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); + detailsRequest.Details = new PaymentCompletionDetails(payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-success.json"); var checkout = new Checkout(client); var paymentResponse = checkout.PaymentDetails(detailsRequest); @@ -223,7 +227,7 @@ public void PaymentDetailsTest() public async Task PaymentDetailsAsyncTest() { var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details.Add("payload", "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); + detailsRequest.Details = new PaymentCompletionDetails(payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); var client = CreateAsyncMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-success.json"); var checkout = new Checkout(client); var paymentResponse = await checkout.PaymentDetailsAsync(detailsRequest); @@ -238,13 +242,32 @@ public async Task PaymentDetailsAsyncTest() public void PaymentDetailsErrorTest() { var detailsRequest = CreateDetailsRequest(); - detailsRequest.Details.Add("payload", "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); + detailsRequest.Details = new PaymentCompletionDetails(payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-error-invalid-data-422.json"); var checkout = new Checkout(client); var paymentResponse = checkout.PaymentDetails(detailsRequest); Assert.IsNull(paymentResponse.ResultCode); } + /// + /// Test success deserialization for + /// POST /payments/details + /// + [TestMethod] + public void PaymentDetailsResponseDeserializeTest() + { + var detailsRequest = CreateDetailsRequest(); + detailsRequest.Details = new PaymentCompletionDetails(payload: "Ab02b4c0!BQABAgBQn96RxfJHpp2RXhqQBuhQFWgE...gfGHb4IZSP4IpoCC2==RXhqQBuhQ"); + var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsdetails-action-success.json"); + var checkout = new Checkout(client); + var paymentResponse = checkout.PaymentDetails(detailsRequest); + Assert.IsTrue(paymentResponse.Action is CheckoutThreeDS2FingerPrintAction); + var paymentActionResponse = (CheckoutThreeDS2FingerPrintAction)paymentResponse.Action; + Assert.AreEqual("Ab02b4c0!BQABAgBNSfsOs...", paymentActionResponse.PaymentData); + Assert.AreEqual("eyJ0aHJlZURTTWVzc2FnZ...", paymentActionResponse.Token); + Assert.AreEqual("threeDS2Fingerprint", paymentActionResponse.Type); + } + /// /// Test success flow for /// POST /paymentMethods @@ -387,7 +410,7 @@ public void PaymentsResultSuccessTest() var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsresult-success.json"); var checkout = new Checkout(client); var paymentResultResponse = checkout.PaymentsResult(paymentResultRequest); - Assert.AreEqual(paymentResultResponse.ResultCode, Model.Checkout.PaymentResultResponse.ResultCodeEnum.Authorised); + Assert.AreEqual(paymentResultResponse.ResultCode, PaymentResultResponse.ResultCodeEnum.Authorised); } /// @@ -401,7 +424,7 @@ public async Task PaymentsResultAsyncSuccessTest() var client = CreateAsyncMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsresult-success.json"); var checkout = new Checkout(client); var paymentResultResponse = await checkout.PaymentsResultAsync(paymentResultRequest); - Assert.AreEqual(paymentResultResponse.ResultCode, Model.Checkout.PaymentResultResponse.ResultCodeEnum.Authorised); + Assert.AreEqual(paymentResultResponse.ResultCode, PaymentResultResponse.ResultCodeEnum.Authorised); } /// @@ -441,7 +464,7 @@ public void PaymentRequestApplicationInfoTest() public void PaymentRequestAppInfoExternalTest() { var externalPlatform = new Model.ApplicationInformation.ExternalPlatform(); - var merchantApplication = new CommonField(); + var merchantApplication = new Model.ApplicationInformation.CommonField(); externalPlatform.Integrator = "TestExternalPlatformIntegration"; externalPlatform.Name = "TestExternalPlatformName"; externalPlatform.Version = "TestExternalPlatformVersion"; @@ -464,35 +487,20 @@ public void PaymentsResponseParsingTest() var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json"); var checkout = new Checkout(client); var paymentResponse = checkout.Payments(paymentRequest); + + Assert.IsTrue(paymentResponse.Action is CheckoutThreeDS2ChallengeAction); + var paymentResponseAction = (CheckoutThreeDS2ChallengeAction)paymentResponse.Action; Assert.AreEqual(paymentResponse.ResultCode, ResultCodeEnum.ChallengeShopper); Assert.AreEqual(paymentResponse.PaymentData, "Te1CMIy1vKQTYsSHZ+gRbFpQy4d4n2HLD3c2b7xKnRNpWzWPuI="); - Assert.AreEqual(paymentResponse.Action.PaymentData, "Te1CMIy1vKQTYsSHZ+gRbFpQy4d4n2HLD3c2b7xKnRNpWzWPuI="); - Assert.AreEqual(paymentResponse.Action.Type, Model.Checkout.CheckoutPaymentsAction.CheckoutActionType.ThreeDS2Challenge); - Assert.AreEqual(paymentResponse.Action.Token, "S0zYWQ0MGEwMjU2MjEifQ=="); - Assert.AreEqual(paymentResponse.Action.PaymentMethodType, "scheme"); + Assert.AreEqual(paymentResponseAction.PaymentData, "Te1CMIy1vKQTYsSHZ+gRbFpQy4d4n2HLD3c2b7xKnRNpWzWPuI="); + Assert.AreEqual(paymentResponseAction.Type, "threeDS2Challenge"); + Assert.AreEqual(paymentResponseAction.Token, "S0zYWQ0MGEwMjU2MjEifQ=="); + Assert.AreEqual(paymentResponseAction.PaymentMethodType, "scheme"); Assert.AreEqual(paymentResponse.Details[0].Key, "threeds2.challengeResult"); Assert.AreEqual(paymentResponse.Details[0].Type, "text"); Assert.AreEqual(paymentResponse.Authentication["threeds2.challengeToken"], "S0zYWQ0MGEwMjU2MjEifQ=="); } - [TestMethod] - public void PaymentsResponseThreeDS2ParsingTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentsResponse-ThreeDS2Result.json"); - var checkout = new Checkout(client); - var paymentResponse = checkout.Payments(paymentRequest); - Assert.AreEqual(paymentResponse.ResultCode, ResultCodeEnum.AuthenticationFinished); - Assert.AreEqual(paymentResponse.PspReference, "812345678912345A"); - Assert.AreEqual(paymentResponse.MerchantReference, "ABC1234"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.AuthenticationValue, "3q263q263q263q263q263q263q263q263q26"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.ECI, "05"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.TransStatus, "Y"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.ThreeDSServerTransID, "abcd1234-abcd1234-abcd1234-abcd1234-"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.DsTransID, "abcd9a67-abcd9a67-abcd9a67-abcd9a671"); - Assert.AreEqual(paymentResponse.ThreeDS2Result.MessageVersion, "2.1.0"); - } - [TestMethod] public void PaymentsOriginTest() { @@ -508,10 +516,10 @@ public void PaymentsOriginTest() [TestMethod] public void CreatePaymentLinkSuccess() { - var createPaymentLinkRequest = new CreatePaymentLinkRequest { Store = "TheDemoStore" }; + var createPaymentLinkRequest = new CreatePaymentLinkRequest(store: "TheDemoStore", amount: new Amount(currency: "EUR", 1000), merchantAccount: "MerchantAccount", reference: "reference"); Assert.AreEqual(createPaymentLinkRequest.Store, "TheDemoStore"); } - + /// /// Test success flow for /// POST /payments/result @@ -521,14 +529,41 @@ public void PaymentLinksSuccess() { var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/payment-links-success.json"); var checkout = new Checkout(client); - var createPaymentLinkRequest = CreatePaymentLinkRequestSuccess(); + var createPaymentLinkRequest = new CreatePaymentLinkRequest(amount: new Amount(currency: "EUR", 1000), merchantAccount: "MerchantAccount", reference: "YOUR_ORDER_NUMBER"); var paymentLinksResponse = checkout.PaymentLinks(createPaymentLinkRequest); Assert.AreEqual(paymentLinksResponse.Url, "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA"); Assert.AreEqual(paymentLinksResponse.ExpiresAt, "2019-12-17T10:05:29Z"); Assert.AreEqual(paymentLinksResponse.Reference, "YOUR_ORDER_NUMBER"); Assert.IsNotNull(paymentLinksResponse.Amount); } - + + /// + /// Test success flow for creation of a payment link with recurring payment + /// POST /paymentLinks + /// + [TestMethod] + public void CreateRecurringPaymentLinkSuccessTest() + { + var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentlinks-recurring-payment-success.json"); + var checkout = new Checkout(client); + + var createPaymentLinkRequest = new CreatePaymentLinkRequest(amount: new Amount(currency: "EUR", 100), merchantAccount: "MerchantAccount", reference: "REFERENCE_NUMBER") + { + CountryCode = "GR", + ShopperLocale = "GR", + ShopperReference = "ShopperReference", + StorePaymentMethod = true, + RecurringProcessingModel = CreatePaymentLinkRequest.RecurringProcessingModelEnum.Subscription + }; + + var paymentLinksResponse = checkout.PaymentLinks(createPaymentLinkRequest); + + Assert.AreEqual(createPaymentLinkRequest.Reference, paymentLinksResponse.Reference); + Assert.AreEqual("https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", paymentLinksResponse.Url); + Assert.AreEqual(createPaymentLinkRequest.Amount.Currency, paymentLinksResponse.Amount.Currency); + Assert.AreEqual(createPaymentLinkRequest.Amount.Value, paymentLinksResponse.Amount.Value); + } + /// /// Test success flow for multibanco /// Post /payments @@ -540,10 +575,11 @@ public void MultibancoPaymentSuccessMockedTest() var checkout = new Checkout(client); var paymentRequest = CreatePaymentRequestCheckout(); var paymentResponse = checkout.Payments(paymentRequest); - Assert.AreEqual(paymentResponse.Action.PaymentMethodType,"multibanco"); - Assert.AreEqual(paymentResponse.Action.ExpiresAt, "2020-01-12T09:37:49"); - Assert.AreEqual(paymentResponse.Action.Reference, "501 422 944"); - Assert.AreEqual(paymentResponse.Action.Entity, "12101"); + var paymentResponseAction = (CheckoutVoucherAction)paymentResponse.Action; + Assert.AreEqual(paymentResponseAction.PaymentMethodType, "multibanco"); + Assert.AreEqual(paymentResponseAction.ExpiresAt, "01/12/2020 09:37:49"); + Assert.AreEqual(paymentResponseAction.Reference, "501 422 944"); + Assert.AreEqual(paymentResponseAction.Entity, "12101"); } /// @@ -551,7 +587,7 @@ public void MultibancoPaymentSuccessMockedTest() /// POST /payments /// [TestMethod] - public void PaymentClientdataaParsingTest() + public void PaymentClientdataParsingTest() { var paymentRequest = CreatePaymentRequestCheckout(); var riskdata = new RiskData @@ -573,7 +609,65 @@ public void PaypalPaymentSuccessTest() var checkout = new Checkout(client); var paymentRequest = CreatePaymentRequestCheckout(); var paymentResponse = checkout.Payments(paymentRequest); - Assert.AreEqual("EC-42N19135GM6949000", paymentResponse.Action.SdkData["orderID"]); + Assert.IsTrue(paymentResponse.Action is CheckoutSDKAction); + var result = (CheckoutSDKAction)paymentResponse.Action; + Assert.AreEqual("EC-42N19135GM6949000", result.SdkData["orderID"]); + Assert.AreEqual("Ab02b4c0!BQABAgARb1TvUJa4nwS0Z1nOmxoYfD9+z...", result.PaymentData); + Assert.AreEqual("paypal", result.PaymentMethodType); + } + + + [TestMethod] + public void ApplePayDetailsDeserializationTest() + { + var json = "{\"type\": \"applepay\",\"applePayToken\": \"VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU...\"}"; + var result = Util.JsonOperation.Deserialize(json); + Assert.IsTrue(result is ApplePayDetails); + Assert.AreEqual(result.Type, "applepay"); + } + + [TestMethod] + public void BlikDetailsDeserializationTest() + { + var json = "{\"amount\":{\"value\":1000,\"currency\":\"USD\"},\"merchantAccount\":\"MerchantAccountTest\",\"paymentMethod\":{\"blikCode\":\"blikCode\",\"type\":\"blik\"},\"reference\":\"Your order number\",\"returnUrl\":\"https://your-company.com/...\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-java-api-library\",\"version\":\"10.1.0\"}}}"; + var paymentRequest = JsonConvert.DeserializeObject(json); + Assert.IsTrue(paymentRequest.PaymentMethod is BlikDetails); + Assert.AreEqual(paymentRequest.PaymentMethod.Type, BlikDetails.Blik); + } + + [TestMethod] + public void DragonpayDetailsDeserializationTest() + { + var json = "{\"amount\":{\"value\":1000,\"currency\":\"USD\"},\"merchantAccount\":\"MerchantAccountTest\",\"paymentMethod\":{\"issuer\":\"issuer\",\"shopperEmail\":\"test@test.com\",\"type\":\"dragonpay_ebanking\"},\"reference\":\"Your order number\",\"returnUrl\":\"https://your-company.com/...\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-java-api-library\",\"version\":\"10.1.0\"}}}"; + var paymentRequest = Util.JsonOperation.Deserialize(json); + Assert.IsTrue(paymentRequest.PaymentMethod is DragonpayDetails); + Assert.AreEqual(paymentRequest.PaymentMethod.Type, DragonpayDetails.EBanking); + } + + [TestMethod] + public void LianLianPayDetailsDeserializationTest() + { + var json = "{\"amount\":{\"value\":1000,\"currency\":\"USD\"},\"merchantAccount\":\"MerchantAccountTest\",\"paymentMethod\":{\"telephoneNumber\":\"telephone\",\"type\":\"lianlianpay_ebanking_credit\"},\"reference\":\"Your order number\",\"returnUrl\":\"https://your-company.com/...\",\"applicationInfo\":{\"adyenLibrary\":{\"name\":\"adyen-java-api-library\",\"version\":\"10.1.0\"}}}"; + + LianLianPayDetails lianLianPayDetails = new LianLianPayDetails(); + var paymentRequest = JsonConvert.DeserializeObject(json); + Assert.IsTrue(paymentRequest.PaymentMethod is LianLianPayDetails); + Assert.AreEqual(paymentRequest.PaymentMethod.Type, LianLianPayDetails.EbankingCredit); + } + + /// + /// Test toJson() that includes the type in the action + /// + [TestMethod] + public void PaymentsResponseToJsonTest() + { + var paymentRequest = CreatePaymentRequestCheckout(); + var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json"); + var checkout = new Checkout(client); + var paymentResponse = checkout.Payments(paymentRequest); + var paymentResponseToJson = paymentResponse.ToJson(); + var jObject = JObject.Parse(paymentResponseToJson); + Assert.AreEqual(jObject["action"]["type"], "threeDS2Challenge"); } } } \ No newline at end of file diff --git a/Adyen.Test/CheckoutUtilityTest.cs b/Adyen.Test/CheckoutUtilityTest.cs index 180405611..a7d63f68f 100644 --- a/Adyen.Test/CheckoutUtilityTest.cs +++ b/Adyen.Test/CheckoutUtilityTest.cs @@ -21,12 +21,10 @@ // */ #endregion -using Adyen.Model.CheckoutUtility; +using Adyen.Model.Checkout; using Adyen.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; using System.Collections.Generic; -using System.Text; namespace Adyen.Test { @@ -40,13 +38,10 @@ public class CheckoutUtilityTest : BaseTest [TestMethod] public void OriginKeysSuccessTest() { - var originKeysRequest = new OriginKeysRequest - { - OriginDomains = new List { "www.test.com", "https://www.your-domain2.com" } - }; + var checkoutUtilityRequest = new CheckoutUtilityRequest(originDomains: new List { "www.test.com", "https://www.your-domain2.com" }); var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkoututility/originkeys-success.json"); var _checkout = new CheckoutUtility(client); - var originKeysResponse = _checkout.OriginKeys(originKeysRequest); + var originKeysResponse = _checkout.OriginKeys(checkoutUtilityRequest); Assert.AreEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI", originKeysResponse.OriginKeys["https://www.your-domain1.com"]); } } diff --git a/Adyen.Test/CloudApiPosRequestTest.cs b/Adyen.Test/CloudApiPosRequestTest.cs index 6bd448894..727cdccba 100644 --- a/Adyen.Test/CloudApiPosRequestTest.cs +++ b/Adyen.Test/CloudApiPosRequestTest.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; using Adyen.Model.Nexo; using Adyen.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/Adyen.Test/ExtensionsTest.cs b/Adyen.Test/ExtensionsTest.cs new file mode 100644 index 000000000..843bd494d --- /dev/null +++ b/Adyen.Test/ExtensionsTest.cs @@ -0,0 +1,72 @@ +#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 Adyen.Model.Checkout; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Collections.Generic; + +namespace Adyen.Test +{ + [TestClass] + public class ExtensionsTest + { + [TestMethod] + public void TestDeviceRenderOptionsObjectListToString() + { + var deviceRenderOptions = new DeviceRenderOptions + { + SdkInterface = DeviceRenderOptions.SdkInterfaceEnum.Native, + SdkUiType = new List { DeviceRenderOptions.SdkUiTypeEnum.MultiSelect, DeviceRenderOptions.SdkUiTypeEnum.OtherHtml } + }; + var expected = "class DeviceRenderOptions {\n SdkInterface: Native\n SdkUiType: \n\t{ MultiSelect\n OtherHtml\n }\n}\n"; + Assert.AreEqual(expected, deviceRenderOptions.ToString()); + } + + [TestMethod] + public void TestFraudCheckResultObjectListToString() + { + var fraudCheckResults = new List { new FraudCheckResult(AccountScore: 1, Name: "test1", CheckId: 1), new FraudCheckResult(AccountScore: 2, Name: "test2", CheckId: 1) }; + var fraudResult = new FraudResult(Results: fraudCheckResults, AccountScore: 1); + var expected = "class FraudResult {\n AccountScore: 1\n Results: \n\t{ class FraudCheckResult {\n AccountScore: 1\n CheckId: 1\n Name: test1\n}\n\n class FraudCheckResult {\n AccountScore: 2\n CheckId: 1\n Name: test2\n}\n\n }\n}\n"; + Assert.AreEqual(expected, fraudResult.ToString()); + } + + [TestMethod] + public void TestToCollectionsStringEmpty() + { + var paymentResultResponse = new PaymentResultResponse(merchantReference:"ref",shopperLocale:"NL", paymentMethod:"applepay"); + var expected = "class PaymentResultResponse {\n AdditionalData: \n FraudResult: \n MerchantReference: ref\n Order: \n PaymentMethod: applepay\n PspReference: \n RefusalReason: \n RefusalReasonCode: \n ResultCode: \n ServiceError: \n ShopperLocale: NL\n}\n"; + Assert.AreEqual(expected, paymentResultResponse.ToString()); + } + + [TestMethod] + public void TestToCollectionsString() + { + var paymentResultResponse = new PaymentResultResponse(merchantReference: "ref", shopperLocale: "NL", paymentMethod: "applepay") + { + AdditionalData = new Dictionary { { "test1", "test1" }, { "test2", "test2" } } + }; + var expected = "class PaymentResultResponse {\n AdditionalData: {test1=test1,test2=test2}\n FraudResult: \n MerchantReference: ref\n Order: \n PaymentMethod: applepay\n PspReference: \n RefusalReason: \n RefusalReasonCode: \n ResultCode: \n ServiceError: \n ShopperLocale: NL\n}\n"; + Assert.AreEqual(expected, paymentResultResponse.ToString()); + } + } +} diff --git a/Adyen.Test/MockPaymentData.cs b/Adyen.Test/MockPaymentData.cs index a279b8526..68438ebe1 100644 --- a/Adyen.Test/MockPaymentData.cs +++ b/Adyen.Test/MockPaymentData.cs @@ -81,11 +81,8 @@ public static PaymentRequestThreeDS2 CreateFullPaymentRequest3DS2() Amount = new Amount("EUR", 1500), Reference = "payment - " + DateTime.Now.ToString("yyyyMMdd"), AdditionalData = CreateAdditionalData(), - ThreeDS2RequestData = new ThreeDS2RequestData - { - ThreeDSCompInd = DeviceFingerprintCompletedEnum.Y, - DeviceChannel = DeviceChannelEnum.Browser - }, + ThreeDS2RequestData = new ThreeDS2RequestData(threeDSCompInd: "Y", + deviceChannel: "browser"), BrowserInfo = CreateMockBrowserInfo(), }; return paymentRequest; diff --git a/Adyen.Test/MockPosApiRequest.cs b/Adyen.Test/MockPosApiRequest.cs index e5dab628b..704238513 100644 --- a/Adyen.Test/MockPosApiRequest.cs +++ b/Adyen.Test/MockPosApiRequest.cs @@ -75,9 +75,53 @@ public static SaleToPOIRequest CreatePosPaymentRequest() }; return saleToPoiRequest; } - + + /// + /// Returns SaleToPOIRequest with MessagePayload PrintRequest with escaped characters + /// + /// SaleToPOIRequest + public static SaleToPOIRequest CreateSaleToPOIPrintRequestEscape() + { + return new SaleToPOIRequest + { + MessageHeader = new MessageHeader() + { + MessageClass = MessageClassType.Device, + MessageCategory = MessageCategoryType.Print, + MessageType = MessageType.Request, + SaleID = "1234567", + POIID = "VX680-12343454", + ServiceID = "1", + }, + MessagePayload = new PrintRequest + { + PrintOutput = new PrintOutput + { + DocumentQualifier = DocumentQualifierType.Document, + ResponseMode = ResponseModeType.PrintEnd, + OutputContent = new OutputContent + { + OutputFormat = OutputFormatType.Text, + OutputText = new OutputText[] { new OutputText { Text = @"m\u006DÄ\u00C4" } }, + }, + }, + }, + }; + } + + /// + /// Dummy Nexo json print request + /// + /// + public static string MockNexoJsonPrintRequest() + { + return "{\"SaleToPOIRequest\":{\"MessageHeader\":{\"MessageClass\":\"Device\",\"MessageCategory\":\"Print\",\"MessageType\":\"Request\",\"ServiceID\":\"1\",\"SaleID\":\"1234567\",\"POIID\":\"VX680-12343454\",\"ProtocolVersion\":\"3.0\"}," + + "\"PrintRequest\":{\"PrintOutput\":{\"OutputContent\":{\"OutputText\":[{\"Color\":\"White\",\"CharacterWidth\":\"SingleWidth\",\"CharacterHeight\":\"SingleHeight\",\"CharacterStyle\":\"Normal\",\"Alignment\":\"Left\"," + + "\"EndOfLineFlag\":true,\"Text\":\"m\\\\u006D?\\\\u00C4\"}],\"OutputFormat\":\"Text\"},\"DocumentQualifier\":\"Document\",\"ResponseMode\":\"PrintEnd\"}}}}"; + } + /// - /// Dummy Nexo json Cloud api/terminal api request + /// Dummy Nexo json api/terminal api request /// /// public static string MockNexoJsonRequest() @@ -90,6 +134,5 @@ public static string MockNexoJsonRequest() " \"Currency\" : \"EUR\",\r\n \"RequestedAmount\" : 15.25 \r\n },\r\n \"TransactionConditions\" : {}\r\n },\r\n " + " \"PaymentData\" : {\"PaymentType\" : \"Normal\"}\r\n }\r\n }\r\n}\r\n"; } - } } diff --git a/Adyen.Test/Mocks/checkout/payment-links-success.json b/Adyen.Test/Mocks/checkout/payment-links-success.json index b91a30ac8..2787a6788 100644 --- a/Adyen.Test/Mocks/checkout/payment-links-success.json +++ b/Adyen.Test/Mocks/checkout/payment-links-success.json @@ -5,5 +5,6 @@ }, "expiresAt": "2019-12-17T10:05:29Z", "reference": "YOUR_ORDER_NUMBER", - "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA" + "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" } \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/paymentlinks-recurring-payment-success.json b/Adyen.Test/Mocks/checkout/paymentlinks-recurring-payment-success.json new file mode 100644 index 000000000..628896bea --- /dev/null +++ b/Adyen.Test/Mocks/checkout/paymentlinks-recurring-payment-success.json @@ -0,0 +1,10 @@ +{ + "amount": { + "currency": "EUR", + "value": 100 + }, + "expiresAt": "2020-10-28T12:00:00Z", + "reference": "REFERENCE_NUMBER", + "url": "https://checkoutshopper-test.adyen.com/checkoutshopper/payByLink.shtml?d=YW1vdW50TWlub3JW...JRA", + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json b/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json new file mode 100644 index 000000000..69fa4430b --- /dev/null +++ b/Adyen.Test/Mocks/checkout/paymentmethod-applepay-request.json @@ -0,0 +1,4 @@ +{ + "type": "applepay", + "applepay.token": "VNRWtuNlNEWkRCSm1xWndjMDFFbktkQU..." +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/payments-success.json b/Adyen.Test/Mocks/checkout/payments-success.json index c4ed10fbe..0deff7d1a 100644 --- a/Adyen.Test/Mocks/checkout/payments-success.json +++ b/Adyen.Test/Mocks/checkout/payments-success.json @@ -11,7 +11,7 @@ "cardIssuingCountry": "NL" }, "fraudResult": { - "accountScore": 0, + "accountScore": 25, "results": [ { "FraudCheckResult": { diff --git a/Adyen.Test/Mocks/checkout/paymentsdetails-action-success.json b/Adyen.Test/Mocks/checkout/paymentsdetails-action-success.json new file mode 100644 index 000000000..06bb004cc --- /dev/null +++ b/Adyen.Test/Mocks/checkout/paymentsdetails-action-success.json @@ -0,0 +1,8 @@ +{ + "action": { + "type": "threeDS2Fingerprint", + "paymentData": "Ab02b4c0!BQABAgBNSfsOs...", + "paymentMethodType": "scheme", + "token": "eyJ0aHJlZURTTWVzc2FnZ..." + } +} diff --git a/Adyen.Test/Mocks/checkout/paymentsresult-error-invalid-data-payload-422.json b/Adyen.Test/Mocks/checkout/paymentsresult-error-invalid-data-payload-422.json index aec41bc02..b4c7109cc 100644 --- a/Adyen.Test/Mocks/checkout/paymentsresult-error-invalid-data-payload-422.json +++ b/Adyen.Test/Mocks/checkout/paymentsresult-error-invalid-data-payload-422.json @@ -2,5 +2,9 @@ "status": 422, "errorCode": "14_018", "message": "Invalid payload provided", - "errorType": "validation" + "errorType": "validation", + "merchantReference": "merchantReference", + "paymentMethod": "applepay", + "shopperLocale": "NL" + } \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/paymentsresult-success.json b/Adyen.Test/Mocks/checkout/paymentsresult-success.json index 9ee3775ce..9cb229a49 100644 --- a/Adyen.Test/Mocks/checkout/paymentsresult-success.json +++ b/Adyen.Test/Mocks/checkout/paymentsresult-success.json @@ -1,4 +1,7 @@ { "pspReference": "8535253563623704", - "resultCode": "Authorised" + "resultCode": "Authorised", + "merchantReference": "merchantReference", + "paymentMethod": "applepay", + "shopperLocale": "NL" } \ No newline at end of file diff --git a/Adyen.Test/Mocks/threedsecure2/authorise-response-identifyshopper.json b/Adyen.Test/Mocks/threedsecure2/authorise-response-identifyshopper.json index 16302d7ec..529194e05 100644 --- a/Adyen.Test/Mocks/threedsecure2/authorise-response-identifyshopper.json +++ b/Adyen.Test/Mocks/threedsecure2/authorise-response-identifyshopper.json @@ -8,7 +8,8 @@ "paymentMethod": "visa", "threeds2.threeDS2Token": "[token]", "paymentMethodVariant": "visa", - "threeds2.threeDSMethodURL": "https:\/\/pal-test.adyen.com\/threeds2simulator\/acs\/startMethod.shtml" + "threeds2.threeDSMethodURL": "https:\/\/pal-test.adyen.com\/threeds2simulator\/acs\/startMethod.shtml", + "deviceChannel": "browser" }, "pspReference": "8535432125638799", "resultCode": "IdentifyShopper" diff --git a/Adyen.Test/Mocks/threedsecure2/authorise3ds2-response-challengeshopper.json b/Adyen.Test/Mocks/threedsecure2/authorise3ds2-response-challengeshopper.json index 649ae554b..79754dfdd 100644 --- a/Adyen.Test/Mocks/threedsecure2/authorise3ds2-response-challengeshopper.json +++ b/Adyen.Test/Mocks/threedsecure2/authorise3ds2-response-challengeshopper.json @@ -8,8 +8,10 @@ "threeds2.threeDS2ResponseData.messageVersion": "2.1.0", "threeds2.threeDS2Token": "[token]", "threeds2.threeDS2ResponseData.acsTransID": "ba961c4b-33f2-4830-3141-744b8586aeb0", - "threeds2.threeDS2ResponseData.acsReferenceNumber": "ADYEN-ACS-SIMULATOR" + "threeds2.threeDS2ResponseData.acsReferenceNumber": "ADYEN-ACS-SIMULATOR", + "threeds2.threeDS2ResponseData.deviceChannel": "browser" }, "pspReference": "8535493828757679", "resultCode": "ChallengeShopper" + } \ No newline at end of file diff --git a/Adyen.Test/Mocks/threedsecure2/authorise3ds2-success.json b/Adyen.Test/Mocks/threedsecure2/authorise3ds2-success.json index 5825b1d7a..a366c618d 100644 --- a/Adyen.Test/Mocks/threedsecure2/authorise3ds2-success.json +++ b/Adyen.Test/Mocks/threedsecure2/authorise3ds2-success.json @@ -1,16 +1,19 @@ { - "additionalData": { - "expiryDate": "10/2020", - "cvcResult": "1 Matches", - "authCode": "62013", - "avsResult": "4 AVS not supported for this card type", - "cardSummary": "1245", - "aliasType": "Default", - "alias": "G250484827315790", - "paymentMethod": "visa", - "paymentMethodVariant": "visa" - }, - "pspReference": "8535493830438417", - "resultCode": "Authorised", - "authCode": "62013" + "additionalData": { + "expiryDate": "10/2020", + "cvcResult": "1 Matches", + "authCode": "62013", + "avsResult": "4 AVS not supported for this card type", + "cardSummary": "1245", + "aliasType": "Default", + "alias": "G250484827315790", + "paymentMethod": "visa", + "paymentMethodVariant": "visa" + }, + "pspReference": "8535493830438417", + "resultCode": "Authorised", + "authCode": "62013", + "merchantReference": "your_merchantReference", + "paymentMethod": "applepay", + "shopperLocale": "NL" } \ No newline at end of file diff --git a/Adyen.Test/ModelTests/NameTests.cs b/Adyen.Test/ModelTests/NameTests.cs index c3ca49010..d6dbf2fd0 100644 --- a/Adyen.Test/ModelTests/NameTests.cs +++ b/Adyen.Test/ModelTests/NameTests.cs @@ -2,6 +2,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; +using System.IO; using System.Text; namespace Adyen.Test.ModelTests @@ -15,7 +16,7 @@ public class NameTests [TestMethod] public void CreatingNameWithoutFirstNameFails() { - Assert.ThrowsException(() => new Name(null, Name.GenderEnum.MALE, null, null)); + Assert.ThrowsException(() => new Name(null, Name.GenderEnum.MALE, null, null)); } /// @@ -24,7 +25,7 @@ public void CreatingNameWithoutFirstNameFails() [TestMethod] public void CreatingNameWithoutLastNameFails() { - Assert.ThrowsException(() => new Name("firstName", Name.GenderEnum.MALE, null, null)); + Assert.ThrowsException(() => new Name("firstName", Name.GenderEnum.MALE, null, null)); } /// diff --git a/Adyen.Test/NotificationDecryptionTest.cs b/Adyen.Test/NotificationDecryptionTest.cs new file mode 100644 index 000000000..57646754d --- /dev/null +++ b/Adyen.Test/NotificationDecryptionTest.cs @@ -0,0 +1,68 @@ +#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 Adyen.Security; +using Adyen.Service; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Text; + +namespace Adyen.Test +{ + [TestClass] + public class NotificationDecryptionTest : BaseTest + { + private EncryptionCredentialDetails _encryptionCredentialDetails; + + [TestInitialize] + public void Initialize() + { + _encryptionCredentialDetails = new EncryptionCredentialDetails + { + AdyenCryptoVersion = 1, + KeyIdentifier = "ncrkey", + Password = "ncrpass" + }; + } + + [TestMethod] + public void TestNotificationDecryption() + { + try + { + var encryptedNotification = @"{""SaleToPOIRequest"":{""SecurityTrailer"":{""AdyenCryptoVersion"":1,""Nonce"":""Be6rAx+vRju2aCHwPh6lrg=="",""KeyIdentifier"":""ncrkey"",""Hmac"":""LG8A9Re1M8xLMr7rDUk0NwsnvAOX+VLjHv9sPHWTl34="",""KeyVersion"":1},""NexoBlob"":""x2DY8J2M9ZCyjOZ8Gt7JdLBA\/6bT\/KXvvAbJf9kzguqO8dWp1I1pPLQpLstpdIiAVqSwG3PR0PrP\/lF82UmhmCnUJGCuEXilqvBNF1tF\/yEgnFOklNc1myR2IPW\/+2oZOWKFXlTo\/gX89EbODXOOGUqaJfSdpDhlqjyMz7mGczobTPvPGqCVx2BDHU8VTxI9nicwQv+QV48GqVZzxnP8ZOdQOQ5cac+bcS0Y3l7SmWpIoQsoicnjahTY9ICosLJmN4DvDHsN4Kh2DAetFO5b9I9Lqgm\/dvnXUVhb9tPbM7Pn+ratjYpaNbonbO5M+Tm8rDEIyKoUUuFXPWISymrCXtCDVKEb2B5S5pilUmokrXVa9Ldtsv3BKG7rbrglYEuql4WVs6kzr6ybgAKh1Q0LsAXEve3pydt72ay4U3FOJSBxJ3gNqmnG8mVW2HCXQVo1RgVaZmP5TBWYuksCKXYypnMulu1PlRI++oeW\/J2qjQU="",""MessageHeader"":{""ProtocolVersion"":""3.0"",""SaleID"":""null"",""MessageClass"":""Event"",""MessageCategory"":""Event"",""POIID"":""P400Plus-275102806"",""MessageType"":""Notification"",""DeviceID"":""5""}}}"; + var expectedDecryption = @"{ ""SaleToPOIRequest"": { ""EventNotification"": { ""EventDetails"": ""reference_id=9876"", ""TimeStamp"": ""2020-11-13T09:02:35.697Z"", ""EventToNotify"": ""SaleWakeUp"" }, ""MessageHeader"": { ""ProtocolVersion"": ""3.0"", ""SaleID"": ""null"", ""MessageClass"": ""Event"", ""MessageCategory"": ""Event"", ""POIID"": ""P400Plus-275102806"", ""MessageType"": ""Notification"", ""DeviceID"": ""5"" } } }"; + + //create a mock client + var client = CreateMockTestClientPosLocalApiRequest("Mocks/terminalapi/pospayment-encrypted-success.json"); + var posPaymentLocalApi = new PosPaymentLocalApi(client); + var decryptedNotification = posPaymentLocalApi.DecryptNotification(encryptedNotification, _encryptionCredentialDetails); + Assert.AreEqual(decryptedNotification, expectedDecryption); + } + catch (Exception) + { + Assert.Fail(); + } + } + } +} \ No newline at end of file diff --git a/Adyen.Test/PaymentMethodDetailsTest.cs b/Adyen.Test/PaymentMethodDetailsTest.cs index ce148bcab..5d4ac4b4b 100644 --- a/Adyen.Test/PaymentMethodDetailsTest.cs +++ b/Adyen.Test/PaymentMethodDetailsTest.cs @@ -21,12 +21,13 @@ #endregion using Adyen.Model.Checkout; +using Adyen.Model.Checkout.Details; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Adyen.Test { [TestClass] - public class PaymentMethodDetailsTest + public class PaymentMethodDetailsTest { [TestMethod] public void TestAchPaymentMethod() @@ -60,7 +61,7 @@ public void TestAchPaymentMethod() Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); } - + [TestMethod] public void TestApplePayPaymentMethod() { @@ -145,5 +146,40 @@ public void TestIdealPaymentMethod() Assert.AreEqual(paymentRequest.Reference, "ideal test"); Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); } + + [TestMethod] + public void TestBacsDirectDebitDetails() + { + var paymentRequest = new PaymentRequest + { + MerchantAccount = "YOUR_MERCHANT_ACCOUNT", + Amount = new Amount("GBP", 1000), + Reference = "bacs direct debit test", + PaymentMethod = new BacsDirectDebitDetails(), + ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." + }; + var paymentMethodDetails = (BacsDirectDebitDetails)paymentRequest.PaymentMethod; + Assert.AreEqual(paymentMethodDetails.Type, "directdebit_GB"); + Assert.AreEqual(paymentRequest.MerchantAccount, "YOUR_MERCHANT_ACCOUNT"); + Assert.AreEqual(paymentRequest.Reference, "bacs direct debit test"); + Assert.AreEqual(paymentRequest.ReturnUrl, "https://your-company.com/checkout?shopperOrder=12xy.."); + } + + + [TestMethod] + public void TestPaypalSuccess() + { + var paymentRequest = new PaymentRequest() + { + MerchantAccount = "YOUR_MERCHANT_ACCOUNT", + Amount = new Amount("USD", 1000), + Reference = "paypal test", + PaymentMethod = new PayPalDetails() { Subtype= PayPalDetails.SubtypeEnum.SDK}, + ReturnUrl = "https://your-company.com/checkout?shopperOrder=12xy.." + }; + var paymentMethodDetails = (PayPalDetails)paymentRequest.PaymentMethod; + Assert.AreEqual(paymentMethodDetails.Type, "paypal"); + Assert.AreEqual(paymentMethodDetails.Subtype, PayPalDetails.SubtypeEnum.SDK); + } } } diff --git a/Adyen.Test/PaymentTest.cs b/Adyen.Test/PaymentTest.cs index 353029bdc..c5a6efd07 100644 --- a/Adyen.Test/PaymentTest.cs +++ b/Adyen.Test/PaymentTest.cs @@ -130,8 +130,6 @@ public void TestAuthorise3DSuccessMocked() Assert.IsNotNull(paymentResult.PspReference); } - - [TestMethod] public void TestAuthoriseErrorCvcDeclinedMocked() { diff --git a/Adyen.Test/RecurringTest.cs b/Adyen.Test/RecurringTest.cs index 5b7b4e7ad..22ada4da3 100644 --- a/Adyen.Test/RecurringTest.cs +++ b/Adyen.Test/RecurringTest.cs @@ -28,6 +28,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Linq; using Recurring = Adyen.Model.Recurring.Recurring; +using System.Threading.Tasks; namespace Adyen.Test { @@ -49,6 +50,20 @@ public void TestListRecurringDetails() Assert.AreEqual("1111", recurringDetail.Card.Number); } + [TestMethod] + public async Task TestListRecurringDetailsAsync() + { + var client = base.CreateMockTestClientNullRequiredFieldsRequest("Mocks/recurring/listRecurringDetails-success.json"); + var recurring = new Service.Recurring(client); + var recurringDetailsRequest = this.CreateRecurringDetailsRequest(); + var recurringDetailsResult = await recurring.ListRecurringDetailsAsync(recurringDetailsRequest); + Assert.AreEqual(1L, (long)recurringDetailsResult.Details.Count); + var recurringDetail = recurringDetailsResult.Details[0].RecurringDetail; + Assert.AreEqual("recurringReference", recurringDetail.RecurringDetailReference); + Assert.AreEqual("cardAlias", recurringDetail.Alias); + Assert.AreEqual("1111", recurringDetail.Card.Number); + } + [TestMethod] public void TestDisable() { diff --git a/Adyen.Test/SerializerTest.cs b/Adyen.Test/SerializerTest.cs index 1616142d4..c6ca64120 100644 --- a/Adyen.Test/SerializerTest.cs +++ b/Adyen.Test/SerializerTest.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; using Microsoft.VisualStudio.TestTools.UnitTesting; using Adyen.Model.Nexo; using System.Text; diff --git a/Adyen.Test/TerminalApiPosSecurityTest.cs b/Adyen.Test/TerminalApiPosSecurityTest.cs index 690e829fa..58f6faf7d 100644 --- a/Adyen.Test/TerminalApiPosSecurityTest.cs +++ b/Adyen.Test/TerminalApiPosSecurityTest.cs @@ -21,6 +21,9 @@ // */ #endregion +using Adyen.ApiSerialization; +using Adyen.Model.Nexo; +using Adyen.Model.Nexo.Message; using Adyen.Security; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -69,5 +72,18 @@ public void TestTerminalApiPosDecryption() Assert.IsNotNull(saleToPoiRequestDecrypt); Assert.AreEqual(saleToPoiRequest, saleToPoiRequestDecrypt); } + + [TestMethod] + public void TestSaleToPoiMessageEscapeStringDecryption() + { + var saleToPoiRequest = MockPosApiRequest.CreateSaleToPOIPrintRequestEscape(); + var messageHeader = MockPosApiRequest.CreateSaleToPOIPrintRequestEscape().MessageHeader; + var saleToPoiMessageSerializer = new SaleToPoiMessageSerializer(); + var saleToPoiRequestMessageSerialized = saleToPoiMessageSerializer.Serialize(saleToPoiRequest); + var saleToPoiMessageSecured = _messageSecuredEncryptor.Encrypt(saleToPoiRequestMessageSerialized, messageHeader, _encryptionCredentialDetails); + var saleToPoiRequestDecrypt = _messageSecuredEncryptor.Decrypt(saleToPoiMessageSecured, _encryptionCredentialDetails); + Assert.IsNotNull(saleToPoiRequestDecrypt); + Assert.AreEqual(MockPosApiRequest.MockNexoJsonPrintRequest(), saleToPoiRequestDecrypt); + } } } diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 780c9321a..005f66a3a 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -4,15 +4,15 @@ netstandard2.0 false Adyen - 5.7.0 - 5.7.0 - 5.7.0 + 6.1.0 + 6.1.0 + 6.1.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 - 5.7.0 + 6.1.0 MIT Adyen Adyen @@ -25,7 +25,7 @@ - + diff --git a/Adyen/CloudApiSerialization/Converter/JSonConvertDeserializerWrapper.cs b/Adyen/ApiSerialization/Converter/JSonConvertDeserializerWrapper.cs similarity index 96% rename from Adyen/CloudApiSerialization/Converter/JSonConvertDeserializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JSonConvertDeserializerWrapper.cs index 24e0cbeab..6a4653c96 100644 --- a/Adyen/CloudApiSerialization/Converter/JSonConvertDeserializerWrapper.cs +++ b/Adyen/ApiSerialization/Converter/JSonConvertDeserializerWrapper.cs @@ -23,7 +23,7 @@ using Newtonsoft.Json; -namespace Adyen.CloudApiSerialization.Converter +namespace Adyen.ApiSerialization.Converter { internal class JSonConvertDeserializerWrapper { diff --git a/Adyen/CloudApiSerialization/Converter/JSonConvertSerializerWrapper.cs b/Adyen/ApiSerialization/Converter/JSonConvertSerializerWrapper.cs similarity index 97% rename from Adyen/CloudApiSerialization/Converter/JSonConvertSerializerWrapper.cs rename to Adyen/ApiSerialization/Converter/JSonConvertSerializerWrapper.cs index 7f4f2b856..6e37b12f1 100644 --- a/Adyen/CloudApiSerialization/Converter/JSonConvertSerializerWrapper.cs +++ b/Adyen/ApiSerialization/Converter/JSonConvertSerializerWrapper.cs @@ -26,7 +26,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.CloudApiSerialization.Converter +namespace Adyen.ApiSerialization.Converter { internal class JSonConvertSerializerWrapper { diff --git a/Adyen/CloudApiSerialization/Converter/JsonBase64Converter.cs b/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs similarity index 97% rename from Adyen/CloudApiSerialization/Converter/JsonBase64Converter.cs rename to Adyen/ApiSerialization/Converter/JsonBase64Converter.cs index 604743e60..56aeec771 100644 --- a/Adyen/CloudApiSerialization/Converter/JsonBase64Converter.cs +++ b/Adyen/ApiSerialization/Converter/JsonBase64Converter.cs @@ -23,7 +23,7 @@ using Newtonsoft.Json; using System; -namespace Adyen.CloudApiSerialization.Converter +namespace Adyen.ApiSerialization.Converter { internal class JsonBase64Converter : JsonConverter { diff --git a/Adyen/CloudApiSerialization/Converter/SaleToPoiMessageConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs similarity index 98% rename from Adyen/CloudApiSerialization/Converter/SaleToPoiMessageConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs index de51b3180..8e643e803 100644 --- a/Adyen/CloudApiSerialization/Converter/SaleToPoiMessageConverter.cs +++ b/Adyen/ApiSerialization/Converter/SaleToPoiMessageConverter.cs @@ -25,7 +25,7 @@ using Adyen.Model.Nexo; using Newtonsoft.Json; -namespace Adyen.CloudApiSerialization.Converter +namespace Adyen.ApiSerialization.Converter { internal class SaleToPoiMessageConverter : JsonConverter { diff --git a/Adyen/CloudApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs b/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs similarity index 98% rename from Adyen/CloudApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs rename to Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs index c985a1305..dde3c0906 100644 --- a/Adyen/CloudApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs +++ b/Adyen/ApiSerialization/Converter/SaleToPoiMessageSecuredConverter.cs @@ -27,7 +27,7 @@ using Adyen.Security; using Newtonsoft.Json; -namespace Adyen.CloudApiSerialization.Converter +namespace Adyen.ApiSerialization.Converter { internal class SaleToPoiMessageSecuredConverter : JsonConverter { diff --git a/Adyen/CloudApiSerialization/IMessagePayload.cs b/Adyen/ApiSerialization/IMessagePayload.cs similarity index 96% rename from Adyen/CloudApiSerialization/IMessagePayload.cs rename to Adyen/ApiSerialization/IMessagePayload.cs index 0e89def65..dad777969 100644 --- a/Adyen/CloudApiSerialization/IMessagePayload.cs +++ b/Adyen/ApiSerialization/IMessagePayload.cs @@ -21,7 +21,7 @@ // */ #endregion -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { public interface IMessagePayload { } } diff --git a/Adyen/CloudApiSerialization/IMessagePayloadSerializer.cs b/Adyen/ApiSerialization/IMessagePayloadSerializer.cs similarity index 96% rename from Adyen/CloudApiSerialization/IMessagePayloadSerializer.cs rename to Adyen/ApiSerialization/IMessagePayloadSerializer.cs index 7f7446fb1..371e2af06 100644 --- a/Adyen/CloudApiSerialization/IMessagePayloadSerializer.cs +++ b/Adyen/ApiSerialization/IMessagePayloadSerializer.cs @@ -21,7 +21,7 @@ // */ #endregion -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal interface IMessagePayloadSerializer where T : IMessagePayload { diff --git a/Adyen/CloudApiSerialization/JSonConvertDeserializerWrapper.cs b/Adyen/ApiSerialization/JSonConvertDeserializerWrapper.cs similarity index 98% rename from Adyen/CloudApiSerialization/JSonConvertDeserializerWrapper.cs rename to Adyen/ApiSerialization/JSonConvertDeserializerWrapper.cs index ecb030e50..e3d5af5c4 100644 --- a/Adyen/CloudApiSerialization/JSonConvertDeserializerWrapper.cs +++ b/Adyen/ApiSerialization/JSonConvertDeserializerWrapper.cs @@ -25,7 +25,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal class JSonConvertDeserializerWrapper { diff --git a/Adyen/CloudApiSerialization/MessageHeaderSerializer.cs b/Adyen/ApiSerialization/MessageHeaderSerializer.cs similarity index 97% rename from Adyen/CloudApiSerialization/MessageHeaderSerializer.cs rename to Adyen/ApiSerialization/MessageHeaderSerializer.cs index 7869cbaa3..02e7e8ef0 100644 --- a/Adyen/CloudApiSerialization/MessageHeaderSerializer.cs +++ b/Adyen/ApiSerialization/MessageHeaderSerializer.cs @@ -23,7 +23,7 @@ using Adyen.Model.Nexo; -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal class MessageHeaderSerializer { diff --git a/Adyen/CloudApiSerialization/MessagePayloadSerializer.cs b/Adyen/ApiSerialization/MessagePayloadSerializer.cs similarity index 97% rename from Adyen/CloudApiSerialization/MessagePayloadSerializer.cs rename to Adyen/ApiSerialization/MessagePayloadSerializer.cs index 9e74dcb71..3a86c4489 100644 --- a/Adyen/CloudApiSerialization/MessagePayloadSerializer.cs +++ b/Adyen/ApiSerialization/MessagePayloadSerializer.cs @@ -21,7 +21,7 @@ // */ #endregion -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal class MessagePayloadSerializer : IMessagePayloadSerializer where T : IMessagePayload { diff --git a/Adyen/CloudApiSerialization/MessagePayloadSerializerFactory.cs b/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs similarity index 98% rename from Adyen/CloudApiSerialization/MessagePayloadSerializerFactory.cs rename to Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs index 97461dabc..6cdd39826 100644 --- a/Adyen/CloudApiSerialization/MessagePayloadSerializerFactory.cs +++ b/Adyen/ApiSerialization/MessagePayloadSerializerFactory.cs @@ -24,7 +24,7 @@ using System; using Adyen.Model.Nexo; -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal class MessagePayloadSerializerFactory { diff --git a/Adyen/CloudApiSerialization/SaleToPoiMessageSecuredSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs similarity index 98% rename from Adyen/CloudApiSerialization/SaleToPoiMessageSecuredSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs index b4102297f..18c1f18c6 100644 --- a/Adyen/CloudApiSerialization/SaleToPoiMessageSecuredSerializer.cs +++ b/Adyen/ApiSerialization/SaleToPoiMessageSecuredSerializer.cs @@ -28,7 +28,7 @@ using Adyen.Security; using Newtonsoft.Json.Linq; -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { internal class SaleToPoiMessageSecuredSerializer { diff --git a/Adyen/CloudApiSerialization/SaleToPoiMessageSerializer.cs b/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs similarity index 99% rename from Adyen/CloudApiSerialization/SaleToPoiMessageSerializer.cs rename to Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs index c80c99d5c..c8b908d37 100644 --- a/Adyen/CloudApiSerialization/SaleToPoiMessageSerializer.cs +++ b/Adyen/ApiSerialization/SaleToPoiMessageSerializer.cs @@ -25,7 +25,7 @@ using Adyen.Security; using Newtonsoft.Json.Linq; -namespace Adyen.CloudApiSerialization +namespace Adyen.ApiSerialization { public class SaleToPoiMessageSerializer { diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index d414806ee..f39b2ee53 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -44,9 +44,8 @@ public class ClientConfig public static string RecurringApiVersion = "v25"; public static string ApiVersion = "v51"; public static string PayoutApiVersion = "v51"; - public static string CheckoutApiVersion = "v51"; + public static string CheckoutApiVersion = "v66"; public static string PosTerminalManagementVersion = "v1"; - public static string CheckoutUtilityApiVersion = "v1"; public static string UserAgentSuffix = "adyen-dotnet-api-library/"; public static string EndpointProtocol = "https://"; public static string NexoProtocolVersion = "3.0"; @@ -54,6 +53,6 @@ public class ClientConfig public static string BinLookupApiVersion = "v50"; public static string LibName = "adyen-dotnet-api-library"; - public static string LibVersion = "5.7.0"; + public static string LibVersion = "6.1.0"; } } diff --git a/Adyen/Model/Checkout/AccountInfo.cs b/Adyen/Model/Checkout/AccountInfo.cs index 3294a1e10..c7d7b693a 100644 --- a/Adyen/Model/Checkout/AccountInfo.cs +++ b/Adyen/Model/Checkout/AccountInfo.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,358 +36,382 @@ namespace Adyen.Model.Checkout /// AccountInfo /// [DataContract] - public partial class AccountInfo : IEquatable, IValidatableObject + public partial class AccountInfo : IEquatable, IValidatableObject { /// - /// Indicator of how long this shopper account exists in the merchant's environment. + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator of how long this shopper account exists in the merchant's environment. + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days [JsonConverter(typeof(StringEnumConverter))] public enum AccountAgeIndicatorEnum { - /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] - NotApplicable = 1, - + [EnumMember(Value = "notApplicable")] NotApplicable = 1, + /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] - ThisTransaction = 2, - + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, + /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] - LessThan30Days = 3, - + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, + /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] - From30To60Days = 4, - + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, + /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] - MoreThan60Days = 5 + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 } /// - /// Indicator of how long this shopper account exists in the merchant's environment. + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator of how long this shopper account exists in the merchant's environment. - [DataMember(Name="accountAgeIndicator", EmitDefaultValue=false)] + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [DataMember(Name = "accountAgeIndicator", EmitDefaultValue = false)] public AccountAgeIndicatorEnum? AccountAgeIndicator { get; set; } + /// - /// Indicator when the shopper's account was last changed. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator when the shopper's account was last changed. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days [JsonConverter(typeof(StringEnumConverter))] public enum AccountChangeIndicatorEnum { - /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] - ThisTransaction = 1, - + [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, + /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] - LessThan30Days = 2, - + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, + /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] - From30To60Days = 3, - + [EnumMember(Value = "from30To60Days")] From30To60Days = 3, + /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] - MoreThan60Days = 4 + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 } /// - /// Indicator when the shopper's account was last changed. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator when the shopper's account was last changed. - [DataMember(Name="accountChangeIndicator", EmitDefaultValue=false)] + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [DataMember(Name = "accountChangeIndicator", EmitDefaultValue = false)] public AccountChangeIndicatorEnum? AccountChangeIndicator { get; set; } + + /// + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + /// + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + [JsonConverter(typeof(StringEnumConverter))] + public enum AccountTypeEnum + { + /// + /// Enum NotApplicable for value: notApplicable + /// + [EnumMember(Value = "notApplicable")] NotApplicable = 1, + + /// + /// Enum Credit for value: credit + /// + [EnumMember(Value = "credit")] Credit = 2, + + /// + /// Enum Debit for value: debit + /// + [EnumMember(Value = "debit")] Debit = 3 + } + + /// + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + /// + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit + [DataMember(Name = "accountType", EmitDefaultValue = false)] + public AccountTypeEnum? AccountType { get; set; } + /// - /// Indicator for when this delivery address was last used. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator for when this delivery address was last used. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressUsageIndicatorEnum { - /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] - ThisTransaction = 1, - + [EnumMember(Value = "thisTransaction")] ThisTransaction = 1, + /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] - LessThan30Days = 2, - + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 2, + /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] - From30To60Days = 3, - + [EnumMember(Value = "from30To60Days")] From30To60Days = 3, + /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] - MoreThan60Days = 4 + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 4 } /// - /// Indicator for when this delivery address was last used. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator for when this delivery address was last used. - [DataMember(Name="deliveryAddressUsageIndicator", EmitDefaultValue=false)] + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [DataMember(Name = "deliveryAddressUsageIndicator", EmitDefaultValue = false)] public DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator { get; set; } + /// - /// Indicator when the shopper has changed their password. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator when the shopper has changed their password. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days [JsonConverter(typeof(StringEnumConverter))] public enum PasswordChangeIndicatorEnum { - /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] - NotApplicable = 1, - + [EnumMember(Value = "notApplicable")] NotApplicable = 1, + /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] - ThisTransaction = 2, - + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, + /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] - LessThan30Days = 3, - + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, + /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] - From30To60Days = 4, - + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, + /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] - MoreThan60Days = 5 + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 } /// - /// Indicator when the shopper has changed their password. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator when the shopper has changed their password. - [DataMember(Name="passwordChangeIndicator", EmitDefaultValue=false)] + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [DataMember(Name = "passwordChangeIndicator", EmitDefaultValue = false)] public PasswordChangeIndicatorEnum? PasswordChangeIndicator { get; set; } + /// - /// Indicator for the amount of time this payment method was enrolled with this account. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator for the amount of time this payment method was enrolled with this account. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days [JsonConverter(typeof(StringEnumConverter))] public enum PaymentAccountIndicatorEnum { - /// /// Enum NotApplicable for value: notApplicable /// - [EnumMember(Value = "notApplicable")] - NotApplicable = 1, - + [EnumMember(Value = "notApplicable")] NotApplicable = 1, + /// /// Enum ThisTransaction for value: thisTransaction /// - [EnumMember(Value = "thisTransaction")] - ThisTransaction = 2, - + [EnumMember(Value = "thisTransaction")] ThisTransaction = 2, + /// /// Enum LessThan30Days for value: lessThan30Days /// - [EnumMember(Value = "lessThan30Days")] - LessThan30Days = 3, - + [EnumMember(Value = "lessThan30Days")] LessThan30Days = 3, + /// /// Enum From30To60Days for value: from30To60Days /// - [EnumMember(Value = "from30To60Days")] - From30To60Days = 4, - + [EnumMember(Value = "from30To60Days")] From30To60Days = 4, + /// /// Enum MoreThan60Days for value: moreThan60Days /// - [EnumMember(Value = "moreThan60Days")] - MoreThan60Days = 5 + [EnumMember(Value = "moreThan60Days")] MoreThan60Days = 5 } /// - /// Indicator for the amount of time this payment method was enrolled with this account. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days /// - /// Indicator for the amount of time this payment method was enrolled with this account. - [DataMember(Name="paymentAccountIndicator", EmitDefaultValue=false)] + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days + [DataMember(Name = "paymentAccountIndicator", EmitDefaultValue = false)] public PaymentAccountIndicatorEnum? PaymentAccountIndicator { get; set; } + /// /// Initializes a new instance of the class. /// - /// Indicator of how long this shopper account exists in the merchant's environment.. - /// Date when the shopper's account was last changed.. - /// Indicator when the shopper's account was last changed.. - /// Date when the shopper's account was created.. - /// Number of attempts the shopper tried to add a card to their account in the last day.. - /// Date the selected delivery address was last used.. - /// Indicator for when this delivery address was last used.. - /// Shopper's home phone number (including the country code).. - /// Shopper's mobile phone number (including the country code).. - /// Date when the shopper has changed their password.. - /// Indicator when the shopper has changed their password.. - /// Number of transactions of this shopper in the past 24 hours.. - /// Number of transactions of this shopper in the past year.. - /// Date this payment method was added to the shopper's account.. - /// Indicator for the amount of time this payment method was enrolled with this account.. - /// Number of purchases in the last 6 months.. - /// Whether suspicious activity was recorded on this account.. - /// Shopper's work phone number (including the country code).. - public AccountInfo(AccountAgeIndicatorEnum? AccountAgeIndicator = default(AccountAgeIndicatorEnum?), DateTime? AccountChangeDate = default(DateTime?), AccountChangeIndicatorEnum? AccountChangeIndicator = default(AccountChangeIndicatorEnum?), DateTime? AccountCreationDate = default(DateTime?), int? AddCardAttemptsDay = default(int?), DateTime? DeliveryAddressUsageDate = default(DateTime?), DeliveryAddressUsageIndicatorEnum? DeliveryAddressUsageIndicator = default(DeliveryAddressUsageIndicatorEnum?), string HomePhone = default(string), string MobilePhone = default(string), DateTime? PasswordChangeDate = default(DateTime?), PasswordChangeIndicatorEnum? PasswordChangeIndicator = default(PasswordChangeIndicatorEnum?), int? PastTransactionsDay = default(int?), int? PastTransactionsYear = default(int?), DateTime? PaymentAccountAge = default(DateTime?), PaymentAccountIndicatorEnum? PaymentAccountIndicator = default(PaymentAccountIndicatorEnum?), int? PurchasesLast6Months = default(int?), bool? SuspiciousActivity = default(bool?), string WorkPhone = default(string)) + /// Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Date when the shopper's account was last changed.. + /// Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Date when the shopper's account was created.. + /// Indicates the type of account. For example, for a multi-account card product. Allowed values: * notApplicable * credit * debit. + /// Number of attempts the shopper tried to add a card to their account in the last day.. + /// Date the selected delivery address was first used.. + /// Indicator for the length of time since this delivery address was first used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Shopper's home phone number (including the country code).. + /// Shopper's mobile phone number (including the country code).. + /// Date when the shopper last changed their password.. + /// Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours.. + /// Number of all transactions (successful and abandoned) from this shopper in the past year.. + /// Date this payment method was added to the shopper's account.. + /// Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days. + /// Number of successful purchases in the last six months.. + /// Whether suspicious activity was recorded on this account.. + /// Shopper's work phone number (including the country code).. + public AccountInfo(AccountAgeIndicatorEnum? accountAgeIndicator = default(AccountAgeIndicatorEnum?), + DateTime? accountChangeDate = default(DateTime?), + AccountChangeIndicatorEnum? accountChangeIndicator = default(AccountChangeIndicatorEnum?), + DateTime? accountCreationDate = default(DateTime?), + AccountTypeEnum? accountType = default(AccountTypeEnum?), int? addCardAttemptsDay = default(int?), + DateTime? deliveryAddressUsageDate = default(DateTime?), + DeliveryAddressUsageIndicatorEnum? deliveryAddressUsageIndicator = + default(DeliveryAddressUsageIndicatorEnum?), string homePhone = default(string), + string mobilePhone = default(string), DateTime? passwordChangeDate = default(DateTime?), + PasswordChangeIndicatorEnum? passwordChangeIndicator = default(PasswordChangeIndicatorEnum?), + int? pastTransactionsDay = default(int?), int? pastTransactionsYear = default(int?), + DateTime? paymentAccountAge = default(DateTime?), + PaymentAccountIndicatorEnum? paymentAccountIndicator = default(PaymentAccountIndicatorEnum?), + int? purchasesLast6Months = default(int?), bool? suspiciousActivity = default(bool?), + string workPhone = default(string)) { - this.AccountAgeIndicator = AccountAgeIndicator; - this.AccountChangeDate = AccountChangeDate; - this.AccountChangeIndicator = AccountChangeIndicator; - this.AccountCreationDate = AccountCreationDate; - this.AddCardAttemptsDay = AddCardAttemptsDay; - this.DeliveryAddressUsageDate = DeliveryAddressUsageDate; - this.DeliveryAddressUsageIndicator = DeliveryAddressUsageIndicator; - this.HomePhone = HomePhone; - this.MobilePhone = MobilePhone; - this.PasswordChangeDate = PasswordChangeDate; - this.PasswordChangeIndicator = PasswordChangeIndicator; - this.PastTransactionsDay = PastTransactionsDay; - this.PastTransactionsYear = PastTransactionsYear; - this.PaymentAccountAge = PaymentAccountAge; - this.PaymentAccountIndicator = PaymentAccountIndicator; - this.PurchasesLast6Months = PurchasesLast6Months; - this.SuspiciousActivity = SuspiciousActivity; - this.WorkPhone = WorkPhone; + this.AccountAgeIndicator = accountAgeIndicator; + this.AccountChangeDate = accountChangeDate; + this.AccountChangeIndicator = accountChangeIndicator; + this.AccountCreationDate = accountCreationDate; + this.AccountType = accountType; + this.AddCardAttemptsDay = addCardAttemptsDay; + this.DeliveryAddressUsageDate = deliveryAddressUsageDate; + this.DeliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + this.HomePhone = homePhone; + this.MobilePhone = mobilePhone; + this.PasswordChangeDate = passwordChangeDate; + this.PasswordChangeIndicator = passwordChangeIndicator; + this.PastTransactionsDay = pastTransactionsDay; + this.PastTransactionsYear = pastTransactionsYear; + this.PaymentAccountAge = paymentAccountAge; + this.PaymentAccountIndicator = paymentAccountIndicator; + this.PurchasesLast6Months = purchasesLast6Months; + this.SuspiciousActivity = suspiciousActivity; + this.WorkPhone = workPhone; } - + /// - /// Date when the shopper's account was last changed. + /// Date when the shopper's account was last changed. /// - /// Date when the shopper's account was last changed. - [DataMember(Name="accountChangeDate", EmitDefaultValue=false)] + /// Date when the shopper's account was last changed. + [DataMember(Name = "accountChangeDate", EmitDefaultValue = false)] public DateTime? AccountChangeDate { get; set; } /// - /// Date when the shopper's account was created. + /// Date when the shopper's account was created. /// - /// Date when the shopper's account was created. - [DataMember(Name="accountCreationDate", EmitDefaultValue=false)] + /// Date when the shopper's account was created. + [DataMember(Name = "accountCreationDate", EmitDefaultValue = false)] public DateTime? AccountCreationDate { get; set; } + /// /// Number of attempts the shopper tried to add a card to their account in the last day. /// /// Number of attempts the shopper tried to add a card to their account in the last day. - [DataMember(Name="addCardAttemptsDay", EmitDefaultValue=false)] + [DataMember(Name = "addCardAttemptsDay", EmitDefaultValue = false)] public int? AddCardAttemptsDay { get; set; } /// - /// Date the selected delivery address was last used. + /// Date the selected delivery address was first used. /// - /// Date the selected delivery address was last used. - [DataMember(Name="deliveryAddressUsageDate", EmitDefaultValue=false)] + /// Date the selected delivery address was first used. + [DataMember(Name = "deliveryAddressUsageDate", EmitDefaultValue = false)] public DateTime? DeliveryAddressUsageDate { get; set; } /// - /// Shopper's home phone number (including the country code). + /// Shopper's home phone number (including the country code). /// - /// Shopper's home phone number (including the country code). - [DataMember(Name="homePhone", EmitDefaultValue=false)] + /// Shopper's home phone number (including the country code). + [DataMember(Name = "homePhone", EmitDefaultValue = false)] public string HomePhone { get; set; } /// - /// Shopper's mobile phone number (including the country code). + /// Shopper's mobile phone number (including the country code). /// - /// Shopper's mobile phone number (including the country code). - [DataMember(Name="mobilePhone", EmitDefaultValue=false)] + /// Shopper's mobile phone number (including the country code). + [DataMember(Name = "mobilePhone", EmitDefaultValue = false)] public string MobilePhone { get; set; } /// - /// Date when the shopper has changed their password. + /// Date when the shopper last changed their password. /// - /// Date when the shopper has changed their password. - [DataMember(Name="passwordChangeDate", EmitDefaultValue=false)] + /// Date when the shopper last changed their password. + [DataMember(Name = "passwordChangeDate", EmitDefaultValue = false)] public DateTime? PasswordChangeDate { get; set; } /// - /// Number of transactions of this shopper in the past 24 hours. + /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. /// - /// Number of transactions of this shopper in the past 24 hours. - [DataMember(Name="pastTransactionsDay", EmitDefaultValue=false)] + /// Number of all transactions (successful and abandoned) from this shopper in the past 24 hours. + [DataMember(Name = "pastTransactionsDay", EmitDefaultValue = false)] public int? PastTransactionsDay { get; set; } /// - /// Number of transactions of this shopper in the past year. + /// Number of all transactions (successful and abandoned) from this shopper in the past year. /// - /// Number of transactions of this shopper in the past year. - [DataMember(Name="pastTransactionsYear", EmitDefaultValue=false)] + /// Number of all transactions (successful and abandoned) from this shopper in the past year. + [DataMember(Name = "pastTransactionsYear", EmitDefaultValue = false)] public int? PastTransactionsYear { get; set; } /// - /// Date this payment method was added to the shopper's account. + /// Date this payment method was added to the shopper's account. /// - /// Date this payment method was added to the shopper's account. - [DataMember(Name="paymentAccountAge", EmitDefaultValue=false)] + /// Date this payment method was added to the shopper's account. + [DataMember(Name = "paymentAccountAge", EmitDefaultValue = false)] public DateTime? PaymentAccountAge { get; set; } /// - /// Number of purchases in the last 6 months. + /// Number of successful purchases in the last six months. /// - /// Number of purchases in the last 6 months. - [DataMember(Name="purchasesLast6Months", EmitDefaultValue=false)] + /// Number of successful purchases in the last six months. + [DataMember(Name = "purchasesLast6Months", EmitDefaultValue = false)] public int? PurchasesLast6Months { get; set; } /// /// Whether suspicious activity was recorded on this account. /// /// Whether suspicious activity was recorded on this account. - [DataMember(Name="suspiciousActivity", EmitDefaultValue=false)] + [DataMember(Name = "suspiciousActivity", EmitDefaultValue = false)] public bool? SuspiciousActivity { get; set; } /// - /// Shopper's work phone number (including the country code). + /// Shopper's work phone number (including the country code). /// - /// Shopper's work phone number (including the country code). - [DataMember(Name="workPhone", EmitDefaultValue=false)] + /// Shopper's work phone number (including the country code). + [DataMember(Name = "workPhone", EmitDefaultValue = false)] public string WorkPhone { get; set; } /// @@ -401,6 +426,7 @@ public override string ToString() sb.Append(" AccountChangeDate: ").Append(AccountChangeDate).Append("\n"); sb.Append(" AccountChangeIndicator: ").Append(AccountChangeIndicator).Append("\n"); sb.Append(" AccountCreationDate: ").Append(AccountCreationDate).Append("\n"); + sb.Append(" AccountType: ").Append(AccountType).Append("\n"); sb.Append(" AddCardAttemptsDay: ").Append(AddCardAttemptsDay).Append("\n"); sb.Append(" DeliveryAddressUsageDate: ").Append(DeliveryAddressUsageDate).Append("\n"); sb.Append(" DeliveryAddressUsageIndicator: ").Append(DeliveryAddressUsageIndicator).Append("\n"); @@ -418,12 +444,12 @@ public override string ToString() 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); } @@ -448,96 +474,101 @@ public bool Equals(AccountInfo input) if (input == null) return false; - return + return ( this.AccountAgeIndicator == input.AccountAgeIndicator || - (this.AccountAgeIndicator != null && - this.AccountAgeIndicator.Equals(input.AccountAgeIndicator)) - ) && + this.AccountAgeIndicator != null && + this.AccountAgeIndicator.Equals(input.AccountAgeIndicator) + ) && ( this.AccountChangeDate == input.AccountChangeDate || - (this.AccountChangeDate != null && - this.AccountChangeDate.Equals(input.AccountChangeDate)) - ) && + this.AccountChangeDate != null && + this.AccountChangeDate.Equals(input.AccountChangeDate) + ) && ( this.AccountChangeIndicator == input.AccountChangeIndicator || - (this.AccountChangeIndicator != null && - this.AccountChangeIndicator.Equals(input.AccountChangeIndicator)) - ) && + this.AccountChangeIndicator != null && + this.AccountChangeIndicator.Equals(input.AccountChangeIndicator) + ) && ( this.AccountCreationDate == input.AccountCreationDate || - (this.AccountCreationDate != null && - this.AccountCreationDate.Equals(input.AccountCreationDate)) - ) && + this.AccountCreationDate != null && + this.AccountCreationDate.Equals(input.AccountCreationDate) + ) && + ( + this.AccountType == input.AccountType || + this.AccountType != null && + this.AccountType.Equals(input.AccountType) + ) && ( this.AddCardAttemptsDay == input.AddCardAttemptsDay || - (this.AddCardAttemptsDay != null && - this.AddCardAttemptsDay.Equals(input.AddCardAttemptsDay)) - ) && + this.AddCardAttemptsDay != null && + this.AddCardAttemptsDay.Equals(input.AddCardAttemptsDay) + ) && ( this.DeliveryAddressUsageDate == input.DeliveryAddressUsageDate || - (this.DeliveryAddressUsageDate != null && - this.DeliveryAddressUsageDate.Equals(input.DeliveryAddressUsageDate)) - ) && + this.DeliveryAddressUsageDate != null && + this.DeliveryAddressUsageDate.Equals(input.DeliveryAddressUsageDate) + ) && ( this.DeliveryAddressUsageIndicator == input.DeliveryAddressUsageIndicator || - (this.DeliveryAddressUsageIndicator != null && - this.DeliveryAddressUsageIndicator.Equals(input.DeliveryAddressUsageIndicator)) - ) && + this.DeliveryAddressUsageIndicator != null && + this.DeliveryAddressUsageIndicator.Equals(input.DeliveryAddressUsageIndicator) + ) && ( this.HomePhone == input.HomePhone || - (this.HomePhone != null && - this.HomePhone.Equals(input.HomePhone)) - ) && + this.HomePhone != null && + this.HomePhone.Equals(input.HomePhone) + ) && ( this.MobilePhone == input.MobilePhone || - (this.MobilePhone != null && - this.MobilePhone.Equals(input.MobilePhone)) - ) && + this.MobilePhone != null && + this.MobilePhone.Equals(input.MobilePhone) + ) && ( this.PasswordChangeDate == input.PasswordChangeDate || - (this.PasswordChangeDate != null && - this.PasswordChangeDate.Equals(input.PasswordChangeDate)) - ) && + this.PasswordChangeDate != null && + this.PasswordChangeDate.Equals(input.PasswordChangeDate) + ) && ( this.PasswordChangeIndicator == input.PasswordChangeIndicator || - (this.PasswordChangeIndicator != null && - this.PasswordChangeIndicator.Equals(input.PasswordChangeIndicator)) - ) && + this.PasswordChangeIndicator != null && + this.PasswordChangeIndicator.Equals(input.PasswordChangeIndicator) + ) && ( this.PastTransactionsDay == input.PastTransactionsDay || - (this.PastTransactionsDay != null && - this.PastTransactionsDay.Equals(input.PastTransactionsDay)) - ) && + this.PastTransactionsDay != null && + this.PastTransactionsDay.Equals(input.PastTransactionsDay) + ) && ( this.PastTransactionsYear == input.PastTransactionsYear || - (this.PastTransactionsYear != null && - this.PastTransactionsYear.Equals(input.PastTransactionsYear)) - ) && + this.PastTransactionsYear != null && + this.PastTransactionsYear.Equals(input.PastTransactionsYear) + ) && ( this.PaymentAccountAge == input.PaymentAccountAge || - (this.PaymentAccountAge != null && - this.PaymentAccountAge.Equals(input.PaymentAccountAge)) - ) && + this.PaymentAccountAge != null && + this.PaymentAccountAge.Equals(input.PaymentAccountAge) + ) && ( this.PaymentAccountIndicator == input.PaymentAccountIndicator || - (this.PaymentAccountIndicator != null && - this.PaymentAccountIndicator.Equals(input.PaymentAccountIndicator)) - ) && + this.PaymentAccountIndicator != null && + this.PaymentAccountIndicator.Equals(input.PaymentAccountIndicator) + ) && ( this.PurchasesLast6Months == input.PurchasesLast6Months || - (this.PurchasesLast6Months != null && - this.PurchasesLast6Months.Equals(input.PurchasesLast6Months)) - ) && + this.PurchasesLast6Months != null && + this.PurchasesLast6Months.Equals(input.PurchasesLast6Months) + ) && ( this.SuspiciousActivity == input.SuspiciousActivity || - (this.SuspiciousActivity != null && - this.SuspiciousActivity.Equals(input.SuspiciousActivity)) - ) && + this.SuspiciousActivity != null && + this.SuspiciousActivity.Equals(input.SuspiciousActivity) + ) && ( this.WorkPhone == input.WorkPhone || - (this.WorkPhone != null && - this.WorkPhone.Equals(input.WorkPhone)) + this.WorkPhone != null && + this.WorkPhone.Equals(input.WorkPhone) ); } @@ -558,6 +589,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.AccountChangeIndicator.GetHashCode(); if (this.AccountCreationDate != null) hashCode = hashCode * 59 + this.AccountCreationDate.GetHashCode(); + if (this.AccountType != null) + hashCode = hashCode * 59 + this.AccountType.GetHashCode(); if (this.AddCardAttemptsDay != null) hashCode = hashCode * 59 + this.AddCardAttemptsDay.GetHashCode(); if (this.DeliveryAddressUsageDate != null) @@ -595,10 +628,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutAwaitAction.cs b/Adyen/Model/Checkout/Action/CheckoutAwaitAction.cs new file mode 100644 index 000000000..ae2031c08 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutAwaitAction.cs @@ -0,0 +1,173 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutAwaitAction + /// + [DataContract] + public partial class CheckoutAwaitAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "await"; + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// Specifies the URL to redirect to.. + public CheckoutAwaitAction(string paymentData = default(string), string paymentMethodType = default(string), + string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutAwaitAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutAwaitAction); + } + + /// + /// Returns true if CheckoutAwaitAction instances are equal + /// + /// Instance of CheckoutAwaitAction to be compared + /// Boolean + public bool Equals(CheckoutAwaitAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutDonationAction.cs b/Adyen/Model/Checkout/Action/CheckoutDonationAction.cs new file mode 100644 index 000000000..7f4180f94 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutDonationAction.cs @@ -0,0 +1,174 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutDonationAction + /// + [DataContract] + public partial class CheckoutDonationAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "donation"; + + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// Specifies the URL to redirect to.. + public CheckoutDonationAction(string paymentData = default(string), string paymentMethodType = default(string), + string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutDonationAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutDonationAction); + } + + /// + /// Returns true if CheckoutDonationAction instances are equal + /// + /// Instance of CheckoutDonationAction to be compared + /// Boolean + public bool Equals(CheckoutDonationAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutOneTimePasscodeAction.cs b/Adyen/Model/Checkout/Action/CheckoutOneTimePasscodeAction.cs new file mode 100644 index 000000000..acf297e63 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutOneTimePasscodeAction.cs @@ -0,0 +1,242 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutOneTimePasscodeAction + /// + [DataContract] + public partial class CheckoutOneTimePasscodeAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "oneTimePasscode"; + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// redirect. + /// The interval in second between OTP resend.. + /// The maximum number of OTP resend attempts.. + /// The URL, to which you make POST request to trigger OTP resend.. + /// Specifies the URL to redirect to.. + public CheckoutOneTimePasscodeAction(string paymentData = default(string), + string paymentMethodType = default(string), Redirect redirect = default(Redirect), + int? resendInterval = default(int?), int? resendMaxAttempts = default(int?), + string resendUrl = default(string), string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Redirect = redirect; + this.ResendInterval = resendInterval; + this.ResendMaxAttempts = resendMaxAttempts; + this.ResendUrl = resendUrl; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// Gets or Sets Redirect + /// + [DataMember(Name = "redirect", EmitDefaultValue = false)] + public Redirect Redirect { get; set; } + + /// + /// The interval in second between OTP resend. + /// + /// The interval in second between OTP resend. + [DataMember(Name = "resendInterval", EmitDefaultValue = false)] + public int? ResendInterval { get; set; } + + /// + /// The maximum number of OTP resend attempts. + /// + /// The maximum number of OTP resend attempts. + [DataMember(Name = "resendMaxAttempts", EmitDefaultValue = false)] + public int? ResendMaxAttempts { get; set; } + + /// + /// The URL, to which you make POST request to trigger OTP resend. + /// + /// The URL, to which you make POST request to trigger OTP resend. + [DataMember(Name = "resendUrl", EmitDefaultValue = false)] + public string ResendUrl { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutOneTimePasscodeAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Redirect: ").Append(Redirect).Append("\n"); + sb.Append(" ResendInterval: ").Append(ResendInterval).Append("\n"); + sb.Append(" ResendMaxAttempts: ").Append(ResendMaxAttempts).Append("\n"); + sb.Append(" ResendUrl: ").Append(ResendUrl).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutOneTimePasscodeAction); + } + + /// + /// Returns true if CheckoutOneTimePasscodeAction instances are equal + /// + /// Instance of CheckoutOneTimePasscodeAction to be compared + /// Boolean + public bool Equals(CheckoutOneTimePasscodeAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Redirect == input.Redirect || + this.Redirect != null && + this.Redirect.Equals(input.Redirect) + ) && + ( + this.ResendInterval == input.ResendInterval || + this.ResendInterval != null && + this.ResendInterval.Equals(input.ResendInterval) + ) && + ( + this.ResendMaxAttempts == input.ResendMaxAttempts || + this.ResendMaxAttempts != null && + this.ResendMaxAttempts.Equals(input.ResendMaxAttempts) + ) && + ( + this.ResendUrl == input.ResendUrl || + this.ResendUrl != null && + this.ResendUrl.Equals(input.ResendUrl) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Redirect != null) + hashCode = hashCode * 59 + this.Redirect.GetHashCode(); + if (this.ResendInterval != null) + hashCode = hashCode * 59 + this.ResendInterval.GetHashCode(); + if (this.ResendMaxAttempts != null) + hashCode = hashCode * 59 + this.ResendMaxAttempts.GetHashCode(); + if (this.ResendUrl != null) + hashCode = hashCode * 59 + this.ResendUrl.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutQrCodeAction.cs b/Adyen/Model/Checkout/Action/CheckoutQrCodeAction.cs new file mode 100644 index 000000000..0e2a95fb9 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutQrCodeAction.cs @@ -0,0 +1,190 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutQrCodeAction + /// + [DataContract] + public partial class CheckoutQrCodeAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "qrCode"; + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// The contents of the QR code as a UTF8 string.. + /// Specifies the URL to redirect to.. + public CheckoutQrCodeAction(string paymentData = default(string), string paymentMethodType = default(string), + string qrCodeData = default(string), string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.QrCodeData = qrCodeData; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// The contents of the QR code as a UTF8 string. + /// + /// The contents of the QR code as a UTF8 string. + [DataMember(Name = "qrCodeData", EmitDefaultValue = false)] + public string QrCodeData { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutQrCodeAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" QrCodeData: ").Append(QrCodeData).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutQrCodeAction); + } + + /// + /// Returns true if CheckoutQrCodeAction instances are equal + /// + /// Instance of CheckoutQrCodeAction to be compared + /// Boolean + public bool Equals(CheckoutQrCodeAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.QrCodeData == input.QrCodeData || + this.QrCodeData != null && + this.QrCodeData.Equals(input.QrCodeData) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.QrCodeData != null) + hashCode = hashCode * 59 + this.QrCodeData.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutRedirectAction.cs b/Adyen/Model/Checkout/Action/CheckoutRedirectAction.cs new file mode 100644 index 000000000..5699d7526 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutRedirectAction.cs @@ -0,0 +1,211 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutRedirectAction + /// + [DataContract] + public partial class CheckoutRedirectAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "redirect"; + /// + /// Initializes a new instance of the class. + /// + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. + /// Specifies the HTTP method, for example GET or POST.. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// Specifies the URL to redirect to.. + public CheckoutRedirectAction(Dictionary data = default(Dictionary), + string method = default(string), string paymentData = default(string), + string paymentMethodType = default(string), string url = default(string)) + { + this.Data = data; + this.Method = method; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Url = url; + } + + /// + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + [DataMember(Name = "data", EmitDefaultValue = false)] + public Dictionary Data { get; set; } + + /// + /// Specifies the HTTP method, for example GET or POST. + /// + /// Specifies the HTTP method, for example GET or POST. + [DataMember(Name = "method", EmitDefaultValue = false)] + public string Method { get; set; } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutRedirectAction {\n"); + sb.Append(" Data: ").Append(Data.ToCollectionsString()).Append("\n"); + sb.Append(" Method: ").Append(Method).Append("\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutRedirectAction); + } + + /// + /// Returns true if CheckoutRedirectAction instances are equal + /// + /// Instance of CheckoutRedirectAction to be compared + /// Boolean + public bool Equals(CheckoutRedirectAction input) + { + if (input == null) + return false; + + return + ( + this.Data == input.Data || + this.Data != null && + input.Data != null && + this.Data.SequenceEqual(input.Data) + ) && + ( + this.Method == input.Method || + this.Method != null && + this.Method.Equals(input.Method) + ) && + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Data != null) + hashCode = hashCode * 59 + this.Data.GetHashCode(); + if (this.Method != null) + hashCode = hashCode * 59 + this.Method.GetHashCode(); + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutSDKAction.cs b/Adyen/Model/Checkout/Action/CheckoutSDKAction.cs new file mode 100644 index 000000000..f57035e1d --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutSDKAction.cs @@ -0,0 +1,194 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutSDKAction + /// + [DataContract] + public partial class CheckoutSDKAction : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "sdk"; + + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// The data to pass to the SDK.. + /// Specifies the URL to redirect to.. + public CheckoutSDKAction(string paymentData = default(string), string paymentMethodType = default(string), + Dictionary sdkData = default(Dictionary), string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.SdkData = sdkData; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// The data to pass to the SDK. + /// + /// The data to pass to the SDK. + [DataMember(Name = "sdkData", EmitDefaultValue = false)] + public Dictionary SdkData { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutSDKAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" SdkData: ").Append(SdkData.ToCollectionsString()).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutSDKAction); + } + + /// + /// Returns true if CheckoutSDKAction instances are equal + /// + /// Instance of CheckoutSDKAction to be compared + /// Boolean + public bool Equals(CheckoutSDKAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.SdkData == input.SdkData || + this.SdkData != null && + input.SdkData != null && + this.SdkData.SequenceEqual(input.SdkData) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.SdkData != null) + hashCode = hashCode * 59 + this.SdkData.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutThreeDS2Action.cs b/Adyen/Model/Checkout/Action/CheckoutThreeDS2Action.cs new file mode 100644 index 000000000..e426b4a6a --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutThreeDS2Action.cs @@ -0,0 +1,225 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutThreeDS2Action + /// + [DataContract] + public partial class CheckoutThreeDS2Action : IEquatable, IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "threeDS2Action"; + /// + /// Initializes a new instance of the class. + /// + /// A token needed to authorise a payment.. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// A subtype of the token.. + /// A token to pass to the 3DS2 Component to get the fingerprint.. + /// Specifies the URL to redirect to.. + public CheckoutThreeDS2Action(string authorisationToken = default(string), string paymentData = default(string), + string paymentMethodType = default(string), string subtype = default(string), + string token = default(string), string url = default(string)) + { + this.AuthorisationToken = authorisationToken; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Subtype = subtype; + this.Token = token; + this.Url = url; + } + + /// + /// A token needed to authorise a payment. + /// + /// A token needed to authorise a payment. + [DataMember(Name = "authorisationToken", EmitDefaultValue = false)] + public string AuthorisationToken { get; set; } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// A subtype of the token. + /// + /// A subtype of the token. + [DataMember(Name = "subtype", EmitDefaultValue = false)] + public string Subtype { get; set; } + + /// + /// A token to pass to the 3DS2 Component to get the fingerprint. + /// + /// A token to pass to the 3DS2 Component to get the fingerprint. + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutThreeDS2Action {\n"); + sb.Append(" AuthorisationToken: ").Append(AuthorisationToken).Append("\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Subtype: ").Append(Subtype).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutThreeDS2Action); + } + + /// + /// Returns true if CheckoutThreeDS2Action instances are equal + /// + /// Instance of CheckoutThreeDS2Action to be compared + /// Boolean + public bool Equals(CheckoutThreeDS2Action input) + { + if (input == null) + return false; + + return + ( + this.AuthorisationToken == input.AuthorisationToken || + this.AuthorisationToken != null && + this.AuthorisationToken.Equals(input.AuthorisationToken) + ) && + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Subtype == input.Subtype || + this.Subtype != null && + this.Subtype.Equals(input.Subtype) + ) && + ( + this.Token == input.Token || + this.Token != null && + this.Token.Equals(input.Token) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AuthorisationToken != null) + hashCode = hashCode * 59 + this.AuthorisationToken.GetHashCode(); + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Subtype != null) + hashCode = hashCode * 59 + this.Subtype.GetHashCode(); + if (this.Token != null) + hashCode = hashCode * 59 + this.Token.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs b/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs new file mode 100644 index 000000000..c58c902a0 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs @@ -0,0 +1,191 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutThreeDS2ChallengeAction + /// + [DataContract] + public partial class CheckoutThreeDS2ChallengeAction : IEquatable, + IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "threeDS2Challenge"; + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// A token to pass to the 3DS2 Component to get the challenge.. + /// Specifies the URL to redirect to.. + public CheckoutThreeDS2ChallengeAction(string paymentData = default(string), + string paymentMethodType = default(string), string token = default(string), string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Token = token; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// A token to pass to the 3DS2 Component to get the challenge. + /// + /// A token to pass to the 3DS2 Component to get the challenge. + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutThreeDS2ChallengeAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutThreeDS2ChallengeAction); + } + + /// + /// Returns true if CheckoutThreeDS2ChallengeAction instances are equal + /// + /// Instance of CheckoutThreeDS2ChallengeAction to be compared + /// Boolean + public bool Equals(CheckoutThreeDS2ChallengeAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Token == input.Token || + this.Token != null && + this.Token.Equals(input.Token) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Token != null) + hashCode = hashCode * 59 + this.Token.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/CheckoutThreeDS2FingerPrintAction.cs b/Adyen/Model/Checkout/Action/CheckoutThreeDS2FingerPrintAction.cs new file mode 100644 index 000000000..0281ac346 --- /dev/null +++ b/Adyen/Model/Checkout/Action/CheckoutThreeDS2FingerPrintAction.cs @@ -0,0 +1,191 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Action +{ + /// + /// CheckoutThreeDS2FingerPrintAction + /// + [DataContract] + public partial class CheckoutThreeDS2FingerPrintAction : IEquatable, + IValidatableObject, IPaymentResponseAction + { + /// + /// Unique identifier of action + /// + /// Unique identifier of action + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } = "threeDS2Fingerprint"; + /// + /// Initializes a new instance of the class. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// A token to pass to the 3DS2 Component to get the fingerprint.. + /// Specifies the URL to redirect to.. + public CheckoutThreeDS2FingerPrintAction(string paymentData = default(string), + string paymentMethodType = default(string), string token = default(string), string url = default(string)) + { + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Token = token; + this.Url = url; + } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// A token to pass to the 3DS2 Component to get the fingerprint. + /// + /// A token to pass to the 3DS2 Component to get the fingerprint. + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutThreeDS2FingerPrintAction {\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutThreeDS2FingerPrintAction); + } + + /// + /// Returns true if CheckoutThreeDS2FingerPrintAction instances are equal + /// + /// Instance of CheckoutThreeDS2FingerPrintAction to be compared + /// Boolean + public bool Equals(CheckoutThreeDS2FingerPrintAction input) + { + if (input == null) + return false; + + return + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Token == input.Token || + this.Token != null && + this.Token.Equals(input.Token) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Token != null) + hashCode = hashCode * 59 + this.Token.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutPaymentsAction.cs b/Adyen/Model/Checkout/Action/CheckoutVoucherAction.cs similarity index 58% rename from Adyen/Model/Checkout/CheckoutPaymentsAction.cs rename to Adyen/Model/Checkout/Action/CheckoutVoucherAction.cs index f834e1db8..7f38d2915 100644 --- a/Adyen/Model/Checkout/CheckoutPaymentsAction.cs +++ b/Adyen/Model/Checkout/Action/CheckoutVoucherAction.cs @@ -1,154 +1,98 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Newtonsoft.Json; -using Newtonsoft.Json.Converters; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; -using Adyen.Util; +using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Action { /// - /// CheckoutPaymentsAction + /// CheckoutVoucherAction /// [DataContract] - public class CheckoutPaymentsAction : IEquatable, IValidatableObject + public partial class CheckoutVoucherAction : IEquatable, IValidatableObject, IPaymentResponseAction { /// - /// Enum that specifies the action that needs to be taken by the client. - /// - /// Enum that specifies the action that needs to be taken by the client. - [JsonConverter(typeof(StringEnumConverter))] - public enum CheckoutActionType - { - /// - /// Enum Await for value: await - /// - [EnumMember(Value = "await")] - Await = 1, - /// - /// Enum Donate for value: donate - /// - [EnumMember(Value = "donate")] - Donate = 2, - /// - /// Enum QrCode for value: qrCode - /// - [EnumMember(Value = "qrCode")] - QrCode = 3, - /// - /// Enum Redirect for value: redirect - /// - [EnumMember(Value = "redirect")] - Redirect = 4, - /// - /// Enum Sdk for value: sdk - /// - [EnumMember(Value = "sdk")] - Sdk = 5, - /// - /// Enum ThreeDS2Challenge for value: threeDS2Challenge - /// - [EnumMember(Value = "threeDS2Challenge")] - ThreeDS2Challenge = 6, - /// - /// Enum ThreeDS2Fingerprint for value: threeDS2Fingerprint - /// - [EnumMember(Value = "threeDS2Fingerprint")] - ThreeDS2Fingerprint = 7, - /// - /// Enum Voucher for value: voucher - /// - [EnumMember(Value = "voucher")] - Voucher = 8, - /// - /// Enum WechatpaySDK for value: wechatpaySDK - /// - [EnumMember(Value = "wechatpaySDK")] - WechatpaySDK = 9 - } - - /// - /// Enum that specifies the action that needs to be taken by the client. + /// Unique identifier of action /// - /// Enum that specifies the action that needs to be taken by the client. + /// Unique identifier of action [DataMember(Name = "type", EmitDefaultValue = false)] - public CheckoutActionType? Type { get; set; } + public string Type { get; set; } = "voucher"; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The voucher alternative reference code.. - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. + /// A collection institution number (store number) for Econtext Pay-Easy ATM.. /// The URL to download the voucher.. + /// An entity number of Multibanco.. /// The date time of the voucher expiry.. - /// /// initialAmount. /// The URL to the detailed instructions to make payment using the voucher.. /// The issuer of the voucher.. /// The shopper telephone number (partially masked).. /// The merchant name.. /// The merchant reference.. - /// Specifies the HTTP method, for example GET or POST.. /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. /// Specifies the payment method.. - /// The contents of the QR code as a UTF8 string.. /// The voucher reference code.. /// The shopper email.. /// The shopper name.. /// surcharge. - /// A token to pass to the 3DS2 Component to get the fingerprint/challenge.. /// totalAmount. - /// Enum that specifies the action that needs to be taken by the client.. /// Specifies the URL to redirect to.. - public CheckoutPaymentsAction(string alternativeReference = default(string), Object data = default(Object), string downloadUrl = default(string), string expiresAt = default(string), string entity = default(string), Amount initialAmount = default(Amount), string instructionsUrl = default(string), string issuer = default(string), string maskedTelephoneNumber = default(string), string merchantName = default(string), string merchantReference = default(string), string method = default(string), string paymentData = default(string), string paymentMethodType = default(string), string qrCodeData = default(string), string reference = default(string), Dictionary sdkData = default(Dictionary), string shopperEmail = default(string), string shopperName = default(string), Amount surcharge = default(Amount), string token = default(string), Amount totalAmount = default(Amount), CheckoutActionType? type = default(CheckoutActionType?), string url = default(string)) + public CheckoutVoucherAction(string alternativeReference = default(string), + string collectionInstitutionNumber = default(string), string downloadUrl = default(string), + string entity = default(string), string expiresAt = default(string), Amount initialAmount = default(Amount), + string instructionsUrl = default(string), string issuer = default(string), + string maskedTelephoneNumber = default(string), string merchantName = default(string), + string merchantReference = default(string), string paymentData = default(string), + string paymentMethodType = default(string), string reference = default(string), + string shopperEmail = default(string), string shopperName = default(string), + Amount surcharge = default(Amount), Amount totalAmount = default(Amount), string url = default(string)) { this.AlternativeReference = alternativeReference; - this.Data = data; + this.CollectionInstitutionNumber = collectionInstitutionNumber; this.DownloadUrl = downloadUrl; - this.ExpiresAt = expiresAt; this.Entity = entity; + this.ExpiresAt = expiresAt; this.InitialAmount = initialAmount; this.InstructionsUrl = instructionsUrl; this.Issuer = issuer; this.MaskedTelephoneNumber = maskedTelephoneNumber; this.MerchantName = merchantName; this.MerchantReference = merchantReference; - this.Method = method; this.PaymentData = paymentData; this.PaymentMethodType = paymentMethodType; - this.QrCodeData = qrCodeData; this.Reference = reference; - this.SdkData = sdkData; this.ShopperEmail = shopperEmail; this.ShopperName = shopperName; this.Surcharge = surcharge; - this.Token = token; this.TotalAmount = totalAmount; - this.Type = type; this.Url = url; } @@ -160,11 +104,11 @@ public enum CheckoutActionType public string AlternativeReference { get; set; } /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. + /// A collection institution number (store number) for Econtext Pay-Easy ATM. /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [DataMember(Name = "data", EmitDefaultValue = false)] - public Object Data { get; set; } + /// A collection institution number (store number) for Econtext Pay-Easy ATM. + [DataMember(Name = "collectionInstitutionNumber", EmitDefaultValue = false)] + public string CollectionInstitutionNumber { get; set; } /// /// The URL to download the voucher. @@ -173,6 +117,13 @@ public enum CheckoutActionType [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] public string DownloadUrl { get; set; } + /// + /// An entity number of Multibanco. + /// + /// An entity number of Multibanco. + [DataMember(Name = "entity", EmitDefaultValue = false)] + public string Entity { get; set; } + /// /// The date time of the voucher expiry. /// @@ -180,12 +131,6 @@ public enum CheckoutActionType [DataMember(Name = "expiresAt", EmitDefaultValue = false)] public string ExpiresAt { get; set; } - /// - /// Entity - /// - /// The date time of the voucher expiry. - [DataMember(Name = "entity", EmitDefaultValue = false)] - public string Entity { get; set; } /// /// Gets or Sets InitialAmount /// @@ -227,13 +172,6 @@ public enum CheckoutActionType [DataMember(Name = "merchantReference", EmitDefaultValue = false)] public string MerchantReference { get; set; } - /// - /// Specifies the HTTP method, for example GET or POST. - /// - /// Specifies the HTTP method, for example GET or POST. - [DataMember(Name = "method", EmitDefaultValue = false)] - public string Method { get; set; } - /// /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. /// @@ -248,13 +186,6 @@ public enum CheckoutActionType [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] public string PaymentMethodType { get; set; } - /// - /// The contents of the QR code as a UTF8 string. - /// - /// The contents of the QR code as a UTF8 string. - [DataMember(Name = "qrCodeData", EmitDefaultValue = false)] - public string QrCodeData { get; set; } - /// /// The voucher reference code. /// @@ -262,13 +193,6 @@ public enum CheckoutActionType [DataMember(Name = "reference", EmitDefaultValue = false)] public string Reference { get; set; } - /// - /// The Sdk data. - /// - /// The Sdk data. - [DataMember(Name = "sdkData", EmitDefaultValue = false)] - public Dictionary SdkData { get; set; } - /// /// The shopper email. /// @@ -282,27 +206,19 @@ public enum CheckoutActionType /// The shopper name. [DataMember(Name = "shopperName", EmitDefaultValue = false)] public string ShopperName { get; set; } - + /// /// Gets or Sets Surcharge /// [DataMember(Name = "surcharge", EmitDefaultValue = false)] public Amount Surcharge { get; set; } - /// - /// A token to pass to the 3DS2 Component to get the fingerprint/challenge. - /// - /// A token to pass to the 3DS2 Component to get the fingerprint/challenge. - [DataMember(Name = "token", EmitDefaultValue = false)] - public string Token { get; set; } - /// /// Gets or Sets TotalAmount /// [DataMember(Name = "totalAmount", EmitDefaultValue = false)] public Amount TotalAmount { get; set; } - /// /// Specifies the URL to redirect to. /// @@ -317,30 +233,25 @@ public enum CheckoutActionType public override string ToString() { var sb = new StringBuilder(); - sb.Append("class CheckoutPaymentsAction {\n"); + sb.Append("class CheckoutVoucherAction {\n"); sb.Append(" AlternativeReference: ").Append(AlternativeReference).Append("\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" CollectionInstitutionNumber: ").Append(CollectionInstitutionNumber).Append("\n"); sb.Append(" DownloadUrl: ").Append(DownloadUrl).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" Entity: ").Append(Entity).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); sb.Append(" InitialAmount: ").Append(InitialAmount).Append("\n"); sb.Append(" InstructionsUrl: ").Append(InstructionsUrl).Append("\n"); sb.Append(" Issuer: ").Append(Issuer).Append("\n"); sb.Append(" MaskedTelephoneNumber: ").Append(MaskedTelephoneNumber).Append("\n"); sb.Append(" MerchantName: ").Append(MerchantName).Append("\n"); sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); - sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); - sb.Append(" QrCodeData: ").Append(QrCodeData).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" SdkData: ").Append(SdkData.ToCollectionsString()).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); sb.Append(" Surcharge: ").Append(Surcharge).Append("\n"); - sb.Append(" Token: ").Append(Token).Append("\n"); sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" Url: ").Append(Url).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -362,15 +273,15 @@ public virtual string ToJson() /// Boolean public override bool Equals(object input) { - return this.Equals(input as CheckoutPaymentsAction); + return this.Equals(input as CheckoutVoucherAction); } /// - /// Returns true if CheckoutPaymentsAction instances are equal + /// Returns true if CheckoutVoucherAction instances are equal /// - /// Instance of CheckoutPaymentsAction to be compared + /// Instance of CheckoutVoucherAction to be compared /// Boolean - public bool Equals(CheckoutPaymentsAction input) + public bool Equals(CheckoutVoucherAction input) { if (input == null) return false; @@ -378,123 +289,98 @@ public bool Equals(CheckoutPaymentsAction input) return ( this.AlternativeReference == input.AlternativeReference || - (this.AlternativeReference != null && - this.AlternativeReference.Equals(input.AlternativeReference)) + this.AlternativeReference != null && + this.AlternativeReference.Equals(input.AlternativeReference) ) && ( - this.Data == input.Data || - (this.Data != null && - this.Data.Equals(input.Data)) + this.CollectionInstitutionNumber == input.CollectionInstitutionNumber || + this.CollectionInstitutionNumber != null && + this.CollectionInstitutionNumber.Equals(input.CollectionInstitutionNumber) ) && ( this.DownloadUrl == input.DownloadUrl || - (this.DownloadUrl != null && - this.DownloadUrl.Equals(input.DownloadUrl)) + this.DownloadUrl != null && + this.DownloadUrl.Equals(input.DownloadUrl) ) && ( - this.ExpiresAt == input.ExpiresAt || - (this.ExpiresAt != null && - this.ExpiresAt.Equals(input.ExpiresAt)) + this.Entity == input.Entity || + this.Entity != null && + this.Entity.Equals(input.Entity) ) && ( - this.Entity == input.Entity || - (this.Entity != null && - this.Entity.Equals(input.Entity)) + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) ) && ( this.InitialAmount == input.InitialAmount || - (this.InitialAmount != null && - this.InitialAmount.Equals(input.InitialAmount)) + this.InitialAmount != null && + this.InitialAmount.Equals(input.InitialAmount) ) && ( this.InstructionsUrl == input.InstructionsUrl || - (this.InstructionsUrl != null && - this.InstructionsUrl.Equals(input.InstructionsUrl)) + this.InstructionsUrl != null && + this.InstructionsUrl.Equals(input.InstructionsUrl) ) && ( this.Issuer == input.Issuer || - (this.Issuer != null && - this.Issuer.Equals(input.Issuer)) + this.Issuer != null && + this.Issuer.Equals(input.Issuer) ) && ( this.MaskedTelephoneNumber == input.MaskedTelephoneNumber || - (this.MaskedTelephoneNumber != null && - this.MaskedTelephoneNumber.Equals(input.MaskedTelephoneNumber)) + this.MaskedTelephoneNumber != null && + this.MaskedTelephoneNumber.Equals(input.MaskedTelephoneNumber) ) && ( this.MerchantName == input.MerchantName || - (this.MerchantName != null && - this.MerchantName.Equals(input.MerchantName)) + this.MerchantName != null && + this.MerchantName.Equals(input.MerchantName) ) && ( this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) - ) && - ( - this.Method == input.Method || - (this.Method != null && - this.Method.Equals(input.Method)) + this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference) ) && ( this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) ) && ( this.PaymentMethodType == input.PaymentMethodType || - (this.PaymentMethodType != null && - this.PaymentMethodType.Equals(input.PaymentMethodType)) - ) && - ( - this.QrCodeData == input.QrCodeData || - (this.QrCodeData != null && - this.QrCodeData.Equals(input.QrCodeData)) + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) ) && ( this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) + this.Reference != null && + this.Reference.Equals(input.Reference) ) && ( this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) - ) && - ( - this.SdkData == input.SdkData || - (this.SdkData != null && - this.SdkData.Equals(input.SdkData)) + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) ) && ( this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) ) && ( this.Surcharge == input.Surcharge || - (this.Surcharge != null && - this.Surcharge.Equals(input.Surcharge)) - ) && - ( - this.Token == input.Token || - (this.Token != null && - this.Token.Equals(input.Token)) + this.Surcharge != null && + this.Surcharge.Equals(input.Surcharge) ) && ( this.TotalAmount == input.TotalAmount || - (this.TotalAmount != null && - this.TotalAmount.Equals(input.TotalAmount)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.TotalAmount != null && + this.TotalAmount.Equals(input.TotalAmount) ) && ( this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) + this.Url != null && + this.Url.Equals(input.Url) ); } @@ -509,14 +395,14 @@ public override int GetHashCode() int hashCode = 41; if (this.AlternativeReference != null) hashCode = hashCode * 59 + this.AlternativeReference.GetHashCode(); - if (this.Data != null) - hashCode = hashCode * 59 + this.Data.GetHashCode(); + if (this.CollectionInstitutionNumber != null) + hashCode = hashCode * 59 + this.CollectionInstitutionNumber.GetHashCode(); if (this.DownloadUrl != null) hashCode = hashCode * 59 + this.DownloadUrl.GetHashCode(); - if (this.ExpiresAt != null) - hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); if (this.Entity != null) hashCode = hashCode * 59 + this.Entity.GetHashCode(); + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); if (this.InitialAmount != null) hashCode = hashCode * 59 + this.InitialAmount.GetHashCode(); if (this.InstructionsUrl != null) @@ -529,30 +415,20 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.MerchantName.GetHashCode(); if (this.MerchantReference != null) hashCode = hashCode * 59 + this.MerchantReference.GetHashCode(); - if (this.Method != null) - hashCode = hashCode * 59 + this.Method.GetHashCode(); if (this.PaymentData != null) hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); if (this.PaymentMethodType != null) hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); - if (this.QrCodeData != null) - hashCode = hashCode * 59 + this.QrCodeData.GetHashCode(); if (this.Reference != null) hashCode = hashCode * 59 + this.Reference.GetHashCode(); - if (this.SdkData != null) - hashCode = hashCode * 59 + this.SdkData.GetHashCode(); if (this.ShopperEmail != null) hashCode = hashCode * 59 + this.ShopperEmail.GetHashCode(); if (this.ShopperName != null) hashCode = hashCode * 59 + this.ShopperName.GetHashCode(); if (this.Surcharge != null) hashCode = hashCode * 59 + this.Surcharge.GetHashCode(); - if (this.Token != null) - hashCode = hashCode * 59 + this.Token.GetHashCode(); if (this.TotalAmount != null) hashCode = hashCode * 59 + this.TotalAmount.GetHashCode(); - if (this.Type != null) - hashCode = hashCode * 59 + this.Type.GetHashCode(); if (this.Url != null) hashCode = hashCode * 59 + this.Url.GetHashCode(); return hashCode; @@ -564,10 +440,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} - +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Action/IPaymentResponseAction.cs b/Adyen/Model/Checkout/Action/IPaymentResponseAction.cs new file mode 100644 index 000000000..f97ee3d52 --- /dev/null +++ b/Adyen/Model/Checkout/Action/IPaymentResponseAction.cs @@ -0,0 +1,30 @@ +#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 + +namespace Adyen.Model.Checkout.Action +{ + public interface IPaymentResponseAction + { + string Type { get; set; } + } +} diff --git a/Adyen/Model/Checkout/Address.cs b/Adyen/Model/Checkout/Address.cs index 121983503..ae988db32 100644 --- a/Adyen/Model/Checkout/Address.cs +++ b/Adyen/Model/Checkout/Address.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,80 +36,110 @@ namespace Adyen.Model.Checkout /// Address /// [DataContract] - public partial class Address : IEquatable
, IValidatableObject + public partial class Address : IEquatable
, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected Address() { } - /// - /// Initializes a new instance of the class. - /// - /// The name of the city. >Required if either houseNumberOrName, street, postalCode, or stateOrProvince are provided.. - /// The two-character country code of the address >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). (required). - /// The number or name of the house.. - /// The postal code. >A maximum of five (5) digits for an address in the USA, or a maximum of ten (10) characters for an address in all other countries. >Required if either houseNumberOrName, street, city, or stateOrProvince are provided.. - /// The abbreviation of the state or province. >Two (2) characters for an address in the USA or Canada, or a maximum of three (3) characters for an address in all other countries. >Required for an address in the USA or Canada if either houseNumberOrName, street, city, or postalCode are provided.. - /// The name of the street. >The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. >Required if either houseNumberOrName, city, postalCode, or stateOrProvince are provided.. - public Address(string City = default(string), string Country = default(string), string HouseNumberOrName = default(string), string PostalCode = default(string), string StateOrProvince = default(string), string Street = default(string)) + /// The name of the city. (required). + /// The two-character country code as defined in ISO-3166-1 alpha-2. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. (required). + /// The number or name of the house. (required). + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. (required). + /// State or province codes as defined in ISO 3166-2. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.. + /// The name of the street. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. (required). + public Address(string city = default(string), string country = default(string), + string houseNumberOrName = default(string), string postalCode = default(string), + string stateOrProvince = default(string), string street = default(string)) { - // to ensure "Country" is required (not null) - if (Country == null) + // to ensure "city" is required (not null) + if (city == null) + { + throw new InvalidDataException("city is a required property for Address and cannot be null"); + } + else + { + this.City = city; + } + // to ensure "country" is required (not null) + if (country == null) + { + throw new InvalidDataException("country is a required property for Address and cannot be null"); + } + else + { + this.Country = country; + } + // to ensure "houseNumberOrName" is required (not null) + if (houseNumberOrName == null) + { + throw new InvalidDataException( + "houseNumberOrName is a required property for Address and cannot be null"); + } + else + { + this.HouseNumberOrName = houseNumberOrName; + } + // to ensure "postalCode" is required (not null) + if (postalCode == null) + { + throw new InvalidDataException("postalCode is a required property for Address and cannot be null"); + } + else + { + this.PostalCode = postalCode; + } + // to ensure "street" is required (not null) + if (street == null) { - throw new InvalidDataException("Country is a required property for Address and cannot be null"); + throw new InvalidDataException("street is a required property for Address and cannot be null"); } else { - this.Country = Country; + this.Street = street; } - this.City = City; - this.HouseNumberOrName = HouseNumberOrName; - this.PostalCode = PostalCode; - this.StateOrProvince = StateOrProvince; - this.Street = Street; + this.StateOrProvince = stateOrProvince; } - + /// - /// The name of the city. >Required if either houseNumberOrName, street, postalCode, or stateOrProvince are provided. + /// The name of the city. /// - /// The name of the city. >Required if either houseNumberOrName, street, postalCode, or stateOrProvince are provided. - [DataMember(Name="city", EmitDefaultValue=false)] + /// The name of the city. + [DataMember(Name = "city", EmitDefaultValue = false)] public string City { get; set; } /// - /// The two-character country code of the address >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). + /// The two-character country code as defined in ISO-3166-1 alpha-2. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. /// - /// The two-character country code of the address >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). - [DataMember(Name="country", EmitDefaultValue=false)] + /// The two-character country code as defined in ISO-3166-1 alpha-2. For example, **US**. > If you don't know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + [DataMember(Name = "country", EmitDefaultValue = false)] public string Country { get; set; } /// /// The number or name of the house. /// /// The number or name of the house. - [DataMember(Name="houseNumberOrName", EmitDefaultValue=false)] + [DataMember(Name = "houseNumberOrName", EmitDefaultValue = false)] public string HouseNumberOrName { get; set; } /// - /// The postal code. >A maximum of five (5) digits for an address in the USA, or a maximum of ten (10) characters for an address in all other countries. >Required if either houseNumberOrName, street, city, or stateOrProvince are provided. + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. /// - /// The postal code. >A maximum of five (5) digits for an address in the USA, or a maximum of ten (10) characters for an address in all other countries. >Required if either houseNumberOrName, street, city, or stateOrProvince are provided. - [DataMember(Name="postalCode", EmitDefaultValue=false)] + /// A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + [DataMember(Name = "postalCode", EmitDefaultValue = false)] public string PostalCode { get; set; } /// - /// The abbreviation of the state or province. >Two (2) characters for an address in the USA or Canada, or a maximum of three (3) characters for an address in all other countries. >Required for an address in the USA or Canada if either houseNumberOrName, street, city, or postalCode are provided. + /// State or province codes as defined in ISO 3166-2. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. /// - /// The abbreviation of the state or province. >Two (2) characters for an address in the USA or Canada, or a maximum of three (3) characters for an address in all other countries. >Required for an address in the USA or Canada if either houseNumberOrName, street, city, or postalCode are provided. - [DataMember(Name="stateOrProvince", EmitDefaultValue=false)] + /// State or province codes as defined in ISO 3166-2. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + [DataMember(Name = "stateOrProvince", EmitDefaultValue = false)] public string StateOrProvince { get; set; } /// - /// The name of the street. >The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. >Required if either houseNumberOrName, city, postalCode, or stateOrProvince are provided. + /// The name of the street. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. /// - /// The name of the street. >The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. >Required if either houseNumberOrName, city, postalCode, or stateOrProvince are provided. - [DataMember(Name="street", EmitDefaultValue=false)] + /// The name of the street. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + [DataMember(Name = "street", EmitDefaultValue = false)] public string Street { get; set; } /// @@ -128,12 +159,12 @@ public override string ToString() 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); } @@ -158,36 +189,36 @@ public bool Equals(Address input) if (input == null) return false; - return + return ( this.City == input.City || - (this.City != null && - this.City.Equals(input.City)) - ) && + this.City != null && + this.City.Equals(input.City) + ) && ( this.Country == input.Country || - (this.Country != null && - this.Country.Equals(input.Country)) - ) && + this.Country != null && + this.Country.Equals(input.Country) + ) && ( this.HouseNumberOrName == input.HouseNumberOrName || - (this.HouseNumberOrName != null && - this.HouseNumberOrName.Equals(input.HouseNumberOrName)) - ) && + this.HouseNumberOrName != null && + this.HouseNumberOrName.Equals(input.HouseNumberOrName) + ) && ( this.PostalCode == input.PostalCode || - (this.PostalCode != null && - this.PostalCode.Equals(input.PostalCode)) - ) && + this.PostalCode != null && + this.PostalCode.Equals(input.PostalCode) + ) && ( this.StateOrProvince == input.StateOrProvince || - (this.StateOrProvince != null && - this.StateOrProvince.Equals(input.StateOrProvince)) - ) && + this.StateOrProvince != null && + this.StateOrProvince.Equals(input.StateOrProvince) + ) && ( this.Street == input.Street || - (this.Street != null && - this.Street.Equals(input.Street)) + this.Street != null && + this.Street.Equals(input.Street) ); } @@ -221,10 +252,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Amount.cs b/Adyen/Model/Checkout/Amount.cs index 57a0a3a0b..156e0736a 100644 --- a/Adyen/Model/Checkout/Amount.cs +++ b/Adyen/Model/Checkout/Amount.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -40,46 +41,41 @@ public partial class Amount : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected Amount() { } - /// - /// Initializes a new instance of the class. - /// - /// The three-character [ISO currency code](https://docs.adyen.com/developers/development-resources/currency-codes). (required). - /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/developers/development-resources/currency-codes). (required). - public Amount(string Currency = default(string), long? Value = default(long?)) + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). (required). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). (required). + public Amount(string currency = default(string), long? value = default(long?)) { - // to ensure "Currency" is required (not null) - if (Currency == null) + // to ensure "currency" is required (not null) + if (currency == null) { - throw new InvalidDataException("Currency is a required property for Amount and cannot be null"); + throw new InvalidDataException("currency is a required property for Amount and cannot be null"); } else { - this.Currency = Currency; + this.Currency = currency; } - // to ensure "Value" is required (not null) - if (Value == null) + // to ensure "value" is required (not null) + if (value == null) { - throw new InvalidDataException("Value is a required property for Amount and cannot be null"); + throw new InvalidDataException("value is a required property for Amount and cannot be null"); } else { - this.Value = Value; + this.Value = value; } } /// - /// The three-character [ISO currency code](https://docs.adyen.com/developers/development-resources/currency-codes). + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). /// - /// The three-character [ISO currency code](https://docs.adyen.com/developers/development-resources/currency-codes). + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). [DataMember(Name = "currency", EmitDefaultValue = false)] public string Currency { get; set; } /// - /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/developers/development-resources/currency-codes). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). /// - /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/developers/development-resources/currency-codes). + /// The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). [DataMember(Name = "value", EmitDefaultValue = false)] public long? Value { get; set; } @@ -101,7 +97,7 @@ public override string 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); } @@ -129,13 +125,13 @@ public bool Equals(Amount input) return ( this.Currency == input.Currency || - (this.Currency != null && - this.Currency.Equals(input.Currency)) + this.Currency != null && + this.Currency.Equals(input.Currency) ) && ( this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) + this.Value != null && + this.Value.Equals(input.Value) ); } @@ -161,19 +157,10 @@ public override int GetHashCode() ///
/// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - // Currency (string) maxLength - if (this.Currency != null && this.Currency.Length > 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be less than 3.", new[] { "Currency" }); - } - - // Currency (string) minLength - if (this.Currency != null && this.Currency.Length < 3) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Currency, length must be greater than 3.", new[] { "Currency" }); - } + yield break; } } } \ No newline at end of file diff --git a/Adyen/Model/Checkout/Avs.cs b/Adyen/Model/Checkout/Avs.cs index f4970a975..d05cc2ad2 100644 --- a/Adyen/Model/Checkout/Avs.cs +++ b/Adyen/Model/Checkout/Avs.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,7 +36,7 @@ namespace Adyen.Model.Checkout /// Avs ///
[DataContract] - public partial class Avs : IEquatable, IValidatableObject + public partial class Avs : IEquatable, IValidatableObject { /// /// Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks. @@ -44,48 +45,45 @@ public partial class Avs : IEquatable, IValidatableObject [JsonConverter(typeof(StringEnumConverter))] public enum EnabledEnum { - /// /// Enum Yes for value: yes /// - [EnumMember(Value = "yes")] - Yes = 1, - + [EnumMember(Value = "yes")] Yes = 1, + /// /// Enum No for value: no /// - [EnumMember(Value = "no")] - No = 2, - + [EnumMember(Value = "no")] No = 2, + /// /// Enum Automatic for value: automatic /// - [EnumMember(Value = "automatic")] - Automatic = 3 + [EnumMember(Value = "automatic")] Automatic = 3 } /// /// Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks. /// /// Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks. - [DataMember(Name="enabled", EmitDefaultValue=false)] + [DataMember(Name = "enabled", EmitDefaultValue = false)] public EnabledEnum? Enabled { get; set; } + /// /// Initializes a new instance of the class. /// - /// Indicates whether the shopper is allowed to modify the billing address for the current payment request.. - /// Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.. - public Avs(bool? AddressEditable = default(bool?), EnabledEnum? Enabled = default(EnabledEnum?)) + /// Indicates whether the shopper is allowed to modify the billing address for the current payment request.. + /// Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.. + public Avs(bool? addressEditable = default(bool?), EnabledEnum? enabled = default(EnabledEnum?)) { - this.AddressEditable = AddressEditable; - this.Enabled = Enabled; + this.AddressEditable = addressEditable; + this.Enabled = enabled; } - + /// /// Indicates whether the shopper is allowed to modify the billing address for the current payment request. /// /// Indicates whether the shopper is allowed to modify the billing address for the current payment request. - [DataMember(Name="addressEditable", EmitDefaultValue=false)] + [DataMember(Name = "addressEditable", EmitDefaultValue = false)] public bool? AddressEditable { get; set; } @@ -102,12 +100,12 @@ public override string ToString() 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); } @@ -132,16 +130,16 @@ public bool Equals(Avs input) if (input == null) return false; - return + return ( this.AddressEditable == input.AddressEditable || - (this.AddressEditable != null && - this.AddressEditable.Equals(input.AddressEditable)) - ) && + this.AddressEditable != null && + this.AddressEditable.Equals(input.AddressEditable) + ) && ( this.Enabled == input.Enabled || - (this.Enabled != null && - this.Enabled.Equals(input.Enabled)) + this.Enabled != null && + this.Enabled.Equals(input.Enabled) ); } @@ -167,10 +165,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/BankAccount.cs b/Adyen/Model/Checkout/BankAccount.cs index da493513f..306048696 100644 --- a/Adyen/Model/Checkout/BankAccount.cs +++ b/Adyen/Model/Checkout/BankAccount.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,94 +35,97 @@ namespace Adyen.Model.Checkout /// BankAccount ///
[DataContract] - public partial class BankAccount : IEquatable, IValidatableObject + public partial class BankAccount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The bank account number (without separators).. - /// The bank city.. - /// The location id of the bank. The field value is `nil` in most cases.. - /// The name of the bank.. - /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases.. - /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').. - /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).. - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. - /// The bank account holder's tax ID.. - public BankAccount(string BankAccountNumber = default(string), string BankCity = default(string), string BankLocationId = default(string), string BankName = default(string), string Bic = default(string), string CountryCode = default(string), string Iban = default(string), string OwnerName = default(string), string TaxId = default(string)) + /// The bank account number (without separators).. + /// The bank city.. + /// The location id of the bank. The field value is `nil` in most cases.. + /// The name of the bank.. + /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases.. + /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').. + /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.. + /// The bank account holder's tax ID.. + public BankAccount(string bankAccountNumber = default(string), string bankCity = default(string), + string bankLocationId = default(string), string bankName = default(string), string bic = default(string), + string countryCode = default(string), string iban = default(string), string ownerName = default(string), + string taxId = default(string)) { - this.BankAccountNumber = BankAccountNumber; - this.BankCity = BankCity; - this.BankLocationId = BankLocationId; - this.BankName = BankName; - this.Bic = Bic; - this.CountryCode = CountryCode; - this.Iban = Iban; - this.OwnerName = OwnerName; - this.TaxId = TaxId; + this.BankAccountNumber = bankAccountNumber; + this.BankCity = bankCity; + this.BankLocationId = bankLocationId; + this.BankName = bankName; + this.Bic = bic; + this.CountryCode = countryCode; + this.Iban = iban; + this.OwnerName = ownerName; + this.TaxId = taxId; } - + /// /// The bank account number (without separators). /// /// The bank account number (without separators). - [DataMember(Name="bankAccountNumber", EmitDefaultValue=false)] + [DataMember(Name = "bankAccountNumber", EmitDefaultValue = false)] public string BankAccountNumber { get; set; } /// /// The bank city. /// /// The bank city. - [DataMember(Name="bankCity", EmitDefaultValue=false)] + [DataMember(Name = "bankCity", EmitDefaultValue = false)] public string BankCity { get; set; } /// /// The location id of the bank. The field value is `nil` in most cases. /// /// The location id of the bank. The field value is `nil` in most cases. - [DataMember(Name="bankLocationId", EmitDefaultValue=false)] + [DataMember(Name = "bankLocationId", EmitDefaultValue = false)] public string BankLocationId { get; set; } /// /// The name of the bank. /// /// The name of the bank. - [DataMember(Name="bankName", EmitDefaultValue=false)] + [DataMember(Name = "bankName", EmitDefaultValue = false)] public string BankName { get; set; } /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. /// /// The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases. - [DataMember(Name="bic", EmitDefaultValue=false)] + [DataMember(Name = "bic", EmitDefaultValue = false)] public string Bic { get; set; } /// - /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). + /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). /// - /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). - [DataMember(Name="countryCode", EmitDefaultValue=false)] + /// Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL'). + [DataMember(Name = "countryCode", EmitDefaultValue = false)] public string CountryCode { get; set; } /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). /// /// The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN). - [DataMember(Name="iban", EmitDefaultValue=false)] + [DataMember(Name = "iban", EmitDefaultValue = false)] public string Iban { get; set; } /// - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. /// - /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. - [DataMember(Name="ownerName", EmitDefaultValue=false)] + /// The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'. + [DataMember(Name = "ownerName", EmitDefaultValue = false)] public string OwnerName { get; set; } /// - /// The bank account holder's tax ID. + /// The bank account holder's tax ID. /// - /// The bank account holder's tax ID. - [DataMember(Name="taxId", EmitDefaultValue=false)] + /// The bank account holder's tax ID. + [DataMember(Name = "taxId", EmitDefaultValue = false)] public string TaxId { get; set; } /// @@ -144,12 +148,12 @@ public override string ToString() 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); } @@ -174,51 +178,51 @@ public bool Equals(BankAccount input) if (input == null) return false; - return + return ( this.BankAccountNumber == input.BankAccountNumber || - (this.BankAccountNumber != null && - this.BankAccountNumber.Equals(input.BankAccountNumber)) - ) && + this.BankAccountNumber != null && + this.BankAccountNumber.Equals(input.BankAccountNumber) + ) && ( this.BankCity == input.BankCity || - (this.BankCity != null && - this.BankCity.Equals(input.BankCity)) - ) && + this.BankCity != null && + this.BankCity.Equals(input.BankCity) + ) && ( this.BankLocationId == input.BankLocationId || - (this.BankLocationId != null && - this.BankLocationId.Equals(input.BankLocationId)) - ) && + this.BankLocationId != null && + this.BankLocationId.Equals(input.BankLocationId) + ) && ( this.BankName == input.BankName || - (this.BankName != null && - this.BankName.Equals(input.BankName)) - ) && + this.BankName != null && + this.BankName.Equals(input.BankName) + ) && ( this.Bic == input.Bic || - (this.Bic != null && - this.Bic.Equals(input.Bic)) - ) && + this.Bic != null && + this.Bic.Equals(input.Bic) + ) && ( this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) - ) && + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) + ) && ( this.Iban == input.Iban || - (this.Iban != null && - this.Iban.Equals(input.Iban)) - ) && + this.Iban != null && + this.Iban.Equals(input.Iban) + ) && ( this.OwnerName == input.OwnerName || - (this.OwnerName != null && - this.OwnerName.Equals(input.OwnerName)) - ) && + this.OwnerName != null && + this.OwnerName.Equals(input.OwnerName) + ) && ( this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) + this.TaxId != null && + this.TaxId.Equals(input.TaxId) ); } @@ -258,10 +262,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/BrowserInfo.cs b/Adyen/Model/Checkout/BrowserInfo.cs index 5699a031c..5f182e8cb 100644 --- a/Adyen/Model/Checkout/BrowserInfo.cs +++ b/Adyen/Model/Checkout/BrowserInfo.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,117 +36,174 @@ namespace Adyen.Model.Checkout /// BrowserInfo ///
[DataContract] - public partial class BrowserInfo : IEquatable, IValidatableObject + public partial class BrowserInfo : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected BrowserInfo() { } - /// - /// Initializes a new instance of the class. - /// - /// The accept header value of the shopper's browser. (required). - /// The color depth of the shopper's device in bits per pixel. Should be obtained by using the browser's screen.colorDepth property.. - /// Boolean value indicating if the shopper's browser is able to execute Java.. - /// The navigator.language value of the shopper's browser (as defined in IETF BCP 47).. - /// The total height of the shopper's device screen in pixels.. - /// The total width of the shopper's device screen in pixels.. - /// Time difference between UTC time and the shopper's browser local time, in minutes.. - /// The user agent value of the shopper's browser. (required). - /// Boolean value indicating if the shopper's browser is able to execute JavaScript.. - - public BrowserInfo(string AcceptHeader = default(string), int? ColorDepth = default(int?), bool? JavaEnabled = default(bool?), string Language = default(string), int? ScreenHeight = default(int?), int? ScreenWidth = default(int?), int? TimeZoneOffset = default(int?), string UserAgent = default(string), bool? JavaScriptEnabled = default(bool?)) + /// The accept header value of the shopper's browser. (required). + /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. (required). + /// Boolean value indicating if the shopper's browser is able to execute Java. (required). + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. (default to true). + /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). (required). + /// The total height of the shopper's device screen in pixels. (required). + /// The total width of the shopper's device screen in pixels. (required). + /// Time difference between UTC time and the shopper's browser local time, in minutes. (required). + /// The user agent value of the shopper's browser. (required). + public BrowserInfo(string acceptHeader = default(string), int? colorDepth = default(int?), + bool? javaEnabled = default(bool?), bool? javaScriptEnabled = true, string language = default(string), + int? screenHeight = default(int?), int? screenWidth = default(int?), int? timeZoneOffset = default(int?), + string userAgent = default(string)) { - // to ensure "AcceptHeader" is required (not null) - if (AcceptHeader == null) + // to ensure "acceptHeader" is required (not null) + if (acceptHeader == null) + { + throw new InvalidDataException( + "acceptHeader is a required property for BrowserInfo and cannot be null"); + } + else + { + this.AcceptHeader = acceptHeader; + } + // to ensure "colorDepth" is required (not null) + if (colorDepth == null) + { + throw new InvalidDataException("colorDepth is a required property for BrowserInfo and cannot be null"); + } + else + { + this.ColorDepth = colorDepth; + } + // to ensure "javaEnabled" is required (not null) + if (javaEnabled == null) + { + throw new InvalidDataException("javaEnabled is a required property for BrowserInfo and cannot be null"); + } + else + { + this.JavaEnabled = javaEnabled; + } + // to ensure "language" is required (not null) + if (language == null) + { + throw new InvalidDataException("language is a required property for BrowserInfo and cannot be null"); + } + else + { + this.Language = language; + } + // to ensure "screenHeight" is required (not null) + if (screenHeight == null) + { + throw new InvalidDataException( + "screenHeight is a required property for BrowserInfo and cannot be null"); + } + else + { + this.ScreenHeight = screenHeight; + } + // to ensure "screenWidth" is required (not null) + if (screenWidth == null) + { + throw new InvalidDataException("screenWidth is a required property for BrowserInfo and cannot be null"); + } + else { - throw new InvalidDataException("AcceptHeader is a required property for BrowserInfo and cannot be null"); + this.ScreenWidth = screenWidth; + } + // to ensure "timeZoneOffset" is required (not null) + if (timeZoneOffset == null) + { + throw new InvalidDataException( + "timeZoneOffset is a required property for BrowserInfo and cannot be null"); } else { - this.AcceptHeader = AcceptHeader; + this.TimeZoneOffset = timeZoneOffset; } - // to ensure "UserAgent" is required (not null) - if (UserAgent == null) + // to ensure "userAgent" is required (not null) + if (userAgent == null) { - throw new InvalidDataException("UserAgent is a required property for BrowserInfo and cannot be null"); + throw new InvalidDataException("userAgent is a required property for BrowserInfo and cannot be null"); } else { - this.UserAgent = UserAgent; + this.UserAgent = userAgent; + } + // use default value if no "javaScriptEnabled" provided + if (javaScriptEnabled == null) + { + this.JavaScriptEnabled = true; + } + else + { + this.JavaScriptEnabled = javaScriptEnabled; } - this.ColorDepth = ColorDepth; - this.JavaEnabled = JavaEnabled; - this.Language = Language; - this.ScreenHeight = ScreenHeight; - this.ScreenWidth = ScreenWidth; - this.TimeZoneOffset = TimeZoneOffset; - this.JavaScriptEnabled = JavaScriptEnabled; } - + /// - /// The accept header value of the shopper's browser. + /// The accept header value of the shopper's browser. /// - /// The accept header value of the shopper's browser. - [DataMember(Name="acceptHeader", EmitDefaultValue=false)] + /// The accept header value of the shopper's browser. + [DataMember(Name = "acceptHeader", EmitDefaultValue = false)] public string AcceptHeader { get; set; } /// - /// The color depth of the shopper's device in bits per pixel. Should be obtained by using the browser's screen.colorDepth property. + /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. /// - /// The color depth of the shopper's device in bits per pixel. Should be obtained by using the browser's screen.colorDepth property. - [DataMember(Name="colorDepth", EmitDefaultValue=false)] + /// The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 30, 32 or 48 bit color depth. + [DataMember(Name = "colorDepth", EmitDefaultValue = false)] public int? ColorDepth { get; set; } /// - /// Boolean value indicating if the shopper's browser is able to execute Java. + /// Boolean value indicating if the shopper's browser is able to execute Java. /// - /// Boolean value indicating if the shopper's browser is able to execute Java. - [DataMember(Name="javaEnabled", EmitDefaultValue=false)] + /// Boolean value indicating if the shopper's browser is able to execute Java. + [DataMember(Name = "javaEnabled", EmitDefaultValue = false)] public bool? JavaEnabled { get; set; } /// - /// The navigator.language value of the shopper's browser (as defined in IETF BCP 47). + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + /// + /// Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present. + [DataMember(Name = "javaScriptEnabled", EmitDefaultValue = false)] + public bool? JavaScriptEnabled { get; set; } + + /// + /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). /// - /// The navigator.language value of the shopper's browser (as defined in IETF BCP 47). - [DataMember(Name="language", EmitDefaultValue=false)] + /// The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47). + [DataMember(Name = "language", EmitDefaultValue = false)] public string Language { get; set; } /// - /// The total height of the shopper's device screen in pixels. + /// The total height of the shopper's device screen in pixels. /// - /// The total height of the shopper's device screen in pixels. - [DataMember(Name="screenHeight", EmitDefaultValue=false)] + /// The total height of the shopper's device screen in pixels. + [DataMember(Name = "screenHeight", EmitDefaultValue = false)] public int? ScreenHeight { get; set; } /// - /// The total width of the shopper's device screen in pixels. + /// The total width of the shopper's device screen in pixels. /// - /// The total width of the shopper's device screen in pixels. - [DataMember(Name="screenWidth", EmitDefaultValue=false)] + /// The total width of the shopper's device screen in pixels. + [DataMember(Name = "screenWidth", EmitDefaultValue = false)] public int? ScreenWidth { get; set; } /// - /// Time difference between UTC time and the shopper's browser local time, in minutes. + /// Time difference between UTC time and the shopper's browser local time, in minutes. /// - /// Time difference between UTC time and the shopper's browser local time, in minutes. - [DataMember(Name="timeZoneOffset", EmitDefaultValue=false)] + /// Time difference between UTC time and the shopper's browser local time, in minutes. + [DataMember(Name = "timeZoneOffset", EmitDefaultValue = false)] public int? TimeZoneOffset { get; set; } /// - /// The user agent value of the shopper's browser. + /// The user agent value of the shopper's browser. /// - /// The user agent value of the shopper's browser. - [DataMember(Name="userAgent", EmitDefaultValue=false)] + /// The user agent value of the shopper's browser. + [DataMember(Name = "userAgent", EmitDefaultValue = false)] public string UserAgent { get; set; } - /// - /// Boolean value indicating if the shopper's browser is able to execute Java. - /// - /// Boolean value indicating if the shopper's browser is able to execute Java. - [DataMember(Name = "javaScriptEnabled", EmitDefaultValue = false)] - public bool? JavaScriptEnabled { get; set; } - + /// /// Returns the string presentation of the object /// @@ -157,21 +215,21 @@ public override string ToString() sb.Append(" AcceptHeader: ").Append(AcceptHeader).Append("\n"); sb.Append(" ColorDepth: ").Append(ColorDepth).Append("\n"); sb.Append(" JavaEnabled: ").Append(JavaEnabled).Append("\n"); + sb.Append(" JavaScriptEnabled: ").Append(JavaScriptEnabled).Append("\n"); sb.Append(" Language: ").Append(Language).Append("\n"); sb.Append(" ScreenHeight: ").Append(ScreenHeight).Append("\n"); sb.Append(" ScreenWidth: ").Append(ScreenWidth).Append("\n"); sb.Append(" TimeZoneOffset: ").Append(TimeZoneOffset).Append("\n"); sb.Append(" UserAgent: ").Append(UserAgent).Append("\n"); - sb.Append(" JavaScriptEnabled: ").Append(JavaEnabled).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); } @@ -196,51 +254,51 @@ public bool Equals(BrowserInfo input) if (input == null) return false; - return + return ( this.AcceptHeader == input.AcceptHeader || - (this.AcceptHeader != null && - this.AcceptHeader.Equals(input.AcceptHeader)) - ) && + this.AcceptHeader != null && + this.AcceptHeader.Equals(input.AcceptHeader) + ) && ( this.ColorDepth == input.ColorDepth || - (this.ColorDepth != null && - this.ColorDepth.Equals(input.ColorDepth)) - ) && + this.ColorDepth != null && + this.ColorDepth.Equals(input.ColorDepth) + ) && ( this.JavaEnabled == input.JavaEnabled || - (this.JavaEnabled != null && - this.JavaEnabled.Equals(input.JavaEnabled)) - ) && + this.JavaEnabled != null && + this.JavaEnabled.Equals(input.JavaEnabled) + ) && + ( + this.JavaScriptEnabled == input.JavaScriptEnabled || + this.JavaScriptEnabled != null && + this.JavaScriptEnabled.Equals(input.JavaScriptEnabled) + ) && ( this.Language == input.Language || - (this.Language != null && - this.Language.Equals(input.Language)) - ) && + this.Language != null && + this.Language.Equals(input.Language) + ) && ( this.ScreenHeight == input.ScreenHeight || - (this.ScreenHeight != null && - this.ScreenHeight.Equals(input.ScreenHeight)) - ) && + this.ScreenHeight != null && + this.ScreenHeight.Equals(input.ScreenHeight) + ) && ( this.ScreenWidth == input.ScreenWidth || - (this.ScreenWidth != null && - this.ScreenWidth.Equals(input.ScreenWidth)) - ) && + this.ScreenWidth != null && + this.ScreenWidth.Equals(input.ScreenWidth) + ) && ( this.TimeZoneOffset == input.TimeZoneOffset || - (this.TimeZoneOffset != null && - this.TimeZoneOffset.Equals(input.TimeZoneOffset)) - ) && + this.TimeZoneOffset != null && + this.TimeZoneOffset.Equals(input.TimeZoneOffset) + ) && ( this.UserAgent == input.UserAgent || - (this.UserAgent != null && - this.UserAgent.Equals(input.UserAgent)) - )&& - ( - this.JavaScriptEnabled == input.JavaScriptEnabled || - (this.JavaScriptEnabled != null && - this.JavaScriptEnabled.Equals(input.JavaScriptEnabled)) + this.UserAgent != null && + this.UserAgent.Equals(input.UserAgent) ); } @@ -259,6 +317,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.ColorDepth.GetHashCode(); if (this.JavaEnabled != null) hashCode = hashCode * 59 + this.JavaEnabled.GetHashCode(); + if (this.JavaScriptEnabled != null) + hashCode = hashCode * 59 + this.JavaScriptEnabled.GetHashCode(); if (this.Language != null) hashCode = hashCode * 59 + this.Language.GetHashCode(); if (this.ScreenHeight != null) @@ -269,8 +329,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.TimeZoneOffset.GetHashCode(); if (this.UserAgent != null) hashCode = hashCode * 59 + this.UserAgent.GetHashCode(); - if (this.JavaScriptEnabled != null) - hashCode = hashCode * 59 + this.JavaScriptEnabled.GetHashCode(); return hashCode; } } @@ -280,9 +338,10 @@ public override int GetHashCode() ///
/// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Card.cs b/Adyen/Model/Checkout/Card.cs index 3f2177b3e..6f2bd4b3a 100644 --- a/Adyen/Model/Checkout/Card.cs +++ b/Adyen/Model/Checkout/Card.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -40,67 +41,65 @@ public partial class Card : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - [JsonConstructor] - public Card() { } - /// - /// Initializes a new instance of the class. - /// - /// The [card verification code](https://docs.adyen.com/developers/payment-glossary#cardsecuritycodecvccvvcid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/developers/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored.. - /// The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November (required). - /// The card expiry year. Format: 4 digits. For example: 2018 (required). - /// The name of the cardholder, as printed on the card. (required). - /// The issue number of the card (for some UK debit cards only).. - /// The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. (required). - /// The month component of the start date (for some UK debit cards only).. - /// The year component of the start date (for some UK debit cards only).. - public Card(string Cvc = default(string), string ExpiryMonth = default(string), string ExpiryYear = default(string), string HolderName = default(string), string IssueNumber = default(string), string Number = default(string), string StartMonth = default(string), string StartYear = default(string)) + /// The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored.. + /// The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November (required). + /// The card expiry year. Format: 4 digits. For example: 2020 (required). + /// The name of the cardholder, as printed on the card. (required). + /// The issue number of the card (for some UK debit cards only).. + /// The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned. (required). + /// The month component of the start date (for some UK debit cards only).. + /// The year component of the start date (for some UK debit cards only).. + public Card(string cvc = default(string), string expiryMonth = default(string), + string expiryYear = default(string), string holderName = default(string), + string issueNumber = default(string), string number = default(string), string startMonth = default(string), + string startYear = default(string)) { - // to ensure "ExpiryMonth" is required (not null) - if (ExpiryMonth == null) + // to ensure "expiryMonth" is required (not null) + if (expiryMonth == null) { - throw new InvalidDataException("ExpiryMonth is a required property for Card and cannot be null"); + throw new InvalidDataException("expiryMonth is a required property for Card and cannot be null"); } else { - this.ExpiryMonth = ExpiryMonth; + this.ExpiryMonth = expiryMonth; } - // to ensure "ExpiryYear" is required (not null) - if (ExpiryYear == null) + // to ensure "expiryYear" is required (not null) + if (expiryYear == null) { - throw new InvalidDataException("ExpiryYear is a required property for Card and cannot be null"); + throw new InvalidDataException("expiryYear is a required property for Card and cannot be null"); } else { - this.ExpiryYear = ExpiryYear; + this.ExpiryYear = expiryYear; } - // to ensure "HolderName" is required (not null) - if (HolderName == null) + // to ensure "holderName" is required (not null) + if (holderName == null) { - throw new InvalidDataException("HolderName is a required property for Card and cannot be null"); + throw new InvalidDataException("holderName is a required property for Card and cannot be null"); } else { - this.HolderName = HolderName; + this.HolderName = holderName; } - // to ensure "Number" is required (not null) - if (Number == null) + // to ensure "number" is required (not null) + if (number == null) { - throw new InvalidDataException("Number is a required property for Card and cannot be null"); + throw new InvalidDataException("number is a required property for Card and cannot be null"); } else { - this.Number = Number; + this.Number = number; } - this.Cvc = Cvc; - this.IssueNumber = IssueNumber; - this.StartMonth = StartMonth; - this.StartYear = StartYear; + this.Cvc = cvc; + this.IssueNumber = issueNumber; + this.StartMonth = startMonth; + this.StartYear = startYear; } /// - /// The [card verification code](https://docs.adyen.com/developers/payment-glossary#cardsecuritycodecvccvvcid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/developers/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. + /// The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. /// - /// The [card verification code](https://docs.adyen.com/developers/payment-glossary#cardsecuritycodecvccvvcid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/developers/features/client-side-encryption), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/developers/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. + /// The [card verification code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored. [DataMember(Name = "cvc", EmitDefaultValue = false)] public string Cvc { get; set; } @@ -112,9 +111,9 @@ public Card() { } public string ExpiryMonth { get; set; } /// - /// The card expiry year. Format: 4 digits. For example: 2018 + /// The card expiry year. Format: 4 digits. For example: 2020 /// - /// The card expiry year. Format: 4 digits. For example: 2018 + /// The card expiry year. Format: 4 digits. For example: 2020 [DataMember(Name = "expiryYear", EmitDefaultValue = false)] public string ExpiryYear { get; set; } @@ -160,16 +159,16 @@ public Card() { } public override string ToString() { var sb = new StringBuilder(); - sb.Append("class Card {\n") - .Append(" Cvc: ").Append(Cvc).Append("\n") - .Append(" ExpiryMonth: ").Append(ExpiryMonth).Append("\n") - .Append(" ExpiryYear: ").Append(ExpiryYear).Append("\n") - .Append(" HolderName: ").Append(HolderName).Append("\n") - .Append(" IssueNumber: ").Append(IssueNumber).Append("\n") - .Append(" Number: ").Append(Number).Append("\n") - .Append(" StartMonth: ").Append(StartMonth).Append("\n") - .Append(" StartYear: ").Append(StartYear).Append("\n") - .Append("}\n"); + sb.Append("class Card {\n"); + sb.Append(" Cvc: ").Append(Cvc).Append("\n"); + sb.Append(" ExpiryMonth: ").Append(ExpiryMonth).Append("\n"); + sb.Append(" ExpiryYear: ").Append(ExpiryYear).Append("\n"); + sb.Append(" HolderName: ").Append(HolderName).Append("\n"); + sb.Append(" IssueNumber: ").Append(IssueNumber).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" StartMonth: ").Append(StartMonth).Append("\n"); + sb.Append(" StartYear: ").Append(StartYear).Append("\n"); + sb.Append("}\n"); return sb.ToString(); } @@ -177,7 +176,7 @@ public override string 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); } @@ -205,43 +204,43 @@ public bool Equals(Card input) return ( this.Cvc == input.Cvc || - (this.Cvc != null && - this.Cvc.Equals(input.Cvc)) + this.Cvc != null && + this.Cvc.Equals(input.Cvc) ) && ( this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) + this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth) ) && ( this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) + this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear) ) && ( this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) + this.HolderName != null && + this.HolderName.Equals(input.HolderName) ) && ( this.IssueNumber == input.IssueNumber || - (this.IssueNumber != null && - this.IssueNumber.Equals(input.IssueNumber)) + this.IssueNumber != null && + this.IssueNumber.Equals(input.IssueNumber) ) && ( this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) + this.Number != null && + this.Number.Equals(input.Number) ) && ( this.StartMonth == input.StartMonth || - (this.StartMonth != null && - this.StartMonth.Equals(input.StartMonth)) + this.StartMonth != null && + this.StartMonth.Equals(input.StartMonth) ) && ( this.StartYear == input.StartYear || - (this.StartYear != null && - this.StartYear.Equals(input.StartYear)) + this.StartYear != null && + this.StartYear.Equals(input.StartYear) ); } @@ -279,103 +278,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - // Cvc (string) maxLength - if (this.Cvc != null && this.Cvc.Length > 20) - { - yield return new ValidationResult("Invalid value for Cvc, length must be less than 20.", new[] { "Cvc" }); - } - - // Cvc (string) minLength - if (this.Cvc != null && this.Cvc.Length < 1) - { - yield return new ValidationResult("Invalid value for Cvc, length must be greater than 1.", new[] { "Cvc" }); - } - - // ExpiryMonth (string) maxLength - if (this.ExpiryMonth != null && this.ExpiryMonth.Length > 2) - { - yield return new ValidationResult("Invalid value for ExpiryMonth, length must be less than 2.", new[] { "ExpiryMonth" }); - } - - // ExpiryMonth (string) minLength - if (this.ExpiryMonth != null && this.ExpiryMonth.Length < 1) - { - yield return new ValidationResult("Invalid value for ExpiryMonth, length must be greater than 1.", new[] { "ExpiryMonth" }); - } - - // ExpiryYear (string) maxLength - if (this.ExpiryYear != null && this.ExpiryYear.Length > 4) - { - yield return new ValidationResult("Invalid value for ExpiryYear, length must be less than 4.", new[] { "ExpiryYear" }); - } - - // ExpiryYear (string) minLength - if (this.ExpiryYear != null && this.ExpiryYear.Length < 4) - { - yield return new ValidationResult("Invalid value for ExpiryYear, length must be greater than 4.", new[] { "ExpiryYear" }); - } - - // HolderName (string) maxLength - if (this.HolderName != null && this.HolderName.Length > 50) - { - yield return new ValidationResult("Invalid value for HolderName, length must be less than 50.", new[] { "HolderName" }); - } - - // HolderName (string) minLength - if (this.HolderName != null && this.HolderName.Length < 1) - { - yield return new ValidationResult("Invalid value for HolderName, length must be greater than 1.", new[] { "HolderName" }); - } - - // IssueNumber (string) maxLength - if (this.IssueNumber != null && this.IssueNumber.Length > 2) - { - yield return new ValidationResult("Invalid value for IssueNumber, length must be less than 2.", new[] { "IssueNumber" }); - } - - // IssueNumber (string) minLength - if (this.IssueNumber != null && this.IssueNumber.Length < 1) - { - yield return new ValidationResult("Invalid value for IssueNumber, length must be greater than 1.", new[] { "IssueNumber" }); - } - - // Number (string) maxLength - if (this.Number != null && this.Number.Length > 19) - { - yield return new ValidationResult("Invalid value for Number, length must be less than 19.", new[] { "Number" }); - } - - // Number (string) minLength - if (this.Number != null && this.Number.Length < 4) - { - yield return new ValidationResult("Invalid value for Number, length must be greater than 4.", new[] { "Number" }); - } - - // StartMonth (string) maxLength - if (this.StartMonth != null && this.StartMonth.Length > 2) - { - yield return new ValidationResult("Invalid value for StartMonth, length must be less than 2.", new[] { "StartMonth" }); - } - - // StartMonth (string) minLength - if (this.StartMonth != null && this.StartMonth.Length < 1) - { - yield return new ValidationResult("Invalid value for StartMonth, length must be greater than 1.", new[] { "StartMonth" }); - } - - // StartYear (string) maxLength - if (this.StartYear != null && this.StartYear.Length > 4) - { - yield return new ValidationResult("Invalid value for StartYear, length must be less than 4.", new[] { "StartYear" }); - } - - // StartYear (string) minLength - if (this.StartYear != null && this.StartYear.Length < 4) - { - yield return new ValidationResult("Invalid value for StartYear, length must be greater than 4.", new[] { "StartYear" }); - } + yield break; } } } \ No newline at end of file diff --git a/Adyen/Model/Checkout/CardDetails.cs b/Adyen/Model/Checkout/CardDetails.cs new file mode 100644 index 000000000..87d43a34a --- /dev/null +++ b/Adyen/Model/Checkout/CardDetails.cs @@ -0,0 +1,399 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// CardDetails + /// + [DataContract] + public partial class CardDetails : IEquatable, IValidatableObject + { + /// + /// Defines FundingSource + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FundingSourceEnum + { + /// + /// Enum Debit for value: debit + /// + [EnumMember(Value = "debit")] Debit = 1 + } + + /// + /// Gets or Sets FundingSource + /// + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// Brand of the card. For example: **plastix**, **hmclub**.. + /// cupsecureplusSmscode. + /// cvc. + /// encryptedCardNumber (required). + /// encryptedExpiryMonth (required). + /// encryptedExpiryYear (required). + /// expiryMonth. + /// expiryYear. + /// fundingSource. + /// holderName. + /// number. + /// 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.. + /// **scheme** (default to "scheme"). + public CardDetails(string brand = default(string), string cupsecureplusSmscode = default(string), + string cvc = default(string), string encryptedCardNumber = default(string), + string encryptedExpiryMonth = default(string), string encryptedExpiryYear = default(string), + string expiryMonth = default(string), string expiryYear = default(string), + FundingSourceEnum? fundingSource = default(FundingSourceEnum?), string holderName = default(string), + string number = default(string), string recurringDetailReference = default(string), + string storedPaymentMethodId = default(string), string type = "scheme") + { + // to ensure "encryptedCardNumber" is required (not null) + if (encryptedCardNumber == null) + { + throw new InvalidDataException( + "encryptedCardNumber is a required property for CardDetails and cannot be null"); + } + else + { + this.EncryptedCardNumber = encryptedCardNumber; + } + // to ensure "encryptedExpiryMonth" is required (not null) + if (encryptedExpiryMonth == null) + { + throw new InvalidDataException( + "encryptedExpiryMonth is a required property for CardDetails and cannot be null"); + } + else + { + this.EncryptedExpiryMonth = encryptedExpiryMonth; + } + // to ensure "encryptedExpiryYear" is required (not null) + if (encryptedExpiryYear == null) + { + throw new InvalidDataException( + "encryptedExpiryYear is a required property for CardDetails and cannot be null"); + } + else + { + this.EncryptedExpiryYear = encryptedExpiryYear; + } + this.Brand = brand; + this.CupsecureplusSmscode = cupsecureplusSmscode; + this.Cvc = cvc; + this.ExpiryMonth = expiryMonth; + this.ExpiryYear = expiryYear; + this.FundingSource = fundingSource; + this.HolderName = holderName; + this.Number = number; + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + // use default value if no "type" provided + if (type == null) + { + this.Type = "scheme"; + } + else + { + this.Type = type; + } + } + + /// + /// Brand of the card. For example: **plastix**, **hmclub**. + /// + /// Brand of the card. For example: **plastix**, **hmclub**. + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } + + /// + /// Gets or Sets CupsecureplusSmscode + /// + [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] + public string CupsecureplusSmscode { get; set; } + + /// + /// Gets or Sets Cvc + /// + [DataMember(Name = "cvc", EmitDefaultValue = false)] + public string Cvc { get; set; } + + /// + /// Gets or Sets EncryptedCardNumber + /// + [DataMember(Name = "encryptedCardNumber", EmitDefaultValue = false)] + public string EncryptedCardNumber { get; set; } + + /// + /// Gets or Sets EncryptedExpiryMonth + /// + [DataMember(Name = "encryptedExpiryMonth", EmitDefaultValue = false)] + public string EncryptedExpiryMonth { get; set; } + + /// + /// Gets or Sets EncryptedExpiryYear + /// + [DataMember(Name = "encryptedExpiryYear", EmitDefaultValue = false)] + public string EncryptedExpiryYear { get; set; } + + /// + /// Gets or Sets ExpiryMonth + /// + [DataMember(Name = "expiryMonth", EmitDefaultValue = false)] + public string ExpiryMonth { get; set; } + + /// + /// Gets or Sets ExpiryYear + /// + [DataMember(Name = "expiryYear", EmitDefaultValue = false)] + public string ExpiryYear { get; set; } + + + /// + /// Gets or Sets HolderName + /// + [DataMember(Name = "holderName", EmitDefaultValue = false)] + public string HolderName { get; set; } + + /// + /// Gets or Sets Number + /// + [DataMember(Name = "number", EmitDefaultValue = false)] + public string Number { 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)] + public string RecurringDetailReference { 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)] + public string StoredPaymentMethodId { get; set; } + + /// + /// **scheme** + /// + /// **scheme** + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { 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 CardDetails {\n"); + sb.Append(" Brand: ").Append(Brand).Append("\n"); + sb.Append(" CupsecureplusSmscode: ").Append(CupsecureplusSmscode).Append("\n"); + sb.Append(" Cvc: ").Append(Cvc).Append("\n"); + sb.Append(" EncryptedCardNumber: ").Append(EncryptedCardNumber).Append("\n"); + sb.Append(" EncryptedExpiryMonth: ").Append(EncryptedExpiryMonth).Append("\n"); + sb.Append(" EncryptedExpiryYear: ").Append(EncryptedExpiryYear).Append("\n"); + sb.Append(" ExpiryMonth: ").Append(ExpiryMonth).Append("\n"); + sb.Append(" ExpiryYear: ").Append(ExpiryYear).Append("\n"); + sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); + sb.Append(" HolderName: ").Append(HolderName).Append("\n"); + sb.Append(" Number: ").Append(Number).Append("\n"); + sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CardDetails); + } + + /// + /// Returns true if CardDetails instances are equal + /// + /// Instance of CardDetails to be compared + /// Boolean + public bool Equals(CardDetails input) + { + if (input == null) + return false; + + return + ( + this.Brand == input.Brand || + this.Brand != null && + this.Brand.Equals(input.Brand) + ) && + ( + this.CupsecureplusSmscode == input.CupsecureplusSmscode || + this.CupsecureplusSmscode != null && + this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode) + ) && + ( + this.Cvc == input.Cvc || + this.Cvc != null && + this.Cvc.Equals(input.Cvc) + ) && + ( + this.EncryptedCardNumber == input.EncryptedCardNumber || + this.EncryptedCardNumber != null && + this.EncryptedCardNumber.Equals(input.EncryptedCardNumber) + ) && + ( + this.EncryptedExpiryMonth == input.EncryptedExpiryMonth || + this.EncryptedExpiryMonth != null && + this.EncryptedExpiryMonth.Equals(input.EncryptedExpiryMonth) + ) && + ( + this.EncryptedExpiryYear == input.EncryptedExpiryYear || + this.EncryptedExpiryYear != null && + this.EncryptedExpiryYear.Equals(input.EncryptedExpiryYear) + ) && + ( + this.ExpiryMonth == input.ExpiryMonth || + this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth) + ) && + ( + this.ExpiryYear == input.ExpiryYear || + this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear) + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource != null && + this.FundingSource.Equals(input.FundingSource) + ) && + ( + this.HolderName == input.HolderName || + this.HolderName != null && + this.HolderName.Equals(input.HolderName) + ) && + ( + this.Number == input.Number || + this.Number != null && + this.Number.Equals(input.Number) + ) && + ( + this.RecurringDetailReference == input.RecurringDetailReference || + this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId) + ) && + ( + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Brand != null) + hashCode = hashCode * 59 + this.Brand.GetHashCode(); + if (this.CupsecureplusSmscode != null) + hashCode = hashCode * 59 + this.CupsecureplusSmscode.GetHashCode(); + if (this.Cvc != null) + hashCode = hashCode * 59 + this.Cvc.GetHashCode(); + if (this.EncryptedCardNumber != null) + hashCode = hashCode * 59 + this.EncryptedCardNumber.GetHashCode(); + if (this.EncryptedExpiryMonth != null) + hashCode = hashCode * 59 + this.EncryptedExpiryMonth.GetHashCode(); + if (this.EncryptedExpiryYear != null) + hashCode = hashCode * 59 + this.EncryptedExpiryYear.GetHashCode(); + if (this.ExpiryMonth != null) + hashCode = hashCode * 59 + this.ExpiryMonth.GetHashCode(); + if (this.ExpiryYear != null) + hashCode = hashCode * 59 + this.ExpiryYear.GetHashCode(); + if (this.FundingSource != null) + hashCode = hashCode * 59 + this.FundingSource.GetHashCode(); + if (this.HolderName != null) + hashCode = hashCode * 59 + this.HolderName.GetHashCode(); + if (this.Number != null) + hashCode = hashCode * 59 + this.Number.GetHashCode(); + if (this.RecurringDetailReference != null) + hashCode = hashCode * 59 + this.RecurringDetailReference.GetHashCode(); + if (this.StoredPaymentMethodId != null) + hashCode = hashCode * 59 + this.StoredPaymentMethodId.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.cs b/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.cs new file mode 100644 index 000000000..5de41539c --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutBalanceCheckRequest.cs @@ -0,0 +1,965 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Model.ApplicationInformation; +using Adyen.Util; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutBalanceCheckRequest + /// + [DataContract] + public partial class CheckoutBalanceCheckRequest : IEquatable, IValidatableObject + { + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] + public enum RecurringProcessingModelEnum + { + /// + /// Enum CardOnFile for value: CardOnFile + /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, + + /// + /// Enum Subscription for value: Subscription + /// + [EnumMember(Value = "Subscription")] Subscription = 2, + + /// + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile + /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + + /// + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [JsonConverter(typeof(StringEnumConverter))] + public enum ShopperInteractionEnum + { + /// + /// Enum Ecommerce for value: Ecommerce + /// + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, + + /// + /// Enum ContAuth for value: ContAuth + /// + [EnumMember(Value = "ContAuth")] ContAuth = 2, + + /// + /// Enum Moto for value: Moto + /// + [EnumMember(Value = "Moto")] Moto = 3, + + /// + /// Enum POS for value: POS + /// + [EnumMember(Value = "POS")] POS = 4 + } + + /// + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? ShopperInteraction { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// accountInfo. + /// additionalAmount. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// browserInfo. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// dccQuote. + /// deliveryAddress. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// installments. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// merchantRiskIndicator. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\".. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. + /// The collection that contains the type of the payment method and its specific information. (required). + /// recurring. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). + /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card.. + /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail.. + /// A session ID used to identify a payment session.. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments.. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string.. + /// The shopper's social security number.. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information).. + /// The physical store, for which this payment is processed.. + /// The shopper's telephone number.. + /// threeDS2RequestData. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). + /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available).. + /// Set to true if the payment should be routed to a trusted MID.. + public CheckoutBalanceCheckRequest(AccountInfo accountInfo = default(AccountInfo), + Amount additionalAmount = default(Amount), + Dictionary additionalData = + default(Dictionary), Amount amount = default(Amount), + ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), + BrowserInfo browserInfo = default(BrowserInfo), int? captureDelayHours = default(int?), + DateTime? dateOfBirth = default(DateTime?), ForexQuote dccQuote = default(ForexQuote), + Address deliveryAddress = default(Address), DateTime? deliveryDate = default(DateTime?), + string deviceFingerprint = default(string), int? fraudOffset = default(int?), + Installments installments = default(Installments), string mcc = default(string), + string merchantAccount = default(string), string merchantOrderReference = default(string), + MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), + Dictionary metadata = default(Dictionary), + string orderReference = default(string), + Dictionary paymentMethod = default(Dictionary), + Recurring recurring = default(Recurring), + RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), + string reference = default(string), string selectedBrand = default(string), + string selectedRecurringDetailReference = default(string), string sessionId = default(string), + string shopperEmail = default(string), string shopperIP = default(string), + ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), + string shopperLocale = default(string), Name shopperName = default(Name), + string shopperReference = default(string), string shopperStatement = default(string), + string socialSecurityNumber = default(string), List splits = default(List), + string store = default(string), string telephoneNumber = default(string), + ThreeDS2RequestData threeDS2RequestData = default(ThreeDS2RequestData), + bool? threeDSAuthenticationOnly = false, string totalsGroup = default(string), + bool? trustedShopper = default(bool?)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException( + "amount is a required property for CheckoutBalanceCheckRequest and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException( + "merchantAccount is a required property for CheckoutBalanceCheckRequest and cannot be null"); + } + else + { + this.MerchantAccount = merchantAccount; + } + // to ensure "paymentMethod" is required (not null) + if (paymentMethod == null) + { + throw new InvalidDataException( + "paymentMethod is a required property for CheckoutBalanceCheckRequest and cannot be null"); + } + else + { + this.PaymentMethod = paymentMethod; + } + // to ensure "reference" is required (not null) + if (reference == null) + { + throw new InvalidDataException( + "reference is a required property for CheckoutBalanceCheckRequest and cannot be null"); + } + else + { + this.Reference = reference; + } + this.AccountInfo = accountInfo; + this.AdditionalAmount = additionalAmount; + this.AdditionalData = additionalData; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BrowserInfo = browserInfo; + this.CaptureDelayHours = captureDelayHours; + this.DateOfBirth = dateOfBirth; + this.DccQuote = dccQuote; + this.DeliveryAddress = deliveryAddress; + this.DeliveryDate = deliveryDate; + this.DeviceFingerprint = deviceFingerprint; + this.FraudOffset = fraudOffset; + this.Installments = installments; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.MerchantRiskIndicator = merchantRiskIndicator; + this.Metadata = metadata; + this.OrderReference = orderReference; + this.Recurring = recurring; + this.RecurringProcessingModel = recurringProcessingModel; + this.SelectedBrand = selectedBrand; + this.SelectedRecurringDetailReference = selectedRecurringDetailReference; + this.SessionId = sessionId; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.SocialSecurityNumber = socialSecurityNumber; + this.Splits = splits; + this.Store = store; + this.TelephoneNumber = telephoneNumber; + this.ThreeDS2RequestData = threeDS2RequestData; + // use default value if no "threeDSAuthenticationOnly" provided + if (threeDSAuthenticationOnly == null) + { + this.ThreeDSAuthenticationOnly = false; + } + else + { + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + } + this.TotalsGroup = totalsGroup; + this.TrustedShopper = trustedShopper; + } + + /// + /// Gets or Sets AccountInfo + /// + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo AccountInfo { get; set; } + + /// + /// Gets or Sets AdditionalAmount + /// + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount AdditionalAmount { get; set; } + + /// + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } + + /// + /// Gets or Sets ApplicationInfo + /// + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } + + /// + /// Gets or Sets BillingAddress + /// + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } + + /// + /// Gets or Sets BrowserInfo + /// + [DataMember(Name = "browserInfo", EmitDefaultValue = false)] + public BrowserInfo BrowserInfo { get; set; } + + /// + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int? CaptureDelayHours { get; set; } + + /// + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime? DateOfBirth { get; set; } + + /// + /// Gets or Sets DccQuote + /// + [DataMember(Name = "dccQuote", EmitDefaultValue = false)] + public ForexQuote DccQuote { get; set; } + + /// + /// Gets or Sets DeliveryAddress + /// + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address DeliveryAddress { get; set; } + + /// + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + /// + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00 + [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] + public DateTime? DeliveryDate { get; set; } + + /// + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + /// + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). + [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] + public string DeviceFingerprint { get; set; } + + /// + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] + public int? FraudOffset { get; set; } + + /// + /// Gets or Sets Installments + /// + [DataMember(Name = "installments", EmitDefaultValue = false)] + public Installments Installments { get; set; } + + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string Mcc { 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)] + public string MerchantAccount { get; set; } + + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } + + /// + /// Gets or Sets MerchantRiskIndicator + /// + [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] + public MerchantRiskIndicator MerchantRiskIndicator { get; set; } + + /// + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". + /// + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } + + /// + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + /// + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. + [DataMember(Name = "orderReference", EmitDefaultValue = false)] + public string OrderReference { get; set; } + + /// + /// The collection that contains the type of the payment method and its specific information. + /// + /// The collection that contains the type of the payment method and its specific information. + [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + public Dictionary PaymentMethod { get; set; } + + /// + /// Gets or Sets Recurring + /// + [DataMember(Name = "recurring", EmitDefaultValue = false)] + public Recurring Recurring { get; set; } + + + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } + + /// + /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + /// + /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + [DataMember(Name = "selectedBrand", EmitDefaultValue = false)] + public string SelectedBrand { get; set; } + + /// + /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + /// + /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + [DataMember(Name = "selectedRecurringDetailReference", EmitDefaultValue = false)] + public string SelectedRecurringDetailReference { get; set; } + + /// + /// A session ID used to identify a payment session. + /// + /// A session ID used to identify a payment session. + [DataMember(Name = "sessionId", EmitDefaultValue = false)] + public string SessionId { get; set; } + + /// + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + /// + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } + + /// + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string ShopperIP { get; set; } + + + /// + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// + /// The combination of a language code and a country code to specify the language to be used in the payment. + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } + + /// + /// Gets or Sets ShopperName + /// + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } + + /// + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. + /// + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } + + /// + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. + /// + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string ShopperStatement { get; set; } + + /// + /// The shopper's social security number. + /// + /// The shopper's social security number. + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string SocialSecurityNumber { get; set; } + + /// + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + /// + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } + + /// + /// The physical store, for which this payment is processed. + /// + /// The physical store, for which this payment is processed. + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } + + /// + /// The shopper's telephone number. + /// + /// The shopper's telephone number. + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string TelephoneNumber { get; set; } + + /// + /// Gets or Sets ThreeDS2RequestData + /// + [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] + public ThreeDS2RequestData ThreeDS2RequestData { get; set; } + + /// + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + /// + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool? ThreeDSAuthenticationOnly { get; set; } + + /// + /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + /// + /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + [DataMember(Name = "totalsGroup", EmitDefaultValue = false)] + public string TotalsGroup { get; set; } + + /// + /// Set to true if the payment should be routed to a trusted MID. + /// + /// Set to true if the payment should be routed to a trusted MID. + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool? TrustedShopper { 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 CheckoutBalanceCheckRequest {\n"); + sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); + sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); + sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); + sb.Append(" CaptureDelayHours: ").Append(CaptureDelayHours).Append("\n"); + sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n"); + sb.Append(" DccQuote: ").Append(DccQuote).Append("\n"); + sb.Append(" DeliveryAddress: ").Append(DeliveryAddress).Append("\n"); + sb.Append(" DeliveryDate: ").Append(DeliveryDate).Append("\n"); + sb.Append(" DeviceFingerprint: ").Append(DeviceFingerprint).Append("\n"); + sb.Append(" FraudOffset: ").Append(FraudOffset).Append("\n"); + sb.Append(" Installments: ").Append(Installments).Append("\n"); + sb.Append(" Mcc: ").Append(Mcc).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); + sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata.ToCollectionsString()).Append("\n"); + sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); + sb.Append(" PaymentMethod: ").Append(PaymentMethod.ToCollectionsString()).Append("\n"); + sb.Append(" Recurring: ").Append(Recurring).Append("\n"); + sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" SelectedBrand: ").Append(SelectedBrand).Append("\n"); + sb.Append(" SelectedRecurringDetailReference: ").Append(SelectedRecurringDetailReference).Append("\n"); + sb.Append(" SessionId: ").Append(SessionId).Append("\n"); + sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); + sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); + sb.Append(" ShopperInteraction: ").Append(ShopperInteraction).Append("\n"); + sb.Append(" ShopperLocale: ").Append(ShopperLocale).Append("\n"); + sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); + sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); + sb.Append(" ShopperStatement: ").Append(ShopperStatement).Append("\n"); + sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n"); + sb.Append(" Splits: ").Append(Splits.ObjectListToString()).Append("\n"); + sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); + sb.Append(" ThreeDS2RequestData: ").Append(ThreeDS2RequestData).Append("\n"); + sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); + sb.Append(" TotalsGroup: ").Append(TotalsGroup).Append("\n"); + sb.Append(" TrustedShopper: ").Append(TrustedShopper).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutBalanceCheckRequest); + } + + /// + /// Returns true if CheckoutBalanceCheckRequest instances are equal + /// + /// Instance of CheckoutBalanceCheckRequest to be compared + /// Boolean + public bool Equals(CheckoutBalanceCheckRequest input) + { + if (input == null) + return false; + + return + ( + this.AccountInfo == input.AccountInfo || + this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo) + ) && + ( + this.AdditionalAmount == input.AdditionalAmount || + this.AdditionalAmount != null && + this.AdditionalAmount.Equals(input.AdditionalAmount) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + this.AdditionalData.Equals(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo) + ) && + ( + this.BillingAddress == input.BillingAddress || + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) + ) && + ( + this.BrowserInfo == input.BrowserInfo || + this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo) + ) && + ( + this.CaptureDelayHours == input.CaptureDelayHours || + this.CaptureDelayHours != null && + this.CaptureDelayHours.Equals(input.CaptureDelayHours) + ) && + ( + this.DateOfBirth == input.DateOfBirth || + this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth) + ) && + ( + this.DccQuote == input.DccQuote || + this.DccQuote != null && + this.DccQuote.Equals(input.DccQuote) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) + ) && + ( + this.DeliveryDate == input.DeliveryDate || + this.DeliveryDate != null && + this.DeliveryDate.Equals(input.DeliveryDate) + ) && + ( + this.DeviceFingerprint == input.DeviceFingerprint || + this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint) + ) && + ( + this.FraudOffset == input.FraudOffset || + this.FraudOffset != null && + this.FraudOffset.Equals(input.FraudOffset) + ) && + ( + this.Installments == input.Installments || + this.Installments != null && + this.Installments.Equals(input.Installments) + ) && + ( + this.Mcc == input.Mcc || + this.Mcc != null && + this.Mcc.Equals(input.Mcc) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference) + ) && + ( + this.MerchantRiskIndicator == input.MerchantRiskIndicator || + this.MerchantRiskIndicator != null && + this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.OrderReference == input.OrderReference || + this.OrderReference != null && + this.OrderReference.Equals(input.OrderReference) + ) && + ( + this.PaymentMethod == input.PaymentMethod || + this.PaymentMethod != null && + input.PaymentMethod != null && + this.PaymentMethod.SequenceEqual(input.PaymentMethod) + ) && + ( + this.Recurring == input.Recurring || + this.Recurring != null && + this.Recurring.Equals(input.Recurring) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel != null && + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.SelectedBrand == input.SelectedBrand || + this.SelectedBrand != null && + this.SelectedBrand.Equals(input.SelectedBrand) + ) && + ( + this.SelectedRecurringDetailReference == input.SelectedRecurringDetailReference || + this.SelectedRecurringDetailReference != null && + this.SelectedRecurringDetailReference.Equals(input.SelectedRecurringDetailReference) + ) && + ( + this.SessionId == input.SessionId || + this.SessionId != null && + this.SessionId.Equals(input.SessionId) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) + ) && + ( + this.ShopperIP == input.ShopperIP || + this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP) + ) && + ( + this.ShopperInteraction == input.ShopperInteraction || + this.ShopperInteraction != null && + this.ShopperInteraction.Equals(input.ShopperInteraction) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) + ) && + ( + this.ShopperName == input.ShopperName || + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) + ) && + ( + this.ShopperReference == input.ShopperReference || + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) + ) && + ( + this.ShopperStatement == input.ShopperStatement || + this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement) + ) && + ( + this.SocialSecurityNumber == input.SocialSecurityNumber || + this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + this.Store != null && + this.Store.Equals(input.Store) + ) && + ( + this.TelephoneNumber == input.TelephoneNumber || + this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber) + ) && + ( + this.ThreeDS2RequestData == input.ThreeDS2RequestData || + this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly != null && + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) + ) && + ( + this.TotalsGroup == input.TotalsGroup || + this.TotalsGroup != null && + this.TotalsGroup.Equals(input.TotalsGroup) + ) && + ( + this.TrustedShopper == input.TrustedShopper || + this.TrustedShopper != null && + this.TrustedShopper.Equals(input.TrustedShopper) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AccountInfo != null) + hashCode = hashCode * 59 + this.AccountInfo.GetHashCode(); + if (this.AdditionalAmount != null) + hashCode = hashCode * 59 + this.AdditionalAmount.GetHashCode(); + if (this.AdditionalData != null) + hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.ApplicationInfo != null) + hashCode = hashCode * 59 + this.ApplicationInfo.GetHashCode(); + if (this.BillingAddress != null) + hashCode = hashCode * 59 + this.BillingAddress.GetHashCode(); + if (this.BrowserInfo != null) + hashCode = hashCode * 59 + this.BrowserInfo.GetHashCode(); + if (this.CaptureDelayHours != null) + hashCode = hashCode * 59 + this.CaptureDelayHours.GetHashCode(); + if (this.DateOfBirth != null) + hashCode = hashCode * 59 + this.DateOfBirth.GetHashCode(); + if (this.DccQuote != null) + hashCode = hashCode * 59 + this.DccQuote.GetHashCode(); + if (this.DeliveryAddress != null) + hashCode = hashCode * 59 + this.DeliveryAddress.GetHashCode(); + if (this.DeliveryDate != null) + hashCode = hashCode * 59 + this.DeliveryDate.GetHashCode(); + if (this.DeviceFingerprint != null) + hashCode = hashCode * 59 + this.DeviceFingerprint.GetHashCode(); + if (this.FraudOffset != null) + hashCode = hashCode * 59 + this.FraudOffset.GetHashCode(); + if (this.Installments != null) + hashCode = hashCode * 59 + this.Installments.GetHashCode(); + if (this.Mcc != null) + hashCode = hashCode * 59 + this.Mcc.GetHashCode(); + if (this.MerchantAccount != null) + hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.MerchantOrderReference != null) + hashCode = hashCode * 59 + this.MerchantOrderReference.GetHashCode(); + if (this.MerchantRiskIndicator != null) + hashCode = hashCode * 59 + this.MerchantRiskIndicator.GetHashCode(); + if (this.Metadata != null) + hashCode = hashCode * 59 + this.Metadata.GetHashCode(); + if (this.OrderReference != null) + hashCode = hashCode * 59 + this.OrderReference.GetHashCode(); + if (this.PaymentMethod != null) + hashCode = hashCode * 59 + this.PaymentMethod.GetHashCode(); + if (this.Recurring != null) + hashCode = hashCode * 59 + this.Recurring.GetHashCode(); + if (this.RecurringProcessingModel != null) + hashCode = hashCode * 59 + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.SelectedBrand != null) + hashCode = hashCode * 59 + this.SelectedBrand.GetHashCode(); + if (this.SelectedRecurringDetailReference != null) + hashCode = hashCode * 59 + this.SelectedRecurringDetailReference.GetHashCode(); + if (this.SessionId != null) + hashCode = hashCode * 59 + this.SessionId.GetHashCode(); + if (this.ShopperEmail != null) + hashCode = hashCode * 59 + this.ShopperEmail.GetHashCode(); + if (this.ShopperIP != null) + hashCode = hashCode * 59 + this.ShopperIP.GetHashCode(); + if (this.ShopperInteraction != null) + hashCode = hashCode * 59 + this.ShopperInteraction.GetHashCode(); + if (this.ShopperLocale != null) + hashCode = hashCode * 59 + this.ShopperLocale.GetHashCode(); + if (this.ShopperName != null) + hashCode = hashCode * 59 + this.ShopperName.GetHashCode(); + if (this.ShopperReference != null) + hashCode = hashCode * 59 + this.ShopperReference.GetHashCode(); + if (this.ShopperStatement != null) + hashCode = hashCode * 59 + this.ShopperStatement.GetHashCode(); + if (this.SocialSecurityNumber != null) + hashCode = hashCode * 59 + this.SocialSecurityNumber.GetHashCode(); + if (this.Splits != null) + hashCode = hashCode * 59 + this.Splits.GetHashCode(); + if (this.Store != null) + hashCode = hashCode * 59 + this.Store.GetHashCode(); + if (this.TelephoneNumber != null) + hashCode = hashCode * 59 + this.TelephoneNumber.GetHashCode(); + if (this.ThreeDS2RequestData != null) + hashCode = hashCode * 59 + this.ThreeDS2RequestData.GetHashCode(); + if (this.ThreeDSAuthenticationOnly != null) + hashCode = hashCode * 59 + this.ThreeDSAuthenticationOnly.GetHashCode(); + if (this.TotalsGroup != null) + hashCode = hashCode * 59 + this.TotalsGroup.GetHashCode(); + if (this.TrustedShopper != null) + hashCode = hashCode * 59 + this.TrustedShopper.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.cs b/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.cs new file mode 100644 index 000000000..6bc3a7641 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutBalanceCheckResponse.cs @@ -0,0 +1,312 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutBalanceCheckResponse + /// + [DataContract] + public partial class CheckoutBalanceCheckResponse : IEquatable, IValidatableObject + { + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [JsonConverter(typeof(StringEnumConverter))] + public enum ResultCodeEnum + { + /// + /// Enum AuthenticationFinished for value: AuthenticationFinished + /// + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, + + /// + /// Enum Authorised for value: Authorised + /// + [EnumMember(Value = "Authorised")] Authorised = 2, + + /// + /// Enum Cancelled for value: Cancelled + /// + [EnumMember(Value = "Cancelled")] Cancelled = 3, + + /// + /// Enum ChallengeShopper for value: ChallengeShopper + /// + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 4, + + /// + /// Enum Error for value: Error + /// + [EnumMember(Value = "Error")] Error = 5, + + /// + /// Enum IdentifyShopper for value: IdentifyShopper + /// + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 6, + + /// + /// Enum Pending for value: Pending + /// + [EnumMember(Value = "Pending")] Pending = 7, + + /// + /// Enum PresentToShopper for value: PresentToShopper + /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 8, + + /// + /// Enum Received for value: Received + /// + [EnumMember(Value = "Received")] Received = 9, + + /// + /// Enum RedirectShopper for value: RedirectShopper + /// + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 10, + + /// + /// Enum Refused for value: Refused + /// + [EnumMember(Value = "Refused")] Refused = 11 + } + + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**.. + /// balance (required). + /// fraudResult. + /// 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. > `pspReference` is returned only for non-redirect payment methods.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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.. + /// transactionLimit. + public CheckoutBalanceCheckResponse( + Dictionary additionalData = + default(Dictionary), Amount balance = default(Amount), + FraudResult fraudResult = default(FraudResult), string pspReference = default(string), + string refusalReason = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), + Amount transactionLimit = default(Amount)) + { + // to ensure "balance" is required (not null) + if (balance == null) + { + throw new InvalidDataException( + "balance is a required property for CheckoutBalanceCheckResponse and cannot be null"); + } + else + { + this.Balance = balance; + } + this.AdditionalData = additionalData; + this.FraudResult = fraudResult; + this.PspReference = pspReference; + this.RefusalReason = refusalReason; + this.ResultCode = resultCode; + this.TransactionLimit = transactionLimit; + } + + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } + + /// + /// Gets or Sets Balance + /// + [DataMember(Name = "balance", EmitDefaultValue = false)] + public Amount Balance { get; set; } + + /// + /// Gets or Sets FraudResult + /// + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } + + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } + + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } + + + /// + /// Gets or Sets TransactionLimit + /// + [DataMember(Name = "transactionLimit", EmitDefaultValue = false)] + public Amount TransactionLimit { 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 CheckoutBalanceCheckResponse {\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" Balance: ").Append(Balance).Append("\n"); + sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append(" TransactionLimit: ").Append(TransactionLimit).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutBalanceCheckResponse); + } + + /// + /// Returns true if CheckoutBalanceCheckResponse instances are equal + /// + /// Instance of CheckoutBalanceCheckResponse to be compared + /// Boolean + public bool Equals(CheckoutBalanceCheckResponse input) + { + if (input == null) + return false; + + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + this.AdditionalData.Equals(input.AdditionalData) + ) && + ( + this.Balance == input.Balance || + this.Balance != null && + this.Balance.Equals(input.Balance) + ) && + ( + this.FraudResult == input.FraudResult || + this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult) + ) && + ( + this.PspReference == input.PspReference || + this.PspReference != null && + this.PspReference.Equals(input.PspReference) + ) && + ( + this.RefusalReason == input.RefusalReason || + this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode) + ) && + ( + this.TransactionLimit == input.TransactionLimit || + this.TransactionLimit != null && + this.TransactionLimit.Equals(input.TransactionLimit) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalData != null) + hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); + if (this.Balance != null) + hashCode = hashCode * 59 + this.Balance.GetHashCode(); + if (this.FraudResult != null) + hashCode = hashCode * 59 + this.FraudResult.GetHashCode(); + if (this.PspReference != null) + hashCode = hashCode * 59 + this.PspReference.GetHashCode(); + if (this.RefusalReason != null) + hashCode = hashCode * 59 + this.RefusalReason.GetHashCode(); + if (this.ResultCode != null) + hashCode = hashCode * 59 + this.ResultCode.GetHashCode(); + if (this.TransactionLimit != null) + hashCode = hashCode * 59 + this.TransactionLimit.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs new file mode 100644 index 000000000..93af41599 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutBankTransferAction.cs @@ -0,0 +1,305 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutBankTransferAction + /// + [DataContract] + public partial class CheckoutBankTransferAction : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The name of the account holder.. + /// The BIC of the IBAN.. + /// The url to download payment details with.. + /// The IBAN of the bank transfer.. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling.. + /// Specifies the payment method.. + /// The transfer reference.. + /// The e-mail of the shopper, included if an e-mail was sent to the shopper.. + /// totalAmount. + /// The type of bank transfer.. + /// Specifies the URL to redirect to.. + public CheckoutBankTransferAction(string beneficiary = default(string), string bic = default(string), + string downloadUrl = default(string), string iban = default(string), string paymentData = default(string), + string paymentMethodType = default(string), string reference = default(string), + string shopperEmail = default(string), Amount totalAmount = default(Amount), string type = default(string), + string url = default(string)) + { + this.Beneficiary = beneficiary; + this.Bic = bic; + this.DownloadUrl = downloadUrl; + this.Iban = iban; + this.PaymentData = paymentData; + this.PaymentMethodType = paymentMethodType; + this.Reference = reference; + this.ShopperEmail = shopperEmail; + this.TotalAmount = totalAmount; + this.Type = type; + this.Url = url; + } + + /// + /// The name of the account holder. + /// + /// The name of the account holder. + [DataMember(Name = "beneficiary", EmitDefaultValue = false)] + public string Beneficiary { get; set; } + + /// + /// The BIC of the IBAN. + /// + /// The BIC of the IBAN. + [DataMember(Name = "bic", EmitDefaultValue = false)] + public string Bic { get; set; } + + /// + /// The url to download payment details with. + /// + /// The url to download payment details with. + [DataMember(Name = "downloadUrl", EmitDefaultValue = false)] + public string DownloadUrl { get; set; } + + /// + /// The IBAN of the bank transfer. + /// + /// The IBAN of the bank transfer. + [DataMember(Name = "iban", EmitDefaultValue = false)] + public string Iban { get; set; } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. In some cases, required for polling. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// Specifies the payment method. + /// + /// Specifies the payment method. + [DataMember(Name = "paymentMethodType", EmitDefaultValue = false)] + public string PaymentMethodType { get; set; } + + /// + /// The transfer reference. + /// + /// The transfer reference. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } + + /// + /// The e-mail of the shopper, included if an e-mail was sent to the shopper. + /// + /// The e-mail of the shopper, included if an e-mail was sent to the shopper. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } + + /// + /// Gets or Sets TotalAmount + /// + [DataMember(Name = "totalAmount", EmitDefaultValue = false)] + public Amount TotalAmount { get; set; } + + /// + /// The type of bank transfer. + /// + /// The type of bank transfer. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { get; set; } + + /// + /// Specifies the URL to redirect to. + /// + /// Specifies the URL to redirect to. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { 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 CheckoutBankTransferAction {\n"); + sb.Append(" Beneficiary: ").Append(Beneficiary).Append("\n"); + sb.Append(" Bic: ").Append(Bic).Append("\n"); + sb.Append(" DownloadUrl: ").Append(DownloadUrl).Append("\n"); + sb.Append(" Iban: ").Append(Iban).Append("\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PaymentMethodType: ").Append(PaymentMethodType).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); + sb.Append(" TotalAmount: ").Append(TotalAmount).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutBankTransferAction); + } + + /// + /// Returns true if CheckoutBankTransferAction instances are equal + /// + /// Instance of CheckoutBankTransferAction to be compared + /// Boolean + public bool Equals(CheckoutBankTransferAction input) + { + if (input == null) + return false; + + return + ( + this.Beneficiary == input.Beneficiary || + this.Beneficiary != null && + this.Beneficiary.Equals(input.Beneficiary) + ) && + ( + this.Bic == input.Bic || + this.Bic != null && + this.Bic.Equals(input.Bic) + ) && + ( + this.DownloadUrl == input.DownloadUrl || + this.DownloadUrl != null && + this.DownloadUrl.Equals(input.DownloadUrl) + ) && + ( + this.Iban == input.Iban || + this.Iban != null && + this.Iban.Equals(input.Iban) + ) && + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PaymentMethodType == input.PaymentMethodType || + this.PaymentMethodType != null && + this.PaymentMethodType.Equals(input.PaymentMethodType) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) + ) && + ( + this.TotalAmount == input.TotalAmount || + this.TotalAmount != null && + this.TotalAmount.Equals(input.TotalAmount) + ) && + ( + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Beneficiary != null) + hashCode = hashCode * 59 + this.Beneficiary.GetHashCode(); + if (this.Bic != null) + hashCode = hashCode * 59 + this.Bic.GetHashCode(); + if (this.DownloadUrl != null) + hashCode = hashCode * 59 + this.DownloadUrl.GetHashCode(); + if (this.Iban != null) + hashCode = hashCode * 59 + this.Iban.GetHashCode(); + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PaymentMethodType != null) + hashCode = hashCode * 59 + this.PaymentMethodType.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.ShopperEmail != null) + hashCode = hashCode * 59 + this.ShopperEmail.GetHashCode(); + if (this.TotalAmount != null) + hashCode = hashCode * 59 + this.TotalAmount.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutCancelOrderRequest.cs b/Adyen/Model/Checkout/CheckoutCancelOrderRequest.cs new file mode 100644 index 000000000..3b56c42d0 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutCancelOrderRequest.cs @@ -0,0 +1,168 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutCancelOrderRequest + /// + [DataContract] + public partial class CheckoutCancelOrderRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The merchant account identifier that orderData belongs to. (required). + /// order (required). + public CheckoutCancelOrderRequest(string merchantAccount = default(string), + CheckoutOrder order = default(CheckoutOrder)) + { + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException( + "merchantAccount is a required property for CheckoutCancelOrderRequest and cannot be null"); + } + else + { + this.MerchantAccount = merchantAccount; + } + // to ensure "order" is required (not null) + if (order == null) + { + throw new InvalidDataException( + "order is a required property for CheckoutCancelOrderRequest and cannot be null"); + } + else + { + this.Order = order; + } + } + + /// + /// The merchant account identifier that orderData belongs to. + /// + /// The merchant account identifier that orderData belongs to. + [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] + public string MerchantAccount { get; set; } + + /// + /// Gets or Sets Order + /// + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrder Order { 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 CheckoutCancelOrderRequest {\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Order: ").Append(Order).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutCancelOrderRequest); + } + + /// + /// Returns true if CheckoutCancelOrderRequest instances are equal + /// + /// Instance of CheckoutCancelOrderRequest to be compared + /// Boolean + public bool Equals(CheckoutCancelOrderRequest input) + { + if (input == null) + return false; + + return + ( + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) + ) && + ( + this.Order == input.Order || + this.Order != null && + this.Order.Equals(input.Order) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MerchantAccount != null) + hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.Order != null) + hashCode = hashCode * 59 + this.Order.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutCancelOrderResponse.cs b/Adyen/Model/Checkout/CheckoutCancelOrderResponse.cs new file mode 100644 index 000000000..651533c73 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutCancelOrderResponse.cs @@ -0,0 +1,168 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutCancelOrderResponse + /// + [DataContract] + public partial class CheckoutCancelOrderResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// A unique reference of the cancellation request. (required). + /// The result of the cancellation request. (required). + public CheckoutCancelOrderResponse(string pspReference = default(string), string resultCode = default(string)) + { + // to ensure "pspReference" is required (not null) + if (pspReference == null) + { + throw new InvalidDataException( + "pspReference is a required property for CheckoutCancelOrderResponse and cannot be null"); + } + else + { + this.PspReference = pspReference; + } + // to ensure "resultCode" is required (not null) + if (resultCode == null) + { + throw new InvalidDataException( + "resultCode is a required property for CheckoutCancelOrderResponse and cannot be null"); + } + else + { + this.ResultCode = resultCode; + } + } + + /// + /// A unique reference of the cancellation request. + /// + /// A unique reference of the cancellation request. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } + + /// + /// The result of the cancellation request. + /// + /// The result of the cancellation request. + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public string ResultCode { 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 CheckoutCancelOrderResponse {\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutCancelOrderResponse); + } + + /// + /// Returns true if CheckoutCancelOrderResponse instances are equal + /// + /// Instance of CheckoutCancelOrderResponse to be compared + /// Boolean + public bool Equals(CheckoutCancelOrderResponse input) + { + if (input == null) + return false; + + return + ( + this.PspReference == input.PspReference || + this.PspReference != null && + this.PspReference.Equals(input.PspReference) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.PspReference != null) + hashCode = hashCode * 59 + this.PspReference.GetHashCode(); + if (this.ResultCode != null) + hashCode = hashCode * 59 + this.ResultCode.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutCreateOrderRequest.cs b/Adyen/Model/Checkout/CheckoutCreateOrderRequest.cs new file mode 100644 index 000000000..8e273987f --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutCreateOrderRequest.cs @@ -0,0 +1,202 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutCreateOrderRequest + /// + [DataContract] + public partial class CheckoutCreateOrderRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day.. + /// The merchant account identifier, with which you want to process the order. (required). + /// A custom reference identifying the order.. + public CheckoutCreateOrderRequest(Amount amount = default(Amount), string expiresAt = default(string), + string merchantAccount = default(string), string reference = default(string)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException( + "amount is a required property for CheckoutCreateOrderRequest and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException( + "merchantAccount is a required property for CheckoutCreateOrderRequest and cannot be null"); + } + else + { + this.MerchantAccount = merchantAccount; + } + this.ExpiresAt = expiresAt; + this.Reference = reference; + } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } + + /// + /// The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + /// + /// The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } + + /// + /// The merchant account identifier, with which you want to process the order. + /// + /// The merchant account identifier, with which you want to process the order. + [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] + public string MerchantAccount { get; set; } + + /// + /// A custom reference identifying the order. + /// + /// A custom reference identifying the order. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { 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 CheckoutCreateOrderRequest {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutCreateOrderRequest); + } + + /// + /// Returns true if CheckoutCreateOrderRequest instances are equal + /// + /// Instance of CheckoutCreateOrderRequest to be compared + /// Boolean + public bool Equals(CheckoutCreateOrderRequest input) + { + if (input == null) + return false; + + return + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); + if (this.MerchantAccount != null) + hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutCreateOrderResponse.cs b/Adyen/Model/Checkout/CheckoutCreateOrderResponse.cs new file mode 100644 index 000000000..7d693f7d8 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutCreateOrderResponse.cs @@ -0,0 +1,348 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutCreateOrderResponse + /// + [DataContract] + public partial class CheckoutCreateOrderResponse : IEquatable, IValidatableObject + { + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [JsonConverter(typeof(StringEnumConverter))] + public enum ResultCodeEnum + { + /// + /// Enum AuthenticationFinished for value: AuthenticationFinished + /// + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, + + /// + /// Enum Authorised for value: Authorised + /// + [EnumMember(Value = "Authorised")] Authorised = 2, + + /// + /// Enum Cancelled for value: Cancelled + /// + [EnumMember(Value = "Cancelled")] Cancelled = 3, + + /// + /// Enum ChallengeShopper for value: ChallengeShopper + /// + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 4, + + /// + /// Enum Error for value: Error + /// + [EnumMember(Value = "Error")] Error = 5, + + /// + /// Enum IdentifyShopper for value: IdentifyShopper + /// + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 6, + + /// + /// Enum Pending for value: Pending + /// + [EnumMember(Value = "Pending")] Pending = 7, + + /// + /// Enum PresentToShopper for value: PresentToShopper + /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 8, + + /// + /// Enum Received for value: Received + /// + [EnumMember(Value = "Received")] Received = 9, + + /// + /// Enum RedirectShopper for value: RedirectShopper + /// + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 10, + + /// + /// Enum Refused for value: Refused + /// + [EnumMember(Value = "Refused")] Refused = 11 + } + + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**.. + /// The date that the order will expire. (required). + /// fraudResult. + /// The encrypted data that will be used by merchant for adding payments to the order. (required). + /// 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. > `pspReference` is returned only for non-redirect payment methods.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// remainingAmount (required). + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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.. + public CheckoutCreateOrderResponse( + Dictionary additionalData = + default(Dictionary), string expiresAt = default(string), + FraudResult fraudResult = default(FraudResult), string orderData = default(string), + string pspReference = default(string), string refusalReason = default(string), + Amount remainingAmount = default(Amount), ResultCodeEnum? resultCode = default(ResultCodeEnum?)) + { + // to ensure "expiresAt" is required (not null) + if (expiresAt == null) + { + throw new InvalidDataException( + "expiresAt is a required property for CheckoutCreateOrderResponse and cannot be null"); + } + else + { + this.ExpiresAt = expiresAt; + } + // to ensure "orderData" is required (not null) + if (orderData == null) + { + throw new InvalidDataException( + "orderData is a required property for CheckoutCreateOrderResponse and cannot be null"); + } + else + { + this.OrderData = orderData; + } + // to ensure "remainingAmount" is required (not null) + if (remainingAmount == null) + { + throw new InvalidDataException( + "remainingAmount is a required property for CheckoutCreateOrderResponse and cannot be null"); + } + else + { + this.RemainingAmount = remainingAmount; + } + this.AdditionalData = additionalData; + this.FraudResult = fraudResult; + this.PspReference = pspReference; + this.RefusalReason = refusalReason; + this.ResultCode = resultCode; + } + + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } + + /// + /// The date that the order will expire. + /// + /// The date that the order will expire. + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } + + /// + /// Gets or Sets FraudResult + /// + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } + + /// + /// The encrypted data that will be used by merchant for adding payments to the order. + /// + /// The encrypted data that will be used by merchant for adding payments to the order. + [DataMember(Name = "orderData", EmitDefaultValue = false)] + public string OrderData { get; set; } + + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } + + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } + + /// + /// Gets or Sets RemainingAmount + /// + [DataMember(Name = "remainingAmount", EmitDefaultValue = false)] + public Amount RemainingAmount { 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 CheckoutCreateOrderResponse {\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); + sb.Append(" OrderData: ").Append(OrderData).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); + sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutCreateOrderResponse); + } + + /// + /// Returns true if CheckoutCreateOrderResponse instances are equal + /// + /// Instance of CheckoutCreateOrderResponse to be compared + /// Boolean + public bool Equals(CheckoutCreateOrderResponse input) + { + if (input == null) + return false; + + return + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + this.AdditionalData.Equals(input.AdditionalData) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) + ) && + ( + this.FraudResult == input.FraudResult || + this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult) + ) && + ( + this.OrderData == input.OrderData || + this.OrderData != null && + this.OrderData.Equals(input.OrderData) + ) && + ( + this.PspReference == input.PspReference || + this.PspReference != null && + this.PspReference.Equals(input.PspReference) + ) && + ( + this.RefusalReason == input.RefusalReason || + this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason) + ) && + ( + this.RemainingAmount == input.RemainingAmount || + this.RemainingAmount != null && + this.RemainingAmount.Equals(input.RemainingAmount) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AdditionalData != null) + hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); + if (this.FraudResult != null) + hashCode = hashCode * 59 + this.FraudResult.GetHashCode(); + if (this.OrderData != null) + hashCode = hashCode * 59 + this.OrderData.GetHashCode(); + if (this.PspReference != null) + hashCode = hashCode * 59 + this.PspReference.GetHashCode(); + if (this.RefusalReason != null) + hashCode = hashCode * 59 + this.RefusalReason.GetHashCode(); + if (this.RemainingAmount != null) + hashCode = hashCode * 59 + this.RemainingAmount.GetHashCode(); + if (this.ResultCode != null) + hashCode = hashCode * 59 + this.ResultCode.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutOrder.cs b/Adyen/Model/Checkout/CheckoutOrder.cs index 4a2270a38..633741d99 100644 --- a/Adyen/Model/Checkout/CheckoutOrder.cs +++ b/Adyen/Model/Checkout/CheckoutOrder.cs @@ -1,38 +1,34 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.IO; using System.Runtime.Serialization; +using System.Text; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; namespace Adyen.Model.Checkout { @@ -45,8 +41,8 @@ public partial class CheckoutOrder : IEquatable, IValidatableObje /// /// Initializes a new instance of the class. /// - /// The encrypted order data (required). - /// The pspReference that belongs to the order (required). + /// The encrypted order data. (required). + /// The `pspReference` that belongs to the order. (required). public CheckoutOrder(string orderData = default(string), string pspReference = default(string)) { // to ensure "orderData" is required (not null) @@ -61,7 +57,8 @@ public partial class CheckoutOrder : IEquatable, IValidatableObje // to ensure "pspReference" is required (not null) if (pspReference == null) { - throw new InvalidDataException("pspReference is a required property for CheckoutOrder and cannot be null"); + throw new InvalidDataException( + "pspReference is a required property for CheckoutOrder and cannot be null"); } else { @@ -70,16 +67,16 @@ public partial class CheckoutOrder : IEquatable, IValidatableObje } /// - /// The encrypted order data + /// The encrypted order data. /// - /// The encrypted order data + /// The encrypted order data. [DataMember(Name = "orderData", EmitDefaultValue = false)] public string OrderData { get; set; } /// - /// The pspReference that belongs to the order + /// The `pspReference` that belongs to the order. /// - /// The pspReference that belongs to the order + /// The `pspReference` that belongs to the order. [DataMember(Name = "pspReference", EmitDefaultValue = false)] public string PspReference { get; set; } @@ -129,13 +126,13 @@ public bool Equals(CheckoutOrder input) return ( this.OrderData == input.OrderData || - (this.OrderData != null && - this.OrderData.Equals(input.OrderData)) + this.OrderData != null && + this.OrderData.Equals(input.OrderData) ) && ( this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) + this.PspReference != null && + this.PspReference.Equals(input.PspReference) ); } @@ -161,9 +158,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutOrderResponse.cs b/Adyen/Model/Checkout/CheckoutOrderResponse.cs new file mode 100644 index 000000000..00edc295e --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutOrderResponse.cs @@ -0,0 +1,211 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutOrderResponse + /// + [DataContract] + public partial class CheckoutOrderResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The expiry date for the order.. + /// The encrypted order data.. + /// The `pspReference` that belongs to the order. (required). + /// The merchant reference for the order.. + /// remainingAmount. + public CheckoutOrderResponse(string expiresAt = default(string), string orderData = default(string), + string pspReference = default(string), string reference = default(string), + Amount remainingAmount = default(Amount)) + { + // to ensure "pspReference" is required (not null) + if (pspReference == null) + { + throw new InvalidDataException( + "pspReference is a required property for CheckoutOrderResponse and cannot be null"); + } + else + { + this.PspReference = pspReference; + } + this.ExpiresAt = expiresAt; + this.OrderData = orderData; + this.Reference = reference; + this.RemainingAmount = remainingAmount; + } + + /// + /// The expiry date for the order. + /// + /// The expiry date for the order. + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } + + /// + /// The encrypted order data. + /// + /// The encrypted order data. + [DataMember(Name = "orderData", EmitDefaultValue = false)] + public string OrderData { get; set; } + + /// + /// The `pspReference` that belongs to the order. + /// + /// The `pspReference` that belongs to the order. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } + + /// + /// The merchant reference for the order. + /// + /// The merchant reference for the order. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } + + /// + /// Gets or Sets RemainingAmount + /// + [DataMember(Name = "remainingAmount", EmitDefaultValue = false)] + public Amount RemainingAmount { 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 CheckoutOrderResponse {\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" OrderData: ").Append(OrderData).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" RemainingAmount: ").Append(RemainingAmount).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutOrderResponse); + } + + /// + /// Returns true if CheckoutOrderResponse instances are equal + /// + /// Instance of CheckoutOrderResponse to be compared + /// Boolean + public bool Equals(CheckoutOrderResponse input) + { + if (input == null) + return false; + + return + ( + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) + ) && + ( + this.OrderData == input.OrderData || + this.OrderData != null && + this.OrderData.Equals(input.OrderData) + ) && + ( + this.PspReference == input.PspReference || + this.PspReference != null && + this.PspReference.Equals(input.PspReference) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.RemainingAmount == input.RemainingAmount || + this.RemainingAmount != null && + this.RemainingAmount.Equals(input.RemainingAmount) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); + if (this.OrderData != null) + hashCode = hashCode * 59 + this.OrderData.GetHashCode(); + if (this.PspReference != null) + hashCode = hashCode * 59 + this.PspReference.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.RemainingAmount != null) + hashCode = hashCode * 59 + this.RemainingAmount.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutUtilityRequest.cs b/Adyen/Model/Checkout/CheckoutUtilityRequest.cs new file mode 100644 index 000000000..b3173eb51 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutUtilityRequest.cs @@ -0,0 +1,143 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutUtilityRequest + /// + [DataContract] + public partial class CheckoutUtilityRequest : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The list of origin domains, for which origin keys are requested. (required). + public CheckoutUtilityRequest(List originDomains = default(List)) + { + // to ensure "originDomains" is required (not null) + if (originDomains == null) + { + throw new InvalidDataException( + "originDomains is a required property for CheckoutUtilityRequest and cannot be null"); + } + else + { + this.OriginDomains = originDomains; + } + } + + /// + /// The list of origin domains, for which origin keys are requested. + /// + /// The list of origin domains, for which origin keys are requested. + [DataMember(Name = "originDomains", EmitDefaultValue = false)] + public List OriginDomains { 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 CheckoutUtilityRequest {\n"); + sb.Append(" OriginDomains: ").Append(OriginDomains.ToListString()).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutUtilityRequest); + } + + /// + /// Returns true if CheckoutUtilityRequest instances are equal + /// + /// Instance of CheckoutUtilityRequest to be compared + /// Boolean + public bool Equals(CheckoutUtilityRequest input) + { + if (input == null) + return false; + + return + this.OriginDomains == input.OriginDomains || + this.OriginDomains != null && + input.OriginDomains != null && + this.OriginDomains.SequenceEqual(input.OriginDomains); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OriginDomains != null) + hashCode = hashCode * 59 + this.OriginDomains.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutUtilityResponse.cs b/Adyen/Model/Checkout/CheckoutUtilityResponse.cs new file mode 100644 index 000000000..96e90ca91 --- /dev/null +++ b/Adyen/Model/Checkout/CheckoutUtilityResponse.cs @@ -0,0 +1,133 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// CheckoutUtilityResponse + /// + [DataContract] + public partial class CheckoutUtilityResponse : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key.. + public CheckoutUtilityResponse(Dictionary originKeys = default(Dictionary)) + { + this.OriginKeys = originKeys; + } + + /// + /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. + /// + /// The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. + [DataMember(Name = "originKeys", EmitDefaultValue = false)] + public Dictionary OriginKeys { 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 CheckoutUtilityResponse {\n"); + sb.Append(" OriginKeys: ").Append(OriginKeys.ToCollectionsString()).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CheckoutUtilityResponse); + } + + /// + /// Returns true if CheckoutUtilityResponse instances are equal + /// + /// Instance of CheckoutUtilityResponse to be compared + /// Boolean + public bool Equals(CheckoutUtilityResponse input) + { + if (input == null) + return false; + + return + this.OriginKeys == input.OriginKeys || + this.OriginKeys != null && + input.OriginKeys != null && + this.OriginKeys.SequenceEqual(input.OriginKeys); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.OriginKeys != null) + hashCode = hashCode * 59 + this.OriginKeys.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Company.cs b/Adyen/Model/Checkout/Company.cs index d82c003e1..c59457d00 100644 --- a/Adyen/Model/Checkout/Company.cs +++ b/Adyen/Model/Checkout/Company.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,67 +35,69 @@ namespace Adyen.Model.Checkout /// Company /// [DataContract] - public partial class Company : IEquatable, IValidatableObject + public partial class Company : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The company website's home page.. - /// The company name.. - /// Registration number of the company.. - /// Registry location of the company.. - /// Tax ID of the company.. - /// The company type.. - public Company(string Homepage = default(string), string Name = default(string), string RegistrationNumber = default(string), string RegistryLocation = default(string), string TaxId = default(string), string Type = default(string)) + /// The company website's home page.. + /// The company name.. + /// Registration number of the company.. + /// Registry location of the company.. + /// Tax ID of the company.. + /// The company type.. + public Company(string homepage = default(string), string name = default(string), + string registrationNumber = default(string), string registryLocation = default(string), + string taxId = default(string), string type = default(string)) { - this.Homepage = Homepage; - this.Name = Name; - this.RegistrationNumber = RegistrationNumber; - this.RegistryLocation = RegistryLocation; - this.TaxId = TaxId; - this.Type = Type; + this.Homepage = homepage; + this.Name = name; + this.RegistrationNumber = registrationNumber; + this.RegistryLocation = registryLocation; + this.TaxId = taxId; + this.Type = type; } - + /// - /// The company website's home page. + /// The company website's home page. /// - /// The company website's home page. - [DataMember(Name="homepage", EmitDefaultValue=false)] + /// The company website's home page. + [DataMember(Name = "homepage", EmitDefaultValue = false)] public string Homepage { get; set; } /// /// The company name. /// /// The company name. - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name = "name", EmitDefaultValue = false)] public string Name { get; set; } /// /// Registration number of the company. /// /// Registration number of the company. - [DataMember(Name="registrationNumber", EmitDefaultValue=false)] + [DataMember(Name = "registrationNumber", EmitDefaultValue = false)] public string RegistrationNumber { get; set; } /// /// Registry location of the company. /// /// Registry location of the company. - [DataMember(Name="registryLocation", EmitDefaultValue=false)] + [DataMember(Name = "registryLocation", EmitDefaultValue = false)] public string RegistryLocation { get; set; } /// /// Tax ID of the company. /// /// Tax ID of the company. - [DataMember(Name="taxId", EmitDefaultValue=false)] + [DataMember(Name = "taxId", EmitDefaultValue = false)] public string TaxId { get; set; } /// /// The company type. /// /// The company type. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } /// @@ -114,12 +117,12 @@ public override string ToString() 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); } @@ -144,36 +147,36 @@ public bool Equals(Company input) if (input == null) return false; - return + return ( this.Homepage == input.Homepage || - (this.Homepage != null && - this.Homepage.Equals(input.Homepage)) - ) && + this.Homepage != null && + this.Homepage.Equals(input.Homepage) + ) && ( this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && + this.Name != null && + this.Name.Equals(input.Name) + ) && ( this.RegistrationNumber == input.RegistrationNumber || - (this.RegistrationNumber != null && - this.RegistrationNumber.Equals(input.RegistrationNumber)) - ) && + this.RegistrationNumber != null && + this.RegistrationNumber.Equals(input.RegistrationNumber) + ) && ( this.RegistryLocation == input.RegistryLocation || - (this.RegistryLocation != null && - this.RegistryLocation.Equals(input.RegistryLocation)) - ) && + this.RegistryLocation != null && + this.RegistryLocation.Equals(input.RegistryLocation) + ) && ( this.TaxId == input.TaxId || - (this.TaxId != null && - this.TaxId.Equals(input.TaxId)) - ) && + this.TaxId != null && + this.TaxId.Equals(input.TaxId) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.Type != null && + this.Type.Equals(input.Type) ); } @@ -207,10 +210,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Configuration.cs b/Adyen/Model/Checkout/Configuration.cs index e1c5083ad..020ed540f 100644 --- a/Adyen/Model/Checkout/Configuration.cs +++ b/Adyen/Model/Checkout/Configuration.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,7 +36,7 @@ namespace Adyen.Model.Checkout /// Configuration /// [DataContract] - public partial class Configuration : IEquatable, IValidatableObject + public partial class Configuration : IEquatable, IValidatableObject { /// /// Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED @@ -44,67 +45,62 @@ public partial class Configuration : IEquatable, IValidatableObj [JsonConverter(typeof(StringEnumConverter))] public enum CardHolderNameEnum { - /// /// Enum NONE for value: NONE /// - [EnumMember(Value = "NONE")] - NONE = 1, - + [EnumMember(Value = "NONE")] NONE = 1, + /// /// Enum OPTIONAL for value: OPTIONAL /// - [EnumMember(Value = "OPTIONAL")] - OPTIONAL = 2, - + [EnumMember(Value = "OPTIONAL")] OPTIONAL = 2, + /// /// Enum REQUIRED for value: REQUIRED /// - [EnumMember(Value = "REQUIRED")] - REQUIRED = 3 + [EnumMember(Value = "REQUIRED")] REQUIRED = 3 } /// /// Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED /// /// Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED - [DataMember(Name="cardHolderName", EmitDefaultValue=false)] + [DataMember(Name = "cardHolderName", EmitDefaultValue = false)] public CardHolderNameEnum? CardHolderName { get; set; } + /// /// Initializes a new instance of the class. /// - /// Describes the configuration for AVS ([Address Verification System](https://en.wikipedia.org/wiki/Address_Verification_System)).. - /// Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED. - /// Describes the configuration for [installment payments](https://docs.adyen.com/developers/payment-methods/installment-payments).. - /// Determines how to display the details fields.. - public Configuration(Avs Avs = default(Avs), CardHolderNameEnum? CardHolderName = default(CardHolderNameEnum?), Installments Installments = default(Installments), ShopperInput ShopperInput = default(ShopperInput)) + /// avs. + /// Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED. + /// installments. + /// shopperInput. + public Configuration(Avs avs = default(Avs), CardHolderNameEnum? cardHolderName = default(CardHolderNameEnum?), + Installments2 installments = default(Installments2), ShopperInput shopperInput = default(ShopperInput)) { - this.Avs = Avs; - this.CardHolderName = CardHolderName; - this.Installments = Installments; - this.ShopperInput = ShopperInput; + this.Avs = avs; + this.CardHolderName = cardHolderName; + this.Installments = installments; + this.ShopperInput = shopperInput; } - + /// - /// Describes the configuration for AVS ([Address Verification System](https://en.wikipedia.org/wiki/Address_Verification_System)). + /// Gets or Sets Avs /// - /// Describes the configuration for AVS ([Address Verification System](https://en.wikipedia.org/wiki/Address_Verification_System)). - [DataMember(Name="avs", EmitDefaultValue=false)] + [DataMember(Name = "avs", EmitDefaultValue = false)] public Avs Avs { get; set; } /// - /// Describes the configuration for [installment payments](https://docs.adyen.com/developers/payment-methods/installment-payments). + /// Gets or Sets Installments /// - /// Describes the configuration for [installment payments](https://docs.adyen.com/developers/payment-methods/installment-payments). - [DataMember(Name="installments", EmitDefaultValue=false)] - public Installments Installments { get; set; } + [DataMember(Name = "installments", EmitDefaultValue = false)] + public Installments2 Installments { get; set; } /// - /// Determines how to display the details fields. + /// Gets or Sets ShopperInput /// - /// Determines how to display the details fields. - [DataMember(Name="shopperInput", EmitDefaultValue=false)] + [DataMember(Name = "shopperInput", EmitDefaultValue = false)] public ShopperInput ShopperInput { get; set; } /// @@ -122,12 +118,12 @@ public override string ToString() 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); } @@ -152,26 +148,26 @@ public bool Equals(Configuration input) if (input == null) return false; - return + return ( this.Avs == input.Avs || - (this.Avs != null && - this.Avs.Equals(input.Avs)) - ) && + this.Avs != null && + this.Avs.Equals(input.Avs) + ) && ( this.CardHolderName == input.CardHolderName || - (this.CardHolderName != null && - this.CardHolderName.Equals(input.CardHolderName)) - ) && + this.CardHolderName != null && + this.CardHolderName.Equals(input.CardHolderName) + ) && ( this.Installments == input.Installments || - (this.Installments != null && - this.Installments.Equals(input.Installments)) - ) && + this.Installments != null && + this.Installments.Equals(input.Installments) + ) && ( this.ShopperInput == input.ShopperInput || - (this.ShopperInput != null && - this.ShopperInput.Equals(input.ShopperInput)) + this.ShopperInput != null && + this.ShopperInput.Equals(input.ShopperInput) ); } @@ -201,10 +197,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CreatePaymentLinkRequest.cs b/Adyen/Model/Checkout/CreatePaymentLinkRequest.cs index 1e50f0458..4e48d1f42 100644 --- a/Adyen/Model/Checkout/CreatePaymentLinkRequest.cs +++ b/Adyen/Model/Checkout/CreatePaymentLinkRequest.cs @@ -1,198 +1,645 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Text; + +using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.IO; +using System.Linq; using System.Runtime.Serialization; +using System.Text; +using Adyen.Model.ApplicationInformation; +using Adyen.Util; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { - /// - /// + /// CreatePaymentLinkRequest /// [DataContract] - public class CreatePaymentLinkRequest + public partial class CreatePaymentLinkRequest : IEquatable, IValidatableObject { /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] + public enum RecurringProcessingModelEnum + { + /// + /// Enum CardOnFile for value: CardOnFile + /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, + + /// + /// Enum Subscription for value: Subscription + /// + [EnumMember(Value = "Subscription")] Subscription = 2, + + /// + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile + /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// The shopper's two-letter country code.. + /// The date and time the purchased goods should be delivered.. + /// deliveryAddress. + /// A short description visible on the payment page. Maximum length: 280 characters.. + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created.. + /// The installment options available per payment method.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip.. + /// The merchant account identifier for which the payment link is created. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. When exceeding, the \"178\" error occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Whatever value is present under that key is going to be replaced by the real link id. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. + /// riskData. + /// The shopper's email address.. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization).. + /// shopperName. + /// A unique identifier for the shopper (for example, user ID or account ID).. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information).. + /// The physical store, for which this payment is processed.. + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored.. + public CreatePaymentLinkRequest(List allowedPaymentMethods = default(List), + Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), + Address billingAddress = default(Address), List blockedPaymentMethods = default(List), + string countryCode = default(string), DateTime? deliverAt = default(DateTime?), + Address deliveryAddress = default(Address), string description = default(string), + string expiresAt = default(string), + Dictionary installmentOptions = default(Dictionary), + List lineItems = default(List), string merchantAccount = default(string), + string merchantOrderReference = default(string), + Dictionary metadata = default(Dictionary), + RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), + string reference = default(string), string returnUrl = default(string), bool? reusable = default(bool?), + RiskData riskData = default(RiskData), string shopperEmail = default(string), + string shopperLocale = default(string), Name shopperName = default(Name), + string shopperReference = default(string), List splits = default(List), + string store = default(string), bool? storePaymentMethod = default(bool?)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException( + "amount is a required property for CreatePaymentLinkRequest and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException( + "merchantAccount is a required property for CreatePaymentLinkRequest and cannot be null"); + } + else + { + this.MerchantAccount = merchantAccount; + } + // to ensure "reference" is required (not null) + if (reference == null) + { + throw new InvalidDataException( + "reference is a required property for CreatePaymentLinkRequest and cannot be null"); + } + else + { + this.Reference = reference; + } + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CountryCode = countryCode; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.Description = description; + this.ExpiresAt = expiresAt; + this.InstallmentOptions = installmentOptions; + this.LineItems = lineItems; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.RecurringProcessingModel = recurringProcessingModel; + this.ReturnUrl = returnUrl; + this.Reusable = reusable; + this.RiskData = riskData; + this.ShopperEmail = shopperEmail; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.Splits = splits; + this.Store = store; + this.StorePaymentMethod = storePaymentMethod; + } + + /// + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "allowedPaymentMethods")] public List AllowedPaymentMethods { get; set; } /// /// Gets or Sets Amount /// [DataMember(Name = "amount", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } + /// + /// Gets or Sets ApplicationInfo + /// + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } + /// /// Gets or Sets BillingAddress /// [DataMember(Name = "billingAddress", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "billingAddress")] public Address BillingAddress { get; set; } /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "blockedPaymentMethods")] public List BlockedPaymentMethods { get; set; } /// - /// The shopper's country code. + /// The shopper's two-letter country code. /// - /// The shopper's country code. + /// The shopper's two-letter country code. [DataMember(Name = "countryCode", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "countryCode")] public string CountryCode { get; set; } + /// + /// The date and time the purchased goods should be delivered. + /// + /// The date and time the purchased goods should be delivered. + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime? DeliverAt { get; set; } + /// /// Gets or Sets DeliveryAddress /// [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "deliveryAddress")] public Address DeliveryAddress { get; set; } /// - /// A short description visible on the Pay By Link page. Maximum length: 280 characters. + /// A short description visible on the payment page. Maximum length: 280 characters. /// - /// A short description visible on the Pay By Link page. Maximum length: 280 characters. + /// A short description visible on the payment page. Maximum length: 280 characters. [DataMember(Name = "description", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "description")] public string Description { get; set; } /// - /// The date that the Pay By Link expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created. /// - /// The date that the Pay By Link expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day. + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created. [DataMember(Name = "expiresAt", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "expiresAt")] public string ExpiresAt { get; set; } /// - /// The merchant account identifier, with which you want to process the transaction. + /// The installment options available per payment method. + /// + /// The installment options available per payment method. + [DataMember(Name = "installmentOptions", EmitDefaultValue = false)] + public Dictionary InstallmentOptions { get; set; } + + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip. /// - /// The merchant account identifier, with which you want to process the transaction. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } + + /// + /// The merchant account identifier for which the payment link is created. + /// + /// The merchant account identifier for which the payment link is created. [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "merchantAccount")] public string MerchantAccount { get; set; } /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } + + /// + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. When exceeding, the \"178\" error occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Whatever value is present under that key is going to be replaced by the real link id + /// + /// Metadata consists of entries, each of which includes a key and a value. Limitations: * Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\" * Maximum 20 characters per key. When exceeding, the \"178\" error occurs: \"Metadata key size exceeds limit\" * A key cannot have the name `checkout.linkId`. Whatever value is present under that key is going to be replaced by the real link id + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary Metadata { get; set; } + + + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// A reference that is used to uniquely identify the payment in future communications about the payment status. [DataMember(Name = "reference", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "reference")] public string Reference { get; set; } /// - /// Merchant URL used for redirection after payment is completed + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. /// - /// Merchant URL used for redirection after payment is completed + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. [DataMember(Name = "returnUrl", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "returnUrl")] public string ReturnUrl { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require the `shopperEmail` for both `deviceChannel` **browser** and **app**. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require the `shopperEmail` for both `deviceChannel` **browser** and **app**. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + [DataMember(Name = "reusable", EmitDefaultValue = false)] + public bool? Reusable { get; set; } + + /// + /// Gets or Sets RiskData + /// + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } + + /// + /// The shopper's email address. + /// + /// The shopper's email address. [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "shopperEmail")] public string ShopperEmail { get; set; } /// - /// The combination of a language code and a country code to specify the language to be used in the payment. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization). /// - /// The combination of a language code and a country code to specify the language to be used in the payment. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization). [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "shopperLocale")] public string ShopperLocale { get; set; } /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Gets or Sets ShopperName /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } + + /// + /// A unique identifier for the shopper (for example, user ID or account ID). + /// + /// A unique identifier for the shopper (for example, user ID or account ID). [DataMember(Name = "shopperReference", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "shopperReference")] public string ShopperReference { get; set; } /// - /// When true and `shopperReference` is provided, the payment details will be stored. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). /// - /// When true and `shopperReference` is provided, the payment details will be stored. - [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "storePaymentMethod")] - public bool? StorePaymentMethod { get; set; } + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// The physical store, for which this payment is processed. /// - /// Store + /// The physical store, for which this payment is processed. [DataMember(Name = "store", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "store")] public string Store { get; set; } + + /// + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + /// + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } + /// - /// Get the string presentation of the object + /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { var sb = new StringBuilder(); sb.Append("class CreatePaymentLinkRequest {\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods.ToListString()).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); + sb.Append(" DeliverAt: ").Append(DeliverAt).Append("\n"); sb.Append(" DeliveryAddress: ").Append(DeliveryAddress).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" InstallmentOptions: ").Append(InstallmentOptions.ToCollectionsString()).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems.ObjectListToString()).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata.ToCollectionsString()).Append("\n"); + sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); + sb.Append(" Reusable: ").Append(Reusable).Append("\n"); + sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperLocale: ").Append(ShopperLocale).Append("\n"); + sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); - sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); + sb.Append(" Splits: ").Append(Splits.ObjectListToString()).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Get the JSON string presentation of the object + /// 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); } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CreatePaymentLinkRequest); + } + + /// + /// Returns true if CreatePaymentLinkRequest instances are equal + /// + /// Instance of CreatePaymentLinkRequest to be compared + /// Boolean + public bool Equals(CreatePaymentLinkRequest input) + { + if (input == null) + return false; + + return + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo) + ) && + ( + this.BillingAddress == input.BillingAddress || + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CountryCode == input.CountryCode || + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) + ) && + ( + this.DeliverAt == input.DeliverAt || + this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) + ) && + ( + this.Description == input.Description || + this.Description != null && + this.Description.Equals(input.Description) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) + ) && + ( + this.InstallmentOptions == input.InstallmentOptions || + this.InstallmentOptions != null && + input.InstallmentOptions != null && + this.InstallmentOptions.SequenceEqual(input.InstallmentOptions) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference) + ) && + ( + this.Metadata == input.Metadata || + this.Metadata != null && + input.Metadata != null && + this.Metadata.SequenceEqual(input.Metadata) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel != null && + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl) + ) && + ( + this.Reusable == input.Reusable || + this.Reusable != null && + this.Reusable.Equals(input.Reusable) + ) && + ( + this.RiskData == input.RiskData || + this.RiskData != null && + this.RiskData.Equals(input.RiskData) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) + ) && + ( + this.ShopperName == input.ShopperName || + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) + ) && + ( + this.ShopperReference == input.ShopperReference || + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Store == input.Store || + this.Store != null && + this.Store.Equals(input.Store) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod != null && + this.StorePaymentMethod.Equals(input.StorePaymentMethod) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AllowedPaymentMethods != null) + hashCode = hashCode * 59 + this.AllowedPaymentMethods.GetHashCode(); + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.ApplicationInfo != null) + hashCode = hashCode * 59 + this.ApplicationInfo.GetHashCode(); + if (this.BillingAddress != null) + hashCode = hashCode * 59 + this.BillingAddress.GetHashCode(); + if (this.BlockedPaymentMethods != null) + hashCode = hashCode * 59 + this.BlockedPaymentMethods.GetHashCode(); + if (this.CountryCode != null) + hashCode = hashCode * 59 + this.CountryCode.GetHashCode(); + if (this.DeliverAt != null) + hashCode = hashCode * 59 + this.DeliverAt.GetHashCode(); + if (this.DeliveryAddress != null) + hashCode = hashCode * 59 + this.DeliveryAddress.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); + if (this.InstallmentOptions != null) + hashCode = hashCode * 59 + this.InstallmentOptions.GetHashCode(); + if (this.LineItems != null) + hashCode = hashCode * 59 + this.LineItems.GetHashCode(); + if (this.MerchantAccount != null) + hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.MerchantOrderReference != null) + hashCode = hashCode * 59 + this.MerchantOrderReference.GetHashCode(); + if (this.Metadata != null) + hashCode = hashCode * 59 + this.Metadata.GetHashCode(); + if (this.RecurringProcessingModel != null) + hashCode = hashCode * 59 + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.ReturnUrl != null) + hashCode = hashCode * 59 + this.ReturnUrl.GetHashCode(); + if (this.Reusable != null) + hashCode = hashCode * 59 + this.Reusable.GetHashCode(); + if (this.RiskData != null) + hashCode = hashCode * 59 + this.RiskData.GetHashCode(); + if (this.ShopperEmail != null) + hashCode = hashCode * 59 + this.ShopperEmail.GetHashCode(); + if (this.ShopperLocale != null) + hashCode = hashCode * 59 + this.ShopperLocale.GetHashCode(); + if (this.ShopperName != null) + hashCode = hashCode * 59 + this.ShopperName.GetHashCode(); + if (this.ShopperReference != null) + hashCode = hashCode * 59 + this.ShopperReference.GetHashCode(); + if (this.Splits != null) + hashCode = hashCode * 59 + this.Splits.GetHashCode(); + if (this.Store != null) + hashCode = hashCode * 59 + this.Store.GetHashCode(); + if (this.StorePaymentMethod != null) + hashCode = hashCode * 59 + this.StorePaymentMethod.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CreatePaymentLinkResponse.cs b/Adyen/Model/Checkout/CreatePaymentLinkResponse.cs deleted file mode 100644 index d110ebebc..000000000 --- a/Adyen/Model/Checkout/CreatePaymentLinkResponse.cs +++ /dev/null @@ -1,91 +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.Text; -using System.Runtime.Serialization; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - - /// - /// - /// - [DataContract] - public class CreatePaymentLinkResponse { - /// - /// Gets or Sets Amount - /// - [DataMember(Name="amount", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "amount")] - public Amount Amount { get; set; } - - /// - /// The date that the Pay By Link expires; e.g. 2019-03-23T12:25:28Z. - /// - /// The date that the Pay By Link expires; e.g. 2019-03-23T12:25:28Z. - [DataMember(Name="expiresAt", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "expiresAt")] - public string ExpiresAt { get; set; } - - /// - /// The reference that was specified when the Pay By Link URL was created. - /// - /// The reference that was specified when the Pay By Link URL was created. - [DataMember(Name="reference", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "reference")] - public string Reference { get; set; } - - /// - /// The URL at which the shopper can complete the payment. - /// - /// The URL at which the shopper can complete the payment. - [DataMember(Name="url", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "url")] - public string Url { 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 CreatePaymentLinkResponse {\n"); - sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); - sb.Append(" Reference: ").Append(Reference).Append("\n"); - sb.Append(" Url: ").Append(Url).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/DefaultPaymentMethodDetails.cs b/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs index b6b2ed475..6ba297296 100644 --- a/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/DefaultPaymentMethodDetails.cs @@ -26,6 +26,7 @@ using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using System.Text; +using Adyen.Model.Checkout.Details; using Newtonsoft.Json; namespace Adyen.Model.Checkout @@ -79,7 +80,7 @@ public class DefaultPaymentMethodDetails : IValidatableObject, IPaymentMethodDet public string SepaIbanNumber { get; set; } [DataMember(Name = "bankAccount", EmitDefaultValue = false)] public BankAccount BankAccount { get; set; } - [DataMember(Name = "additionalData.applepay.token", EmitDefaultValue = false)] + [DataMember(Name = "applepay.token", EmitDefaultValue = false)] public string ApplePayToken { get; set; } [DataMember(Name = "paywithgoogle.token", EmitDefaultValue = false)] public string GooglePayToken { get; set; } diff --git a/Adyen/Model/Checkout/AchDetails.cs b/Adyen/Model/Checkout/Details/AchDetails.cs similarity index 84% rename from Adyen/Model/Checkout/AchDetails.cs rename to Adyen/Model/Checkout/Details/AchDetails.cs index 81c04b296..9fef583d6 100644 --- a/Adyen/Model/Checkout/AchDetails.cs +++ b/Adyen/Model/Checkout/Details/AchDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// @@ -74,14 +74,27 @@ public class AchDetails : IPaymentMethodDetails [JsonProperty(PropertyName = "ownerName")] public string OwnerName { 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)] + public string RecurringDetailReference { 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)] + public string StoredPaymentMethodId { get; set; } + /// /// **ach** /// /// **ach** [DataMember(Name = "type", EmitDefaultValue = false)] [JsonProperty(PropertyName = "type")] - public string Type { get; set; } = Ach; - + public string Type { get; set; } = Ach; /// /// Get the string presentation of the object @@ -96,6 +109,8 @@ public override string ToString() sb.Append(" EncryptedBankAccountNumber: ").Append(EncryptedBankAccountNumber).Append("\n"); sb.Append(" EncryptedBankLocationId: ").Append(EncryptedBankLocationId).Append("\n"); sb.Append(" OwnerName: ").Append(OwnerName).Append("\n"); + sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); diff --git a/Adyen/Model/Checkout/AmazonPayDetails.cs b/Adyen/Model/Checkout/Details/AmazonPayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/AmazonPayDetails.cs rename to Adyen/Model/Checkout/Details/AmazonPayDetails.cs index fbdbbcb0c..c70309729 100644 --- a/Adyen/Model/Checkout/AmazonPayDetails.cs +++ b/Adyen/Model/Checkout/Details/AmazonPayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs b/Adyen/Model/Checkout/Details/AndroidPayDetails.cs similarity index 63% rename from Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs rename to Adyen/Model/Checkout/Details/AndroidPayDetails.cs index 804cbd0c6..5a468dd61 100644 --- a/Adyen/Model/Checkout/GenericIssuerPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/Details/AndroidPayDetails.cs @@ -1,4 +1,4 @@ -#region Licence +#region Licence // // ###### // ###### @@ -23,38 +23,40 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// /// /// [DataContract] - public class GenericIssuerPaymentMethodDetails : IPaymentMethodDetails + public class AndroidPayDetails : IPaymentMethodDetails { + //Possible types + public const string AndroidPay = "androidpay"; + /// - /// The issuer id of the shopper's selected bank. + /// Gets or Sets androidpayToken /// - /// The issuer id of the shopper's selected bank. - [DataMember(Name = "issuer", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "issuer")] - public string Issuer { get; set; } + [DataMember(Name = "androidpayToken", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "androidpayToken")] + public string AndroidPayToken { get; set; } /// - /// This is the recurringDetailReference returned in the response when you created the token. + /// Gets or Sets FundingSource /// - /// 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; } + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "fundingSource")] + public string FundingSource { get; set; } /// - /// **genericissuer** + /// **adroidPay** /// - /// **genericissuer** + /// **androidPay** [DataMember(Name = "type", EmitDefaultValue = false)] [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public string Type { get; set; } = AndroidPay; + /// @@ -64,9 +66,8 @@ public class GenericIssuerPaymentMethodDetails : IPaymentMethodDetails public override string ToString() { var sb = new StringBuilder(); - sb.Append("class GenericIssuerPaymentMethodDetails {\n"); - sb.Append(" Issuer: ").Append(Issuer).Append("\n"); - sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append("class AndroidPayDetails {\n"); + sb.Append(" AndroidPayToken: ").Append(AndroidPayToken).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); diff --git a/Adyen/Model/Checkout/ApplePayDetails.cs b/Adyen/Model/Checkout/Details/ApplePayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/ApplePayDetails.cs rename to Adyen/Model/Checkout/Details/ApplePayDetails.cs index 1292c523c..537229ea7 100644 --- a/Adyen/Model/Checkout/ApplePayDetails.cs +++ b/Adyen/Model/Checkout/Details/ApplePayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/BacsDirectDebitDetails.cs b/Adyen/Model/Checkout/Details/BacsDirectDebitDetails.cs new file mode 100644 index 000000000..b94cd2b68 --- /dev/null +++ b/Adyen/Model/Checkout/Details/BacsDirectDebitDetails.cs @@ -0,0 +1,69 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class BacsDirectDebitDetails : IPaymentMethodDetails + { + //Possible types + public const string Directdebit_GB = "directdebit_GB"; + + /// + /// **directdebit_GB** + /// + /// **directdebit_GB** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Directdebit_GB; + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BacsDirectDebitDetails {\n"); + sb.Append(" Type: ").Append(Type).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/BilldeskOnlineDetails.cs b/Adyen/Model/Checkout/Details/BilldeskOnlineDetails.cs similarity index 98% rename from Adyen/Model/Checkout/BilldeskOnlineDetails.cs rename to Adyen/Model/Checkout/Details/BilldeskOnlineDetails.cs index ceedb0c86..3e14b4a2f 100644 --- a/Adyen/Model/Checkout/BilldeskOnlineDetails.cs +++ b/Adyen/Model/Checkout/Details/BilldeskOnlineDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/BilldeskWalletDetails.cs b/Adyen/Model/Checkout/Details/BilldeskWalletDetails.cs similarity index 98% rename from Adyen/Model/Checkout/BilldeskWalletDetails.cs rename to Adyen/Model/Checkout/Details/BilldeskWalletDetails.cs index ef09bc27c..7a4e99bc9 100644 --- a/Adyen/Model/Checkout/BilldeskWalletDetails.cs +++ b/Adyen/Model/Checkout/Details/BilldeskWalletDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/BlikDetails.cs b/Adyen/Model/Checkout/Details/BlikDetails.cs similarity index 98% rename from Adyen/Model/Checkout/BlikDetails.cs rename to Adyen/Model/Checkout/Details/BlikDetails.cs index 1551bfdef..72a7ce9d9 100644 --- a/Adyen/Model/Checkout/BlikDetails.cs +++ b/Adyen/Model/Checkout/Details/BlikDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/CellulantDetails.cs b/Adyen/Model/Checkout/Details/CellulantDetails.cs new file mode 100644 index 000000000..a3c42abfc --- /dev/null +++ b/Adyen/Model/Checkout/Details/CellulantDetails.cs @@ -0,0 +1,77 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class CellulantDetails : IPaymentMethodDetails + { + //Possible types + public const string Cellulant = "cellulant"; + + /// + /// IssuerId. + /// + /// IssuerId + [DataMember(Name = "issuerId", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "issuerId")] + public string IssuerId { get; set; } + + /// + /// **cellulant** + /// + /// **cellulant** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Cellulant; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CellulantDetails {\n"); + sb.Append(" IssuerId: ").Append(IssuerId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/DokuDetails.cs b/Adyen/Model/Checkout/Details/DokuDetails.cs similarity index 99% rename from Adyen/Model/Checkout/DokuDetails.cs rename to Adyen/Model/Checkout/Details/DokuDetails.cs index 72be0a137..20ff26f9a 100644 --- a/Adyen/Model/Checkout/DokuDetails.cs +++ b/Adyen/Model/Checkout/Details/DokuDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// /// diff --git a/Adyen/Model/Checkout/DotpayDetails.cs b/Adyen/Model/Checkout/Details/DotpayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/DotpayDetails.cs rename to Adyen/Model/Checkout/Details/DotpayDetails.cs index 12baf64df..4019e2da9 100644 --- a/Adyen/Model/Checkout/DotpayDetails.cs +++ b/Adyen/Model/Checkout/Details/DotpayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/DragonpayDetails.cs b/Adyen/Model/Checkout/Details/DragonpayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/DragonpayDetails.cs rename to Adyen/Model/Checkout/Details/DragonpayDetails.cs index 77a5aa708..b551b760c 100644 --- a/Adyen/Model/Checkout/DragonpayDetails.cs +++ b/Adyen/Model/Checkout/Details/DragonpayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/EcontextVoucherDetails.cs b/Adyen/Model/Checkout/Details/EcontextVoucherDetails.cs similarity index 99% rename from Adyen/Model/Checkout/EcontextVoucherDetails.cs rename to Adyen/Model/Checkout/Details/EcontextVoucherDetails.cs index 2e92cb148..ab68ac5d1 100644 --- a/Adyen/Model/Checkout/EcontextVoucherDetails.cs +++ b/Adyen/Model/Checkout/Details/EcontextVoucherDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/EntercashDetails.cs b/Adyen/Model/Checkout/Details/EntercashDetails.cs similarity index 98% rename from Adyen/Model/Checkout/EntercashDetails.cs rename to Adyen/Model/Checkout/Details/EntercashDetails.cs index 039174c08..2ab5bff86 100644 --- a/Adyen/Model/Checkout/EntercashDetails.cs +++ b/Adyen/Model/Checkout/Details/EntercashDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/GiropayDetails.cs b/Adyen/Model/Checkout/Details/GiropayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/GiropayDetails.cs rename to Adyen/Model/Checkout/Details/GiropayDetails.cs index 4c508e341..9b7d228d7 100644 --- a/Adyen/Model/Checkout/GiropayDetails.cs +++ b/Adyen/Model/Checkout/Details/GiropayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/GooglePayDetails.cs b/Adyen/Model/Checkout/Details/GooglePayDetails.cs similarity index 99% rename from Adyen/Model/Checkout/GooglePayDetails.cs rename to Adyen/Model/Checkout/Details/GooglePayDetails.cs index 3da6e09ea..d6f4e6f29 100644 --- a/Adyen/Model/Checkout/GooglePayDetails.cs +++ b/Adyen/Model/Checkout/Details/GooglePayDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/IPaymentMethodDetails.cs b/Adyen/Model/Checkout/Details/IPaymentMethodDetails.cs similarity index 96% rename from Adyen/Model/Checkout/IPaymentMethodDetails.cs rename to Adyen/Model/Checkout/Details/IPaymentMethodDetails.cs index 7d44c4c86..8169dfe6b 100644 --- a/Adyen/Model/Checkout/IPaymentMethodDetails.cs +++ b/Adyen/Model/Checkout/Details/IPaymentMethodDetails.cs @@ -20,7 +20,7 @@ * See the LICENSE file for more info. */ #endregion -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { public interface IPaymentMethodDetails { diff --git a/Adyen/Model/Checkout/IdealDetails.cs b/Adyen/Model/Checkout/Details/IdealDetails.cs similarity index 98% rename from Adyen/Model/Checkout/IdealDetails.cs rename to Adyen/Model/Checkout/Details/IdealDetails.cs index cc89e9b54..d939f4384 100644 --- a/Adyen/Model/Checkout/IdealDetails.cs +++ b/Adyen/Model/Checkout/Details/IdealDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// /// diff --git a/Adyen/Model/Checkout/Details/KlarnaDetails.cs b/Adyen/Model/Checkout/Details/KlarnaDetails.cs new file mode 100644 index 000000000..8aa1e7f09 --- /dev/null +++ b/Adyen/Model/Checkout/Details/KlarnaDetails.cs @@ -0,0 +1,144 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class KlarnaDetails : IPaymentMethodDetails + { + //Possible types + public const string Klarna = "klarna"; + public const string KlarnaPayments = "klarnapayments"; + public const string KlarnaPaymentsAccount = "klarnapayments_account"; + public const string KlarnaPaymentsB2B = "klarnapayments_b2b"; + public const string KlarnaPayNow = "klarna_paynow"; + public const string KlarnaAccount = "klarna_account"; + public const string KlarnaB2B = "klarna_b2b"; + /// + /// The bank account number. + /// + /// The bank account number. + [DataMember(Name = "bankAccount", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "bankAccount")] + public string BankAccount { get; set; } + + /// + /// billingAddress + /// + /// billingAddress + [DataMember(Name = "billingAddress ", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "billingAddress ")] + public string BillingAddress { get; set; } + + /// + /// deliveryAddress + /// + /// deliveryAddress + [DataMember(Name = "deliveryAddress ", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "deliveryAddress ")] + public string DeliveryAddress { get; set; } + + /// + /// installmentConfigurationKey + /// + /// installmentConfigurationKey + [DataMember(Name = "installmentConfigurationKey ", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "installmentConfigurationKey ")] + public string InstallmentConfigurationKey { get; set; } + + /// + /// personalDetails. + /// + /// personalDetails + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "personalDetails")] + public string PersonalDetails { get; set; } + + /// + /// separateDeliveryAddress. + /// + /// separateDeliveryAddress + [DataMember(Name = "separateDeliveryAddress", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "separateDeliveryAddress")] + public string SeparateDeliveryAddress { get; set; } + + /// + /// storedPaymentMethodId. + /// + /// storedPaymentMethodId. + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + public string StoredPaymentMethodId { get; set; } + + /// + /// token. + /// + /// token. + [DataMember(Name = "token", EmitDefaultValue = false)] + public string Token { get; set; } + + /// + /// **KlarnaDetail** + /// + /// **KlarnaDetail** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { 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 KlarnaDetail {\n"); + sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); + sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); + sb.Append(" DeliveryAddress: ").Append(DeliveryAddress).Append("\n"); + sb.Append(" InstallmentConfigurationKey: ").Append(InstallmentConfigurationKey).Append("\n"); + sb.Append(" PersonalDetails: ").Append(PersonalDetails).Append("\n"); + sb.Append(" SeparateDeliveryAddress: ").Append(SeparateDeliveryAddress).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" Token: ").Append(Token).Append("\n"); + sb.Append(" Type: ").Append(Type).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/LianLianPayDetails.cs b/Adyen/Model/Checkout/Details/LianLianPayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/LianLianPayDetails.cs rename to Adyen/Model/Checkout/Details/LianLianPayDetails.cs index ade63fe4d..ac1a6cf92 100644 --- a/Adyen/Model/Checkout/LianLianPayDetails.cs +++ b/Adyen/Model/Checkout/Details/LianLianPayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/MasterpassDetails.cs b/Adyen/Model/Checkout/Details/MasterpassDetails.cs new file mode 100644 index 000000000..278736374 --- /dev/null +++ b/Adyen/Model/Checkout/Details/MasterpassDetails.cs @@ -0,0 +1,103 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class MasterpassDetails : IPaymentMethodDetails + { + //Possible types + public const string Masterpass = "masterpass"; + + /// + /// Defines FundingSource + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FundingSourceEnum + { + /// + /// Enum Credit for value: credit + /// + [EnumMember(Value = "credit")] + Credit = 1, + /// + /// Enum Debit for value: debit + /// + [EnumMember(Value = "debit")] + Debit = 2 + } + /// + /// Gets or Sets masterpassTransactionId + /// + [DataMember(Name = "masterpassTransactionId ", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "masterpassTransactionId ")] + public string MasterpassTransactionId { get; set; } + + /// + /// Gets or Sets fundingSource + /// + [DataMember(Name = "fundingSource ", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "fundingSource ")] + public FundingSourceEnum FundingSource { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Masterpass; + + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MasterpassDetails {\n"); + sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); + sb.Append(" MasterpassTransactionId: ").Append(MasterpassTransactionId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/MbwayDetails.cs b/Adyen/Model/Checkout/Details/MbwayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/MbwayDetails.cs rename to Adyen/Model/Checkout/Details/MbwayDetails.cs index 081d412ed..d2968d602 100644 --- a/Adyen/Model/Checkout/MbwayDetails.cs +++ b/Adyen/Model/Checkout/Details/MbwayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/MobilePayDetails.cs b/Adyen/Model/Checkout/Details/MobilePayDetails.cs new file mode 100644 index 000000000..db679a556 --- /dev/null +++ b/Adyen/Model/Checkout/Details/MobilePayDetails.cs @@ -0,0 +1,69 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// MobilePayDetails + /// + [DataContract] + public class MobilePayDetails : IPaymentMethodDetails + { + //Possible types + public const string Mobilepay = "mobilepay"; + + /// + /// **mobilepay** + /// + /// **mobilepay** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Mobilepay; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class MobilePayDetails {\n"); + sb.Append(" Type: ").Append(Type).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/MolPayDetails.cs b/Adyen/Model/Checkout/Details/MolPayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/MolPayDetails.cs rename to Adyen/Model/Checkout/Details/MolPayDetails.cs index c7a041ae7..4a1b52950 100644 --- a/Adyen/Model/Checkout/MolPayDetails.cs +++ b/Adyen/Model/Checkout/Details/MolPayDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/PayPalDetails.cs b/Adyen/Model/Checkout/Details/PayPalDetails.cs similarity index 98% rename from Adyen/Model/Checkout/PayPalDetails.cs rename to Adyen/Model/Checkout/Details/PayPalDetails.cs index 076118170..55f5c8bfe 100644 --- a/Adyen/Model/Checkout/PayPalDetails.cs +++ b/Adyen/Model/Checkout/Details/PayPalDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// /// diff --git a/Adyen/Model/Checkout/Details/PayUUpiDetails.cs b/Adyen/Model/Checkout/Details/PayUUpiDetails.cs new file mode 100644 index 000000000..1e8105c1d --- /dev/null +++ b/Adyen/Model/Checkout/Details/PayUUpiDetails.cs @@ -0,0 +1,105 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class PayUUpiDetails : IPaymentMethodDetails + { + //Possible types + public const string PayUinUPI = "payu_IN_upi"; + /// + /// shopperNotificationReference + /// + /// shopperNotificationReference + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "shopperNotificationReference")] + public string ShopperNotificationReference { get; set; } + + /// + ///storedPaymentMethodId + /// + /// storedPaymentMethodId + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "storedPaymentMethodId")] + public string StoredPaymentMethodId { get; set; } + + /// + /// subscriptionDetails + /// + /// subscriptionDetails + [DataMember(Name = "subscriptionDetails", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "subscriptionDetails")] + public string SubscriptionDetails { get; set; } + + /// + /// virtualPaymentAddress + /// + /// virtualPaymentAddress + [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "virtualPaymentAddress")] + public string VirtualPaymentAddress { get; set; } + + + /// + /// **PayUinUPI** + /// + /// **PayUinUPI** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = PayUinUPI; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PayUUpiDetails {\n"); + sb.Append(" ShopperNotificationReference: ").Append(ShopperNotificationReference).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" SubscriptionDetails: ").Append(SubscriptionDetails).Append("\n"); + sb.Append(" VirtualPaymentAddress: ").Append(VirtualPaymentAddress).Append("\n"); + sb.Append(" Type: ").Append(Type).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/QiwiWalletDetails.cs b/Adyen/Model/Checkout/Details/QiwiWalletDetails.cs similarity index 98% rename from Adyen/Model/Checkout/QiwiWalletDetails.cs rename to Adyen/Model/Checkout/Details/QiwiWalletDetails.cs index 7adc73e04..5adc7d59f 100644 --- a/Adyen/Model/Checkout/QiwiWalletDetails.cs +++ b/Adyen/Model/Checkout/Details/QiwiWalletDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/SamsungPayDetails.cs b/Adyen/Model/Checkout/Details/SamsungPayDetails.cs similarity index 98% rename from Adyen/Model/Checkout/SamsungPayDetails.cs rename to Adyen/Model/Checkout/Details/SamsungPayDetails.cs index 1111d889a..bcd24ab72 100644 --- a/Adyen/Model/Checkout/SamsungPayDetails.cs +++ b/Adyen/Model/Checkout/Details/SamsungPayDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs b/Adyen/Model/Checkout/Details/SepaDirectDebitDetails.cs similarity index 98% rename from Adyen/Model/Checkout/SepaDirectDebitDetails.cs rename to Adyen/Model/Checkout/Details/SepaDirectDebitDetails.cs index c94d0d856..6a9a2d666 100644 --- a/Adyen/Model/Checkout/SepaDirectDebitDetails.cs +++ b/Adyen/Model/Checkout/Details/SepaDirectDebitDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/UpiDetails.cs b/Adyen/Model/Checkout/Details/UpiDetails.cs new file mode 100644 index 000000000..d90652d99 --- /dev/null +++ b/Adyen/Model/Checkout/Details/UpiDetails.cs @@ -0,0 +1,105 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class UpiDetails : IPaymentMethodDetails + { + //Possible types + public const string Upi = "upi"; + /// + /// shopperNotificationReference + /// + /// shopperNotificationReference + [DataMember(Name = "shopperNotificationReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "shopperNotificationReference")] + public string ShopperNotificationReference { get; set; } + + /// + ///storedPaymentMethodId + /// + /// storedPaymentMethodId + [DataMember(Name = "storedPaymentMethodId", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "storedPaymentMethodId")] + public string StoredPaymentMethodId { get; set; } + + /// + /// subscriptionDetails + /// + /// subscriptionDetails + [DataMember(Name = "subscriptionDetails", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "subscriptionDetails")] + public string SubscriptionDetails { get; set; } + + /// + /// virtualPaymentAddress + /// + /// virtualPaymentAddress + [DataMember(Name = "virtualPaymentAddress", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "virtualPaymentAddress")] + public string VirtualPaymentAddress { get; set; } + + + /// + /// **UPIpay** + /// + /// **UPIpay** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Upi; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class UpiDetails {\n"); + sb.Append(" ShopperNotificationReference: ").Append(ShopperNotificationReference).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" SubscriptionDetails: ").Append(SubscriptionDetails).Append("\n"); + sb.Append(" VirtualPaymentAddress: ").Append(VirtualPaymentAddress).Append("\n"); + sb.Append(" Type: ").Append(Type).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/VippsDetails.cs b/Adyen/Model/Checkout/Details/VippsDetails.cs similarity index 98% rename from Adyen/Model/Checkout/VippsDetails.cs rename to Adyen/Model/Checkout/Details/VippsDetails.cs index b4b7f6a19..ac990af1a 100644 --- a/Adyen/Model/Checkout/VippsDetails.cs +++ b/Adyen/Model/Checkout/Details/VippsDetails.cs @@ -23,7 +23,7 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/VisaCheckoutDetails.cs b/Adyen/Model/Checkout/Details/VisaCheckoutDetails.cs similarity index 98% rename from Adyen/Model/Checkout/VisaCheckoutDetails.cs rename to Adyen/Model/Checkout/Details/VisaCheckoutDetails.cs index 68f4b5a1c..6eb35eac4 100644 --- a/Adyen/Model/Checkout/VisaCheckoutDetails.cs +++ b/Adyen/Model/Checkout/Details/VisaCheckoutDetails.cs @@ -24,7 +24,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Details { /// diff --git a/Adyen/Model/Checkout/Details/WeChatPayDetails.cs b/Adyen/Model/Checkout/Details/WeChatPayDetails.cs new file mode 100644 index 000000000..9e0c6778e --- /dev/null +++ b/Adyen/Model/Checkout/Details/WeChatPayDetails.cs @@ -0,0 +1,87 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class WeChatPayDetails : IPaymentMethodDetails + { + //Possible types + public const string Wechatpay = "wechatpay"; + + /// + /// appId + /// + /// appId + [DataMember(Name = "appId", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "appId")] + public string AppId { get; set; } + + /// + /// openid + /// + /// openid + [DataMember(Name = "openid", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "openid")] + public string Openid { get; set; } + + + /// + /// **Wechatpay** + /// + /// **Wechatpay** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = Wechatpay; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class WeChatPayDetails {\n"); + sb.Append(" Openid: ").Append(Openid).Append("\n"); + sb.Append(" AppId: ").Append(AppId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/Details/WeChatPayMiniProgramDetails.cs b/Adyen/Model/Checkout/Details/WeChatPayMiniProgramDetails.cs new file mode 100644 index 000000000..5ac4feb36 --- /dev/null +++ b/Adyen/Model/Checkout/Details/WeChatPayMiniProgramDetails.cs @@ -0,0 +1,87 @@ +#region Licence +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout.Details +{ + + /// + /// + /// + [DataContract] + public class WeChatPayMiniProgramDetails : IPaymentMethodDetails + { + //Possible types + public const string WechatpayMiniProgram = "wechatpayMiniProgram"; + + /// + /// appId + /// + /// appId + [DataMember(Name = "appId", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "appId")] + public string AppId { get; set; } + + /// + /// openid + /// + /// openid + [DataMember(Name = "openid", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "openid")] + public string Openid { get; set; } + + + /// + /// **WechatpayMiniProgram** + /// + /// **WechatpayMiniProgram** + [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } = WechatpayMiniProgram; + + /// + /// Get the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class WeChatPayMiniProgramDetails {\n"); + sb.Append(" Openid: ").Append(Openid).Append("\n"); + sb.Append(" AppId: ").Append(AppId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/DeviceRenderOptions.cs b/Adyen/Model/Checkout/DeviceRenderOptions.cs index 4871caf8e..6b77d0e1f 100644 --- a/Adyen/Model/Checkout/DeviceRenderOptions.cs +++ b/Adyen/Model/Checkout/DeviceRenderOptions.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,6 +28,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -36,97 +38,96 @@ namespace Adyen.Model.Checkout /// DeviceRenderOptions /// [DataContract] - public partial class DeviceRenderOptions : IEquatable, IValidatableObject + public partial class DeviceRenderOptions : IEquatable, IValidatableObject { /// - /// Supported SDK interface types. + /// Supported SDK interface types. Allowed values: * native * html * both /// - /// Supported SDK interface types. + /// Supported SDK interface types. Allowed values: * native * html * both [JsonConverter(typeof(StringEnumConverter))] public enum SdkInterfaceEnum { - /// - /// Enum Html for value: Html + /// Enum Native for value: native /// - [EnumMember(Value = "Html")] - Html = 1, - + [EnumMember(Value = "native")] Native = 1, + /// - /// Enum Native for value: Native + /// Enum Html for value: html /// - [EnumMember(Value = "Native")] - Native = 2, - + [EnumMember(Value = "html")] Html = 2, + /// /// Enum Both for value: both /// - [EnumMember(Value = "both")] - Both = 3 + [EnumMember(Value = "both")] Both = 3 } /// - /// Supported SDK interface types. + /// Supported SDK interface types. Allowed values: * native * html * both /// - /// Supported SDK interface types. - [DataMember(Name="sdkInterface", EmitDefaultValue=false)] + /// Supported SDK interface types. Allowed values: * native * html * both + [DataMember(Name = "sdkInterface", EmitDefaultValue = false)] public SdkInterfaceEnum? SdkInterface { get; set; } + /// /// Defines SdkUiType /// [JsonConverter(typeof(StringEnumConverter))] public enum SdkUiTypeEnum { - /// /// Enum MultiSelect for value: multiSelect /// - [EnumMember(Value = "multiSelect")] - MultiSelect = 1, - + [EnumMember(Value = "multiSelect")] MultiSelect = 1, + /// /// Enum OtherHtml for value: otherHtml /// - [EnumMember(Value = "otherHtml")] - OtherHtml = 2, - + [EnumMember(Value = "otherHtml")] OtherHtml = 2, + /// /// Enum OutOfBand for value: outOfBand /// - [EnumMember(Value = "outOfBand")] - OutOfBand = 3, - + [EnumMember(Value = "outOfBand")] OutOfBand = 3, + /// /// Enum SingleSelect for value: singleSelect /// - [EnumMember(Value = "singleSelect")] - SingleSelect = 4, - + [EnumMember(Value = "singleSelect")] SingleSelect = 4, + /// /// Enum Text for value: text /// - [EnumMember(Value = "text")] - Text = 5 + [EnumMember(Value = "text")] Text = 5 } - /// - /// UI types supported for displaying specific challenges. + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect /// - /// UI types supported for displaying specific challenges. - [DataMember(Name="sdkUiType", EmitDefaultValue=false)] + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect + [DataMember(Name = "sdkUiType", EmitDefaultValue = false)] public List SdkUiType { get; set; } + /// /// Initializes a new instance of the class. /// - /// Supported SDK interface types.. - /// UI types supported for displaying specific challenges.. - public DeviceRenderOptions(SdkInterfaceEnum? SdkInterface = default(SdkInterfaceEnum?), List SdkUiType = default(List)) + /// Supported SDK interface types. Allowed values: * native * html * both (default to SdkInterfaceEnum.Both). + /// UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect. + public DeviceRenderOptions(SdkInterfaceEnum? sdkInterface = SdkInterfaceEnum.Both, + List sdkUiType = default(List)) { - this.SdkInterface = SdkInterface; - this.SdkUiType = SdkUiType; + // use default value if no "sdkInterface" provided + if (sdkInterface == null) + { + this.SdkInterface = SdkInterfaceEnum.Both; + } + else + { + this.SdkInterface = sdkInterface; + } + this.SdkUiType = sdkUiType; } - /// @@ -138,16 +139,16 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class DeviceRenderOptions {\n"); sb.Append(" SdkInterface: ").Append(SdkInterface).Append("\n"); - sb.Append(" SdkUiType: ").Append(SdkUiType).Append("\n"); + sb.Append(" SdkUiType: ").Append(SdkUiType.ObjectListToString()).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); } @@ -172,15 +173,16 @@ public bool Equals(DeviceRenderOptions input) if (input == null) return false; - return + return ( this.SdkInterface == input.SdkInterface || - (this.SdkInterface != null && - this.SdkInterface.Equals(input.SdkInterface)) - ) && + this.SdkInterface != null && + this.SdkInterface.Equals(input.SdkInterface) + ) && ( this.SdkUiType == input.SdkUiType || this.SdkUiType != null && + input.SdkUiType != null && this.SdkUiType.SequenceEqual(input.SdkUiType) ); } @@ -207,10 +209,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ExternalPlatform.cs b/Adyen/Model/Checkout/ExternalPlatform.cs deleted file mode 100644 index 2b1967ab9..000000000 --- a/Adyen/Model/Checkout/ExternalPlatform.cs +++ /dev/null @@ -1,165 +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.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - /// - /// ExternalPlatform - /// - [DataContract] - public partial class ExternalPlatform : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// External platform integrator.. - /// Name of the field. For example, Name of External Platform.. - /// Version of the field. For example, Version of External Platform.. - public ExternalPlatform(string Integrator = default(string), string Name = default(string), string Version = default(string)) - { - this.Integrator = Integrator; - this.Name = Name; - this.Version = Version; - } - - /// - /// External platform integrator. - /// - /// External platform integrator. - [DataMember(Name="integrator", EmitDefaultValue=false)] - public string Integrator { get; set; } - - /// - /// Name of the field. For example, Name of External Platform. - /// - /// Name of the field. For example, Name of External Platform. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Version of the field. For example, Version of External Platform. - /// - /// Version of the field. For example, Version of External Platform. - [DataMember(Name="version", EmitDefaultValue=false)] - public string Version { 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 ExternalPlatform {\n"); - sb.Append(" Integrator: ").Append(Integrator).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Version: ").Append(Version).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 input) - { - return this.Equals(input as ExternalPlatform); - } - - /// - /// Returns true if ExternalPlatform instances are equal - /// - /// Instance of ExternalPlatform to be compared - /// Boolean - public bool Equals(ExternalPlatform input) - { - if (input == null) - return false; - - return - ( - this.Integrator == input.Integrator || - (this.Integrator != null && - this.Integrator.Equals(input.Integrator)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Version == input.Version || - (this.Version != null && - this.Version.Equals(input.Version)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Integrator != null) - hashCode = hashCode * 59 + this.Integrator.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Version != null) - hashCode = hashCode * 59 + this.Version.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/ForexQuote.cs b/Adyen/Model/Checkout/ForexQuote.cs index 87f8a009c..b14f9b221 100644 --- a/Adyen/Model/Checkout/ForexQuote.cs +++ b/Adyen/Model/Checkout/ForexQuote.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,142 +36,137 @@ namespace Adyen.Model.Checkout /// ForexQuote /// [DataContract] - public partial class ForexQuote : IEquatable, IValidatableObject + public partial class ForexQuote : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected ForexQuote() { } - /// - /// Initializes a new instance of the class. - /// - /// The account name.. - /// The account type.. - /// The base amount.. - /// The base points. (required). - /// The buy rate.. - /// The interbank amount.. - /// The reference assigned to the forex quote request.. - /// The sell rate.. - /// The signature to validate the integrity.. - /// The source of the forex quote.. - /// The type of forex.. - /// The date until which the forex quote is valid. (required). - public ForexQuote(string Account = default(string), string AccountType = default(string), Amount BaseAmount = default(Amount), int? BasePoints = default(int?), Amount Buy = default(Amount), Amount Interbank = default(Amount), string Reference = default(string), Amount Sell = default(Amount), string Signature = default(string), string Source = default(string), string Type = default(string), DateTime? ValidTill = default(DateTime?)) + /// The account name.. + /// The account type.. + /// baseAmount. + /// The base points. (required). + /// buy. + /// interbank. + /// The reference assigned to the forex quote request.. + /// sell. + /// The signature to validate the integrity.. + /// The source of the forex quote.. + /// The type of forex.. + /// The date until which the forex quote is valid. (required). + public ForexQuote(string account = default(string), string accountType = default(string), + Amount baseAmount = default(Amount), int? basePoints = default(int?), Amount buy = default(Amount), + Amount interbank = default(Amount), string reference = default(string), Amount sell = default(Amount), + string signature = default(string), string source = default(string), string type = default(string), + DateTime? validTill = default(DateTime?)) { - // to ensure "BasePoints" is required (not null) - if (BasePoints == null) + // to ensure "basePoints" is required (not null) + if (basePoints == null) { - throw new InvalidDataException("BasePoints is a required property for ForexQuote and cannot be null"); + throw new InvalidDataException("basePoints is a required property for ForexQuote and cannot be null"); } else { - this.BasePoints = BasePoints; + this.BasePoints = basePoints; } - // to ensure "ValidTill" is required (not null) - if (ValidTill == null) + // to ensure "validTill" is required (not null) + if (validTill == null) { - throw new InvalidDataException("ValidTill is a required property for ForexQuote and cannot be null"); + throw new InvalidDataException("validTill is a required property for ForexQuote and cannot be null"); } else { - this.ValidTill = ValidTill; + this.ValidTill = validTill; } - this.Account = Account; - this.AccountType = AccountType; - this.BaseAmount = BaseAmount; - this.Buy = Buy; - this.Interbank = Interbank; - this.Reference = Reference; - this.Sell = Sell; - this.Signature = Signature; - this.Source = Source; - this.Type = Type; + this.Account = account; + this.AccountType = accountType; + this.BaseAmount = baseAmount; + this.Buy = buy; + this.Interbank = interbank; + this.Reference = reference; + this.Sell = sell; + this.Signature = signature; + this.Source = source; + this.Type = type; } - + /// /// The account name. /// /// The account name. - [DataMember(Name="account", EmitDefaultValue=false)] + [DataMember(Name = "account", EmitDefaultValue = false)] public string Account { get; set; } /// /// The account type. /// /// The account type. - [DataMember(Name="accountType", EmitDefaultValue=false)] + [DataMember(Name = "accountType", EmitDefaultValue = false)] public string AccountType { get; set; } /// - /// The base amount. + /// Gets or Sets BaseAmount /// - /// The base amount. - [DataMember(Name="baseAmount", EmitDefaultValue=false)] + [DataMember(Name = "baseAmount", EmitDefaultValue = false)] public Amount BaseAmount { get; set; } /// /// The base points. /// /// The base points. - [DataMember(Name="basePoints", EmitDefaultValue=false)] + [DataMember(Name = "basePoints", EmitDefaultValue = false)] public int? BasePoints { get; set; } /// - /// The buy rate. + /// Gets or Sets Buy /// - /// The buy rate. - [DataMember(Name="buy", EmitDefaultValue=false)] + [DataMember(Name = "buy", EmitDefaultValue = false)] public Amount Buy { get; set; } /// - /// The interbank amount. + /// Gets or Sets Interbank /// - /// The interbank amount. - [DataMember(Name="interbank", EmitDefaultValue=false)] + [DataMember(Name = "interbank", EmitDefaultValue = false)] public Amount Interbank { get; set; } /// /// The reference assigned to the forex quote request. /// /// The reference assigned to the forex quote request. - [DataMember(Name="reference", EmitDefaultValue=false)] + [DataMember(Name = "reference", EmitDefaultValue = false)] public string Reference { get; set; } /// - /// The sell rate. + /// Gets or Sets Sell /// - /// The sell rate. - [DataMember(Name="sell", EmitDefaultValue=false)] + [DataMember(Name = "sell", EmitDefaultValue = false)] public Amount Sell { get; set; } /// /// The signature to validate the integrity. /// /// The signature to validate the integrity. - [DataMember(Name="signature", EmitDefaultValue=false)] + [DataMember(Name = "signature", EmitDefaultValue = false)] public string Signature { get; set; } /// /// The source of the forex quote. /// /// The source of the forex quote. - [DataMember(Name="source", EmitDefaultValue=false)] + [DataMember(Name = "source", EmitDefaultValue = false)] public string Source { get; set; } /// /// The type of forex. /// /// The type of forex. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } /// /// The date until which the forex quote is valid. /// /// The date until which the forex quote is valid. - [DataMember(Name="validTill", EmitDefaultValue=false)] + [DataMember(Name = "validTill", EmitDefaultValue = false)] public DateTime? ValidTill { get; set; } /// @@ -196,12 +192,12 @@ public override string ToString() 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); } @@ -226,66 +222,66 @@ public bool Equals(ForexQuote input) if (input == null) return false; - return + return ( this.Account == input.Account || - (this.Account != null && - this.Account.Equals(input.Account)) - ) && + this.Account != null && + this.Account.Equals(input.Account) + ) && ( this.AccountType == input.AccountType || - (this.AccountType != null && - this.AccountType.Equals(input.AccountType)) - ) && + this.AccountType != null && + this.AccountType.Equals(input.AccountType) + ) && ( this.BaseAmount == input.BaseAmount || - (this.BaseAmount != null && - this.BaseAmount.Equals(input.BaseAmount)) - ) && + this.BaseAmount != null && + this.BaseAmount.Equals(input.BaseAmount) + ) && ( this.BasePoints == input.BasePoints || - (this.BasePoints != null && - this.BasePoints.Equals(input.BasePoints)) - ) && + this.BasePoints != null && + this.BasePoints.Equals(input.BasePoints) + ) && ( this.Buy == input.Buy || - (this.Buy != null && - this.Buy.Equals(input.Buy)) - ) && + this.Buy != null && + this.Buy.Equals(input.Buy) + ) && ( this.Interbank == input.Interbank || - (this.Interbank != null && - this.Interbank.Equals(input.Interbank)) - ) && + this.Interbank != null && + this.Interbank.Equals(input.Interbank) + ) && ( this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ) && + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && ( this.Sell == input.Sell || - (this.Sell != null && - this.Sell.Equals(input.Sell)) - ) && + this.Sell != null && + this.Sell.Equals(input.Sell) + ) && ( this.Signature == input.Signature || - (this.Signature != null && - this.Signature.Equals(input.Signature)) - ) && + this.Signature != null && + this.Signature.Equals(input.Signature) + ) && ( this.Source == input.Source || - (this.Source != null && - this.Source.Equals(input.Source)) - ) && + this.Source != null && + this.Source.Equals(input.Source) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && + this.Type != null && + this.Type.Equals(input.Type) + ) && ( this.ValidTill == input.ValidTill || - (this.ValidTill != null && - this.ValidTill.Equals(input.ValidTill)) + this.ValidTill != null && + this.ValidTill.Equals(input.ValidTill) ); } @@ -331,10 +327,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/FraudCheckResult.cs b/Adyen/Model/Checkout/FraudCheckResult.cs index f42ed6eed..d8e8d7c20 100644 --- a/Adyen/Model/Checkout/FraudCheckResult.cs +++ b/Adyen/Model/Checkout/FraudCheckResult.cs @@ -1,4 +1,4 @@ -#region License +#region License // /* // * ###### // * ###### @@ -35,7 +35,7 @@ namespace Adyen.Model.Checkout /// FraudCheckResult /// [DataContract] - public partial class FraudCheckResult : IEquatable, IValidatableObject + public partial class FraudCheckResult : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -78,26 +78,26 @@ protected FraudCheckResult() { } this.Name = Name; } } - + /// /// The fraud score generated by the risk check. /// /// The fraud score generated by the risk check. - [DataMember(Name="accountScore", EmitDefaultValue=false)] + [DataMember(Name = "accountScore", EmitDefaultValue = false)] public int? AccountScore { get; set; } /// /// The ID of the risk check. /// /// The ID of the risk check. - [DataMember(Name="checkId", EmitDefaultValue=false)] + [DataMember(Name = "checkId", EmitDefaultValue = false)] public int? CheckId { get; set; } /// /// The name of the risk check. /// /// The name of the risk check. - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name = "name", EmitDefaultValue = false)] public string Name { get; set; } /// @@ -114,7 +114,7 @@ public override string ToString() sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -144,17 +144,17 @@ public bool Equals(FraudCheckResult input) if (input == null) return false; - return + return ( this.AccountScore == input.AccountScore || (this.AccountScore != null && this.AccountScore.Equals(input.AccountScore)) - ) && + ) && ( this.CheckId == input.CheckId || (this.CheckId != null && this.CheckId.Equals(input.CheckId)) - ) && + ) && ( this.Name == input.Name || (this.Name != null && @@ -192,4 +192,4 @@ public override int GetHashCode() } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/FraudResult.cs b/Adyen/Model/Checkout/FraudResult.cs index 3b0f35ac0..a1b7de91e 100644 --- a/Adyen/Model/Checkout/FraudResult.cs +++ b/Adyen/Model/Checkout/FraudResult.cs @@ -28,6 +28,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; namespace Adyen.Model.Checkout @@ -36,7 +37,7 @@ namespace Adyen.Model.Checkout /// FraudResult /// [DataContract] - public partial class FraudResult : IEquatable, IValidatableObject + public partial class FraudResult : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. @@ -61,19 +62,19 @@ protected FraudResult() { } } this.Results = Results; } - + /// /// The total fraud score generated by the risk checks. /// /// The total fraud score generated by the risk checks. - [DataMember(Name="accountScore", EmitDefaultValue=false)] + [DataMember(Name = "accountScore", EmitDefaultValue = false)] public int? AccountScore { get; set; } /// /// The result of the individual risk checks. /// /// The result of the individual risk checks. - [DataMember(Name="results", EmitDefaultValue=false)] + [DataMember(Name = "results", EmitDefaultValue = false)] public List Results { get; set; } /// @@ -85,11 +86,11 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class FraudResult {\n"); sb.Append(" AccountScore: ").Append(AccountScore).Append("\n"); - sb.Append(" Results: ").Append(Results).Append("\n"); + sb.Append(" Results: ").Append(Results.ObjectListToString()).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -119,12 +120,12 @@ public bool Equals(FraudResult input) if (input == null) return false; - return + return ( this.AccountScore == input.AccountScore || (this.AccountScore != null && this.AccountScore.Equals(input.AccountScore)) - ) && + ) && ( this.Results == input.Results || this.Results != null && @@ -160,4 +161,4 @@ public override int GetHashCode() } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/InputDetail.cs b/Adyen/Model/Checkout/InputDetail.cs index d5d499761..1667474c2 100644 --- a/Adyen/Model/Checkout/InputDetail.cs +++ b/Adyen/Model/Checkout/InputDetail.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,8 +28,8 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { @@ -36,124 +37,98 @@ namespace Adyen.Model.Checkout /// InputDetail /// [DataContract] - public partial class InputDetail : IEquatable, IValidatableObject + public partial class InputDetail : IEquatable, IValidatableObject { - /// - /// The type of validation to be applied to the input value. - /// - /// The type of validation to be applied to the input value. - [JsonConverter(typeof(StringEnumConverter))] - public enum ValidationTypeEnum - { - - /// - /// Enum IBAN for value: IBAN - /// - [EnumMember(Value = "IBAN")] - IBAN = 1, - - /// - /// Enum Name for value: Name - /// - [EnumMember(Value = "Name")] - Name = 2 - } - - /// - /// The type of validation to be applied to the input value. - /// - /// The type of validation to be applied to the input value. - [DataMember(Name="validationType", EmitDefaultValue=false)] - public ValidationTypeEnum? ValidationType { get; set; } /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input.. - /// Input details can also be provided recursively.. - /// In case of a select, the URL from which to query the items.. - /// In case of a select, the items to choose from.. - /// The value to provide in the result.. - /// The default name for this input field, which will be displayed by the SDKs.. - /// True if this input value is optional.. - /// The type of the required input.. - /// The type of validation to be applied to the input value.. - /// The value can be pre-filled, if available.. - public InputDetail(Dictionary Configuration = default(Dictionary), List Details = default(List), string ItemSearchUrl = default(string), List Items = default(List), string Key = default(string), string Name = default(string), bool? Optional = default(bool?), string Type = default(string), ValidationTypeEnum? ValidationType = default(ValidationTypeEnum?), string Value = default(string)) + /// Configuration parameters for the required input.. + /// Input details can also be provided recursively.. + /// Input details can also be provided recursively (deprecated).. + /// In case of a select, the URL from which to query the items.. + /// In case of a select, the items to choose from.. + /// The value to provide in the result.. + /// True if this input value is optional.. + /// The type of the required input.. + /// The value can be pre-filled, if available.. + public InputDetail(Dictionary configuration = default(Dictionary), + List details = default(List), + List inputDetails = default(List), string itemSearchUrl = default(string), + List items = default(List), string key = default(string), bool? optional = default(bool?), + string type = default(string), string value = default(string)) { - this.Configuration = Configuration; - this.Details = Details; - this.ItemSearchUrl = ItemSearchUrl; - this.Items = Items; - this.Key = Key; - this.Name = Name; - this.Optional = Optional; - this.Type = Type; - this.ValidationType = ValidationType; - this.Value = Value; + this.Configuration = configuration; + this.Details = details; + this.InputDetails = inputDetails; + this.ItemSearchUrl = itemSearchUrl; + this.Items = items; + this.Key = key; + this.Optional = optional; + this.Type = type; + this.Value = value; } - + /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [DataMember(Name="configuration", EmitDefaultValue=false)] + [DataMember(Name = "configuration", EmitDefaultValue = false)] public Dictionary Configuration { get; set; } /// /// Input details can also be provided recursively. /// /// Input details can also be provided recursively. - [DataMember(Name="details", EmitDefaultValue=false)] + [DataMember(Name = "details", EmitDefaultValue = false)] public List Details { get; set; } + /// + /// Input details can also be provided recursively (deprecated). + /// + /// Input details can also be provided recursively (deprecated). + [DataMember(Name = "inputDetails", EmitDefaultValue = false)] + public List InputDetails { get; set; } + /// /// In case of a select, the URL from which to query the items. /// /// In case of a select, the URL from which to query the items. - [DataMember(Name="itemSearchUrl", EmitDefaultValue=false)] + [DataMember(Name = "itemSearchUrl", EmitDefaultValue = false)] public string ItemSearchUrl { get; set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [DataMember(Name="items", EmitDefaultValue=false)] + [DataMember(Name = "items", EmitDefaultValue = false)] public List Items { get; set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name="key", EmitDefaultValue=false)] + [DataMember(Name = "key", EmitDefaultValue = false)] public string Key { get; set; } - /// - /// The default name for this input field, which will be displayed by the SDKs. - /// - /// The default name for this input field, which will be displayed by the SDKs. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - /// /// True if this input value is optional. /// /// True if this input value is optional. - [DataMember(Name="optional", EmitDefaultValue=false)] + [DataMember(Name = "optional", EmitDefaultValue = false)] public bool? Optional { get; set; } /// /// The type of the required input. /// /// The type of the required input. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } - /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [DataMember(Name="value", EmitDefaultValue=false)] + [DataMember(Name = "value", EmitDefaultValue = false)] public string Value { get; set; } /// @@ -164,25 +139,24 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class InputDetail {\n"); - sb.Append(" Configuration: ").Append(Configuration).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration.ToCollectionsString()).Append("\n"); + sb.Append(" Details: ").Append(Details.ObjectListToString()).Append("\n"); + sb.Append(" InputDetails: ").Append(InputDetails.ObjectListToString()).Append("\n"); sb.Append(" ItemSearchUrl: ").Append(ItemSearchUrl).Append("\n"); - sb.Append(" Items: ").Append(Items).Append("\n"); + sb.Append(" Items: ").Append(Items.ObjectListToString()).Append("\n"); sb.Append(" Key: ").Append(Key).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Optional: ").Append(Optional).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" ValidationType: ").Append(ValidationType).Append("\n"); sb.Append(" Value: ").Append(Value).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); } @@ -207,56 +181,55 @@ public bool Equals(InputDetail input) if (input == null) return false; - return + return ( this.Configuration == input.Configuration || this.Configuration != null && + input.Configuration != null && this.Configuration.SequenceEqual(input.Configuration) - ) && + ) && ( this.Details == input.Details || this.Details != null && + input.Details != null && this.Details.SequenceEqual(input.Details) - ) && + ) && + ( + this.InputDetails == input.InputDetails || + this.InputDetails != null && + input.InputDetails != null && + this.InputDetails.SequenceEqual(input.InputDetails) + ) && ( this.ItemSearchUrl == input.ItemSearchUrl || - (this.ItemSearchUrl != null && - this.ItemSearchUrl.Equals(input.ItemSearchUrl)) - ) && + this.ItemSearchUrl != null && + this.ItemSearchUrl.Equals(input.ItemSearchUrl) + ) && ( this.Items == input.Items || this.Items != null && + input.Items != null && this.Items.SequenceEqual(input.Items) - ) && + ) && ( this.Key == input.Key || - (this.Key != null && - this.Key.Equals(input.Key)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && + this.Key != null && + this.Key.Equals(input.Key) + ) && ( this.Optional == input.Optional || - (this.Optional != null && - this.Optional.Equals(input.Optional)) - ) && + this.Optional != null && + this.Optional.Equals(input.Optional) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.ValidationType == input.ValidationType || - (this.ValidationType != null && - this.ValidationType.Equals(input.ValidationType)) - ) && + this.Type != null && + this.Type.Equals(input.Type) + ) && ( this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) + this.Value != null && + this.Value.Equals(input.Value) ); } @@ -273,20 +246,18 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Configuration.GetHashCode(); if (this.Details != null) hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.InputDetails != null) + hashCode = hashCode * 59 + this.InputDetails.GetHashCode(); if (this.ItemSearchUrl != null) hashCode = hashCode * 59 + this.ItemSearchUrl.GetHashCode(); if (this.Items != null) hashCode = hashCode * 59 + this.Items.GetHashCode(); if (this.Key != null) hashCode = hashCode * 59 + this.Key.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); if (this.Optional != null) hashCode = hashCode * 59 + this.Optional.GetHashCode(); if (this.Type != null) hashCode = hashCode * 59 + this.Type.GetHashCode(); - if (this.ValidationType != null) - hashCode = hashCode * 59 + this.ValidationType.GetHashCode(); if (this.Value != null) hashCode = hashCode * 59 + this.Value.GetHashCode(); return hashCode; @@ -298,10 +269,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/InstallmentOption.cs b/Adyen/Model/Checkout/InstallmentOption.cs new file mode 100644 index 000000000..fd5644274 --- /dev/null +++ b/Adyen/Model/Checkout/InstallmentOption.cs @@ -0,0 +1,171 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Adyen.Util; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// InstallmentOption + /// + [DataContract] + public partial class InstallmentOption : IEquatable, IValidatableObject + { + /// + /// Defines Plans + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum PlansEnum + { + /// + /// Enum Regular for value: regular + /// + [EnumMember(Value = "regular")] Regular = 1, + + /// + /// Enum Revolving for value: revolving + /// + [EnumMember(Value = "revolving")] Revolving = 2 + } + + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + [DataMember(Name = "plans", EmitDefaultValue = false)] + public List Plans { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// The maximum number of installments offered for this payment method.. + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving**. + public InstallmentOption(int? maxValue = default(int?), List plans = default(List)) + { + this.MaxValue = maxValue; + this.Plans = plans; + } + + /// + /// The maximum number of installments offered for this payment method. + /// + /// The maximum number of installments offered for this payment method. + [DataMember(Name = "maxValue", EmitDefaultValue = false)] + public int? MaxValue { 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 InstallmentOption {\n"); + sb.Append(" MaxValue: ").Append(MaxValue).Append("\n"); + sb.Append(" Plans: ").Append(Plans.ObjectListToString()).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as InstallmentOption); + } + + /// + /// Returns true if InstallmentOption instances are equal + /// + /// Instance of InstallmentOption to be compared + /// Boolean + public bool Equals(InstallmentOption input) + { + if (input == null) + return false; + + return + ( + this.MaxValue == input.MaxValue || + this.MaxValue != null && + this.MaxValue.Equals(input.MaxValue) + ) && + ( + this.Plans == input.Plans || + this.Plans != null && + input.Plans != null && + this.Plans.SequenceEqual(input.Plans) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MaxValue != null) + hashCode = hashCode * 59 + this.MaxValue.GetHashCode(); + if (this.Plans != null) + hashCode = hashCode * 59 + this.Plans.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Installments.cs b/Adyen/Model/Checkout/Installments.cs index ad7c9985d..e493b8a32 100644 --- a/Adyen/Model/Checkout/Installments.cs +++ b/Adyen/Model/Checkout/Installments.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -28,6 +29,7 @@ using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { @@ -35,35 +37,58 @@ namespace Adyen.Model.Checkout /// Installments /// [DataContract] - public partial class Installments : IEquatable, IValidatableObject + public partial class Installments : IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** /// - [JsonConstructor] - protected Installments() { } + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + [JsonConverter(typeof(StringEnumConverter))] + public enum PlanEnum + { + /// + /// Enum Regular for value: regular + /// + [EnumMember(Value = "regular")] Regular = 1, + + /// + /// Enum Revolving for value: revolving + /// + [EnumMember(Value = "revolving")] Revolving = 2 + } + + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + /// + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving** + [DataMember(Name = "plan", EmitDefaultValue = false)] + public PlanEnum? Plan { get; set; } + /// /// Initializes a new instance of the class. /// - /// Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. (required). - public Installments(int? Value = default(int?)) + /// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving**. + /// Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. (required). + public Installments(PlanEnum? plan = default(PlanEnum?), int? value = default(int?)) { - // to ensure "Value" is required (not null) - if (Value == null) + // to ensure "value" is required (not null) + if (value == null) { - throw new InvalidDataException("Value is a required property for Installments and cannot be null"); + throw new InvalidDataException("value is a required property for Installments and cannot be null"); } else { - this.Value = Value; + this.Value = value; } + this.Plan = plan; } - + + /// /// Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. /// /// Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. - [DataMember(Name="value", EmitDefaultValue=false)] + [DataMember(Name = "value", EmitDefaultValue = false)] public int? Value { get; set; } /// @@ -74,16 +99,17 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Installments {\n"); + sb.Append(" Plan: ").Append(Plan).Append("\n"); sb.Append(" Value: ").Append(Value).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); } @@ -108,11 +134,16 @@ public bool Equals(Installments input) if (input == null) return false; - return + return + ( + this.Plan == input.Plan || + this.Plan != null && + this.Plan.Equals(input.Plan) + ) && ( this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) + this.Value != null && + this.Value.Equals(input.Value) ); } @@ -125,6 +156,8 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Plan != null) + hashCode = hashCode * 59 + this.Plan.GetHashCode(); if (this.Value != null) hashCode = hashCode * 59 + this.Value.GetHashCode(); return hashCode; @@ -136,10 +169,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Installments2.cs b/Adyen/Model/Checkout/Installments2.cs new file mode 100644 index 000000000..4c655bc9b --- /dev/null +++ b/Adyen/Model/Checkout/Installments2.cs @@ -0,0 +1,140 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// Installments2 + /// + [DataContract] + public partial class Installments2 : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// Maximum number of installments (required). + public Installments2(int? maxNumberOfInstallments = default(int?)) + { + // to ensure "maxNumberOfInstallments" is required (not null) + if (maxNumberOfInstallments == null) + { + throw new InvalidDataException( + "maxNumberOfInstallments is a required property for Installments2 and cannot be null"); + } + else + { + this.MaxNumberOfInstallments = maxNumberOfInstallments; + } + } + + /// + /// Maximum number of installments + /// + /// Maximum number of installments + [DataMember(Name = "maxNumberOfInstallments", EmitDefaultValue = false)] + public int? MaxNumberOfInstallments { 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 Installments2 {\n"); + sb.Append(" MaxNumberOfInstallments: ").Append(MaxNumberOfInstallments).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Installments2); + } + + /// + /// Returns true if Installments2 instances are equal + /// + /// Instance of Installments2 to be compared + /// Boolean + public bool Equals(Installments2 input) + { + if (input == null) + return false; + + return + this.MaxNumberOfInstallments == input.MaxNumberOfInstallments || + this.MaxNumberOfInstallments != null && + this.MaxNumberOfInstallments.Equals(input.MaxNumberOfInstallments); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MaxNumberOfInstallments != null) + hashCode = hashCode * 59 + this.MaxNumberOfInstallments.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Item.cs b/Adyen/Model/Checkout/Item.cs index b7bef7cbd..eff4b0f51 100644 --- a/Adyen/Model/Checkout/Item.cs +++ b/Adyen/Model/Checkout/Item.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,31 +35,31 @@ namespace Adyen.Model.Checkout /// Item /// [DataContract] - public partial class Item : IEquatable, IValidatableObject + public partial class Item : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The value to provide in the result.. - /// The display name.. - public Item(string Id = default(string), string Name = default(string)) + /// The value to provide in the result.. + /// The display name.. + public Item(string id = default(string), string name = default(string)) { - this.Id = Id; - this.Name = Name; + this.Id = id; + this.Name = name; } - + /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name="id", EmitDefaultValue=false)] + [DataMember(Name = "id", EmitDefaultValue = false)] public string Id { get; set; } /// /// The display name. /// /// The display name. - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name = "name", EmitDefaultValue = false)] public string Name { get; set; } /// @@ -74,12 +75,12 @@ public override string ToString() 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); } @@ -104,16 +105,16 @@ public bool Equals(Item input) if (input == null) return false; - return + return ( this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && + this.Id != null && + this.Id.Equals(input.Id) + ) && ( this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) + this.Name != null && + this.Name.Equals(input.Name) ); } @@ -139,10 +140,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/LineItem.cs b/Adyen/Model/Checkout/LineItem.cs index b6a8be9ae..759311d5b 100644 --- a/Adyen/Model/Checkout/LineItem.cs +++ b/Adyen/Model/Checkout/LineItem.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,114 +36,127 @@ namespace Adyen.Model.Checkout /// LineItem /// [DataContract] - public partial class LineItem : IEquatable, IValidatableObject + public partial class LineItem : IEquatable, IValidatableObject { /// - /// Tax category: High, Low, None, Zero + /// Required for AfterPay. Tax category: High, Low, None, Zero /// - /// Tax category: High, Low, None, Zero + /// Required for AfterPay. Tax category: High, Low, None, Zero [JsonConverter(typeof(StringEnumConverter))] public enum TaxCategoryEnum { - /// /// Enum High for value: High /// - [EnumMember(Value = "High")] - High = 1, - + [EnumMember(Value = "High")] High = 1, + /// /// Enum Low for value: Low /// - [EnumMember(Value = "Low")] - Low = 2, - + [EnumMember(Value = "Low")] Low = 2, + /// /// Enum None for value: None /// - [EnumMember(Value = "None")] - None = 3, - + [EnumMember(Value = "None")] None = 3, + /// /// Enum Zero for value: Zero /// - [EnumMember(Value = "Zero")] - Zero = 4 + [EnumMember(Value = "Zero")] Zero = 4 } /// - /// Tax category: High, Low, None, Zero + /// Required for AfterPay. Tax category: High, Low, None, Zero /// - /// Tax category: High, Low, None, Zero - [DataMember(Name="taxCategory", EmitDefaultValue=false)] + /// Required for AfterPay. Tax category: High, Low, None, Zero + [DataMember(Name = "taxCategory", EmitDefaultValue = false)] public TaxCategoryEnum? TaxCategory { get; set; } + /// /// Initializes a new instance of the class. /// - /// Item amount excluding the tax, in minor units.. - /// Item amount including the tax, in minor units.. - /// Description of the line item.. - /// ID of the line item.. - /// Number of items.. - /// Tax amount, in minor units.. - /// Tax category: High, Low, None, Zero. - /// Tax percentage, in minor units.. - /// Url to the item productpage. - /// Url to an image of the item. - public LineItem(long? AmountExcludingTax = default(long?), long? AmountIncludingTax = default(long?), string Description = default(string), string Id = default(string), long? Quantity = default(long?), long? TaxAmount = default(long?), TaxCategoryEnum? TaxCategory = default(TaxCategoryEnum?), long? TaxPercentage = default(long?), string ProductUrl = default(string), string ImageUrl = default(string)) + /// Item amount excluding the tax, in minor units.. + /// Item amount including the tax, in minor units.. + /// Description of the line item.. + /// ID of the line item.. + /// Link to the picture of the purchased item.. + /// Link to the purchased item.. + /// Number of items.. + /// Tax amount, in minor units.. + /// Required for AfterPay. Tax category: High, Low, None, Zero. + /// Tax percentage, in minor units.. + public LineItem(long? amountExcludingTax = default(long?), long? amountIncludingTax = default(long?), + string description = default(string), string id = default(string), string imageUrl = default(string), + string productUrl = default(string), long? quantity = default(long?), long? taxAmount = default(long?), + TaxCategoryEnum? taxCategory = default(TaxCategoryEnum?), long? taxPercentage = default(long?)) { - this.AmountExcludingTax = AmountExcludingTax; - this.AmountIncludingTax = AmountIncludingTax; - this.Description = Description; - this.Id = Id; - this.Quantity = Quantity; - this.TaxAmount = TaxAmount; - this.TaxCategory = TaxCategory; - this.TaxPercentage = TaxPercentage; - this.ProductUrl = ProductUrl; - this.ImageUrl = ImageUrl; + this.AmountExcludingTax = amountExcludingTax; + this.AmountIncludingTax = amountIncludingTax; + this.Description = description; + this.Id = id; + this.ImageUrl = imageUrl; + this.ProductUrl = productUrl; + this.Quantity = quantity; + this.TaxAmount = taxAmount; + this.TaxCategory = taxCategory; + this.TaxPercentage = taxPercentage; } - + /// /// Item amount excluding the tax, in minor units. /// /// Item amount excluding the tax, in minor units. - [DataMember(Name="amountExcludingTax", EmitDefaultValue=false)] + [DataMember(Name = "amountExcludingTax", EmitDefaultValue = false)] public long? AmountExcludingTax { get; set; } /// /// Item amount including the tax, in minor units. /// /// Item amount including the tax, in minor units. - [DataMember(Name="amountIncludingTax", EmitDefaultValue=false)] + [DataMember(Name = "amountIncludingTax", EmitDefaultValue = false)] public long? AmountIncludingTax { get; set; } /// /// Description of the line item. /// /// Description of the line item. - [DataMember(Name="description", EmitDefaultValue=false)] + [DataMember(Name = "description", EmitDefaultValue = false)] public string Description { get; set; } /// /// ID of the line item. /// /// ID of the line item. - [DataMember(Name="id", EmitDefaultValue=false)] + [DataMember(Name = "id", EmitDefaultValue = false)] public string Id { get; set; } + /// + /// Link to the picture of the purchased item. + /// + /// Link to the picture of the purchased item. + [DataMember(Name = "imageUrl", EmitDefaultValue = false)] + public string ImageUrl { get; set; } + + /// + /// Link to the purchased item. + /// + /// Link to the purchased item. + [DataMember(Name = "productUrl", EmitDefaultValue = false)] + public string ProductUrl { get; set; } + /// /// Number of items. /// /// Number of items. - [DataMember(Name="quantity", EmitDefaultValue=false)] + [DataMember(Name = "quantity", EmitDefaultValue = false)] public long? Quantity { get; set; } /// /// Tax amount, in minor units. /// /// Tax amount, in minor units. - [DataMember(Name="taxAmount", EmitDefaultValue=false)] + [DataMember(Name = "taxAmount", EmitDefaultValue = false)] public long? TaxAmount { get; set; } @@ -150,23 +164,9 @@ public enum TaxCategoryEnum /// Tax percentage, in minor units. /// /// Tax percentage, in minor units. - [DataMember(Name="taxPercentage", EmitDefaultValue=false)] + [DataMember(Name = "taxPercentage", EmitDefaultValue = false)] public long? TaxPercentage { get; set; } - /// - /// Url to the productpage. - /// - /// Description of the line item. - [DataMember(Name = "productUrl", EmitDefaultValue = false)] - public string ProductUrl { get; set; } - - /// - /// Url to an image of the item. - /// - /// Description of the line item. - [DataMember(Name = "imageUrl", EmitDefaultValue = false)] - public string ImageUrl { get; set; } - /// /// Returns the string presentation of the object /// @@ -179,21 +179,21 @@ public override string ToString() sb.Append(" AmountIncludingTax: ").Append(AmountIncludingTax).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n"); + sb.Append(" ProductUrl: ").Append(ProductUrl).Append("\n"); sb.Append(" Quantity: ").Append(Quantity).Append("\n"); sb.Append(" TaxAmount: ").Append(TaxAmount).Append("\n"); sb.Append(" TaxCategory: ").Append(TaxCategory).Append("\n"); sb.Append(" TaxPercentage: ").Append(TaxPercentage).Append("\n"); - sb.Append(" ProductUrl: ").Append(ProductUrl).Append("\n"); - sb.Append(" ImageUrl: ").Append(ImageUrl).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); } @@ -218,56 +218,56 @@ public bool Equals(LineItem input) if (input == null) return false; - return + return ( this.AmountExcludingTax == input.AmountExcludingTax || - (this.AmountExcludingTax != null && - this.AmountExcludingTax.Equals(input.AmountExcludingTax)) - ) && + this.AmountExcludingTax != null && + this.AmountExcludingTax.Equals(input.AmountExcludingTax) + ) && ( this.AmountIncludingTax == input.AmountIncludingTax || - (this.AmountIncludingTax != null && - this.AmountIncludingTax.Equals(input.AmountIncludingTax)) - ) && + this.AmountIncludingTax != null && + this.AmountIncludingTax.Equals(input.AmountIncludingTax) + ) && ( this.Description == input.Description || - (this.Description != null && - this.Description.Equals(input.Description)) - ) && + this.Description != null && + this.Description.Equals(input.Description) + ) && ( this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && + this.Id != null && + this.Id.Equals(input.Id) + ) && ( - this.Quantity == input.Quantity || - (this.Quantity != null && - this.Quantity.Equals(input.Quantity)) - ) && + this.ImageUrl == input.ImageUrl || + this.ImageUrl != null && + this.ImageUrl.Equals(input.ImageUrl) + ) && ( - this.TaxAmount == input.TaxAmount || - (this.TaxAmount != null && - this.TaxAmount.Equals(input.TaxAmount)) - ) && + this.ProductUrl == input.ProductUrl || + this.ProductUrl != null && + this.ProductUrl.Equals(input.ProductUrl) + ) && ( - this.TaxCategory == input.TaxCategory || - (this.TaxCategory != null && - this.TaxCategory.Equals(input.TaxCategory)) - ) && + this.Quantity == input.Quantity || + this.Quantity != null && + this.Quantity.Equals(input.Quantity) + ) && ( - this.TaxPercentage == input.TaxPercentage || - (this.TaxPercentage != null && - this.TaxPercentage.Equals(input.TaxPercentage)) + this.TaxAmount == input.TaxAmount || + this.TaxAmount != null && + this.TaxAmount.Equals(input.TaxAmount) ) && ( - this.ProductUrl == input.ProductUrl || - (this.ProductUrl != null && - this.ProductUrl.Equals(input.ProductUrl)) + this.TaxCategory == input.TaxCategory || + this.TaxCategory != null && + this.TaxCategory.Equals(input.TaxCategory) ) && ( - this.ImageUrl == input.ImageUrl || - (this.ImageUrl != null && - this.ImageUrl.Equals(input.ImageUrl)) + this.TaxPercentage == input.TaxPercentage || + this.TaxPercentage != null && + this.TaxPercentage.Equals(input.TaxPercentage) ); } @@ -288,6 +288,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Description.GetHashCode(); if (this.Id != null) hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.ImageUrl != null) + hashCode = hashCode * 59 + this.ImageUrl.GetHashCode(); + if (this.ProductUrl != null) + hashCode = hashCode * 59 + this.ProductUrl.GetHashCode(); if (this.Quantity != null) hashCode = hashCode * 59 + this.Quantity.GetHashCode(); if (this.TaxAmount != null) @@ -296,10 +300,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.TaxCategory.GetHashCode(); if (this.TaxPercentage != null) hashCode = hashCode * 59 + this.TaxPercentage.GetHashCode(); - if (this.ProductUrl != null) - hashCode = hashCode * 59 + this.ProductUrl.GetHashCode(); - if (this.ImageUrl != null) - hashCode = hashCode * 59 + this.ImageUrl.GetHashCode(); return hashCode; } } @@ -309,10 +309,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/MerchantDevice.cs b/Adyen/Model/Checkout/MerchantDevice.cs deleted file mode 100644 index cd6aa39a7..000000000 --- a/Adyen/Model/Checkout/MerchantDevice.cs +++ /dev/null @@ -1,165 +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.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - /// - /// MerchantDevice - /// - [DataContract] - public partial class MerchantDevice : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Operating system running on the merchant device.. - /// Version of the operating system on the merchant device.. - /// Merchant device reference.. - public MerchantDevice(string Os = default(string), string OsVersion = default(string), string Reference = default(string)) - { - this.Os = Os; - this.OsVersion = OsVersion; - this.Reference = Reference; - } - - /// - /// Operating system running on the merchant device. - /// - /// Operating system running on the merchant device. - [DataMember(Name="os", EmitDefaultValue=false)] - public string Os { get; set; } - - /// - /// Version of the operating system on the merchant device. - /// - /// Version of the operating system on the merchant device. - [DataMember(Name="osVersion", EmitDefaultValue=false)] - public string OsVersion { get; set; } - - /// - /// Merchant device reference. - /// - /// Merchant device reference. - [DataMember(Name="reference", EmitDefaultValue=false)] - public string Reference { 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 MerchantDevice {\n"); - sb.Append(" Os: ").Append(Os).Append("\n"); - sb.Append(" OsVersion: ").Append(OsVersion).Append("\n"); - sb.Append(" Reference: ").Append(Reference).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 input) - { - return this.Equals(input as MerchantDevice); - } - - /// - /// Returns true if MerchantDevice instances are equal - /// - /// Instance of MerchantDevice to be compared - /// Boolean - public bool Equals(MerchantDevice input) - { - if (input == null) - return false; - - return - ( - this.Os == input.Os || - (this.Os != null && - this.Os.Equals(input.Os)) - ) && - ( - this.OsVersion == input.OsVersion || - (this.OsVersion != null && - this.OsVersion.Equals(input.OsVersion)) - ) && - ( - this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Os != null) - hashCode = hashCode * 59 + this.Os.GetHashCode(); - if (this.OsVersion != null) - hashCode = hashCode * 59 + this.OsVersion.GetHashCode(); - if (this.Reference != null) - hashCode = hashCode * 59 + this.Reference.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/MerchantRiskIndicator.cs b/Adyen/Model/Checkout/MerchantRiskIndicator.cs index 2cb63ba3d..899391ef7 100644 --- a/Adyen/Model/Checkout/MerchantRiskIndicator.cs +++ b/Adyen/Model/Checkout/MerchantRiskIndicator.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,134 +36,129 @@ namespace Adyen.Model.Checkout /// MerchantRiskIndicator /// [DataContract] - public partial class MerchantRiskIndicator : IEquatable, IValidatableObject + public partial class MerchantRiskIndicator : IEquatable, IValidatableObject { /// - /// Indicator regarding the delivery address. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// - /// Indicator regarding the delivery address. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressIndicatorEnum { - /// /// Enum ShipToBillingAddress for value: shipToBillingAddress /// - [EnumMember(Value = "shipToBillingAddress")] - ShipToBillingAddress = 1, - + [EnumMember(Value = "shipToBillingAddress")] ShipToBillingAddress = 1, + /// /// Enum ShipToVerifiedAddress for value: shipToVerifiedAddress /// - [EnumMember(Value = "shipToVerifiedAddress")] - ShipToVerifiedAddress = 2, - + [EnumMember(Value = "shipToVerifiedAddress")] ShipToVerifiedAddress = 2, + /// /// Enum ShipToNewAddress for value: shipToNewAddress /// - [EnumMember(Value = "shipToNewAddress")] - ShipToNewAddress = 3, - + [EnumMember(Value = "shipToNewAddress")] ShipToNewAddress = 3, + /// /// Enum ShipToStore for value: shipToStore /// - [EnumMember(Value = "shipToStore")] - ShipToStore = 4, - + [EnumMember(Value = "shipToStore")] ShipToStore = 4, + /// /// Enum DigitalGoods for value: digitalGoods /// - [EnumMember(Value = "digitalGoods")] - DigitalGoods = 5, - + [EnumMember(Value = "digitalGoods")] DigitalGoods = 5, + /// /// Enum GoodsNotShipped for value: goodsNotShipped /// - [EnumMember(Value = "goodsNotShipped")] - GoodsNotShipped = 6, - + [EnumMember(Value = "goodsNotShipped")] GoodsNotShipped = 6, + /// /// Enum Other for value: other /// - [EnumMember(Value = "other")] - Other = 7 + [EnumMember(Value = "other")] Other = 7 } /// - /// Indicator regarding the delivery address. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` /// - /// Indicator regarding the delivery address. - [DataMember(Name="deliveryAddressIndicator", EmitDefaultValue=false)] + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other` + [DataMember(Name = "deliveryAddressIndicator", EmitDefaultValue = false)] public DeliveryAddressIndicatorEnum? DeliveryAddressIndicator { get; set; } + /// - /// The estimated delivery time for the shopper to receive the goods. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// - /// The estimated delivery time for the shopper to receive the goods. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryTimeframeEnum { - /// /// Enum ElectronicDelivery for value: electronicDelivery /// - [EnumMember(Value = "electronicDelivery")] - ElectronicDelivery = 1, - + [EnumMember(Value = "electronicDelivery")] ElectronicDelivery = 1, + /// /// Enum SameDayShipping for value: sameDayShipping /// - [EnumMember(Value = "sameDayShipping")] - SameDayShipping = 2, - + [EnumMember(Value = "sameDayShipping")] SameDayShipping = 2, + /// /// Enum OvernightShipping for value: overnightShipping /// - [EnumMember(Value = "overnightShipping")] - OvernightShipping = 3, - + [EnumMember(Value = "overnightShipping")] OvernightShipping = 3, + /// /// Enum TwoOrMoreDaysShipping for value: twoOrMoreDaysShipping /// - [EnumMember(Value = "twoOrMoreDaysShipping")] - TwoOrMoreDaysShipping = 4 + [EnumMember(Value = "twoOrMoreDaysShipping")] TwoOrMoreDaysShipping = 4 } /// - /// The estimated delivery time for the shopper to receive the goods. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` /// - /// The estimated delivery time for the shopper to receive the goods. - [DataMember(Name="deliveryTimeframe", EmitDefaultValue=false)] + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping` + [DataMember(Name = "deliveryTimeframe", EmitDefaultValue = false)] public DeliveryTimeframeEnum? DeliveryTimeframe { get; set; } + /// /// Initializes a new instance of the class. /// - /// Whether the chosen delivery address is identical to the billing address.. - /// Indicator regarding the delivery address.. - /// The delivery email address (for digital goods).. - /// The estimated delivery time for the shopper to receive the goods.. - /// The amount of prepaid or gift cards used for this purchase.. - /// Number of individual prepaid or gift cards used for this purchase.. - /// For pre-order purchases, the expected date this product will be available to the shopper.. - /// Whether this transaction is for pre-ordering a product.. - /// Whether the shopper has already purchased the same items in the past.. - public MerchantRiskIndicator(bool? AddressMatch = default(bool?), DeliveryAddressIndicatorEnum? DeliveryAddressIndicator = default(DeliveryAddressIndicatorEnum?), string DeliveryEmail = default(string), DeliveryTimeframeEnum? DeliveryTimeframe = default(DeliveryTimeframeEnum?), Amount GiftCardAmount = default(Amount), int? GiftCardCount = default(int?), DateTime? PreOrderDate = default(DateTime?), bool? PreOrderPurchase = default(bool?), bool? ReorderItems = default(bool?)) + /// Whether the chosen delivery address is identical to the billing address.. + /// Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other`. + /// The delivery email address (for digital goods).. + /// The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping`. + /// giftCardAmount. + /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased.. + /// For pre-order purchases, the expected date this product will be available to the shopper.. + /// Indicator for whether this transaction is for pre-ordering a product.. + /// Indicator for whether the shopper has already purchased the same items in the past.. + public MerchantRiskIndicator(bool? addressMatch = default(bool?), + DeliveryAddressIndicatorEnum? deliveryAddressIndicator = default(DeliveryAddressIndicatorEnum?), + string deliveryEmail = default(string), + DeliveryTimeframeEnum? deliveryTimeframe = default(DeliveryTimeframeEnum?), + Amount giftCardAmount = default(Amount), int? giftCardCount = default(int?), + DateTime? preOrderDate = default(DateTime?), bool? preOrderPurchase = default(bool?), + bool? reorderItems = default(bool?)) { - this.AddressMatch = AddressMatch; - this.DeliveryAddressIndicator = DeliveryAddressIndicator; - this.DeliveryEmail = DeliveryEmail; - this.DeliveryTimeframe = DeliveryTimeframe; - this.GiftCardAmount = GiftCardAmount; - this.GiftCardCount = GiftCardCount; - this.PreOrderDate = PreOrderDate; - this.PreOrderPurchase = PreOrderPurchase; - this.ReorderItems = ReorderItems; + this.AddressMatch = addressMatch; + this.DeliveryAddressIndicator = deliveryAddressIndicator; + this.DeliveryEmail = deliveryEmail; + this.DeliveryTimeframe = deliveryTimeframe; + this.GiftCardAmount = giftCardAmount; + this.GiftCardCount = giftCardCount; + this.PreOrderDate = preOrderDate; + this.PreOrderPurchase = preOrderPurchase; + this.ReorderItems = reorderItems; } - + /// /// Whether the chosen delivery address is identical to the billing address. /// /// Whether the chosen delivery address is identical to the billing address. - [DataMember(Name="addressMatch", EmitDefaultValue=false)] + [DataMember(Name = "addressMatch", EmitDefaultValue = false)] public bool? AddressMatch { get; set; } @@ -170,43 +166,42 @@ public enum DeliveryTimeframeEnum /// The delivery email address (for digital goods). /// /// The delivery email address (for digital goods). - [DataMember(Name="deliveryEmail", EmitDefaultValue=false)] + [DataMember(Name = "deliveryEmail", EmitDefaultValue = false)] public string DeliveryEmail { get; set; } /// - /// The amount of prepaid or gift cards used for this purchase. + /// Gets or Sets GiftCardAmount /// - /// The amount of prepaid or gift cards used for this purchase. - [DataMember(Name="giftCardAmount", EmitDefaultValue=false)] + [DataMember(Name = "giftCardAmount", EmitDefaultValue = false)] public Amount GiftCardAmount { get; set; } /// - /// Number of individual prepaid or gift cards used for this purchase. + /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. /// - /// Number of individual prepaid or gift cards used for this purchase. - [DataMember(Name="giftCardCount", EmitDefaultValue=false)] + /// For prepaid or gift card purchase, total count of individual prepaid or gift cards/codes purchased. + [DataMember(Name = "giftCardCount", EmitDefaultValue = false)] public int? GiftCardCount { get; set; } /// /// For pre-order purchases, the expected date this product will be available to the shopper. /// /// For pre-order purchases, the expected date this product will be available to the shopper. - [DataMember(Name="preOrderDate", EmitDefaultValue=false)] + [DataMember(Name = "preOrderDate", EmitDefaultValue = false)] public DateTime? PreOrderDate { get; set; } /// - /// Whether this transaction is for pre-ordering a product. + /// Indicator for whether this transaction is for pre-ordering a product. /// - /// Whether this transaction is for pre-ordering a product. - [DataMember(Name="preOrderPurchase", EmitDefaultValue=false)] + /// Indicator for whether this transaction is for pre-ordering a product. + [DataMember(Name = "preOrderPurchase", EmitDefaultValue = false)] public bool? PreOrderPurchase { get; set; } /// - /// Whether the shopper has already purchased the same items in the past. + /// Indicator for whether the shopper has already purchased the same items in the past. /// - /// Whether the shopper has already purchased the same items in the past. - [DataMember(Name="reorderItems", EmitDefaultValue=false)] + /// Indicator for whether the shopper has already purchased the same items in the past. + [DataMember(Name = "reorderItems", EmitDefaultValue = false)] public bool? ReorderItems { get; set; } /// @@ -229,12 +224,12 @@ public override string ToString() 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); } @@ -259,51 +254,51 @@ public bool Equals(MerchantRiskIndicator input) if (input == null) return false; - return + return ( this.AddressMatch == input.AddressMatch || - (this.AddressMatch != null && - this.AddressMatch.Equals(input.AddressMatch)) - ) && + this.AddressMatch != null && + this.AddressMatch.Equals(input.AddressMatch) + ) && ( this.DeliveryAddressIndicator == input.DeliveryAddressIndicator || - (this.DeliveryAddressIndicator != null && - this.DeliveryAddressIndicator.Equals(input.DeliveryAddressIndicator)) - ) && + this.DeliveryAddressIndicator != null && + this.DeliveryAddressIndicator.Equals(input.DeliveryAddressIndicator) + ) && ( this.DeliveryEmail == input.DeliveryEmail || - (this.DeliveryEmail != null && - this.DeliveryEmail.Equals(input.DeliveryEmail)) - ) && + this.DeliveryEmail != null && + this.DeliveryEmail.Equals(input.DeliveryEmail) + ) && ( this.DeliveryTimeframe == input.DeliveryTimeframe || - (this.DeliveryTimeframe != null && - this.DeliveryTimeframe.Equals(input.DeliveryTimeframe)) - ) && + this.DeliveryTimeframe != null && + this.DeliveryTimeframe.Equals(input.DeliveryTimeframe) + ) && ( this.GiftCardAmount == input.GiftCardAmount || - (this.GiftCardAmount != null && - this.GiftCardAmount.Equals(input.GiftCardAmount)) - ) && + this.GiftCardAmount != null && + this.GiftCardAmount.Equals(input.GiftCardAmount) + ) && ( this.GiftCardCount == input.GiftCardCount || - (this.GiftCardCount != null && - this.GiftCardCount.Equals(input.GiftCardCount)) - ) && + this.GiftCardCount != null && + this.GiftCardCount.Equals(input.GiftCardCount) + ) && ( this.PreOrderDate == input.PreOrderDate || - (this.PreOrderDate != null && - this.PreOrderDate.Equals(input.PreOrderDate)) - ) && + this.PreOrderDate != null && + this.PreOrderDate.Equals(input.PreOrderDate) + ) && ( this.PreOrderPurchase == input.PreOrderPurchase || - (this.PreOrderPurchase != null && - this.PreOrderPurchase.Equals(input.PreOrderPurchase)) - ) && + this.PreOrderPurchase != null && + this.PreOrderPurchase.Equals(input.PreOrderPurchase) + ) && ( this.ReorderItems == input.ReorderItems || - (this.ReorderItems != null && - this.ReorderItems.Equals(input.ReorderItems)) + this.ReorderItems != null && + this.ReorderItems.Equals(input.ReorderItems) ); } @@ -343,10 +338,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Name.cs b/Adyen/Model/Checkout/Name.cs index 8e2b7aea3..379421c7f 100644 --- a/Adyen/Model/Checkout/Name.cs +++ b/Adyen/Model/Checkout/Name.cs @@ -1,29 +1,31 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json; @@ -44,24 +46,20 @@ public partial class Name : IEquatable, IValidatableObject [JsonConverter(typeof(StringEnumConverter))] public enum GenderEnum { - /// /// Enum MALE for value: MALE /// - [EnumMember(Value = "MALE")] - MALE = 1, + [EnumMember(Value = "MALE")] MALE = 1, /// /// Enum FEMALE for value: FEMALE /// - [EnumMember(Value = "FEMALE")] - FEMALE = 2, + [EnumMember(Value = "FEMALE")] FEMALE = 2, /// /// Enum UNKNOWN for value: UNKNOWN /// - [EnumMember(Value = "UNKNOWN")] - UNKNOWN = 3 + [EnumMember(Value = "UNKNOWN")] UNKNOWN = 3 } /// @@ -70,36 +68,39 @@ public enum GenderEnum /// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. [DataMember(Name = "gender", EmitDefaultValue = false)] public GenderEnum Gender { get; set; } - /// - /// Initializes a new instance of the class. - /// - [JsonConstructor] - protected Name() { } + /// /// Initializes a new instance of the class. /// /// The first name. (required). /// The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`. (required). - /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed.. + /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed.. /// The last name. (required). - public Name(string firstName, GenderEnum gender, string infix, string lastName) + public Name(string firstName = default(string), GenderEnum gender = default(GenderEnum), + string infix = default(string), string lastName = default(string)) { - // to ensure "FirstName" is required (not null) + // to ensure "firstName" is required (not null) if (firstName == null) { - throw new ArgumentNullException("FirstName is a required property for Name and cannot be null"); + throw new InvalidDataException("firstName is a required property for Name and cannot be null"); } else { this.FirstName = firstName; } - - this.Gender = gender; - - // to ensure "LastName" is required (not null) + // to ensure "gender" is required (not null) + if (gender == null) + { + throw new InvalidDataException("gender is a required property for Name and cannot be null"); + } + else + { + this.Gender = gender; + } + // to ensure "lastName" is required (not null) if (lastName == null) { - throw new ArgumentNullException("LastName is a required property for Name and cannot be null"); + throw new InvalidDataException("lastName is a required property for Name and cannot be null"); } else { @@ -113,22 +114,22 @@ public Name(string firstName, GenderEnum gender, string infix, string lastName) /// /// The first name. [DataMember(Name = "firstName", EmitDefaultValue = false)] - public string FirstName { get; } + public string FirstName { get; set; } /// - /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed. + /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed. /// - /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed. + /// The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed. [DataMember(Name = "infix", EmitDefaultValue = false)] - public string Infix { get; } + public string Infix { get; set; } /// /// The last name. /// /// The last name. [DataMember(Name = "lastName", EmitDefaultValue = false)] - public string LastName { get; } + public string LastName { get; set; } /// /// Returns the string presentation of the object @@ -150,7 +151,7 @@ public override string 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); } @@ -178,22 +179,23 @@ public bool Equals(Name input) return ( this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) + this.FirstName != null && + this.FirstName.Equals(input.FirstName) ) && ( this.Gender == input.Gender || + this.Gender != null && this.Gender.Equals(input.Gender) ) && ( this.Infix == input.Infix || - (this.Infix != null && - this.Infix.Equals(input.Infix)) + this.Infix != null && + this.Infix.Equals(input.Infix) ) && ( this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) + this.LastName != null && + this.LastName.Equals(input.LastName) ); } @@ -208,7 +210,8 @@ public override int GetHashCode() int hashCode = 41; if (this.FirstName != null) hashCode = hashCode * 59 + this.FirstName.GetHashCode(); - hashCode = hashCode * 59 + this.Gender.GetHashCode(); + if (this.Gender != null) + hashCode = hashCode * 59 + this.Gender.GetHashCode(); if (this.Infix != null) hashCode = hashCode * 59 + this.Infix.GetHashCode(); if (this.LastName != null) @@ -222,10 +225,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentCompletionDetails.cs b/Adyen/Model/Checkout/PaymentCompletionDetails.cs new file mode 100644 index 000000000..10641a7ee --- /dev/null +++ b/Adyen/Model/Checkout/PaymentCompletionDetails.cs @@ -0,0 +1,394 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// PaymentCompletionDetails + /// + [DataContract] + public partial class PaymentCompletionDetails : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// A payment session identifier returned by the card issuer.. + /// (3D) Payment Authentication Request data for the card issuer.. + /// (3D) Payment Authentication Response data by the card issuer.. + /// PayPal-generated token for recurring payments.. + /// The SMS verification code collected from the shopper.. + /// PayPal-generated third party access token.. + /// A random number sent to the mobile phone number of the shopper to verify the payment.. + /// PayPal-assigned ID for the order.. + /// PayPal-assigned ID for the payer (shopper).. + /// Payload appended to the `returnURL` as a result of the redirect.. + /// PayPal-generated ID for the payment.. + /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`.. + /// The result of the redirect as appended to the `returnURL`.. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`.. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`.. + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`.. + public PaymentCompletionDetails(string mD = default(string), string paReq = default(string), + string paRes = default(string), string billingToken = default(string), + string cupsecureplusSmscode = default(string), string facilitatorAccessToken = default(string), + string oneTimePasscode = default(string), string orderID = default(string), + string payerID = default(string), string payload = default(string), string paymentID = default(string), + string paymentStatus = default(string), string redirectResult = default(string), + string threeDSResult = default(string), string threeds2ChallengeResult = default(string), + string threeds2Fingerprint = default(string)) + { + this.MD = mD; + this.PaReq = paReq; + this.PaRes = paRes; + this.BillingToken = billingToken; + this.CupsecureplusSmscode = cupsecureplusSmscode; + this.FacilitatorAccessToken = facilitatorAccessToken; + this.OneTimePasscode = oneTimePasscode; + this.OrderID = orderID; + this.PayerID = payerID; + this.Payload = payload; + this.PaymentID = paymentID; + this.PaymentStatus = paymentStatus; + this.RedirectResult = redirectResult; + this.ThreeDSResult = threeDSResult; + this.Threeds2ChallengeResult = threeds2ChallengeResult; + this.Threeds2Fingerprint = threeds2Fingerprint; + } + + /// + /// A payment session identifier returned by the card issuer. + /// + /// A payment session identifier returned by the card issuer. + [DataMember(Name = "MD", EmitDefaultValue = false)] + public string MD { get; set; } + + /// + /// (3D) Payment Authentication Request data for the card issuer. + /// + /// (3D) Payment Authentication Request data for the card issuer. + [DataMember(Name = "PaReq", EmitDefaultValue = false)] + public string PaReq { get; set; } + + /// + /// (3D) Payment Authentication Response data by the card issuer. + /// + /// (3D) Payment Authentication Response data by the card issuer. + [DataMember(Name = "PaRes", EmitDefaultValue = false)] + public string PaRes { get; set; } + + /// + /// PayPal-generated token for recurring payments. + /// + /// PayPal-generated token for recurring payments. + [DataMember(Name = "billingToken", EmitDefaultValue = false)] + public string BillingToken { get; set; } + + /// + /// The SMS verification code collected from the shopper. + /// + /// The SMS verification code collected from the shopper. + [DataMember(Name = "cupsecureplus.smscode", EmitDefaultValue = false)] + public string CupsecureplusSmscode { get; set; } + + /// + /// PayPal-generated third party access token. + /// + /// PayPal-generated third party access token. + [DataMember(Name = "facilitatorAccessToken", EmitDefaultValue = false)] + public string FacilitatorAccessToken { get; set; } + + /// + /// A random number sent to the mobile phone number of the shopper to verify the payment. + /// + /// A random number sent to the mobile phone number of the shopper to verify the payment. + [DataMember(Name = "oneTimePasscode", EmitDefaultValue = false)] + public string OneTimePasscode { get; set; } + + /// + /// PayPal-assigned ID for the order. + /// + /// PayPal-assigned ID for the order. + [DataMember(Name = "orderID", EmitDefaultValue = false)] + public string OrderID { get; set; } + + /// + /// PayPal-assigned ID for the payer (shopper). + /// + /// PayPal-assigned ID for the payer (shopper). + [DataMember(Name = "payerID", EmitDefaultValue = false)] + public string PayerID { get; set; } + + /// + /// Payload appended to the `returnURL` as a result of the redirect. + /// + /// Payload appended to the `returnURL` as a result of the redirect. + [DataMember(Name = "payload", EmitDefaultValue = false)] + public string Payload { get; set; } + + /// + /// PayPal-generated ID for the payment. + /// + /// PayPal-generated ID for the payment. + [DataMember(Name = "paymentID", EmitDefaultValue = false)] + public string PaymentID { get; set; } + + /// + /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. + /// + /// Value passed from the WeChat MiniProgram `wx.requestPayment` **complete** callback. Possible values: any value starting with `requestPayment:`. + [DataMember(Name = "paymentStatus", EmitDefaultValue = false)] + public string PaymentStatus { get; set; } + + /// + /// The result of the redirect as appended to the `returnURL`. + /// + /// The result of the redirect as appended to the `returnURL`. + [DataMember(Name = "redirectResult", EmitDefaultValue = false)] + public string RedirectResult { get; set; } + + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameters: `transStatus`, `authorisationToken`. + [DataMember(Name = "threeDSResult", EmitDefaultValue = false)] + public string ThreeDSResult { get; set; } + + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `transStatus`. + [DataMember(Name = "threeds2.challengeResult", EmitDefaultValue = false)] + public string Threeds2ChallengeResult { get; set; } + + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. + /// + /// Base64-encoded string returned by the Component after the challenge flow. It contains the following parameter: `threeDSCompInd`. + [DataMember(Name = "threeds2.fingerprint", EmitDefaultValue = false)] + public string Threeds2Fingerprint { 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 PaymentCompletionDetails {\n"); + sb.Append(" MD: ").Append(MD).Append("\n"); + sb.Append(" PaReq: ").Append(PaReq).Append("\n"); + sb.Append(" PaRes: ").Append(PaRes).Append("\n"); + sb.Append(" BillingToken: ").Append(BillingToken).Append("\n"); + sb.Append(" CupsecureplusSmscode: ").Append(CupsecureplusSmscode).Append("\n"); + sb.Append(" FacilitatorAccessToken: ").Append(FacilitatorAccessToken).Append("\n"); + sb.Append(" OneTimePasscode: ").Append(OneTimePasscode).Append("\n"); + sb.Append(" OrderID: ").Append(OrderID).Append("\n"); + sb.Append(" PayerID: ").Append(PayerID).Append("\n"); + sb.Append(" Payload: ").Append(Payload).Append("\n"); + sb.Append(" PaymentID: ").Append(PaymentID).Append("\n"); + sb.Append(" PaymentStatus: ").Append(PaymentStatus).Append("\n"); + sb.Append(" RedirectResult: ").Append(RedirectResult).Append("\n"); + sb.Append(" ThreeDSResult: ").Append(ThreeDSResult).Append("\n"); + sb.Append(" Threeds2ChallengeResult: ").Append(Threeds2ChallengeResult).Append("\n"); + sb.Append(" Threeds2Fingerprint: ").Append(Threeds2Fingerprint).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentCompletionDetails); + } + + /// + /// Returns true if PaymentCompletionDetails instances are equal + /// + /// Instance of PaymentCompletionDetails to be compared + /// Boolean + public bool Equals(PaymentCompletionDetails input) + { + if (input == null) + return false; + + return + ( + this.MD == input.MD || + this.MD != null && + this.MD.Equals(input.MD) + ) && + ( + this.PaReq == input.PaReq || + this.PaReq != null && + this.PaReq.Equals(input.PaReq) + ) && + ( + this.PaRes == input.PaRes || + this.PaRes != null && + this.PaRes.Equals(input.PaRes) + ) && + ( + this.BillingToken == input.BillingToken || + this.BillingToken != null && + this.BillingToken.Equals(input.BillingToken) + ) && + ( + this.CupsecureplusSmscode == input.CupsecureplusSmscode || + this.CupsecureplusSmscode != null && + this.CupsecureplusSmscode.Equals(input.CupsecureplusSmscode) + ) && + ( + this.FacilitatorAccessToken == input.FacilitatorAccessToken || + this.FacilitatorAccessToken != null && + this.FacilitatorAccessToken.Equals(input.FacilitatorAccessToken) + ) && + ( + this.OneTimePasscode == input.OneTimePasscode || + this.OneTimePasscode != null && + this.OneTimePasscode.Equals(input.OneTimePasscode) + ) && + ( + this.OrderID == input.OrderID || + this.OrderID != null && + this.OrderID.Equals(input.OrderID) + ) && + ( + this.PayerID == input.PayerID || + this.PayerID != null && + this.PayerID.Equals(input.PayerID) + ) && + ( + this.Payload == input.Payload || + this.Payload != null && + this.Payload.Equals(input.Payload) + ) && + ( + this.PaymentID == input.PaymentID || + this.PaymentID != null && + this.PaymentID.Equals(input.PaymentID) + ) && + ( + this.PaymentStatus == input.PaymentStatus || + this.PaymentStatus != null && + this.PaymentStatus.Equals(input.PaymentStatus) + ) && + ( + this.RedirectResult == input.RedirectResult || + this.RedirectResult != null && + this.RedirectResult.Equals(input.RedirectResult) + ) && + ( + this.ThreeDSResult == input.ThreeDSResult || + this.ThreeDSResult != null && + this.ThreeDSResult.Equals(input.ThreeDSResult) + ) && + ( + this.Threeds2ChallengeResult == input.Threeds2ChallengeResult || + this.Threeds2ChallengeResult != null && + this.Threeds2ChallengeResult.Equals(input.Threeds2ChallengeResult) + ) && + ( + this.Threeds2Fingerprint == input.Threeds2Fingerprint || + this.Threeds2Fingerprint != null && + this.Threeds2Fingerprint.Equals(input.Threeds2Fingerprint) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.MD != null) + hashCode = hashCode * 59 + this.MD.GetHashCode(); + if (this.PaReq != null) + hashCode = hashCode * 59 + this.PaReq.GetHashCode(); + if (this.PaRes != null) + hashCode = hashCode * 59 + this.PaRes.GetHashCode(); + if (this.BillingToken != null) + hashCode = hashCode * 59 + this.BillingToken.GetHashCode(); + if (this.CupsecureplusSmscode != null) + hashCode = hashCode * 59 + this.CupsecureplusSmscode.GetHashCode(); + if (this.FacilitatorAccessToken != null) + hashCode = hashCode * 59 + this.FacilitatorAccessToken.GetHashCode(); + if (this.OneTimePasscode != null) + hashCode = hashCode * 59 + this.OneTimePasscode.GetHashCode(); + if (this.OrderID != null) + hashCode = hashCode * 59 + this.OrderID.GetHashCode(); + if (this.PayerID != null) + hashCode = hashCode * 59 + this.PayerID.GetHashCode(); + if (this.Payload != null) + hashCode = hashCode * 59 + this.Payload.GetHashCode(); + if (this.PaymentID != null) + hashCode = hashCode * 59 + this.PaymentID.GetHashCode(); + if (this.PaymentStatus != null) + hashCode = hashCode * 59 + this.PaymentStatus.GetHashCode(); + if (this.RedirectResult != null) + hashCode = hashCode * 59 + this.RedirectResult.GetHashCode(); + if (this.ThreeDSResult != null) + hashCode = hashCode * 59 + this.ThreeDSResult.GetHashCode(); + if (this.Threeds2ChallengeResult != null) + hashCode = hashCode * 59 + this.Threeds2ChallengeResult.GetHashCode(); + if (this.Threeds2Fingerprint != null) + hashCode = hashCode * 59 + this.Threeds2Fingerprint.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentDetails.cs b/Adyen/Model/Checkout/PaymentDetails.cs new file mode 100644 index 000000000..2ef7121b8 --- /dev/null +++ b/Adyen/Model/Checkout/PaymentDetails.cs @@ -0,0 +1,130 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// PaymentDetails + /// + [DataContract] + public partial class PaymentDetails : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// The payment method type.. + public PaymentDetails(string type = default(string)) + { + this.Type = type; + } + + /// + /// The payment method type. + /// + /// The payment method type. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { 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 PaymentDetails {\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentDetails); + } + + /// + /// Returns true if PaymentDetails instances are equal + /// + /// Instance of PaymentDetails to be compared + /// Boolean + public bool Equals(PaymentDetails input) + { + if (input == null) + return false; + + return + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentLinkResource.cs b/Adyen/Model/Checkout/PaymentLinkResource.cs new file mode 100644 index 000000000..fd20590b0 --- /dev/null +++ b/Adyen/Model/Checkout/PaymentLinkResource.cs @@ -0,0 +1,687 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Model.ApplicationInformation; +using Adyen.Util; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// PaymentLinkResource + /// + [DataContract] + public partial class PaymentLinkResource : IEquatable, IValidatableObject + { + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [JsonConverter(typeof(StringEnumConverter))] + public enum RecurringProcessingModelEnum + { + /// + /// Enum CardOnFile for value: CardOnFile + /// + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, + + /// + /// Enum Subscription for value: Subscription + /// + [EnumMember(Value = "Subscription")] Subscription = 2, + + /// + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile + /// + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 + } + + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + + /// + /// Status of the payment link. Possible values: * **active** * **expired** * **completed** (v66 and above) * **paid** (v65 and below) + /// + /// Status of the payment link. Possible values: * **active** * **expired** * **completed** (v66 and above) * **paid** (v65 and below) + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Active for value: active + /// + [EnumMember(Value = "active")] Active = 1, + + /// + /// Enum Completed for value: completed + /// + [EnumMember(Value = "completed")] Completed = 2, + + /// + /// Enum Expired for value: expired + /// + [EnumMember(Value = "expired")] Expired = 3 + } + + /// + /// Status of the payment link. Possible values: * **active** * **expired** * **completed** (v66 and above) * **paid** (v65 and below) + /// + /// Status of the payment link. Possible values: * **active** * **expired** * **completed** (v66 and above) * **paid** (v65 and below) + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum Status { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// The shopper's two-letter country code.. + /// The date and time the purchased goods should be delivered. In ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`.. + /// deliveryAddress. + /// A short description visible on the payment page. Maximum length: 280 characters.. + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created.. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip.. + /// The merchant account identifier for which the payment link is created. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle.. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or has variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// A reference that is used to uniquely identify the payment in future communications about the payment status. (required). + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL.. + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only.. + /// riskData. + /// The shopper's email address.. + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization).. + /// shopperName. + /// A unique identifier for the shopper (for example, user ID or account ID).. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information).. + /// Status of the payment link. Possible values: * **active** * **expired** * **completed** (v66 and above) * **paid** (v65 and below) (required). + /// The physical store, for which this payment is processed.. + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored.. + public PaymentLinkResource(List allowedPaymentMethods = default(List), + Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), + Address billingAddress = default(Address), List blockedPaymentMethods = default(List), + string countryCode = default(string), DateTime? deliverAt = default(DateTime?), + Address deliveryAddress = default(Address), string description = default(string), + string expiresAt = default(string), List lineItems = default(List), + string merchantAccount = default(string), string merchantOrderReference = default(string), + RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), + string reference = default(string), string returnUrl = default(string), bool? reusable = default(bool?), + RiskData riskData = default(RiskData), string shopperEmail = default(string), + string shopperLocale = default(string), Name shopperName = default(Name), + string shopperReference = default(string), List splits = default(List), + StatusEnum status = default(StatusEnum), string store = default(string), + bool? storePaymentMethod = default(bool?)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException( + "amount is a required property for PaymentLinkResource and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException( + "merchantAccount is a required property for PaymentLinkResource and cannot be null"); + } + else + { + this.MerchantAccount = merchantAccount; + } + // to ensure "reference" is required (not null) + if (reference == null) + { + throw new InvalidDataException( + "reference is a required property for PaymentLinkResource and cannot be null"); + } + else + { + this.Reference = reference; + } + // to ensure "status" is required (not null) + if (status == null) + { + throw new InvalidDataException( + "status is a required property for PaymentLinkResource and cannot be null"); + } + else + { + this.Status = status; + } + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CountryCode = countryCode; + this.DeliverAt = deliverAt; + this.DeliveryAddress = deliveryAddress; + this.Description = description; + this.ExpiresAt = expiresAt; + this.LineItems = lineItems; + this.MerchantOrderReference = merchantOrderReference; + this.RecurringProcessingModel = recurringProcessingModel; + this.ReturnUrl = returnUrl; + this.Reusable = reusable; + this.RiskData = riskData; + this.ShopperEmail = shopperEmail; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.Splits = splits; + this.Store = store; + this.StorePaymentMethod = storePaymentMethod; + } + + /// + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List AllowedPaymentMethods { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } + + /// + /// Gets or Sets ApplicationInfo + /// + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo ApplicationInfo { get; set; } + + /// + /// Gets or Sets BillingAddress + /// + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address BillingAddress { get; set; } + + /// + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List BlockedPaymentMethods { get; set; } + + /// + /// The shopper's two-letter country code. + /// + /// The shopper's two-letter country code. + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string CountryCode { get; set; } + + /// + /// The date and time the purchased goods should be delivered. In ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. + /// + /// The date and time the purchased goods should be delivered. In ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. + [DataMember(Name = "deliverAt", EmitDefaultValue = false)] + public DateTime? DeliverAt { get; set; } + + /// + /// Gets or Sets DeliveryAddress + /// + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address DeliveryAddress { get; set; } + + /// + /// A short description visible on the payment page. Maximum length: 280 characters. + /// + /// A short description visible on the payment page. Maximum length: 280 characters. + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created. + /// + /// The date that the payment link expires, in ISO 8601 format. For example `2019-11-23T12:25:28Z`, or `2020-05-27T20:25:28+08:00`. Maximum expiry date should be 30 days from when the payment link is created. If not provided, the default expiry is set to 24 hours after the payment link is created. + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public string ExpiresAt { get; set; } + + /// + /// A unique identifier of the payment link. + /// + /// A unique identifier of the payment link. + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; private set; } + + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip. + /// + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. This parameter is required for open invoice (_buy now, pay later_) payment methods such AfterPay, Klarna, RatePay, and Zip. + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List LineItems { get; set; } + + /// + /// The merchant account identifier for which the payment link is created. + /// + /// The merchant account identifier for which the payment link is created. + [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] + public string MerchantAccount { get; set; } + + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + /// + /// This reference allows linking multiple transactions to each other for reporting purposes (for example, order auth-rate). The reference should be unique per billing cycle. + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string MerchantOrderReference { get; set; } + + + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + /// + /// A reference that is used to uniquely identify the payment in future communications about the payment status. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { get; set; } + + /// + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + /// + /// Website URL used for redirection after payment is completed. If provided, a **Continue** button will be shown on the payment page. If shoppers select the button, they are redirected to the specified URL. + [DataMember(Name = "returnUrl", EmitDefaultValue = false)] + public string ReturnUrl { get; set; } + + /// + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + /// + /// Indicates whether the payment link can be reused for multiple payments. If not provided, this defaults to **false** which means the link can be used for one successful payment only. + [DataMember(Name = "reusable", EmitDefaultValue = false)] + public bool? Reusable { get; set; } + + /// + /// Gets or Sets RiskData + /// + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } + + /// + /// The shopper's email address. + /// + /// The shopper's email address. + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string ShopperEmail { get; set; } + + /// + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization). + /// + /// The language to be used in the payment page, specified by a combination of a language and country code. For example, `en-US`. For a list of shopper locales that Pay by Link supports, refer to [Language and localization](https://docs.adyen.com/checkout/pay-by-link#language-and-localization). + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string ShopperLocale { get; set; } + + /// + /// Gets or Sets ShopperName + /// + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name ShopperName { get; set; } + + /// + /// A unique identifier for the shopper (for example, user ID or account ID). + /// + /// A unique identifier for the shopper (for example, user ID or account ID). + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string ShopperReference { get; set; } + + /// + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + /// + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } + + + /// + /// The physical store, for which this payment is processed. + /// + /// The physical store, for which this payment is processed. + [DataMember(Name = "store", EmitDefaultValue = false)] + public string Store { get; set; } + + /// + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + /// + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } + + /// + /// The URL at which the shopper can complete the payment. + /// + /// The URL at which the shopper can complete the payment. + [DataMember(Name = "url", EmitDefaultValue = false)] + public string Url { get; private set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PaymentLinkResource {\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods.ToListString()).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); + sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); + sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods.ToListString()).Append("\n"); + sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); + sb.Append(" DeliverAt: ").Append(DeliverAt).Append("\n"); + sb.Append(" DeliveryAddress: ").Append(DeliveryAddress).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" LineItems: ").Append(LineItems.ObjectListToString()).Append("\n"); + sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); + sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); + sb.Append(" Reusable: ").Append(Reusable).Append("\n"); + sb.Append(" RiskData: ").Append(RiskData).Append("\n"); + sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); + sb.Append(" ShopperLocale: ").Append(ShopperLocale).Append("\n"); + sb.Append(" ShopperName: ").Append(ShopperName).Append("\n"); + sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); + sb.Append(" Splits: ").Append(Splits.ObjectListToString()).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); + sb.Append(" Url: ").Append(Url).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentLinkResource); + } + + /// + /// Returns true if PaymentLinkResource instances are equal + /// + /// Instance of PaymentLinkResource to be compared + /// Boolean + public bool Equals(PaymentLinkResource input) + { + if (input == null) + return false; + + return + ( + this.AllowedPaymentMethods == input.AllowedPaymentMethods || + this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && + this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + ) && + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.ApplicationInfo == input.ApplicationInfo || + this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo) + ) && + ( + this.BillingAddress == input.BillingAddress || + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) + ) && + ( + this.BlockedPaymentMethods == input.BlockedPaymentMethods || + this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && + this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + ) && + ( + this.CountryCode == input.CountryCode || + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) + ) && + ( + this.DeliverAt == input.DeliverAt || + this.DeliverAt != null && + this.DeliverAt.Equals(input.DeliverAt) + ) && + ( + this.DeliveryAddress == input.DeliveryAddress || + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) + ) && + ( + this.Description == input.Description || + this.Description != null && + this.Description.Equals(input.Description) + ) && + ( + this.ExpiresAt == input.ExpiresAt || + this.ExpiresAt != null && + this.ExpiresAt.Equals(input.ExpiresAt) + ) && + ( + this.Id == input.Id || + this.Id != null && + this.Id.Equals(input.Id) + ) && + ( + this.LineItems == input.LineItems || + this.LineItems != null && + input.LineItems != null && + this.LineItems.SequenceEqual(input.LineItems) + ) && + ( + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) + ) && + ( + this.MerchantOrderReference == input.MerchantOrderReference || + this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference) + ) && + ( + this.RecurringProcessingModel == input.RecurringProcessingModel || + this.RecurringProcessingModel != null && + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.ReturnUrl == input.ReturnUrl || + this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl) + ) && + ( + this.Reusable == input.Reusable || + this.Reusable != null && + this.Reusable.Equals(input.Reusable) + ) && + ( + this.RiskData == input.RiskData || + this.RiskData != null && + this.RiskData.Equals(input.RiskData) + ) && + ( + this.ShopperEmail == input.ShopperEmail || + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) + ) && + ( + this.ShopperLocale == input.ShopperLocale || + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) + ) && + ( + this.ShopperName == input.ShopperName || + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) + ) && + ( + this.ShopperReference == input.ShopperReference || + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) + ) && + ( + this.Splits == input.Splits || + this.Splits != null && + input.Splits != null && + this.Splits.SequenceEqual(input.Splits) + ) && + ( + this.Status == input.Status || + this.Status != null && + this.Status.Equals(input.Status) + ) && + ( + this.Store == input.Store || + this.Store != null && + this.Store.Equals(input.Store) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod != null && + this.StorePaymentMethod.Equals(input.StorePaymentMethod) + ) && + ( + this.Url == input.Url || + this.Url != null && + this.Url.Equals(input.Url) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AllowedPaymentMethods != null) + hashCode = hashCode * 59 + this.AllowedPaymentMethods.GetHashCode(); + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.ApplicationInfo != null) + hashCode = hashCode * 59 + this.ApplicationInfo.GetHashCode(); + if (this.BillingAddress != null) + hashCode = hashCode * 59 + this.BillingAddress.GetHashCode(); + if (this.BlockedPaymentMethods != null) + hashCode = hashCode * 59 + this.BlockedPaymentMethods.GetHashCode(); + if (this.CountryCode != null) + hashCode = hashCode * 59 + this.CountryCode.GetHashCode(); + if (this.DeliverAt != null) + hashCode = hashCode * 59 + this.DeliverAt.GetHashCode(); + if (this.DeliveryAddress != null) + hashCode = hashCode * 59 + this.DeliveryAddress.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.ExpiresAt != null) + hashCode = hashCode * 59 + this.ExpiresAt.GetHashCode(); + if (this.Id != null) + hashCode = hashCode * 59 + this.Id.GetHashCode(); + if (this.LineItems != null) + hashCode = hashCode * 59 + this.LineItems.GetHashCode(); + if (this.MerchantAccount != null) + hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.MerchantOrderReference != null) + hashCode = hashCode * 59 + this.MerchantOrderReference.GetHashCode(); + if (this.RecurringProcessingModel != null) + hashCode = hashCode * 59 + this.RecurringProcessingModel.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.ReturnUrl != null) + hashCode = hashCode * 59 + this.ReturnUrl.GetHashCode(); + if (this.Reusable != null) + hashCode = hashCode * 59 + this.Reusable.GetHashCode(); + if (this.RiskData != null) + hashCode = hashCode * 59 + this.RiskData.GetHashCode(); + if (this.ShopperEmail != null) + hashCode = hashCode * 59 + this.ShopperEmail.GetHashCode(); + if (this.ShopperLocale != null) + hashCode = hashCode * 59 + this.ShopperLocale.GetHashCode(); + if (this.ShopperName != null) + hashCode = hashCode * 59 + this.ShopperName.GetHashCode(); + if (this.ShopperReference != null) + hashCode = hashCode * 59 + this.ShopperReference.GetHashCode(); + if (this.Splits != null) + hashCode = hashCode * 59 + this.Splits.GetHashCode(); + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + if (this.Store != null) + hashCode = hashCode * 59 + this.Store.GetHashCode(); + if (this.StorePaymentMethod != null) + hashCode = hashCode * 59 + this.StorePaymentMethod.GetHashCode(); + if (this.Url != null) + hashCode = hashCode * 59 + this.Url.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentMethod.cs b/Adyen/Model/Checkout/PaymentMethod.cs index f0cc0455f..5419acdfb 100644 --- a/Adyen/Model/Checkout/PaymentMethod.cs +++ b/Adyen/Model/Checkout/PaymentMethod.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,7 +28,9 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { @@ -35,87 +38,115 @@ namespace Adyen.Model.Checkout /// PaymentMethod /// [DataContract] - public partial class PaymentMethod : IEquatable, IValidatableObject + public partial class PaymentMethod : IEquatable, IValidatableObject { + /// + /// The funding source of the payment method. + /// + /// The funding source of the payment method. + [JsonConverter(typeof(StringEnumConverter))] + public enum FundingSourceEnum + { + /// + /// Enum Debit for value: debit + /// + [EnumMember(Value = "debit")] Debit = 1 + } + + /// + /// The funding source of the payment method. + /// + /// The funding source of the payment method. + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } + /// /// Initializes a new instance of the class. /// - /// The configuration of the payment method.. - /// All input details to be provided to complete the payment with this payment method.. - /// The group where this payment method belongs to.. - /// The displayable name of this payment method.. - /// Echo data required to send in next calls.. - /// Indicates whether this payment method supports tokenization or not.. - /// The unique payment method code.. - /// List of card brands - public PaymentMethod(Dictionary Configuration = default(Dictionary), List Details = default(List), PaymentMethodGroup Group = default(PaymentMethodGroup), string Name = default(string), string PaymentMethodData = default(string), bool? SupportsRecurring = default(bool?), string Type = default(string), List Brands = default(List)) + /// Brand for the selected gift card. For example: plastix, hmclub.. + /// List of possible brands. For example: visa, mc.. + /// The configuration of the payment method.. + /// All input details to be provided to complete the payment with this payment method.. + /// The funding source of the payment method.. + /// group. + /// All input details to be provided to complete the payment with this payment method.. + /// The displayable name of this payment method.. + /// The unique payment method code.. + public PaymentMethod(string brand = default(string), List brands = default(List), + Dictionary configuration = default(Dictionary), + List details = default(List), + FundingSourceEnum? fundingSource = default(FundingSourceEnum?), + PaymentMethodGroup group = default(PaymentMethodGroup), + List inputDetails = default(List), string name = default(string), + string type = default(string)) { - this.Configuration = Configuration; - this.Details = Details; - this.Group = Group; - this.Name = Name; - this.PaymentMethodData = PaymentMethodData; - this.SupportsRecurring = SupportsRecurring; - this.Type = Type; - this.Brands = Brands; + this.Brand = brand; + this.Brands = brands; + this.Configuration = configuration; + this.Details = details; + this.FundingSource = fundingSource; + this.Group = group; + this.InputDetails = inputDetails; + this.Name = name; + this.Type = type; } - + + /// + /// Brand for the selected gift card. For example: plastix, hmclub. + /// + /// Brand for the selected gift card. For example: plastix, hmclub. + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } + + /// + /// List of possible brands. For example: visa, mc. + /// + /// List of possible brands. For example: visa, mc. + [DataMember(Name = "brands", EmitDefaultValue = false)] + public List Brands { get; set; } + /// /// The configuration of the payment method. /// /// The configuration of the payment method. - [DataMember(Name="configuration", EmitDefaultValue=false)] + [DataMember(Name = "configuration", EmitDefaultValue = false)] public Dictionary Configuration { get; set; } /// /// All input details to be provided to complete the payment with this payment method. /// /// All input details to be provided to complete the payment with this payment method. - [DataMember(Name="details", EmitDefaultValue=false)] + [DataMember(Name = "details", EmitDefaultValue = false)] public List Details { get; set; } - /// - /// The group where this payment method belongs to. - /// - /// The group where this payment method belongs to. - [DataMember(Name="group", EmitDefaultValue=false)] - public PaymentMethodGroup Group { get; set; } /// - /// The displayable name of this payment method. + /// Gets or Sets Group /// - /// The displayable name of this payment method. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } + [DataMember(Name = "group", EmitDefaultValue = false)] + public PaymentMethodGroup Group { get; set; } /// - /// Echo data required to send in next calls. + /// All input details to be provided to complete the payment with this payment method. /// - /// Echo data required to send in next calls. - [DataMember(Name="paymentMethodData", EmitDefaultValue=false)] - public string PaymentMethodData { get; set; } + /// All input details to be provided to complete the payment with this payment method. + [DataMember(Name = "inputDetails", EmitDefaultValue = false)] + public List InputDetails { get; set; } /// - /// Indicates whether this payment method supports tokenization or not. + /// The displayable name of this payment method. /// - /// Indicates whether this payment method supports tokenization or not. - [DataMember(Name="supportsRecurring", EmitDefaultValue=false)] - public bool? SupportsRecurring { get; set; } + /// The displayable name of this payment method. + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// The unique payment method code. /// /// The unique payment method code. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } - /// - /// List of brand codes - /// - /// The unique payment method code. - [DataMember(Name = "brands", EmitDefaultValue = false)] - public List Brands { get; set; } - /// /// Returns the string presentation of the object /// @@ -124,23 +155,24 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PaymentMethod {\n"); - sb.Append(" Configuration: ").Append(Configuration).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" Brand: ").Append(Brand).Append("\n"); + sb.Append(" Brands: ").Append(Brands.ToListString()).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration.ToCollectionsString()).Append("\n"); + sb.Append(" Details: ").Append(Details.ObjectListToString()).Append("\n"); + sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Group: ").Append(Group).Append("\n"); + sb.Append(" InputDetails: ").Append(InputDetails.ObjectListToString()).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PaymentMethodData: ").Append(PaymentMethodData).Append("\n"); - sb.Append(" SupportsRecurring: ").Append(SupportsRecurring).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Brands: ").Append(Brands).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); } @@ -165,46 +197,55 @@ public bool Equals(PaymentMethod input) if (input == null) return false; - return + return + ( + this.Brand == input.Brand || + this.Brand != null && + this.Brand.Equals(input.Brand) + ) && + ( + this.Brands == input.Brands || + this.Brands != null && + input.Brands != null && + this.Brands.SequenceEqual(input.Brands) + ) && ( this.Configuration == input.Configuration || this.Configuration != null && + input.Configuration != null && this.Configuration.SequenceEqual(input.Configuration) - ) && + ) && ( this.Details == input.Details || this.Details != null && + input.Details != null && this.Details.SequenceEqual(input.Details) - ) && - ( - this.Group == input.Group || - (this.Group != null && - this.Group.Equals(input.Group)) - ) && + ) && ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && + this.FundingSource == input.FundingSource || + this.FundingSource != null && + this.FundingSource.Equals(input.FundingSource) + ) && ( - this.PaymentMethodData == input.PaymentMethodData || - (this.PaymentMethodData != null && - this.PaymentMethodData.Equals(input.PaymentMethodData)) - ) && + this.Group == input.Group || + this.Group != null && + this.Group.Equals(input.Group) + ) && ( - this.SupportsRecurring == input.SupportsRecurring || - (this.SupportsRecurring != null && - this.SupportsRecurring.Equals(input.SupportsRecurring)) - ) && + this.InputDetails == input.InputDetails || + this.InputDetails != null && + input.InputDetails != null && + this.InputDetails.SequenceEqual(input.InputDetails) + ) && ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.Name == input.Name || + this.Name != null && + this.Name.Equals(input.Name) ) && ( - this.Brands == input.Brands || - (this.Brands != null && - this.Brands.Equals(input.Brands)) + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type) ); } @@ -217,22 +258,24 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Brand != null) + hashCode = hashCode * 59 + this.Brand.GetHashCode(); + if (this.Brands != null) + hashCode = hashCode * 59 + this.Brands.GetHashCode(); if (this.Configuration != null) hashCode = hashCode * 59 + this.Configuration.GetHashCode(); if (this.Details != null) hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.FundingSource != null) + hashCode = hashCode * 59 + this.FundingSource.GetHashCode(); if (this.Group != null) hashCode = hashCode * 59 + this.Group.GetHashCode(); + if (this.InputDetails != null) + hashCode = hashCode * 59 + this.InputDetails.GetHashCode(); if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.PaymentMethodData != null) - hashCode = hashCode * 59 + this.PaymentMethodData.GetHashCode(); - if (this.SupportsRecurring != null) - hashCode = hashCode * 59 + this.SupportsRecurring.GetHashCode(); if (this.Type != null) hashCode = hashCode * 59 + this.Type.GetHashCode(); - if (this.Brands != null) - hashCode = hashCode * 59 + this.Brands.GetHashCode(); return hashCode; } } @@ -242,10 +285,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentMethodGroup.cs b/Adyen/Model/Checkout/PaymentMethodGroup.cs index f4955efdb..ddbe2a25b 100644 --- a/Adyen/Model/Checkout/PaymentMethodGroup.cs +++ b/Adyen/Model/Checkout/PaymentMethodGroup.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,40 +35,41 @@ namespace Adyen.Model.Checkout /// PaymentMethodGroup /// [DataContract] - public partial class PaymentMethodGroup : IEquatable, IValidatableObject + public partial class PaymentMethodGroup : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The name of the group.. - /// Echo data to be used if the payment method is displayed as part of this group.. - /// The unique code of the group.. - public PaymentMethodGroup(string Name = default(string), string PaymentMethodData = default(string), string Type = default(string)) + /// The name of the group.. + /// Echo data to be used if the payment method is displayed as part of this group.. + /// The unique code of the group.. + public PaymentMethodGroup(string name = default(string), string paymentMethodData = default(string), + string type = default(string)) { - this.Name = Name; - this.PaymentMethodData = PaymentMethodData; - this.Type = Type; + this.Name = name; + this.PaymentMethodData = paymentMethodData; + this.Type = type; } - + /// /// The name of the group. /// /// The name of the group. - [DataMember(Name="name", EmitDefaultValue=false)] + [DataMember(Name = "name", EmitDefaultValue = false)] public string Name { get; set; } /// /// Echo data to be used if the payment method is displayed as part of this group. /// /// Echo data to be used if the payment method is displayed as part of this group. - [DataMember(Name="paymentMethodData", EmitDefaultValue=false)] + [DataMember(Name = "paymentMethodData", EmitDefaultValue = false)] public string PaymentMethodData { get; set; } /// /// The unique code of the group. /// /// The unique code of the group. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } /// @@ -84,12 +86,12 @@ public override string ToString() 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); } @@ -114,21 +116,21 @@ public bool Equals(PaymentMethodGroup input) if (input == null) return false; - return + return ( this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && + this.Name != null && + this.Name.Equals(input.Name) + ) && ( this.PaymentMethodData == input.PaymentMethodData || - (this.PaymentMethodData != null && - this.PaymentMethodData.Equals(input.PaymentMethodData)) - ) && + this.PaymentMethodData != null && + this.PaymentMethodData.Equals(input.PaymentMethodData) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.Type != null && + this.Type.Equals(input.Type) ); } @@ -156,10 +158,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentMethodsGroup.cs b/Adyen/Model/Checkout/PaymentMethodsGroup.cs deleted file mode 100644 index f6c4b168a..000000000 --- a/Adyen/Model/Checkout/PaymentMethodsGroup.cs +++ /dev/null @@ -1,166 +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.Checkout -{ - /// - /// PaymentMethodsGroup - /// - [DataContract] - public partial class PaymentMethodsGroup : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// The type to submit for any payment method in this group.. - /// The human-readable name of this group.. - /// The types of payment methods that belong in this group.. - public PaymentMethodsGroup(string GroupType = default(string), string Name = default(string), List Types = default(List)) - { - this.GroupType = GroupType; - this.Name = Name; - this.Types = Types; - } - - /// - /// The type to submit for any payment method in this group. - /// - /// The type to submit for any payment method in this group. - [DataMember(Name="groupType", EmitDefaultValue=false)] - public string GroupType { get; set; } - - /// - /// The human-readable name of this group. - /// - /// The human-readable name of this group. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// The types of payment methods that belong in this group. - /// - /// The types of payment methods that belong in this group. - [DataMember(Name="types", EmitDefaultValue=false)] - public List Types { 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 PaymentMethodsGroup {\n"); - sb.Append(" GroupType: ").Append(GroupType).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" Types: ").Append(Types).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 input) - { - return this.Equals(input as PaymentMethodsGroup); - } - - /// - /// Returns true if PaymentMethodsGroup instances are equal - /// - /// Instance of PaymentMethodsGroup to be compared - /// Boolean - public bool Equals(PaymentMethodsGroup input) - { - if (input == null) - return false; - - return - ( - this.GroupType == input.GroupType || - (this.GroupType != null && - this.GroupType.Equals(input.GroupType)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Types == input.Types || - this.Types != null && - this.Types.SequenceEqual(input.Types) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.GroupType != null) - hashCode = hashCode * 59 + this.GroupType.GetHashCode(); - if (this.Name != null) - hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.Types != null) - hashCode = hashCode * 59 + this.Types.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/PaymentMethodsRequest.cs b/Adyen/Model/Checkout/PaymentMethodsRequest.cs index 4fbfd9f0e..9ce476b7a 100644 --- a/Adyen/Model/Checkout/PaymentMethodsRequest.cs +++ b/Adyen/Model/Checkout/PaymentMethodsRequest.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -28,6 +29,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -49,46 +51,55 @@ public enum ChannelEnum /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] - IOS = 1, + [EnumMember(Value = "iOS")] IOS = 1, + /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] - Android = 2, + [EnumMember(Value = "Android")] Android = 2, + /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] - Web = 3 + [EnumMember(Value = "Web")] Web = 3 } + /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web /// /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web [DataMember(Name = "channel", EmitDefaultValue = false)] public ChannelEnum? Channel { get; set; } + /// /// Initializes a new instance of the class. /// /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods).. + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`. /// amount. - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods).. + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`. /// The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web. /// The shopper's country code.. - /// Choose if a specific transaction should use the Real-time Account Updater, regardless of other settings.. /// The merchant account identifier, with which you want to process the transaction. (required). + /// order. /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation.. - /// The physical store, for which this payment is processed. - public PaymentMethodsRequest(Dictionary additionalData = default(Dictionary), List allowedPaymentMethods = default(List), Amount amount = default(Amount), List blockedPaymentMethods = default(List), ChannelEnum? channel = default(ChannelEnum?), string countryCode = default(string), bool? enableRealTimeUpdate = default(bool?), string merchantAccount = default(string), string shopperLocale = default(string), string shopperReference = default(string), string store = default(string), bool? threeDSAuthenticationOnly = default(bool?)) + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments.. + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false). + /// The physical store, for which this payment is processed.. + public PaymentMethodsRequest( + Dictionary additionalData = default(Dictionary), + List allowedPaymentMethods = default(List), Amount amount = default(Amount), + List blockedPaymentMethods = default(List), ChannelEnum? channel = default(ChannelEnum?), + string countryCode = default(string), string merchantAccount = default(string), + CheckoutOrder order = default(CheckoutOrder), string shopperLocale = default(string), + string shopperReference = default(string), bool? splitCardFundingSources = false, + string store = default(string)) { // to ensure "merchantAccount" is required (not null) if (merchantAccount == null) { - throw new InvalidDataException("merchantAccount is a required property for PaymentMethodsRequest and cannot be null"); + throw new InvalidDataException( + "merchantAccount is a required property for PaymentMethodsRequest and cannot be null"); } else { @@ -100,11 +111,19 @@ public enum ChannelEnum this.BlockedPaymentMethods = blockedPaymentMethods; this.Channel = channel; this.CountryCode = countryCode; - this.EnableRealTimeUpdate = enableRealTimeUpdate; + this.Order = order; this.ShopperLocale = shopperLocale; this.ShopperReference = shopperReference; + // use default value if no "splitCardFundingSources" provided + if (splitCardFundingSources == null) + { + this.SplitCardFundingSources = false; + } + else + { + this.SplitCardFundingSources = splitCardFundingSources; + } this.Store = store; - this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; } /// @@ -115,9 +134,9 @@ public enum ChannelEnum public Dictionary AdditionalData { get; set; } /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] public List AllowedPaymentMethods { get; set; } @@ -128,9 +147,9 @@ public enum ChannelEnum public Amount Amount { get; set; } /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type` from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] public List BlockedPaymentMethods { get; set; } @@ -142,13 +161,6 @@ public enum ChannelEnum [DataMember(Name = "countryCode", EmitDefaultValue = false)] public string CountryCode { get; set; } - /// - /// Choose if a specific transaction should use the Real-time Account Updater, regardless of other settings. - /// - /// Choose if a specific transaction should use the Real-time Account Updater, regardless of other settings. - [DataMember(Name = "enableRealTimeUpdate", EmitDefaultValue = false)] - public bool? EnableRealTimeUpdate { get; set; } - /// /// The merchant account identifier, with which you want to process the transaction. /// @@ -156,6 +168,12 @@ public enum ChannelEnum [DataMember(Name = "merchantAccount", EmitDefaultValue = false)] public string MerchantAccount { get; set; } + /// + /// Gets or Sets Order + /// + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrder Order { get; set; } + /// /// The combination of a language code and a country code to specify the language to be used in the payment. /// @@ -164,12 +182,19 @@ public enum ChannelEnum public string ShopperLocale { get; set; } /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. [DataMember(Name = "shopperReference", EmitDefaultValue = false)] public string ShopperReference { get; set; } + /// + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. + /// + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool? SplitCardFundingSources { get; set; } + /// /// The physical store, for which this payment is processed. /// @@ -177,13 +202,6 @@ public enum ChannelEnum [DataMember(Name = "store", EmitDefaultValue = false)] public string Store { get; set; } - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - public bool? ThreeDSAuthenticationOnly { get; set; } - /// /// Returns the string presentation of the object /// @@ -192,18 +210,18 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PaymentMethodsRequest {\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods.ToListString()).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); - sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); + sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods.ToListString()).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); - sb.Append(" EnableRealTimeUpdate: ").Append(EnableRealTimeUpdate).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); + sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" ShopperLocale: ").Append(ShopperLocale).Append("\n"); sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); + sb.Append(" SplitCardFundingSources: ").Append(SplitCardFundingSources).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); - sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -241,7 +259,6 @@ public bool Equals(PaymentMethodsRequest input) ( this.AdditionalData == input.AdditionalData || this.AdditionalData != null && - input.AdditionalData != null && this.AdditionalData.Equals(input.AdditionalData) ) && ( @@ -252,8 +269,8 @@ public bool Equals(PaymentMethodsRequest input) ) && ( this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) + this.Amount != null && + this.Amount.Equals(input.Amount) ) && ( this.BlockedPaymentMethods == input.BlockedPaymentMethods || @@ -263,43 +280,43 @@ public bool Equals(PaymentMethodsRequest input) ) && ( this.Channel == input.Channel || - (this.Channel != null && - this.Channel.Equals(input.Channel)) + this.Channel != null && + this.Channel.Equals(input.Channel) ) && ( this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) ) && ( - this.EnableRealTimeUpdate == input.EnableRealTimeUpdate || - (this.EnableRealTimeUpdate != null && - this.EnableRealTimeUpdate.Equals(input.EnableRealTimeUpdate)) + this.MerchantAccount == input.MerchantAccount || + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) ) && ( - this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) + this.Order == input.Order || + this.Order != null && + this.Order.Equals(input.Order) ) && ( this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) ) && ( this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) ) && ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) + this.SplitCardFundingSources == input.SplitCardFundingSources || + this.SplitCardFundingSources != null && + this.SplitCardFundingSources.Equals(input.SplitCardFundingSources) ) && ( - this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - (this.ThreeDSAuthenticationOnly != null && - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly)) + this.Store == input.Store || + this.Store != null && + this.Store.Equals(input.Store) ); } @@ -324,18 +341,18 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Channel.GetHashCode(); if (this.CountryCode != null) hashCode = hashCode * 59 + this.CountryCode.GetHashCode(); - if (this.EnableRealTimeUpdate != null) - hashCode = hashCode * 59 + this.EnableRealTimeUpdate.GetHashCode(); if (this.MerchantAccount != null) hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); + if (this.Order != null) + hashCode = hashCode * 59 + this.Order.GetHashCode(); if (this.ShopperLocale != null) hashCode = hashCode * 59 + this.ShopperLocale.GetHashCode(); if (this.ShopperReference != null) hashCode = hashCode * 59 + this.ShopperReference.GetHashCode(); + if (this.SplitCardFundingSources != null) + hashCode = hashCode * 59 + this.SplitCardFundingSources.GetHashCode(); if (this.Store != null) hashCode = hashCode * 59 + this.Store.GetHashCode(); - if (this.ThreeDSAuthenticationOnly != null) - hashCode = hashCode * 59 + this.ThreeDSAuthenticationOnly.GetHashCode(); return hashCode; } } @@ -345,10 +362,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentMethodsResponse.cs b/Adyen/Model/Checkout/PaymentMethodsResponse.cs index cd4db1b33..744d4c083 100644 --- a/Adyen/Model/Checkout/PaymentMethodsResponse.cs +++ b/Adyen/Model/Checkout/PaymentMethodsResponse.cs @@ -1,33 +1,35 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Linq; -using System.Text; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; namespace Adyen.Model.Checkout { @@ -40,32 +42,15 @@ public partial class PaymentMethodsResponse : IEquatable /// /// Initializes a new instance of the class. /// - /// Groups of payment methods.. - /// Detailed list of one-click payment methods.. /// Detailed list of payment methods required to generate payment forms.. /// List of all stored payment methods.. - public PaymentMethodsResponse(List groups = default(List), List oneClickPaymentMethods = default(List), List paymentMethods = default(List), List storedPaymentMethods = default(List)) + public PaymentMethodsResponse(List paymentMethods = default(List), + List storedPaymentMethods = default(List)) { - this.Groups = groups; - this.OneClickPaymentMethods = oneClickPaymentMethods; this.PaymentMethods = paymentMethods; this.StoredPaymentMethods = storedPaymentMethods; } - /// - /// Groups of payment methods. - /// - /// Groups of payment methods. - [DataMember(Name = "groups", EmitDefaultValue = false)] - public List Groups { get; set; } - - /// - /// Detailed list of one-click payment methods. - /// - /// Detailed list of one-click payment methods. - [DataMember(Name = "oneClickPaymentMethods", EmitDefaultValue = false)] - public List OneClickPaymentMethods { get; set; } - /// /// Detailed list of payment methods required to generate payment forms. /// @@ -88,10 +73,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PaymentMethodsResponse {\n"); - sb.Append(" Groups: ").Append(Groups).Append("\n"); - sb.Append(" OneClickPaymentMethods: ").Append(OneClickPaymentMethods).Append("\n"); - sb.Append(" PaymentMethods: ").Append(PaymentMethods).Append("\n"); - sb.Append(" StoredPaymentMethods: ").Append(StoredPaymentMethods).Append("\n"); + sb.Append(" PaymentMethods: ").Append(PaymentMethods.ObjectListToString()).Append("\n"); + sb.Append(" StoredPaymentMethods: ").Append(StoredPaymentMethods.ObjectListToString()).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -126,18 +109,6 @@ public bool Equals(PaymentMethodsResponse input) return false; return - ( - this.Groups == input.Groups || - this.Groups != null && - input.Groups != null && - this.Groups.SequenceEqual(input.Groups) - ) && - ( - this.OneClickPaymentMethods == input.OneClickPaymentMethods || - this.OneClickPaymentMethods != null && - input.OneClickPaymentMethods != null && - this.OneClickPaymentMethods.SequenceEqual(input.OneClickPaymentMethods) - ) && ( this.PaymentMethods == input.PaymentMethods || this.PaymentMethods != null && @@ -161,10 +132,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.Groups != null) - hashCode = hashCode * 59 + this.Groups.GetHashCode(); - if (this.OneClickPaymentMethods != null) - hashCode = hashCode * 59 + this.OneClickPaymentMethods.GetHashCode(); if (this.PaymentMethods != null) hashCode = hashCode * 59 + this.PaymentMethods.GetHashCode(); if (this.StoredPaymentMethods != null) @@ -178,9 +145,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentRequest.cs b/Adyen/Model/Checkout/PaymentRequest.cs index a65e50514..743b2b80a 100644 --- a/Adyen/Model/Checkout/PaymentRequest.cs +++ b/Adyen/Model/Checkout/PaymentRequest.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -29,9 +30,11 @@ using System.Runtime.Serialization; using System.Text; using Adyen.Constants; +using Adyen.Model.ApplicationInformation; +using Adyen.Model.Checkout.Details; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Adyen.Model.ApplicationInformation; namespace Adyen.Model.Checkout { @@ -48,24 +51,20 @@ public partial class PaymentRequest : IEquatable, IValidatableOb [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { - /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] - IOS = 1, + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] - Android = 2, + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] - Web = 3 + [EnumMember(Value = "Web")] Web = 3 } /// @@ -74,6 +73,7 @@ public enum ChannelEnum /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web [DataMember(Name = "channel", EmitDefaultValue = false)] public ChannelEnum? Channel { get; set; } + /// /// The type of the entity the payment is processed for. /// @@ -81,18 +81,15 @@ public enum ChannelEnum [JsonConverter(typeof(StringEnumConverter))] public enum EntityTypeEnum { - /// /// Enum NaturalPerson for value: NaturalPerson /// - [EnumMember(Value = "NaturalPerson")] - NaturalPerson = 1, + [EnumMember(Value = "NaturalPerson")] NaturalPerson = 1, /// /// Enum CompanyName for value: CompanyName /// - [EnumMember(Value = "CompanyName")] - CompanyName = 2 + [EnumMember(Value = "CompanyName")] CompanyName = 2 } /// @@ -101,39 +98,37 @@ public enum EntityTypeEnum /// The type of the entity the payment is processed for. [DataMember(Name = "entityType", EmitDefaultValue = false)] public EntityTypeEnum? EntityType { get; set; } + /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – Transaction that occurs on a non-fixed schedule using stored card details. For example, automatic top-ups when the cardholder's balance drops below certain amount. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – Transaction that occurs on a non-fixed schedule using stored card details. For example, automatic top-ups when the cardholder's balance drops below certain amount. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. [JsonConverter(typeof(StringEnumConverter))] public enum RecurringProcessingModelEnum { - /// /// Enum CardOnFile for value: CardOnFile /// - [EnumMember(Value = "CardOnFile")] - CardOnFile = 1, + [EnumMember(Value = "CardOnFile")] CardOnFile = 1, /// /// Enum Subscription for value: Subscription /// - [EnumMember(Value = "Subscription")] - Subscription = 2, + [EnumMember(Value = "Subscription")] Subscription = 2, /// - /// Enum Subscription for value: UnscheduledCardOnFile + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile /// - [EnumMember(Value = "UnscheduledCardOnFile")] - UnscheduledCardOnFile = 3 + [EnumMember(Value = "UnscheduledCardOnFile")] UnscheduledCardOnFile = 3 } /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } + /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// @@ -141,30 +136,25 @@ public enum RecurringProcessingModelEnum [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { - /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] - Ecommerce = 1, + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] - ContAuth = 2, + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] - Moto = 3, + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] - POS = 4 + [EnumMember(Value = "POS")] POS = 4 } /// @@ -185,242 +175,243 @@ public PaymentRequest() /// /// Initializes a new instance of the class. /// - /// Shopper account information for 3D Secure 2.0.. - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. . - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).. - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview).. - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). (required). - /// Application information.. - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request.. - /// The address where to send the invoice.. - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview).. - /// The shopper's browser information.. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request.. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. - /// Information regarding the company. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The forex quote as returned in the response of the forex service.. - /// The address where the purchased goods should be delivered.. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting).. - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.. - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. - /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.. - /// The type of the entity the payment is processed for.. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments).. - /// Line items regarding the payment.. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// Additional risk fields for 3D Secure 2.0.. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\". - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa).. - /// The two-character country code of the shopper's nationality.. - /// The order reference to link multiple partial payments.. - /// Required for the 3DS2.0 Web integration. - /// The collection that contains the type of the payment method and its specific information (e.g. `idealIssuer`). (required). - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments).. - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction.. - /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. - /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). - /// The URL to return to. (required). - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card.. - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail.. - /// A session ID used to identify a payment session.. - /// The maximum validity of the session.. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.. - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// The shopper's full name and gender (if specified).. - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.. - /// The text to appear on the shopper's bank statement.. - /// The shopper's social security number.. - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts.. + /// accountInfo. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// browserInfo. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. + /// company. + /// Conversion ID that corresponds to the Id generated for tracking user payment journey.. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE. + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// dccQuote. + /// deliveryAddress. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.. + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. + /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.. + /// The type of the entity the payment is processed for.. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// installments. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip.. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// merchantRiskIndicator. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\".. + /// mpiData. + /// order. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from.. + /// The type and required details of a payment method to use. (required). + /// 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.. + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. . + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer.. + /// Specifies the redirect method (GET or POST) when redirecting to the issuer.. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` (required). + /// riskData. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments.. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string.. + /// The shopper's social security number.. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information).. + /// The physical store, for which this payment is processed.. /// When true and `shopperReference` is provided, the payment details will be stored.. - /// The physical store, for which this payment is processed.. - /// The shopper's telephone number.. - /// Request fields for 3D Secure 2.0.. - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available).. - /// Set to true if the payment should be routed to a trusted MID.. - public PaymentRequest(AccountInfo AccountInfo = default(AccountInfo), Amount AdditionalAmount = default(Amount), Dictionary AdditionalData = default(Dictionary), List AllowedPaymentMethods = default(List), Amount Amount = default(Amount), BankAccount BankAccount = default(BankAccount), Address BillingAddress = default(Address), List BlockedPaymentMethods = default(List), BrowserInfo BrowserInfo = default(BrowserInfo), int? CaptureDelayHours = default(int?), Card Card = default(Card), ChannelEnum? Channel = default(ChannelEnum?), Company Company = default(Company), string CountryCode = default(string), DateTime? DateOfBirth = default(DateTime?), ForexQuote DccQuote = default(ForexQuote), Address DeliveryAddress = default(Address), DateTime? DeliveryDate = default(DateTime?), string DeviceFingerprint = default(string), 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), string MerchantAccount = default(string), string MerchantOrderReference = default(string), MerchantRiskIndicator MerchantRiskIndicator = default(MerchantRiskIndicator), Dictionary Metadata = default(Dictionary), ThreeDSecureData MpiData = default(ThreeDSecureData), CheckoutOrder order = default(CheckoutOrder), string Nationality = default(string), string OrderReference = default(string), DefaultPaymentMethodDetails PaymentMethod = default(DefaultPaymentMethodDetails), Recurring Recurring = default(Recurring), RecurringProcessingModelEnum? RecurringProcessingModel = default(RecurringProcessingModelEnum?), string RedirectFromIssuerMethod = default(string), string RedirectToIssuerMethod = default(string), string Reference = default(string), string ReturnUrl = default(string), RiskData RiskData = default(RiskData), string SelectedBrand = default(string), string SelectedRecurringDetailReference = default(string), string SessionId = default(string), string SessionValidity = default(string), string ShopperEmail = default(string), string ShopperIP = default(string), ShopperInteractionEnum? ShopperInteraction = default(ShopperInteractionEnum?), string ShopperLocale = default(string), Name ShopperName = default(Name), string ShopperReference = default(string), string ShopperStatement = default(string), string SocialSecurityNumber = default(string), List Splits = default(List), bool? storePaymentMethod = default(bool?), string Store = default(string), string TelephoneNumber = default(string), ThreeDS2RequestData ThreeDS2RequestData = default(ThreeDS2RequestData), string TotalsGroup = default(string), bool? TrustedShopper = default(bool?)) + /// The shopper's telephone number.. + /// threeDS2RequestData. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). + /// Set to true if the payment should be routed to a trusted MID.. + public PaymentRequest(AccountInfo accountInfo = default(AccountInfo), + Dictionary additionalData = default(Dictionary), + Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), + Address billingAddress = default(Address), BrowserInfo browserInfo = default(BrowserInfo), + int? captureDelayHours = default(int?), ChannelEnum? channel = default(ChannelEnum?), + Company company = default(Company), string conversionId = default(string), + string countryCode = default(string), DateTime? dateOfBirth = default(DateTime?), + ForexQuote dccQuote = default(ForexQuote), Address deliveryAddress = default(Address), + DateTime? deliveryDate = default(DateTime?), string deviceFingerprint = default(string), + 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), + string merchantAccount = default(string), string merchantOrderReference = default(string), + MerchantRiskIndicator merchantRiskIndicator = default(MerchantRiskIndicator), + Dictionary metadata = default(Dictionary), + ThreeDSecureData mpiData = default(ThreeDSecureData), CheckoutOrder order = default(CheckoutOrder), + string orderReference = default(string), string origin = default(string), + DefaultPaymentMethodDetails paymentMethod = default(DefaultPaymentMethodDetails), + string recurringExpiry = default(string), string recurringFrequency = default(string), + RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), + string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), + string reference = default(string), string returnUrl = default(string), + RiskData riskData = default(RiskData), string sessionValidity = default(string), + string shopperEmail = default(string), string shopperIP = default(string), + ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), + string shopperLocale = default(string), Name shopperName = default(Name), + string shopperReference = default(string), string shopperStatement = default(string), + string socialSecurityNumber = default(string), List splits = default(List), + string store = default(string), bool? storePaymentMethod = default(bool?), + string telephoneNumber = default(string), + ThreeDS2RequestData threeDS2RequestData = default(ThreeDS2RequestData), + bool? threeDSAuthenticationOnly = false, bool? trustedShopper = default(bool?)) { CreateApplicationInfo(); - // to ensure "Amount" is required (not null) - if (Amount == null) + // to ensure "amount" is required (not null) + if (amount == null) { - throw new InvalidDataException("Amount is a required property for PaymentRequest and cannot be null"); + throw new InvalidDataException("amount is a required property for PaymentRequest and cannot be null"); } else { - this.Amount = Amount; + this.Amount = amount; } - // to ensure "MerchantAccount" is required (not null) - if (MerchantAccount == null) + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) { - throw new InvalidDataException("MerchantAccount is a required property for PaymentRequest and cannot be null"); + throw new InvalidDataException( + "merchantAccount is a required property for PaymentRequest and cannot be null"); } else { - this.MerchantAccount = MerchantAccount; + this.MerchantAccount = merchantAccount; } - // to ensure "PaymentMethod" is required (not null) - if (PaymentMethod == null) + // to ensure "paymentMethod" is required (not null) + if (paymentMethod == null) { - throw new InvalidDataException("PaymentMethod is a required property for PaymentRequest and cannot be null"); + throw new InvalidDataException( + "paymentMethod is a required property for PaymentRequest and cannot be null"); } else { - this.PaymentMethod = PaymentMethod; + this.PaymentMethod = paymentMethod; } - // to ensure "Reference" is required (not null) - if (Reference == null) + // to ensure "reference" is required (not null) + if (reference == null) { - throw new InvalidDataException("Reference is a required property for PaymentRequest and cannot be null"); + throw new InvalidDataException( + "reference is a required property for PaymentRequest and cannot be null"); } else { - this.Reference = Reference; + this.Reference = reference; } - // to ensure "ReturnUrl" is required (not null) - if (ReturnUrl == null) + // to ensure "returnUrl" is required (not null) + if (returnUrl == null) { - throw new InvalidDataException("ReturnUrl is a required property for PaymentRequest and cannot be null"); + throw new InvalidDataException( + "returnUrl is a required property for PaymentRequest and cannot be null"); } else { - this.ReturnUrl = ReturnUrl; + this.ReturnUrl = returnUrl; } - this.AccountInfo = AccountInfo; - this.AdditionalAmount = AdditionalAmount; - this.AdditionalData = AdditionalData; - this.AllowedPaymentMethods = AllowedPaymentMethods; - this.BankAccount = BankAccount; - this.BillingAddress = BillingAddress; - this.BlockedPaymentMethods = BlockedPaymentMethods; - this.BrowserInfo = BrowserInfo; - this.CaptureDelayHours = CaptureDelayHours; - this.Card = Card; - this.Channel = Channel; - this.Company = Company; - this.CountryCode = CountryCode; - this.DateOfBirth = DateOfBirth; - this.DccQuote = DccQuote; - this.DeliveryAddress = DeliveryAddress; - this.DeliveryDate = DeliveryDate; - this.DeviceFingerprint = DeviceFingerprint; - this.EnableOneClick = EnableOneClick; - this.EnablePayOut = EnablePayOut; - this.EnableRecurring = EnableRecurring; - this.EntityType = EntityType; - this.FraudOffset = FraudOffset; - this.Installments = Installments; - this.LineItems = LineItems; - this.Mcc = Mcc; - this.MerchantOrderReference = MerchantOrderReference; - this.MerchantRiskIndicator = MerchantRiskIndicator; - this.Metadata = Metadata; - this.MpiData = MpiData; + this.AccountInfo = accountInfo; + this.AdditionalData = additionalData; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BrowserInfo = browserInfo; + this.CaptureDelayHours = captureDelayHours; + this.Channel = channel; + this.Company = company; + this.ConversionId = conversionId; + this.CountryCode = countryCode; + this.DateOfBirth = dateOfBirth; + this.DccQuote = dccQuote; + this.DeliveryAddress = deliveryAddress; + this.DeliveryDate = deliveryDate; + this.DeviceFingerprint = deviceFingerprint; + this.EnableOneClick = enableOneClick; + this.EnablePayOut = enablePayOut; + this.EnableRecurring = enableRecurring; + this.EntityType = entityType; + this.FraudOffset = fraudOffset; + this.Installments = installments; + this.LineItems = lineItems; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.MerchantRiskIndicator = merchantRiskIndicator; + this.Metadata = metadata; + this.MpiData = mpiData; this.Order = order; - this.OrderReference = OrderReference; - this.Origin = Origin; - this.Recurring = Recurring; - this.RecurringProcessingModel = RecurringProcessingModel; - this.RedirectFromIssuerMethod = RedirectFromIssuerMethod; - this.RedirectToIssuerMethod = RedirectToIssuerMethod; - this.RiskData = RiskData; - this.SelectedBrand = SelectedBrand; - this.SelectedRecurringDetailReference = SelectedRecurringDetailReference; - this.SessionId = SessionId; - this.SessionValidity = SessionValidity; - this.ShopperEmail = ShopperEmail; - this.ShopperIP = ShopperIP; - this.ShopperInteraction = ShopperInteraction; - this.ShopperLocale = ShopperLocale; - this.ShopperName = ShopperName; - this.ShopperReference = ShopperReference; - this.ShopperStatement = ShopperStatement; - this.SocialSecurityNumber = SocialSecurityNumber; - this.Splits = Splits; + this.OrderReference = orderReference; + this.Origin = origin; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.RecurringProcessingModel = recurringProcessingModel; + this.RedirectFromIssuerMethod = redirectFromIssuerMethod; + this.RedirectToIssuerMethod = redirectToIssuerMethod; + this.RiskData = riskData; + this.SessionValidity = sessionValidity; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.SocialSecurityNumber = socialSecurityNumber; + this.Splits = splits; + this.Store = store; this.StorePaymentMethod = storePaymentMethod; - this.Store = Store; - this.TelephoneNumber = TelephoneNumber; - this.ThreeDS2RequestData = ThreeDS2RequestData; - this.TotalsGroup = TotalsGroup; - this.TrustedShopper = TrustedShopper; + this.TelephoneNumber = telephoneNumber; + this.ThreeDS2RequestData = threeDS2RequestData; + // use default value if no "threeDSAuthenticationOnly" provided + if (threeDSAuthenticationOnly == null) + { + this.ThreeDSAuthenticationOnly = false; + } + else + { + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + } + this.TrustedShopper = trustedShopper; } /// - /// Shopper account information for 3D Secure 2.0. + /// Gets or Sets AccountInfo /// - /// Shopper account information for 3D Secure 2.0. [DataMember(Name = "accountInfo", EmitDefaultValue = false)] public AccountInfo AccountInfo { get; set; } /// - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. - /// - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } - - /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata). + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata). + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. [DataMember(Name = "additionalData", EmitDefaultValue = false)] public Dictionary AdditionalData { get; set; } /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// Gets or Sets Amount /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). - [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] - public List AllowedPaymentMethods { get; set; } - - /// - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). - /// - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). [DataMember(Name = "amount", EmitDefaultValue = false)] public Amount Amount { get; set; } /// - /// Application information. + /// Gets or Sets ApplicationInfo /// - /// Application information. [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInfo ApplicationInfo { get; private set; } + public ApplicationInfo ApplicationInfo { get; set; } /// - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request. + /// Gets or Sets BillingAddress /// - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request. - [DataMember(Name = "bankAccount", EmitDefaultValue = false)] - public BankAccount BankAccount { get; set; } - - /// - /// The address where to send the invoice. - /// - /// The address where to send the invoice. [DataMember(Name = "billingAddress", EmitDefaultValue = false)] public Address BillingAddress { get; set; } /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// Gets or Sets BrowserInfo /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). - [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] - public List BlockedPaymentMethods { get; set; } - - /// - /// The shopper's browser information. - /// - /// The shopper's browser information. [DataMember(Name = "browserInfo", EmitDefaultValue = false)] public BrowserInfo BrowserInfo { get; set; } @@ -431,21 +422,20 @@ public PaymentRequest() [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] public int? CaptureDelayHours { get; set; } - /// - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request. - /// - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request. - [DataMember(Name = "card", EmitDefaultValue = false)] - public Card Card { get; set; } - /// - /// Information regarding the company + /// Gets or Sets Company /// - /// Information regarding the company [DataMember(Name = "company", EmitDefaultValue = false)] public Company Company { get; set; } + /// + /// Conversion ID that corresponds to the Id generated for tracking user payment journey. + /// + /// Conversion ID that corresponds to the Id generated for tracking user payment journey. + [DataMember(Name = "conversionId", EmitDefaultValue = false)] + public string ConversionId { get; set; } + /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// @@ -454,23 +444,21 @@ public PaymentRequest() public string CountryCode { get; set; } /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] public DateTime? DateOfBirth { get; set; } /// - /// The forex quote as returned in the response of the forex service. + /// Gets or Sets DccQuote /// - /// The forex quote as returned in the response of the forex service. [DataMember(Name = "dccQuote", EmitDefaultValue = false)] public ForexQuote DccQuote { get; set; } /// - /// The address where the purchased goods should be delivered. + /// Gets or Sets DeliveryAddress /// - /// The address where the purchased goods should be delivered. [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] public Address DeliveryAddress { get; set; } @@ -482,9 +470,9 @@ public PaymentRequest() public DateTime? DeliveryDate { get; set; } /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting). + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting). + /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting). [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] public string DeviceFingerprint { get; set; } @@ -509,13 +497,6 @@ public PaymentRequest() [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] public bool? EnableRecurring { get; set; } - /// - /// Choose if a specific transaction should use the Real-time Account Updater, regardless of other settings. - /// - /// Choose if a specific transaction should use the Real-time Account Updater, regardless of other settings. - [DataMember(Name = "enableRealTimeUpdate", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "enableRealTimeUpdate")] - public bool? EnableRealTimeUpdate { get; set; } /// /// An integer value that is added to the normal fraud score. The value can be either positive or negative. @@ -525,16 +506,15 @@ public PaymentRequest() public int? FraudOffset { get; set; } /// - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments). + /// Gets or Sets Installments /// - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments). [DataMember(Name = "installments", EmitDefaultValue = false)] public Installments Installments { get; set; } /// - /// Line items regarding the payment. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip. /// - /// Line items regarding the payment. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip. [DataMember(Name = "lineItems", EmitDefaultValue = false)] public List LineItems { get; set; } @@ -553,51 +533,41 @@ public PaymentRequest() public string MerchantAccount { get; set; } /// - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] public string MerchantOrderReference { get; set; } /// - /// Additional risk fields for 3D Secure 2.0. + /// Gets or Sets MerchantRiskIndicator /// - /// Additional risk fields for 3D Secure 2.0. [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] public MerchantRiskIndicator MerchantRiskIndicator { get; set; } /// - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\" + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". /// - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\" + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". [DataMember(Name = "metadata", EmitDefaultValue = false)] public Dictionary Metadata { get; set; } /// - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa). + /// Gets or Sets MpiData /// - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa). [DataMember(Name = "mpiData", EmitDefaultValue = false)] public ThreeDSecureData MpiData { get; set; } - - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. - [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] - public bool? ThreeDSAuthenticationOnly { get; set; } - /// /// Gets or Sets Order /// [DataMember(Name = "order", EmitDefaultValue = false)] public CheckoutOrder Order { get; set; } - + /// - /// The order reference to link multiple partial payments. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. /// - /// The order reference to link multiple partial payments. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. [DataMember(Name = "orderReference", EmitDefaultValue = false)] public string OrderReference { get; set; } @@ -606,14 +576,29 @@ public PaymentRequest() /// /// The collection that contains the type of the payment method and its specific information (e.g. `idealIssuer`). [DataMember(Name = "paymentMethod", EmitDefaultValue = false)] + [JsonConverter(typeof(PaymentMethodDetailsConverter))] public IPaymentMethodDetails PaymentMethod { get; set; } /// - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments). + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. /// - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments). - [DataMember(Name = "recurring", EmitDefaultValue = false)] - public Recurring Recurring { get; set; } + /// Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from. + [DataMember(Name = "origin", EmitDefaultValue = false)] + public string Origin { 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 string 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; } /// @@ -638,51 +623,36 @@ public PaymentRequest() public string Reference { get; set; } /// - /// The URL to return to. + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` /// - /// The URL to return to. + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` [DataMember(Name = "returnUrl", EmitDefaultValue = false)] public string ReturnUrl { get; set; } /// - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - /// - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - [DataMember(Name = "selectedBrand", EmitDefaultValue = false)] - public string SelectedBrand { get; set; } - - /// - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - /// - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - [DataMember(Name = "selectedRecurringDetailReference", EmitDefaultValue = false)] - public string SelectedRecurringDetailReference { get; set; } - - /// - /// A session ID used to identify a payment session. + /// Gets or Sets RiskData /// - /// A session ID used to identify a payment session. - [DataMember(Name = "sessionId", EmitDefaultValue = false)] - public string SessionId { get; set; } + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } /// - /// The maximum validity of the session. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// - /// The maximum validity of the session. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] public string SessionValidity { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] public string ShopperEmail { get; set; } /// - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). /// - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). [DataMember(Name = "shopperIP", EmitDefaultValue = false)] public string ShopperIP { get; set; } @@ -695,46 +665,39 @@ public PaymentRequest() public string ShopperLocale { get; set; } /// - /// The shopper's full name and gender (if specified). + /// Gets or Sets ShopperName /// - /// The shopper's full name and gender (if specified). [DataMember(Name = "shopperName", EmitDefaultValue = false)] public Name ShopperName { get; set; } /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. [DataMember(Name = "shopperReference", EmitDefaultValue = false)] public string ShopperReference { get; set; } /// - /// The text to appear on the shopper's bank statement. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. /// - /// The text to appear on the shopper's bank statement. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] public string ShopperStatement { get; set; } /// - /// The shopper's social security number. + /// The shopper's social security number. /// - /// The shopper's social security number. + /// The shopper's social security number. [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] public string SocialSecurityNumber { get; set; } /// - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). /// - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). [DataMember(Name = "splits", EmitDefaultValue = false)] - public List Splits { get; set; } + public List Splits { get; set; } - /// - /// When true and `shopperReference` is provided, the payment details will be stored. - /// - /// When true and `shopperReference` is provided, the payment details will be stored. - [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] - public bool? StorePaymentMethod { get; set; } /// /// The physical store, for which this payment is processed. /// @@ -743,25 +706,31 @@ public PaymentRequest() public string Store { get; set; } /// - /// The shopper's telephone number. + /// When true and `shopperReference` is provided, the payment details will be stored. /// - /// The shopper's telephone number. + /// When true and `shopperReference` is provided, the payment details will be stored. + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool? StorePaymentMethod { get; set; } + + /// + /// The shopper's telephone number. + /// + /// The shopper's telephone number. [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] public string TelephoneNumber { get; set; } /// - /// Request fields for 3D Secure 2.0. + /// Gets or Sets ThreeDS2RequestData /// - /// Request fields for 3D Secure 2.0. [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] public ThreeDS2RequestData ThreeDS2RequestData { get; set; } /// - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - [DataMember(Name = "totalsGroup", EmitDefaultValue = false)] - public string TotalsGroup { get; set; } + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// Set to true if the payment should be routed to a trusted MID. @@ -770,21 +739,6 @@ public PaymentRequest() [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] public bool? TrustedShopper { get; set; } - /// - /// Required for the 3DS2.0 Web integration. - /// - /// Required for the 3DS2.0 Web integration. - [DataMember(Name = "origin", EmitDefaultValue = false)] - public string Origin { get; set; } - - /// - /// Gets or Sets RiskData - /// - [DataMember(Name = "riskData", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "riskData")] - public RiskData RiskData { get; set; } - - public void AddCardData(string cardNumber, string expiryMonth, string expiryYear, string securityCode, string holderName) { var defaultPaymentMethodDetails = new DefaultPaymentMethodDetails @@ -823,19 +777,15 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class PaymentRequest {\n"); sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); - sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); - sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); - sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); sb.Append(" CaptureDelayHours: ").Append(CaptureDelayHours).Append("\n"); - sb.Append(" Card: ").Append(Card).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); sb.Append(" Company: ").Append(Company).Append("\n"); + sb.Append(" ConversionId: ").Append(ConversionId).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n"); sb.Append(" DccQuote: ").Append(DccQuote).Append("\n"); @@ -845,7 +795,6 @@ public override string ToString() sb.Append(" EnableOneClick: ").Append(EnableOneClick).Append("\n"); sb.Append(" EnablePayOut: ").Append(EnablePayOut).Append("\n"); sb.Append(" EnableRecurring: ").Append(EnableRecurring).Append("\n"); - sb.Append(" EnableRealTimeUpdate: ").Append(EnableRealTimeUpdate).Append("\n"); sb.Append(" EntityType: ").Append(EntityType).Append("\n"); sb.Append(" FraudOffset: ").Append(FraudOffset).Append("\n"); sb.Append(" Installments: ").Append(Installments).Append("\n"); @@ -854,22 +803,20 @@ public override string ToString() sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); - sb.Append(" Metadata: ").Append(Metadata).Append("\n"); + sb.Append(" Metadata: ").Append(Metadata.ToCollectionsString()).Append("\n"); sb.Append(" MpiData: ").Append(MpiData).Append("\n"); sb.Append(" Order: ").Append(Order).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); sb.Append(" PaymentMethod: ").Append(PaymentMethod).Append("\n"); - sb.Append(" Recurring: ").Append(Recurring).Append("\n"); + sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n"); + sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n"); sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); sb.Append(" RedirectFromIssuerMethod: ").Append(RedirectFromIssuerMethod).Append("\n"); sb.Append(" RedirectToIssuerMethod: ").Append(RedirectToIssuerMethod).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); sb.Append(" RiskData: ").Append(RiskData).Append("\n"); - sb.Append(" SelectedBrand: ").Append(SelectedBrand).Append("\n"); - sb.Append(" SelectedRecurringDetailReference: ").Append(SelectedRecurringDetailReference).Append("\n"); - sb.Append(" SessionId: ").Append(SessionId).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -880,12 +827,11 @@ public override string ToString() sb.Append(" ShopperStatement: ").Append(ShopperStatement).Append("\n"); sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); - sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); sb.Append(" ThreeDS2RequestData: ").Append(ThreeDS2RequestData).Append("\n"); sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); - sb.Append(" TotalsGroup: ").Append(TotalsGroup).Append("\n"); sb.Append(" TrustedShopper: ").Append(TrustedShopper).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -895,7 +841,7 @@ public override string 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); } @@ -923,187 +869,165 @@ public bool Equals(PaymentRequest input) return ( this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) + this.AccountInfo != null && + this.AccountInfo.Equals(input.AccountInfo) ) && ( this.AdditionalData == input.AdditionalData || this.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) - ) && - ( - this.AllowedPaymentMethods == input.AllowedPaymentMethods || - this.AllowedPaymentMethods != null && - this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) + this.AdditionalData.Equals(input.AdditionalData) ) && ( this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) + this.Amount != null && + this.Amount.Equals(input.Amount) ) && ( this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.BankAccount == input.BankAccount || - (this.BankAccount != null && - this.BankAccount.Equals(input.BankAccount)) + this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo) ) && ( this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && - ( - this.BlockedPaymentMethods == input.BlockedPaymentMethods || - this.BlockedPaymentMethods != null && - this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) ) && ( this.BrowserInfo == input.BrowserInfo || - (this.BrowserInfo != null && - this.BrowserInfo.Equals(input.BrowserInfo)) + this.BrowserInfo != null && + this.BrowserInfo.Equals(input.BrowserInfo) ) && ( this.CaptureDelayHours == input.CaptureDelayHours || - (this.CaptureDelayHours != null && - this.CaptureDelayHours.Equals(input.CaptureDelayHours)) - ) && - ( - this.Card == input.Card || - (this.Card != null && - this.Card.Equals(input.Card)) + this.CaptureDelayHours != null && + this.CaptureDelayHours.Equals(input.CaptureDelayHours) ) && ( this.Channel == input.Channel || - (this.Channel != null && - this.Channel.Equals(input.Channel)) + this.Channel != null && + this.Channel.Equals(input.Channel) ) && ( this.Company == input.Company || - (this.Company != null && - this.Company.Equals(input.Company)) + this.Company != null && + this.Company.Equals(input.Company) + ) && + ( + this.ConversionId == input.ConversionId || + this.ConversionId != null && + this.ConversionId.Equals(input.ConversionId) ) && ( this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) ) && ( this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) + this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth) ) && ( this.DccQuote == input.DccQuote || - (this.DccQuote != null && - this.DccQuote.Equals(input.DccQuote)) + this.DccQuote != null && + this.DccQuote.Equals(input.DccQuote) ) && ( this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) ) && ( this.DeliveryDate == input.DeliveryDate || - (this.DeliveryDate != null && - this.DeliveryDate.Equals(input.DeliveryDate)) + this.DeliveryDate != null && + this.DeliveryDate.Equals(input.DeliveryDate) ) && ( this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + this.DeviceFingerprint != null && + this.DeviceFingerprint.Equals(input.DeviceFingerprint) ) && ( this.EnableOneClick == input.EnableOneClick || - (this.EnableOneClick != null && - this.EnableOneClick.Equals(input.EnableOneClick)) + this.EnableOneClick != null && + this.EnableOneClick.Equals(input.EnableOneClick) ) && ( this.EnablePayOut == input.EnablePayOut || - (this.EnablePayOut != null && - this.EnablePayOut.Equals(input.EnablePayOut)) + this.EnablePayOut != null && + this.EnablePayOut.Equals(input.EnablePayOut) ) && ( this.EnableRecurring == input.EnableRecurring || - (this.EnableRecurring != null && - this.EnableRecurring.Equals(input.EnableRecurring)) - ) && ( - this.EnableRealTimeUpdate == input.EnableRealTimeUpdate || - (this.EnableRecurring != null && - this.EnableRealTimeUpdate.Equals(input.EnableRealTimeUpdate)) + this.EnableRecurring != null && + this.EnableRecurring.Equals(input.EnableRecurring) ) && ( this.EntityType == input.EntityType || - (this.EntityType != null && - this.EntityType.Equals(input.EntityType)) + this.EntityType != null && + this.EntityType.Equals(input.EntityType) ) && ( this.FraudOffset == input.FraudOffset || - (this.FraudOffset != null && - this.FraudOffset.Equals(input.FraudOffset)) + this.FraudOffset != null && + this.FraudOffset.Equals(input.FraudOffset) ) && ( this.Installments == input.Installments || - (this.Installments != null && - this.Installments.Equals(input.Installments)) + this.Installments != null && + this.Installments.Equals(input.Installments) ) && ( this.LineItems == input.LineItems || this.LineItems != null && + input.LineItems != null && this.LineItems.SequenceEqual(input.LineItems) ) && ( this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) + this.Mcc != null && + this.Mcc.Equals(input.Mcc) ) && ( this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) ) && ( this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) + this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference) ) && ( this.MerchantRiskIndicator == input.MerchantRiskIndicator || - (this.MerchantRiskIndicator != null && - this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) + this.MerchantRiskIndicator != null && + this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator) ) && ( this.Metadata == input.Metadata || this.Metadata != null && + input.Metadata != null && this.Metadata.SequenceEqual(input.Metadata) ) && ( this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) + this.MpiData != null && + this.MpiData.Equals(input.MpiData) ) && ( this.Order == input.Order || - (this.Order != null && - this.Order.Equals(input.Order)) + this.Order != null && + this.Order.Equals(input.Order) ) && ( this.OrderReference == input.OrderReference || - (this.OrderReference != null && - this.OrderReference.Equals(input.OrderReference)) + this.OrderReference != null && + this.OrderReference.Equals(input.OrderReference) ) && - ( + ( this.Origin == input.Origin || - (this.Origin != null && - this.Origin.Equals(input.Origin)) + this.Origin != null && + this.Origin.Equals(input.Origin) ) && ( this.PaymentMethod == input.PaymentMethod || @@ -1111,140 +1035,125 @@ public bool Equals(PaymentRequest input) this.PaymentMethod.Equals(input.PaymentMethod) ) && ( - this.Recurring == input.Recurring || - (this.Recurring != null && - this.Recurring.Equals(input.Recurring)) + this.RecurringExpiry == input.RecurringExpiry || + this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry) + ) && + ( + this.RecurringFrequency == input.RecurringFrequency || + this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency) ) && ( this.RecurringProcessingModel == input.RecurringProcessingModel || - (this.RecurringProcessingModel != null && - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel)) + this.RecurringProcessingModel != null && + this.RecurringProcessingModel.Equals(input.RecurringProcessingModel) ) && ( this.RedirectFromIssuerMethod == input.RedirectFromIssuerMethod || - (this.RedirectFromIssuerMethod != null && - this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod)) + this.RedirectFromIssuerMethod != null && + this.RedirectFromIssuerMethod.Equals(input.RedirectFromIssuerMethod) ) && ( this.RedirectToIssuerMethod == input.RedirectToIssuerMethod || - (this.RedirectToIssuerMethod != null && - this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod)) + this.RedirectToIssuerMethod != null && + this.RedirectToIssuerMethod.Equals(input.RedirectToIssuerMethod) ) && ( this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) + this.Reference != null && + this.Reference.Equals(input.Reference) ) && ( this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) + this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl) ) && ( this.RiskData == input.RiskData || - (this.RiskData != null && - this.RiskData.Equals(input.RiskData)) - ) - && - ( - this.SelectedBrand == input.SelectedBrand || - (this.SelectedBrand != null && - this.SelectedBrand.Equals(input.SelectedBrand)) - ) && - ( - this.SelectedRecurringDetailReference == input.SelectedRecurringDetailReference || - (this.SelectedRecurringDetailReference != null && - this.SelectedRecurringDetailReference.Equals(input.SelectedRecurringDetailReference)) - ) && - ( - this.SessionId == input.SessionId || - (this.SessionId != null && - this.SessionId.Equals(input.SessionId)) + this.RiskData != null && + this.RiskData.Equals(input.RiskData) ) && ( this.SessionValidity == input.SessionValidity || - (this.SessionValidity != null && - this.SessionValidity.Equals(input.SessionValidity)) + this.SessionValidity != null && + this.SessionValidity.Equals(input.SessionValidity) ) && ( this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) ) && ( this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) + this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP) ) && ( this.ShopperInteraction == input.ShopperInteraction || - (this.ShopperInteraction != null && - this.ShopperInteraction.Equals(input.ShopperInteraction)) + this.ShopperInteraction != null && + this.ShopperInteraction.Equals(input.ShopperInteraction) ) && ( this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) ) && ( this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) ) && ( this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) ) && ( this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) + this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement) ) && ( this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber) ) && ( this.Splits == input.Splits || this.Splits != null && + input.Splits != null && this.Splits.SequenceEqual(input.Splits) - )&& - ( - this.StorePaymentMethod == input.StorePaymentMethod || - (this.StorePaymentMethod != null && - this.StorePaymentMethod.Equals(input.StorePaymentMethod)) ) && ( this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) + this.Store != null && + this.Store.Equals(input.Store) + ) && + ( + this.StorePaymentMethod == input.StorePaymentMethod || + this.StorePaymentMethod != null && + this.StorePaymentMethod.Equals(input.StorePaymentMethod) ) && ( this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) + this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber) ) && ( this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + this.ThreeDS2RequestData != null && + this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData) ) && ( this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || - (this.ThreeDSAuthenticationOnly != null && - this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly)) - ) && - ( - this.TotalsGroup == input.TotalsGroup || - (this.TotalsGroup != null && - this.TotalsGroup.Equals(input.TotalsGroup)) + this.ThreeDSAuthenticationOnly != null && + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) ) && ( this.TrustedShopper == input.TrustedShopper || - (this.TrustedShopper != null && - this.TrustedShopper.Equals(input.TrustedShopper)) + this.TrustedShopper != null && + this.TrustedShopper.Equals(input.TrustedShopper) ); } @@ -1259,32 +1168,24 @@ public override int GetHashCode() int hashCode = 41; if (this.AccountInfo != null) hashCode = hashCode * 59 + this.AccountInfo.GetHashCode(); - if (this.AdditionalAmount != null) - hashCode = hashCode * 59 + this.AdditionalAmount.GetHashCode(); if (this.AdditionalData != null) hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); - if (this.AllowedPaymentMethods != null) - hashCode = hashCode * 59 + this.AllowedPaymentMethods.GetHashCode(); if (this.Amount != null) hashCode = hashCode * 59 + this.Amount.GetHashCode(); if (this.ApplicationInfo != null) hashCode = hashCode * 59 + this.ApplicationInfo.GetHashCode(); - if (this.BankAccount != null) - hashCode = hashCode * 59 + this.BankAccount.GetHashCode(); if (this.BillingAddress != null) hashCode = hashCode * 59 + this.BillingAddress.GetHashCode(); - if (this.BlockedPaymentMethods != null) - hashCode = hashCode * 59 + this.BlockedPaymentMethods.GetHashCode(); if (this.BrowserInfo != null) hashCode = hashCode * 59 + this.BrowserInfo.GetHashCode(); if (this.CaptureDelayHours != null) hashCode = hashCode * 59 + this.CaptureDelayHours.GetHashCode(); - if (this.Card != null) - hashCode = hashCode * 59 + this.Card.GetHashCode(); if (this.Channel != null) hashCode = hashCode * 59 + this.Channel.GetHashCode(); if (this.Company != null) hashCode = hashCode * 59 + this.Company.GetHashCode(); + if (this.ConversionId != null) + hashCode = hashCode * 59 + this.ConversionId.GetHashCode(); if (this.CountryCode != null) hashCode = hashCode * 59 + this.CountryCode.GetHashCode(); if (this.DateOfBirth != null) @@ -1303,8 +1204,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.EnablePayOut.GetHashCode(); if (this.EnableRecurring != null) hashCode = hashCode * 59 + this.EnableRecurring.GetHashCode(); - if (this.EnableRealTimeUpdate != null) - hashCode = hashCode * 59 + this.EnableRealTimeUpdate.GetHashCode(); if (this.EntityType != null) hashCode = hashCode * 59 + this.EntityType.GetHashCode(); if (this.FraudOffset != null) @@ -1333,8 +1232,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Origin.GetHashCode(); if (this.PaymentMethod != null) hashCode = hashCode * 59 + this.PaymentMethod.GetHashCode(); - if (this.Recurring != null) - hashCode = hashCode * 59 + this.Recurring.GetHashCode(); + if (this.RecurringExpiry != null) + hashCode = hashCode * 59 + this.RecurringExpiry.GetHashCode(); + if (this.RecurringFrequency != null) + hashCode = hashCode * 59 + this.RecurringFrequency.GetHashCode(); if (this.RecurringProcessingModel != null) hashCode = hashCode * 59 + this.RecurringProcessingModel.GetHashCode(); if (this.RedirectFromIssuerMethod != null) @@ -1345,12 +1246,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Reference.GetHashCode(); if (this.ReturnUrl != null) hashCode = hashCode * 59 + this.ReturnUrl.GetHashCode(); - if (this.SelectedBrand != null) - hashCode = hashCode * 59 + this.SelectedBrand.GetHashCode(); - if (this.SelectedRecurringDetailReference != null) - hashCode = hashCode * 59 + this.SelectedRecurringDetailReference.GetHashCode(); - if (this.SessionId != null) - hashCode = hashCode * 59 + this.SessionId.GetHashCode(); + if (this.RiskData != null) + hashCode = hashCode * 59 + this.RiskData.GetHashCode(); if (this.SessionValidity != null) hashCode = hashCode * 59 + this.SessionValidity.GetHashCode(); if (this.ShopperEmail != null) @@ -1381,8 +1278,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.ThreeDS2RequestData.GetHashCode(); if (this.ThreeDSAuthenticationOnly != null) hashCode = hashCode * 59 + this.ThreeDSAuthenticationOnly.GetHashCode(); - if (this.TotalsGroup != null) - hashCode = hashCode * 59 + this.TotalsGroup.GetHashCode(); if (this.TrustedShopper != null) hashCode = hashCode * 59 + this.TrustedShopper.GetHashCode(); return hashCode; @@ -1394,36 +1289,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new[] { "Store" }); - } - - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new[] { "Store" }); - } - - // TotalsGroup (string) maxLength - if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new[] { "TotalsGroup" }); - } - - // TotalsGroup (string) minLength - if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new[] { "TotalsGroup" }); - } - yield break; } } - -} - - +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs new file mode 100644 index 000000000..93d8cccc3 --- /dev/null +++ b/Adyen/Model/Checkout/PaymentResponse.cs @@ -0,0 +1,463 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; +using Newtonsoft.Json.Converters; +using Adyen.Model.Checkout.Action; +using Adyen.Util; + +namespace Adyen.Model.Checkout +{ + /// + /// PaymentResponse + /// + [DataContract] + public partial class PaymentResponse : IEquatable, IValidatableObject + { + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [JsonConverter(typeof(StringEnumConverter))] + public enum ResultCodeEnum + { + /// + /// Enum AuthenticationFinished for value: AuthenticationFinished + /// + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, + + /// + /// Enum Authorised for value: Authorised + /// + [EnumMember(Value = "Authorised")] Authorised = 2, + + /// + /// Enum Cancelled for value: Cancelled + /// + [EnumMember(Value = "Cancelled")] Cancelled = 3, + + /// + /// Enum ChallengeShopper for value: ChallengeShopper + /// + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 4, + + /// + /// Enum Error for value: Error + /// + [EnumMember(Value = "Error")] Error = 5, + + /// + /// Enum IdentifyShopper for value: IdentifyShopper + /// + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 6, + + /// + /// Enum Pending for value: Pending + /// + [EnumMember(Value = "Pending")] Pending = 7, + + /// + /// Enum PresentToShopper for value: PresentToShopper + /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 8, + + /// + /// Enum Received for value: Received + /// + [EnumMember(Value = "Received")] Received = 9, + + /// + /// Enum RedirectShopper for value: RedirectShopper + /// + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 10, + + /// + /// Enum Refused for value: Refused + /// + [EnumMember(Value = "Refused")] Refused = 11 + } + + /// + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. + [DataMember(Name = "resultCode", EmitDefaultValue = false)] + public ResultCodeEnum? ResultCode { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// Action to be taken for completing the payment.. + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**.. + /// amount. + /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. . + /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint.. + /// donationToken. + /// fraudResult. + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.. + /// order. + /// Contains the details that will be presented to the shopper.. + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint.. + /// 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. > `pspReference` is returned only for non-redirect payment methods.. + /// redirect. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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.. + public PaymentResponse(IPaymentResponseAction action = default(IPaymentResponseAction), + Dictionary additionalData = default(Dictionary), + Amount amount = default(Amount), + Dictionary authentication = default(Dictionary), + List details = default(List), string donationToken = default(string), + FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), + CheckoutOrderResponse order = default(CheckoutOrderResponse), + Dictionary outputDetails = default(Dictionary), + string paymentData = default(string), string pspReference = default(string), + Redirect redirect = default(Redirect), string refusalReason = default(string), + string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?)) + { + this.Action = action; + this.AdditionalData = additionalData; + this.Amount = amount; + this.Authentication = authentication; + this.Details = details; + this.DonationToken = donationToken; + this.FraudResult = fraudResult; + this.MerchantReference = merchantReference; + this.Order = order; + this.OutputDetails = outputDetails; + this.PaymentData = paymentData; + this.PspReference = pspReference; + this.Redirect = redirect; + this.RefusalReason = refusalReason; + this.RefusalReasonCode = refusalReasonCode; + this.ResultCode = resultCode; + } + + /// + /// Action to be taken for completing the payment. + /// + /// Action to be taken for completing the payment. + [DataMember(Name = "action", EmitDefaultValue = false)] + public IPaymentResponseAction Action { get; set; } + + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + /// + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary AdditionalData { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public Amount Amount { get; set; } + + /// + /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. + /// + /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. + [DataMember(Name = "authentication", EmitDefaultValue = false)] + public Dictionary Authentication { get; set; } + + /// + /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint. + /// + /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint. + [DataMember(Name = "details", EmitDefaultValue = false)] + public List Details { get; set; } + + /// + /// Gets or Sets DonationToken + /// + [DataMember(Name = "donationToken", EmitDefaultValue = false)] + public string DonationToken { get; set; } + + /// + /// Gets or Sets FraudResult + /// + [DataMember(Name = "fraudResult", EmitDefaultValue = false)] + public FraudResult FraudResult { get; set; } + + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + /// + /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + public string MerchantReference { get; set; } + + /// + /// Gets or Sets Order + /// + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrderResponse Order { get; set; } + + /// + /// Contains the details that will be presented to the shopper. + /// + /// Contains the details that will be presented to the shopper. + [DataMember(Name = "outputDetails", EmitDefaultValue = false)] + public Dictionary OutputDetails { get; set; } + + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. + /// + /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. + [DataMember(Name = "paymentData", EmitDefaultValue = false)] + public string PaymentData { get; set; } + + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + /// + /// 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. > `pspReference` is returned only for non-redirect payment methods. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + public string PspReference { get; set; } + + /// + /// Gets or Sets Redirect + /// + [DataMember(Name = "redirect", EmitDefaultValue = false)] + public Redirect Redirect { get; set; } + + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [DataMember(Name = "refusalReason", EmitDefaultValue = false)] + public string RefusalReason { get; set; } + + /// + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + /// + /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). + [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] + public string RefusalReasonCode { 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 PaymentResponse {\n"); + sb.Append(" Action: ").Append(Action).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" Authentication: ").Append(Authentication.ToCollectionsString()).Append("\n"); + sb.Append(" Details: ").Append(Details.ObjectListToString()).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(" OutputDetails: ").Append(OutputDetails.ToCollectionsString()).Append("\n"); + sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" Redirect: ").Append(Redirect).Append("\n"); + sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); + sb.Append(" RefusalReasonCode: ").Append(RefusalReasonCode).Append("\n"); + sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as PaymentResponse); + } + + /// + /// Returns true if PaymentResponse instances are equal + /// + /// Instance of PaymentResponse to be compared + /// Boolean + public bool Equals(PaymentResponse input) + { + if (input == null) + return false; + + return + ( + this.Action == input.Action || + this.Action != null && + this.Action.Equals(input.Action) + ) && + ( + this.AdditionalData == input.AdditionalData || + this.AdditionalData != null && + this.AdditionalData.Equals(input.AdditionalData) + ) && + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.Authentication == input.Authentication || + this.Authentication != null && + input.Authentication != null && + this.Authentication.SequenceEqual(input.Authentication) + ) && + ( + this.Details == input.Details || + this.Details != null && + input.Details != null && + this.Details.SequenceEqual(input.Details) + ) && + ( + this.DonationToken == input.DonationToken || + this.DonationToken != null && + this.DonationToken.Equals(input.DonationToken) + ) && + ( + 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 || + this.Order != null && + this.Order.Equals(input.Order) + ) && + ( + this.OutputDetails == input.OutputDetails || + this.OutputDetails != null && + input.OutputDetails != null && + this.OutputDetails.SequenceEqual(input.OutputDetails) + ) && + ( + this.PaymentData == input.PaymentData || + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.PspReference == input.PspReference || + this.PspReference != null && + this.PspReference.Equals(input.PspReference) + ) && + ( + this.Redirect == input.Redirect || + this.Redirect != null && + this.Redirect.Equals(input.Redirect) + ) && + ( + this.RefusalReason == input.RefusalReason || + this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason) + ) && + ( + this.RefusalReasonCode == input.RefusalReasonCode || + this.RefusalReasonCode != null && + this.RefusalReasonCode.Equals(input.RefusalReasonCode) + ) && + ( + this.ResultCode == input.ResultCode || + this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Action != null) + hashCode = hashCode * 59 + this.Action.GetHashCode(); + if (this.AdditionalData != null) + hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.Authentication != null) + hashCode = hashCode * 59 + this.Authentication.GetHashCode(); + if (this.Details != null) + hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.DonationToken != null) + hashCode = hashCode * 59 + this.DonationToken.GetHashCode(); + if (this.FraudResult != null) + hashCode = hashCode * 59 + this.FraudResult.GetHashCode(); + if (this.MerchantReference != null) + hashCode = hashCode * 59 + this.MerchantReference.GetHashCode(); + if (this.Order != null) + hashCode = hashCode * 59 + this.Order.GetHashCode(); + if (this.OutputDetails != null) + hashCode = hashCode * 59 + this.OutputDetails.GetHashCode(); + if (this.PaymentData != null) + hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.PspReference != null) + hashCode = hashCode * 59 + this.PspReference.GetHashCode(); + if (this.Redirect != null) + hashCode = hashCode * 59 + this.Redirect.GetHashCode(); + if (this.RefusalReason != null) + hashCode = hashCode * 59 + this.RefusalReason.GetHashCode(); + if (this.RefusalReasonCode != null) + hashCode = hashCode * 59 + this.RefusalReasonCode.GetHashCode(); + if (this.ResultCode != null) + hashCode = hashCode * 59 + this.ResultCode.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentResultRequest.cs b/Adyen/Model/Checkout/PaymentResultRequest.cs index 93921123e..4b4f049fb 100644 --- a/Adyen/Model/Checkout/PaymentResultRequest.cs +++ b/Adyen/Model/Checkout/PaymentResultRequest.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,35 +36,31 @@ namespace Adyen.Model.Checkout /// PaymentResultRequest /// [DataContract] - public partial class PaymentResultRequest : IEquatable, IValidatableObject + public partial class PaymentResultRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected PaymentResultRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. (required). - public PaymentResultRequest(string Payload = default(string)) + /// Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. (required). + public PaymentResultRequest(string payload = default(string)) { - // to ensure "Payload" is required (not null) - if (Payload == null) + // to ensure "payload" is required (not null) + if (payload == null) { - throw new InvalidDataException("Payload is a required property for PaymentResultRequest and cannot be null"); + throw new InvalidDataException( + "payload is a required property for PaymentResultRequest and cannot be null"); } else { - this.Payload = Payload; + this.Payload = payload; } } - + /// /// Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. /// /// Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment. - [DataMember(Name="payload", EmitDefaultValue=false)] + [DataMember(Name = "payload", EmitDefaultValue = false)] public string Payload { get; set; } /// @@ -78,12 +75,12 @@ public override string ToString() 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,7 +96,7 @@ public override bool Equals(object input) } /// - /// Returns true if PaymentResultRequest instances are equal + /// Returns true if PaymentResultRequest instances are equal /// /// Instance of PaymentResultRequest to be compared /// Boolean @@ -108,12 +105,10 @@ public bool Equals(PaymentResultRequest input) if (input == null) return false; - return - ( - this.Payload == input.Payload || - (this.Payload != null && - this.Payload.Equals(input.Payload)) - ); + return + this.Payload == input.Payload || + this.Payload != null && + this.Payload.Equals(input.Payload); } /// @@ -136,10 +131,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentResultResponse.cs b/Adyen/Model/Checkout/PaymentResultResponse.cs index 2d21f76fc..22c0dddc6 100644 --- a/Adyen/Model/Checkout/PaymentResultResponse.cs +++ b/Adyen/Model/Checkout/PaymentResultResponse.cs @@ -1,131 +1,143 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; -using System.Text; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.IO; using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; namespace Adyen.Model.Checkout { /// - /// PaymentResultResponse + /// PaymentResultResponse /// [DataContract] public partial class PaymentResultResponse : IEquatable, IValidatableObject { /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. [JsonConverter(typeof(StringEnumConverter))] public enum ResultCodeEnum { /// /// Enum AuthenticationFinished for value: AuthenticationFinished /// - [EnumMember(Value = "AuthenticationFinished")] - AuthenticationFinished = 0, + [EnumMember(Value = "AuthenticationFinished")] AuthenticationFinished = 1, + /// /// Enum Authorised for value: Authorised /// - [EnumMember(Value = "Authorised")] - Authorised = 1, + [EnumMember(Value = "Authorised")] Authorised = 2, + /// /// Enum Cancelled for value: Cancelled /// - [EnumMember(Value = "Cancelled")] - Cancelled = 2, + [EnumMember(Value = "Cancelled")] Cancelled = 3, + /// /// Enum ChallengeShopper for value: ChallengeShopper /// - [EnumMember(Value = "ChallengeShopper")] - ChallengeShopper = 3, + [EnumMember(Value = "ChallengeShopper")] ChallengeShopper = 4, + /// /// Enum Error for value: Error /// - [EnumMember(Value = "Error")] - Error = 4, + [EnumMember(Value = "Error")] Error = 5, + /// /// Enum IdentifyShopper for value: IdentifyShopper /// - [EnumMember(Value = "IdentifyShopper")] - IdentifyShopper = 5, + [EnumMember(Value = "IdentifyShopper")] IdentifyShopper = 6, + /// /// Enum Pending for value: Pending /// - [EnumMember(Value = "Pending")] - Pending = 6, + [EnumMember(Value = "Pending")] Pending = 7, + + /// + /// Enum PresentToShopper for value: PresentToShopper + /// + [EnumMember(Value = "PresentToShopper")] PresentToShopper = 8, + /// /// Enum Received for value: Received /// - [EnumMember(Value = "Received")] - Received = 7, + [EnumMember(Value = "Received")] Received = 9, + /// /// Enum RedirectShopper for value: RedirectShopper /// - [EnumMember(Value = "RedirectShopper")] - RedirectShopper = 8, + [EnumMember(Value = "RedirectShopper")] RedirectShopper = 10, + /// /// Enum Refused for value: Refused /// - [EnumMember(Value = "Refused")] - Refused = 9 + [EnumMember(Value = "Refused")] Refused = 11 } + /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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 result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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. [DataMember(Name = "resultCode", EmitDefaultValue = false)] public ResultCodeEnum? ResultCode { get; set; } + /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected PaymentResultResponse() { } - /// - /// Initializes a new instance of the class. - /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.. + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**.. /// fraudResult. /// A unique value that you provided in the initial `/paymentSession` request as a `reference` field. (required). + /// order. /// The payment method used in the transaction. (required). /// 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. > `pspReference` is returned only for non-redirect payment methods.. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. . + /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/checkout/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/checkout/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.. /// serviceError. /// The shopperLocale value provided in the payment request. (required). - public PaymentResultResponse(Dictionary additionalData = default(Dictionary), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), string paymentMethod = default(string), string pspReference = default(string), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?), ServiceError serviceError = default(ServiceError), string shopperLocale = default(string)) + public PaymentResultResponse( + Dictionary additionalData = + default(Dictionary), 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?), ServiceError serviceError = default(ServiceError), + string shopperLocale = default(string)) { // to ensure "merchantReference" is required (not null) if (merchantReference == null) { - throw new InvalidDataException("merchantReference is a required property for PaymentResultResponse and cannot be null"); + throw new InvalidDataException( + "merchantReference is a required property for PaymentResultResponse and cannot be null"); } else { @@ -134,7 +146,8 @@ protected PaymentResultResponse() { } // to ensure "paymentMethod" is required (not null) if (paymentMethod == null) { - throw new InvalidDataException("paymentMethod is a required property for PaymentResultResponse and cannot be null"); + throw new InvalidDataException( + "paymentMethod is a required property for PaymentResultResponse and cannot be null"); } else { @@ -143,7 +156,8 @@ protected PaymentResultResponse() { } // to ensure "shopperLocale" is required (not null) if (shopperLocale == null) { - throw new InvalidDataException("shopperLocale is a required property for PaymentResultResponse and cannot be null"); + throw new InvalidDataException( + "shopperLocale is a required property for PaymentResultResponse and cannot be null"); } else { @@ -151,6 +165,7 @@ protected PaymentResultResponse() { } } this.AdditionalData = additionalData; this.FraudResult = fraudResult; + this.Order = order; this.PspReference = pspReference; this.RefusalReason = refusalReason; this.RefusalReasonCode = refusalReasonCode; @@ -159,11 +174,11 @@ protected PaymentResultResponse() { } } /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**. + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**. + /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs** > **Additional data settings**. [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } + public Dictionary AdditionalData { get; set; } /// /// Gets or Sets FraudResult @@ -178,6 +193,12 @@ protected PaymentResultResponse() { } [DataMember(Name = "merchantReference", EmitDefaultValue = false)] public string MerchantReference { get; set; } + /// + /// Gets or Sets Order + /// + [DataMember(Name = "order", EmitDefaultValue = false)] + public CheckoutOrderResponse Order { get; set; } + /// /// The payment method used in the transaction. /// @@ -193,9 +214,9 @@ protected PaymentResultResponse() { } public string PspReference { get; set; } /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. + /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). [DataMember(Name = "refusalReason", EmitDefaultValue = false)] public string RefusalReason { get; set; } @@ -228,9 +249,10 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PaymentResultResponse {\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).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"); sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); @@ -274,53 +296,58 @@ public bool Equals(PaymentResultResponse input) return ( this.AdditionalData == input.AdditionalData || - (this.AdditionalData != null && - this.AdditionalData.Equals(input.AdditionalData)) + this.AdditionalData != null && + this.AdditionalData.Equals(input.AdditionalData) ) && ( this.FraudResult == input.FraudResult || - (this.FraudResult != null && - this.FraudResult.Equals(input.FraudResult)) + this.FraudResult != null && + this.FraudResult.Equals(input.FraudResult) ) && ( this.MerchantReference == input.MerchantReference || - (this.MerchantReference != null && - this.MerchantReference.Equals(input.MerchantReference)) + this.MerchantReference != null && + this.MerchantReference.Equals(input.MerchantReference) + ) && + ( + this.Order == input.Order || + this.Order != null && + this.Order.Equals(input.Order) ) && ( this.PaymentMethod == input.PaymentMethod || - (this.PaymentMethod != null && - this.PaymentMethod.Equals(input.PaymentMethod)) + this.PaymentMethod != null && + this.PaymentMethod.Equals(input.PaymentMethod) ) && ( this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) + this.PspReference != null && + this.PspReference.Equals(input.PspReference) ) && ( this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) + this.RefusalReason != null && + this.RefusalReason.Equals(input.RefusalReason) ) && ( this.RefusalReasonCode == input.RefusalReasonCode || - (this.RefusalReasonCode != null && - this.RefusalReasonCode.Equals(input.RefusalReasonCode)) + this.RefusalReasonCode != null && + this.RefusalReasonCode.Equals(input.RefusalReasonCode) ) && ( this.ResultCode == input.ResultCode || - (this.ResultCode != null && - this.ResultCode.Equals(input.ResultCode)) + this.ResultCode != null && + this.ResultCode.Equals(input.ResultCode) ) && ( this.ServiceError == input.ServiceError || - (this.ServiceError != null && - this.ServiceError.Equals(input.ServiceError)) + this.ServiceError != null && + this.ServiceError.Equals(input.ServiceError) ) && ( this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) ); } @@ -339,6 +366,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.FraudResult.GetHashCode(); if (this.MerchantReference != null) hashCode = hashCode * 59 + this.MerchantReference.GetHashCode(); + if (this.Order != null) + hashCode = hashCode * 59 + this.Order.GetHashCode(); if (this.PaymentMethod != null) hashCode = hashCode * 59 + this.PaymentMethod.GetHashCode(); if (this.PspReference != null) @@ -362,9 +391,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentSessionRequest.cs b/Adyen/Model/Checkout/PaymentSessionRequest.cs index 20d443bf3..9da5c0209 100644 --- a/Adyen/Model/Checkout/PaymentSessionRequest.cs +++ b/Adyen/Model/Checkout/PaymentSessionRequest.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -28,6 +29,8 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Model.ApplicationInformation; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -46,24 +49,20 @@ public partial class PaymentSessionRequest : IEquatable, [JsonConverter(typeof(StringEnumConverter))] public enum ChannelEnum { - /// /// Enum IOS for value: iOS /// - [EnumMember(Value = "iOS")] - IOS = 1, + [EnumMember(Value = "iOS")] IOS = 1, /// /// Enum Android for value: Android /// - [EnumMember(Value = "Android")] - Android = 2, + [EnumMember(Value = "Android")] Android = 2, /// /// Enum Web for value: Web /// - [EnumMember(Value = "Web")] - Web = 3 + [EnumMember(Value = "Web")] Web = 3 } /// @@ -72,6 +71,7 @@ public enum ChannelEnum /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web [DataMember(Name = "channel", EmitDefaultValue = false)] public ChannelEnum? Channel { get; set; } + /// /// The type of the entity the payment is processed for. /// @@ -79,18 +79,15 @@ public enum ChannelEnum [JsonConverter(typeof(StringEnumConverter))] public enum EntityTypeEnum { - /// /// Enum NaturalPerson for value: NaturalPerson /// - [EnumMember(Value = "NaturalPerson")] - NaturalPerson = 1, + [EnumMember(Value = "NaturalPerson")] NaturalPerson = 1, /// /// Enum CompanyName for value: CompanyName /// - [EnumMember(Value = "CompanyName")] - CompanyName = 2 + [EnumMember(Value = "CompanyName")] CompanyName = 2 } /// @@ -99,39 +96,7 @@ public enum EntityTypeEnum /// The type of the entity the payment is processed for. [DataMember(Name = "entityType", EmitDefaultValue = false)] public EntityTypeEnum? EntityType { get; set; } - /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – Transaction that occurs on a non-fixed schedule using stored card details. For example, automatic top-ups when the cardholder's balance drops below certain amount. - /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – Transaction that occurs on a non-fixed schedule using stored card details. For example, automatic top-ups when the cardholder's balance drops below certain amount. - [JsonConverter(typeof(StringEnumConverter))] - public enum RecurringProcessingModelEnum - { - /// - /// Enum CardOnFile for value: CardOnFile - /// - [EnumMember(Value = "CardOnFile")] - CardOnFile = 1, - - /// - /// Enum Subscription for value: Subscription - /// - [EnumMember(Value = "Subscription")] - Subscription = 2, - - /// - /// Enum Subscription for value: UnscheduledCardOnFile - /// - [EnumMember(Value = "UnscheduledCardOnFile")] - UnscheduledCardOnFile = 3 - } - - /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. - /// - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. - [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] - public RecurringProcessingModelEnum? RecurringProcessingModel { get; set; } /// /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. /// @@ -139,30 +104,25 @@ public enum RecurringProcessingModelEnum [JsonConverter(typeof(StringEnumConverter))] public enum ShopperInteractionEnum { - /// /// Enum Ecommerce for value: Ecommerce /// - [EnumMember(Value = "Ecommerce")] - Ecommerce = 1, + [EnumMember(Value = "Ecommerce")] Ecommerce = 1, /// /// Enum ContAuth for value: ContAuth /// - [EnumMember(Value = "ContAuth")] - ContAuth = 2, + [EnumMember(Value = "ContAuth")] ContAuth = 2, /// /// Enum Moto for value: Moto /// - [EnumMember(Value = "Moto")] - Moto = 3, + [EnumMember(Value = "Moto")] Moto = 3, /// /// Enum POS for value: POS /// - [EnumMember(Value = "POS")] - POS = 4 + [EnumMember(Value = "POS")] POS = 4 } /// @@ -171,254 +131,234 @@ public enum ShopperInteractionEnum /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] public ShopperInteractionEnum? ShopperInteraction { get; set; } + /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected PaymentSessionRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// Shopper account information for 3D Secure 2.0.. - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. . - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata).. - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview).. - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). (required). - /// Application information.. - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request.. - /// The address where to send the invoice.. - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview).. - /// The shopper's browser information.. - /// The delay between the authorisation and scheduled auto-capture, specified in hours.. - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request.. - /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. - /// Information regarding the company. - /// Specify configurations to enable additional features.. - /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE (required). - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. - /// The forex quote as returned in the response of the forex service.. - /// The address where the purchased goods should be delivered.. - /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting).. - /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.. - /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. - /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.. - /// The type of the entity the payment is processed for.. - /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. - /// Required for the Web integration. Set this parameter to true to use the default Checkout UI from the SDK.. - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments).. - /// Line items regarding the payment.. - /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. - /// The merchant account identifier, with which you want to process the transaction. (required). - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. - /// Additional risk fields for 3D Secure 2.0.. - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\". - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa).. - /// The two-character country code of the shopper's nationality.. - /// The order reference to link multiple partial payments.. - /// Required for the Web integration. Set this parameter to the page URL, on which you are loading the SDK.. - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments).. - /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction.. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). - /// The URL to return to. (required). - /// The version of the SDK you are using (for Web SDK integrations only).. - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card.. - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail.. - /// A session ID used to identify a payment session.. - /// The maximum validity of the session.. - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks.. - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).. - /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. - /// The combination of a language code and a country code to specify the language to be used in the payment.. - /// The shopper's full name and gender (if specified).. - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.. - /// The text to appear on the shopper's bank statement.. - /// The shopper's social security number.. - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts.. - /// The physical store, for which this payment is processed.. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.. + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// amount (required). + /// applicationInfo. + /// billingAddress. + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`. + /// The delay between the authorisation and scheduled auto-capture, specified in hours.. + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web. + /// company. + /// configuration. + /// Conversion ID that corresponds to the Id generated for tracking user payment journey.. + /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE (required). + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD. + /// dccQuote. + /// deliveryAddress. + /// The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00. + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.. + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts.. + /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.. + /// The type of the entity the payment is processed for.. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// installments. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip.. + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.. + /// The merchant account identifier, with which you want to process the transaction. (required). + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.. + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\".. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.. + /// Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from.. + /// 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 reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` (required). + /// riskData. + /// The version of the SDK you are using (for Web SDK integrations only).. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations.. + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).. + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.. + /// The combination of a language code and a country code to specify the language to be used in the payment.. + /// shopperName. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments.. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string.. + /// The shopper's social security number.. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information).. /// When true and `shopperReference` is provided, the payment details will be stored.. - /// The shopper's telephone number.. - /// Request fields for 3D Secure 2.0.. - /// The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web.. - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available).. - /// Set to true if the payment should be routed to a trusted MID.. - public PaymentSessionRequest(AccountInfo AccountInfo = default(AccountInfo), Amount AdditionalAmount = default(Amount), Dictionary AdditionalData = default(Dictionary), List AllowedPaymentMethods = default(List), Amount Amount = default(Amount), ApplicationInformation.ApplicationInfo ApplicationInfo = default(ApplicationInformation.ApplicationInfo), BankAccount BankAccount = default(BankAccount), Address BillingAddress = default(Address), List BlockedPaymentMethods = default(List), BrowserInfo BrowserInfo = default(BrowserInfo), int? CaptureDelayHours = default(int?), Card Card = default(Card), ChannelEnum? Channel = default(ChannelEnum?), Company Company = default(Company), Configuration Configuration = default(Configuration), string CountryCode = default(string), DateTime? DateOfBirth = default(DateTime?), ForexQuote DccQuote = default(ForexQuote), Address DeliveryAddress = default(Address), DateTime? DeliveryDate = default(DateTime?), string DeviceFingerprint = default(string), bool? EnableOneClick = default(bool?), bool? EnablePayOut = default(bool?), bool? EnableRecurring = default(bool?), EntityTypeEnum? EntityType = default(EntityTypeEnum?), int? FraudOffset = default(int?), bool? Html = default(bool?), Installments Installments = default(Installments), List LineItems = default(List), string Mcc = default(string), string MerchantAccount = default(string), string MerchantOrderReference = default(string), MerchantRiskIndicator MerchantRiskIndicator = default(MerchantRiskIndicator), Dictionary Metadata = default(Dictionary), ThreeDSecureData MpiData = default(ThreeDSecureData), string Nationality = default(string), string OrderReference = default(string), string Origin = default(string), Recurring Recurring = default(Recurring), RecurringProcessingModelEnum? RecurringProcessingModel = default(RecurringProcessingModelEnum?), string Reference = default(string), string ReturnUrl = default(string), string SdkVersion = default(string), string SelectedBrand = default(string), string SelectedRecurringDetailReference = default(string), string SessionId = default(string), string SessionValidity = default(string), string ShopperEmail = default(string), string ShopperIP = default(string), ShopperInteractionEnum? ShopperInteraction = default(ShopperInteractionEnum?), string ShopperLocale = default(string), Name ShopperName = default(Name), string ShopperReference = default(string), string ShopperStatement = default(string), string SocialSecurityNumber = default(string), List Splits = default(List), string Store = default(string), bool? StorePaymentMethod = default(bool?), string TelephoneNumber = default(string), ThreeDS2RequestData ThreeDS2RequestData = default(ThreeDS2RequestData), string Token = default(string), string TotalsGroup = default(string), bool? TrustedShopper = default(bool?)) + /// The shopper's telephone number.. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). + /// The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web.. + /// Set to true if the payment should be routed to a trusted MID.. + public PaymentSessionRequest( + Dictionary additionalData = default(Dictionary), + List allowedPaymentMethods = default(List), Amount amount = default(Amount), + ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), + List blockedPaymentMethods = default(List), int? captureDelayHours = default(int?), + ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), + Configuration configuration = default(Configuration), string conversionId = default(string), + string countryCode = default(string), DateTime? dateOfBirth = default(DateTime?), + ForexQuote dccQuote = default(ForexQuote), Address deliveryAddress = default(Address), + DateTime? deliveryDate = default(DateTime?), 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), string merchantAccount = default(string), + string merchantOrderReference = default(string), + Dictionary metadata = default(Dictionary), + string orderReference = default(string), string origin = default(string), + string recurringExpiry = default(string), string recurringFrequency = default(string), + string reference = default(string), string returnUrl = default(string), + RiskData riskData = default(RiskData), string sdkVersion = default(string), + string sessionValidity = default(string), string shopperEmail = default(string), + string shopperIP = default(string), + ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), + string shopperLocale = default(string), Name shopperName = default(Name), + string shopperReference = default(string), string shopperStatement = default(string), + string socialSecurityNumber = default(string), List splits = default(List), + bool? storePaymentMethod = default(bool?), string telephoneNumber = default(string), + bool? threeDSAuthenticationOnly = false, string token = default(string), + bool? trustedShopper = default(bool?)) { - // to ensure "Amount" is required (not null) - if (Amount == null) + // to ensure "amount" is required (not null) + if (amount == null) { - throw new InvalidDataException("Amount is a required property for PaymentSessionRequest and cannot be null"); + throw new InvalidDataException( + "amount is a required property for PaymentSessionRequest and cannot be null"); } else { - this.Amount = Amount; + this.Amount = amount; } - // to ensure "CountryCode" is required (not null) - if (CountryCode == null) + // to ensure "countryCode" is required (not null) + if (countryCode == null) { - throw new InvalidDataException("CountryCode is a required property for PaymentSessionRequest and cannot be null"); + throw new InvalidDataException( + "countryCode is a required property for PaymentSessionRequest and cannot be null"); } else { - this.CountryCode = CountryCode; + this.CountryCode = countryCode; } - // to ensure "MerchantAccount" is required (not null) - if (MerchantAccount == null) + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) { - throw new InvalidDataException("MerchantAccount is a required property for PaymentSessionRequest and cannot be null"); + throw new InvalidDataException( + "merchantAccount is a required property for PaymentSessionRequest and cannot be null"); } else { - this.MerchantAccount = MerchantAccount; + this.MerchantAccount = merchantAccount; } - // to ensure "Reference" is required (not null) - if (Reference == null) + // to ensure "reference" is required (not null) + if (reference == null) { - throw new InvalidDataException("Reference is a required property for PaymentSessionRequest and cannot be null"); + throw new InvalidDataException( + "reference is a required property for PaymentSessionRequest and cannot be null"); } else { - this.Reference = Reference; + this.Reference = reference; } - // to ensure "ReturnUrl" is required (not null) - if (ReturnUrl == null) + // to ensure "returnUrl" is required (not null) + if (returnUrl == null) { - throw new InvalidDataException("ReturnUrl is a required property for PaymentSessionRequest and cannot be null"); + throw new InvalidDataException( + "returnUrl is a required property for PaymentSessionRequest and cannot be null"); } else { - this.ReturnUrl = ReturnUrl; + this.ReturnUrl = returnUrl; } - this.AccountInfo = AccountInfo; - this.AdditionalAmount = AdditionalAmount; - this.AdditionalData = AdditionalData; - this.AllowedPaymentMethods = AllowedPaymentMethods; - this.ApplicationInfo = ApplicationInfo; - this.BankAccount = BankAccount; - this.BillingAddress = BillingAddress; - this.BlockedPaymentMethods = BlockedPaymentMethods; - this.BrowserInfo = BrowserInfo; - this.CaptureDelayHours = CaptureDelayHours; - this.Card = Card; - this.Channel = Channel; - this.Company = Company; - this.Configuration = Configuration; - this.DateOfBirth = DateOfBirth; - this.DccQuote = DccQuote; - this.DeliveryAddress = DeliveryAddress; - this.DeliveryDate = DeliveryDate; - this.DeviceFingerprint = DeviceFingerprint; - this.EnableOneClick = EnableOneClick; - this.EnablePayOut = EnablePayOut; - this.EnableRecurring = EnableRecurring; - this.EntityType = EntityType; - this.FraudOffset = FraudOffset; - this.Html = Html; - this.Installments = Installments; - this.LineItems = LineItems; - this.Mcc = Mcc; - this.MerchantOrderReference = MerchantOrderReference; - this.MerchantRiskIndicator = MerchantRiskIndicator; - this.Metadata = Metadata; - this.MpiData = MpiData; - this.Nationality = Nationality; - this.OrderReference = OrderReference; - this.Origin = Origin; - this.Recurring = Recurring; - this.RecurringProcessingModel = RecurringProcessingModel; - this.SdkVersion = SdkVersion; - this.SelectedBrand = SelectedBrand; - this.SelectedRecurringDetailReference = SelectedRecurringDetailReference; - this.SessionId = SessionId; - this.SessionValidity = SessionValidity; - this.ShopperEmail = ShopperEmail; - this.ShopperIP = ShopperIP; - this.ShopperInteraction = ShopperInteraction; - this.ShopperLocale = ShopperLocale; - this.ShopperName = ShopperName; - this.ShopperReference = ShopperReference; - this.ShopperStatement = ShopperStatement; - this.SocialSecurityNumber = SocialSecurityNumber; - this.Splits = Splits; - this.Store = Store; - this.StorePaymentMethod = StorePaymentMethod; - this.TelephoneNumber = TelephoneNumber; - this.ThreeDS2RequestData = ThreeDS2RequestData; - this.Token = Token; - this.TotalsGroup = TotalsGroup; - this.TrustedShopper = TrustedShopper; + this.AdditionalData = additionalData; + this.AllowedPaymentMethods = allowedPaymentMethods; + this.ApplicationInfo = applicationInfo; + this.BillingAddress = billingAddress; + this.BlockedPaymentMethods = blockedPaymentMethods; + this.CaptureDelayHours = captureDelayHours; + this.Channel = channel; + this.Company = company; + this.Configuration = configuration; + this.ConversionId = conversionId; + this.DateOfBirth = dateOfBirth; + this.DccQuote = dccQuote; + this.DeliveryAddress = deliveryAddress; + this.DeliveryDate = deliveryDate; + this.EnableOneClick = enableOneClick; + this.EnablePayOut = enablePayOut; + this.EnableRecurring = enableRecurring; + this.EntityType = entityType; + this.FraudOffset = fraudOffset; + this.Installments = installments; + this.LineItems = lineItems; + this.Mcc = mcc; + this.MerchantOrderReference = merchantOrderReference; + this.Metadata = metadata; + this.OrderReference = orderReference; + this.Origin = origin; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.RiskData = riskData; + this.SdkVersion = sdkVersion; + this.SessionValidity = sessionValidity; + this.ShopperEmail = shopperEmail; + this.ShopperIP = shopperIP; + this.ShopperInteraction = shopperInteraction; + this.ShopperLocale = shopperLocale; + this.ShopperName = shopperName; + this.ShopperReference = shopperReference; + this.ShopperStatement = shopperStatement; + this.SocialSecurityNumber = socialSecurityNumber; + this.Splits = splits; + this.StorePaymentMethod = storePaymentMethod; + this.TelephoneNumber = telephoneNumber; + // use default value if no "threeDSAuthenticationOnly" provided + if (threeDSAuthenticationOnly == null) + { + this.ThreeDSAuthenticationOnly = false; + } + else + { + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; + } + this.Token = token; + this.TrustedShopper = trustedShopper; } /// - /// Shopper account information for 3D Secure 2.0. - /// - /// Shopper account information for 3D Secure 2.0. - [DataMember(Name = "accountInfo", EmitDefaultValue = false)] - public AccountInfo AccountInfo { get; set; } - - /// - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. /// - /// If you want a [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) request to use a non-zero value, assign this value to `additionalAmount` (while the amount must be still set to 0 to trigger BIN or card verification). Required to be in the same currency as the `amount`. - [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] - public Amount AdditionalAmount { get; set; } - - /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata). - /// - /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/developers/api-reference/payments-api#paymentrequestadditionaldata). + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. [DataMember(Name = "additionalData", EmitDefaultValue = false)] public Dictionary AdditionalData { get; set; } /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// List of payments methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] public List AllowedPaymentMethods { get; set; } /// - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). + /// Gets or Sets Amount /// - /// The amount information for the transaction. For [BIN or card verification](https://docs.adyen.com/developers/payment-methods/cards/bin-data-and-card-verification) requests, set amount to 0 (zero). [DataMember(Name = "amount", EmitDefaultValue = false)] public Amount Amount { get; set; } /// - /// Application information. + /// Gets or Sets ApplicationInfo /// - /// Application information. [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] - public ApplicationInformation.ApplicationInfo ApplicationInfo { get; set; } - - /// - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request. - /// - /// The details of the bank account, from which the payment should be made. > Either `bankAccount` or `card` field must be provided in a payment request. - [DataMember(Name = "bankAccount", EmitDefaultValue = false)] - public BankAccount BankAccount { get; set; } + public ApplicationInfo ApplicationInfo { get; set; } /// - /// The address where to send the invoice. + /// Gets or Sets BillingAddress /// - /// The address where to send the invoice. [DataMember(Name = "billingAddress", EmitDefaultValue = false)] public Address BillingAddress { get; set; } /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` /// - /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/developers/payment-methods/payment-methods-overview). + /// List of payments methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] public List BlockedPaymentMethods { get; set; } - /// - /// The shopper's browser information. - /// - /// The shopper's browser information. - [DataMember(Name = "browserInfo", EmitDefaultValue = false)] - public BrowserInfo BrowserInfo { get; set; } - /// /// The delay between the authorisation and scheduled auto-capture, specified in hours. /// @@ -426,28 +366,26 @@ protected PaymentSessionRequest() { } [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] public int? CaptureDelayHours { get; set; } - /// - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request. - /// - /// A container for card data. > Either `bankAccount` or `card` field must be provided in a payment request. - [DataMember(Name = "card", EmitDefaultValue = false)] - public Card Card { get; set; } - /// - /// Information regarding the company + /// Gets or Sets Company /// - /// Information regarding the company [DataMember(Name = "company", EmitDefaultValue = false)] public Company Company { get; set; } /// - /// Specify configurations to enable additional features. + /// Gets or Sets Configuration /// - /// Specify configurations to enable additional features. [DataMember(Name = "configuration", EmitDefaultValue = false)] public Configuration Configuration { get; set; } + /// + /// Conversion ID that corresponds to the Id generated for tracking user payment journey. + /// + /// Conversion ID that corresponds to the Id generated for tracking user payment journey. + [DataMember(Name = "conversionId", EmitDefaultValue = false)] + public string ConversionId { get; set; } + /// /// The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE /// @@ -456,23 +394,21 @@ protected PaymentSessionRequest() { } public string CountryCode { get; set; } /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD /// - /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] public DateTime? DateOfBirth { get; set; } /// - /// The forex quote as returned in the response of the forex service. + /// Gets or Sets DccQuote /// - /// The forex quote as returned in the response of the forex service. [DataMember(Name = "dccQuote", EmitDefaultValue = false)] public ForexQuote DccQuote { get; set; } /// - /// The address where the purchased goods should be delivered. + /// Gets or Sets DeliveryAddress /// - /// The address where the purchased goods should be delivered. [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] public Address DeliveryAddress { get; set; } @@ -483,13 +419,6 @@ protected PaymentSessionRequest() { } [DataMember(Name = "deliveryDate", EmitDefaultValue = false)] public DateTime? DeliveryDate { get; set; } - /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting). - /// - /// A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/developers/risk-management/device-fingerprinting). - [DataMember(Name = "deviceFingerprint", EmitDefaultValue = false)] - public string DeviceFingerprint { get; set; } - /// /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. /// @@ -520,23 +449,15 @@ protected PaymentSessionRequest() { } public int? FraudOffset { get; set; } /// - /// Required for the Web integration. Set this parameter to true to use the default Checkout UI from the SDK. - /// - /// Required for the Web integration. Set this parameter to true to use the default Checkout UI from the SDK. - [DataMember(Name = "html", EmitDefaultValue = false)] - public bool? Html { get; set; } - - /// - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments). + /// Gets or Sets Installments /// - /// Contains installment settings. For more information, refer to [Installments](https://docs.adyen.com/developers/payment-methods/installment-payments). [DataMember(Name = "installments", EmitDefaultValue = false)] public Installments Installments { get; set; } /// - /// Line items regarding the payment. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip. /// - /// Line items regarding the payment. + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, AfterPay, Klarna, RatePay, and Zip. [DataMember(Name = "lineItems", EmitDefaultValue = false)] public List LineItems { get; set; } @@ -555,61 +476,46 @@ protected PaymentSessionRequest() { } public string MerchantAccount { get; set; } /// - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. /// - /// This reference allows linking multiple transactions to each other. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] public string MerchantOrderReference { get; set; } /// - /// Additional risk fields for 3D Secure 2.0. - /// - /// Additional risk fields for 3D Secure 2.0. - [DataMember(Name = "merchantRiskIndicator", EmitDefaultValue = false)] - public MerchantRiskIndicator MerchantRiskIndicator { get; set; } - - /// - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\" + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". /// - /// Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\" + /// Metadata consists of entries, each of which includes a key and a value. Limitations: Maximum 20 key-value pairs per request. When exceeding, the \"177\" error occurs: \"Metadata size exceeds limit\". [DataMember(Name = "metadata", EmitDefaultValue = false)] public Dictionary Metadata { get; set; } /// - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa). + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. /// - /// Authentication data produced by an MPI (Mastercard SecureCode or Verified By Visa). - [DataMember(Name = "mpiData", EmitDefaultValue = false)] - public ThreeDSecureData MpiData { get; set; } - - /// - /// The two-character country code of the shopper's nationality. - /// - /// The two-character country code of the shopper's nationality. - [DataMember(Name = "nationality", EmitDefaultValue = false)] - public string Nationality { get; set; } - - /// - /// The order reference to link multiple partial payments. - /// - /// The order reference to link multiple partial payments. + /// When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead. [DataMember(Name = "orderReference", EmitDefaultValue = false)] public string OrderReference { get; set; } /// - /// Required for the Web integration. Set this parameter to the page URL, on which you are loading the SDK. + /// Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. /// - /// Required for the Web integration. Set this parameter to the page URL, on which you are loading the SDK. + /// Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from. [DataMember(Name = "origin", EmitDefaultValue = false)] public string Origin { get; set; } /// - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments). + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. /// - /// The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/developers/features/recurring-payments). - [DataMember(Name = "recurring", EmitDefaultValue = false)] - public Recurring Recurring { get; set; } + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string 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; } /// /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. @@ -619,12 +525,18 @@ protected PaymentSessionRequest() { } public string Reference { get; set; } /// - /// The URL to return to. + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` /// - /// The URL to return to. + /// The URL to return to in case of a redirection. The format depends on the channel. This URL can have a maximum of 1024 characters. * For web, include the protocol `http://` or `https://`. You can also include your own additional query parameters, for example, shopper ID or order reference number. Example: `https://your-company.com/checkout?shopperOrder=12xy` * For iOS, use the custom URL for your app. To know more about setting custom URL schemes, refer to the [Apple Developer documentation](https://developer.apple.com/documentation/uikit/inter-process_communication/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app). Example: `my-app://` * For Android, use a custom URL handled by an Activity on your app. You can configure it with an [intent filter](https://developer.android.com/guide/components/intents-filters). Example: `my-app://your.package.name` [DataMember(Name = "returnUrl", EmitDefaultValue = false)] public string ReturnUrl { get; set; } + /// + /// Gets or Sets RiskData + /// + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData RiskData { get; set; } + /// /// The version of the SDK you are using (for Web SDK integrations only). /// @@ -633,44 +545,23 @@ protected PaymentSessionRequest() { } public string SdkVersion { get; set; } /// - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - /// - /// Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. - [DataMember(Name = "selectedBrand", EmitDefaultValue = false)] - public string SelectedBrand { get; set; } - - /// - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - /// - /// The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. - [DataMember(Name = "selectedRecurringDetailReference", EmitDefaultValue = false)] - public string SelectedRecurringDetailReference { get; set; } - - /// - /// A session ID used to identify a payment session. - /// - /// A session ID used to identify a payment session. - [DataMember(Name = "sessionId", EmitDefaultValue = false)] - public string SessionId { get; set; } - - /// - /// The maximum validity of the session. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 /// - /// The maximum validity of the session. + /// The date and time until when the session remains valid, in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format. For example: 2020-07-18T15:42:40.428+01:00 [DataMember(Name = "sessionValidity", EmitDefaultValue = false)] public string SessionValidity { get; set; } /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. /// - /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + /// The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require `shopperEmail` for all browser-based and mobile implementations. [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] public string ShopperEmail { get; set; } /// - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). /// - /// The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). [DataMember(Name = "shopperIP", EmitDefaultValue = false)] public string ShopperIP { get; set; } @@ -683,67 +574,59 @@ protected PaymentSessionRequest() { } public string ShopperLocale { get; set; } /// - /// The shopper's full name and gender (if specified). + /// Gets or Sets ShopperName /// - /// The shopper's full name and gender (if specified). [DataMember(Name = "shopperName", EmitDefaultValue = false)] public Name ShopperName { get; set; } /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. /// - /// The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments. + /// Your reference to uniquely identify this shopper (for example, user ID or account ID). Minimum length: 3 characters. > This field is required for recurring payments. [DataMember(Name = "shopperReference", EmitDefaultValue = false)] public string ShopperReference { get; set; } /// - /// The text to appear on the shopper's bank statement. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. /// - /// The text to appear on the shopper's bank statement. + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 25 characters, otherwise banks might truncate the string. [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] public string ShopperStatement { get; set; } /// - /// The shopper's social security number. + /// The shopper's social security number. /// - /// The shopper's social security number. + /// The shopper's social security number. [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] public string SocialSecurityNumber { get; set; } /// - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts. + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). /// - /// The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts. - [System.Runtime.Serialization.DataMember(Name = "splits", EmitDefaultValue = false)] - public System.Collections.Generic.List Splits { get; set; } + /// Information on how the payment should be split between accounts when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information). + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// - /// The physical store, for which this payment is processed. + /// When true and `shopperReference` is provided, the payment details will be stored. /// - /// The physical store, for which this payment is processed. - [DataMember(Name = "store", EmitDefaultValue = false)] - public string Store { get; set; } - - /// - /// The physical store, for which this payment is processed. - /// - /// The physical store, for which this payment is processed. + /// When true and `shopperReference` is provided, the payment details will be stored. [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] public bool? StorePaymentMethod { get; set; } /// - /// The shopper's telephone number. + /// The shopper's telephone number. /// - /// The shopper's telephone number. + /// The shopper's telephone number. [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] public string TelephoneNumber { get; set; } /// - /// Request fields for 3D Secure 2.0. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// - /// Request fields for 3D Secure 2.0. - [DataMember(Name = "threeDS2RequestData", EmitDefaultValue = false)] - public ThreeDS2RequestData ThreeDS2RequestData { get; set; } + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool? ThreeDSAuthenticationOnly { get; set; } /// /// The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web. @@ -752,13 +635,6 @@ protected PaymentSessionRequest() { } [DataMember(Name = "token", EmitDefaultValue = false)] public string Token { get; set; } - /// - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - /// - /// The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). - [DataMember(Name = "totalsGroup", EmitDefaultValue = false)] - public string TotalsGroup { get; set; } - /// /// Set to true if the payment should be routed to a trusted MID. /// @@ -774,52 +650,41 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class PaymentSessionRequest {\n"); - sb.Append(" AccountInfo: ").Append(AccountInfo).Append("\n"); - sb.Append(" AdditionalAmount: ").Append(AdditionalAmount).Append("\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods).Append("\n"); + sb.Append(" AdditionalData: ").Append(AdditionalData.ToCollectionsString()).Append("\n"); + sb.Append(" AllowedPaymentMethods: ").Append(AllowedPaymentMethods.ToListString()).Append("\n"); sb.Append(" Amount: ").Append(Amount).Append("\n"); sb.Append(" ApplicationInfo: ").Append(ApplicationInfo).Append("\n"); - sb.Append(" BankAccount: ").Append(BankAccount).Append("\n"); sb.Append(" BillingAddress: ").Append(BillingAddress).Append("\n"); - sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods).Append("\n"); - sb.Append(" BrowserInfo: ").Append(BrowserInfo).Append("\n"); + sb.Append(" BlockedPaymentMethods: ").Append(BlockedPaymentMethods.ToListString()).Append("\n"); sb.Append(" CaptureDelayHours: ").Append(CaptureDelayHours).Append("\n"); - sb.Append(" Card: ").Append(Card).Append("\n"); sb.Append(" Channel: ").Append(Channel).Append("\n"); sb.Append(" Company: ").Append(Company).Append("\n"); sb.Append(" Configuration: ").Append(Configuration).Append("\n"); + sb.Append(" ConversionId: ").Append(ConversionId).Append("\n"); sb.Append(" CountryCode: ").Append(CountryCode).Append("\n"); sb.Append(" DateOfBirth: ").Append(DateOfBirth).Append("\n"); sb.Append(" DccQuote: ").Append(DccQuote).Append("\n"); sb.Append(" DeliveryAddress: ").Append(DeliveryAddress).Append("\n"); sb.Append(" DeliveryDate: ").Append(DeliveryDate).Append("\n"); - sb.Append(" DeviceFingerprint: ").Append(DeviceFingerprint).Append("\n"); sb.Append(" EnableOneClick: ").Append(EnableOneClick).Append("\n"); sb.Append(" EnablePayOut: ").Append(EnablePayOut).Append("\n"); sb.Append(" EnableRecurring: ").Append(EnableRecurring).Append("\n"); sb.Append(" EntityType: ").Append(EntityType).Append("\n"); sb.Append(" FraudOffset: ").Append(FraudOffset).Append("\n"); - sb.Append(" Html: ").Append(Html).Append("\n"); sb.Append(" Installments: ").Append(Installments).Append("\n"); sb.Append(" LineItems: ").Append(LineItems).Append("\n"); sb.Append(" Mcc: ").Append(Mcc).Append("\n"); sb.Append(" MerchantAccount: ").Append(MerchantAccount).Append("\n"); sb.Append(" MerchantOrderReference: ").Append(MerchantOrderReference).Append("\n"); - sb.Append(" MerchantRiskIndicator: ").Append(MerchantRiskIndicator).Append("\n"); sb.Append(" Metadata: ").Append(Metadata).Append("\n"); - sb.Append(" MpiData: ").Append(MpiData).Append("\n"); - sb.Append(" Nationality: ").Append(Nationality).Append("\n"); sb.Append(" OrderReference: ").Append(OrderReference).Append("\n"); sb.Append(" Origin: ").Append(Origin).Append("\n"); - sb.Append(" Recurring: ").Append(Recurring).Append("\n"); - sb.Append(" RecurringProcessingModel: ").Append(RecurringProcessingModel).Append("\n"); + sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n"); + sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n"); sb.Append(" Reference: ").Append(Reference).Append("\n"); sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); + sb.Append(" RiskData: ").Append(RiskData).Append("\n"); sb.Append(" SdkVersion: ").Append(SdkVersion).Append("\n"); - sb.Append(" SelectedBrand: ").Append(SelectedBrand).Append("\n"); - sb.Append(" SelectedRecurringDetailReference: ").Append(SelectedRecurringDetailReference).Append("\n"); - sb.Append(" SessionId: ").Append(SessionId).Append("\n"); sb.Append(" SessionValidity: ").Append(SessionValidity).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); sb.Append(" ShopperIP: ").Append(ShopperIP).Append("\n"); @@ -829,13 +694,11 @@ public override string ToString() sb.Append(" ShopperReference: ").Append(ShopperReference).Append("\n"); sb.Append(" ShopperStatement: ").Append(ShopperStatement).Append("\n"); sb.Append(" SocialSecurityNumber: ").Append(SocialSecurityNumber).Append("\n"); - sb.Append(" StoredPaymentMethod: ").Append(StorePaymentMethod).Append("\n"); sb.Append(" Splits: ").Append(Splits).Append("\n"); - sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" StorePaymentMethod: ").Append(StorePaymentMethod).Append("\n"); sb.Append(" TelephoneNumber: ").Append(TelephoneNumber).Append("\n"); - sb.Append(" ThreeDS2RequestData: ").Append(ThreeDS2RequestData).Append("\n"); + sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).Append("\n"); sb.Append(" Token: ").Append(Token).Append("\n"); - sb.Append(" TotalsGroup: ").Append(TotalsGroup).Append("\n"); sb.Append(" TrustedShopper: ").Append(TrustedShopper).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -845,7 +708,7 @@ public override string 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); } @@ -871,320 +734,260 @@ public bool Equals(PaymentSessionRequest input) return false; return - ( - this.AccountInfo == input.AccountInfo || - (this.AccountInfo != null && - this.AccountInfo.Equals(input.AccountInfo)) - ) && - ( - this.AdditionalAmount == input.AdditionalAmount || - (this.AdditionalAmount != null && - this.AdditionalAmount.Equals(input.AdditionalAmount)) - ) && ( this.AdditionalData == input.AdditionalData || this.AdditionalData != null && - this.AdditionalData.SequenceEqual(input.AdditionalData) + this.AdditionalData.Equals(input.AdditionalData) ) && ( this.AllowedPaymentMethods == input.AllowedPaymentMethods || this.AllowedPaymentMethods != null && + input.AllowedPaymentMethods != null && this.AllowedPaymentMethods.SequenceEqual(input.AllowedPaymentMethods) ) && ( this.Amount == input.Amount || - (this.Amount != null && - this.Amount.Equals(input.Amount)) + this.Amount != null && + this.Amount.Equals(input.Amount) ) && ( this.ApplicationInfo == input.ApplicationInfo || - (this.ApplicationInfo != null && - this.ApplicationInfo.Equals(input.ApplicationInfo)) - ) && - ( - this.BankAccount == input.BankAccount || - (this.BankAccount != null && - this.BankAccount.Equals(input.BankAccount)) + this.ApplicationInfo != null && + this.ApplicationInfo.Equals(input.ApplicationInfo) ) && ( this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) ) && ( this.BlockedPaymentMethods == input.BlockedPaymentMethods || this.BlockedPaymentMethods != null && + input.BlockedPaymentMethods != null && this.BlockedPaymentMethods.SequenceEqual(input.BlockedPaymentMethods) ) && - ( - this.BrowserInfo == input.BrowserInfo || - (this.BrowserInfo != null && - this.BrowserInfo.Equals(input.BrowserInfo)) - ) && ( this.CaptureDelayHours == input.CaptureDelayHours || - (this.CaptureDelayHours != null && - this.CaptureDelayHours.Equals(input.CaptureDelayHours)) - ) && - ( - this.Card == input.Card || - (this.Card != null && - this.Card.Equals(input.Card)) + this.CaptureDelayHours != null && + this.CaptureDelayHours.Equals(input.CaptureDelayHours) ) && ( this.Channel == input.Channel || - (this.Channel != null && - this.Channel.Equals(input.Channel)) + this.Channel != null && + this.Channel.Equals(input.Channel) ) && ( this.Company == input.Company || - (this.Company != null && - this.Company.Equals(input.Company)) + this.Company != null && + this.Company.Equals(input.Company) ) && ( this.Configuration == input.Configuration || - (this.Configuration != null && - this.Configuration.Equals(input.Configuration)) + this.Configuration != null && + this.Configuration.Equals(input.Configuration) + ) && + ( + this.ConversionId == input.ConversionId || + this.ConversionId != null && + this.ConversionId.Equals(input.ConversionId) ) && ( this.CountryCode == input.CountryCode || - (this.CountryCode != null && - this.CountryCode.Equals(input.CountryCode)) + this.CountryCode != null && + this.CountryCode.Equals(input.CountryCode) ) && ( this.DateOfBirth == input.DateOfBirth || - (this.DateOfBirth != null && - this.DateOfBirth.Equals(input.DateOfBirth)) + this.DateOfBirth != null && + this.DateOfBirth.Equals(input.DateOfBirth) ) && ( this.DccQuote == input.DccQuote || - (this.DccQuote != null && - this.DccQuote.Equals(input.DccQuote)) + this.DccQuote != null && + this.DccQuote.Equals(input.DccQuote) ) && ( this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) ) && ( this.DeliveryDate == input.DeliveryDate || - (this.DeliveryDate != null && - this.DeliveryDate.Equals(input.DeliveryDate)) - ) && - ( - this.DeviceFingerprint == input.DeviceFingerprint || - (this.DeviceFingerprint != null && - this.DeviceFingerprint.Equals(input.DeviceFingerprint)) + this.DeliveryDate != null && + this.DeliveryDate.Equals(input.DeliveryDate) ) && ( this.EnableOneClick == input.EnableOneClick || - (this.EnableOneClick != null && - this.EnableOneClick.Equals(input.EnableOneClick)) + this.EnableOneClick != null && + this.EnableOneClick.Equals(input.EnableOneClick) ) && ( this.EnablePayOut == input.EnablePayOut || - (this.EnablePayOut != null && - this.EnablePayOut.Equals(input.EnablePayOut)) + this.EnablePayOut != null && + this.EnablePayOut.Equals(input.EnablePayOut) ) && ( this.EnableRecurring == input.EnableRecurring || - (this.EnableRecurring != null && - this.EnableRecurring.Equals(input.EnableRecurring)) + this.EnableRecurring != null && + this.EnableRecurring.Equals(input.EnableRecurring) ) && ( this.EntityType == input.EntityType || - (this.EntityType != null && - this.EntityType.Equals(input.EntityType)) + this.EntityType != null && + this.EntityType.Equals(input.EntityType) ) && ( this.FraudOffset == input.FraudOffset || - (this.FraudOffset != null && - this.FraudOffset.Equals(input.FraudOffset)) - ) && - ( - this.Html == input.Html || - (this.Html != null && - this.Html.Equals(input.Html)) + this.FraudOffset != null && + this.FraudOffset.Equals(input.FraudOffset) ) && ( this.Installments == input.Installments || - (this.Installments != null && - this.Installments.Equals(input.Installments)) + this.Installments != null && + this.Installments.Equals(input.Installments) ) && ( this.LineItems == input.LineItems || this.LineItems != null && + input.LineItems != null && this.LineItems.SequenceEqual(input.LineItems) ) && ( this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) + this.Mcc != null && + this.Mcc.Equals(input.Mcc) ) && ( this.MerchantAccount == input.MerchantAccount || - (this.MerchantAccount != null && - this.MerchantAccount.Equals(input.MerchantAccount)) + this.MerchantAccount != null && + this.MerchantAccount.Equals(input.MerchantAccount) ) && ( this.MerchantOrderReference == input.MerchantOrderReference || - (this.MerchantOrderReference != null && - this.MerchantOrderReference.Equals(input.MerchantOrderReference)) - ) && - ( - this.MerchantRiskIndicator == input.MerchantRiskIndicator || - (this.MerchantRiskIndicator != null && - this.MerchantRiskIndicator.Equals(input.MerchantRiskIndicator)) + this.MerchantOrderReference != null && + this.MerchantOrderReference.Equals(input.MerchantOrderReference) ) && ( this.Metadata == input.Metadata || this.Metadata != null && + input.Metadata != null && this.Metadata.SequenceEqual(input.Metadata) ) && - ( - this.MpiData == input.MpiData || - (this.MpiData != null && - this.MpiData.Equals(input.MpiData)) - ) && - ( - this.Nationality == input.Nationality || - (this.Nationality != null && - this.Nationality.Equals(input.Nationality)) - ) && ( this.OrderReference == input.OrderReference || - (this.OrderReference != null && - this.OrderReference.Equals(input.OrderReference)) + this.OrderReference != null && + this.OrderReference.Equals(input.OrderReference) ) && ( this.Origin == input.Origin || - (this.Origin != null && - this.Origin.Equals(input.Origin)) + this.Origin != null && + this.Origin.Equals(input.Origin) ) && ( - this.Recurring == input.Recurring || - (this.Recurring != null && - this.Recurring.Equals(input.Recurring)) + this.RecurringExpiry == input.RecurringExpiry || + this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry) ) && ( - this.RecurringProcessingModel == input.RecurringProcessingModel || - (this.RecurringProcessingModel != null && - this.RecurringProcessingModel.Equals(input.RecurringProcessingModel)) + this.RecurringFrequency == input.RecurringFrequency || + this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency) ) && ( this.Reference == input.Reference || - (this.Reference != null && - this.Reference.Equals(input.Reference)) + this.Reference != null && + this.Reference.Equals(input.Reference) ) && ( this.ReturnUrl == input.ReturnUrl || - (this.ReturnUrl != null && - this.ReturnUrl.Equals(input.ReturnUrl)) + this.ReturnUrl != null && + this.ReturnUrl.Equals(input.ReturnUrl) ) && ( - this.SdkVersion == input.SdkVersion || - (this.SdkVersion != null && - this.SdkVersion.Equals(input.SdkVersion)) - ) && - ( - this.SelectedBrand == input.SelectedBrand || - (this.SelectedBrand != null && - this.SelectedBrand.Equals(input.SelectedBrand)) - ) && - ( - this.SelectedRecurringDetailReference == input.SelectedRecurringDetailReference || - (this.SelectedRecurringDetailReference != null && - this.SelectedRecurringDetailReference.Equals(input.SelectedRecurringDetailReference)) + this.RiskData == input.RiskData || + this.RiskData != null && + this.RiskData.Equals(input.RiskData) ) && ( - this.SessionId == input.SessionId || - (this.SessionId != null && - this.SessionId.Equals(input.SessionId)) + this.SdkVersion == input.SdkVersion || + this.SdkVersion != null && + this.SdkVersion.Equals(input.SdkVersion) ) && ( this.SessionValidity == input.SessionValidity || - (this.SessionValidity != null && - this.SessionValidity.Equals(input.SessionValidity)) + this.SessionValidity != null && + this.SessionValidity.Equals(input.SessionValidity) ) && ( this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) ) && ( this.ShopperIP == input.ShopperIP || - (this.ShopperIP != null && - this.ShopperIP.Equals(input.ShopperIP)) + this.ShopperIP != null && + this.ShopperIP.Equals(input.ShopperIP) ) && ( this.ShopperInteraction == input.ShopperInteraction || - (this.ShopperInteraction != null && - this.ShopperInteraction.Equals(input.ShopperInteraction)) + this.ShopperInteraction != null && + this.ShopperInteraction.Equals(input.ShopperInteraction) ) && ( this.ShopperLocale == input.ShopperLocale || - (this.ShopperLocale != null && - this.ShopperLocale.Equals(input.ShopperLocale)) + this.ShopperLocale != null && + this.ShopperLocale.Equals(input.ShopperLocale) ) && ( this.ShopperName == input.ShopperName || - (this.ShopperName != null && - this.ShopperName.Equals(input.ShopperName)) + this.ShopperName != null && + this.ShopperName.Equals(input.ShopperName) ) && ( this.ShopperReference == input.ShopperReference || - (this.ShopperReference != null && - this.ShopperReference.Equals(input.ShopperReference)) + this.ShopperReference != null && + this.ShopperReference.Equals(input.ShopperReference) ) && ( this.ShopperStatement == input.ShopperStatement || - (this.ShopperStatement != null && - this.ShopperStatement.Equals(input.ShopperStatement)) + this.ShopperStatement != null && + this.ShopperStatement.Equals(input.ShopperStatement) ) && ( this.SocialSecurityNumber == input.SocialSecurityNumber || - (this.SocialSecurityNumber != null && - this.SocialSecurityNumber.Equals(input.SocialSecurityNumber)) + this.SocialSecurityNumber != null && + this.SocialSecurityNumber.Equals(input.SocialSecurityNumber) ) && ( this.Splits == input.Splits || this.Splits != null && + input.Splits != null && this.Splits.SequenceEqual(input.Splits) ) && - ( - this.Store == input.Store || - (this.Store != null && - this.Store.Equals(input.Store)) - ) && ( this.StorePaymentMethod == input.StorePaymentMethod || - (this.StorePaymentMethod != null && - this.StorePaymentMethod.Equals(input.StorePaymentMethod)) + this.StorePaymentMethod != null && + this.StorePaymentMethod.Equals(input.StorePaymentMethod) ) && ( this.TelephoneNumber == input.TelephoneNumber || - (this.TelephoneNumber != null && - this.TelephoneNumber.Equals(input.TelephoneNumber)) + this.TelephoneNumber != null && + this.TelephoneNumber.Equals(input.TelephoneNumber) ) && ( - this.ThreeDS2RequestData == input.ThreeDS2RequestData || - (this.ThreeDS2RequestData != null && - this.ThreeDS2RequestData.Equals(input.ThreeDS2RequestData)) + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly != null && + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) ) && ( this.Token == input.Token || - (this.Token != null && - this.Token.Equals(input.Token)) - ) && - ( - this.TotalsGroup == input.TotalsGroup || - (this.TotalsGroup != null && - this.TotalsGroup.Equals(input.TotalsGroup)) + this.Token != null && + this.Token.Equals(input.Token) ) && ( this.TrustedShopper == input.TrustedShopper || - (this.TrustedShopper != null && - this.TrustedShopper.Equals(input.TrustedShopper)) + this.TrustedShopper != null && + this.TrustedShopper.Equals(input.TrustedShopper) ); } @@ -1197,10 +1000,6 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.AccountInfo != null) - hashCode = hashCode * 59 + this.AccountInfo.GetHashCode(); - if (this.AdditionalAmount != null) - hashCode = hashCode * 59 + this.AdditionalAmount.GetHashCode(); if (this.AdditionalData != null) hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); if (this.AllowedPaymentMethods != null) @@ -1209,24 +1008,20 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Amount.GetHashCode(); if (this.ApplicationInfo != null) hashCode = hashCode * 59 + this.ApplicationInfo.GetHashCode(); - if (this.BankAccount != null) - hashCode = hashCode * 59 + this.BankAccount.GetHashCode(); if (this.BillingAddress != null) hashCode = hashCode * 59 + this.BillingAddress.GetHashCode(); if (this.BlockedPaymentMethods != null) hashCode = hashCode * 59 + this.BlockedPaymentMethods.GetHashCode(); - if (this.BrowserInfo != null) - hashCode = hashCode * 59 + this.BrowserInfo.GetHashCode(); if (this.CaptureDelayHours != null) hashCode = hashCode * 59 + this.CaptureDelayHours.GetHashCode(); - if (this.Card != null) - hashCode = hashCode * 59 + this.Card.GetHashCode(); if (this.Channel != null) hashCode = hashCode * 59 + this.Channel.GetHashCode(); if (this.Company != null) hashCode = hashCode * 59 + this.Company.GetHashCode(); if (this.Configuration != null) hashCode = hashCode * 59 + this.Configuration.GetHashCode(); + if (this.ConversionId != null) + hashCode = hashCode * 59 + this.ConversionId.GetHashCode(); if (this.CountryCode != null) hashCode = hashCode * 59 + this.CountryCode.GetHashCode(); if (this.DateOfBirth != null) @@ -1237,8 +1032,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.DeliveryAddress.GetHashCode(); if (this.DeliveryDate != null) hashCode = hashCode * 59 + this.DeliveryDate.GetHashCode(); - if (this.DeviceFingerprint != null) - hashCode = hashCode * 59 + this.DeviceFingerprint.GetHashCode(); if (this.EnableOneClick != null) hashCode = hashCode * 59 + this.EnableOneClick.GetHashCode(); if (this.EnablePayOut != null) @@ -1249,8 +1042,6 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.EntityType.GetHashCode(); if (this.FraudOffset != null) hashCode = hashCode * 59 + this.FraudOffset.GetHashCode(); - if (this.Html != null) - hashCode = hashCode * 59 + this.Html.GetHashCode(); if (this.Installments != null) hashCode = hashCode * 59 + this.Installments.GetHashCode(); if (this.LineItems != null) @@ -1261,34 +1052,24 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.MerchantAccount.GetHashCode(); if (this.MerchantOrderReference != null) hashCode = hashCode * 59 + this.MerchantOrderReference.GetHashCode(); - if (this.MerchantRiskIndicator != null) - hashCode = hashCode * 59 + this.MerchantRiskIndicator.GetHashCode(); if (this.Metadata != null) hashCode = hashCode * 59 + this.Metadata.GetHashCode(); - if (this.MpiData != null) - hashCode = hashCode * 59 + this.MpiData.GetHashCode(); - if (this.Nationality != null) - hashCode = hashCode * 59 + this.Nationality.GetHashCode(); if (this.OrderReference != null) hashCode = hashCode * 59 + this.OrderReference.GetHashCode(); if (this.Origin != null) hashCode = hashCode * 59 + this.Origin.GetHashCode(); - if (this.Recurring != null) - hashCode = hashCode * 59 + this.Recurring.GetHashCode(); - if (this.RecurringProcessingModel != null) - hashCode = hashCode * 59 + this.RecurringProcessingModel.GetHashCode(); + if (this.RecurringExpiry != null) + hashCode = hashCode * 59 + this.RecurringExpiry.GetHashCode(); + if (this.RecurringFrequency != null) + hashCode = hashCode * 59 + this.RecurringFrequency.GetHashCode(); if (this.Reference != null) hashCode = hashCode * 59 + this.Reference.GetHashCode(); if (this.ReturnUrl != null) hashCode = hashCode * 59 + this.ReturnUrl.GetHashCode(); + if (this.RiskData != null) + hashCode = hashCode * 59 + this.RiskData.GetHashCode(); if (this.SdkVersion != null) hashCode = hashCode * 59 + this.SdkVersion.GetHashCode(); - if (this.SelectedBrand != null) - hashCode = hashCode * 59 + this.SelectedBrand.GetHashCode(); - if (this.SelectedRecurringDetailReference != null) - hashCode = hashCode * 59 + this.SelectedRecurringDetailReference.GetHashCode(); - if (this.SessionId != null) - hashCode = hashCode * 59 + this.SessionId.GetHashCode(); if (this.SessionValidity != null) hashCode = hashCode * 59 + this.SessionValidity.GetHashCode(); if (this.ShopperEmail != null) @@ -1309,18 +1090,14 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.SocialSecurityNumber.GetHashCode(); if (this.Splits != null) hashCode = hashCode * 59 + this.Splits.GetHashCode(); - if (this.Store != null) - hashCode = hashCode * 59 + this.Store.GetHashCode(); if (this.StorePaymentMethod != null) hashCode = hashCode * 59 + this.StorePaymentMethod.GetHashCode(); if (this.TelephoneNumber != null) hashCode = hashCode * 59 + this.TelephoneNumber.GetHashCode(); - if (this.ThreeDS2RequestData != null) - hashCode = hashCode * 59 + this.ThreeDS2RequestData.GetHashCode(); + if (this.ThreeDSAuthenticationOnly != null) + hashCode = hashCode * 59 + this.ThreeDSAuthenticationOnly.GetHashCode(); if (this.Token != null) hashCode = hashCode * 59 + this.Token.GetHashCode(); - if (this.TotalsGroup != null) - hashCode = hashCode * 59 + this.TotalsGroup.GetHashCode(); if (this.TrustedShopper != null) hashCode = hashCode * 59 + this.TrustedShopper.GetHashCode(); return hashCode; @@ -1332,38 +1109,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - // Nationality (string) maxLength - if (this.Nationality != null && this.Nationality.Length > 2) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Nationality, length must be less than 2.", new[] { "Nationality" }); - } - - // Store (string) maxLength - if (this.Store != null && this.Store.Length > 16) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be less than 16.", new[] { "Store" }); - } - - // Store (string) minLength - if (this.Store != null && this.Store.Length < 1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Store, length must be greater than 1.", new[] { "Store" }); - } - - // TotalsGroup (string) maxLength - if (this.TotalsGroup != null && this.TotalsGroup.Length > 16) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be less than 16.", new[] { "TotalsGroup" }); - } - - // TotalsGroup (string) minLength - if (this.TotalsGroup != null && this.TotalsGroup.Length < 1) - { - yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for TotalsGroup, length must be greater than 1.", new[] { "TotalsGroup" }); - } yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentSessionResponse.cs b/Adyen/Model/Checkout/PaymentSessionResponse.cs index f6c94f0fc..9d95cdae1 100644 --- a/Adyen/Model/Checkout/PaymentSessionResponse.cs +++ b/Adyen/Model/Checkout/PaymentSessionResponse.cs @@ -1,31 +1,34 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Adyen.Util; using Newtonsoft.Json; namespace Adyen.Model.Checkout @@ -34,24 +37,34 @@ namespace Adyen.Model.Checkout /// PaymentSessionResponse /// [DataContract] - public partial class PaymentSessionResponse : IEquatable, IValidatableObject + public partial class PaymentSessionResponse : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The encoded payment session that you need to pass to the SDK.. - public PaymentSessionResponse(string PaymentSession = default(string)) + /// The encoded payment session that you need to pass to the SDK.. + /// The detailed list of stored payment details required to generate payment forms. Will be empty if oneClick is set to false in the request.. + public PaymentSessionResponse(string paymentSession = default(string), + List recurringDetails = default(List)) { - this.PaymentSession = PaymentSession; + this.PaymentSession = paymentSession; + this.RecurringDetails = recurringDetails; } - + /// /// The encoded payment session that you need to pass to the SDK. /// /// The encoded payment session that you need to pass to the SDK. - [DataMember(Name="paymentSession", EmitDefaultValue=false)] + [DataMember(Name = "paymentSession", EmitDefaultValue = false)] public string PaymentSession { get; set; } + /// + /// The detailed list of stored payment details required to generate payment forms. Will be empty if oneClick is set to false in the request. + /// + /// The detailed list of stored payment details required to generate payment forms. Will be empty if oneClick is set to false in the request. + [DataMember(Name = "recurringDetails", EmitDefaultValue = false)] + public List RecurringDetails { get; set; } + /// /// Returns the string presentation of the object /// @@ -61,15 +74,16 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class PaymentSessionResponse {\n"); sb.Append(" PaymentSession: ").Append(PaymentSession).Append("\n"); + sb.Append(" RecurringDetails: ").Append(RecurringDetails.ObjectListToString()).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); } @@ -94,11 +108,17 @@ public bool Equals(PaymentSessionResponse input) if (input == null) return false; - return + return ( this.PaymentSession == input.PaymentSession || - (this.PaymentSession != null && - this.PaymentSession.Equals(input.PaymentSession)) + this.PaymentSession != null && + this.PaymentSession.Equals(input.PaymentSession) + ) && + ( + this.RecurringDetails == input.RecurringDetails || + this.RecurringDetails != null && + input.RecurringDetails != null && + this.RecurringDetails.SequenceEqual(input.RecurringDetails) ); } @@ -113,6 +133,8 @@ public override int GetHashCode() int hashCode = 41; if (this.PaymentSession != null) hashCode = hashCode * 59 + this.PaymentSession.GetHashCode(); + if (this.RecurringDetails != null) + hashCode = hashCode * 59 + this.RecurringDetails.GetHashCode(); return hashCode; } } @@ -122,10 +144,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentsDetailsRequest.cs b/Adyen/Model/Checkout/PaymentsDetailsRequest.cs index 7b6c56fab..d3af0573c 100644 --- a/Adyen/Model/Checkout/PaymentsDetailsRequest.cs +++ b/Adyen/Model/Checkout/PaymentsDetailsRequest.cs @@ -1,31 +1,31 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; -using System.Linq; using System.Runtime.Serialization; using System.Text; using Newtonsoft.Json; @@ -36,61 +36,50 @@ namespace Adyen.Model.Checkout /// PaymentsDetailsRequest /// [DataContract] - public partial class PaymentsDetailsRequest : IEquatable, IValidatableObject + public partial class PaymentsDetailsRequest : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected PaymentsDetailsRequest() { } - /// - /// Initializes a new instance of the class. - /// - /// Use this collection to submit the details that were returned as a result of the `/payments` call. (required). - /// The `paymentData` value that you received in the response to the `/payments` call. (required). - public PaymentsDetailsRequest(Dictionary Details = default(Dictionary), string PaymentData = default(string)) - { - // to ensure "Details" is required (not null) - if (Details == null) - { - throw new InvalidDataException("Details is a required property for PaymentsDetailsRequest and cannot be null"); - } - else - { - this.Details = Details; - } - this.PaymentData = PaymentData; - } - /// - /// Initializes a new instance of the class. - /// - /// Use this collection to submit the details that were returned as a result of the `/payments` call. (required). - public PaymentsDetailsRequest(Dictionary Details = default(Dictionary)) + /// details (required). + /// The `paymentData` value that you received in the response to the `/payments` call.. + /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously.. + public PaymentsDetailsRequest(PaymentCompletionDetails details = default(PaymentCompletionDetails), + string paymentData = default(string), bool? threeDSAuthenticationOnly = default(bool?)) { - // to ensure "Details" is required (not null) - if (Details == null) + // to ensure "details" is required (not null) + if (details == null) { - throw new InvalidDataException("Details is a required property for PaymentsDetailsRequest and cannot be null"); + throw new InvalidDataException("details is a required property for PaymentsDetailsRequest and cannot be null"); } else { - this.Details = Details; + this.Details = details; } + this.PaymentData = paymentData; + this.ThreeDSAuthenticationOnly = threeDSAuthenticationOnly; } + /// - /// Use this collection to submit the details that were returned as a result of the `/payments` call. + /// Gets or Sets Details /// - /// Use this collection to submit the details that were returned as a result of the `/payments` call. - [DataMember(Name="details", EmitDefaultValue=false)] - public Dictionary Details { get; set; } + [DataMember(Name = "details", EmitDefaultValue = false)] + public PaymentCompletionDetails Details { get; set; } /// /// The `paymentData` value that you received in the response to the `/payments` call. /// /// The `paymentData` value that you received in the response to the `/payments` call. - [DataMember(Name="paymentData", EmitDefaultValue=false)] + [DataMember(Name = "paymentData", EmitDefaultValue = false)] public string PaymentData { get; set; } + /// + /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. + /// + /// Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously. + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool? ThreeDSAuthenticationOnly { get; set; } + /// /// Returns the string presentation of the object /// @@ -101,15 +90,16 @@ public override string ToString() sb.Append("class PaymentsDetailsRequest {\n"); sb.Append(" Details: ").Append(Details).Append("\n"); sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); + sb.Append(" ThreeDSAuthenticationOnly: ").Append(ThreeDSAuthenticationOnly).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); } @@ -134,16 +124,21 @@ public bool Equals(PaymentsDetailsRequest input) if (input == null) return false; - return + return ( this.Details == input.Details || this.Details != null && - this.Details.SequenceEqual(input.Details) - ) && + this.Details.Equals(input.Details) + ) && ( this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) + this.PaymentData != null && + this.PaymentData.Equals(input.PaymentData) + ) && + ( + this.ThreeDSAuthenticationOnly == input.ThreeDSAuthenticationOnly || + this.ThreeDSAuthenticationOnly != null && + this.ThreeDSAuthenticationOnly.Equals(input.ThreeDSAuthenticationOnly) ); } @@ -160,6 +155,8 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.Details.GetHashCode(); if (this.PaymentData != null) hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); + if (this.ThreeDSAuthenticationOnly != null) + hashCode = hashCode * 59 + this.ThreeDSAuthenticationOnly.GetHashCode(); return hashCode; } } @@ -169,10 +166,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/PaymentsResponse.cs b/Adyen/Model/Checkout/PaymentsResponse.cs deleted file mode 100644 index d1d834588..000000000 --- a/Adyen/Model/Checkout/PaymentsResponse.cs +++ /dev/null @@ -1,427 +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.Linq; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; - -namespace Adyen.Model.Checkout -{ - /// - /// PaymentResponse - /// - [DataContract] - public partial class PaymentsResponse : IEquatable, IValidatableObject - { - /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. - /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. - [JsonConverter(typeof(StringEnumConverter))] - public enum ResultCodeEnum - { - /// - /// Enum AuthenticationFinished for value: AuthenticationFinished - /// - [EnumMember(Value = "AuthenticationFinished")] - AuthenticationFinished = 0, - /// - /// Enum Authorised for value: Authorised - /// - [EnumMember(Value = "Authorised")] - Authorised = 1, - /// - /// Enum Cancelled for value: Cancelled - /// - [EnumMember(Value = "Cancelled")] - Cancelled = 2, - /// - /// Enum ChallengeShopper for value: ChallengeShopper - /// - [EnumMember(Value = "ChallengeShopper")] - ChallengeShopper = 3, - /// - /// Enum Error for value: Error - /// - [EnumMember(Value = "Error")] - Error = 4, - /// - /// Enum IdentifyShopper for value: IdentifyShopper - /// - [EnumMember(Value = "IdentifyShopper")] - IdentifyShopper = 5, - /// - /// Enum Pending for value: Pending - /// - [EnumMember(Value = "Pending")] - Pending = 6, - /// - /// Enum Received for value: Received - /// - [EnumMember(Value = "Received")] - Received = 7, - /// - /// Enum RedirectShopper for value: RedirectShopper - /// - [EnumMember(Value = "RedirectShopper")] - RedirectShopper = 8, - /// - /// Enum Refused for value: Refused - /// - [EnumMember(Value = "Refused")] - Refused = 9, - /// - /// Enum PresentToShopper for value: PresentToShopper - /// - [EnumMember(Value = "PresentToShopper")] - PresentToShopper = 10, - /// - /// Enum AuthenticationNotRequired for value: AuthenticationNotRequired - /// - [EnumMember(Value = "AuthenticationNotRequired")] - AuthenticationNotRequired = 11 - } - /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. - /// - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. - [DataMember(Name = "resultCode", EmitDefaultValue = false)] - public ResultCodeEnum? ResultCode { get; set; } - /// - /// Initializes a new instance of the class. - /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.. - /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. . - /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint.. - /// fraudResult. - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. (required). - /// Contains the details that will be presented to the shopper.. - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint.. - /// 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. > `pspReference` is returned only for non-redirect payment methods.. - /// redirect. - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.. - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).. - /// The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **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. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **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. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **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. . - /// If your server received an action object in the/payments response, pass the object back to your front end. Make sure that you only pass the action object and not the full response. - /// Send the property below within the threeDS2Result object to submit the results of the challenge flow - /// - public PaymentsResponse(Dictionary additionalData = default(Dictionary), Dictionary authentication = default(Dictionary), List details = default(List), FraudResult fraudResult = default(FraudResult), string merchantReference = default(string), Dictionary outputDetails = default(Dictionary), string paymentData = default(string), string pspReference = default(string), Redirect redirect = default(Redirect), string refusalReason = default(string), string refusalReasonCode = default(string), ResultCodeEnum? resultCode = default(ResultCodeEnum?),CheckoutPaymentsAction action=default(CheckoutPaymentsAction), ThreeDS2Result threeDS2Result=default(ThreeDS2Result),ServiceError serviceError=default(ServiceError)) - { - this.AdditionalData = additionalData; - this.Authentication = authentication; - this.Details = details; - this.FraudResult = fraudResult; - this.OutputDetails = outputDetails; - this.PaymentData = paymentData; - this.PspReference = pspReference; - this.Redirect = redirect; - this.RefusalReason = refusalReason; - this.RefusalReasonCode = refusalReasonCode; - this.ResultCode = resultCode; - this.Action = action; - this.MerchantReference = merchantReference; - this.ServiceError = serviceError; - this.ThreeDS2Result = threeDS2Result; - } - - /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**. - /// - /// This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**. - [DataMember(Name = "additionalData", EmitDefaultValue = false)] - public Dictionary AdditionalData { get; set; } - - /// - /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. - /// - /// Contains `threeds2.fingerprint` or `threeds2.challengeToken` values to be used in further calls to `/payments/details` endpoint. - [DataMember(Name = "authentication", EmitDefaultValue = false)] - public Dictionary Authentication { get; set; } - - /// - /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint. - /// - /// When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint. - [DataMember(Name = "details", EmitDefaultValue = false)] - public List Details { get; set; } - - /// - /// Gets or Sets FraudResult - /// - [DataMember(Name = "fraudResult", EmitDefaultValue = false)] - public FraudResult FraudResult { get; set; } - - /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - /// - /// The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters. - [DataMember(Name = "merchantReference", EmitDefaultValue = false)] - public string MerchantReference { get; set; } - - /// - /// Contains the details that will be presented to the shopper. - /// - /// Contains the details that will be presented to the shopper. - [DataMember(Name = "outputDetails", EmitDefaultValue = false)] - public Dictionary OutputDetails { get; set; } - - /// - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. - /// - /// When non-empty, contains a value that you must submit to the `/payments/details` endpoint. - [DataMember(Name = "paymentData", EmitDefaultValue = false)] - public string PaymentData { get; set; } - - /// - /// 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. > `pspReference` is returned only for non-redirect payment methods. - /// - /// 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. > `pspReference` is returned only for non-redirect payment methods. - [DataMember(Name = "pspReference", EmitDefaultValue = false)] - public string PspReference { get; set; } - - /// - /// Gets or Sets Redirect - /// - [DataMember(Name = "redirect", EmitDefaultValue = false)] - public Redirect Redirect { get; set; } - - /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - /// - /// If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. - [DataMember(Name = "refusalReason", EmitDefaultValue = false)] - public string RefusalReason { get; set; } - - /// - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - /// - /// Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons). - [DataMember(Name = "refusalReasonCode", EmitDefaultValue = false)] - public string RefusalReasonCode { get; set; } - - [DataMember(Name = "action", EmitDefaultValue = false)] - public CheckoutPaymentsAction Action { get; set; } - /// - /// Send the property below within the threeDS2Result object to submit the results of the challenge flow - /// - [DataMember(Name = "threeDS2Result", EmitDefaultValue = false)] - public ThreeDS2Result ThreeDS2Result { get; set; } - - [DataMember(Name = "serviceError", EmitDefaultValue = false)] - public ServiceError ServiceError { 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 PaymentsResponse {\n"); - sb.Append(" AdditionalData: ").Append(AdditionalData).Append("\n"); - sb.Append(" Authentication: ").Append(Authentication).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); - sb.Append(" FraudResult: ").Append(FraudResult).Append("\n"); - sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); - sb.Append(" OutputDetails: ").Append(OutputDetails).Append("\n"); - sb.Append(" PaymentData: ").Append(PaymentData).Append("\n"); - sb.Append(" PspReference: ").Append(PspReference).Append("\n"); - sb.Append(" Redirect: ").Append(Redirect).Append("\n"); - sb.Append(" RefusalReason: ").Append(RefusalReason).Append("\n"); - sb.Append(" RefusalReasonCode: ").Append(RefusalReasonCode).Append("\n"); - sb.Append(" ResultCode: ").Append(ResultCode).Append("\n"); - sb.Append(" Action: ").Append(Action).Append("\n"); - sb.Append(" ThreeDS2Result: ").Append(ThreeDS2Result).Append("\n"); - sb.Append(" ServiceError: ").Append(ServiceError).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public virtual string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as PaymentsResponse); - } - - /// - /// Returns true if PaymentResponse instances are equal - /// - /// Instance of PaymentResponse to be compared - /// Boolean - public bool Equals(PaymentsResponse input) - { - if (input == null) - return false; - - return - ( - this.AdditionalData == input.AdditionalData || - (this.AdditionalData != null && - this.AdditionalData.Equals(input.AdditionalData)) - ) && - ( - this.Authentication == input.Authentication || - (this.Authentication != null && - this.Authentication.Equals(input.Authentication)) - ) && - ( - this.Details == input.Details || - this.Details != null && - input.Details != null && - this.Details.SequenceEqual(input.Details) - ) && - ( - 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.OutputDetails == input.OutputDetails || - (this.OutputDetails != null && - this.OutputDetails.Equals(input.OutputDetails)) - ) && - ( - this.PaymentData == input.PaymentData || - (this.PaymentData != null && - this.PaymentData.Equals(input.PaymentData)) - ) && - ( - this.PspReference == input.PspReference || - (this.PspReference != null && - this.PspReference.Equals(input.PspReference)) - ) && - ( - this.Redirect == input.Redirect || - (this.Redirect != null && - this.Redirect.Equals(input.Redirect)) - ) && - ( - this.RefusalReason == input.RefusalReason || - (this.RefusalReason != null && - this.RefusalReason.Equals(input.RefusalReason)) - ) && - ( - this.RefusalReasonCode == input.RefusalReasonCode || - (this.RefusalReasonCode != null && - this.RefusalReasonCode.Equals(input.RefusalReasonCode)) - ) && - ( - this.ResultCode == input.ResultCode || - (this.ResultCode != null && - this.ResultCode.Equals(input.ResultCode)) - ) && - ( - this.Action == input.Action || - (this.Action != null && - this.Action.Equals(input.Action)) - ) && - ( - this.ThreeDS2Result == input.ThreeDS2Result || - (this.ThreeDS2Result != null && - this.ThreeDS2Result.Equals(input.ThreeDS2Result)) - ) && - ( - this.ServiceError == input.ServiceError || - (this.ServiceError != null && - this.ServiceError.Equals(input.ServiceError)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.AdditionalData != null) - hashCode = hashCode * 59 + this.AdditionalData.GetHashCode(); - if (this.Authentication != null) - hashCode = hashCode * 59 + this.Authentication.GetHashCode(); - if (this.Details != null) - hashCode = hashCode * 59 + this.Details.GetHashCode(); - if (this.FraudResult != null) - hashCode = hashCode * 59 + this.FraudResult.GetHashCode(); - if (this.MerchantReference != null) - hashCode = hashCode * 59 + this.MerchantReference.GetHashCode(); - if (this.OutputDetails != null) - hashCode = hashCode * 59 + this.OutputDetails.GetHashCode(); - if (this.PaymentData != null) - hashCode = hashCode * 59 + this.PaymentData.GetHashCode(); - if (this.PspReference != null) - hashCode = hashCode * 59 + this.PspReference.GetHashCode(); - if (this.Redirect != null) - hashCode = hashCode * 59 + this.Redirect.GetHashCode(); - if (this.RefusalReason != null) - hashCode = hashCode * 59 + this.RefusalReason.GetHashCode(); - if (this.RefusalReasonCode != null) - hashCode = hashCode * 59 + this.RefusalReasonCode.GetHashCode(); - if (this.ResultCode != null) - hashCode = hashCode * 59 + this.ResultCode.GetHashCode(); - if (this.Action != null) - hashCode = hashCode * 59 + this.Action.GetHashCode(); - if (this.ThreeDS2Result != null) - hashCode = hashCode * 59 + this.ThreeDS2Result.GetHashCode(); - if (this.ServiceError != null) - hashCode = hashCode * 59 + this.ServiceError.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } -} diff --git a/Adyen/Model/Checkout/Permit.cs b/Adyen/Model/Checkout/Permit.cs deleted file mode 100644 index 931b2e870..000000000 --- a/Adyen/Model/Checkout/Permit.cs +++ /dev/null @@ -1,199 +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.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - /// - /// Permit - /// - [DataContract] - public partial class Permit : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Partner ID (when using the permit-per-partner token sharing model).. - /// The profile to apply to this permit (when using the shared permits model).. - /// Permit level restriction overrides.. - /// The key to link permit requests to permit results.. - /// The expiry date for this permit.. - public Permit(string PartnerId = default(string), string ProfileReference = default(string), PermitRestriction Restriction = default(PermitRestriction), string ResultKey = default(string), DateTime? ValidTillDate = default(DateTime?)) - { - this.PartnerId = PartnerId; - this.ProfileReference = ProfileReference; - this.Restriction = Restriction; - this.ResultKey = ResultKey; - this.ValidTillDate = ValidTillDate; - } - - /// - /// Partner ID (when using the permit-per-partner token sharing model). - /// - /// Partner ID (when using the permit-per-partner token sharing model). - [DataMember(Name="partnerId", EmitDefaultValue=false)] - public string PartnerId { get; set; } - - /// - /// The profile to apply to this permit (when using the shared permits model). - /// - /// The profile to apply to this permit (when using the shared permits model). - [DataMember(Name="profileReference", EmitDefaultValue=false)] - public string ProfileReference { get; set; } - - /// - /// Permit level restriction overrides. - /// - /// Permit level restriction overrides. - [DataMember(Name="restriction", EmitDefaultValue=false)] - public PermitRestriction Restriction { get; set; } - - /// - /// The key to link permit requests to permit results. - /// - /// The key to link permit requests to permit results. - [DataMember(Name="resultKey", EmitDefaultValue=false)] - public string ResultKey { get; set; } - - /// - /// The expiry date for this permit. - /// - /// The expiry date for this permit. - [DataMember(Name="validTillDate", EmitDefaultValue=false)] - public DateTime? ValidTillDate { 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 Permit {\n"); - sb.Append(" PartnerId: ").Append(PartnerId).Append("\n"); - sb.Append(" ProfileReference: ").Append(ProfileReference).Append("\n"); - sb.Append(" Restriction: ").Append(Restriction).Append("\n"); - sb.Append(" ResultKey: ").Append(ResultKey).Append("\n"); - sb.Append(" ValidTillDate: ").Append(ValidTillDate).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 input) - { - return this.Equals(input as Permit); - } - - /// - /// Returns true if Permit instances are equal - /// - /// Instance of Permit to be compared - /// Boolean - public bool Equals(Permit input) - { - if (input == null) - return false; - - return - ( - this.PartnerId == input.PartnerId || - (this.PartnerId != null && - this.PartnerId.Equals(input.PartnerId)) - ) && - ( - this.ProfileReference == input.ProfileReference || - (this.ProfileReference != null && - this.ProfileReference.Equals(input.ProfileReference)) - ) && - ( - this.Restriction == input.Restriction || - (this.Restriction != null && - this.Restriction.Equals(input.Restriction)) - ) && - ( - this.ResultKey == input.ResultKey || - (this.ResultKey != null && - this.ResultKey.Equals(input.ResultKey)) - ) && - ( - this.ValidTillDate == input.ValidTillDate || - (this.ValidTillDate != null && - this.ValidTillDate.Equals(input.ValidTillDate)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.PartnerId != null) - hashCode = hashCode * 59 + this.PartnerId.GetHashCode(); - if (this.ProfileReference != null) - hashCode = hashCode * 59 + this.ProfileReference.GetHashCode(); - if (this.Restriction != null) - hashCode = hashCode * 59 + this.Restriction.GetHashCode(); - if (this.ResultKey != null) - hashCode = hashCode * 59 + this.ResultKey.GetHashCode(); - if (this.ValidTillDate != null) - hashCode = hashCode * 59 + this.ValidTillDate.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/PermitRestriction.cs b/Adyen/Model/Checkout/PermitRestriction.cs deleted file mode 100644 index dfa71d303..000000000 --- a/Adyen/Model/Checkout/PermitRestriction.cs +++ /dev/null @@ -1,165 +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.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - /// - /// PermitRestriction - /// - [DataContract] - public partial class PermitRestriction : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// The total sum amount of one or more payments made using this permit may not exceed this amount if set.. - /// The amount of any single payment using this permit may not exceed this amount if set.. - /// Only a single payment can be made using this permit if set to true, otherwise multiple payments are allowed.. - public PermitRestriction(Amount MaxAmount = default(Amount), Amount SingleTransactionLimit = default(Amount), bool? SingleUse = default(bool?)) - { - this.MaxAmount = MaxAmount; - this.SingleTransactionLimit = SingleTransactionLimit; - this.SingleUse = SingleUse; - } - - /// - /// The total sum amount of one or more payments made using this permit may not exceed this amount if set. - /// - /// The total sum amount of one or more payments made using this permit may not exceed this amount if set. - [DataMember(Name="maxAmount", EmitDefaultValue=false)] - public Amount MaxAmount { get; set; } - - /// - /// The amount of any single payment using this permit may not exceed this amount if set. - /// - /// The amount of any single payment using this permit may not exceed this amount if set. - [DataMember(Name="singleTransactionLimit", EmitDefaultValue=false)] - public Amount SingleTransactionLimit { get; set; } - - /// - /// Only a single payment can be made using this permit if set to true, otherwise multiple payments are allowed. - /// - /// Only a single payment can be made using this permit if set to true, otherwise multiple payments are allowed. - [DataMember(Name="singleUse", EmitDefaultValue=false)] - public bool? SingleUse { 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 PermitRestriction {\n"); - sb.Append(" MaxAmount: ").Append(MaxAmount).Append("\n"); - sb.Append(" SingleTransactionLimit: ").Append(SingleTransactionLimit).Append("\n"); - sb.Append(" SingleUse: ").Append(SingleUse).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 input) - { - return this.Equals(input as PermitRestriction); - } - - /// - /// Returns true if PermitRestriction instances are equal - /// - /// Instance of PermitRestriction to be compared - /// Boolean - public bool Equals(PermitRestriction input) - { - if (input == null) - return false; - - return - ( - this.MaxAmount == input.MaxAmount || - (this.MaxAmount != null && - this.MaxAmount.Equals(input.MaxAmount)) - ) && - ( - this.SingleTransactionLimit == input.SingleTransactionLimit || - (this.SingleTransactionLimit != null && - this.SingleTransactionLimit.Equals(input.SingleTransactionLimit)) - ) && - ( - this.SingleUse == input.SingleUse || - (this.SingleUse != null && - this.SingleUse.Equals(input.SingleUse)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.MaxAmount != null) - hashCode = hashCode * 59 + this.MaxAmount.GetHashCode(); - if (this.SingleTransactionLimit != null) - hashCode = hashCode * 59 + this.SingleTransactionLimit.GetHashCode(); - if (this.SingleUse != null) - hashCode = hashCode * 59 + this.SingleUse.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/PersonalDetails.cs b/Adyen/Model/Checkout/PersonalDetails.cs index ed7a44b6e..cf8ce80b5 100644 --- a/Adyen/Model/Checkout/PersonalDetails.cs +++ b/Adyen/Model/Checkout/PersonalDetails.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) 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.Collections.Generic; diff --git a/Adyen/Model/Checkout/Recurring.cs b/Adyen/Model/Checkout/Recurring.cs index b6b82e85f..29be3dc42 100644 --- a/Adyen/Model/Checkout/Recurring.cs +++ b/Adyen/Model/Checkout/Recurring.cs @@ -1,30 +1,30 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -36,41 +36,38 @@ namespace Adyen.Model.Checkout /// 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/developers/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/developers/payment-glossary#cardnotpresentcnp). * `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/developers/features/third-party-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/checkout/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/developers/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/developers/payment-glossary#cardnotpresentcnp). * `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/developers/features/third-party-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/checkout/online-payouts). [JsonConverter(typeof(StringEnumConverter))] public enum ContractEnum { - /// /// Enum ONECLICK for value: ONECLICK /// - [EnumMember(Value = "ONECLICK")] - ONECLICK = 1, - + [EnumMember(Value = "ONECLICK")] ONECLICK = 1, + /// /// Enum RECURRING for value: RECURRING /// - [EnumMember(Value = "RECURRING")] - RECURRING = 2, - + [EnumMember(Value = "RECURRING")] RECURRING = 2, + /// /// Enum PAYOUT for value: PAYOUT /// - [EnumMember(Value = "PAYOUT")] - PAYOUT = 3 + [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/developers/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/developers/payment-glossary#cardnotpresentcnp). * `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/developers/features/third-party-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/checkout/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/developers/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/developers/payment-glossary#cardnotpresentcnp). * `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/developers/features/third-party-payouts). - [DataMember(Name="contract", EmitDefaultValue=false)] + /// 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/checkout/online-payouts). + [DataMember(Name = "contract", EmitDefaultValue = false)] public ContractEnum? Contract { get; set; } + /// /// The name of the token service. /// @@ -78,72 +75,63 @@ public enum ContractEnum [JsonConverter(typeof(StringEnumConverter))] public enum TokenServiceEnum { - /// /// Enum VISATOKENSERVICE for value: VISATOKENSERVICE /// - [EnumMember(Value = "VISATOKENSERVICE")] - VISATOKENSERVICE = 1, - + [EnumMember(Value = "VISATOKENSERVICE")] VISATOKENSERVICE = 1, + /// /// Enum MCTOKENSERVICE for value: MCTOKENSERVICE /// - [EnumMember(Value = "MCTOKENSERVICE")] - MCTOKENSERVICE = 2 + [EnumMember(Value = "MCTOKENSERVICE")] MCTOKENSERVICE = 2 } /// /// The name of the token service. /// /// The name of the token service. - [DataMember(Name="tokenService", EmitDefaultValue=false)] + [DataMember(Name = "tokenService", EmitDefaultValue = false)] public TokenServiceEnum? TokenService { get; set; } + /// /// Initializes a new instance of the class. /// - /// 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/developers/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/developers/payment-glossary#cardnotpresentcnp). * `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/developers/features/third-party-payouts).. - /// Permit requests for this recurring contract.. - /// A descriptive name for this detail.. - /// Date after which no further authorisations shall be performed. Only for 3D Secure 2.0.. - /// Minimum number of days between authorisations. Only for 3D Secure 2.0.. - /// The name of the token service.. - public Recurring(ContractEnum? Contract = default(ContractEnum?), List Permits = default(List), string RecurringDetailName = default(string), DateTime? RecurringExpiry = default(DateTime?), string RecurringFrequency = default(string), TokenServiceEnum? TokenService = default(TokenServiceEnum?)) + /// 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/checkout/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.Contract = Contract; - this.Permits = Permits; - this.RecurringDetailName = RecurringDetailName; - this.RecurringExpiry = RecurringExpiry; - this.RecurringFrequency = RecurringFrequency; - this.TokenService = TokenService; + this.Contract = contract; + this.RecurringDetailName = recurringDetailName; + this.RecurringExpiry = recurringExpiry; + this.RecurringFrequency = recurringFrequency; + this.TokenService = tokenService; } - - /// - /// Permit requests for this recurring contract. - /// - /// Permit requests for this recurring contract. - [DataMember(Name="permits", EmitDefaultValue=false)] - public List Permits { get; set; } /// /// 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.0. + /// 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.0. - [DataMember(Name="recurringExpiry", EmitDefaultValue=false)] + /// 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.0. + /// Minimum number of days between authorisations. Only for 3D Secure 2. /// - /// Minimum number of days between authorisations. Only for 3D Secure 2.0. - [DataMember(Name="recurringFrequency", EmitDefaultValue=false)] + /// Minimum number of days between authorisations. Only for 3D Secure 2. + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] public string RecurringFrequency { get; set; } @@ -156,7 +144,6 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class Recurring {\n"); sb.Append(" Contract: ").Append(Contract).Append("\n"); - sb.Append(" Permits: ").Append(Permits).Append("\n"); sb.Append(" RecurringDetailName: ").Append(RecurringDetailName).Append("\n"); sb.Append(" RecurringExpiry: ").Append(RecurringExpiry).Append("\n"); sb.Append(" RecurringFrequency: ").Append(RecurringFrequency).Append("\n"); @@ -164,12 +151,12 @@ public override string ToString() 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); } @@ -194,36 +181,31 @@ public bool Equals(Recurring input) if (input == null) return false; - return + return ( this.Contract == input.Contract || - (this.Contract != null && - this.Contract.Equals(input.Contract)) - ) && - ( - this.Permits == input.Permits || - this.Permits != null && - this.Permits.SequenceEqual(input.Permits) - ) && + this.Contract != null && + this.Contract.Equals(input.Contract) + ) && ( this.RecurringDetailName == input.RecurringDetailName || - (this.RecurringDetailName != null && - this.RecurringDetailName.Equals(input.RecurringDetailName)) - ) && + this.RecurringDetailName != null && + this.RecurringDetailName.Equals(input.RecurringDetailName) + ) && ( this.RecurringExpiry == input.RecurringExpiry || - (this.RecurringExpiry != null && - this.RecurringExpiry.Equals(input.RecurringExpiry)) - ) && + this.RecurringExpiry != null && + this.RecurringExpiry.Equals(input.RecurringExpiry) + ) && ( this.RecurringFrequency == input.RecurringFrequency || - (this.RecurringFrequency != null && - this.RecurringFrequency.Equals(input.RecurringFrequency)) - ) && + this.RecurringFrequency != null && + this.RecurringFrequency.Equals(input.RecurringFrequency) + ) && ( this.TokenService == input.TokenService || - (this.TokenService != null && - this.TokenService.Equals(input.TokenService)) + this.TokenService != null && + this.TokenService.Equals(input.TokenService) ); } @@ -238,8 +220,6 @@ public override int GetHashCode() int hashCode = 41; if (this.Contract != null) hashCode = hashCode * 59 + this.Contract.GetHashCode(); - if (this.Permits != null) - hashCode = hashCode * 59 + this.Permits.GetHashCode(); if (this.RecurringDetailName != null) hashCode = hashCode * 59 + this.RecurringDetailName.GetHashCode(); if (this.RecurringExpiry != null) @@ -257,10 +237,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/RecurringDetail.cs b/Adyen/Model/Checkout/RecurringDetail.cs index 1812c4432..5ed3a1a40 100644 --- a/Adyen/Model/Checkout/RecurringDetail.cs +++ b/Adyen/Model/Checkout/RecurringDetail.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,7 +28,9 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { @@ -35,94 +38,131 @@ namespace Adyen.Model.Checkout /// RecurringDetail /// [DataContract] - public partial class RecurringDetail : IEquatable, IValidatableObject + public partial class RecurringDetail : IEquatable, IValidatableObject { + /// + /// The funding source of the payment method. + /// + /// The funding source of the payment method. + [JsonConverter(typeof(StringEnumConverter))] + public enum FundingSourceEnum + { + /// + /// Enum Debit for value: debit + /// + [EnumMember(Value = "debit")] Debit = 1 + } + + /// + /// The funding source of the payment method. + /// + /// The funding source of the payment method. + [DataMember(Name = "fundingSource", EmitDefaultValue = false)] + public FundingSourceEnum? FundingSource { get; set; } + /// /// Initializes a new instance of the class. /// - /// The configuration of the payment method.. - /// All input details to be provided to complete the payment with this payment method.. - /// The group where this payment method belongs to.. - /// The displayable name of this payment method.. - /// Echo data required to send in next calls.. - /// The reference that uniquely identifies the recurring detail.. - /// Contains information on previously stored payment details.. - /// Indicates whether this payment method supports tokenization or not.. - /// The unique payment method code.. - public RecurringDetail(Dictionary Configuration = default(Dictionary), List Details = default(List), PaymentMethodGroup Group = default(PaymentMethodGroup), string Name = default(string), string PaymentMethodData = default(string), string RecurringDetailReference = default(string), StoredDetails StoredDetails = default(StoredDetails), bool? SupportsRecurring = default(bool?), string Type = default(string)) + /// Brand for the selected gift card. For example: plastix, hmclub.. + /// List of possible brands. For example: visa, mc.. + /// The configuration of the payment method.. + /// All input details to be provided to complete the payment with this payment method.. + /// The funding source of the payment method.. + /// group. + /// All input details to be provided to complete the payment with this payment method.. + /// The displayable name of this payment method.. + /// The reference that uniquely identifies the recurring detail.. + /// storedDetails. + /// The unique payment method code.. + public RecurringDetail(string brand = default(string), List brands = default(List), + Dictionary configuration = default(Dictionary), + List details = default(List), + FundingSourceEnum? fundingSource = default(FundingSourceEnum?), + PaymentMethodGroup group = default(PaymentMethodGroup), + List inputDetails = default(List), string name = default(string), + string recurringDetailReference = default(string), StoredDetails storedDetails = default(StoredDetails), + string type = default(string)) { - this.Configuration = Configuration; - this.Details = Details; - this.Group = Group; - this.Name = Name; - this.PaymentMethodData = PaymentMethodData; - this.RecurringDetailReference = RecurringDetailReference; - this.StoredDetails = StoredDetails; - this.SupportsRecurring = SupportsRecurring; - this.Type = Type; + this.Brand = brand; + this.Brands = brands; + this.Configuration = configuration; + this.Details = details; + this.FundingSource = fundingSource; + this.Group = group; + this.InputDetails = inputDetails; + this.Name = name; + this.RecurringDetailReference = recurringDetailReference; + this.StoredDetails = storedDetails; + this.Type = type; } - + + /// + /// Brand for the selected gift card. For example: plastix, hmclub. + /// + /// Brand for the selected gift card. For example: plastix, hmclub. + [DataMember(Name = "brand", EmitDefaultValue = false)] + public string Brand { get; set; } + + /// + /// List of possible brands. For example: visa, mc. + /// + /// List of possible brands. For example: visa, mc. + [DataMember(Name = "brands", EmitDefaultValue = false)] + public List Brands { get; set; } + /// /// The configuration of the payment method. /// /// The configuration of the payment method. - [DataMember(Name="configuration", EmitDefaultValue=false)] + [DataMember(Name = "configuration", EmitDefaultValue = false)] public Dictionary Configuration { get; set; } /// /// All input details to be provided to complete the payment with this payment method. /// /// All input details to be provided to complete the payment with this payment method. - [DataMember(Name="details", EmitDefaultValue=false)] + [DataMember(Name = "details", EmitDefaultValue = false)] public List Details { get; set; } + /// - /// The group where this payment method belongs to. + /// Gets or Sets Group /// - /// The group where this payment method belongs to. - [DataMember(Name="group", EmitDefaultValue=false)] + [DataMember(Name = "group", EmitDefaultValue = false)] public PaymentMethodGroup Group { get; set; } /// - /// The displayable name of this payment method. + /// All input details to be provided to complete the payment with this payment method. /// - /// The displayable name of this payment method. - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } + /// All input details to be provided to complete the payment with this payment method. + [DataMember(Name = "inputDetails", EmitDefaultValue = false)] + public List InputDetails { get; set; } /// - /// Echo data required to send in next calls. + /// The displayable name of this payment method. /// - /// Echo data required to send in next calls. - [DataMember(Name="paymentMethodData", EmitDefaultValue=false)] - public string PaymentMethodData { get; set; } + /// The displayable name of this payment method. + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } /// /// The reference that uniquely identifies the recurring detail. /// /// The reference that uniquely identifies the recurring detail. - [DataMember(Name="recurringDetailReference", EmitDefaultValue=false)] + [DataMember(Name = "recurringDetailReference", EmitDefaultValue = false)] public string RecurringDetailReference { get; set; } /// - /// Contains information on previously stored payment details. + /// Gets or Sets StoredDetails /// - /// Contains information on previously stored payment details. - [DataMember(Name="storedDetails", EmitDefaultValue=false)] + [DataMember(Name = "storedDetails", EmitDefaultValue = false)] public StoredDetails StoredDetails { get; set; } - /// - /// Indicates whether this payment method supports tokenization or not. - /// - /// Indicates whether this payment method supports tokenization or not. - [DataMember(Name="supportsRecurring", EmitDefaultValue=false)] - public bool? SupportsRecurring { get; set; } - /// /// The unique payment method code. /// /// The unique payment method code. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } /// @@ -133,24 +173,26 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class RecurringDetail {\n"); - sb.Append(" Configuration: ").Append(Configuration).Append("\n"); - sb.Append(" Details: ").Append(Details).Append("\n"); + sb.Append(" Brand: ").Append(Brand).Append("\n"); + sb.Append(" Brands: ").Append(Brands.ToListString()).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration.ToCollectionsString()).Append("\n"); + sb.Append(" Details: ").Append(Details.ObjectListToString()).Append("\n"); + sb.Append(" FundingSource: ").Append(FundingSource).Append("\n"); sb.Append(" Group: ").Append(Group).Append("\n"); + sb.Append(" InputDetails: ").Append(InputDetails.ObjectListToString()).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PaymentMethodData: ").Append(PaymentMethodData).Append("\n"); sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); sb.Append(" StoredDetails: ").Append(StoredDetails).Append("\n"); - sb.Append(" SupportsRecurring: ").Append(SupportsRecurring).Append("\n"); sb.Append(" Type: ").Append(Type).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); } @@ -175,51 +217,65 @@ public bool Equals(RecurringDetail input) if (input == null) return false; - return + return + ( + this.Brand == input.Brand || + this.Brand != null && + this.Brand.Equals(input.Brand) + ) && + ( + this.Brands == input.Brands || + this.Brands != null && + input.Brands != null && + this.Brands.SequenceEqual(input.Brands) + ) && ( this.Configuration == input.Configuration || this.Configuration != null && + input.Configuration != null && this.Configuration.SequenceEqual(input.Configuration) - ) && + ) && ( this.Details == input.Details || this.Details != null && + input.Details != null && this.Details.SequenceEqual(input.Details) - ) && + ) && + ( + this.FundingSource == input.FundingSource || + this.FundingSource != null && + this.FundingSource.Equals(input.FundingSource) + ) && ( this.Group == input.Group || - (this.Group != null && - this.Group.Equals(input.Group)) - ) && + this.Group != null && + this.Group.Equals(input.Group) + ) && ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && + this.InputDetails == input.InputDetails || + this.InputDetails != null && + input.InputDetails != null && + this.InputDetails.SequenceEqual(input.InputDetails) + ) && ( - this.PaymentMethodData == input.PaymentMethodData || - (this.PaymentMethodData != null && - this.PaymentMethodData.Equals(input.PaymentMethodData)) - ) && + this.Name == input.Name || + this.Name != null && + this.Name.Equals(input.Name) + ) && ( this.RecurringDetailReference == input.RecurringDetailReference || - (this.RecurringDetailReference != null && - this.RecurringDetailReference.Equals(input.RecurringDetailReference)) - ) && + this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference) + ) && ( this.StoredDetails == input.StoredDetails || - (this.StoredDetails != null && - this.StoredDetails.Equals(input.StoredDetails)) - ) && - ( - this.SupportsRecurring == input.SupportsRecurring || - (this.SupportsRecurring != null && - this.SupportsRecurring.Equals(input.SupportsRecurring)) - ) && + this.StoredDetails != null && + this.StoredDetails.Equals(input.StoredDetails) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.Type != null && + this.Type.Equals(input.Type) ); } @@ -232,22 +288,26 @@ public override int GetHashCode() unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.Brand != null) + hashCode = hashCode * 59 + this.Brand.GetHashCode(); + if (this.Brands != null) + hashCode = hashCode * 59 + this.Brands.GetHashCode(); if (this.Configuration != null) hashCode = hashCode * 59 + this.Configuration.GetHashCode(); if (this.Details != null) hashCode = hashCode * 59 + this.Details.GetHashCode(); + if (this.FundingSource != null) + hashCode = hashCode * 59 + this.FundingSource.GetHashCode(); if (this.Group != null) hashCode = hashCode * 59 + this.Group.GetHashCode(); + if (this.InputDetails != null) + hashCode = hashCode * 59 + this.InputDetails.GetHashCode(); if (this.Name != null) hashCode = hashCode * 59 + this.Name.GetHashCode(); - if (this.PaymentMethodData != null) - hashCode = hashCode * 59 + this.PaymentMethodData.GetHashCode(); if (this.RecurringDetailReference != null) hashCode = hashCode * 59 + this.RecurringDetailReference.GetHashCode(); if (this.StoredDetails != null) hashCode = hashCode * 59 + this.StoredDetails.GetHashCode(); - if (this.SupportsRecurring != null) - hashCode = hashCode * 59 + this.SupportsRecurring.GetHashCode(); if (this.Type != null) hashCode = hashCode * 59 + this.Type.GetHashCode(); return hashCode; @@ -259,10 +319,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/Redirect.cs b/Adyen/Model/Checkout/Redirect.cs index 3a929b23c..b88bb31fd 100644 --- a/Adyen/Model/Checkout/Redirect.cs +++ b/Adyen/Model/Checkout/Redirect.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,6 +28,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -36,7 +38,7 @@ namespace Adyen.Model.Checkout /// Redirect /// [DataContract] - public partial class Redirect : IEquatable, IValidatableObject + public partial class Redirect : IEquatable, IValidatableObject { /// /// The web method that you must use to access the redirect URL. Possible values: GET, POST. @@ -45,44 +47,43 @@ public partial class Redirect : IEquatable, IValidatableObject [JsonConverter(typeof(StringEnumConverter))] public enum MethodEnum { - /// /// Enum GET for value: GET /// - [EnumMember(Value = "GET")] - GET = 1, - + [EnumMember(Value = "GET")] GET = 1, + /// /// Enum POST for value: POST /// - [EnumMember(Value = "POST")] - POST = 2 + [EnumMember(Value = "POST")] POST = 2 } /// /// The web method that you must use to access the redirect URL. Possible values: GET, POST. /// /// The web method that you must use to access the redirect URL. Possible values: GET, POST. - [DataMember(Name="method", EmitDefaultValue=false)] + [DataMember(Name = "method", EmitDefaultValue = false)] public MethodEnum? Method { get; set; } + /// /// Initializes a new instance of the class. /// - /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. - /// The web method that you must use to access the redirect URL. Possible values: GET, POST.. - /// The URL, to which you must redirect a shopper to complete a payment.. - public Redirect(Dictionary Data = default(Dictionary), MethodEnum? Method = default(MethodEnum?), string Url = default(string)) + /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL.. + /// The web method that you must use to access the redirect URL. Possible values: GET, POST.. + /// The URL, to which you must redirect a shopper to complete a payment.. + public Redirect(Dictionary data = default(Dictionary), + MethodEnum? method = default(MethodEnum?), string url = default(string)) { - this.Data = Data; - this.Method = Method; - this.Url = Url; + this.Data = data; + this.Method = method; + this.Url = url; } - + /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. /// /// When the redirect URL must be accessed via POST, use this data to post to the redirect URL. - [DataMember(Name="data", EmitDefaultValue=false)] + [DataMember(Name = "data", EmitDefaultValue = false)] public Dictionary Data { get; set; } @@ -90,7 +91,7 @@ public enum MethodEnum /// The URL, to which you must redirect a shopper to complete a payment. /// /// The URL, to which you must redirect a shopper to complete a payment. - [DataMember(Name="url", EmitDefaultValue=false)] + [DataMember(Name = "url", EmitDefaultValue = false)] public string Url { get; set; } /// @@ -101,18 +102,18 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class Redirect {\n"); - sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Data: ").Append(Data.ToCollectionsString()).Append("\n"); sb.Append(" Method: ").Append(Method).Append("\n"); sb.Append(" Url: ").Append(Url).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); } @@ -137,21 +138,22 @@ public bool Equals(Redirect input) if (input == null) return false; - return + return ( this.Data == input.Data || this.Data != null && + input.Data != null && this.Data.SequenceEqual(input.Data) - ) && + ) && ( this.Method == input.Method || - (this.Method != null && - this.Method.Equals(input.Method)) - ) && + this.Method != null && + this.Method.Equals(input.Method) + ) && ( this.Url == input.Url || - (this.Url != null && - this.Url.Equals(input.Url)) + this.Url != null && + this.Url.Equals(input.Url) ); } @@ -179,10 +181,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/RiskData.cs b/Adyen/Model/Checkout/RiskData.cs index 42d632887..87b74c035 100644 --- a/Adyen/Model/Checkout/RiskData.cs +++ b/Adyen/Model/Checkout/RiskData.cs @@ -1,49 +1,91 @@ -#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. - */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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 Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; +using Newtonsoft.Json; namespace Adyen.Model.Checkout { /// - /// + /// RiskData /// [DataContract] - public class RiskData + public partial class RiskData : IEquatable, IValidatableObject { + /// + /// Initializes a new instance of the class. + /// + /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings.. + /// Any custom fields used as part of the input to configured risk rules.. + /// An integer value that is added to the normal fraud score. The value can be either positive or negative.. + /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied.. + public RiskData(string clientData = default(string), + Dictionary customFields = default(Dictionary), + int? fraudOffset = default(int?), string profileReference = default(string)) + { + this.ClientData = clientData; + this.CustomFields = customFields; + this.FraudOffset = fraudOffset; + this.ProfileReference = profileReference; + } + /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. /// /// Contains client-side data, like the device fingerprint, cookies, and specific browser settings. [DataMember(Name = "clientData", EmitDefaultValue = false)] - [JsonProperty(PropertyName = "clientData")] public string ClientData { get; set; } + /// + /// Any custom fields used as part of the input to configured risk rules. + /// + /// Any custom fields used as part of the input to configured risk rules. + [DataMember(Name = "customFields", EmitDefaultValue = false)] + public Dictionary CustomFields { get; set; } /// - /// Get the string presentation of the object + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + /// + /// An integer value that is added to the normal fraud score. The value can be either positive or negative. + [DataMember(Name = "fraudOffset", EmitDefaultValue = false)] + public int? FraudOffset { get; set; } + + /// + /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. + /// + /// The risk profile to assign to this payment. When left empty, the merchant-level account's default risk profile will be applied. + [DataMember(Name = "profileReference", EmitDefaultValue = false)] + public string ProfileReference { get; set; } + + /// + /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() @@ -51,17 +93,96 @@ public override string ToString() var sb = new StringBuilder(); sb.Append("class RiskData {\n"); sb.Append(" ClientData: ").Append(ClientData).Append("\n"); + sb.Append(" CustomFields: ").Append(CustomFields.ToCollectionsString()).Append("\n"); + sb.Append(" FraudOffset: ").Append(FraudOffset).Append("\n"); + sb.Append(" ProfileReference: ").Append(ProfileReference).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// - /// Get the JSON string presentation of the object + /// 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); } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as RiskData); + } + + /// + /// Returns true if RiskData instances are equal + /// + /// Instance of RiskData to be compared + /// Boolean + public bool Equals(RiskData input) + { + if (input == null) + return false; + + return + ( + this.ClientData == input.ClientData || + this.ClientData != null && + this.ClientData.Equals(input.ClientData) + ) && + ( + this.CustomFields == input.CustomFields || + this.CustomFields != null && + input.CustomFields != null && + this.CustomFields.SequenceEqual(input.CustomFields) + ) && + ( + this.FraudOffset == input.FraudOffset || + this.FraudOffset != null && + this.FraudOffset.Equals(input.FraudOffset) + ) && + ( + this.ProfileReference == input.ProfileReference || + this.ProfileReference != null && + this.ProfileReference.Equals(input.ProfileReference) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.ClientData != null) + hashCode = hashCode * 59 + this.ClientData.GetHashCode(); + if (this.CustomFields != null) + hashCode = hashCode * 59 + this.CustomFields.GetHashCode(); + if (this.FraudOffset != null) + hashCode = hashCode * 59 + this.FraudOffset.GetHashCode(); + if (this.ProfileReference != null) + hashCode = hashCode * 59 + this.ProfileReference.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/SDKEphemPubKey.cs b/Adyen/Model/Checkout/SDKEphemPubKey.cs index f8f23d3aa..2afb146af 100644 --- a/Adyen/Model/Checkout/SDKEphemPubKey.cs +++ b/Adyen/Model/Checkout/SDKEphemPubKey.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,49 +35,50 @@ namespace Adyen.Model.Checkout /// SDKEphemPubKey /// [DataContract] - public partial class SDKEphemPubKey : IEquatable, IValidatableObject + public partial class SDKEphemPubKey : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The `crv` value as received from the 3D Secure 2.0 SDK.. - /// The `kty` value as received from the 3D Secure 2.0 SDK.. - /// The `x` value as received from the 3D Secure 2.0 SDK.. - /// The `y` value as received from the 3D Secure 2.0 SDK.. - public SDKEphemPubKey(string Crv = default(string), string Kty = default(string), string X = default(string), string Y = default(string)) + /// The `crv` value as received from the 3D Secure 2 SDK.. + /// The `kty` value as received from the 3D Secure 2 SDK.. + /// The `x` value as received from the 3D Secure 2 SDK.. + /// The `y` value as received from the 3D Secure 2 SDK.. + public SDKEphemPubKey(string crv = default(string), string kty = default(string), string x = default(string), + string y = default(string)) { - this.Crv = Crv; - this.Kty = Kty; - this.X = X; - this.Y = Y; + this.Crv = crv; + this.Kty = kty; + this.X = x; + this.Y = y; } - + /// - /// The `crv` value as received from the 3D Secure 2.0 SDK. + /// The `crv` value as received from the 3D Secure 2 SDK. /// - /// The `crv` value as received from the 3D Secure 2.0 SDK. - [DataMember(Name="crv", EmitDefaultValue=false)] + /// The `crv` value as received from the 3D Secure 2 SDK. + [DataMember(Name = "crv", EmitDefaultValue = false)] public string Crv { get; set; } /// - /// The `kty` value as received from the 3D Secure 2.0 SDK. + /// The `kty` value as received from the 3D Secure 2 SDK. /// - /// The `kty` value as received from the 3D Secure 2.0 SDK. - [DataMember(Name="kty", EmitDefaultValue=false)] + /// The `kty` value as received from the 3D Secure 2 SDK. + [DataMember(Name = "kty", EmitDefaultValue = false)] public string Kty { get; set; } /// - /// The `x` value as received from the 3D Secure 2.0 SDK. + /// The `x` value as received from the 3D Secure 2 SDK. /// - /// The `x` value as received from the 3D Secure 2.0 SDK. - [DataMember(Name="x", EmitDefaultValue=false)] + /// The `x` value as received from the 3D Secure 2 SDK. + [DataMember(Name = "x", EmitDefaultValue = false)] public string X { get; set; } /// - /// The `y` value as received from the 3D Secure 2.0 SDK. + /// The `y` value as received from the 3D Secure 2 SDK. /// - /// The `y` value as received from the 3D Secure 2.0 SDK. - [DataMember(Name="y", EmitDefaultValue=false)] + /// The `y` value as received from the 3D Secure 2 SDK. + [DataMember(Name = "y", EmitDefaultValue = false)] public string Y { get; set; } /// @@ -94,12 +96,12 @@ public override string ToString() 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); } @@ -124,26 +126,26 @@ public bool Equals(SDKEphemPubKey input) if (input == null) return false; - return + return ( this.Crv == input.Crv || - (this.Crv != null && - this.Crv.Equals(input.Crv)) - ) && + this.Crv != null && + this.Crv.Equals(input.Crv) + ) && ( this.Kty == input.Kty || - (this.Kty != null && - this.Kty.Equals(input.Kty)) - ) && + this.Kty != null && + this.Kty.Equals(input.Kty) + ) && ( this.X == input.X || - (this.X != null && - this.X.Equals(input.X)) - ) && + this.X != null && + this.X.Equals(input.X) + ) && ( this.Y == input.Y || - (this.Y != null && - this.Y.Equals(input.Y)) + this.Y != null && + this.Y.Equals(input.Y) ); } @@ -173,10 +175,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ServiceError.cs b/Adyen/Model/Checkout/ServiceError.cs index 60d904061..75fdf1e3a 100644 --- a/Adyen/Model/Checkout/ServiceError.cs +++ b/Adyen/Model/Checkout/ServiceError.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,37 +35,38 @@ namespace Adyen.Model.Checkout /// ServiceError /// [DataContract] - public partial class ServiceError : IEquatable, IValidatableObject + public partial class ServiceError : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// ErrorCode. - /// ErrorType. - /// Message. - public ServiceError(string ErrorCode = default(string), string ErrorType = default(string), string Message = default(string)) + /// errorCode. + /// errorType. + /// message. + public ServiceError(string errorCode = default(string), string errorType = default(string), + string message = default(string)) { - this.ErrorCode = ErrorCode; - this.ErrorType = ErrorType; - this.Message = Message; + this.ErrorCode = errorCode; + this.ErrorType = errorType; + this.Message = message; } - + /// /// Gets or Sets ErrorCode /// - [DataMember(Name="errorCode", EmitDefaultValue=false)] + [DataMember(Name = "errorCode", EmitDefaultValue = false)] public string ErrorCode { get; set; } /// /// Gets or Sets ErrorType /// - [DataMember(Name="errorType", EmitDefaultValue=false)] + [DataMember(Name = "errorType", EmitDefaultValue = false)] public string ErrorType { get; set; } /// /// Gets or Sets Message /// - [DataMember(Name="message", EmitDefaultValue=false)] + [DataMember(Name = "message", EmitDefaultValue = false)] public string Message { get; set; } /// @@ -81,12 +83,12 @@ public override string ToString() 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); } @@ -111,21 +113,21 @@ public bool Equals(ServiceError input) if (input == null) return false; - return + return ( this.ErrorCode == input.ErrorCode || - (this.ErrorCode != null && - this.ErrorCode.Equals(input.ErrorCode)) - ) && + this.ErrorCode != null && + this.ErrorCode.Equals(input.ErrorCode) + ) && ( this.ErrorType == input.ErrorType || - (this.ErrorType != null && - this.ErrorType.Equals(input.ErrorType)) - ) && + this.ErrorType != null && + this.ErrorType.Equals(input.ErrorType) + ) && ( this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) + this.Message != null && + this.Message.Equals(input.Message) ); } @@ -153,10 +155,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ShopperInput.cs b/Adyen/Model/Checkout/ShopperInput.cs index 8f45fa8fb..8e25a6bf2 100644 --- a/Adyen/Model/Checkout/ShopperInput.cs +++ b/Adyen/Model/Checkout/ShopperInput.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -35,7 +36,7 @@ namespace Adyen.Model.Checkout /// ShopperInput /// [DataContract] - public partial class ShopperInput : IEquatable, IValidatableObject + public partial class ShopperInput : IEquatable, IValidatableObject { /// /// Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly @@ -44,32 +45,29 @@ public partial class ShopperInput : IEquatable, IValidatableObjec [JsonConverter(typeof(StringEnumConverter))] public enum BillingAddressEnum { - /// /// Enum Editable for value: editable /// - [EnumMember(Value = "editable")] - Editable = 1, - + [EnumMember(Value = "editable")] Editable = 1, + /// /// Enum Hidden for value: hidden /// - [EnumMember(Value = "hidden")] - Hidden = 2, - + [EnumMember(Value = "hidden")] Hidden = 2, + /// /// Enum ReadOnly for value: readOnly /// - [EnumMember(Value = "readOnly")] - ReadOnly = 3 + [EnumMember(Value = "readOnly")] ReadOnly = 3 } /// /// Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly /// /// Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly - [DataMember(Name="billingAddress", EmitDefaultValue=false)] + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] public BillingAddressEnum? BillingAddress { get; set; } + /// /// Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly /// @@ -77,32 +75,29 @@ public enum BillingAddressEnum [JsonConverter(typeof(StringEnumConverter))] public enum DeliveryAddressEnum { - /// /// Enum Editable for value: editable /// - [EnumMember(Value = "editable")] - Editable = 1, - + [EnumMember(Value = "editable")] Editable = 1, + /// /// Enum Hidden for value: hidden /// - [EnumMember(Value = "hidden")] - Hidden = 2, - + [EnumMember(Value = "hidden")] Hidden = 2, + /// /// Enum ReadOnly for value: readOnly /// - [EnumMember(Value = "readOnly")] - ReadOnly = 3 + [EnumMember(Value = "readOnly")] ReadOnly = 3 } /// /// Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly /// /// Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly - [DataMember(Name="deliveryAddress", EmitDefaultValue=false)] + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] public DeliveryAddressEnum? DeliveryAddress { get; set; } + /// /// Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly /// @@ -110,46 +105,43 @@ public enum DeliveryAddressEnum [JsonConverter(typeof(StringEnumConverter))] public enum PersonalDetailsEnum { - /// /// Enum Editable for value: editable /// - [EnumMember(Value = "editable")] - Editable = 1, - + [EnumMember(Value = "editable")] Editable = 1, + /// /// Enum Hidden for value: hidden /// - [EnumMember(Value = "hidden")] - Hidden = 2, - + [EnumMember(Value = "hidden")] Hidden = 2, + /// /// Enum ReadOnly for value: readOnly /// - [EnumMember(Value = "readOnly")] - ReadOnly = 3 + [EnumMember(Value = "readOnly")] ReadOnly = 3 } /// /// Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly /// /// Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly - [DataMember(Name="personalDetails", EmitDefaultValue=false)] + [DataMember(Name = "personalDetails", EmitDefaultValue = false)] public PersonalDetailsEnum? PersonalDetails { get; set; } + /// /// Initializes a new instance of the class. /// - /// Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly. - /// Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly. - /// Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly. - public ShopperInput(BillingAddressEnum? BillingAddress = default(BillingAddressEnum?), DeliveryAddressEnum? DeliveryAddress = default(DeliveryAddressEnum?), PersonalDetailsEnum? PersonalDetails = default(PersonalDetailsEnum?)) + /// Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly. + /// Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly. + /// Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly. + public ShopperInput(BillingAddressEnum? billingAddress = default(BillingAddressEnum?), + DeliveryAddressEnum? deliveryAddress = default(DeliveryAddressEnum?), + PersonalDetailsEnum? personalDetails = default(PersonalDetailsEnum?)) { - this.BillingAddress = BillingAddress; - this.DeliveryAddress = DeliveryAddress; - this.PersonalDetails = PersonalDetails; + this.BillingAddress = billingAddress; + this.DeliveryAddress = deliveryAddress; + this.PersonalDetails = personalDetails; } - - /// @@ -166,12 +158,12 @@ public override string ToString() 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); } @@ -196,21 +188,21 @@ public bool Equals(ShopperInput input) if (input == null) return false; - return + return ( this.BillingAddress == input.BillingAddress || - (this.BillingAddress != null && - this.BillingAddress.Equals(input.BillingAddress)) - ) && + this.BillingAddress != null && + this.BillingAddress.Equals(input.BillingAddress) + ) && ( this.DeliveryAddress == input.DeliveryAddress || - (this.DeliveryAddress != null && - this.DeliveryAddress.Equals(input.DeliveryAddress)) - ) && + this.DeliveryAddress != null && + this.DeliveryAddress.Equals(input.DeliveryAddress) + ) && ( this.PersonalDetails == input.PersonalDetails || - (this.PersonalDetails != null && - this.PersonalDetails.Equals(input.PersonalDetails)) + this.PersonalDetails != null && + this.PersonalDetails.Equals(input.PersonalDetails) ); } @@ -238,10 +230,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ShopperInteractionDevice.cs b/Adyen/Model/Checkout/ShopperInteractionDevice.cs deleted file mode 100644 index 4ab7340f1..000000000 --- a/Adyen/Model/Checkout/ShopperInteractionDevice.cs +++ /dev/null @@ -1,165 +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.Runtime.Serialization; -using System.Text; -using Newtonsoft.Json; - -namespace Adyen.Model.Checkout -{ - /// - /// ShopperInteractionDevice - /// - [DataContract] - public partial class ShopperInteractionDevice : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// Locale on the shopper interaction device.. - /// Operating system running on the shopper interaction device.. - /// Version of the operating system on the shopper interaction device.. - public ShopperInteractionDevice(string Locale = default(string), string Os = default(string), string OsVersion = default(string)) - { - this.Locale = Locale; - this.Os = Os; - this.OsVersion = OsVersion; - } - - /// - /// Locale on the shopper interaction device. - /// - /// Locale on the shopper interaction device. - [DataMember(Name="locale", EmitDefaultValue=false)] - public string Locale { get; set; } - - /// - /// Operating system running on the shopper interaction device. - /// - /// Operating system running on the shopper interaction device. - [DataMember(Name="os", EmitDefaultValue=false)] - public string Os { get; set; } - - /// - /// Version of the operating system on the shopper interaction device. - /// - /// Version of the operating system on the shopper interaction device. - [DataMember(Name="osVersion", EmitDefaultValue=false)] - public string OsVersion { 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 ShopperInteractionDevice {\n"); - sb.Append(" Locale: ").Append(Locale).Append("\n"); - sb.Append(" Os: ").Append(Os).Append("\n"); - sb.Append(" OsVersion: ").Append(OsVersion).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 input) - { - return this.Equals(input as ShopperInteractionDevice); - } - - /// - /// Returns true if ShopperInteractionDevice instances are equal - /// - /// Instance of ShopperInteractionDevice to be compared - /// Boolean - public bool Equals(ShopperInteractionDevice input) - { - if (input == null) - return false; - - return - ( - this.Locale == input.Locale || - (this.Locale != null && - this.Locale.Equals(input.Locale)) - ) && - ( - this.Os == input.Os || - (this.Os != null && - this.Os.Equals(input.Os)) - ) && - ( - this.OsVersion == input.OsVersion || - (this.OsVersion != null && - this.OsVersion.Equals(input.OsVersion)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.Locale != null) - hashCode = hashCode * 59 + this.Locale.GetHashCode(); - if (this.Os != null) - hashCode = hashCode * 59 + this.Os.GetHashCode(); - if (this.OsVersion != null) - hashCode = hashCode * 59 + this.OsVersion.GetHashCode(); - return hashCode; - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/Adyen/Model/Checkout/Split.cs b/Adyen/Model/Checkout/Split.cs index 03a3df13e..c3b09a3de 100644 --- a/Adyen/Model/Checkout/Split.cs +++ b/Adyen/Model/Checkout/Split.cs @@ -1,29 +1,35 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; using System.Runtime.Serialization; +using System.Text; using Newtonsoft.Json; +using Newtonsoft.Json.Converters; namespace Adyen.Model.Checkout { @@ -31,32 +37,226 @@ namespace Adyen.Model.Checkout /// Split /// [DataContract] - [Obsolete("Keep for backwards compatibility, but Adyen.Model.Split should be used instead, as it is required outside of the Checkout namespace")] - public class Split : Model.Split, IEquatable + public partial class Split : IEquatable, IValidatableObject { /// - /// Initializes a new instance of the class. + /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `BalanceAccount`. + /// + /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `BalanceAccount`. + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum BalanceAccount for value: BalanceAccount + /// + [EnumMember(Value = "BalanceAccount")] BalanceAccount = 1, + + /// + /// Enum Commission for value: Commission + /// + [EnumMember(Value = "Commission")] Commission = 2, + + /// + /// Enum Default for value: Default + /// + [EnumMember(Value = "Default")] Default = 3, + + /// + /// Enum MarketPlace for value: MarketPlace + /// + [EnumMember(Value = "MarketPlace")] MarketPlace = 4, + + /// + /// Enum PaymentFee for value: PaymentFee + /// + [EnumMember(Value = "PaymentFee")] PaymentFee = 5, + + /// + /// Enum VAT for value: VAT + /// + [EnumMember(Value = "VAT")] VAT = 6, + + /// + /// Enum Verification for value: Verification + /// + [EnumMember(Value = "Verification")] Verification = 7 + } + + /// + /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `BalanceAccount`. /// - [JsonConstructor] - protected Split() { } + /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `BalanceAccount`. + [DataMember(Name = "type", EmitDefaultValue = false)] + public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. /// - /// The account to which this split applies. >Required if the type is `MarketPlace`.. - /// The amount of this split. (required). - /// A description of this split.. - /// The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`.. - /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `Verification`. (required). - public Split(string Account = default(string), SplitAmount Amount = default(SplitAmount), - string Description = default(string), string Reference = default(string), TypeEnum Type = default(TypeEnum)) : base(Account,Amount,Description,Reference,Type) + /// The account to which this split applies. >Required if the type is `MarketPlace`.. + /// amount (required). + /// A description of this split.. + /// The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`.. + /// The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `BalanceAccount`. (required). + public Split(string account = default(string), SplitAmount amount = default(SplitAmount), + string description = default(string), string reference = default(string), TypeEnum type = default(TypeEnum)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException("amount is a required property for Split and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "type" is required (not null) + if (type == null) + { + throw new InvalidDataException("type is a required property for Split and cannot be null"); + } + else + { + this.Type = type; + } + this.Account = account; + this.Description = description; + this.Reference = reference; + } + + /// + /// The account to which this split applies. >Required if the type is `MarketPlace`. + /// + /// The account to which this split applies. >Required if the type is `MarketPlace`. + [DataMember(Name = "account", EmitDefaultValue = false)] + public string Account { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public SplitAmount Amount { get; set; } + + /// + /// A description of this split. + /// + /// A description of this split. + [DataMember(Name = "description", EmitDefaultValue = false)] + public string Description { get; set; } + + /// + /// The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`. + /// + /// The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`. + [DataMember(Name = "reference", EmitDefaultValue = false)] + public string Reference { 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 Split {\n"); + sb.Append(" Account: ").Append(Account).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" Reference: ").Append(Reference).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() { + return JsonConvert.SerializeObject(this, Formatting.Indented); } + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as Split); + } - public bool Equals(Split other) + /// + /// Returns true if Split instances are equal + /// + /// Instance of Split to be compared + /// Boolean + public bool Equals(Split input) + { + if (input == null) + return false; + + return + ( + this.Account == input.Account || + this.Account != null && + this.Account.Equals(input.Account) + ) && + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.Description == input.Description || + this.Description != null && + this.Description.Equals(input.Description) + ) && + ( + this.Reference == input.Reference || + this.Reference != null && + this.Reference.Equals(input.Reference) + ) && + ( + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Account != null) + hashCode = hashCode * 59 + this.Account.GetHashCode(); + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.Description != null) + hashCode = hashCode * 59 + this.Description.GetHashCode(); + if (this.Reference != null) + hashCode = hashCode * 59 + this.Reference.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - return base.Equals(other); + yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/SplitAmount.cs b/Adyen/Model/Checkout/SplitAmount.cs index 8502d959b..c8f3994e7 100644 --- a/Adyen/Model/Checkout/SplitAmount.cs +++ b/Adyen/Model/Checkout/SplitAmount.cs @@ -1,29 +1,33 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; using System.Runtime.Serialization; +using System.Text; using Newtonsoft.Json; namespace Adyen.Model.Checkout @@ -32,27 +36,123 @@ namespace Adyen.Model.Checkout /// SplitAmount /// [DataContract] - [Obsolete("Keep for backwards compatibility, but Adyen.Model.SplitAmount should be used instead, as it is required outside of the Checkout namespace")] - public partial class SplitAmount : Model.SplitAmount, IEquatable, IValidatableObject + public partial class SplitAmount : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - [JsonConstructor] - protected SplitAmount() { } + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used.. + /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). (required). + public SplitAmount(string currency = default(string), long? value = default(long?)) + { + // to ensure "value" is required (not null) + if (value == null) + { + throw new InvalidDataException("value is a required property for SplitAmount and cannot be null"); + } + else + { + this.Value = value; + } + this.Currency = currency; + } /// - /// Initializes a new instance of the class. + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + /// + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + [DataMember(Name = "currency", EmitDefaultValue = false)] + public string Currency { get; set; } + + /// + /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + /// + /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes). + [DataMember(Name = "value", EmitDefaultValue = false)] + public long? Value { 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 SplitAmount {\n"); + sb.Append(" Currency: ").Append(Currency).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal /// - /// The three-character [ISO currency code](https://docs.adyen.com/developers/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used.. - /// The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/developers/development-resources/currency-codes). (required). - public SplitAmount(string Currency = default(string), long? Value = default(long?)) :base(Currency,Value) + /// Object to be compared + /// Boolean + public override bool Equals(object input) { + return this.Equals(input as SplitAmount); } - public bool Equals(SplitAmount other) + /// + /// Returns true if SplitAmount instances are equal + /// + /// Instance of SplitAmount to be compared + /// Boolean + public bool Equals(SplitAmount input) + { + if (input == null) + return false; + + return + ( + this.Currency == input.Currency || + this.Currency != null && + this.Currency.Equals(input.Currency) + ) && + ( + this.Value == input.Value || + this.Value != null && + this.Value.Equals(input.Value) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Currency != null) + hashCode = hashCode * 59 + this.Currency.GetHashCode(); + if (this.Value != null) + hashCode = hashCode * 59 + this.Value.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { - return base.Equals(other); + yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/StoredDetails.cs b/Adyen/Model/Checkout/StoredDetails.cs index 9c034de88..57030fd13 100644 --- a/Adyen/Model/Checkout/StoredDetails.cs +++ b/Adyen/Model/Checkout/StoredDetails.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -34,40 +35,39 @@ namespace Adyen.Model.Checkout /// StoredDetails /// [DataContract] - public partial class StoredDetails : IEquatable, IValidatableObject + public partial class StoredDetails : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// The stored bank account.. - /// The stored card information.. - /// The email associated with stored payment details.. - public StoredDetails(BankAccount Bank = default(BankAccount), Card Card = default(Card), string EmailAddress = default(string)) + /// bank. + /// card. + /// The email associated with stored payment details.. + public StoredDetails(BankAccount bank = default(BankAccount), Card card = default(Card), + string emailAddress = default(string)) { - this.Bank = Bank; - this.Card = Card; - this.EmailAddress = EmailAddress; + this.Bank = bank; + this.Card = card; + this.EmailAddress = emailAddress; } - + /// - /// The stored bank account. + /// Gets or Sets Bank /// - /// The stored bank account. - [DataMember(Name="bank", EmitDefaultValue=false)] + [DataMember(Name = "bank", EmitDefaultValue = false)] public BankAccount Bank { get; set; } /// - /// The stored card information. + /// Gets or Sets Card /// - /// The stored card information. - [DataMember(Name="card", EmitDefaultValue=false)] + [DataMember(Name = "card", EmitDefaultValue = false)] public Card Card { get; set; } /// /// The email associated with stored payment details. /// /// The email associated with stored payment details. - [DataMember(Name="emailAddress", EmitDefaultValue=false)] + [DataMember(Name = "emailAddress", EmitDefaultValue = false)] public string EmailAddress { get; set; } /// @@ -84,12 +84,12 @@ public override string ToString() 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); } @@ -114,21 +114,21 @@ public bool Equals(StoredDetails input) if (input == null) return false; - return + return ( this.Bank == input.Bank || - (this.Bank != null && - this.Bank.Equals(input.Bank)) - ) && + this.Bank != null && + this.Bank.Equals(input.Bank) + ) && ( this.Card == input.Card || - (this.Card != null && - this.Card.Equals(input.Card)) - ) && + this.Card != null && + this.Card.Equals(input.Card) + ) && ( this.EmailAddress == input.EmailAddress || - (this.EmailAddress != null && - this.EmailAddress.Equals(input.EmailAddress)) + this.EmailAddress != null && + this.EmailAddress.Equals(input.EmailAddress) ); } @@ -156,10 +156,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/StoredPaymentMethod.cs b/Adyen/Model/Checkout/StoredPaymentMethod.cs index 815b5af9b..0aef69c5d 100644 --- a/Adyen/Model/Checkout/StoredPaymentMethod.cs +++ b/Adyen/Model/Checkout/StoredPaymentMethod.cs @@ -1,35 +1,37 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Linq; -using System.Text; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout { /// /// StoredPaymentMethod @@ -50,7 +52,10 @@ public partial class StoredPaymentMethod : IEquatable, IVal /// The shopper’s email address.. /// The supported shopper interactions for this stored payment method.. /// The type of payment method.. - public StoredPaymentMethod(string brand = default(string), string expiryMonth = default(string), string expiryYear = default(string), string holderName = default(string), string id = default(string), string lastFour = default(string), string name = default(string), string shopperEmail = default(string), List supportedShopperInteractions = default(List), string type = default(string)) + public StoredPaymentMethod(string brand = default(string), string expiryMonth = default(string), + string expiryYear = default(string), string holderName = default(string), string id = default(string), + string lastFour = default(string), string name = default(string), string shopperEmail = default(string), + List supportedShopperInteractions = default(List), string type = default(string)) { this.Brand = brand; this.ExpiryMonth = expiryMonth; @@ -150,7 +155,7 @@ public override string ToString() sb.Append(" LastFour: ").Append(LastFour).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" ShopperEmail: ").Append(ShopperEmail).Append("\n"); - sb.Append(" SupportedShopperInteractions: ").Append(SupportedShopperInteractions).Append("\n"); + sb.Append(" SupportedShopperInteractions: ").Append(SupportedShopperInteractions.ToListString()).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -188,43 +193,43 @@ public bool Equals(StoredPaymentMethod input) return ( this.Brand == input.Brand || - (this.Brand != null && - this.Brand.Equals(input.Brand)) + this.Brand != null && + this.Brand.Equals(input.Brand) ) && ( this.ExpiryMonth == input.ExpiryMonth || - (this.ExpiryMonth != null && - this.ExpiryMonth.Equals(input.ExpiryMonth)) + this.ExpiryMonth != null && + this.ExpiryMonth.Equals(input.ExpiryMonth) ) && ( this.ExpiryYear == input.ExpiryYear || - (this.ExpiryYear != null && - this.ExpiryYear.Equals(input.ExpiryYear)) + this.ExpiryYear != null && + this.ExpiryYear.Equals(input.ExpiryYear) ) && ( this.HolderName == input.HolderName || - (this.HolderName != null && - this.HolderName.Equals(input.HolderName)) + this.HolderName != null && + this.HolderName.Equals(input.HolderName) ) && ( this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) + this.Id != null && + this.Id.Equals(input.Id) ) && ( this.LastFour == input.LastFour || - (this.LastFour != null && - this.LastFour.Equals(input.LastFour)) + this.LastFour != null && + this.LastFour.Equals(input.LastFour) ) && ( this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) + this.Name != null && + this.Name.Equals(input.Name) ) && ( this.ShopperEmail == input.ShopperEmail || - (this.ShopperEmail != null && - this.ShopperEmail.Equals(input.ShopperEmail)) + this.ShopperEmail != null && + this.ShopperEmail.Equals(input.ShopperEmail) ) && ( this.SupportedShopperInteractions == input.SupportedShopperInteractions || @@ -234,8 +239,8 @@ public bool Equals(StoredPaymentMethod input) ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) + this.Type != null && + this.Type.Equals(input.Type) ); } @@ -277,9 +282,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs new file mode 100644 index 000000000..7f8eb1f10 --- /dev/null +++ b/Adyen/Model/Checkout/StoredPaymentMethodDetails.cs @@ -0,0 +1,167 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.Checkout +{ + /// + /// StoredPaymentMethodDetails + /// + [DataContract] + public partial class StoredPaymentMethodDetails : IEquatable, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + /// 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.. + /// The payment method type.. + public StoredPaymentMethodDetails(string recurringDetailReference = default(string), + string storedPaymentMethodId = default(string), string type = default(string)) + { + this.RecurringDetailReference = recurringDetailReference; + this.StoredPaymentMethodId = storedPaymentMethodId; + this.Type = type; + } + + /// + /// 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)] + public string RecurringDetailReference { 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)] + public string StoredPaymentMethodId { get; set; } + + /// + /// The payment method type. + /// + /// The payment method type. + [DataMember(Name = "type", EmitDefaultValue = false)] + public string Type { 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 StoredPaymentMethodDetails {\n"); + sb.Append(" RecurringDetailReference: ").Append(RecurringDetailReference).Append("\n"); + sb.Append(" StoredPaymentMethodId: ").Append(StoredPaymentMethodId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as StoredPaymentMethodDetails); + } + + /// + /// Returns true if StoredPaymentMethodDetails instances are equal + /// + /// Instance of StoredPaymentMethodDetails to be compared + /// Boolean + public bool Equals(StoredPaymentMethodDetails input) + { + if (input == null) + return false; + + return + ( + this.RecurringDetailReference == input.RecurringDetailReference || + this.RecurringDetailReference != null && + this.RecurringDetailReference.Equals(input.RecurringDetailReference) + ) && + ( + this.StoredPaymentMethodId == input.StoredPaymentMethodId || + this.StoredPaymentMethodId != null && + this.StoredPaymentMethodId.Equals(input.StoredPaymentMethodId) + ) && + ( + this.Type == input.Type || + this.Type != null && + this.Type.Equals(input.Type) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.RecurringDetailReference != null) + hashCode = hashCode * 59 + this.RecurringDetailReference.GetHashCode(); + if (this.StoredPaymentMethodId != null) + hashCode = hashCode * 59 + this.StoredPaymentMethodId.GetHashCode(); + if (this.Type != null) + hashCode = hashCode * 59 + this.Type.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/SubInputDetail.cs b/Adyen/Model/Checkout/SubInputDetail.cs index eb2e7625d..c5b29cffa 100644 --- a/Adyen/Model/Checkout/SubInputDetail.cs +++ b/Adyen/Model/Checkout/SubInputDetail.cs @@ -1,24 +1,25 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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; @@ -27,6 +28,7 @@ using System.Linq; using System.Runtime.Serialization; using System.Text; +using Adyen.Util; using Newtonsoft.Json; namespace Adyen.Model.Checkout @@ -35,67 +37,69 @@ namespace Adyen.Model.Checkout /// SubInputDetail /// [DataContract] - public partial class SubInputDetail : IEquatable, IValidatableObject + public partial class SubInputDetail : IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. /// - /// Configuration parameters for the required input.. - /// In case of a select, the items to choose from.. - /// The value to provide in the result.. - /// True if this input is optional to provide.. - /// The type of the required input.. - /// The value can be pre-filled, if available.. - public SubInputDetail(Dictionary Configuration = default(Dictionary), List Items = default(List), string Key = default(string), bool? Optional = default(bool?), string Type = default(string), string Value = default(string)) + /// Configuration parameters for the required input.. + /// In case of a select, the items to choose from.. + /// The value to provide in the result.. + /// True if this input is optional to provide.. + /// The type of the required input.. + /// The value can be pre-filled, if available.. + public SubInputDetail(Dictionary configuration = default(Dictionary), + List items = default(List), string key = default(string), bool? optional = default(bool?), + string type = default(string), string value = default(string)) { - this.Configuration = Configuration; - this.Items = Items; - this.Key = Key; - this.Optional = Optional; - this.Type = Type; - this.Value = Value; + this.Configuration = configuration; + this.Items = items; + this.Key = key; + this.Optional = optional; + this.Type = type; + this.Value = value; } - + /// /// Configuration parameters for the required input. /// /// Configuration parameters for the required input. - [DataMember(Name="configuration", EmitDefaultValue=false)] + [DataMember(Name = "configuration", EmitDefaultValue = false)] public Dictionary Configuration { get; set; } /// /// In case of a select, the items to choose from. /// /// In case of a select, the items to choose from. - [DataMember(Name="items", EmitDefaultValue=false)] + [DataMember(Name = "items", EmitDefaultValue = false)] public List Items { get; set; } /// /// The value to provide in the result. /// /// The value to provide in the result. - [DataMember(Name="key", EmitDefaultValue=false)] + [DataMember(Name = "key", EmitDefaultValue = false)] public string Key { get; set; } /// /// True if this input is optional to provide. /// /// True if this input is optional to provide. - [DataMember(Name="optional", EmitDefaultValue=false)] + [DataMember(Name = "optional", EmitDefaultValue = false)] public bool? Optional { get; set; } /// /// The type of the required input. /// /// The type of the required input. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public string Type { get; set; } /// /// The value can be pre-filled, if available. /// /// The value can be pre-filled, if available. - [DataMember(Name="value", EmitDefaultValue=false)] + [DataMember(Name = "value", EmitDefaultValue = false)] public string Value { get; set; } /// @@ -106,8 +110,8 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("class SubInputDetail {\n"); - sb.Append(" Configuration: ").Append(Configuration).Append("\n"); - sb.Append(" Items: ").Append(Items).Append("\n"); + sb.Append(" Configuration: ").Append(Configuration.ToCollectionsString()).Append("\n"); + sb.Append(" Items: ").Append(Items.ObjectListToString()).Append("\n"); sb.Append(" Key: ").Append(Key).Append("\n"); sb.Append(" Optional: ").Append(Optional).Append("\n"); sb.Append(" Type: ").Append(Type).Append("\n"); @@ -115,12 +119,12 @@ public override string ToString() 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); } @@ -145,36 +149,38 @@ public bool Equals(SubInputDetail input) if (input == null) return false; - return + return ( this.Configuration == input.Configuration || this.Configuration != null && + input.Configuration != null && this.Configuration.SequenceEqual(input.Configuration) - ) && + ) && ( this.Items == input.Items || this.Items != null && + input.Items != null && this.Items.SequenceEqual(input.Items) - ) && + ) && ( this.Key == input.Key || - (this.Key != null && - this.Key.Equals(input.Key)) - ) && + this.Key != null && + this.Key.Equals(input.Key) + ) && ( this.Optional == input.Optional || - (this.Optional != null && - this.Optional.Equals(input.Optional)) - ) && + this.Optional != null && + this.Optional.Equals(input.Optional) + ) && ( this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && + this.Type != null && + this.Type.Equals(input.Type) + ) && ( this.Value == input.Value || - (this.Value != null && - this.Value.Equals(input.Value)) + this.Value != null && + this.Value.Equals(input.Value) ); } @@ -208,10 +214,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } - -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/SubscriptionDetails.cs b/Adyen/Model/Checkout/SubscriptionDetails.cs new file mode 100644 index 000000000..00b3e339e --- /dev/null +++ b/Adyen/Model/Checkout/SubscriptionDetails.cs @@ -0,0 +1,376 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// SubscriptionDetails + /// + [DataContract] + public partial class SubscriptionDetails : IEquatable, IValidatableObject + { + /// + /// 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`. + [JsonConverter(typeof(StringEnumConverter))] + public enum AmountRuleEnum + { + /// + /// Enum Max for value: max + /// + [EnumMember(Value = "max")] Max = 1, + + /// + /// Enum Exact for value: exact + /// + [EnumMember(Value = "exact")] Exact = 2 + } + + /// + /// 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)] + public AmountRuleEnum? 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. + [JsonConverter(typeof(StringEnumConverter))] + public enum BillingAttemptsRuleEnum + { + /// + /// Enum On for value: on + /// + [EnumMember(Value = "on")] On = 1, + + /// + /// Enum Before for value: before + /// + [EnumMember(Value = "before")] Before = 2, + + /// + /// Enum After for value: after + /// + [EnumMember(Value = "after")] After = 3 + } + + /// + /// 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)] + public BillingAttemptsRuleEnum? BillingAttemptsRule { 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. + [JsonConverter(typeof(StringEnumConverter))] + public enum FrequencyEnum + { + /// + /// Enum Adhoc for value: adhoc + /// + [EnumMember(Value = "adhoc")] Adhoc = 1, + + /// + /// Enum Daily for value: daily + /// + [EnumMember(Value = "daily")] Daily = 2, + + /// + /// Enum Weekly for value: weekly + /// + [EnumMember(Value = "weekly")] Weekly = 3, + + /// + /// Enum BiWeekly for value: biWeekly + /// + [EnumMember(Value = "biWeekly")] BiWeekly = 4, + + /// + /// Enum Monthly for value: monthly + /// + [EnumMember(Value = "monthly")] Monthly = 5, + + /// + /// Enum Quarterly for value: quarterly + /// + [EnumMember(Value = "quarterly")] Quarterly = 6, + + /// + /// Enum HalfYearly for value: halfYearly + /// + [EnumMember(Value = "halfYearly")] HalfYearly = 7, + + /// + /// Enum Yearly for value: yearly + /// + [EnumMember(Value = "yearly")] Yearly = 8 + } + + /// + /// 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)] + public FrequencyEnum Frequency { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// The billing amount of the recurring transactions. (required). + /// 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 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 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`.. + /// End date of the billing plan, in YYYY-MM-DD format. (required). + /// The frequency with which a shopper should be charged. Possible values: daily, weekly, biWeekly, monthly, quarterly, halfYearly, yearly. (required). + /// The message shown by UPI to the shopper on the approval screen.. + /// Start date of the billing plan, in YYYY-MM-DD format. By default, the transaction date.. + public SubscriptionDetails(string amount = default(string), + AmountRuleEnum? amountRule = default(AmountRuleEnum?), + BillingAttemptsRuleEnum? billingAttemptsRule = default(BillingAttemptsRuleEnum?), + string billingDay = default(string), string endAt = default(string), + FrequencyEnum frequency = default(FrequencyEnum), string remarks = default(string), + string startAt = default(string)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException( + "amount is a required property for SubscriptionDetails and cannot be null"); + } + else + { + this.Amount = amount; + } + // to ensure "endAt" is required (not null) + if (endAt == null) + { + throw new InvalidDataException( + "endAt is a required property for SubscriptionDetails and cannot be null"); + } + else + { + this.EndAt = endAt; + } + // to ensure "frequency" is required (not null) + if (frequency == null) + { + throw new InvalidDataException( + "frequency is a required property for SubscriptionDetails and cannot be null"); + } + else + { + this.Frequency = frequency; + } + this.AmountRule = amountRule; + this.BillingAttemptsRule = billingAttemptsRule; + this.BillingDay = billingDay; + this.Remarks = remarks; + this.StartAt = startAt; + } + + /// + /// The billing amount of the recurring transactions. + /// + /// The billing amount of the recurring transactions. + [DataMember(Name = "amount", EmitDefaultValue = false)] + public string Amount { 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)] + 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 = "endAt", EmitDefaultValue = false)] + public string EndAt { 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)] + 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 = "startAt", EmitDefaultValue = false)] + public string StartAt { 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 SubscriptionDetails {\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(" EndAt: ").Append(EndAt).Append("\n"); + sb.Append(" Frequency: ").Append(Frequency).Append("\n"); + sb.Append(" Remarks: ").Append(Remarks).Append("\n"); + sb.Append(" StartAt: ").Append(StartAt).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as SubscriptionDetails); + } + + /// + /// Returns true if SubscriptionDetails instances are equal + /// + /// Instance of SubscriptionDetails to be compared + /// Boolean + public bool Equals(SubscriptionDetails input) + { + if (input == null) + return false; + + return + ( + this.Amount == input.Amount || + this.Amount != null && + this.Amount.Equals(input.Amount) + ) && + ( + this.AmountRule == input.AmountRule || + this.AmountRule != null && + this.AmountRule.Equals(input.AmountRule) + ) && + ( + this.BillingAttemptsRule == input.BillingAttemptsRule || + this.BillingAttemptsRule != null && + this.BillingAttemptsRule.Equals(input.BillingAttemptsRule) + ) && + ( + this.BillingDay == input.BillingDay || + this.BillingDay != null && + this.BillingDay.Equals(input.BillingDay) + ) && + ( + this.EndAt == input.EndAt || + this.EndAt != null && + this.EndAt.Equals(input.EndAt) + ) && + ( + this.Frequency == input.Frequency || + this.Frequency != null && + this.Frequency.Equals(input.Frequency) + ) && + ( + this.Remarks == input.Remarks || + this.Remarks != null && + this.Remarks.Equals(input.Remarks) + ) && + ( + this.StartAt == input.StartAt || + this.StartAt != null && + this.StartAt.Equals(input.StartAt) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Amount != null) + hashCode = hashCode * 59 + this.Amount.GetHashCode(); + if (this.AmountRule != null) + hashCode = hashCode * 59 + this.AmountRule.GetHashCode(); + if (this.BillingAttemptsRule != null) + hashCode = hashCode * 59 + this.BillingAttemptsRule.GetHashCode(); + if (this.BillingDay != null) + hashCode = hashCode * 59 + this.BillingDay.GetHashCode(); + if (this.EndAt != null) + hashCode = hashCode * 59 + this.EndAt.GetHashCode(); + if (this.Frequency != null) + hashCode = hashCode * 59 + this.Frequency.GetHashCode(); + if (this.Remarks != null) + hashCode = hashCode * 59 + this.Remarks.GetHashCode(); + if (this.StartAt != null) + hashCode = hashCode * 59 + this.StartAt.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ThreeDS2RequestData.cs b/Adyen/Model/Checkout/ThreeDS2RequestData.cs index abb6d7b23..c3610d9de 100644 --- a/Adyen/Model/Checkout/ThreeDS2RequestData.cs +++ b/Adyen/Model/Checkout/ThreeDS2RequestData.cs @@ -1,35 +1,35 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; -using System.Text; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.IO; using System.Runtime.Serialization; +using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using Adyen.Model.Enum; namespace Adyen.Model.Checkout { @@ -49,47 +49,83 @@ public enum ChallengeIndicatorEnum /// /// Enum NoPreference for value: noPreference /// - [EnumMember(Value = "noPreference")] - NoPreference = 0, + [EnumMember(Value = "noPreference")] NoPreference = 1, + /// /// Enum RequestNoChallenge for value: requestNoChallenge /// - [EnumMember(Value = "requestNoChallenge")] - RequestNoChallenge = 1, + [EnumMember(Value = "requestNoChallenge")] RequestNoChallenge = 2, + /// /// Enum RequestChallenge for value: requestChallenge /// - [EnumMember(Value = "requestChallenge")] - RequestChallenge = 2, + [EnumMember(Value = "requestChallenge")] RequestChallenge = 3, + /// /// Enum RequestChallengeAsMandate for value: requestChallengeAsMandate /// - [EnumMember(Value = "requestChallengeAsMandate")] - RequestChallengeAsMandate = 3 + [EnumMember(Value = "requestChallengeAsMandate")] RequestChallengeAsMandate = 4 } + /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` /// /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` [DataMember(Name = "challengeIndicator", EmitDefaultValue = false)] public ChallengeIndicatorEnum? ChallengeIndicator { get; set; } + /// - /// Initializes a new instance of the class. + /// Identify the type of the transaction being authenticated. /// - [JsonConstructor] - protected ThreeDS2RequestData() { } + /// Identify the type of the transaction being authenticated. + [JsonConverter(typeof(StringEnumConverter))] + public enum TransactionTypeEnum + { + /// + /// Enum GoodsOrServicePurchase for value: goodsOrServicePurchase + /// + [EnumMember(Value = "goodsOrServicePurchase")] GoodsOrServicePurchase = 1, + + /// + /// Enum CheckAcceptance for value: checkAcceptance + /// + [EnumMember(Value = "checkAcceptance")] CheckAcceptance = 2, + + /// + /// Enum AccountFunding for value: accountFunding + /// + [EnumMember(Value = "accountFunding")] AccountFunding = 3, + + /// + /// Enum QuasiCashTransaction for value: quasiCashTransaction + /// + [EnumMember(Value = "quasiCashTransaction")] QuasiCashTransaction = 4, + + /// + /// Enum PrepaidActivationAndLoad for value: prepaidActivationAndLoad + /// + [EnumMember(Value = "prepaidActivationAndLoad")] PrepaidActivationAndLoad = 5 + } + + /// + /// Identify the type of the transaction being authenticated. + /// + /// Identify the type of the transaction being authenticated. + [DataMember(Name = "transactionType", EmitDefaultValue = false)] + public TransactionTypeEnum? TransactionType { get; set; } + /// /// Initializes a new instance of the class. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation.. - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation.. - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration), and not the payment authorisation.. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform.. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false). /// Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` * `requestChallengeAsMandate` . /// The environment of the shopper. Allowed values: * `app` * `browser` (required). /// deviceRenderOptions. - /// Required for merchants that have been enrolled for 3DS2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. - /// The `messageVersion` value indicating the 3D Secure 2 protocol version.. + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme.. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.. + /// The `messageVersion` value indicating the 3D Secure 2 protocol version. (default to "2.1.0"). /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**.. /// The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. /// The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**.. @@ -98,52 +134,93 @@ protected ThreeDS2RequestData() { } /// The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. /// The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**.. /// Completion indicator for the device fingerprinting.. - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2.. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2.. /// URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process.. - public ThreeDS2RequestData(string AcquirerBIN = default(string), string AcquirerMerchantID = default(string), bool? AuthenticationOnly = default(bool?), ChallengeIndicatorEnum? ChallengeIndicator = default(ChallengeIndicatorEnum?), DeviceChannelEnum? DeviceChannel = default(DeviceChannelEnum), DeviceRenderOptions DeviceRenderOptions = default(DeviceRenderOptions), string Mcc = default(string), string MerchantName = default(string), string MessageVersion = default(string), string NotificationURL = default(string), string SdkAppID = default(string), string SdkEncData = default(string), SDKEphemPubKey SdkEphemPubKey = default(SDKEphemPubKey), int? SdkMaxTimeout = default(int?), string SdkReferenceNumber = default(string), string SdkTransID = default(string), DeviceFingerprintCompletedEnum? ThreeDSCompInd = default(DeviceFingerprintCompletedEnum?), string ThreeDSRequestorID = default(string), string ThreeDSRequestorName = default(string), string ThreeDSRequestorURL = default(string)) + /// Identify the type of the transaction being authenticated.. + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0.. + public ThreeDS2RequestData(string acquirerBIN = default(string), string acquirerMerchantID = default(string), + bool? authenticationOnly = false, + ChallengeIndicatorEnum? challengeIndicator = default(ChallengeIndicatorEnum?), + string deviceChannel = default(string), + DeviceRenderOptions deviceRenderOptions = default(DeviceRenderOptions), string mcc = default(string), + string merchantName = default(string), string messageVersion = "2.1.0", + string notificationURL = default(string), string sdkAppID = default(string), + string sdkEncData = default(string), SDKEphemPubKey sdkEphemPubKey = default(SDKEphemPubKey), + int? sdkMaxTimeout = default(int?), string sdkReferenceNumber = default(string), + string sdkTransID = default(string), string threeDSCompInd = default(string), + string threeDSRequestorID = default(string), string threeDSRequestorName = default(string), + string threeDSRequestorURL = default(string), + TransactionTypeEnum? transactionType = default(TransactionTypeEnum?), + string whiteListStatus = default(string)) { - // to ensure "deviceChannel" is required (not null) - this.DeviceChannel = DeviceChannel ?? throw new InvalidDataException("DeviceChannel is a required property for ThreeDS2RequestData and cannot be null"); ; - this.AcquirerBIN = AcquirerBIN; - this.AcquirerMerchantID = AcquirerMerchantID; - this.AuthenticationOnly = AuthenticationOnly; - this.ChallengeIndicator = ChallengeIndicator; - this.DeviceRenderOptions = DeviceRenderOptions; - this.Mcc = Mcc; - this.MerchantName = MerchantName; - this.MessageVersion = MessageVersion; - this.NotificationURL = NotificationURL; - this.SdkAppID = SdkAppID; - this.SdkEncData = SdkEncData; - this.SdkEphemPubKey = SdkEphemPubKey; - this.SdkMaxTimeout = SdkMaxTimeout; - this.SdkReferenceNumber = SdkReferenceNumber; - this.SdkTransID = SdkTransID; - this.ThreeDSCompInd = ThreeDSCompInd; - this.ThreeDSRequestorID = ThreeDSRequestorID; - this.ThreeDSRequestorName = ThreeDSRequestorName; - this.ThreeDSRequestorURL = ThreeDSRequestorURL; + //to ensure "deviceChannel" is required(not null) + if (deviceChannel == null) + { + throw new InvalidDataException( + "deviceChannel is a required property for ThreeDS2RequestData and cannot be null"); + } + else + { + this.DeviceChannel = deviceChannel; + } + this.AcquirerBIN = acquirerBIN; + this.AcquirerMerchantID = acquirerMerchantID; + // use default value if no "authenticationOnly" provided + if (authenticationOnly == null) + { + this.AuthenticationOnly = false; + } + else + { + this.AuthenticationOnly = authenticationOnly; + } + this.ChallengeIndicator = challengeIndicator; + this.DeviceRenderOptions = deviceRenderOptions; + this.Mcc = mcc; + this.MerchantName = merchantName; + // use default value if no "messageVersion" provided + if (messageVersion == null) + { + this.MessageVersion = "2.1.0"; + } + else + { + this.MessageVersion = messageVersion; + } + this.NotificationURL = notificationURL; + this.SdkAppID = sdkAppID; + this.SdkEncData = sdkEncData; + this.SdkEphemPubKey = sdkEphemPubKey; + this.SdkMaxTimeout = sdkMaxTimeout; + this.SdkReferenceNumber = sdkReferenceNumber; + this.SdkTransID = sdkTransID; + this.ThreeDSCompInd = threeDSCompInd; + this.ThreeDSRequestorID = threeDSRequestorID; + this.ThreeDSRequestorName = threeDSRequestorName; + this.ThreeDSRequestorURL = threeDSRequestorURL; + this.TransactionType = transactionType; + this.WhiteListStatus = whiteListStatus; } /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The acquiring BIN enrolled for 3D Secure 2. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. [DataMember(Name = "acquirerBIN", EmitDefaultValue = false)] public string AcquirerBIN { get; set; } /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchantId that is enrolled for 3D Secure 2 by the merchant's acquirer. This string should match the value that you will use in the authorisation. Use 123456 on the Test platform. [DataMember(Name = "acquirerMerchantID", EmitDefaultValue = false)] public string AcquirerMerchantID { get; set; } /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration), and not the payment authorisation. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. /// - /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration), and not the payment authorisation. + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. [DataMember(Name = "authenticationOnly", EmitDefaultValue = false)] public bool? AuthenticationOnly { get; set; } @@ -153,7 +230,7 @@ protected ThreeDS2RequestData() { } /// /// The environment of the shopper. Allowed values: * `app` * `browser` [DataMember(Name = "deviceChannel", EmitDefaultValue = false)] - public DeviceChannelEnum? DeviceChannel { get; set; } + public string DeviceChannel { get; set; } /// /// Gets or Sets DeviceRenderOptions @@ -162,16 +239,16 @@ protected ThreeDS2RequestData() { } public DeviceRenderOptions DeviceRenderOptions { get; set; } /// - /// Required for merchants that have been enrolled for 3DS2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. /// - /// Required for merchants that have been enrolled for 3DS2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. + /// Required for merchants that have been enrolled for 3D Secure 2 by another party than Adyen, mostly [authentication-only integrations](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The `mcc` is a four-digit code with which the previously given `acquirerMerchantID` is registered at the scheme. [DataMember(Name = "mcc", EmitDefaultValue = false)] public string Mcc { get; set; } /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters. > Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account. [DataMember(Name = "merchantName", EmitDefaultValue = false)] public string MerchantName { get; set; } @@ -183,7 +260,7 @@ protected ThreeDS2RequestData() { } public string MessageVersion { get; set; } /// - /// URL to where the issuer should send the CR. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. /// /// URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. [DataMember(Name = "notificationURL", EmitDefaultValue = false)] @@ -235,19 +312,19 @@ protected ThreeDS2RequestData() { } /// /// Completion indicator for the device fingerprinting. [DataMember(Name = "threeDSCompInd", EmitDefaultValue = false)] - public DeviceFingerprintCompletedEnum? ThreeDSCompInd { get; set; } + public string ThreeDSCompInd { get; set; } /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. [DataMember(Name = "threeDSRequestorID", EmitDefaultValue = false)] public string ThreeDSRequestorID { get; set; } /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. /// - /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + /// Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/other-3ds-flows/authentication-only) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. [DataMember(Name = "threeDSRequestorName", EmitDefaultValue = false)] public string ThreeDSRequestorName { get; set; } @@ -258,6 +335,14 @@ protected ThreeDS2RequestData() { } [DataMember(Name = "threeDSRequestorURL", EmitDefaultValue = false)] public string ThreeDSRequestorURL { get; set; } + + /// + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + /// + /// The `whiteListStatus` value returned from a previous 3D Secure 2 transaction, only applicable for 3D Secure 2 protocol version 2.2.0. + [DataMember(Name = "whiteListStatus", EmitDefaultValue = false)] + public string WhiteListStatus { get; set; } + /// /// Returns the string presentation of the object /// @@ -286,6 +371,8 @@ public override string ToString() sb.Append(" ThreeDSRequestorID: ").Append(ThreeDSRequestorID).Append("\n"); sb.Append(" ThreeDSRequestorName: ").Append(ThreeDSRequestorName).Append("\n"); sb.Append(" ThreeDSRequestorURL: ").Append(ThreeDSRequestorURL).Append("\n"); + sb.Append(" TransactionType: ").Append(TransactionType).Append("\n"); + sb.Append(" WhiteListStatus: ").Append(WhiteListStatus).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -322,103 +409,113 @@ public bool Equals(ThreeDS2RequestData input) return ( this.AcquirerBIN == input.AcquirerBIN || - (this.AcquirerBIN != null && - this.AcquirerBIN.Equals(input.AcquirerBIN)) + this.AcquirerBIN != null && + this.AcquirerBIN.Equals(input.AcquirerBIN) ) && ( this.AcquirerMerchantID == input.AcquirerMerchantID || - (this.AcquirerMerchantID != null && - this.AcquirerMerchantID.Equals(input.AcquirerMerchantID)) + this.AcquirerMerchantID != null && + this.AcquirerMerchantID.Equals(input.AcquirerMerchantID) ) && ( this.AuthenticationOnly == input.AuthenticationOnly || - (this.AuthenticationOnly != null && - this.AuthenticationOnly.Equals(input.AuthenticationOnly)) + this.AuthenticationOnly != null && + this.AuthenticationOnly.Equals(input.AuthenticationOnly) ) && ( this.ChallengeIndicator == input.ChallengeIndicator || - (this.ChallengeIndicator != null && - this.ChallengeIndicator.Equals(input.ChallengeIndicator)) + this.ChallengeIndicator != null && + this.ChallengeIndicator.Equals(input.ChallengeIndicator) ) && ( this.DeviceChannel == input.DeviceChannel || - (this.DeviceChannel != null && - this.DeviceChannel.Equals(input.DeviceChannel)) + this.DeviceChannel != null && + this.DeviceChannel.Equals(input.DeviceChannel) ) && ( this.DeviceRenderOptions == input.DeviceRenderOptions || - (this.DeviceRenderOptions != null && - this.DeviceRenderOptions.Equals(input.DeviceRenderOptions)) + this.DeviceRenderOptions != null && + this.DeviceRenderOptions.Equals(input.DeviceRenderOptions) ) && ( this.Mcc == input.Mcc || - (this.Mcc != null && - this.Mcc.Equals(input.Mcc)) + this.Mcc != null && + this.Mcc.Equals(input.Mcc) ) && ( this.MerchantName == input.MerchantName || - (this.MerchantName != null && - this.MerchantName.Equals(input.MerchantName)) + this.MerchantName != null && + this.MerchantName.Equals(input.MerchantName) ) && ( this.MessageVersion == input.MessageVersion || - (this.MessageVersion != null && - this.MessageVersion.Equals(input.MessageVersion)) + this.MessageVersion != null && + this.MessageVersion.Equals(input.MessageVersion) ) && ( this.NotificationURL == input.NotificationURL || - (this.NotificationURL != null && - this.NotificationURL.Equals(input.NotificationURL)) + this.NotificationURL != null && + this.NotificationURL.Equals(input.NotificationURL) ) && ( this.SdkAppID == input.SdkAppID || - (this.SdkAppID != null && - this.SdkAppID.Equals(input.SdkAppID)) + this.SdkAppID != null && + this.SdkAppID.Equals(input.SdkAppID) ) && ( this.SdkEncData == input.SdkEncData || - (this.SdkEncData != null && - this.SdkEncData.Equals(input.SdkEncData)) + this.SdkEncData != null && + this.SdkEncData.Equals(input.SdkEncData) ) && ( this.SdkEphemPubKey == input.SdkEphemPubKey || - (this.SdkEphemPubKey != null && - this.SdkEphemPubKey.Equals(input.SdkEphemPubKey)) + this.SdkEphemPubKey != null && + this.SdkEphemPubKey.Equals(input.SdkEphemPubKey) ) && ( this.SdkMaxTimeout == input.SdkMaxTimeout || - (this.SdkMaxTimeout != null && - this.SdkMaxTimeout.Equals(input.SdkMaxTimeout)) + this.SdkMaxTimeout != null && + this.SdkMaxTimeout.Equals(input.SdkMaxTimeout) ) && ( this.SdkReferenceNumber == input.SdkReferenceNumber || - (this.SdkReferenceNumber != null && - this.SdkReferenceNumber.Equals(input.SdkReferenceNumber)) + this.SdkReferenceNumber != null && + this.SdkReferenceNumber.Equals(input.SdkReferenceNumber) ) && ( this.SdkTransID == input.SdkTransID || - (this.SdkTransID != null && - this.SdkTransID.Equals(input.SdkTransID)) + this.SdkTransID != null && + this.SdkTransID.Equals(input.SdkTransID) ) && ( this.ThreeDSCompInd == input.ThreeDSCompInd || - (this.ThreeDSCompInd != null && - this.ThreeDSCompInd.Equals(input.ThreeDSCompInd)) + this.ThreeDSCompInd != null && + this.ThreeDSCompInd.Equals(input.ThreeDSCompInd) ) && ( this.ThreeDSRequestorID == input.ThreeDSRequestorID || - (this.ThreeDSRequestorID != null && - this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID)) + this.ThreeDSRequestorID != null && + this.ThreeDSRequestorID.Equals(input.ThreeDSRequestorID) ) && ( this.ThreeDSRequestorName == input.ThreeDSRequestorName || - (this.ThreeDSRequestorName != null && - this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName)) + this.ThreeDSRequestorName != null && + this.ThreeDSRequestorName.Equals(input.ThreeDSRequestorName) ) && ( this.ThreeDSRequestorURL == input.ThreeDSRequestorURL || - (this.ThreeDSRequestorURL != null && - this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL)) + this.ThreeDSRequestorURL != null && + this.ThreeDSRequestorURL.Equals(input.ThreeDSRequestorURL) + ) && + ( + this.TransactionType == input.TransactionType || + this.TransactionType != null && + this.TransactionType.Equals(input.TransactionType) + ) && + ( + this.WhiteListStatus == input.WhiteListStatus || + this.WhiteListStatus != null && + this.WhiteListStatus.Equals(input.WhiteListStatus) ); } @@ -471,6 +568,10 @@ public override int GetHashCode() hashCode = hashCode * 59 + this.ThreeDSRequestorName.GetHashCode(); if (this.ThreeDSRequestorURL != null) hashCode = hashCode * 59 + this.ThreeDSRequestorURL.GetHashCode(); + if (this.TransactionType != null) + hashCode = hashCode * 59 + this.TransactionType.GetHashCode(); + if (this.WhiteListStatus != null) + hashCode = hashCode * 59 + this.WhiteListStatus.GetHashCode(); return hashCode; } } @@ -480,9 +581,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/ThreeDSecureData.cs b/Adyen/Model/Checkout/ThreeDSecureData.cs index 47dffb692..f25c26d70 100644 --- a/Adyen/Model/Checkout/ThreeDSecureData.cs +++ b/Adyen/Model/Checkout/ThreeDSecureData.cs @@ -1,34 +1,34 @@ -#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. -// */ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.Text; using System.Collections.Generic; -using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; +using System.Text; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; namespace Adyen.Model.Checkout { @@ -39,90 +39,112 @@ namespace Adyen.Model.Checkout public partial class ThreeDSecureData : IEquatable, IValidatableObject { /// - /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// - /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. [JsonConverter(typeof(StringEnumConverter))] public enum AuthenticationResponseEnum { /// /// Enum Y for value: Y /// - [EnumMember(Value = "Y")] - Y = 0, + [EnumMember(Value = "Y")] Y = 1, + /// /// Enum N for value: N /// - [EnumMember(Value = "N")] - N = 1, + [EnumMember(Value = "N")] N = 2, + /// /// Enum U for value: U /// - [EnumMember(Value = "U")] - U = 2, + [EnumMember(Value = "U")] U = 3, + /// /// Enum A for value: A /// - [EnumMember(Value = "A")] - A = 3 + [EnumMember(Value = "A")] A = 4 } + /// - /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. /// - /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter. [DataMember(Name = "authenticationResponse", EmitDefaultValue = false)] public AuthenticationResponseEnum? AuthenticationResponse { get; set; } + /// - /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. /// - /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. [JsonConverter(typeof(StringEnumConverter))] public enum DirectoryResponseEnum { /// - /// Enum Y for value: Y + /// Enum A for value: A /// - [EnumMember(Value = "Y")] - Y = 0, + [EnumMember(Value = "A")] A = 1, + + /// + /// Enum C for value: C + /// + [EnumMember(Value = "C")] C = 2, + + /// + /// Enum D for value: D + /// + [EnumMember(Value = "D")] D = 3, + + /// + /// Enum I for value: I + /// + [EnumMember(Value = "I")] I = 4, + /// /// Enum N for value: N /// - [EnumMember(Value = "N")] - N = 1, + [EnumMember(Value = "N")] N = 5, + /// - /// Enum U for value: U + /// Enum R for value: R /// - [EnumMember(Value = "U")] - U = 2, + [EnumMember(Value = "R")] R = 6, + /// - /// Enum E for value: E + /// Enum U for value: U /// - [EnumMember(Value = "E")] - E = 3, + [EnumMember(Value = "U")] U = 7, + /// - /// Enum C for value: C + /// Enum Y for value: Y /// - [EnumMember(Value = "C")] - C = 4 + [EnumMember(Value = "Y")] Y = 8 } + /// - /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. /// - /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`. [DataMember(Name = "directoryResponse", EmitDefaultValue = false)] public DirectoryResponseEnum? DirectoryResponse { get; set; } + /// /// Initializes a new instance of the class. /// - /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**.. + /// In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from the challenge result. If the transaction was frictionless, omit this parameter.. /// The cardholder authentication value (base64 encoded, 20 bytes in a decoded form).. /// The CAVV algorithm used. Include this only for 3D Secure 1.. - /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result.. + /// In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from the `ARes`.. /// Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction.. /// The electronic commerce indicator.. /// The version of the 3D Secure protocol.. /// Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form).. - public ThreeDSecureData(AuthenticationResponseEnum? authenticationResponse = default(AuthenticationResponseEnum?), byte[] cavv = default(byte[]), string cavvAlgorithm = default(string), DirectoryResponseEnum? directoryResponse = default(DirectoryResponseEnum?), string dsTransID = default(string), string eci = default(string), string threeDSVersion = default(string), byte[] xid = default(byte[])) + public ThreeDSecureData( + AuthenticationResponseEnum? authenticationResponse = default(AuthenticationResponseEnum?), + byte[] cavv = default(byte[]), string cavvAlgorithm = default(string), + DirectoryResponseEnum? directoryResponse = default(DirectoryResponseEnum?), + string dsTransID = default(string), string eci = default(string), string threeDSVersion = default(string), + byte[] xid = default(byte[])) { this.AuthenticationResponse = authenticationResponse; this.Cavv = cavv; @@ -230,43 +252,43 @@ public bool Equals(ThreeDSecureData input) return ( this.AuthenticationResponse == input.AuthenticationResponse || - (this.AuthenticationResponse != null && - this.AuthenticationResponse.Equals(input.AuthenticationResponse)) + this.AuthenticationResponse != null && + this.AuthenticationResponse.Equals(input.AuthenticationResponse) ) && ( this.Cavv == input.Cavv || - (this.Cavv != null && - this.Cavv.Equals(input.Cavv)) + this.Cavv != null && + this.Cavv.Equals(input.Cavv) ) && ( this.CavvAlgorithm == input.CavvAlgorithm || - (this.CavvAlgorithm != null && - this.CavvAlgorithm.Equals(input.CavvAlgorithm)) + this.CavvAlgorithm != null && + this.CavvAlgorithm.Equals(input.CavvAlgorithm) ) && ( this.DirectoryResponse == input.DirectoryResponse || - (this.DirectoryResponse != null && - this.DirectoryResponse.Equals(input.DirectoryResponse)) + this.DirectoryResponse != null && + this.DirectoryResponse.Equals(input.DirectoryResponse) ) && ( this.DsTransID == input.DsTransID || - (this.DsTransID != null && - this.DsTransID.Equals(input.DsTransID)) + this.DsTransID != null && + this.DsTransID.Equals(input.DsTransID) ) && ( this.Eci == input.Eci || - (this.Eci != null && - this.Eci.Equals(input.Eci)) + this.Eci != null && + this.Eci.Equals(input.Eci) ) && ( this.ThreeDSVersion == input.ThreeDSVersion || - (this.ThreeDSVersion != null && - this.ThreeDSVersion.Equals(input.ThreeDSVersion)) + this.ThreeDSVersion != null && + this.ThreeDSVersion.Equals(input.ThreeDSVersion) ) && ( this.Xid == input.Xid || - (this.Xid != null && - this.Xid.Equals(input.Xid)) + this.Xid != null && + this.Xid.Equals(input.Xid) ); } @@ -304,9 +326,10 @@ public override int GetHashCode() /// /// Validation context /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) { yield break; } } -} +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs new file mode 100644 index 000000000..23a332144 --- /dev/null +++ b/Adyen/Model/Checkout/UpdatePaymentLinkRequest.cs @@ -0,0 +1,155 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// 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.IO; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Adyen.Model.Checkout +{ + /// + /// UpdatePaymentLinkRequest + /// + [DataContract] + public partial class UpdatePaymentLinkRequest : IEquatable, IValidatableObject + { + /// + /// Status of the payment link. Possible values: * **expired** + /// + /// Status of the payment link. Possible values: * **expired** + [JsonConverter(typeof(StringEnumConverter))] + public enum StatusEnum + { + /// + /// Enum Expired for value: expired + /// + [EnumMember(Value = "expired")] Expired = 1 + } + + /// + /// Status of the payment link. Possible values: * **expired** + /// + /// Status of the payment link. Possible values: * **expired** + [DataMember(Name = "status", EmitDefaultValue = false)] + public StatusEnum Status { get; set; } + + /// + /// Initializes a new instance of the class. + /// + /// Status of the payment link. Possible values: * **expired** (required). + public UpdatePaymentLinkRequest(StatusEnum status = default(StatusEnum)) + { + // to ensure "status" is required (not null) + if (status == null) + { + throw new InvalidDataException( + "status is a required property for UpdatePaymentLinkRequest and cannot be null"); + } + else + { + this.Status = status; + } + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class UpdatePaymentLinkRequest {\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as UpdatePaymentLinkRequest); + } + + /// + /// Returns true if UpdatePaymentLinkRequest instances are equal + /// + /// Instance of UpdatePaymentLinkRequest to be compared + /// Boolean + public bool Equals(UpdatePaymentLinkRequest input) + { + if (input == null) + return false; + + return + this.Status == input.Status || + this.Status != null && + this.Status.Equals(input.Status); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Status != null) + hashCode = hashCode * 59 + this.Status.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate( + ValidationContext validationContext) + { + yield break; + } + } +} \ No newline at end of file diff --git a/Adyen/Model/CheckoutUtility/OriginKeysRequest.cs b/Adyen/Model/CheckoutUtility/OriginKeysRequest.cs deleted file mode 100644 index be2cbb009..000000000 --- a/Adyen/Model/CheckoutUtility/OriginKeysRequest.cs +++ /dev/null @@ -1,105 +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 Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; - -namespace Adyen.Model.CheckoutUtility -{ - /// - /// OriginKeysRequest - /// - [DataContract] - public class OriginKeysRequest : IEquatable, IValidatableObject - { - [DataMember(Name = "originDomains", EmitDefaultValue = false)] - public List OriginDomains { get; set; } - - public bool Equals(OriginKeysRequest input) - { - if (input == null) - return false; - - return ( - this.OriginDomains == input.OriginDomains || - this.OriginDomains != null && - this.OriginDomains.SequenceEqual(input.OriginDomains)); - } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OriginKeysRequest {\n"); - sb.Append(" OriginDomains: ").Append(OriginDomains).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 input) - { - return this.Equals(input as OriginKeysRequest); - } - - - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OriginDomains != null) - hashCode = hashCode * 59 + this.OriginDomains.GetHashCode(); - return hashCode; - } - - } - } -} diff --git a/Adyen/Model/CheckoutUtility/OriginKeysResponse.cs b/Adyen/Model/CheckoutUtility/OriginKeysResponse.cs deleted file mode 100644 index bccb949e7..000000000 --- a/Adyen/Model/CheckoutUtility/OriginKeysResponse.cs +++ /dev/null @@ -1,108 +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.Runtime.Serialization; -using System.Text; -using System.Linq; -using Newtonsoft.Json; - -namespace Adyen.Model.CheckoutUtility -{ - /// - /// OriginKeysResponse - /// - [DataContract] - public class OriginKeysResponse : IEquatable, IValidatableObject - { - [DataMember(Name = "originKeys", EmitDefaultValue = false)] - public Dictionary OriginKeys { get;set;} - - public bool Equals(OriginKeysResponse input) - { - if (input == null) - return false; - - return ( - this.OriginKeys == input.OriginKeys || - this.OriginKeys != null && - this.OriginKeys.SequenceEqual(input.OriginKeys)); - } - - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OriginKeysResponse {\n"); - sb.Append(" OriginKeys: ").Append(OriginKeys).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 input) - { - return this.Equals(input as OriginKeysResponse); - } - - public IEnumerable Validate(ValidationContext validationContext) - { - yield break; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this.OriginKeys != null) - hashCode = hashCode * 59 + this.OriginKeys.GetHashCode(); - return hashCode; - } - } - } -} diff --git a/Adyen/Model/Hop/GetOnboardingUrlRequest.cs b/Adyen/Model/Hop/GetOnboardingUrlRequest.cs index 4e294dcd5..8b058bd48 100644 --- a/Adyen/Model/Hop/GetOnboardingUrlRequest.cs +++ b/Adyen/Model/Hop/GetOnboardingUrlRequest.cs @@ -31,46 +31,57 @@ namespace Adyen.Model.Hop public class GetOnboardingUrlRequest { /// - /// The account holder code you provided when you created the account holder. - /// - /// The account holder code you provided when you created the account holder. - [DataMember(Name="accountHolderCode", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "accountHolderCode")] + /// The account holder code you provided when you created the account holder. + /// + /// The account holder code you provided when you created the account holder. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] public string AccountHolderCode { get; set; } - /// - /// The URL where the sub-merchant will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don't provide this, the sub-merchant will be redirected back to the default return URL configured in your platform account. - /// - /// The URL where the sub-merchant will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don't provide this, the sub-merchant will be redirected back to the default return URL configured in your platform account. - [DataMember(Name="returnUrl", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "returnUrl")] + /// + /// The URL where the sub-merchant will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don't provide this, the sub-merchant will be redirected back to the default return URL configured in your platform account. + /// + /// The URL where the sub-merchant will be redirected back to after they complete the onboarding, or if their session times out. Maximum length of 500 characters. If you don't provide this, the sub-merchant will be redirected back to the default return URL configured in your platform account. + [DataMember(Name = "returnUrl", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "returnUrl")] public string ReturnUrl { get; set; } - /// - /// The platform name which will show up in the welcome page. - /// - /// The platform name which will show up in the welcome page. - [DataMember(Name="platformName", EmitDefaultValue=false)] - [JsonProperty(PropertyName = "platformName")] - public string PlatformName { 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 GetOnboardingUrlRequest {\n"); - sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); - sb.Append(" PlatformName: ").Append(PlatformName).Append("\n"); - sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } + /// + /// The platform name which will show up in the welcome page. + /// + /// The platform name which will show up in the welcome page. + [DataMember(Name = "platformName", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "platformName")] + public string PlatformName { get; set; } + /// + /// The language to be used in the page, specified by a combination of a language and country code. For example, pt-BR. + /// If not specified in the request or if the language is not supported, the page uses the browser + /// language.If the browser language is not supported, the page uses en-US by default + /// + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "shopperLocale")] + public string ShopperLocale { 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 GetOnboardingUrlRequest {\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" PlatformName: ").Append(PlatformName).Append("\n"); + sb.Append(" ReturnUrl: ").Append(ReturnUrl).Append("\n"); + sb.Append(" ShopperLocale: ").Append(ShopperLocale).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); - } + /// + /// 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/Modification/CaptureRequest.cs b/Adyen/Model/Modification/CaptureRequest.cs index 83f614a82..1284a0a1f 100644 --- a/Adyen/Model/Modification/CaptureRequest.cs +++ b/Adyen/Model/Modification/CaptureRequest.cs @@ -21,13 +21,11 @@ // */ #endregion -using System; using System.Collections.Generic; using System.Runtime.Serialization; using System.Text; -using Adyen.Constants; -using Adyen.Constants.HPPConstants; using Adyen.Model.ApplicationInformation; +using Adyen.Util; using Newtonsoft.Json; namespace Adyen.Model.Modification @@ -43,6 +41,8 @@ public CaptureRequest() [DataMember(Name = "modificationAmount", EmitDefaultValue = false)] public Amount ModificationAmount { get; set; } + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List Splits { get; set; } /// /// Returns the string presentation of the object /// @@ -55,6 +55,8 @@ public override string ToString() sb.Append(" modificationAmount.Currency: ").Append(ModificationAmount.Currency).Append("\n"); sb.Append(" modificationAmount.Value: ").Append(ModificationAmount.Value).Append("\n"); sb.Append(" originalReference: ").Append(OriginalReference).Append("\n"); + sb.Append(" splits: ").Append(Splits.ObjectListToString()).Append("\n"); + sb.Append("}"); return sb.ToString(); } diff --git a/Adyen/Model/Nexo/BalanceInquiryResponse.cs b/Adyen/Model/Nexo/BalanceInquiryResponse.cs index 701d30e58..79ed1da82 100644 --- a/Adyen/Model/Nexo/BalanceInquiryResponse.cs +++ b/Adyen/Model/Nexo/BalanceInquiryResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/CardAcquisitionRequest.cs b/Adyen/Model/Nexo/CardAcquisitionRequest.cs index 68732d2af..42fdcd466 100644 --- a/Adyen/Model/Nexo/CardAcquisitionRequest.cs +++ b/Adyen/Model/Nexo/CardAcquisitionRequest.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/CardAcquisitionResponse.cs b/Adyen/Model/Nexo/CardAcquisitionResponse.cs index c73dbc74e..7da20fa08 100644 --- a/Adyen/Model/Nexo/CardAcquisitionResponse.cs +++ b/Adyen/Model/Nexo/CardAcquisitionResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/CardReaderInitResponse.cs b/Adyen/Model/Nexo/CardReaderInitResponse.cs index eec732cb3..6604871fd 100644 --- a/Adyen/Model/Nexo/CardReaderInitResponse.cs +++ b/Adyen/Model/Nexo/CardReaderInitResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/CardReaderPowerOffResponse.cs b/Adyen/Model/Nexo/CardReaderPowerOffResponse.cs index 2e42cd5ea..42767c4bb 100644 --- a/Adyen/Model/Nexo/CardReaderPowerOffResponse.cs +++ b/Adyen/Model/Nexo/CardReaderPowerOffResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/DiagnosisResponse.cs b/Adyen/Model/Nexo/DiagnosisResponse.cs index 5f0f9d5d6..446ecb738 100644 --- a/Adyen/Model/Nexo/DiagnosisResponse.cs +++ b/Adyen/Model/Nexo/DiagnosisResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/DisplayResponse.cs b/Adyen/Model/Nexo/DisplayResponse.cs index f5f51c83a..541a5640c 100644 --- a/Adyen/Model/Nexo/DisplayResponse.cs +++ b/Adyen/Model/Nexo/DisplayResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/EnableServiceResponse.cs b/Adyen/Model/Nexo/EnableServiceResponse.cs index cf3cb61d3..b03ec836e 100644 --- a/Adyen/Model/Nexo/EnableServiceResponse.cs +++ b/Adyen/Model/Nexo/EnableServiceResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/EventNotification.cs b/Adyen/Model/Nexo/EventNotification.cs index b47ad2412..6004c250b 100644 --- a/Adyen/Model/Nexo/EventNotification.cs +++ b/Adyen/Model/Nexo/EventNotification.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/GetTotalsResponse.cs b/Adyen/Model/Nexo/GetTotalsResponse.cs index 9766bf124..f1d4918e8 100644 --- a/Adyen/Model/Nexo/GetTotalsResponse.cs +++ b/Adyen/Model/Nexo/GetTotalsResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/InputResponse.cs b/Adyen/Model/Nexo/InputResponse.cs index 052785c0a..e3b452b4e 100644 --- a/Adyen/Model/Nexo/InputResponse.cs +++ b/Adyen/Model/Nexo/InputResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/LoginResponse.cs b/Adyen/Model/Nexo/LoginResponse.cs index 57be60ade..78873f662 100644 --- a/Adyen/Model/Nexo/LoginResponse.cs +++ b/Adyen/Model/Nexo/LoginResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/LogoutResponse.cs b/Adyen/Model/Nexo/LogoutResponse.cs index 07f67656c..71330f888 100644 --- a/Adyen/Model/Nexo/LogoutResponse.cs +++ b/Adyen/Model/Nexo/LogoutResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/LoyaltyResponse.cs b/Adyen/Model/Nexo/LoyaltyResponse.cs index 6015cac91..999526e20 100644 --- a/Adyen/Model/Nexo/LoyaltyResponse.cs +++ b/Adyen/Model/Nexo/LoyaltyResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/PaymentResponse.cs b/Adyen/Model/Nexo/PaymentResponse.cs index 51b01597c..ad24398e3 100644 --- a/Adyen/Model/Nexo/PaymentResponse.cs +++ b/Adyen/Model/Nexo/PaymentResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/PrintResponse.cs b/Adyen/Model/Nexo/PrintResponse.cs index 1485ca0b7..308460927 100644 --- a/Adyen/Model/Nexo/PrintResponse.cs +++ b/Adyen/Model/Nexo/PrintResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/ReconciliationResponse.cs b/Adyen/Model/Nexo/ReconciliationResponse.cs index af1f5598f..1f5bfd283 100644 --- a/Adyen/Model/Nexo/ReconciliationResponse.cs +++ b/Adyen/Model/Nexo/ReconciliationResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/RepeatedMessageResponse.cs b/Adyen/Model/Nexo/RepeatedMessageResponse.cs index 5260f4f30..3dd9ce84a 100644 --- a/Adyen/Model/Nexo/RepeatedMessageResponse.cs +++ b/Adyen/Model/Nexo/RepeatedMessageResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/RepeatedResponseMessageBody.cs b/Adyen/Model/Nexo/RepeatedResponseMessageBody.cs index 03ca9d53b..0c0bb709c 100644 --- a/Adyen/Model/Nexo/RepeatedResponseMessageBody.cs +++ b/Adyen/Model/Nexo/RepeatedResponseMessageBody.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/ReversalResponse.cs b/Adyen/Model/Nexo/ReversalResponse.cs index d38e0c871..d6e7d34ed 100644 --- a/Adyen/Model/Nexo/ReversalResponse.cs +++ b/Adyen/Model/Nexo/ReversalResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/SaleData.cs b/Adyen/Model/Nexo/SaleData.cs index 25bb39c0f..63a6c7b0d 100644 --- a/Adyen/Model/Nexo/SaleData.cs +++ b/Adyen/Model/Nexo/SaleData.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization.Converter; +using Adyen.ApiSerialization.Converter; using Adyen.Model.Terminal; using Newtonsoft.Json; diff --git a/Adyen/Model/Nexo/SaleToPOIResponse.cs b/Adyen/Model/Nexo/SaleToPOIResponse.cs index 3c64bcbf2..463869233 100644 --- a/Adyen/Model/Nexo/SaleToPOIResponse.cs +++ b/Adyen/Model/Nexo/SaleToPOIResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/StoredValueResponse.cs b/Adyen/Model/Nexo/StoredValueResponse.cs index a6e375dc2..f4633c202 100644 --- a/Adyen/Model/Nexo/StoredValueResponse.cs +++ b/Adyen/Model/Nexo/StoredValueResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/TransactionStatusResponse.cs b/Adyen/Model/Nexo/TransactionStatusResponse.cs index e726a6144..ca924cad4 100644 --- a/Adyen/Model/Nexo/TransactionStatusResponse.cs +++ b/Adyen/Model/Nexo/TransactionStatusResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Model/Nexo/TransmitResponse.cs b/Adyen/Model/Nexo/TransmitResponse.cs index 4d90e940a..d7fe61ec5 100644 --- a/Adyen/Model/Nexo/TransmitResponse.cs +++ b/Adyen/Model/Nexo/TransmitResponse.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; namespace Adyen.Model.Nexo { diff --git a/Adyen/Security/SaleToPoiMessageSecured.cs b/Adyen/Security/SaleToPoiMessageSecured.cs index 3b0acb489..619f285e3 100644 --- a/Adyen/Security/SaleToPoiMessageSecured.cs +++ b/Adyen/Security/SaleToPoiMessageSecured.cs @@ -21,7 +21,7 @@ // */ #endregion -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; using Adyen.Model.Nexo; using Adyen.Model.Nexo.Message; diff --git a/Adyen/Service/Checkout.cs b/Adyen/Service/Checkout.cs index a0dc4bfda..3df7aa749 100644 --- a/Adyen/Service/Checkout.cs +++ b/Adyen/Service/Checkout.cs @@ -26,6 +26,7 @@ using Adyen.Model.Checkout; using Adyen.Service.Resource.Checkout; using Newtonsoft.Json; +using PaymentDetails = Adyen.Service.Resource.Checkout.PaymentDetails; using PaymentRequest = Adyen.Model.Checkout.PaymentRequest; namespace Adyen.Service @@ -56,11 +57,11 @@ public Checkout(Client client) : base(client) /// /// /// PaymentsResponse - public PaymentsResponse Payments(PaymentRequest paymentRequest, RequestOptions requestOptions = null) + public PaymentResponse Payments(PaymentRequest paymentRequest, RequestOptions requestOptions = null) { var jsonRequest = Util.JsonOperation.SerializeRequest(paymentRequest); var jsonResponse = _payments.Request(jsonRequest, requestOptions); - return Util.JsonOperation.Deserialize(jsonResponse); + return Util.JsonOperation.Deserialize(jsonResponse); } /// @@ -69,11 +70,11 @@ public PaymentsResponse Payments(PaymentRequest paymentRequest, RequestOptions r /// /// /// PaymentsResponse - public async Task PaymentsAsync(PaymentRequest paymentRequest, RequestOptions requestOptions = null) + public async Task PaymentsAsync(PaymentRequest paymentRequest, RequestOptions requestOptions = null) { var jsonRequest = Util.JsonOperation.SerializeRequest(paymentRequest); var jsonResponse = await _payments.RequestAsync(jsonRequest, requestOptions); - return Util.JsonOperation.Deserialize(jsonResponse); + return Util.JsonOperation.Deserialize(jsonResponse); } /// @@ -105,11 +106,11 @@ public async Task PaymentMethodsAsync(PaymentMethodsRequ /// /// /// PaymentsResponse - public PaymentsResponse PaymentDetails(PaymentsDetailsRequest paymentsDetailsRequest) + public PaymentResponse PaymentDetails(PaymentsDetailsRequest paymentsDetailsRequest, RequestOptions requestOptions = null) { var jsonRequest = Util.JsonOperation.SerializeRequest(paymentsDetailsRequest); - var jsonResponse = _paymentDetails.Request(jsonRequest); - return JsonConvert.DeserializeObject(jsonResponse); + var jsonResponse = _paymentDetails.Request(jsonRequest, requestOptions); + return Util.JsonOperation.Deserialize(jsonResponse); } /// @@ -117,11 +118,11 @@ public PaymentsResponse PaymentDetails(PaymentsDetailsRequest paymentsDetailsReq /// /// /// PaymentsResponse - public async Task PaymentDetailsAsync(PaymentsDetailsRequest paymentsDetailsRequest) + public async Task PaymentDetailsAsync(PaymentsDetailsRequest paymentsDetailsRequest, RequestOptions requestOptions = null) { var jsonRequest = Util.JsonOperation.SerializeRequest(paymentsDetailsRequest); - var jsonResponse = await _paymentDetails.RequestAsync(jsonRequest); - return JsonConvert.DeserializeObject(jsonResponse); + var jsonResponse = await _paymentDetails.RequestAsync(jsonRequest, requestOptions); + return Util.JsonOperation.Deserialize(jsonResponse); } /// @@ -177,11 +178,11 @@ public async Task PaymentsResultAsync(PaymentResultReques /// /// /// CreatePaymentLinkResponse - public CreatePaymentLinkResponse PaymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest) + public PaymentLinkResource PaymentLinks(CreatePaymentLinkRequest createPaymentLinkRequest) { var jsonRequest = Util.JsonOperation.SerializeRequest(createPaymentLinkRequest); - var jsonResponse = _paymentLinksResult.Request(jsonRequest); - return JsonConvert.DeserializeObject(jsonResponse); + var jsonResponse = _paymentLinksResult.Request(jsonRequest); + return JsonConvert.DeserializeObject(jsonResponse); } } } \ No newline at end of file diff --git a/Adyen/Service/CheckoutUtility.cs b/Adyen/Service/CheckoutUtility.cs index a1e4ded1d..f0d9e9ebc 100644 --- a/Adyen/Service/CheckoutUtility.cs +++ b/Adyen/Service/CheckoutUtility.cs @@ -21,8 +21,8 @@ // */ #endregion -using Adyen.Model.CheckoutUtility; -using Adyen.Service.Resource.CheckoutUtility; +using Adyen.Model.Checkout; +using Adyen.Service.Resource.Checkout; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -40,11 +40,11 @@ public CheckoutUtility(Client client) _originKeys = new OriginKeys(this); } - public OriginKeysResponse OriginKeys(OriginKeysRequest originKeysRequest) + public CheckoutUtilityResponse OriginKeys(CheckoutUtilityRequest checkoutUtilityRequest) { - var jsonRequest = Util.JsonOperation.SerializeRequest(originKeysRequest); + var jsonRequest = Util.JsonOperation.SerializeRequest(checkoutUtilityRequest); var jsonResponse = _originKeys.Request(jsonRequest); - return JsonConvert.DeserializeObject(jsonResponse); + return JsonConvert.DeserializeObject(jsonResponse); } } } diff --git a/Adyen/Service/PosPaymentCloudApi.cs b/Adyen/Service/PosPaymentCloudApi.cs index 7e236a0a3..257d4421b 100644 --- a/Adyen/Service/PosPaymentCloudApi.cs +++ b/Adyen/Service/PosPaymentCloudApi.cs @@ -22,7 +22,7 @@ #endregion using System.Threading.Tasks; -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; using Adyen.Model.Nexo; using Adyen.Service.Resource.Payment; diff --git a/Adyen/Service/PosPaymentLocalApi.cs b/Adyen/Service/PosPaymentLocalApi.cs index 2469e6697..7755f0bfd 100644 --- a/Adyen/Service/PosPaymentLocalApi.cs +++ b/Adyen/Service/PosPaymentLocalApi.cs @@ -25,7 +25,7 @@ using System.ComponentModel; using System.IO; using System.Net.Security; -using Adyen.CloudApiSerialization; +using Adyen.ApiSerialization; using Adyen.Model.Nexo; using Adyen.Security; using Adyen.Service.Resource.Payment; @@ -86,6 +86,18 @@ public SaleToPOIResponse TerminalApiLocal(SaleToPOIMessage saleToPoiRequest, Enc { return TerminalApiLocal(saleToPoiRequest: saleToPoiRequest, encryptionCredentialDetails: encryptionCredentialDetails); } + + /// + /// Used to decrypt the notification received + /// + /// + /// + /// + public string DecryptNotification(string notification, EncryptionCredentialDetails encryptionCredentialDetails) + { + var saleToPoiMessageSecured = _saleToPoiMessageSecuredSerializer.Deserialize(notification); + var decryptNotification = _messageSecuredEncryptor.Decrypt(saleToPoiMessageSecured, encryptionCredentialDetails); + return decryptNotification; + } } } - diff --git a/Adyen/Service/Recurring.cs b/Adyen/Service/Recurring.cs index 73fd6ffd8..1ff432096 100644 --- a/Adyen/Service/Recurring.cs +++ b/Adyen/Service/Recurring.cs @@ -23,7 +23,7 @@ using Adyen.Model.Recurring; using Adyen.Service.Resource.Recurring; -using System; +using System.Threading.Tasks; namespace Adyen.Service { @@ -45,6 +45,13 @@ public RecurringDetailsResult ListRecurringDetails(RecurringDetailsRequest reque return Util.JsonOperation.Deserialize(jsonResponse); } + public async Task ListRecurringDetailsAsync(RecurringDetailsRequest request) + { + var jsonRequest = Util.JsonOperation.SerializeRequest(request); + var jsonResponse = await _listRecurringDetails.RequestAsync(jsonRequest); + return Util.JsonOperation.Deserialize(jsonResponse); + } + public DisableResult Disable(DisableRequest disableRequest) { var jsonRequest = Util.JsonOperation.SerializeRequest(disableRequest); diff --git a/Adyen/Service/Resource/CheckoutUtility/OriginKeys.cs b/Adyen/Service/Resource/Checkout/OriginKeys.cs similarity index 86% rename from Adyen/Service/Resource/CheckoutUtility/OriginKeys.cs rename to Adyen/Service/Resource/Checkout/OriginKeys.cs index e219ccf59..28904e42c 100644 --- a/Adyen/Service/Resource/CheckoutUtility/OriginKeys.cs +++ b/Adyen/Service/Resource/Checkout/OriginKeys.cs @@ -22,16 +22,14 @@ #endregion using Adyen.Constants; -using System; using System.Collections.Generic; -using System.Text; -namespace Adyen.Service.Resource.CheckoutUtility +namespace Adyen.Service.Resource.Checkout { public class OriginKeys : ServiceResource { public OriginKeys(AbstractService abstractService) - : base(abstractService, abstractService.Client.Config.CheckoutEndpoint + "/" + ClientConfig.CheckoutUtilityApiVersion + "/originKeys", new List { "originDomains" }) + : base(abstractService, abstractService.Client.Config.CheckoutEndpoint + "/" + ClientConfig.CheckoutApiVersion + "/originKeys", new List { "originDomains" }) { } } diff --git a/Adyen/Service/Resource/Resource.cs b/Adyen/Service/Resource/Resource.cs index 6077fa183..ac10e66a1 100644 --- a/Adyen/Service/Resource/Resource.cs +++ b/Adyen/Service/Resource/Resource.cs @@ -22,6 +22,7 @@ #endregion using System.Collections.Generic; +using System.Threading.Tasks; namespace Adyen.Service.Resource { @@ -44,5 +45,12 @@ public string Request(string json) var config = this._abstractService.Client.Config; return clientInterface.Request(this.Endpoint, json, config); } + + public async Task RequestAsync(string json) + { + var clientInterface = this._abstractService.Client.HttpClient; + var config = this._abstractService.Client.Config; + return await clientInterface.RequestAsync(this.Endpoint, json, config, false, null); + } } } \ No newline at end of file diff --git a/Adyen/Util/Extensions.cs b/Adyen/Util/Extensions.cs index 6bb5c75ad..04d3fd47c 100644 --- a/Adyen/Util/Extensions.cs +++ b/Adyen/Util/Extensions.cs @@ -71,6 +71,10 @@ public static string ToIndentedString(this object o) /// string public static string ToCollectionsString(this IDictionary dictionary) { + if (dictionary == null) + { + return ""; + } return "{" + string.Join(",", dictionary.Select(kv => kv.Key + "=" + kv.Value).ToArray()) + "}"; } diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs index dddcc7c62..21e066285 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/Util/JsonOperation.cs @@ -37,6 +37,8 @@ public static T Deserialize(string response) { var jsonSettings = new JsonSerializerSettings(); jsonSettings.Converters.Add(new ByteArrayConverter()); + jsonSettings.Converters.Add(new PaymentMethodDetailsConverter()); + jsonSettings.Converters.Add(new PaymentResponseActionConverter()); return JsonConvert.DeserializeObject(response, jsonSettings); } @@ -48,7 +50,7 @@ public static string SerializeRequest(object request) DefaultValueHandling = DefaultValueHandling.Include, }; jsonSettings.Converters.Add(new ByteArrayConverter()); - return JsonConvert.SerializeObject(request, Newtonsoft.Json.Formatting.None, jsonSettings); + return JsonConvert.SerializeObject(request, Formatting.None, jsonSettings); } } } diff --git a/Adyen/Util/PaymentMethodDetailsConverter.cs b/Adyen/Util/PaymentMethodDetailsConverter.cs new file mode 100644 index 000000000..904a7fbae --- /dev/null +++ b/Adyen/Util/PaymentMethodDetailsConverter.cs @@ -0,0 +1,185 @@ +#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 Newtonsoft.Json; +using System; +using Adyen.Model.Checkout; +using Newtonsoft.Json.Linq; +using Adyen.Model.Checkout.Details; + +namespace Adyen.Util +{ + internal class PaymentMethodDetailsConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return objectType == typeof(IPaymentMethodDetails); + } + public override void WriteJson(JsonWriter writer, + object value, JsonSerializer serializer) + { + serializer.Serialize(writer, value); + } + + public override object ReadJson(JsonReader reader, + Type objectType, object existingValue, + JsonSerializer serializer) + { + var jsonObject = JObject.Load(reader); + var paymentMethodDetails = default(IPaymentMethodDetails); + switch (jsonObject["type"].ToString()) + { + case AchDetails.Ach: + paymentMethodDetails = new AchDetails(); + break; + case AmazonPayDetails.AmazonPay: + paymentMethodDetails = new AmazonPayDetails(); + break; + case AndroidPayDetails.AndroidPay: + paymentMethodDetails = new AndroidPayDetails(); + break; + case ApplePayDetails.ApplePay: + paymentMethodDetails = new ApplePayDetails(); + break; + case BacsDirectDebitDetails.Directdebit_GB: + paymentMethodDetails = new BacsDirectDebitDetails(); + break; + case BilldeskOnlineDetails.BilldeskOnline: + paymentMethodDetails = new BilldeskOnlineDetails(); + break; + case BilldeskWalletDetails.BilldeskWallet: + paymentMethodDetails = new BilldeskWalletDetails(); + break; + case BlikDetails.Blik: + paymentMethodDetails = new BlikDetails(); + break; + case CellulantDetails.Cellulant: + paymentMethodDetails = new CellulantDetails(); + break; + case DokuDetails.Alfamart: + case DokuDetails.Bcava: + case DokuDetails.Bniva: + case DokuDetails.Briva: + case DokuDetails.Cimbva: + case DokuDetails.Danamonva: + case DokuDetails.Permataliteatm: + case DokuDetails.Permatatm: + case DokuDetails.Sinarmasva: + case DokuDetails.Indomaret: + case DokuDetails.Mandiriva: + paymentMethodDetails = new DokuDetails(); + break; + case DotpayDetails.Dotpay: + paymentMethodDetails = new DotpayDetails(); + break; + case DragonpayDetails.EBanking: + case DragonpayDetails.OTCBanking: + case DragonpayDetails.OTCNonBanking: + case DragonpayDetails.OTCPhilippines: + paymentMethodDetails = new DragonpayDetails(); + break; + case EcontextVoucherDetails.Stores: + case EcontextVoucherDetails.Seveneleven: + paymentMethodDetails = new EcontextVoucherDetails(); + break; + case EntercashDetails.Entercash: + paymentMethodDetails = new EntercashDetails(); + break; + case GiropayDetails.Giropay: + paymentMethodDetails = new GiropayDetails(); + break; + case GooglePayDetails.GooglePay: + paymentMethodDetails = new GooglePayDetails(); + break; + case IdealDetails.Ideal: + paymentMethodDetails = new IdealDetails(); + break; + case KlarnaDetails.Klarna: + case KlarnaDetails.KlarnaAccount: + case KlarnaDetails.KlarnaB2B: + case KlarnaDetails.KlarnaPayNow: + case KlarnaDetails.KlarnaPayments: + case KlarnaDetails.KlarnaPaymentsAccount: + case KlarnaDetails.KlarnaPaymentsB2B: + paymentMethodDetails = new KlarnaDetails(); + break; + case LianLianPayDetails.EbankingCredit: + case LianLianPayDetails.EbankingDebit: + case LianLianPayDetails.EbankingEnterprise: + paymentMethodDetails = new LianLianPayDetails(); + break; + case MasterpassDetails.Masterpass: + paymentMethodDetails = new MasterpassDetails(); + break; + case MbwayDetails.Mbway: + paymentMethodDetails = new MbwayDetails(); + break; + case MolPayDetails.EBankingDirectMY: + case MolPayDetails.EBankingFPXMy: + case MolPayDetails.EBankingMY: + case MolPayDetails.EBankingTH: + case MolPayDetails.EBankingVN: + case MolPayDetails.FPX: + paymentMethodDetails = new MolPayDetails(); + break; + case MobilePayDetails.Mobilepay: + paymentMethodDetails = new MobilePayDetails(); + break; + case PayPalDetails.PayPal: + paymentMethodDetails = new PayPalDetails(); + break; + case PayUUpiDetails.PayUinUPI: + paymentMethodDetails = new PayUUpiDetails(); + break; + case QiwiWalletDetails.QiwiWallet: + paymentMethodDetails = new QiwiWalletDetails(); + break; + case SamsungPayDetails.SamsungPay: + paymentMethodDetails = new SamsungPayDetails(); + break; + case SepaDirectDebitDetails.Sepadirectdebit: + paymentMethodDetails = new SepaDirectDebitDetails(); + break; + case UpiDetails.Upi: + paymentMethodDetails = new UpiDetails(); + break; + case VippsDetails.Vipps: + paymentMethodDetails = new VippsDetails(); + break; + case VisaCheckoutDetails.VisaCheckout: + paymentMethodDetails = new VisaCheckoutDetails(); + break; + case WeChatPayDetails.Wechatpay: + paymentMethodDetails = new WeChatPayDetails(); + break; + case WeChatPayMiniProgramDetails.WechatpayMiniProgram: + paymentMethodDetails = new WeChatPayMiniProgramDetails(); + break; + default: + paymentMethodDetails = new DefaultPaymentMethodDetails(); + break; + } + serializer.Populate(jsonObject.CreateReader(), paymentMethodDetails); + return paymentMethodDetails; + } + } +} diff --git a/Adyen/Util/PaymentResponseActionConverter.cs b/Adyen/Util/PaymentResponseActionConverter.cs new file mode 100644 index 000000000..4d069b2d3 --- /dev/null +++ b/Adyen/Util/PaymentResponseActionConverter.cs @@ -0,0 +1,86 @@ +#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 Newtonsoft.Json; +using System; +using Adyen.Model.Checkout.Action; +using Newtonsoft.Json.Linq; + +namespace Adyen.Util +{ + internal class PaymentResponseActionConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return objectType == typeof(IPaymentResponseAction); + } + public override void WriteJson(JsonWriter writer, + object value, JsonSerializer serializer) + { + throw new InvalidOperationException("Use default serialization."); + } + + public override object ReadJson(JsonReader reader, + Type objectType, object existingValue, + JsonSerializer serializer) + { + var jsonObject = JObject.Load(reader); + var paymentResponseAction = default(IPaymentResponseAction); + switch (jsonObject["type"].ToString()) + { + case "donation": + paymentResponseAction = new CheckoutDonationAction(); + break; + case "qrCode": + paymentResponseAction = new CheckoutQrCodeAction(); + break; + case "redirect": + paymentResponseAction = new CheckoutRedirectAction(); + break; + case "sdk": + paymentResponseAction = new CheckoutSDKAction(); + break; + case "threeDS2Challenge": + paymentResponseAction = new CheckoutThreeDS2ChallengeAction(); + break; + case "threeDS2Fingerprint": + paymentResponseAction = new CheckoutThreeDS2FingerPrintAction(); + break; + case "threeDS2Action": + paymentResponseAction = new CheckoutThreeDS2Action(); + break; + case "await": + paymentResponseAction = new CheckoutAwaitAction(); + break; + case "voucher": + paymentResponseAction = new CheckoutVoucherAction(); + break; + case "oneTimePasscode": + paymentResponseAction = new CheckoutOneTimePasscodeAction(); + break; + } + + serializer.Populate(jsonObject.CreateReader(), paymentResponseAction); + return paymentResponseAction; + } + } +} diff --git a/README.md b/README.md index 889aaa60a..31ea63b71 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Adyen dotnet API Library -[![Build Status](https://travis-ci.org/Adyen/adyen-dotnet-api-library.svg?branch=develop)](https://travis-ci.org/Adyen/adyen-dotnet-api-library) [![nuget](https://img.shields.io/nuget/v/adyen.svg)](https://www.nuget.org/packages/adyen/) [![nuget](https://img.shields.io/nuget/dt/adyen.svg)](https://www.nuget.org/packages/adyen/) ![.NET Core](https://github.com/Adyen/adyen-dotnet-api-library/workflows/.NET%20Core/badge.svg) +[![nuget](https://img.shields.io/nuget/v/adyen.svg)](https://www.nuget.org/packages/adyen/) [![nuget](https://img.shields.io/nuget/dt/adyen.svg)](https://www.nuget.org/packages/adyen/) ![.NET Core](https://github.com/Adyen/adyen-dotnet-api-library/workflows/.NET%20Core/badge.svg) The Adyen API Library for .net framework enables you to work with Adyen APIs, Hosted Payment Pages and Terminal API with any .net application. @@ -24,7 +24,7 @@ The Library supports all APIs under the following services: * Simply download and restore nuget packages https://www.nuget.org/packages/Adyen/ * or install it from package manager - PM> Install-Package Adyen -Version 5.7.0 + PM> Install-Package Adyen -Version 6.1.0 ### Vagrant setup * Prerequisites virtualbox and vagrant @@ -44,20 +44,20 @@ In order to submit http request to Adyen API you need to initialize the client. ```csharp // Create a paymentsRequest var amount = new Model.Checkout.Amount("USD", 1000); -var paymentsRequest = new Model.Checkout.PaymentRequest +var paymentRequest = new Model.Checkout.PaymentRequest { Reference = "Your order number", Amount = amount, ReturnUrl = @"https://your-company.com/...", MerchantAccount = ClientConstants.MerchantAccount, }; -paymentsRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith"); +paymentRequest.AddCardData("4111111111111111", "10", "2020", "737", "John Smith"); //Create the http client var client = new Client("YOUR-XAPI-KEY", Model.Enum.Environment.Test);//or Model.Enum.Environment.Live var checkout = new Checkout(client); //Make the call to the service. This example code makes a call to /payments -var paymentsResponse = checkout.Payments(paymentsRequest); +var paymentResponse = checkout.Payments(paymentRequest); ``` ## Documentation