From 921dec4ee00a63dedb9991638778fa8e86a25588 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis Date: Thu, 29 Apr 2021 16:17:49 +0200 Subject: [PATCH 1/4] [PW-4393] Update README.md based on the new template (#428) * Update README.md * Small corrections * Update README.md --- README.md | 110 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 31ea63b71..afc70b8fc 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,48 @@ # 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) -The Adyen API Library for .net framework enables you to work with Adyen APIs, Hosted Payment Pages and Terminal API with any .net application. - -The Library supports all APIs under the following services: -* [x] bin lookup -* [x] checkout -* [x] checkout utility -* [x] payments -* [x] payout -* [x] modifications -* [x] recurring -* [x] notifications -* [x] marketpay account -* [x] marketpay fund -* [x] Terminal API (Local and Cloud based) - -## Requirements -* Adyen API Library supports .net standard 2.0 -* In order for Adyen API Library to support local terminal api certificate validation the application should be set to .net core 2.1 and above or .net framework 4.6.1 and above +This is the officially supported dotnet library for using Adyen's APIs. + +## Integration +The library supports all APIs under the following services: + +* [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview): Our latest integration for accepting online payments. Current supported version: **v67** +* [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v51/overview): Our classic integration for online payments. Current supported version: **v51** +* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v25/overview): Endpoints for managing saved payment details. Current supported version: **v49** +* [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v51/overview): Endpoints for sending funds to your customers. Current supported version: **v51** +* [Adyen BinLookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v50/overview): Endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN. Current supported version: **v50** +* [Utility API](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/post/originKeys): This operation takes the origin domains and returns a JSON object containing the corresponding origin keys for the domains. Current supported version: **v67** +* [Platforms APIs](https://docs.adyen.com/platforms/api): Set of APIs when using Adyen for Platforms. + * [Hosted Onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v1/overview) Current supported version: **v1** + * [Account API](https://docs.adyen.com/api-explorer/#/Account/v5/overview) Current supported version: **v5** + * [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v5/overview) Current supported version: **v5** +* [Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/choose-your-architecture/cloud): Our point-of-sale integration. +* [Local-based Terminal API](https://docs.adyen.com/point-of-sale/choose-your-architecture/local): Our point-of-sale integration. +* [POS Terminal Management API](https://docs.adyen.com/api-explorer/#/postfmapi/v1/overview): Endpoints for managing your point-of-sale payment terminals **v1** + +For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). + + +## Prerequisites + +- [Adyen test account](https://docs.adyen.com/get-started-with-adyen) +- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles). +- Adyen dotnet API Library supports .net standard 2.0 +- In order for Adyen dotnet API Library to support local terminal api certificate validation the application should be set to .net core 2.1 and above or .net framework 4.6.1 and above ## Installation -* Simply download and restore nuget packages - https://www.nuget.org/packages/Adyen/ -* or install it from package manager - PM> Install-Package Adyen -Version 6.1.0 -### Vagrant setup -* Prerequisites -virtualbox and vagrant -* Run the following commands in the root folder to setup vagrant -``` -vagrant up -vagrant ssh -``` -* Run the library tests -``` -cd adyen-dotnet-api-library -dotnet build -dotnet test -``` -## Usage +Simply download and restore nuget packages https://www.nuget.org/packages/Adyen/ +or install it from package manager +~~~~ bash +PM> Install-Package Adyen -Version x.x.x +~~~~ + +## Using the library + +### General use with API key + In order to submit http request to Adyen API you need to initialize the client. The following example makes a checkout payment request: -```csharp +~~~~ csharp // Create a paymentsRequest var amount = new Model.Checkout.Amount("USD", 1000); var paymentRequest = new Model.Checkout.PaymentRequest @@ -58,22 +59,33 @@ var client = new Client("YOUR-XAPI-KEY", Model.Enum.Environment.Test);//or Model var checkout = new Checkout(client); //Make the call to the service. This example code makes a call to /payments var paymentResponse = checkout.Payments(paymentRequest); -``` +~~~~ + +### Example integration + +For a closer look at how our dotnet library works, clone our [ASP .net example integration](https://github.com/adyen-examples/adyen-dotnet-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library. -## Documentation -* https://docs.adyen.com/developers/development-resources/libraries -* https://docs.adyen.com/developers/checkout +### Running the tests +Navigate to adyen-dotnet-api-library folder and run the following commands. +~~~~ bash +dotnet build +dotnet test +~~~~ ## Contributing -We strongly encourage you to join us in contributing to this repository so everyone can benefit from: -* New features and functionality -* Resolved bug fixes and issues -* Any general improvements -Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how. +We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. +Have a look at our [contributing guidelines](https://github.com/Adyen/adyen-dotnet-api-library/blob/develop/CONTRIBUTING.md) to find out how to raise a pull request. ## Support -If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420). +If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-dotnet-api-library/issues/new/choose). + +For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/requests/new?ticket_form_id=360000705420). ## Licence -MIT license. For more information, see the LICENSE file. +This repository is available under the [MIT license](https://github.com/Adyen/adyen-dotnet-api-library/blob/master/LICENSE). + +## See also +* [Example integration](https://github.com/adyen-examples/adyen-dotnet-online-payments) +* [Adyen docs](https://docs.adyen.com/) +* [API Explorer](https://docs.adyen.com/api-explorer/) From 59ab4caecd97a1fe934b428108b790a6ac2a87e3 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis Date: Wed, 5 May 2021 10:08:14 +0200 Subject: [PATCH 2/4] [PW-4606] Add the threeds2 in the action deserializer (#434) * Add the threeds2 in the action deserializer * Remove paymentData from CheckoutBankTransferAction class --- Adyen.Test/CheckoutTest.cs | 43 ++-- .../paymentResponse-3DS-ChallengeShopper.json | 2 +- .../checkout/paymentResponse-3DS2-Action.json | 11 + .../CheckoutBankTransferAction.cs | 27 +-- .../Action/CheckoutThreeDS2ChallengeAction.cs | 191 ------------------ .../CheckoutThreeDS2FingerPrintAction.cs | 191 ------------------ Adyen/Util/PaymentResponseActionConverter.cs | 14 +- 7 files changed, 42 insertions(+), 437 deletions(-) create mode 100644 Adyen.Test/Mocks/checkout/paymentResponse-3DS2-Action.json rename Adyen/Model/Checkout/{ => Action}/CheckoutBankTransferAction.cs (90%) delete mode 100644 Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs delete mode 100644 Adyen/Model/Checkout/Action/CheckoutThreeDS2FingerPrintAction.cs diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index cc8d09532..6a39dbf87 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -477,27 +477,7 @@ public void PaymentRequestAppInfoExternalTest() Assert.AreEqual(paymentRequest.ApplicationInfo.MerchantApplication.Version, "MerchantApplicationVersion"); } - [TestMethod] - public void PaymentsResponseParsingTest() - { - var paymentRequest = CreatePaymentRequestCheckout(); - 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(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 PaymentsOriginTest() { @@ -612,7 +592,7 @@ public void PaypalPaymentSuccessTest() Assert.AreEqual("Ab02b4c0!BQABAgARb1TvUJa4nwS0Z1nOmxoYfD9+z...", result.PaymentData); Assert.AreEqual("paypal", result.PaymentMethodType); } - + [TestMethod] public void ApplePayDetailsDeserializationTest() { @@ -663,7 +643,7 @@ public void PaymentsResponseToJsonTest() var paymentResponse = checkout.Payments(paymentRequest); var paymentResponseToJson = paymentResponse.ToJson(); var jObject = JObject.Parse(paymentResponseToJson); - Assert.AreEqual(jObject["action"]["type"], "threeDS2Challenge"); + Assert.AreEqual(jObject["action"]["type"], "threeDS2"); } [TestMethod] @@ -671,7 +651,7 @@ public void StoredPaymentMethodsTest() { var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentmethods-storedpaymentmethods.json"); var checkout = new Checkout(client); - var paymentMethodsRequest = new PaymentMethodsRequest(merchantAccount:"TestMerchant"); + var paymentMethodsRequest = new PaymentMethodsRequest(merchantAccount: "TestMerchant"); var paymentMethodsResponse = checkout.PaymentMethods(paymentMethodsRequest); Assert.AreEqual(4, paymentMethodsResponse.StoredPaymentMethods.Count); Assert.AreEqual("NL32ABNA0515071439", paymentMethodsResponse.StoredPaymentMethods[0].Iban); @@ -701,5 +681,20 @@ public void FraudResultParsingTest() Assert.AreEqual(0, fraudResults[1].FraudCheckResult.AccountScore); Assert.AreEqual(3, fraudResults[1].FraudCheckResult.CheckId); } + /// + /// Test if the fraud result are properly deseriazed + /// POST /payments + /// + [TestMethod] + public void ThreeDS2Test() + { + var paymentRequest = CreatePaymentRequestCheckout(); + var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/paymentResponse-3DS2-Action.json"); + var checkout = new Checkout(client); + var paymentResponse = checkout.Payments(paymentRequest); + var paymentResponseThreeDs2Action = (CheckoutThreeDS2Action)paymentResponse.Action; + Assert.AreEqual(ResultCodeEnum.IdentifyShopper, paymentResponse.ResultCode); + Assert.AreEqual("threeDS2", paymentResponseThreeDs2Action.Type); + } } } \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json b/Adyen.Test/Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json index 86b11fbde..f12307abe 100644 --- a/Adyen.Test/Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json +++ b/Adyen.Test/Mocks/checkout/paymentResponse-3DS-ChallengeShopper.json @@ -4,7 +4,7 @@ "paymentData": "Te1CMIy1vKQTYsSHZ+gRbFpQy4d4n2HLD3c2b7xKnRNpWzWPuI=", "paymentMethodType": "scheme", "token": "S0zYWQ0MGEwMjU2MjEifQ==", - "type": "threeDS2Challenge" + "type": "threeDS2" }, "authentication": { "threeds2.challengeToken": "S0zYWQ0MGEwMjU2MjEifQ==" }, "details": [ diff --git a/Adyen.Test/Mocks/checkout/paymentResponse-3DS2-Action.json b/Adyen.Test/Mocks/checkout/paymentResponse-3DS2-Action.json new file mode 100644 index 000000000..f51f65d99 --- /dev/null +++ b/Adyen.Test/Mocks/checkout/paymentResponse-3DS2-Action.json @@ -0,0 +1,11 @@ +{ + "resultCode": "IdentifyShopper", + "action": { + "paymentData": "Ab02b4c0!BQABAgBqShefxaKSYhF\/FJ99af+muEP7A0ZXQEoygJaA2mSwmAreKJwDxZ10\/Lhh\/lrGc+c9ilZ5KEk\/eZ\/+wD9S8svnS7HJmy9anMEVZR0NKaQMna2m4iY2AiFEbeC9oTCwvHBFBfmAHIk4WehqByKimDI8BBFLV\/A1XX\/f1m5jGTWVjeBmulSLIBqEL6n+8HinEwkRTDmjGU0lSe2sJo4eazAM5rpEn6WiOYh08CJX1t+QhhVmYWqz5sbaIVTykxRT3HUs6hB0SVsaWNaswvnks64OvzI00P8U\/9rmcXgpdtcxBka6DLmqhhAWwTuCslQH7TzXL40EqW8MgfH2tZ7MBjwev0zKXqLXyBpRuoSHfDNWhjbbWBacd5+q6SAd0IsZ0aSG\/OJQRGeJZbcJy\/qO3Zentc80X3eqiKMdfzRZBgNfa+87SSS9HElS5+u3CZTPRF0dqkF0xmvXKX9pRyGdaZ1aEwOVVGkwexqiqexD1p5E7X89tAeDKT2VQg+2OxC\/ovPt0Gr6N5taq3f6WNmwANCVcFeTmpAahXV2VYCDJiO3qJrW\/aQhAg\/qAW7RIYjW8QffzqYbJ7AgBeP5f9WNOEg3U2FCBuDLM9Fd1cL6KZswlMywrX8GenSoDcDRLS4vquF4N89g\/4KmUEvImPfb4upteITmef15Ygg451kOg8oyWBDPbD6FL0cPe10BpvF4KOToAEp7ImtleSI6IkFGMEFBQTEwM0NBNTM3RUFFRDg3QzI0REQ1MzkwOUI4MEE3OEE5MjNFMzgyM0Q2OERBQ0M5NEI5RkY4MzA1REMifV1TsVOXak8RoK51QaIQhXRnhuh+oWggjJISjMq55jLoy6OI7xLYbnUCgZsp7OcjWnLg3mXV+vddYxDF4M5IKK7FBBPC7pSvAD5e4mLncujHov5+SinViFnM9YXaE4Wzh\/+u9XbdulSqrZRedhGIT8OAnjJa1j8OIv1PUUDVOsa\/BD\/4OX84y0jzio2yyvzRCsUKH6yIEuq6ov95aDTH1MShkb4qegdPFJDfKUgBxX3Ev3RwDMp51YmnHYlTsaqOBpIE2mOQrOXswciZ3hfnAxUCbKLYBWZsARyJ1ZZYY\/H1l8b2s3dwjg0ykHe10dsBjzWsuvV4KdPvlDBHrWcf7FgLNPpAPjRJrrrOwppkRqGa7JxzbSlIywsDWSZEPgrpT230NSr7yVPAyyPyK9sJjKb9oE1354KTbG5nDpfrVKeruk1OfOWJCkD81HkKmdzHVMJyPth3StqTfpH9nFq2L4GoM7TFvCdL0L9RdbFE\/fgX8t88RFThNoDjX3FC8gj4PMur8fdbbRbZ0b\/oHpoK\/iSgzVvZxSHQi+XzFN+M\/XAmS3kTMnFyYgSIkG+4sHMPCPiqRMXlt64ycDy4B+TUYjLxUV7+SnVViUyIOrV\/4pWY\/\/rcvKplG+P\/pAUSIKZZI8rEFABbgQs\/xwZEGbR37hO9GCFurBFqiCzZvTHZrxGeO89hzTpXgWSEhbm4p+jeEI9XjNSvqbZVhPuixO5bR4E\/sO7K\/3PgXFzVZMW80qhCJFkx8jREQ0rIWa25tBZvTHnpExV3EkNxY3iUsS1HDWUna3bI0vNlx8gAsUJXMHAdT2aArFSfpMVkAgziNeVK\/icTMv4G+3jNLYpZCnnSnDDtsGZdKMPHRxAl9zzDU32r4DcAHldcWG4LXFuBkXdx\/M7BFqF95Dxl8H91kSKJb4mkRTU06MEOzaePkFLTQgams6D\/kHupB7DZxjy1s6+J3vRpdhzrMvBQVGroHsF8BkoOw8Qx29opgSKaqe+7EiOvG0f0lG3S4jiVVP916DzgkaaUNdj516UpN6qlQ7ZWw7VzpnV5wu5hJ6IQtNQvOJhegXeX2iTxoGHLloMJzRTZQ6XI390ZYqGng5jniDVPJkFsUqVDVYily7JlFZ7mSX420MWWwl0p+G9Yo9cFjCpn9lmeBQ3eFkuP\/Pe9TSgogN+tb1PgHiTIsyAU5OKoZAKmmABTTlMVLxCzjb0LjcZXzFyVfHabdJp65L9ichsKZti1DsxdQhqU+CihKocwsKqqh+PAUTDKnOX6hCOqGv14W66c4Phu0Tw5w+LRHeA4jTcqcMPnOI2vacfh2LhzOcPEuzog6X2QDCnZKQxoy1eD2VOvR9w+DPI45Xt4E2QjQf1ktbQNzmhKYlf4UTkCPJJf9tSiFHvW9Pf7MrT6lKKAYXUyEeIdlJ7Ipc7Gowyqmc+X1+JZ4iwNp+u6x0GaVl7wbuPSbrR8CCoz1+YNeS4DjOYajabhU\/GNjNgGelUN1l+TdHs2MEYV7iRyIfIos62Hj0AP63Nj2hGAs9I80\/4ff8fwrO91eWz4puMe+LiGcbPR79UxLUXcSmtH0DCBKPT4v\/6bAZATTwz4ZRF7+VJlZcBvqgsRmChbUR3Ep6jZXcG04giMMV1aiRyhKjsrHW0byUt4uVx14mWrn7QcoRueR4X+eGf9Oubc5mEh5ECVfL6YQULWNxyI7z+LhOW6zCWDo2J27BGQH8o0z6p+UXhLX4du03GhgN24V5NKDrHpjLvw83V9obQcQ2vXbkC\/nK+Jh0YrELDWRLsaQqi9ZTmI\/0ioGoMJXSi7Rp2FZU\/MxmBtaKQIKMp0DfvCd614LiEiGtfq93VvHJhfMcxdZpSHHDbaF58bBn5u6QhL3j5hdGl8ic2DceuwShOP7Xz1NksIdbMife6cjL3WeDzvbKSaPf3OW30ThZlTFzmjHPJ+ZZpTYK75Lj5DBiZYlMYLzR3WM9NkcrxFtYnIhMsWqbgxRIx3V\/Iz1k9RLD4QW7CuCb8ZD8oq4xjyqueNAljbVilFFZdMj+\/muS10afbIHNawYZAg1yw4\/X6IHUU5+48vf1znUSOJA1g9VazULjFVJHPREj6SxjIO+gP\/hA4\/QR4x3+IMymC4nYKaE+OBnOaSCT\/ltKTUYX+MK30eUPUt4Wky0m1c8Fed4ALS4OItM+iCJcJ+wGeWcbxQvMOJKD\/qWr+IAD8M7JvtSio0IjJWkSeeR\/ob4GiCoCx+4Ro0KrnHz4BizHNq7T3lwNozipYVamQPl1rrIAzFDnScgnkIEz1kadv5rcZFDlxqBi8\/5S5oKdO1St3EEEur9VVgv4isNpOLZz4vJ8khp46QtA1mvhraJKS6LGszMvbEaOnUgbyFvB8ZZdTdOMd4pQn901\/p3dzLbxUONnRe++tZqRMsq6xWgMWyM+cxM21l1iGsVoGiGBOhBXlHFpaKpx61XuSmQAgAR+kiC6stBdyHjZKi3MQlXFV9\/lD6KDrByLLi9u4o1UB63YzCsADbgRbFH4jdxizH0IolPCPFtNBfjX1KVRgmqrotihpAdWBQkg6I3h7ZL7gcTo8jbPSF9cihNaySkIYzQucFH2uNHHtnTCuiVNRzQYxIg5Sif\/sObueJ2xUuuoKk1LSDlwmdZ5IKZxyjwScel2Te\/Ls3AMtrQqDeOWD+CUocTAobEklZ9HixRKnEvmbLq6z13DbigzA\/pn4EPBGdsQHfIr4JRXCYR6YkRNhxMXJyQqPYFgMfJEnZl1lL\/\/DiNCB4A2HureQLCENgPsyKnS+JmEt8stn1s\/hAUelrEaC+UvKMVT12rzuQT2uCmzGuvE53r4iJOMo5p3ROT8dbDH5K2uC7UfeQHpKD\/FxD5gADwg3FCrDYYm02QTxZKkVwGuB4dGF4Z4\/ZcB\/4ZTtIWCngFVt+Tp1u+qZoeo62\/KZIBs7\/PmKZSnfU0ba3KW8n0+00MPlXnFIUU1ZudsgheKH\/L3x5EtyjXimyHsylwJBKPwpiUyoqZeRz\/wB3KZMQzf8ZV\/CwCnMvHn8K6FLnXvyyMNbp1iG0gRJ3OyN3ilW9Bd9q9lAXM5l7+ZNsSYCybt4dqOsBez7MO4LdVsFMpK+VYzW\/gd+5XCbpKNL+q5istGi\/BpEhcsANBecgNFqCNHsvfAsv+F4yV9VDd++uHICJn+Vhri4ef2ZW\/YOp9GysgobMm7plujmiQnD565uxL5JcPc++5l8hR7NPzef5BO1Zf8rc1S9AGSlntWX3VApc\/WKHyHOyX2NU37C3n1ESHwEFVDYHLf8DlfWp7bJUwyFPVVMZji0lHYrkIJRgblkWs49sxT99AcFDwD\/tllKH8KodnRy4X+8W\/uwGldyKtgE6jQ7OPEvPA8PsllimIBP1z+wXlhjMyJARFZwIfI6P6ZuuEDVoRiK8\/jHKS29ta\/O99UTmQAIsfNKU4WML0boKkBHIRk3foC3zb+RFMQwIHRvqw5EUrvgb39c1Q1e9hX5sZnYX38ZooQlcMo+h4wfMi9tTsDxxgJGEVI4KBsSGm7jkjOObwRV3WzbaLuheARXoyAFTx\/Go24nnqRRS9bCw2o1vydsBgeId3mb0C9j8ld1cllos6PuzM8khM3Th7kmze1NDkHbswZzrJSinuzDqVDCwcOTEZasGeMF9DveBecaVa4+Qd+u+j4BB8iwQyJAI+oYFlZ1ghVqnAIo3ihxCWrLAZuzfz2gV4f91BKKEih1wAubXsYQGJ5XvreMif7lPs4yNiIbQSSoYh4pert9YqTVVzmu6BLOkBL4t2aasuhYVJNVPqKlnkOnFVpj48ucOEjfNSTl5vnnRUQnd9EXkdR3wNkGjIq5iFcophNTASvrguBTqE4Sc+mvbs83Yeyb2yWu53IdLPSRUIV3iY7BJzBPx29Gr\/zT6jQ6xkhFcl0wC73Z3brtzmK+0KpAX+1wtz7rrjBVnuqlfxAmHKFMeXiXzpU1RIfdJdXG0gH\/YC2Ck7sKkpqoNl9s2bGxhq15FXouOn1PO3ul9BZTZGEZVEEsUhkhzmrHZaPrt29n1yYdvm2jmVKip+QVPyz5H3WhHxkzts4i\/Rn6ts12rv8Z+9J2Kz2TQdHuq80+LeOQ5pSv5dkEiOyR8lGIRFZJcemVOdMdHdaGJkMOIiiEEVjAyKvNjNNjCCAb+z8oV185ug9XRRNnTKlO6Ha9r46UsI8bq6AQBX2ZQ6n7qQxcXLXwzT5xINfDLPwH5WfM68rQzra\/qLXc6KkyzcygcYB0iKs0ykg\/Dzpap93WcJ4GVNTsyySo34LD7OXDKuiIJWPgbZ3T66s1Fvgju3SYUrB1zD6W9caDfySF2aruHF63xsi78JiS7FdVN1V7Ba+sKM0sqwnVocBMbZLZSH6\/IVuMDqaJWT5xI6xu6hMwWngJvpjHvLXmuSMn9\/CQD1Ly0+wGUGlFcWd40eCsjqMIq5UD4ks8wfTPj\/Fyz\/mWfn1pgbXWWuCzqeeT5T+ukvtOFGSPzB5zK8YichvOOHiEgg7eLgITgl8cxVBjNjZPUwnfGe0R6M\/pChrj9S4c91KaFRDy3YcHC\/M0LJY594bfF4u3+ru7FjUpTfyUBgbToFajMD4h8V0gC35TYjDGgmZqECP1VoYrkRHhByf6ARKhdvHVDWs6fYbCijL4iZb1kSOnIMF+3CTf45DdA+sjvIXveIF7w3do4gq8nV\/S6v0R9iBxieG6jYALyHSEqbu8zTC2ciMcqSqoJYntHg\/gou\/bj9SPDl4VKIZZohv\/JyRBfET+fHunV1gZnB5LHD6BlenWCSgDE+jehBDxOuHgekcRDVjZ5tKtklaBkE8v\/nKTljvGF71QyxmSm5ak0DwPwCIMeYVUpa5PL5TsmaXcekMpgkzgD4ZVyvFLOQJi6C0ndhcY8VHUP33G5f2s5BCVAMjvpdCX25hHa536WkRnTI2OkSPezK2fXXVoLdIL1S9p6pWOhDNOWIJ0Ie9lSaKFbMX1plLDmM9D8OWvFsYEXDjAdgiMJl\/vfOS6cm+z5qShddfghK6BVOVlJGdUlJ2D6c\/XfCcKFifv7bTYlWc\/6DttmHtxL7cD67El9O7iE58g\/SuLRJNJMltl4ZlR\/\/Uxha3\/80lfOFa3v0Xv6hz3OtkyiQ7Fa7egz85KyMVZiwqjKwHXkQmWa4SaVBMnlPWc6Rlo5t0umIS4t+vRYqxydprr7ySO7SUndgmWlPobRZkBGcLLkzkcvcEtMdMJA6RTataarULqhYfX5FE5kodULDnQ21MLSrH9F\/jNsCo3hK6mmfJBRQO+2gQA78VPVPSbh8XBGr60WDoThgFTJM5N+uY2pH\/BPxOB6bv0uIml4oBnqzwdzi7yAzNDFHNeZTaORHAL+1jEgkE\/WGDeQ8DIE111u9gtDVbhss7AVzG3DvQrBSXYTZwQbUsXFG7ZD6sQ0oT7vQURJDHp+CuU2a11CtDsXzJILTDPemnCmDVv\/CAfWYdVutlpwUiK6DoPjM7RLnmf6+NrwCiBajs00JGuSk5pCsncZJhMpug1FMV89BI2F56R1Naj8yvdHM8GcwOI04PIOHJ60v7FpuyNCzQWrOuNSg+GTw5F7Ys7n+qLeUdxueZY6ukRQVRzJXy9hr2tHAPUyxBZ5o6s4NgzlybR6mLxO13SujSEkv9RiJSC38dSmiEANZ32o7XOtxEDS6dXLRFQsCeQRsQXDjA1qiO2M0evP\/WeaUZWgvHIE0sbyOCI8hbxTdYaQE9Bbf\/o6b3JJz1gQPdhyTqKX7gy9YhD99MAvI6voujnzsu3+V1KWEf6gf8VRfOlCza1KTnRqgQ6KeGmvpdtV\/HMRFJqPZ8RE9eoA7ii9EKbqzazWd+nIkY8oCgFU1Jz3n1oz0S+HK+9+g+RUHDQ6PkIB8m+KCPQ0vz5Xvm+mIxt8x0DC0+YXXuPXc9fCRGfPF29sEFovHh3jMu8eZbfN0XOOgrIp7SxsZevYoV51rzch8syAebvgbFIDFyielFdzRw2VJlauJtyeOpl41yCAXNNJTTdfqyiAcSN6y7AgJ+7jwRda6FxjVhaQIvC5\/id0KPVh\/HBHhrk1t4mCVT6MvNymbfFSrAWLtAI0kNQJCu5nFe\/Joww\/o3rt7OiNv45Z8hVYfDIEg2IVvw8UD1izE4\/AuB+5p3QoIZ+9SrtkurJv6Z79w9MnMEouXRF+bD4l4Ey7nbxVf+Hqd\/w4QJLXmRx\/vJ6GWLQ5oBCwruTolONlRyHRlDfUdDzVG6l9od\/mDo9lVB1MUxRADDKLSaDcDkUy5MUuTmxzn4BlMBN9Ce+F1uVVgHv5YO47aUZtmynRXCze++38oxp\/1dz\/pMerVW5i6ElmX\/iFDXlXWvjCxgHTcxiv\/LB8l04FGoHHQqQQW5HuoSuqr41oHrkdBmU1pZUB7st+ZKPYNgyH9AdYo3hRVAvd\/vaZr1gdmwZDrzoWCwz9BICjtgdHksLjTZIImr+aO\/tXKb2Jq330Ri0RUEUREAbRUsUDiLMN8lEDzjQ4GW9y4f5Kxi1ahYI83M62YMBh9DiSlV2nr1\/fxx1VGJLzSB37fKXs4v40Nfcxnn6Bv+Mk7WwTP36+YP2Om16XUkDnwl0\/1nezKGhbXMP9wNeSWllplu4PHn0IdMCx8TG+6+iLl5Ym8G3s9ub4ShYYf\/TRdMVE1DBsndJeVwp8ixxDdAyXWvaYZZzjXgnz+vJFJ7GFTK4wku9uQEn8XSjIpklEMacQDxedgryHRxrbkszil6SaAGVYqhzw6RqEPnJbKLK+rHAh3SwkhCz6xtSkt1kYHx65U9huA7Q6fyG5SrSDpNhlhlQSa2PnKWG5z2e7gTAVm1bIbU63NvlkFWAmkQQzZxf1dzWfBj2\/E8YrLludgxMu27svgcogbvMrkKKQrQeHF8t0kYb\/yA3DFxE=", + "paymentMethodType": "scheme", + "authorisationToken": "BQABAQAtoCgu4f1F43TousQB6ayVPRw+IcQG535CB2TBnNvMbcYvrfqlog2ZyEomJqjNyn+3R\/hTLmCWVS3C09cok4bVbXdldMgWsXa1nT4GryjlL82chhVJyOSTOxOtCWvot25VMYmKQ2VvgzwB4S5p3UM4jK4HyAloRSdr+t\/Y25E72kcR2Hx3gY6uWkBivNrEfpfcWRAX1rBGX4Unpbp8QfCIunLeVouT76jYV\/XblktC59Jn8X4lZjsJ2\/y74D+vsdAvHHlPzjSJslkjD2oH1N2ej+S1Y\/ka62USC+aAr\/0spFsBnxoRQxZEgRxRoyy5+eriwAhXpsBRvAHr2T1UE\/IbEJmbx151OCqE7iNrMzosRXsAABEKVQBDzMHIjn3IIzeIvW2yHaOR3k1sFm4e2jUAOHTA5aoWqI+cAbk5xvrWWB09OiAjSClDVF0VThMBSD+ux7G30HJtrJ9jSZYFgbV85I1MPrY7le+k2vyqbRo5o96syIuJPMeYaYdhoM6zUt2UYUOPE4fbLAB0Tt4i2jf0NFx4pZQ\/WC8RiesQnwhJCWoOFcj\/PmU7Xim6xyB5cFrzRIeutYJS\/A8ChobdVpoqtt16R5voELy7KDH0V1R+PbQSAplgogBlvmC+q+tJUIuJ8UKdqFgi2oTzk7FM2xk\/a964DvC9+6vTDuET2TJyX67mLQaB\/+ProyK\/rRC\/7DoK9s4auUqkaw6C\/nfKyhk3buXg+hMBppPZ0L9w8Jfl4Ei+pj1Z0ZZhN7ZrKFKfXPW4Vv3BUmGnZuughjKdnSaFjIGzYKWHBWji97xNptxBfVDLOACD4h+hu1KAcZriirrXN94dYC9Zf8S1L5ORRWLAv566Y\/Qvfban2EeuF4nvz7HYAbXr+EBb1KRTAWHUSkkvQ4tFwCewUTyV2KRtoNm\/fkDnUAR2CfT7cKDwJ+H9P9aBgfE4zDQGcWtWotQc3BjgU9+ARGMBwHQ+Acbdo\/8pvBkgQyRDmDDn8If\/iTZxNtzkdI\/KRYeYqXDWN6YkG0HULi79HNvUPYuDGt6x1NEKaN2AiVA0iYGvR2dIfUO+4oUakeDmJSsr6FnMac12ywIOHET5SIjWQkwWh4yGD8eX9lVLG3p3BB2PMMYKiIvPNHjoNGIAuk0tPL41prtYSiKiSUjk8fQdRd\/XTBAMNySJfA5vQ4t9s1qMNPu8WsfuEZhuinMrFEvTRZh7oipyS6yRs8rCktmDpb8EuiY5yw5K5pZma7eqZe7kzO3gfhVV4lwqtBCIrtZjqrbB9UDw9+eUrseeOSs3Gqte5Ev0SgJVXJUsPI7BQ2wk14bT7ROKfDwRs0ylaR+jASOES7YKteHsm7dv3\/2Vk3iRYCbrrQmwkg8J3x3BdA0g3rRDWHaBoUsSOwdz2GVj\/3OUQlYSOQacszpTbxeEq9kEgd6qeTaV87zocRhAO5d62Cgs63TlPtWL9RmJoJgwexkh\/mXUtu9QzLCxHnT31KG1P2ibr07il8xbhW9yZTxHL8tDEb5KMPZ\/WjB\/hGv92ovCgVFT0Mu8vAH+NFIAMZ5rHGeguECPIa7xJd7pYHbQIfM2NwUefnkagnUQKTt5pZhcj34dlCHRhn7XyqQCFuesMSUg4ZoHOJR5t0TS32YU3UteDaydpYrlIUQ5nxE60yoxpc3FZEq3dK7nspCw4Ai6tgQEtcV3Qx4ySmLFitHQc9dhaSJMuG5aqumbDScaoLWerl4VfaatKH9zZU\/U0VUiis0nYrO6geRvV61W0ihSYci5VhQCn1ZPCcBknzrnxKogq7tkNQH+z9VobcCVWb3QIxa0K642CrPM5qPVKXIQXNsSwKTukrTOcksf8MxFhOziYITM\/UWtP\/kqU57pnM73fwD9Z0O\/oohOpfIpAXpm2U\/Z0k3A8ci2EKg\/9TD22+bPkx9Z2ZItf1OKBr4yWETO8SYWT+suacf6etVKp8xl28twoEDm2lyyZ2Z2dfic82vu4e5rXpmIs8M4Q6TX6nN9wJK14qhQoTD3ltvTu5SUY7GVWjdy41CZ0V6hzKvXigQ5swYeXJtWX3oR5i0CthjjG3688ut6u0z9jZ7eOktwXiu6CQiqqgvOURcCazHReJXQ0006sr19Rj8va5LDeespixLIfN3EQ+IhL6fyjlc9I3E4N7S0PN50+p12et5kcndybA067Hq1hkLP4huqfQCbSJDtvurjLwm\/FFGnCurscp4EjwBHcYEpf9Ju8QBWEwyQLkQEdAAMqQRqX6FFdokomj+OxDOp8o8JAszCeyeAiOMAikiouYKT3WmFSdFe7exKnog6frEP38Wetz66iFugL002fC3on2stHou1lbtiqQod3PJCDT\/1TYMa339\/Hfmkm3leKUbXCIY4jomp4KtA7ZoY7ppaKLQi6ZZb15g7dnVivsypv09+nG9MlkG7v1FbuY+cCXurjhZWs7BalwNzSTaQuz\/pRtg3HzGF9ieYhPfB7HUiWPN70sV99fjFx13nGZqMpuK6I88D6ffpGIyT9Frp4h2r5qy1XBj+\/RUyjcY8vhSKfetTm1HPZUKu1k2aTfm9R7BudHYUMCrBMKAXDMNODloZLkAvUY\/lVr5JLsMhAjXdOtv2JGRdKajWn0s8U8fszuzzNo9veKSF7f\/peQ295BnmTYoYj5gy1NwLNGcsON3nYlnh04kmGEAmXkcHKCCPpL4TtPYyH689kqA8un1awsGg9D6Fas92+meqM8vtAco=", + "subtype": "fingerprint", + "token": "eyJ0aHJlZURTTWVzc2FnZVZlcnNpb24iOiIyLjEuMCIsInRocmVlRFNNZXRob2ROb3RpZmljYXRpb25VUkwiOiJodHRwczpcL1wvY2hlY2tvdXRzaG9wcGVyLXRlc3QuYWR5ZW4uY29tXC9jaGVja291dHNob3BwZXJcL3RocmVlRFNNZXRob2ROb3RpZmljYXRpb24uc2h0bWw\/b3JpZ2luS2V5PXB1Yi52Mi44MTE1NjIwNTc5NDc0OTQyLmFIUjBjSE02THk5c2IyTmhiQzEzZDNjdWQyRjBZMmhtYVc1a1pYSXVabkkuX1FIZGFQUmEzYmRVR2V3ZmZDdjlJOFNRaDAwbV9oeldzQmlnejJwQTNTRSIsInRocmVlRFNNZXRob2RVcmwiOiJodHRwczpcL1wvcGFsLXRlc3QuYWR5ZW4uY29tXC90aHJlZWRzMnNpbXVsYXRvclwvYWNzXC9zdGFydE1ldGhvZC5zaHRtbCIsInRocmVlRFNTZXJ2ZXJUcmFuc0lEIjoiYjlhMWFkYTQtOTJmZi00MmZlLTkzYWQtNThiMzQwOTcyNzUzIn0=", + "type": "threeDS2" + } +} \ No newline at end of file diff --git a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs b/Adyen/Model/Checkout/Action/CheckoutBankTransferAction.cs similarity index 90% rename from Adyen/Model/Checkout/CheckoutBankTransferAction.cs rename to Adyen/Model/Checkout/Action/CheckoutBankTransferAction.cs index 93af41599..7c9f689e3 100644 --- a/Adyen/Model/Checkout/CheckoutBankTransferAction.cs +++ b/Adyen/Model/Checkout/Action/CheckoutBankTransferAction.cs @@ -29,13 +29,13 @@ using System.Text; using Newtonsoft.Json; -namespace Adyen.Model.Checkout +namespace Adyen.Model.Checkout.Action { /// /// CheckoutBankTransferAction /// [DataContract] - public partial class CheckoutBankTransferAction : IEquatable, IValidatableObject + public partial class CheckoutBankTransferAction : IEquatable, IValidatableObject, IPaymentResponseAction { /// /// Initializes a new instance of the class. @@ -44,7 +44,6 @@ public partial class CheckoutBankTransferAction : IEquatableThe 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.. @@ -52,7 +51,7 @@ public partial class CheckoutBankTransferAction : IEquatableThe 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 downloadUrl = default(string), string iban = 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)) @@ -61,7 +60,6 @@ public partial class CheckoutBankTransferAction : IEquatableThe 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. /// @@ -158,7 +149,6 @@ public override string ToString() 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"); @@ -218,12 +208,7 @@ public bool Equals(CheckoutBankTransferAction input) 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 && @@ -273,8 +258,6 @@ public override int GetHashCode() 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) diff --git a/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs b/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs deleted file mode 100644 index c58c902a0..000000000 --- a/Adyen/Model/Checkout/Action/CheckoutThreeDS2ChallengeAction.cs +++ /dev/null @@ -1,191 +0,0 @@ -#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 deleted file mode 100644 index 0281ac346..000000000 --- a/Adyen/Model/Checkout/Action/CheckoutThreeDS2FingerPrintAction.cs +++ /dev/null @@ -1,191 +0,0 @@ -#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/Util/PaymentResponseActionConverter.cs b/Adyen/Util/PaymentResponseActionConverter.cs index 4d069b2d3..e9dfe398e 100644 --- a/Adyen/Util/PaymentResponseActionConverter.cs +++ b/Adyen/Util/PaymentResponseActionConverter.cs @@ -47,9 +47,12 @@ public override object ReadJson(JsonReader reader, var paymentResponseAction = default(IPaymentResponseAction); switch (jsonObject["type"].ToString()) { - case "donation": + case "donate": paymentResponseAction = new CheckoutDonationAction(); break; + case "bankTransfer": + paymentResponseAction = new CheckoutBankTransferAction(); + break; case "qrCode": paymentResponseAction = new CheckoutQrCodeAction(); break; @@ -57,15 +60,10 @@ public override object ReadJson(JsonReader reader, paymentResponseAction = new CheckoutRedirectAction(); break; case "sdk": + case "wechatpaySDK": paymentResponseAction = new CheckoutSDKAction(); break; - case "threeDS2Challenge": - paymentResponseAction = new CheckoutThreeDS2ChallengeAction(); - break; - case "threeDS2Fingerprint": - paymentResponseAction = new CheckoutThreeDS2FingerPrintAction(); - break; - case "threeDS2Action": + case "threeDS2": paymentResponseAction = new CheckoutThreeDS2Action(); break; case "await": From 61d29abd441b8eb90c4f8ecbdc47eaf6dcd6dedc Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis Date: Wed, 5 May 2021 18:08:59 +0200 Subject: [PATCH 3/4] [PW-4449] Market pay notification handler (#433) * Add the marketpay notification models * Add the deserializer and the notification handler * Add notification handler unit tests * Remove java library headers from test files * Fix alerts * Resolve suggestions * Delete payout-confirmed-test.json --- Adyen.Test/BaseTest.cs | 13 + .../{ => MarketPayTests}/MarketPayFundTest.cs | 2 +- .../MarketPayNotificationTest.cs | 317 ++++++++++++++++++ .../MarketpayAccountTest.cs | 2 +- .../notification/account-closed-test.json | 27 ++ .../notification/account-created-success.json | 37 ++ .../account-funds-below-thresold-test.json | 18 + .../account-holder-created-success.json | 183 ++++++++++ .../account-holder-payout-fail.json | 73 ++++ .../account-holder-status-change.json | 40 +++ ...count-holder-store-status-change-test.json | 15 + ...account-holder-upcoming-deadline-test.json | 12 + .../notification/account-holder-updated.json | 181 ++++++++++ .../account-holder-verification.json | 26 ++ .../notification/account-updated-test.json | 35 ++ .../notification/beneficiary-setup.json | 16 + .../compensate-negative-balance-test.json | 23 ++ ...te-notification-configuration-success.json | 22 ++ ...e-notification-configurations-success.json | 5 + .../direct-debit-initiated-test.json | 18 + ...tification-configuration-list-success.json | 46 +++ ...et-notification-configuration-success.json | 22 ++ .../notification/payment-failure-test.json | 25 ++ .../refund-funds-transfer-test.json | 37 ++ .../notification/report-available-test.json | 14 + .../notification/scheduled-refunds-test.json | 70 ++++ ...st-notification-configuration-success.json | 30 ++ .../notification/transfer-funds-test.json | 35 ++ ...te-notification-configuration-success.json | 28 ++ Adyen/Adyen.csproj | 2 +- Adyen/Model/MarketPay/AccountPayoutState.cs | 12 +- Adyen/Model/MarketPay/KYCCheckStatusData.cs | 32 +- .../Notification/AccountCloseNotification.cs | 121 +++++++ .../Notification/AccountCreateNotification.cs | 121 +++++++ .../AccountFundsBelowThresholdNotification.cs | 121 +++++++ ...tFundsBelowThresholdNotificationContent.cs | 102 ++++++ .../AccountHolderCreateNotification.cs | 121 +++++++ .../AccountHolderPayoutNotification.cs | 121 +++++++ .../AccountHolderPayoutNotificationContent.cs | 202 +++++++++++ .../AccountHolderStatusChangeNotification.cs | 121 +++++++ ...ntHolderStatusChangeNotificationContent.cs | 104 ++++++ ...ountHolderStoreStatusChangeNotification.cs | 121 +++++++ ...derStoreStatusChangeNotificationContent.cs | 124 +++++++ ...countHolderUpcomingDeadlineNotification.cs | 121 +++++++ ...lderUpcomingDeadlineNotificationContent.cs | 96 ++++++ .../AccountHolderUpdateNotification.cs | 121 +++++++ .../AccountHolderVerificationNotification.cs | 121 +++++++ ...ntHolderVerificationNotificationContent.cs | 94 ++++++ .../Notification/AccountUpdateNotification.cs | 121 +++++++ .../BeneficiarySetupNotification.cs | 121 +++++++ .../BeneficiarySetupNotificationContent.cs | 125 +++++++ .../CompensateNegativeBalanceNotification.cs | 121 +++++++ ...nsateNegativeBalanceNotificationContent.cs | 70 ++++ ...ensateNegativeBalanceNotificationRecord.cs | 86 +++++ .../DirectDebitInitiatedNotification.cs | 121 +++++++ ...DirectDebitInitiatedNotificationContent.cs | 122 +++++++ .../Notification/ErrorFieldTypeContainer.cs | 39 +++ .../Notification/IGenericNotification.cs | 30 ++ .../Model/MarketPay/Notification/LocalDate.cs | 75 +++++ Adyen/Model/MarketPay/Notification/Message.cs | 77 +++++ .../NotificationErrorContainer.cs | 77 +++++ .../MarketPay/Notification/OperationStatus.cs | 76 +++++ .../PaymentFailureNotification.cs | 121 +++++++ .../PaymentFailureNotificationContent.cs | 114 +++++++ .../RefundFundsTransferNotification.cs | 121 +++++++ .../RefundFundsTransferNotificationContent.cs | 104 ++++++ .../MarketPay/Notification/RefundResult.cs | 85 +++++ .../Notification/RefundResultContainer.cs | 39 +++ .../ReportAvailableNotification.cs | 121 +++++++ .../ReportAvailableNotificationContent.cs | 105 ++++++ .../ScheduledRefundsNotification.cs | 121 +++++++ .../ScheduledRefundsNotificationContent.cs | 105 ++++++ .../Notification/TransferFundsNotification.cs | 121 +++++++ .../TransferFundsNotificationContent.cs | 122 +++++++ Adyen/Notification/NotificationHandler.cs | 6 + Adyen/Util/JsonOperation.cs | 2 + Adyen/Util/MarketPayNotificationConverter.cs | 115 +++++++ 77 files changed, 5985 insertions(+), 28 deletions(-) rename Adyen.Test/{ => MarketPayTests}/MarketPayFundTest.cs (99%) create mode 100644 Adyen.Test/MarketPayTests/MarketPayNotificationTest.cs rename Adyen.Test/{ => MarketPayTests}/MarketpayAccountTest.cs (99%) create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-closed-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-created-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-funds-below-thresold-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-created-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-payout-fail.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-status-change.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-store-status-change-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-upcoming-deadline-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-updated.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-holder-verification.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/account-updated-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/beneficiary-setup.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/compensate-negative-balance-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/create-notification-configuration-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/delete-notification-configurations-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/direct-debit-initiated-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-list-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/payment-failure-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/refund-funds-transfer-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/report-available-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/scheduled-refunds-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/test-notification-configuration-success.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/transfer-funds-test.json create mode 100644 Adyen.Test/Mocks/marketpay/notification/update-notification-configuration-success.json create mode 100644 Adyen/Model/MarketPay/Notification/AccountCloseNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountCreateNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderCreateNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderUpdateNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/AccountUpdateNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/BeneficiarySetupNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/BeneficiarySetupNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationRecord.cs create mode 100644 Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/ErrorFieldTypeContainer.cs create mode 100644 Adyen/Model/MarketPay/Notification/IGenericNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/LocalDate.cs create mode 100644 Adyen/Model/MarketPay/Notification/Message.cs create mode 100644 Adyen/Model/MarketPay/Notification/NotificationErrorContainer.cs create mode 100644 Adyen/Model/MarketPay/Notification/OperationStatus.cs create mode 100644 Adyen/Model/MarketPay/Notification/PaymentFailureNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/PaymentFailureNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/RefundFundsTransferNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/RefundFundsTransferNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/RefundResult.cs create mode 100644 Adyen/Model/MarketPay/Notification/RefundResultContainer.cs create mode 100644 Adyen/Model/MarketPay/Notification/ReportAvailableNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/ReportAvailableNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/ScheduledRefundsNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/ScheduledRefundsNotificationContent.cs create mode 100644 Adyen/Model/MarketPay/Notification/TransferFundsNotification.cs create mode 100644 Adyen/Model/MarketPay/Notification/TransferFundsNotificationContent.cs create mode 100644 Adyen/Util/MarketPayNotificationConverter.cs diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/BaseTest.cs index f2817ec8f..f9f801c17 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/BaseTest.cs @@ -453,6 +453,7 @@ protected Client CreateMockTestClientForErrors(int status, string fileName) }; return clientMock; } + protected string MockFileToString(string fileName) { @@ -477,6 +478,18 @@ protected string MockFileToString(string fileName) return text; } + /// + /// Helper for file reading + /// + /// + /// + public string GetFileContents(string fileName) + { + string mockPath = GetMockFilePath(fileName); + return MockFileToString(mockPath); + } + + /// /// Create dummy Nexo message header /// diff --git a/Adyen.Test/MarketPayFundTest.cs b/Adyen.Test/MarketPayTests/MarketPayFundTest.cs similarity index 99% rename from Adyen.Test/MarketPayFundTest.cs rename to Adyen.Test/MarketPayTests/MarketPayFundTest.cs index ac707d5be..a5df5d25d 100644 --- a/Adyen.Test/MarketPayFundTest.cs +++ b/Adyen.Test/MarketPayTests/MarketPayFundTest.cs @@ -26,7 +26,7 @@ using Adyen.Service; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Adyen.Test +namespace Adyen.Test.MarketPayTest { [TestClass] public class MarketPayFundTest : BaseTest diff --git a/Adyen.Test/MarketPayTests/MarketPayNotificationTest.cs b/Adyen.Test/MarketPayTests/MarketPayNotificationTest.cs new file mode 100644 index 000000000..7c197b381 --- /dev/null +++ b/Adyen.Test/MarketPayTests/MarketPayNotificationTest.cs @@ -0,0 +1,317 @@ +#region License +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Dotnet API Library + * + * Copyright (c) 2021 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +#endregion +using Adyen.Model.MarketPay; +using Adyen.Model.MarketPay.Notification; +using Adyen.Notification; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Adyen.Test.MarketPayTest +{ + [TestClass] + public class MarketPayNotificationTest : BaseTest + { + [TestMethod] + public void MarketPayAccountClosedNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-closed-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountCloseNotification accountCloseNotification = (AccountCloseNotification)notificationMessage; + Assert.AreEqual(accountCloseNotification.EventType, "ACCOUNT_CLOSED"); + Assert.AreEqual(accountCloseNotification.PspReference, "TSTPSPR0001"); + Assert.AreEqual(accountCloseNotification.Content.ResultCode, "Success"); + } + + [TestMethod] + public void MarketPayAccountCreatedNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-created-success.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountCreateNotification accountCreateNotificationMessage = (AccountCreateNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_CREATED", accountCreateNotificationMessage.EventType); + Assert.AreEqual("000", accountCreateNotificationMessage.Error.ErrorCode); + Assert.AreEqual("test error message", accountCreateNotificationMessage.Error.Message); + Assert.IsNotNull(accountCreateNotificationMessage.Content); + + CreateAccountResponse content = accountCreateNotificationMessage.Content; + Assert.AreEqual("TestAccountHolder", content.AccountHolderCode); + Assert.AreEqual("AC0000000001", content.AccountCode); + Assert.AreEqual("account description", content.Description); + Assert.AreEqual("MetaValue", content.Metadata["MetaKey"]); + Assert.AreEqual(CreateAccountResponse.StatusEnum.Active, content.Status); + + PayoutScheduleResponse payoutSchedule = content.PayoutSchedule; + Assert.AreEqual(PayoutScheduleResponse.ScheduleEnum.DAILY, payoutSchedule.Schedule); + Assert.AreEqual(1, content.InvalidFields.Count); + + ErrorFieldType errorFieldType = content.InvalidFields[0]; + Assert.AreEqual(1, (long)errorFieldType.ErrorCode); + Assert.AreEqual("Field is missing", errorFieldType.ErrorDescription); + Assert.AreEqual("AccountHolderDetails.BusinessDetails.Shareholders.unknown", errorFieldType.FieldType.Field); + Assert.AreEqual(FieldType.FieldNameEnum.Unknown, errorFieldType.FieldType.FieldName); + Assert.AreEqual("SH00001", errorFieldType.FieldType.ShareholderCode); + } + + [TestMethod] + public void MarketPayAccountHolderCreatedNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-created-success.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderCreateNotification accountHolderCreateNotificationMessage = (AccountHolderCreateNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_HOLDER_CREATED", accountHolderCreateNotificationMessage.EventType); + Assert.IsNotNull(accountHolderCreateNotificationMessage.Content); + Assert.AreEqual("AHC00000001", accountHolderCreateNotificationMessage.Content.AccountHolderCode); + Assert.AreEqual("TSTPSPR0001", accountHolderCreateNotificationMessage.Content.PspReference); + Assert.AreEqual("executing-user-key", accountHolderCreateNotificationMessage.ExecutingUserKey); + } + + [TestMethod] + public void MarketPayAccountHolderVerificationNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-verification.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderVerificationNotification notification = (AccountHolderVerificationNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_HOLDER_VERIFICATION", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("AH0000001", notification.Content.AccountHolderCode); + } + + [TestMethod] + public void MarketPayAccountHolderStatusChangeNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-status-change.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderStatusChangeNotification notification = (AccountHolderStatusChangeNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_HOLDER_STATUS_CHANGE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("ah689", notification.Content.AccountHolderCode); + Assert.IsNull(notification.Content.OldStatus.ProcessingState.ProcessedTo); + Assert.AreEqual("GBP", notification.Content.NewStatus.ProcessingState.ProcessedTo.Currency); + } + + [TestMethod] + public void MarketPayAccountHolderPayoutFailNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-payout-fail.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderPayoutNotification notification = (AccountHolderPayoutNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_HOLDER_PAYOUT", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("AC00000001", notification.Content.AccountCode); + Assert.AreEqual(1, notification.Content.Amounts.Count); + Assert.AreEqual(10L, notification.Content.Amounts[0].Value); + Assert.AreEqual("10_069", notification.Content.Status.Message.Code); + } + + [TestMethod] + public void MarketPayAccountHolderUpdatedNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-updated.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderUpdateNotification notification = (AccountHolderUpdateNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_HOLDER_UPDATED", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("accountHolderCode", notification.Content.AccountHolderCode); + Assert.AreEqual(AccountHolderStatus.StatusEnum.Active, notification.Content.AccountHolderStatus.Status); + Assert.AreEqual(KYCCheckStatusData.TypeEnum.COMPANYVERIFICATION, notification.Content.Verification.AccountHolder.Checks[0].Type); + Assert.AreEqual(KYCCheckStatusData.StatusEnum.DATAPROVIDED, notification.Content.Verification.AccountHolder.Checks[0].Status); + } + + [TestMethod] + public void MarketPayBeneficiarySetupNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/beneficiary-setup.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + BeneficiarySetupNotification notification = (BeneficiarySetupNotification)notificationMessage; + Assert.AreEqual("BENEFICIARY_SETUP", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("136058999", notification.Content.SourceAccountCode); + Assert.AreEqual("117001608", notification.Content.DestinationAccountCode); + } + + [TestMethod] + public void MarketPayScheduledRefundsNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/scheduled-refunds-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + ScheduledRefundsNotification notification = (ScheduledRefundsNotification)notificationMessage; + Assert.AreEqual("SCHEDULED_REFUNDS", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("1234567890", notification.Content.AccountCode); + Assert.AreEqual(5000L, notification.Content.LastPayout.Amount.Value); + Assert.AreEqual(Transaction.TransactionStatusEnum.PendingCredit, notification.Content.RefundResults[0].RefundResult.OriginalTransaction.TransactionStatus); + } + + [TestMethod] + public void MarketPayCompensateNegativeBalanceNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/compensate-negative-balance-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + CompensateNegativeBalanceNotification notification = (CompensateNegativeBalanceNotification)notificationMessage; + Assert.AreEqual("COMPENSATE_NEGATIVE_BALANCE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("AC000001", notification.Content.Records[0].AccountCode); + Assert.AreEqual(10L, notification.Content.Records[0].Amount.Value); + } + + [TestMethod] + public void MarketPayPaymentFailureNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/payment-failure-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + PaymentFailureNotification notification = (PaymentFailureNotification)notificationMessage; + Assert.AreEqual("PAYMENT_FAILURE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual(1L, notification.Content.ErrorFields[0].ErrorFieldType.ErrorCode.Value); + Assert.AreEqual("10_062", notification.Content.ErrorMessage.Code); + } + + [TestMethod] + public void MarketPayReportAvailableNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/report-available-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + ReportAvailableNotification notification = (ReportAvailableNotification)notificationMessage; + Assert.AreEqual("REPORT_AVAILABLE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.IsNotNull(notification.Content.RemoteAccessUrl); + } + + [TestMethod] + public void MarketPayTransferFundsNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/transfer-funds-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + TransferFundsNotification notification = (TransferFundsNotification)notificationMessage; + Assert.AreEqual("TRANSFER_FUNDS", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual(1000L, notification.Content.Amount.Value); + Assert.AreEqual("testTransferCode", notification.Content.TransferCode); + Assert.IsNotNull(notification.Error); + Assert.AreEqual("000", notification.Error.ErrorCode); + Assert.AreEqual("test error message", notification.Error.Message); + + Assert.IsNotNull(notification.Content.InvalidFields); + Assert.AreEqual(1, notification.Content.InvalidFields.Count); + } + + [TestMethod] + public void MarketPayAccountUpdatedNotificationTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-updated-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountUpdateNotification notification = (AccountUpdateNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_UPDATED", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual(1, notification.Content.InvalidFields.Count); + } + + [TestMethod] + public void MarketPayAccountFundsBelowThresholdTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-funds-below-thresold-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountFundsBelowThresholdNotification notification = (AccountFundsBelowThresholdNotification)notificationMessage; + Assert.AreEqual("ACCOUNT_FUNDS_BELOW_THRESHOLD", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("TestAccountHolder", notification.Content.AccountCode); + Assert.AreEqual(100L, notification.Content.FundThreshold.Value); + Assert.AreEqual(96, notification.Content.CurrentFunds.Value); + } + + [TestMethod] + public void MarketPayAccountHolderStoreStatusChangeTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-store-status-change-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderStoreStatusChangeNotification notification = (AccountHolderStoreStatusChangeNotification)notificationMessage; + + Assert.AreEqual("ACCOUNT_HOLDER_STORE_STATUS_CHANGE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("AH000001", notification.Content.AccountHolderCode); + Assert.AreEqual("x00x00x00-xx00-0xx0-x000-00xx00xx000000", notification.Content.Store); + } + + [TestMethod] + public void MarketPayAccountHolderUpcomingDeadlineTest() + { + string json = GetFileContents("Mocks/marketpay/notification/account-holder-upcoming-deadline-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + AccountHolderUpcomingDeadlineNotification notification = (AccountHolderUpcomingDeadlineNotification)notificationMessage; + + Assert.AreEqual("ACCOUNT_HOLDER_UPCOMING_DEADLINE", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("testD47", notification.Content.AccountHolderCode); + Assert.AreEqual("InactivateAccount", notification.Content.Event); + } + + [TestMethod] + public void MarketPayDirectDebitInitiatedTest() + { + string json = GetFileContents("Mocks/marketpay/notification/direct-debit-initiated-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + DirectDebitInitiatedNotification notification = (DirectDebitInitiatedNotification)notificationMessage; + Assert.AreEqual("DIRECT_DEBIT_INITIATED", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("100000000", notification.Content.AccountCode); + Assert.AreEqual("TestMarketPlaceMerchant", notification.Content.MerchantAccountCode); + } + + [TestMethod] + public void MarketPayRefundFundsTransferTest() + { + string json = GetFileContents("Mocks/marketpay/notification/refund-funds-transfer-test.json"); + NotificationHandler notificationHandler = new NotificationHandler(); + IGenericNotification notificationMessage = notificationHandler.HandleMarketpayNotificationJson(json); + RefundFundsTransferNotification notification = (RefundFundsTransferNotification)notificationMessage; + Assert.AreEqual("REFUND_FUNDS_TRANSFER", notification.EventType); + Assert.IsNotNull(notification.Content); + Assert.AreEqual("MRef#000001", notification.Content.MerchantReference); + Assert.AreEqual("TSTPSPR0000000PT", notification.Content.OriginalReference); + Assert.IsTrue(notification.Content.InvalidFields.Count > 0); + } + + + } +} diff --git a/Adyen.Test/MarketpayAccountTest.cs b/Adyen.Test/MarketPayTests/MarketpayAccountTest.cs similarity index 99% rename from Adyen.Test/MarketpayAccountTest.cs rename to Adyen.Test/MarketPayTests/MarketpayAccountTest.cs index 8ebc0cf07..57d33b955 100644 --- a/Adyen.Test/MarketpayAccountTest.cs +++ b/Adyen.Test/MarketPayTests/MarketpayAccountTest.cs @@ -25,7 +25,7 @@ using System.Collections.Generic; using Account = Adyen.Service.Account; -namespace Adyen.Test +namespace Adyen.Test.MarketPayTest { [TestClass] public class MarketpayAccountTest : BaseTest diff --git a/Adyen.Test/Mocks/marketpay/notification/account-closed-test.json b/Adyen.Test/Mocks/marketpay/notification/account-closed-test.json new file mode 100644 index 000000000..4b6df6524 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-closed-test.json @@ -0,0 +1,27 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_CLOSED", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "pspReference": "TSTPSPR0001", + "resultCode": "Success", + "status": "Closed" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-created-success.json b/Adyen.Test/Mocks/marketpay/notification/account-created-success.json new file mode 100644 index 000000000..ddfc665a6 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-created-success.json @@ -0,0 +1,37 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_CREATED", + "executingUserKey": "ws", + "live": "true", + "pspReference": "Test_ACCOUNT_CREATED", + "content": { + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "pspReference": "Test_ACCOUNT_CREATED", + "resultCode": "Success", + "accountCode": "AC0000000001", + "accountHolderCode": "TestAccountHolder", + "description": "account description", + "metadata": { + "MetaKey": "MetaValue" + }, + "payoutSchedule": { + "nextScheduledPayout": "1970-01-02T01:00:00+01:00", + "schedule": "DAILY" + }, + "status": "Active" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-funds-below-thresold-test.json b/Adyen.Test/Mocks/marketpay/notification/account-funds-below-thresold-test.json new file mode 100644 index 000000000..f4c019c44 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-funds-below-thresold-test.json @@ -0,0 +1,18 @@ +{ + "eventType": "ACCOUNT_FUNDS_BELOW_THRESHOLD", + "executingUserKey": "ws", + "live": "true", + "pspReference": "Test_ACCOUNT_CREATED", + "content": { + "accountCode": "TestAccountHolder", + "balanceDate": "2020-11-04", + "currentFunds": { + "currency": "USD", + "value": 96 + }, + "fundThreshold": { + "currency": "USD", + "value": 100 + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-created-success.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-created-success.json new file mode 100644 index 000000000..323fcb849 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-created-success.json @@ -0,0 +1,183 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_HOLDER_CREATED", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "pspReference": "TSTPSPR0001", + "resultCode": "Success", + "accountCode": "AC0000000001", + "accountHolderCode": "AHC00000001", + "accountHolderDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "96/A", + "postalCode": "1000AA", + "stateOrProvince": "Nord Holland", + "street": "Street" + }, + "bankAccountDetails": [ + { + "accountNumber": "00000000", + "accountType": "checking", + "bankAccountName": "Account name", + "bankAccountReference": "Ref#000001", + "bankAccountUUID": "00000000-0000-0000-0000-000000000000", + "bankBicSwift": "BSWFT", + "bankCity": "Amsterdam", + "bankCode": "00000000", + "bankName": "Bank Name Co", + "branchCode": "00000000", + "checkCode": "1234", + "countryCode": "NL", + "currencyCode": "EUR", + "iban": "NL00NONE1234123412", + "ownerCity": "Amsterdam", + "ownerCountryCode": "NL", + "ownerDateOfBirth": "1981-02-27", + "ownerHouseNumberOrName": "32/B", + "ownerName": "Owner Name", + "ownerNationality": "NL", + "ownerPostalCode": "1000AA", + "ownerState": "Nord Holland", + "ownerStreet": "Owner Street", + "primaryAccount": false, + "taxId": "OT#12345", + "urlForVerification": "http://adyen.com" + } + ], + "email": "contact@adyen.com", + "fullPhoneNumber": "+31858888138", + "individualDetails": { + "name": { + "firstName": "Firstname", + "gender": "UNKNOWN", + "infix": "inifix", + "lastName": "Lastname" + }, + "personalData": { + "dateOfBirth": "1981-02-27", + "documentData": [ + { + "expirationDate": "2030-12-31", + "issuerCountry": "NL", + "issuerState": "Nord Holland", + "number": "ID#123456", + "type": "ID" + } + ], + "nationality": "Dutch" + } + }, + "merchantCategoryCode": "1212", + "metadata": { + "MetaKey": "MetaValue" + }, + "payoutInstrumentTokens": [ + { + "merchantAccount": "MA000001", + "payoutInstrumentTokenCode": "PIT000001", + "payoutInstrumentTokenType": "CardToken", + "recurringDetailReference": "RDR0000001", + "shopperReference": "SR000001" + } + ], + "phoneNumber": { + "phoneCountryCode": "NL", + "phoneNumber": "858888138", + "phoneType": "Landline" + }, + "webAddress": "https://adyen.com" + }, + "accountHolderStatus": { + "status": "Active", + "statusReason": "Reason of status", + "processingState": { + "disabled": true, + "disableReason": "Reason of disabled", + "processedFrom": { + "currency": "EUR", + "value": 10 + }, + "processedTo": { + "currency": "EUR", + "value": 100 + }, + "tierNumber": 2 + }, + "payoutState": { + "allowPayout": false, + "payoutLimit": { + "currency": "EUR", + "value": 1000 + }, + "disabled": true, + "disableReason": "Reason of disabled", + "tierNumber": 2, + "notAllowedReason": "Reason of not allowed" + }, + "events": [ + { + "event": "InactivateAccount", + "executionDate": "2019-01-01T01:00:00+01:00", + "reason": "Reason of event" + } + ] + }, + "description": "Description for account holder", + "legalEntity": "Individual", + "primaryCurrency": "EUR", + "verification": { + "accountHolder": { + "checks": [ + { + "type": "IDENTITY_VERIFICATION", + "status": "PENDING", + "summary": { + "kycCheckCode": 100, + "kycCheckDescription": "KYC check summary description" + }, + "requiredFields": [ + "field.missing" + ] + } + ] + }, + "bankAccounts": [ + { + "checks": [ + { + "type": "IDENTITY_VERIFICATION", + "status": "PENDING", + "summary": { + "kycCheckCode": 100, + "kycCheckDescription": "KYC check summary description" + }, + "requiredFields": [ + "field.missing" + ] + } + ], + "bankAccountUUID": "00000000-0000-0000-0000-000000000000" + } + ] + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-payout-fail.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-payout-fail.json new file mode 100644 index 000000000..e1feefb6d --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-payout-fail.json @@ -0,0 +1,73 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_HOLDER_PAYOUT", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "accountCode": "AC00000001", + "accountHolderCode": "AH00000001", + "amount": { + "currency": "EUR", + "value": 100 + }, + "amounts": [ + { + "currency": "EUR", + "value": 10 + } + ], + "bankAccountDetail": { + "accountNumber": "00000000", + "accountType": "checking", + "bankAccountName": "Account name", + "bankAccountReference": "Ref#000001", + "bankAccountUUID": "00000000-0000-0000-0000-000000000000", + "bankBicSwift": "BSWFT", + "bankCity": "Amsterdam", + "bankCode": "00000000", + "bankName": "Bank Name Co", + "branchCode": "00000000", + "checkCode": "1234", + "countryCode": "NL", + "currencyCode": "EUR", + "iban": "NL00NONE1234123412", + "ownerCity": "Amsterdam", + "ownerCountryCode": "NL", + "ownerDateOfBirth": "1981-02-27", + "ownerHouseNumberOrName": "32/B", + "ownerName": "Owner Name", + "ownerNationality": "NL", + "ownerPostalCode": "1000AA", + "ownerState": "Nord Holland", + "ownerStreet": "Owner Street", + "primaryAccount": false, + "taxId": "OT#12345", + "urlForVerification": "http://adyen.com" + }, + "description": "description of payout", + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "merchantReference": "MRef#00000001", + "status": { + "message": { + "code": "10_069", + "text": "Payout has been failed for account seller1. Details: Payout has been rejected by the beneficiary bank." + }, + "statusCode": "Failed" + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-status-change.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-status-change.json new file mode 100644 index 000000000..099176670 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-status-change.json @@ -0,0 +1,40 @@ +{ + "eventDate": "2018-03-01T15:04:18+01:00", + "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", + "executingUserKey": "Status Update", + "live": "false", + "pspReference": "8815199130589319", + "content": { + "accountHolderCode": "ah689", + "oldStatus": { + "status": "Active", + "processingState": {}, + "payoutState": { + "allowPayout": "false" + }, + "events": [] + }, + "newStatus": { + "status": "Active", + "processingState": { + "disabled": "false", + "processedFrom": { + "currency": "GBP", + "value": 0 + }, + "processedTo": { + "currency": "GBP", + "value": 0 + }, + "tierNumber": 0 + }, + "payoutState": { + "allowPayout": "false", + "disabled": "false", + "tierNumber": 0 + }, + "events": [] + }, + "reason": "Account holder has been updated" + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-store-status-change-test.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-store-status-change-test.json new file mode 100644 index 000000000..09abd14a5 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-store-status-change-test.json @@ -0,0 +1,15 @@ +{ + "eventDate": "2019-12-16T10:38:15+01:00", + "eventType": "ACCOUNT_HOLDER_STORE_STATUS_CHANGE", + "executingUserKey": "Store Status Update", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "accountHolderCode": "AH000001", + "store": "x00x00x00-xx00-0xx0-x000-00xx00xx000000", + "storeReference": "Ref#000001", + "oldStatus": "Pending", + "newStatus": "Active", + "reason": "Store was successfully set up" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-upcoming-deadline-test.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-upcoming-deadline-test.json new file mode 100644 index 000000000..384b9aeca --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-upcoming-deadline-test.json @@ -0,0 +1,12 @@ +{ + "eventDate": "2019-09-25T09:52:28+02:00", + "eventType": "ACCOUNT_HOLDER_UPCOMING_DEADLINE", + "live": false, + "pspReference": "9315693979482563", + "content": { + "accountHolderCode": "testD47", + "event": "InactivateAccount", + "executionDate": "2019-10-11", + "reason": "Processed more than GBP 5000.00 or equivalent, deadline triggered" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-updated.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-updated.json new file mode 100644 index 000000000..eb4b1e55d --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-updated.json @@ -0,0 +1,181 @@ +{ + "eventDate": "2018-03-02T10:02:45+01:00", + "eventType": "ACCOUNT_HOLDER_UPDATED", + "executingUserKey": "ws", + "live": "false", + "pspReference": "8515199813653278", + "content": { + "pspReference": "8515199813653278", + "submittedAsync": "false", + "accountHolderCode": "accountHolderCode", + "accountHolderDetails": { + "address": { + "city": "PASSEDCITY", + "country": "GB", + "postalCode": "12345", + "stateOrProvince": "NH", + "street": "Teststreet 1" + }, + "bankAccountDetails": [ + { + "BankAccountDetail": { + "bankAccountUUID": "0c9c8c09-f6cf-4d0f-b4a9-547d2147ac3c", + "bankCity": "PASSED", + "bankName": "testBank", + "countryCode": "GB", + "currencyCode": "EUR", + "iban": "GB26TEST40051512347366", + "ownerCity": "PASSED", + "ownerCountryCode": "NL", + "ownerDateOfBirth": "1980-01-01", + "ownerHouseNumberOrName": "9", + "ownerName": "TestData", + "ownerNationality": "NL", + "ownerPostalCode": "1062HT", + "ownerState": "NL", + "ownerStreet": "street", + "primaryAccount": "true" + } + } + ], + "businessDetails": { + "legalBusinessName": "Test company", + "shareholders": [ + { + "ShareholderContact": { + "email": "test.ah681@adyen.com", + "name": { + "firstName": "Test", + "gender": "MALE", + "lastName": "Test" + }, + "personalData": { + "dateOfBirth": "1970-01-01", + "idNumber": "1234567890", + "nationality": "NL" + }, + "shareholderCode": "6d2d8ba3-751c-4ecc-8777-6bbdcd4053cd" + } + } + ] + }, + "email": "ah62@adyen.com" + }, + "accountHolderStatus": { + "status": "Active", + "processingState": { + "disabled": "false", + "processedFrom": { + "currency": "GBP", + "value": 0 + }, + "processedTo": { + "currency": "GBP", + "value": 0 + }, + "tierNumber": 0 + }, + "payoutState": { + "allowPayout": "false", + "disabled": "false", + "tierNumber": 0 + }, + "events": [] + }, + "invalidFields": [], + "kycVerificationResults": [ + { + "KYCVerificationResult": { + "accountHolderCode": "ah690", + "checkResults": [ + { + "KYCCheckResult": { + "checkType": "COMPANY_VERIFICATION", + "verificationStatus": "DATA_PROVIDED" + } + } + ], + "verificationStatuses": { + "COMPANY_VERIFICATION": "DATA_PROVIDED" + } + } + }, + { + "KYCVerificationResult": { + "accountHolderCode": "ah690", + "checkResults": [ + { + "KYCCheckResult": { + "checkType": "IDENTITY_VERIFICATION", + "verificationStatus": "DATA_PROVIDED" + } + }, + { + "KYCCheckResult": { + "checkType": "PASSPORT_VERIFICATION", + "verificationStatus": "AWAITING_DATA" + } + } + ], + "shareholderCode": "6d2d8ba3-751c-4ecc-8777-6bbdcd4053cd", + "verificationStatuses": { + "IDENTITY_VERIFICATION": "DATA_PROVIDED", + "PASSPORT_VERIFICATION": "AWAITING_DATA" + } + } + }, + { + "KYCVerificationResult": { + "accountHolderCode": "ah690", + "bankAccountUUID": "0c9c8c09-f6cf-4d0f-b4a9-547d2147ac3c", + "checkResults": [ + { + "KYCCheckResult": { + "checkType": "BANK_ACCOUNT_VERIFICATION", + "verificationStatus": "DATA_PROVIDED" + } + } + ], + "verificationStatuses": { + "BANK_ACCOUNT_VERIFICATION": "DATA_PROVIDED" + } + } + } + ], + "legalEntity": "Business", + "requirementsForNextAccountState": [], + "updatedFields": [], + "verification": { + "accountHolder": { + "checks": [ + { + "type": "COMPANY_VERIFICATION", + "status": "DATA_PROVIDED" + } + ] + }, + "shareholders": [ + { + "shareholderCode": "6d2d8ba3-751c-4ecc-8777-6bbdcd4053cd", + "checks": [ + { + "type": "IDENTITY_VERIFICATION", + "status": "DATA_PROVIDED" + } + ] + } + ], + "bankAccounts": [ + { + "bankAccountUUID": "0c9c8c09-f6cf-4d0f-b4a9-547d2147ac3c", + "checks": [ + { + "type": "BANK_ACCOUNT_VERIFICATION", + "status": "DATA_PROVIDED" + } + ] + } + ] + } + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/account-holder-verification.json b/Adyen.Test/Mocks/marketpay/notification/account-holder-verification.json new file mode 100644 index 000000000..7b31ae92f --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-holder-verification.json @@ -0,0 +1,26 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_HOLDER_VERIFICATION", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "accountHolderCode": "AH0000001", + "kycCheckStatusData": { + "type": "IDENTITY_VERIFICATION", + "status": "PENDING", + "summary": { + "kycCheckCode": 100, + "kycCheckDescription": "KYC check summary description" + }, + "requiredFields": [ + "field.missing" + ] + }, + "shareholderCode": "SH00000001" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/account-updated-test.json b/Adyen.Test/Mocks/marketpay/notification/account-updated-test.json new file mode 100644 index 000000000..1ad093a87 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/account-updated-test.json @@ -0,0 +1,35 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "ACCOUNT_UPDATED", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "pspReference": "TSTPSPR0001", + "resultCode": "Success", + "accountCode": "AC0000000001", + "description": "account description", + "metadata": { + "MetaKey": "MetaValue" + }, + "payoutSchedule": { + "nextScheduledPayout": "1970-01-02T01:00:00+01:00", + "schedule": "DAILY" + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/beneficiary-setup.json b/Adyen.Test/Mocks/marketpay/notification/beneficiary-setup.json new file mode 100644 index 000000000..64bc9835b --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/beneficiary-setup.json @@ -0,0 +1,16 @@ +{ + "eventDate": "2018-03-02T17:35:58+01:00", + "eventType": "BENEFICIARY_SETUP", + "executingUserKey": "executingUserKey", + "live": "false", + "pspReference": "8815200085572134", + "content": { + "destinationAccountCode": "117001608", + "destinationAccountHolderCode": "ah690", + "merchantReference": "test", + "sourceAccountCode": "136058999", + "sourceAccountHolderCode": "ah689", + "transferDate": "2018-03-02T17:35:57+01:00", + "transferredTransactionCount": 0 + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/compensate-negative-balance-test.json b/Adyen.Test/Mocks/marketpay/notification/compensate-negative-balance-test.json new file mode 100644 index 000000000..1028c1586 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/compensate-negative-balance-test.json @@ -0,0 +1,23 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2019-01-01T01:00:00+01:00", + "eventType": "COMPENSATE_NEGATIVE_BALANCE", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "records": [ + { + "accountCode": "AC000001", + "amount": { + "currency": "EUR", + "value": 10 + }, + "transferDate": "2019-01-01T01:00:00+01:00" + } + ] + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/create-notification-configuration-success.json b/Adyen.Test/Mocks/marketpay/notification/create-notification-configuration-success.json new file mode 100644 index 000000000..444baf7c7 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/create-notification-configuration-success.json @@ -0,0 +1,22 @@ +{ + "pspReference": "8515077331535427", + "submittedAsync": "false", + "configurationDetails": { + "active": "true", + "apiVersion": 1, + "description": "TestBas", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 157, + "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/delete-notification-configurations-success.json b/Adyen.Test/Mocks/marketpay/notification/delete-notification-configurations-success.json new file mode 100644 index 000000000..490025b7a --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/delete-notification-configurations-success.json @@ -0,0 +1,5 @@ + +{ + "pspReference": "8515078085249090", + "submittedAsync": "false" +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/direct-debit-initiated-test.json b/Adyen.Test/Mocks/marketpay/notification/direct-debit-initiated-test.json new file mode 100644 index 000000000..888941ff4 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/direct-debit-initiated-test.json @@ -0,0 +1,18 @@ +{ + "eventDate": "2019-11-15T11:42:59+01:00", + "eventType": "DIRECT_DEBIT_INITIATED", + "live": false, + "pspReference": "991573814577004H", + "content": { + "accountCode": "100000000", + "amount": { + "currency": "EUR", + "value": 10000000 + }, + "debitInitiationDate": "2019-11-15", + "merchantAccountCode": "TestMarketPlaceMerchant", + "status": { + "statusCode": "Initiated" + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-list-success.json b/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-list-success.json new file mode 100644 index 000000000..152c189f0 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-list-success.json @@ -0,0 +1,46 @@ +{ + "pspReference": "8515078078661665", + "submittedAsync": "false", + "configurations": [ + { + "NotificationConfigurationDetails": { + "active": "true", + "apiVersion": 1, + "description": "TestBas", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 157, + "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } + }, + { + "NotificationConfigurationDetails": { + "active": "true", + "apiVersion": 1, + "description": "TestBas2", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 161, + "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } + } + ] +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-success.json b/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-success.json new file mode 100644 index 000000000..520848cbf --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/get-notification-configuration-success.json @@ -0,0 +1,22 @@ +{ + "pspReference": "8815078078131377", + "submittedAsync": "false", + "configurationDetails": { + "active": "true", + "apiVersion": 1, + "description": "TestBas", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_STATUS_CHANGE", + "includeMode": "INCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 157, + "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/payment-failure-test.json b/Adyen.Test/Mocks/marketpay/notification/payment-failure-test.json new file mode 100644 index 000000000..e306229ff --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/payment-failure-test.json @@ -0,0 +1,25 @@ +{ + "eventDate": "2018-03-07T13:44:34+01:00", + "eventType": "PAYMENT_FAILURE", + "executingUserKey": "ws_957630", + "live": "false", + "pspReference": "Test_PAYMENT_FAILURE", + "content": { + "errorFields": [ + { + "ErrorFieldType": { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.accountNumber", + "fieldName": "accountNumber" + } + } + } + ], + "errorMessage": { + "code": "10_062", + "text": "Processing is not allowed because the account holder TestAccountHolder is not in the processing state." + } + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/refund-funds-transfer-test.json b/Adyen.Test/Mocks/marketpay/notification/refund-funds-transfer-test.json new file mode 100644 index 000000000..3111fe648 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/refund-funds-transfer-test.json @@ -0,0 +1,37 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "1970-01-01T01:00:00+01:00", + "eventType": "REFUND_FUNDS_TRANSFER", + "executingUserKey": "executing-user-key", + "live": false, + "pspReference": "TSTPSPR0001", + "content": { + "amount": { + "currency": "EUR", + "value": 10 + }, + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "merchantReference": "MRef#000001", + "originalReference": "TSTPSPR0000000PT", + "status": { + "message": { + "code": "100", + "text": "test message" + }, + "statusCode": "Success" + } + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/report-available-test.json b/Adyen.Test/Mocks/marketpay/notification/report-available-test.json new file mode 100644 index 000000000..b6eafd92a --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/report-available-test.json @@ -0,0 +1,14 @@ +{ + "eventDate": "2018-03-07T13:44:34+01:00", + "eventType": "REPORT_AVAILABLE", + "executingUserKey": "ReportProcessor", + "live": "false", + "pspReference": "marketplace_payments_accounting_report_2016_01_01.csv", + "content": { + "accountCode": "TestMarketPlaceV1", + "accountType": "MarketPlace", + "eventDate": "2018-03-07T13:44:34+01:00", + "remoteAccessUrl": "https:\/\/ca-test.adyen.com\/reports\/download\/MarketPlace\/TestMarketPlaceV1\/marketplace_payments_accounting_report_2016_01_01.csv", + "success": "true" + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/scheduled-refunds-test.json b/Adyen.Test/Mocks/marketpay/notification/scheduled-refunds-test.json new file mode 100644 index 000000000..6be3ea055 --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/scheduled-refunds-test.json @@ -0,0 +1,70 @@ +{ + "eventType": "SCHEDULED_REFUNDS", + "executingUserKey": "ws_957630", + "live": "false", + "pspReference": "Test_SCHEDULED_REFUNDS", + "content": { + "accountCode": "1234567890", + "accountHolderCode": "TestAccountHolder", + "lastPayout": { + "amount": { + "currency": "EUR", + "value": 5000 + }, + "creationDate": "2018-03-07T13:44:34+01:00", + "description": "Test reference - Test description", + "pspReference": "Test_SCHEDULED_REFUNDS_transactionReference", + "transactionStatus": "Payout" + }, + "refundResults": [ + { + "RefundResult": { + "originalTransaction": { + "amount": { + "currency": "EUR", + "value": 5000 + }, + "creationDate": "2018-03-07T13:44:34+01:00", + "description": "Test reference - Test description", + "pspReference": "Test_SCHEDULED_REFUNDS_transactionReference", + "transactionStatus": "PendingCredit" + }, + "pspReference": "Test_SCHEDULED_REFUNDS_modificationReference", + "response": "[refund-received]" + } + }, + { + "RefundResult": { + "originalTransaction": { + "amount": { + "currency": "EUR", + "value": 5000 + }, + "creationDate": "2018-03-07T13:44:34+01:00", + "description": "Test reference - Test description", + "pspReference": "Test_SCHEDULED_REFUNDS_transactionReference", + "transactionStatus": "PendingCredit" + }, + "pspReference": "Test_SCHEDULED_REFUNDS_modificationReference", + "response": "Could not determine merchantAccount" + } + }, + { + "RefundResult": { + "originalTransaction": { + "amount": { + "currency": "EUR", + "value": 5000 + }, + "creationDate": "2018-03-07T13:44:34+01:00", + "description": "Test reference - Test description", + "pspReference": "Test_SCHEDULED_REFUNDS_transactionReference", + "transactionStatus": "PendingCredit" + }, + "pspReference": "Test_SCHEDULED_REFUNDS_modificationReference", + "response": "Failed to send refund: Service unavailable" + } + } + ] + } +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/test-notification-configuration-success.json b/Adyen.Test/Mocks/marketpay/notification/test-notification-configuration-success.json new file mode 100644 index 000000000..39b4e5c1d --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/test-notification-configuration-success.json @@ -0,0 +1,30 @@ +{ + "pspReference": "8515078087759211", + "submittedAsync": "false", + "errorMessages": [ + "The required string \"[accepted]\" is not in all the results" + ], + "eventTypes": [ + "ACCOUNT_CREATED" + ], + "exchangeMessages": [ + { + "ExchangeMessage": { + "messageCode": "Number", + "messageDescription": "1" + } + }, + { + "ExchangeMessage": { + "messageCode": "Title", + "messageDescription": "Test 1: Test_ACCOUNT_CREATED" + } + } + ], + "notificationId": 157, + "okMessages": [ + "Output: \n\n\nERROR: The requested URL could not be retrieved\n\n\n
\n

ERROR

\n

The requested URL could not be retrieved

\n
\n
\n\n
\n

The following error was encountered while trying to retrieve the URL: https://cal-test.adyen.com/*

\n\n
\n

Unable to determine IP address from host name cal-test.adyen.com

\n
\n\n

The DNS server returned:

\n
\n
No DNS records
\n
\n\n

This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.

\n\n

Your cache administrator is root.

\n
\n
\n\n
\n
\n

Generated Thu, 12 Oct 2017 11:46:15 GMT by proxy2.tr3.adyen.com (squid/3.1.23)

\n\n
\n\n", + "ResponseCode: 404", + "ResponseTime_ms: 15" + ] +} \ No newline at end of file diff --git a/Adyen.Test/Mocks/marketpay/notification/transfer-funds-test.json b/Adyen.Test/Mocks/marketpay/notification/transfer-funds-test.json new file mode 100644 index 000000000..d0e9020dc --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/transfer-funds-test.json @@ -0,0 +1,35 @@ +{ + "error": { + "errorCode": "000", + "message": "test error message" + }, + "eventDate": "2018-03-07T13:44:34+01:00", + "eventType": "TRANSFER_FUNDS", + "executingUserKey": "ws_957630", + "live": "false", + "pspReference": "Test_TRANSFER_FUNDS", + "content": { + "invalidFields": [ + { + "errorCode": 1, + "errorDescription": "Field is missing", + "fieldType": { + "field": "AccountHolderDetails.BusinessDetails.Shareholders.unknown", + "fieldName": "unknown", + "shareholderCode": "SH00001" + } + } + ], + "amount": { + "currency": "EUR", + "value": 1000 + }, + "destinationAccountCode": "987654321", + "merchantReference": "MerchantReference", + "sourceAccountCode": "123456789", + "status": { + "statusCode": "Success" + }, + "transferCode": "testTransferCode" + } +} diff --git a/Adyen.Test/Mocks/marketpay/notification/update-notification-configuration-success.json b/Adyen.Test/Mocks/marketpay/notification/update-notification-configuration-success.json new file mode 100644 index 000000000..847f9728d --- /dev/null +++ b/Adyen.Test/Mocks/marketpay/notification/update-notification-configuration-success.json @@ -0,0 +1,28 @@ +{ + "pspReference": "8515078084389038", + "submittedAsync": "false", + "configurationDetails": { + "active": "false", + "apiVersion": 1, + "description": "TestUpdate", + "eventConfigs": [ + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_CREATED", + "includeMode": "INCLUDE" + } + }, + { + "NotificationEventConfiguration": { + "eventType": "ACCOUNT_HOLDER_CREATED", + "includeMode": "EXCLUDE" + } + } + ], + "messageFormat": "SOAP", + "notificationId": 157, + "notifyURL": "https://cal-test.adyen.com/cal/services/ViasNotification/handleGenericEvent", + "sendActionHeader": "true", + "sslProtocol": "SSLInsecureCiphers" + } +} \ No newline at end of file diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 3fcfb72a4..493dcf13d 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -22,7 +22,7 @@ https://www.adyen.com/dam/jcr:39adc4db-76f7-4b9e-aec6-bfa21db4153c/adyen-logo-green.png true - true + false adyen-dotnet-api-library-key.snk diff --git a/Adyen/Model/MarketPay/AccountPayoutState.cs b/Adyen/Model/MarketPay/AccountPayoutState.cs index de4786141..6aa7fad1c 100644 --- a/Adyen/Model/MarketPay/AccountPayoutState.cs +++ b/Adyen/Model/MarketPay/AccountPayoutState.cs @@ -57,16 +57,8 @@ public partial class AccountPayoutState : IEquatable, IVali { this.AllowPayout = allowPayout; } - // to ensure "disabled" is required (not null) - if (disabled == null) - { - throw new InvalidDataException("disabled is a required property for AccountPayoutState and cannot be null"); - } - else - { - this.Disabled = disabled; - } - + + this.Disabled = disabled; this.NotAllowedReason = notAllowedReason; this.TierNumber = tierNumber; this.PayoutLimit = payoutLimit; diff --git a/Adyen/Model/MarketPay/KYCCheckStatusData.cs b/Adyen/Model/MarketPay/KYCCheckStatusData.cs index 3b8caad5a..85f23874a 100644 --- a/Adyen/Model/MarketPay/KYCCheckStatusData.cs +++ b/Adyen/Model/MarketPay/KYCCheckStatusData.cs @@ -37,14 +37,14 @@ namespace Adyen.Model.MarketPay /// KYCCheckStatusData ///
[DataContract] - public partial class KYCCheckStatusData : IEquatable, IValidatableObject + public partial class KYCCheckStatusData : IEquatable, IValidatableObject { /// /// The status of the check. >Permitted Values: `DATA_PROVIDED`, `PASSED`, `PENDING`, `AWAITING_DATA`, `RETRY_LIMIT_REACHED`, `INVALID_DATA`, `FAILED`. /// /// The status of the check. >Permitted Values: `DATA_PROVIDED`, `PASSED`, `PENDING`, `AWAITING_DATA`, `RETRY_LIMIT_REACHED`, `INVALID_DATA`, `FAILED`. [JsonConverter(typeof(StringEnumConverter))] - public enum StatusEnum + public enum StatusEnum { /// /// Enum AWAITINGDATA for value: AWAITING_DATA @@ -90,19 +90,20 @@ public enum StatusEnum /// Enum UNCHECKED for value: UNCHECKED /// [EnumMember(Value = "UNCHECKED")] - UNCHECKED = 9 } + UNCHECKED = 9 + } /// /// The status of the check. >Permitted Values: `DATA_PROVIDED`, `PASSED`, `PENDING`, `AWAITING_DATA`, `RETRY_LIMIT_REACHED`, `INVALID_DATA`, `FAILED`. /// /// The status of the check. >Permitted Values: `DATA_PROVIDED`, `PASSED`, `PENDING`, `AWAITING_DATA`, `RETRY_LIMIT_REACHED`, `INVALID_DATA`, `FAILED`. - [DataMember(Name="status", EmitDefaultValue=false)] + [DataMember(Name = "status", EmitDefaultValue = false)] public StatusEnum Status { get; set; } /// /// The type of check. >Permitted Values: `COMPANY_VERIFICATION`, `IDENTITY_VERIFICATION`, `PASSPORT_VERIFICATION`, `BANK_ACCOUNT_VERIFICATION`, `NONPROFIT_VERIFICATION`. /// /// The type of check. >Permitted Values: `COMPANY_VERIFICATION`, `IDENTITY_VERIFICATION`, `PASSPORT_VERIFICATION`, `BANK_ACCOUNT_VERIFICATION`, `NONPROFIT_VERIFICATION`. [JsonConverter(typeof(StringEnumConverter))] - public enum TypeEnum + public enum TypeEnum { /// /// Enum BANKACCOUNTVERIFICATION for value: BANK_ACCOUNT_VERIFICATION @@ -128,12 +129,13 @@ public enum TypeEnum /// Enum PASSPORTVERIFICATION for value: PASSPORT_VERIFICATION /// [EnumMember(Value = "PASSPORT_VERIFICATION")] - PASSPORTVERIFICATION = 5 } + PASSPORTVERIFICATION = 5 + } /// /// The type of check. >Permitted Values: `COMPANY_VERIFICATION`, `IDENTITY_VERIFICATION`, `PASSPORT_VERIFICATION`, `BANK_ACCOUNT_VERIFICATION`, `NONPROFIT_VERIFICATION`. /// /// The type of check. >Permitted Values: `COMPANY_VERIFICATION`, `IDENTITY_VERIFICATION`, `PASSPORT_VERIFICATION`, `BANK_ACCOUNT_VERIFICATION`, `NONPROFIT_VERIFICATION`. - [DataMember(Name="type", EmitDefaultValue=false)] + [DataMember(Name = "type", EmitDefaultValue = false)] public TypeEnum Type { get; set; } /// /// Initializes a new instance of the class. @@ -149,19 +151,19 @@ public enum TypeEnum this.RequiredFields = requiredFields; this.Summary = summary; } - + /// /// A list of the fields required for execution of the check. /// /// A list of the fields required for execution of the check. - [DataMember(Name="requiredFields", EmitDefaultValue=false)] + [DataMember(Name = "requiredFields", EmitDefaultValue = false)] public List RequiredFields { get; set; } /// /// Gets or Sets Summary /// - [DataMember(Name="summary", EmitDefaultValue=false)] + [DataMember(Name = "summary", EmitDefaultValue = false)] public KYCCheckSummary Summary { get; set; } @@ -180,7 +182,7 @@ public override string ToString() sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -210,22 +212,22 @@ public bool Equals(KYCCheckStatusData input) if (input == null) return false; - return + return ( this.RequiredFields == input.RequiredFields || this.RequiredFields != null && input.RequiredFields != null && this.RequiredFields.SequenceEqual(input.RequiredFields) - ) && + ) && ( this.Status == input.Status || this.Status.Equals(input.Status) - ) && + ) && ( this.Summary == input.Summary || (this.Summary != null && this.Summary.Equals(input.Summary)) - ) && + ) && ( this.Type == input.Type || this.Type.Equals(input.Type) diff --git a/Adyen/Model/MarketPay/Notification/AccountCloseNotification.cs b/Adyen/Model/MarketPay/Notification/AccountCloseNotification.cs new file mode 100644 index 000000000..43632c554 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountCloseNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountCloseNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public CloseAccountResponse Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountCloseNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountCreateNotification.cs b/Adyen/Model/MarketPay/Notification/AccountCreateNotification.cs new file mode 100644 index 000000000..76f030f57 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountCreateNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountCreateNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public CreateAccountResponse Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountCreateNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotification.cs b/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotification.cs new file mode 100644 index 000000000..3584f50d2 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountFundsBelowThresholdNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountFundsBelowThresholdNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountFundsBelowThresholdNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotificationContent.cs new file mode 100644 index 000000000..02e241abb --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountFundsBelowThresholdNotificationContent.cs @@ -0,0 +1,102 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountFundsBelowThresholdNotificationContent + { + /// + /// The code of the account with funds under threshold + /// + /// The code of the account with funds under threshold + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// Gets or Sets BalanceDate + /// + [DataMember(Name = "balanceDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "balanceDate")] + public DateTime BalanceDate { get; set; } + + /// + /// Gets or Sets CurrentFunds + /// + [DataMember(Name = "currentFunds", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "currentFunds")] + public Amount CurrentFunds { get; set; } + + /// + /// Gets or Sets FundThreshold + /// + [DataMember(Name = "fundThreshold", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "fundThreshold")] + public Amount FundThreshold { get; set; } + + /// + /// The code of the merchant account. + /// + /// The code of the merchant account. + [DataMember(Name = "merchantAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantAccountCode")] + public string MerchantAccountCode { 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 AccountFundsBelowThresholdNotificationContent {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" BalanceDate: ").Append(BalanceDate).Append("\n"); + sb.Append(" CurrentFunds: ").Append(CurrentFunds).Append("\n"); + sb.Append(" FundThreshold: ").Append(FundThreshold).Append("\n"); + sb.Append(" MerchantAccountCode: ").Append(MerchantAccountCode).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderCreateNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderCreateNotification.cs new file mode 100644 index 000000000..ffffcd3c9 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderCreateNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderCreateNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public CreateAccountHolderResponse Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderCreateNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotification.cs new file mode 100644 index 000000000..04239ea6e --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderPayoutNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountHolderPayoutNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderPayoutNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotificationContent.cs new file mode 100644 index 000000000..11340bcd4 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderPayoutNotificationContent.cs @@ -0,0 +1,202 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Adyen.Util; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderPayoutNotificationContent + { + /// + /// The code of the account from which the payout was made. + /// + /// The code of the account from which the payout was made. + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// The code of the Account Holder to which the payout was made. + /// + /// The code of the Account Holder to which the payout was made. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// The payout amounts (per currency). + /// + /// The payout amounts (per currency). + [DataMember(Name = "amounts", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "amounts")] + public List Amounts { get; set; } + + /// + /// Gets or Sets BankAccountDetail + /// + [DataMember(Name = "bankAccountDetail", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "bankAccountDetail")] + public BankAccountDetail BankAccountDetail { get; set; } + + /// + /// A description of the payout. + /// + /// A description of the payout. + [DataMember(Name = "description", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or Sets EstimatedArrivalDate + /// + [DataMember(Name = "estimatedArrivalDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "estimatedArrivalDate")] + public LocalDate EstimatedArrivalDate { get; set; } + + /// + /// Invalid fields list. + /// + /// Invalid fields list. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// The merchant reference. + /// + /// The merchant reference. + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantReference")] + public string MerchantReference { get; set; } + + /// + /// The PSP reference of the original payout. + /// + /// The PSP reference of the original payout. + [DataMember(Name = "originalPspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "originalPspReference")] + public string OriginalPspReference { get; set; } + + /// + /// Payout account country. + /// + /// Payout account country. + [DataMember(Name = "payoutAccountCountry", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutAccountCountry")] + public string PayoutAccountCountry { get; set; } + + /// + /// Payout bank account number. + /// + /// Payout bank account number. + [DataMember(Name = "payoutAccountNumber", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutAccountNumber")] + public string PayoutAccountNumber { get; set; } + + /// + /// Payout bank name. + /// + /// Payout bank name. + [DataMember(Name = "payoutBankName", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutBankName")] + public string PayoutBankName { get; set; } + + /// + /// Payout branch code. + /// + /// Payout branch code. + [DataMember(Name = "payoutBranchCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutBranchCode")] + public string PayoutBranchCode { get; set; } + + /// + /// Payout transaction id. + /// + /// Payout transaction id. + [DataMember(Name = "payoutReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutReference")] + public long? PayoutReference { get; set; } + + /// + /// Speed with which payouts for this account are processed. Permitted values: `STANDARD`, `SAME_DAY`. + /// + /// Speed with which payouts for this account are processed. Permitted values: `STANDARD`, `SAME_DAY`. + [DataMember(Name = "payoutSpeed", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutSpeed")] + public string PayoutSpeed { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "status")] + public OperationStatus Status { 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 AccountHolderPayoutNotificationContent {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" Amounts: ").Append(Amounts.ObjectListToString()).Append("\n"); + sb.Append(" BankAccountDetail: ").Append(BankAccountDetail).Append("\n"); + sb.Append(" Description: ").Append(Description).Append("\n"); + sb.Append(" EstimatedArrivalDate: ").Append(EstimatedArrivalDate).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); + sb.Append(" OriginalPspReference: ").Append(OriginalPspReference).Append("\n"); + sb.Append(" PayoutAccountCountry: ").Append(PayoutAccountCountry).Append("\n"); + sb.Append(" PayoutAccountNumber: ").Append(PayoutAccountNumber).Append("\n"); + sb.Append(" PayoutBankName: ").Append(PayoutBankName).Append("\n"); + sb.Append(" PayoutBranchCode: ").Append(PayoutBranchCode).Append("\n"); + sb.Append(" PayoutReference: ").Append(PayoutReference).Append("\n"); + sb.Append(" PayoutSpeed: ").Append(PayoutSpeed).Append("\n"); + sb.Append(" Status: ").Append(Status).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotification.cs new file mode 100644 index 000000000..388f5e329 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderStatusChangeNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountHolderStatusChangeNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderStatusChangeNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotificationContent.cs new file mode 100644 index 000000000..1e4b04865 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderStatusChangeNotificationContent.cs @@ -0,0 +1,104 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderStatusChangeNotificationContent + { + /// + /// The code of the account holder. + /// + /// The code of the account holder. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// in case the account holder has not been updated, contains account holder fields, that did not pass the validation. + /// + /// in case the account holder has not been updated, contains account holder fields, that did not pass the validation. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// Gets or Sets NewStatus + /// + [DataMember(Name = "newStatus", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "newStatus")] + public AccountHolderStatus NewStatus { get; set; } + + /// + /// Gets or Sets OldStatus + /// + [DataMember(Name = "oldStatus", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "oldStatus")] + public AccountHolderStatus OldStatus { get; set; } + + /// + /// The reason for the status change. + /// + /// The reason for the status change. + [DataMember(Name = "reason", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "reason")] + public string Reason { 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 AccountHolderStatusChangeNotificationContent {\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" NewStatus: ").Append(NewStatus).Append("\n"); + sb.Append(" OldStatus: ").Append(OldStatus).Append("\n"); + sb.Append(" Reason: ").Append(Reason).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotification.cs new file mode 100644 index 000000000..2359ccfc6 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderStoreStatusChangeNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountHolderStoreStatusChangeNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderStoreStatusChangeNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotificationContent.cs new file mode 100644 index 000000000..5c0346f7f --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderStoreStatusChangeNotificationContent.cs @@ -0,0 +1,124 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderStoreStatusChangeNotificationContent + { + /// + /// The code of the account holder. + /// + /// The code of the account holder. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// In case the store status has not been updated, contains fields that did not pass the validation. + /// + /// In case the store status has not been updated, contains fields that did not pass the validation. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// The new status of the account holder. + /// + /// The new status of the account holder. + [DataMember(Name = "newStatus", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "newStatus")] + public string NewStatus { get; set; } + + /// + /// The former status of the account holder. + /// + /// The former status of the account holder. + [DataMember(Name = "oldStatus", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "oldStatus")] + public string OldStatus { get; set; } + + /// + /// The reason for the status change. + /// + /// The reason for the status change. + [DataMember(Name = "reason", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "reason")] + public string Reason { get; set; } + + /// + /// Alphanumeric identifier of the store. + /// + /// Alphanumeric identifier of the store. + [DataMember(Name = "store", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "store")] + public string Store { get; set; } + + /// + /// Store store reference. + /// + /// Store store reference. + [DataMember(Name = "storeReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "storeReference")] + public string StoreReference { 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 AccountHolderStoreStatusChangeNotificationContent {\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" NewStatus: ").Append(NewStatus).Append("\n"); + sb.Append(" OldStatus: ").Append(OldStatus).Append("\n"); + sb.Append(" Reason: ").Append(Reason).Append("\n"); + sb.Append(" Store: ").Append(Store).Append("\n"); + sb.Append(" StoreReference: ").Append(StoreReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotification.cs new file mode 100644 index 000000000..25c741efa --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderUpcomingDeadlineNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountHolderUpcomingDeadlineNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderUpcomingDeadlineNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotificationContent.cs new file mode 100644 index 000000000..735acb8cf --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderUpcomingDeadlineNotificationContent.cs @@ -0,0 +1,96 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderUpcomingDeadlineNotificationContent + { + /// + /// The code of the account holder whom the event refers to. + /// + /// The code of the account holder whom the event refers to. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// The event name that will be trigger if no action is taken. + /// + /// The event name that will be trigger if no action is taken. + [DataMember(Name = "event", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "event")] + public string Event { get; set; } + + /// + /// The execution date scheduled for the event. + /// + /// The execution date scheduled for the event. + [DataMember(Name = "executionDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executionDate")] + public DateTime? ExecutionDate { get; set; } + + /// + /// The reason that leads to scheduling of the event. + /// + /// The reason that leads to scheduling of the event. + [DataMember(Name = "reason", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "reason")] + public string Reason { 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 AccountHolderUpcomingDeadlineNotificationContent {\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" Event: ").Append(Event).Append("\n"); + sb.Append(" ExecutionDate: ").Append(ExecutionDate).Append("\n"); + sb.Append(" Reason: ").Append(Reason).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderUpdateNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderUpdateNotification.cs new file mode 100644 index 000000000..6691f8a08 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderUpdateNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderUpdateNotification :IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public UpdateAccountHolderResponse Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderUpdateNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotification.cs b/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotification.cs new file mode 100644 index 000000000..3cf647443 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderVerificationNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public AccountHolderVerificationNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountHolderVerificationNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotificationContent.cs b/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotificationContent.cs new file mode 100644 index 000000000..2cdd83458 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountHolderVerificationNotificationContent.cs @@ -0,0 +1,94 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountHolderVerificationNotificationContent + { + /// + /// The code of the account holder. + /// + /// The code of the account holder. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// Gets or Sets KycCheckStatusData + /// + [DataMember(Name = "kycCheckStatusData", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "kycCheckStatusData")] + public KYCCheckStatusData KycCheckStatusData { get; set; } + + /// + /// The unique code of the payout method that has been verified. + /// + /// The unique code of the payout method that has been verified. + [DataMember(Name = "payoutMethodCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "payoutMethodCode")] + public string PayoutMethodCode { get; set; } + + /// + /// The code of the shareholder that has been verified. + /// + /// The code of the shareholder that has been verified. + [DataMember(Name = "shareholderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "shareholderCode")] + public string ShareholderCode { 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 AccountHolderVerificationNotificationContent {\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" KycCheckStatusData: ").Append(KycCheckStatusData).Append("\n"); + sb.Append(" PayoutMethodCode: ").Append(PayoutMethodCode).Append("\n"); + sb.Append(" ShareholderCode: ").Append(ShareholderCode).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/AccountUpdateNotification.cs b/Adyen/Model/MarketPay/Notification/AccountUpdateNotification.cs new file mode 100644 index 000000000..0ea77bee5 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/AccountUpdateNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class AccountUpdateNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public UpdateAccountResponse Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 AccountUpdateNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotification.cs b/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotification.cs new file mode 100644 index 000000000..cfe970e9c --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class BeneficiarySetupNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public BeneficiarySetupNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 BeneficiarySetupNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotificationContent.cs b/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotificationContent.cs new file mode 100644 index 000000000..cb8d6714e --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/BeneficiarySetupNotificationContent.cs @@ -0,0 +1,125 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class BeneficiarySetupNotificationContent + { + /// + /// The code of the beneficiary account. + /// + /// The code of the beneficiary account. + [DataMember(Name = "destinationAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "destinationAccountCode")] + public string DestinationAccountCode { get; set; } + + /// + /// The code of the beneficiary Account Holder. + /// + /// The code of the beneficiary Account Holder. + [DataMember(Name = "destinationAccountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "destinationAccountHolderCode")] + public string DestinationAccountHolderCode { get; set; } + + /// + /// A listing of the invalid fields which have caused the Setup Beneficiary request to fail. If this is empty, the Setup Beneficiary request has succeeded. + /// + /// A listing of the invalid fields which have caused the Setup Beneficiary request to fail. If this is empty, the Setup Beneficiary request has succeeded. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// The reference provided by the merchant. + /// + /// The reference provided by the merchant. + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantReference")] + public string MerchantReference { get; set; } + + /// + /// The code of the benefactor account. + /// + /// The code of the benefactor account. + [DataMember(Name = "sourceAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "sourceAccountCode")] + public string SourceAccountCode { get; set; } + + /// + /// The code of the benefactor Account Holder. + /// + /// The code of the benefactor Account Holder. + [DataMember(Name = "sourceAccountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "sourceAccountHolderCode")] + public string SourceAccountHolderCode { get; set; } + + /// + /// The date on which the beneficiary was set up and funds transferred from benefactor to beneficiary. + /// + /// The date on which the beneficiary was set up and funds transferred from benefactor to beneficiary. + [DataMember(Name = "transferDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "transferDate")] + public DateTime? TransferDate { 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 BeneficiarySetupNotificationContent {\n"); + sb.Append(" DestinationAccountCode: ").Append(DestinationAccountCode).Append("\n"); + sb.Append(" DestinationAccountHolderCode: ").Append(DestinationAccountHolderCode).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); + sb.Append(" SourceAccountCode: ").Append(SourceAccountCode).Append("\n"); + sb.Append(" SourceAccountHolderCode: ").Append(SourceAccountHolderCode).Append("\n"); + sb.Append(" TransferDate: ").Append(TransferDate).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotification.cs b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotification.cs new file mode 100644 index 000000000..6d46ffc28 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class CompensateNegativeBalanceNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public CompensateNegativeBalanceNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 CompensateNegativeBalanceNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationContent.cs b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationContent.cs new file mode 100644 index 000000000..0b8cda68d --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationContent.cs @@ -0,0 +1,70 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class CompensateNegativeBalanceNotificationContent + { + /// + /// A list of the negative balances compensated. + /// + /// A list of the negative balances compensated. + [DataMember(Name = "records", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "records")] + public List Records { 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 CompensateNegativeBalanceNotificationContent {\n"); + sb.Append(" Records: ").Append(Records.ObjectListToString()).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationRecord.cs b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationRecord.cs new file mode 100644 index 000000000..0ff4346f0 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/CompensateNegativeBalanceNotificationRecord.cs @@ -0,0 +1,86 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class CompensateNegativeBalanceNotificationRecord + { + /// + /// The code of the account whose negative balance has been compensated. + /// + /// The code of the account whose negative balance has been compensated. + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "amount")] + public Amount Amount { get; set; } + + /// + /// The date on which the compensation took place. + /// + /// The date on which the compensation took place. + [DataMember(Name = "transferDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "transferDate")] + public DateTime? TransferDate { 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 CompensateNegativeBalanceNotificationRecord {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" TransferDate: ").Append(TransferDate).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotification.cs b/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotification.cs new file mode 100644 index 000000000..796e281c6 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class DirectDebitInitiatedNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public DirectDebitInitiatedNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 DirectDebitInitiatedNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotificationContent.cs b/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotificationContent.cs new file mode 100644 index 000000000..e48d8ee08 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/DirectDebitInitiatedNotificationContent.cs @@ -0,0 +1,122 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class DirectDebitInitiatedNotificationContent + { + /// + /// The code of the account. + /// + /// The code of the account. + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "amount")] + public Amount Amount { get; set; } + + /// + /// Gets or Sets DebitInitiationDate + /// + [DataMember(Name = "debitInitiationDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "debitInitiationDate")] + public DateTime DebitInitiationDate { get; set; } + + /// + /// Invalid fields list. + /// + /// Invalid fields list. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// The code of the merchant account. + /// + /// The code of the merchant account. + [DataMember(Name = "merchantAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantAccountCode")] + public string MerchantAccountCode { get; set; } + + /// + /// The split data for the debit request + /// + /// The split data for the debit request + [DataMember(Name = "splits", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "splits")] + public List Splits { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "status")] + public OperationStatus Status { 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 DirectDebitInitiatedNotificationContent {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" DebitInitiationDate: ").Append(DebitInitiationDate).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" MerchantAccountCode: ").Append(MerchantAccountCode).Append("\n"); + sb.Append(" Splits: ").Append(Splits.ObjectListToString()).Append("\n"); + sb.Append(" Status: ").Append(Status).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/ErrorFieldTypeContainer.cs b/Adyen/Model/MarketPay/Notification/ErrorFieldTypeContainer.cs new file mode 100644 index 000000000..6e3ce934e --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/ErrorFieldTypeContainer.cs @@ -0,0 +1,39 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion +using Newtonsoft.Json; +using System.Runtime.Serialization; + +namespace Adyen.Model.MarketPay.Notification +{ + public class ErrorFieldTypeContainer + { + /// + /// The code of the account. + /// + /// The code of the account. + [DataMember(Name = "errorFieldType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "errorFieldType")] + public ErrorFieldType ErrorFieldType { get; set; } + } +} diff --git a/Adyen/Model/MarketPay/Notification/IGenericNotification.cs b/Adyen/Model/MarketPay/Notification/IGenericNotification.cs new file mode 100644 index 000000000..b2ae3ba74 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/IGenericNotification.cs @@ -0,0 +1,30 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +namespace Adyen.Model.MarketPay.Notification +{ + public interface IGenericNotification + { + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/LocalDate.cs b/Adyen/Model/MarketPay/Notification/LocalDate.cs new file mode 100644 index 000000000..9efafb410 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/LocalDate.cs @@ -0,0 +1,75 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class LocalDate + { + /// + /// Gets or Sets Month + /// + [DataMember(Name = "month", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "month")] + public int? Month { get; set; } + + /// + /// Gets or Sets Year + /// + [DataMember(Name = "year", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "year")] + public int? Year { 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 LocalDate {\n"); + sb.Append(" Month: ").Append(Month).Append("\n"); + sb.Append(" Year: ").Append(Year).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/Message.cs b/Adyen/Model/MarketPay/Notification/Message.cs new file mode 100644 index 000000000..8fadfed40 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/Message.cs @@ -0,0 +1,77 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class Message + { + /// + /// The message code. + /// + /// The message code. + [DataMember(Name = "code", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// The message text. + /// + /// The message text. + [DataMember(Name = "text", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "text")] + public string Text { 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 Message {\n"); + sb.Append(" Code: ").Append(Code).Append("\n"); + sb.Append(" Text: ").Append(Text).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/NotificationErrorContainer.cs b/Adyen/Model/MarketPay/Notification/NotificationErrorContainer.cs new file mode 100644 index 000000000..982a3fa20 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/NotificationErrorContainer.cs @@ -0,0 +1,77 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class NotificationErrorContainer + { + /// + /// The Adyen code that is mapped to the error message. + /// + /// The Adyen code that is mapped to the error message. + [DataMember(Name = "errorCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; set; } + + /// + /// A short explanation of the issue. + /// + /// A short explanation of the issue. + [DataMember(Name = "message", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "message")] + public string Message { 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 NotificationErrorContainer {\n"); + sb.Append(" ErrorCode: ").Append(ErrorCode).Append("\n"); + sb.Append(" Message: ").Append(Message).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/OperationStatus.cs b/Adyen/Model/MarketPay/Notification/OperationStatus.cs new file mode 100644 index 000000000..99dfc940f --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/OperationStatus.cs @@ -0,0 +1,76 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class OperationStatus + { + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "message")] + public Message Message { get; set; } + + /// + /// The status code. + /// + /// The status code. + [DataMember(Name = "statusCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "statusCode")] + public string StatusCode { 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 OperationStatus {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" StatusCode: ").Append(StatusCode).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/PaymentFailureNotification.cs b/Adyen/Model/MarketPay/Notification/PaymentFailureNotification.cs new file mode 100644 index 000000000..14f9b1879 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/PaymentFailureNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class PaymentFailureNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public PaymentFailureNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 PaymentFailureNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/PaymentFailureNotificationContent.cs b/Adyen/Model/MarketPay/Notification/PaymentFailureNotificationContent.cs new file mode 100644 index 000000000..bb6b13180 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/PaymentFailureNotificationContent.cs @@ -0,0 +1,114 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class PaymentFailureNotificationContent + { + /// + /// Missing or invalid fields that caused the payment error. + /// + /// Missing or invalid fields that caused the payment error. + [DataMember(Name = "errorFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "errorFields")] + public List ErrorFields { get; set; } + + /// + /// Gets or Sets ErrorMessage + /// + [DataMember(Name = "errorMessage", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "errorMessage")] + public Message ErrorMessage { get; set; } + + /// + /// The modification merchant reference. + /// + /// The modification merchant reference. + [DataMember(Name = "modificationMerchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "modificationMerchantReference")] + public string ModificationMerchantReference { get; set; } + + /// + /// The modification psp reference. + /// + /// The modification psp reference. + [DataMember(Name = "modificationPspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "modificationPspReference")] + public string ModificationPspReference { get; set; } + + /// + /// The payment merchant reference. + /// + /// The payment merchant reference. + [DataMember(Name = "paymentMerchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "paymentMerchantReference")] + public string PaymentMerchantReference { get; set; } + + /// + /// The payment psp reference. + /// + /// The payment psp reference. + [DataMember(Name = "paymentPspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "paymentPspReference")] + public string PaymentPspReference { 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 PaymentFailureNotificationContent {\n"); + sb.Append(" ErrorFields: ").Append(ErrorFields.ObjectListToString()).Append("\n"); + sb.Append(" ErrorMessage: ").Append(ErrorMessage).Append("\n"); + sb.Append(" ModificationMerchantReference: ").Append(ModificationMerchantReference).Append("\n"); + sb.Append(" ModificationPspReference: ").Append(ModificationPspReference).Append("\n"); + sb.Append(" PaymentMerchantReference: ").Append(PaymentMerchantReference).Append("\n"); + sb.Append(" PaymentPspReference: ").Append(PaymentPspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotification.cs b/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotification.cs new file mode 100644 index 000000000..9f7e277e2 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class RefundFundsTransferNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public RefundFundsTransferNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 RefundFundsTransferNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotificationContent.cs b/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotificationContent.cs new file mode 100644 index 000000000..26eaaccba --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/RefundFundsTransferNotificationContent.cs @@ -0,0 +1,104 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class RefundFundsTransferNotificationContent + { + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "amount")] + public Amount Amount { get; set; } + + /// + /// Invalid fields list. + /// + /// Invalid fields list. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// A value that can be supplied at the discretion of the executing user in order to link multiple transactions to one another. + /// + /// A value that can be supplied at the discretion of the executing user in order to link multiple transactions to one another. + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantReference")] + public string MerchantReference { get; set; } + + /// + /// A PSP reference of the original fund transfer. + /// + /// A PSP reference of the original fund transfer. + [DataMember(Name = "originalReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "originalReference")] + public string OriginalReference { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "status")] + public OperationStatus Status { 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 RefundFundsTransferNotificationContent {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); + sb.Append(" OriginalReference: ").Append(OriginalReference).Append("\n"); + sb.Append(" Status: ").Append(Status).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/RefundResult.cs b/Adyen/Model/MarketPay/Notification/RefundResult.cs new file mode 100644 index 000000000..fa49f4de1 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/RefundResult.cs @@ -0,0 +1,85 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class RefundResult + { + /// + /// Gets or Sets OriginalTransaction + /// + [DataMember(Name = "originalTransaction", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "originalTransaction")] + public Transaction OriginalTransaction { get; set; } + + /// + /// The reference of the refund. + /// + /// The reference of the refund. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { get; set; } + + /// + /// The response indicating if the refund has been received for processing. + /// + /// The response indicating if the refund has been received for processing. + [DataMember(Name = "response", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "response")] + public string Response { 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 RefundResult {\n"); + sb.Append(" OriginalTransaction: ").Append(OriginalTransaction).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).Append("\n"); + sb.Append(" Response: ").Append(Response).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/RefundResultContainer.cs b/Adyen/Model/MarketPay/Notification/RefundResultContainer.cs new file mode 100644 index 000000000..20d9c022f --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/RefundResultContainer.cs @@ -0,0 +1,39 @@ +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +using Newtonsoft.Json; +using System.Runtime.Serialization; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class RefundResultContainer + { + /// + /// Gets or Sets OriginalTransaction + /// + [DataMember(Name = "RefundResult", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "RefundResult")] + public RefundResult RefundResult { get; set; } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/ReportAvailableNotification.cs b/Adyen/Model/MarketPay/Notification/ReportAvailableNotification.cs new file mode 100644 index 000000000..3b08490f1 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/ReportAvailableNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class ReportAvailableNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public ReportAvailableNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 ReportAvailableNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/ReportAvailableNotificationContent.cs b/Adyen/Model/MarketPay/Notification/ReportAvailableNotificationContent.cs new file mode 100644 index 000000000..f9c245f40 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/ReportAvailableNotificationContent.cs @@ -0,0 +1,105 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class ReportAvailableNotificationContent + { + /// + /// The code of the Account to which the report applies. + /// + /// The code of the Account to which the report applies. + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// The type of Account to which the report applies. + /// + /// The type of Account to which the report applies. + [DataMember(Name = "accountType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountType")] + public string AccountType { get; set; } + + /// + /// The date of the event to which the report applies. + /// + /// The date of the event to which the report applies. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The URL at which the report can be accessed. + /// + /// The URL at which the report can be accessed. + [DataMember(Name = "remoteAccessUrl", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "remoteAccessUrl")] + public string RemoteAccessUrl { get; set; } + + /// + /// Indicates whether the event resulted in a success. + /// + /// Indicates whether the event resulted in a success. + [DataMember(Name = "success", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "success")] + public bool? Success { 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 ReportAvailableNotificationContent {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" AccountType: ").Append(AccountType).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" RemoteAccessUrl: ").Append(RemoteAccessUrl).Append("\n"); + sb.Append(" Success: ").Append(Success).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotification.cs b/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotification.cs new file mode 100644 index 000000000..9464074bf --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class ScheduledRefundsNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public ScheduledRefundsNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 ScheduledRefundsNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotificationContent.cs b/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotificationContent.cs new file mode 100644 index 000000000..06ffb4ef5 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/ScheduledRefundsNotificationContent.cs @@ -0,0 +1,105 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class ScheduledRefundsNotificationContent + { + /// + /// The code of the account. + /// + /// The code of the account. + [DataMember(Name = "accountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountCode")] + public string AccountCode { get; set; } + + /// + /// The code of the Account Holder. + /// + /// The code of the Account Holder. + [DataMember(Name = "accountHolderCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "accountHolderCode")] + public string AccountHolderCode { get; set; } + + /// + /// Invalid fields list. + /// + /// Invalid fields list. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// Gets or Sets LastPayout + /// + [DataMember(Name = "lastPayout", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "lastPayout")] + public Transaction LastPayout { get; set; } + + /// + /// A list of the refunds that have been scheduled and their results. + /// + /// A list of the refunds that have been scheduled and their results. + [DataMember(Name = "refundResults", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "refundResults")] + public List RefundResults { 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 ScheduledRefundsNotificationContent {\n"); + sb.Append(" AccountCode: ").Append(AccountCode).Append("\n"); + sb.Append(" AccountHolderCode: ").Append(AccountHolderCode).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" LastPayout: ").Append(LastPayout).Append("\n"); + sb.Append(" RefundResults: ").Append(RefundResults.ObjectListToString()).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/TransferFundsNotification.cs b/Adyen/Model/MarketPay/Notification/TransferFundsNotification.cs new file mode 100644 index 000000000..238312a88 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/TransferFundsNotification.cs @@ -0,0 +1,121 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class TransferFundsNotification : IGenericNotification + { + /// + /// Gets or Sets Content + /// + [DataMember(Name = "content", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "content")] + public TransferFundsNotificationContent Content { get; set; } + + /// + /// Gets or Sets Error + /// + [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "error")] + public NotificationErrorContainer Error { get; set; } + + /// + /// The date and time when an event has been completed. + /// + /// The date and time when an event has been completed. + [DataMember(Name = "eventDate", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventDate")] + public DateTime? EventDate { get; set; } + + /// + /// The event type of the notification. + /// + /// The event type of the notification. + [DataMember(Name = "eventType", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "eventType")] + public string EventType { get; set; } + + /// + /// The user or process that has triggered the notification. + /// + /// The user or process that has triggered the notification. + [DataMember(Name = "executingUserKey", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "executingUserKey")] + public string ExecutingUserKey { get; set; } + + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + /// + /// Indicates whether the notification originated from the live environment or the test environment. If true, the notification originated from the live environment. If false, the notification originated from the test environment. + [DataMember(Name = "live", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "live")] + public bool? Live { get; set; } + + /// + /// The PSP reference of the request from which the notification originates. + /// + /// The PSP reference of the request from which the notification originates. + [DataMember(Name = "pspReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "pspReference")] + public string PspReference { 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 TransferFundsNotification {\n"); + sb.Append(" Content: ").Append(Content).Append("\n"); + sb.Append(" Error: ").Append(Error).Append("\n"); + sb.Append(" EventDate: ").Append(EventDate).Append("\n"); + sb.Append(" EventType: ").Append(EventType).Append("\n"); + sb.Append(" ExecutingUserKey: ").Append(ExecutingUserKey).Append("\n"); + sb.Append(" Live: ").Append(Live).Append("\n"); + sb.Append(" PspReference: ").Append(PspReference).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Model/MarketPay/Notification/TransferFundsNotificationContent.cs b/Adyen/Model/MarketPay/Notification/TransferFundsNotificationContent.cs new file mode 100644 index 000000000..fbb72fa29 --- /dev/null +++ b/Adyen/Model/MarketPay/Notification/TransferFundsNotificationContent.cs @@ -0,0 +1,122 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Adyen.Util; +using Newtonsoft.Json; + +namespace Adyen.Model.MarketPay.Notification +{ + /// + /// + /// + [DataContract] + public class TransferFundsNotificationContent + { + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "amount")] + public Amount Amount { get; set; } + + /// + /// The code of the Account to which funds were credited. + /// + /// The code of the Account to which funds were credited. + [DataMember(Name = "destinationAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "destinationAccountCode")] + public string DestinationAccountCode { get; set; } + + /// + /// Invalid fields list. + /// + /// Invalid fields list. + [DataMember(Name = "invalidFields", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "invalidFields")] + public List InvalidFields { get; set; } + + /// + /// The reference provided by the merchant. + /// + /// The reference provided by the merchant. + [DataMember(Name = "merchantReference", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "merchantReference")] + public string MerchantReference { get; set; } + + /// + /// The code of the Account from which funds were debited. + /// + /// The code of the Account from which funds were debited. + [DataMember(Name = "sourceAccountCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "sourceAccountCode")] + public string SourceAccountCode { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "status")] + public OperationStatus Status { get; set; } + + /// + /// The transfer code. + /// + /// The transfer code. + [DataMember(Name = "transferCode", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "transferCode")] + public string TransferCode { 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 TransferFundsNotificationContent {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" DestinationAccountCode: ").Append(DestinationAccountCode).Append("\n"); + sb.Append(" InvalidFields: ").Append(InvalidFields.ObjectListToString()).Append("\n"); + sb.Append(" MerchantReference: ").Append(MerchantReference).Append("\n"); + sb.Append(" SourceAccountCode: ").Append(SourceAccountCode).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" TransferCode: ").Append(TransferCode).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); + } + } +} \ No newline at end of file diff --git a/Adyen/Notification/NotificationHandler.cs b/Adyen/Notification/NotificationHandler.cs index 44c27e6a9..5be3a9338 100644 --- a/Adyen/Notification/NotificationHandler.cs +++ b/Adyen/Notification/NotificationHandler.cs @@ -21,6 +21,7 @@ // */ #endregion +using Adyen.Model.MarketPay.Notification; using Adyen.Model.Notification; using Adyen.Util; @@ -32,5 +33,10 @@ public NotificationRequest HandleNotificationRequest(string jsonRequest) { return JsonOperation.Deserialize(jsonRequest); } + + public IGenericNotification HandleMarketpayNotificationJson(string jsonRequest) + { + return Util.JsonOperation.Deserialize(jsonRequest); + } } } diff --git a/Adyen/Util/JsonOperation.cs b/Adyen/Util/JsonOperation.cs index 21e066285..457ff9381 100644 --- a/Adyen/Util/JsonOperation.cs +++ b/Adyen/Util/JsonOperation.cs @@ -39,6 +39,8 @@ public static T Deserialize(string response) jsonSettings.Converters.Add(new ByteArrayConverter()); jsonSettings.Converters.Add(new PaymentMethodDetailsConverter()); jsonSettings.Converters.Add(new PaymentResponseActionConverter()); + jsonSettings.Converters.Add(new MarketPayNotificationConverter()); + return JsonConvert.DeserializeObject(response, jsonSettings); } diff --git a/Adyen/Util/MarketPayNotificationConverter.cs b/Adyen/Util/MarketPayNotificationConverter.cs new file mode 100644 index 000000000..dd8ad7b23 --- /dev/null +++ b/Adyen/Util/MarketPayNotificationConverter.cs @@ -0,0 +1,115 @@ +#region Licence + +// +// ###### +// ###### +// ############ ####( ###### #####. ###### ############ ############ +// ############# #####( ###### #####. ###### ############# ############# +// ###### #####( ###### #####. ###### ##### ###### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### +// ###### ###### #####( ###### #####. ###### ##### ##### ###### +// ############# ############# ############# ############# ##### ###### +// ############ ############ ############# ############ ##### ###### +// ###### +// ############# +// ############ +// +// Adyen Dotnet API Library +// +// Copyright (c) 2021 Adyen B.V. +// This file is open source and available under the MIT license. +// See the LICENSE file for more info. + +#endregion + +using System; +using Adyen.Model.MarketPay.Notification; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Adyen.Util +{ + internal class MarketPayNotificationConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return objectType == typeof(IGenericNotification); + } + 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 notification = default(IGenericNotification); + switch (jsonObject["eventType"].ToString()) + { + case "ACCOUNT_CREATED": + notification = new AccountCreateNotification(); + break; + case "ACCOUNT_CLOSED": + notification = new AccountCloseNotification(); + break; + case "ACCOUNT_UPDATED": + notification = new AccountUpdateNotification(); + break; + case "ACCOUNT_FUNDS_BELOW_THRESHOLD": + notification = new AccountFundsBelowThresholdNotification(); + break; + case "ACCOUNT_HOLDER_CREATED": + notification = new AccountHolderCreateNotification(); + break; + case "ACCOUNT_HOLDER_VERIFICATION": + notification = new AccountHolderVerificationNotification(); + break; + case "ACCOUNT_HOLDER_STATUS_CHANGE": + notification = new AccountHolderStatusChangeNotification(); + break; + case "ACCOUNT_HOLDER_PAYOUT": + notification = new AccountHolderPayoutNotification(); + break; + case "ACCOUNT_HOLDER_UPDATED": + notification = new AccountHolderUpdateNotification(); + break; + case "ACCOUNT_HOLDER_STORE_STATUS_CHANGE": + notification = new AccountHolderStoreStatusChangeNotification(); + break; + case "ACCOUNT_HOLDER_UPCOMING_DEADLINE": + notification = new AccountHolderUpcomingDeadlineNotification(); + break; + case "BENEFICIARY_SETUP": + notification = new BeneficiarySetupNotification(); + break; + case "SCHEDULED_REFUNDS": + notification = new ScheduledRefundsNotification(); + break; + case "COMPENSATE_NEGATIVE_BALANCE": + notification = new CompensateNegativeBalanceNotification(); + break; + case "PAYMENT_FAILURE": + notification = new PaymentFailureNotification(); + break; + case "REPORT_AVAILABLE": + notification = new ReportAvailableNotification(); + break; + case "TRANSFER_FUNDS": + notification = new TransferFundsNotification(); + break; + case "DIRECT_DEBIT_INITIATED": + notification = new DirectDebitInitiatedNotification(); + break; + case "REFUND_FUNDS_TRANSFER": + notification = new RefundFundsTransferNotification(); + break; + } + + serializer.Populate(jsonObject.CreateReader(), notification); + return notification; + } + } +} \ No newline at end of file From 256e11194e8997c73bf40cd0977c7cb4f061a742 Mon Sep 17 00:00:00 2001 From: alexandros Date: Thu, 6 May 2021 15:25:55 +0200 Subject: [PATCH 4/4] Bump the version --- Adyen.Test/Adyen.Test.csproj | 6 +++--- Adyen/Adyen.csproj | 8 ++++---- Adyen/Constants/ClientConfig.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index bb73cc7bb..35ea9b359 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -5,11 +5,11 @@ false - 7.0.0 + 7.1.0 - 7.0.0 + 7.1.0 - 7.0.0 + 7.1.0 7.2 diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 493dcf13d..fbdd8e368 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -4,15 +4,15 @@ netstandard2.0 false Adyen - 7.0.0 - 7.0.0 - 7.0.0 + 7.1.0 + 7.1.0 + 7.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 - 7.0.0 + 7.1.0 MIT Adyen Adyen diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index a388dd149..f7e80bf09 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -53,6 +53,6 @@ public class ClientConfig public static string BinLookupApiVersion = "v50"; public static string LibName = "adyen-dotnet-api-library"; - public static string LibVersion = "7.0.0"; + public static string LibVersion = "7.1.0"; } }