From 34f4379f720a9a58235e1b86a53bc09f235e2c0b Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Wed, 4 Aug 2021 19:48:57 +0200 Subject: [PATCH 01/12] [PW-4729] Add region based cloud api endpoints (#479) * Add region based cloud api endpoints * Correct Endpoint to CloudApiEndPoint * Revert helper method * Remone /sync and /async as it is added by terminal api * Update README.md Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> * Update Adyen/Constants/ClientConfig.cs Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> --- Adyen.Test/BaseTest.cs | 2 +- Adyen/Client.cs | 6 +++--- Adyen/Constants/ClientConfig.cs | 7 ++++++- README.md | 21 +++++++++++++++++---- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Adyen.Test/BaseTest.cs b/Adyen.Test/BaseTest.cs index 4c1454cc1..41c04f44f 100644 --- a/Adyen.Test/BaseTest.cs +++ b/Adyen.Test/BaseTest.cs @@ -320,7 +320,7 @@ protected Client CreateAsyncMockTestClientApiKeyBasedRequest(string fileName) /// <returns>IClient implementation</returns> protected Client CreateMockTestClientPosCloudApiRequest(string fileName) { - var config = new Config { Endpoint = ClientConfig.CloudApiEndPointTest }; + var config = new Config { CloudApiEndPoint = ClientConfig.CloudApiEndPointTest }; var mockPath = GetMockFilePath(fileName); var response = MockFileToString(mockPath); //Create a mock interface diff --git a/Adyen/Client.cs b/Adyen/Client.cs index 26ef872c8..5a27f82a5 100644 --- a/Adyen/Client.cs +++ b/Adyen/Client.cs @@ -51,7 +51,7 @@ public Client(string username, string password, Environment environment) }; this.SetEnvironment(environment); } - + public Client(string xapikey, Environment environment) { Config = new Config @@ -69,7 +69,7 @@ public Client(string xapikey, Environment environment, string liveEndpointUrlPre Environment = environment, XApiKey = xapikey }; - this.SetEnvironment(environment,liveEndpointUrlPrefix); + this.SetEnvironment(environment, liveEndpointUrlPrefix); } public Client(Config config) @@ -103,7 +103,7 @@ public void SetEnvironment(Environment environment, string liveEndpointUrlPrefix Config.Endpoint = ClientConfig.EndpointProtocol + liveEndpointUrlPrefix + ClientConfig.EndpointLiveSuffix; Config.HppEndpoint = ClientConfig.HppLive; - Config.CloudApiEndPoint = ClientConfig.CloudApiEndPointLive; + Config.CloudApiEndPoint = ClientConfig.CloudApiEndPointEULive; Config.CheckoutEndpoint = ClientConfig.EndpointProtocol + liveEndpointUrlPrefix + ClientConfig.CheckoutEndpointLiveSuffix; Config.MarketPayEndpoint = ClientConfig.MarketpayEndPointLive; Config.PosTerminalManagementEndpoint = ClientConfig.PosTerminalManagementEndpointLive; diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index 876d319ae..cbfa4eba1 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -32,8 +32,13 @@ public class ClientConfig public static string HppLive = "https://live.adyen.com/hpp"; public static string CheckoutEndpointTest = "https://checkout-test.adyen.com"; public static string CheckoutEndpointLiveSuffix = "-checkout-live.adyenpayments.com/checkout"; + //Test cloud api endpoints public static string CloudApiEndPointTest = "https://terminal-api-test.adyen.com"; - public static string CloudApiEndPointLive = "https://terminal-api-live.adyen.com"; + //Live cloud api endpoints + public static string CloudApiEndPointEULive = "https://terminal-api-live.adyen.com"; + public static string CloudApiEndPointAULive = "https://terminal-api-live-au.adyen.com"; + public static string CloudApiEndPointUSLive = "https://terminal-api-live-us.adyen.com"; + public static string MarketpayEndPointTest = "https://cal-test.adyen.com/cal/services"; public static string MarketpayEndPointLive = "https://cal-live.adyen.com/cal/services"; public static string PosTerminalManagementEndpointTest = "https://postfmapi-test.adyen.com/postfmapi/terminal"; diff --git a/README.md b/README.md index 56e2f0f36..8e3c60edd 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ The library supports all APIs under the following services: * [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. +* [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** + * [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** +* [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/). @@ -32,7 +32,7 @@ For more information, refer to our [documentation](https://docs.adyen.com/) or t ## Installation Simply download and restore nuget packages https://www.nuget.org/packages/Adyen/ -or install it from package manager +or install it from package manager ~~~~ bash PM> Install-Package Adyen -Version x.x.x ~~~~ @@ -72,6 +72,19 @@ dotnet build dotnet test ~~~~ +### Using the Cloud API for post +In order to submit POS request with Cloud API you need to initialize the client with the Endpoints that it is closer to your region. The Endpoints are available as contacts in [ClientConfig](https://github.com/Adyen/adyen-dotnet-api-library/blob/develop/Adyen/Constants/ClientConfig.cs#L35) +For more information please read our [documentation](https://docs.adyen.com/point-of-sale/terminal-api-fundamentals#cloud) +~~~~ csharp +//Example for EU based Endpoint Syncronous +var config = new Config + { + XApiKey = "Your merchant XAPI key", + CloudApiEndPoint = ClientConfig.CloudApiEndPointEULive + }; +var client = new Client(config); +~~~~ + ## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. From d359dd759b11d77731ccd8a7b4e3a0c680547e99 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Wed, 4 Aug 2021 19:49:20 +0200 Subject: [PATCH 02/12] Add more constants for additional data (#476) * [PW-3744] Release 6.0.0 (#361) * [PW-2298]Remove the travis file (#327) * Remove the travis file * Update README.md * Update .gitignore (#331) * Bump Moq from 4.14.5 to 4.14.6 (#329) Bumps [Moq](https://github.com/moq/moq4) from 4.14.5 to 4.14.6. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](https://github.com/moq/moq4/compare/v4.14.5...v4.14.6) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update dependency Moq to v4.14.6 (#328) * Update dependency Moq to v4.14.7 (#334) * [PW-3266] Add BACS direct debit details class (#335) * Add bacs direct debit * Change EUR to GBP This change is because the bacs is applicable only in GB * Add RecurringProcessingModel to CreatePaymentLinkRequest (#337) * Add RecurringProcessingModel to CreatePaymentLinkRequest. * Add unit test for addition of RecurringProcessingModel to CreatePaymentLinkRequest. * Bump System.ComponentModel.Annotations from 4.7.0 to 5.0.0 (#341) Bumps [System.ComponentModel.Annotations](https://github.com/dotnet/runtime) from 4.7.0 to 5.0.0. - [Release notes](https://github.com/dotnet/runtime/releases) - [Commits](https://github.com/dotnet/runtime/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update dependency System.ComponentModel.Annotations to v5 (#340) * Bump Moq from 4.14.7 to 4.15.1 (#343) Bumps [Moq](https://github.com/moq/moq4) from 4.14.7 to 4.15.1. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](https://github.com/moq/moq4/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Correct the property name for Apple Pay tokens (#338) * Corrects the property name for Apple Pay tokens * Adds test to confirm can deserialize paymentmethod. * [PW-2640] Deserialize the response of dropin into the correct paymentMethod model (#347) * Add the payment method details json deserializer * Rename PaymentMethodDetailsConverter * Update Adyen/Util/PaymentMethodDetailsConverter.cs Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> * Add optional RequestOptions object to PaymentDetails calls (same as existing Payments call) so that the idempotency key can be passed to the API in order to prevent duplicates. (#346) * [PW-3125] Rename namespace Adyen.CloudApiSerialization to Adyen.ApiSerialization (#349) * Rename namespace Adyen.CloudApiSerialization to Adyen.Serialization * Rename namespace Serialization to ApiSerialization * [PW-2616]Test the escape string with encryption (#353) * Test the escape string with encryption * Apply suggestions from code review Remove underscore from internal method * Bump Moq from 4.15.1 to 4.15.2 (#351) Bumps [Moq](https://github.com/moq/moq4) from 4.15.1 to 4.15.2. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](https://github.com/moq/moq4/commits/v4.15.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update dependency Moq to v4.15.2 (#350) * Add async version of Recurring.ListRecurringDetails (#344) * Add async version of Recurring.ListRecurringDetails * Add unit test for ListRecurringDetailsAsync Co-authored-by: Karol Grodzicki <karol.grodzicki@speeron.com> * Add paypal unit test (#355) * Add paypal unit test * Apply suggestions from code review * Add shopper locale to GetOnboardingUrlRequest (#360) * [PW-3441]- Update to version 66 (#359) * Commit the models from v65 to compare * Add the draft models to be able to modify them * Add the license header * Add deserializer for action respone, add details folder * Add the rest paymentmethods * Finalize payment methods details methods json converter * Add the PaymentResponse action Json Converter * Move the actions payment response classes to action folder * Update the library checkout version * Remove additional data classes * Fix the unit tests * Revert class names similar to endpoints * Remove autogenerated class OneOfPaymentResponseAction * Remove the redundant application fields * Remove oneof autogenerated class * Update test project to 2.1 dotnetcore, fix the multibanco test * Update dotnetcore.yml Update to test with 2.1 dotnet core version * Update Adyen.Test.csproj * Update Adyen.Test.csproj * Update dotnetcore.yml * Update Adyen.Test.csproj * Update dotnetcore.yml * Update Adyen.Test.csproj * Correct the string representation in checkout classes using extensions * Correct more in checkout the string representation inclasses using extensions * Correct last class in checkout the string representation using extensions * Correct PaymentResponse in checkout the string representation using extensions * Update README.md * Add MobilePayDetails and UpiDetails to json converter * Add CheckoutThreeDS2Action to the action json converter * Originkeys endpoint uses checkout CheckoutUtilityRequest and CheckoutUtilityResponse * Move origin keys endpoint to checkout * Bump the version 6.0.0 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: WhiteSource Renovate <bot@renovateapp.com> Co-authored-by: gtodde <giulia.todde@overapp.it> Co-authored-by: James Simm <587226+jimmah@users.noreply.github.com> Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> Co-authored-by: Ryan O'Neill <r@ryanoneill.com> Co-authored-by: qj0n <karol.gro@gmail.com> Co-authored-by: Karol Grodzicki <karol.grodzicki@speeron.com> * Revert "[PW-3744] Release 6.0.0 (#361)" This reverts commit 9746f0dbddea1a55b4cff7f0da38c6aade6f8d07. * Update constants for additional data * Apply suggestions from code review * Remove custom constants for additional data Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: WhiteSource Renovate <bot@renovateapp.com> Co-authored-by: gtodde <giulia.todde@overapp.it> Co-authored-by: James Simm <587226+jimmah@users.noreply.github.com> Co-authored-by: Alessio Zampatti <alessio.zampatti@adyen.com> Co-authored-by: Ryan O'Neill <r@ryanoneill.com> Co-authored-by: qj0n <karol.gro@gmail.com> Co-authored-by: Karol Grodzicki <karol.grodzicki@speeron.com> --- Adyen/Constants/AdditionalData.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Adyen/Constants/AdditionalData.cs b/Adyen/Constants/AdditionalData.cs index 485ed3536..72c7662c9 100644 --- a/Adyen/Constants/AdditionalData.cs +++ b/Adyen/Constants/AdditionalData.cs @@ -46,5 +46,7 @@ public class AdditionalData public const string RecurringShopperReference = "recurring.shopperReference"; public const string RecurringDetailReference = "recurring.recurringDetailReference"; public const string AllowThreeDS2 = "allow3DS2"; + public const string PaymentLinkId = "paymentLinkId"; + public const string MerchantOrderReference = "merchantOrderReference"; } } From f114b179e35c799c661064a762cb845c4ad57eff Mon Sep 17 00:00:00 2001 From: Deepu K Sasidharan <d4udts@gmail.com> Date: Mon, 6 Sep 2021 07:49:34 +0200 Subject: [PATCH 03/12] Update CODEOWNERS (#491) --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f1fb42139..b9f999d01 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek @deepu105 +* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek From 4012c81888bce33b4de8ec32b63bf9f0b2675d0f Mon Sep 17 00:00:00 2001 From: bobesh77 <90173783+bobesh77@users.noreply.github.com> Date: Tue, 14 Sep 2021 15:48:46 +0200 Subject: [PATCH 04/12] Update PaymentResponse.cs (#494) * Update PaymentResponse.cs * Update PaymentDetailResponse Added missing value in ResultCodeEnum * Update PaymentDetailsResponse.cs * Update PaymentResponse.cs --- Adyen/Model/Checkout/PaymentDetailsResponse.cs | 6 +++++- Adyen/Model/Checkout/PaymentResponse.cs | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Adyen/Model/Checkout/PaymentDetailsResponse.cs b/Adyen/Model/Checkout/PaymentDetailsResponse.cs index ad633d506..4317ce98d 100644 --- a/Adyen/Model/Checkout/PaymentDetailsResponse.cs +++ b/Adyen/Model/Checkout/PaymentDetailsResponse.cs @@ -107,7 +107,11 @@ public enum ResultCodeEnum /// Enum Success for value: Success /// </summary> [EnumMember(Value = "Success")] - Success = 12 + Success = 12, + /// <summary> + /// Enum Refused for value: AuthenticationNotRequired + /// </summary> + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 13 } /// <summary> /// The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. diff --git a/Adyen/Model/Checkout/PaymentResponse.cs b/Adyen/Model/Checkout/PaymentResponse.cs index 93d8cccc3..97d59c324 100644 --- a/Adyen/Model/Checkout/PaymentResponse.cs +++ b/Adyen/Model/Checkout/PaymentResponse.cs @@ -101,7 +101,12 @@ public enum ResultCodeEnum /// <summary> /// Enum Refused for value: Refused /// </summary> - [EnumMember(Value = "Refused")] Refused = 11 + [EnumMember(Value = "Refused")] Refused = 11, + + /// <summary> + /// Enum Refused for value: AuthenticationNotRequired + /// </summary> + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 12, } /// <summary> @@ -460,4 +465,4 @@ public override int GetHashCode() yield break; } } -} \ No newline at end of file +} From 7454e22200b1946f943f137c834992a7ad40ce7d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate <bot@renovateapp.com> Date: Wed, 15 Sep 2021 08:15:12 +0200 Subject: [PATCH 05/12] Update mstest monorepo to v2.2.7 (#485) --- Adyen.Test/Adyen.Test.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index 235026765..90f5747fb 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -36,9 +36,9 @@ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" /> <PackageReference Include="Moq" Version="4.16.1" /> - <PackageReference Include="MSTest.TestAdapter" Version="2.2.5" /> + <PackageReference Include="MSTest.TestAdapter" Version="2.2.7" /> - <PackageReference Include="MSTest.TestFramework" Version="2.2.5" /> + <PackageReference Include="MSTest.TestFramework" Version="2.2.7" /> </ItemGroup> <ItemGroup> From c3d2ee738c7aa248623eb22827568d31b4b518b5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate <bot@renovateapp.com> Date: Wed, 15 Sep 2021 08:16:34 +0200 Subject: [PATCH 06/12] Update dependency Microsoft.NET.Test.Sdk to v16.11.0 (#483) --- Adyen.Test/Adyen.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index 90f5747fb..a823c63c8 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -33,7 +33,7 @@ </ItemGroup> <ItemGroup> - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> <PackageReference Include="Moq" Version="4.16.1" /> <PackageReference Include="MSTest.TestAdapter" Version="2.2.7" /> From 361ae88c02e0e904b39acd7647466ba95f94ae4a Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Wed, 15 Sep 2021 14:41:19 +0300 Subject: [PATCH 07/12] Update CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b9f999d01..7d4c07a1d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek +* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek @zaiddreakh @wboereboom From dc4e0e4e23a7c46bbbbcd12f6ec990e8ba6222c1 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Thu, 16 Sep 2021 17:53:19 +0300 Subject: [PATCH 08/12] Modify the PaymentMethodDetailsConverter to public class (#497) --- Adyen/Util/PaymentMethodDetailsConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adyen/Util/PaymentMethodDetailsConverter.cs b/Adyen/Util/PaymentMethodDetailsConverter.cs index 904a7fbae..266d8a8be 100644 --- a/Adyen/Util/PaymentMethodDetailsConverter.cs +++ b/Adyen/Util/PaymentMethodDetailsConverter.cs @@ -28,7 +28,7 @@ namespace Adyen.Util { - internal class PaymentMethodDetailsConverter : JsonConverter + public class PaymentMethodDetailsConverter : JsonConverter { public override bool CanConvert(Type objectType) { From aa9be36facf5d05aafddf55c550a0e72efb65b10 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Thu, 16 Sep 2021 17:53:35 +0300 Subject: [PATCH 09/12] Remove null check CreateAccountHolderResponse.cs (#496) --- Adyen/Model/MarketPay/CreateAccountHolderResponse.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Adyen/Model/MarketPay/CreateAccountHolderResponse.cs b/Adyen/Model/MarketPay/CreateAccountHolderResponse.cs index 43f6861e0..a56ec77b0 100644 --- a/Adyen/Model/MarketPay/CreateAccountHolderResponse.cs +++ b/Adyen/Model/MarketPay/CreateAccountHolderResponse.cs @@ -88,15 +88,7 @@ public enum LegalEntityEnum /// <param name="verification">verification (required).</param> public CreateAccountHolderResponse(string accountCode = default(string), string accountHolderCode = default(string), AccountHolderDetails accountHolderDetails = default(AccountHolderDetails), AccountHolderStatus accountHolderStatus = default(AccountHolderStatus), string description = default(string), List<ErrorFieldType> invalidFields = default(List<ErrorFieldType>), LegalEntityEnum legalEntity = default(LegalEntityEnum), string primaryCurrency = default(string), string pspReference = default(string), string resultCode = default(string), KYCVerificationResult verification = default(KYCVerificationResult)) { - // to ensure "pspReference" is required (not null) - if (pspReference == null) - { - throw new InvalidDataException("pspReference is a required property for CreateAccountHolderResponse and cannot be null"); - } - else - { - this.PspReference = pspReference; - } + this.PspReference = pspReference; this.AccountHolderStatus = accountHolderStatus; this.LegalEntity = legalEntity; this.Verification = verification; From 08fd424b8fac1e88831054ab9441324a07073e19 Mon Sep 17 00:00:00 2001 From: alexandros <alexandros.moraitis@adyen.com> Date: Fri, 17 Sep 2021 09:02:24 +0300 Subject: [PATCH 10/12] 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 a823c63c8..069137ae5 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -5,11 +5,11 @@ <IsPackable>false</IsPackable> - <AssemblyVersion>7.2.0</AssemblyVersion> + <AssemblyVersion>7.3.0</AssemblyVersion> - <FileVersion>7.2.0</FileVersion> + <FileVersion>7.3.0</FileVersion> - <Version>7.2.0</Version> + <Version>7.3.0</Version> <LangVersion>7.2</LangVersion> </PropertyGroup> diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index e97b5dd9b..26ab70e96 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -4,15 +4,15 @@ <TargetFrameworks>netstandard2.0</TargetFrameworks> <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <Copyright>Adyen</Copyright> - <Version>7.2.0</Version> - <AssemblyVersion>7.2.0</AssemblyVersion> - <FileVersion>7.2.0</FileVersion> + <Version>7.3.0</Version> + <AssemblyVersion>7.3.0</AssemblyVersion> + <FileVersion>7.3.0</FileVersion> <GeneratePackageOnBuild>true</GeneratePackageOnBuild> <Description>The Adyen API Library for .net core enables you to work with Adyen APIs, Hosted Payment Pages and terminal api with any .net application.</Description> <PackageProjectUrl>https://github.com/Adyen/adyen-dotnet-api-library</PackageProjectUrl> <RepositoryUrl>https://github.com/Adyen/adyen-dotnet-api-library</RepositoryUrl> <RepositoryType>git</RepositoryType> - <PackageTags>7.2.0</PackageTags> + <PackageTags>7.3.0</PackageTags> <PackageLicenseExpression>MIT</PackageLicenseExpression> <Authors>Adyen</Authors> <Company>Adyen</Company> diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index cbfa4eba1..d9677302f 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -58,6 +58,6 @@ public class ClientConfig public static string BinLookupApiVersion = "v50"; public static string LibName = "adyen-dotnet-api-library"; - public static string LibVersion = "7.2.0"; + public static string LibVersion = "7.3.0"; } } From 3590b63546fd1d2fe4ed4016fbcaaa2467fdcfd7 Mon Sep 17 00:00:00 2001 From: Alexandros Moraitis <alexandros.moraitis@adyen.com> Date: Thu, 7 Oct 2021 14:19:48 +0200 Subject: [PATCH 11/12] [PW-5485] Update checkout to v68 (#500) * Add sessions endpoint * Add unit test * Remove unused mock json files --- Adyen.Test/CheckoutTest.cs | 25 + .../Mocks/checkout/sessions-success.json | 11 + Adyen/Constants/ClientConfig.cs | 2 +- .../Checkout/CreateCheckoutSessionRequest.cs | 1026 +++++++++++++++ .../Checkout/CreateCheckoutSessionResponse.cs | 1097 +++++++++++++++++ Adyen/Service/Checkout.cs | 26 + Adyen/Service/Resource/Checkout/Sessions.cs | 36 + README.md | 2 +- 8 files changed, 2223 insertions(+), 2 deletions(-) create mode 100644 Adyen.Test/Mocks/checkout/sessions-success.json create mode 100644 Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs create mode 100644 Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs create mode 100644 Adyen/Service/Resource/Checkout/Sessions.cs diff --git a/Adyen.Test/CheckoutTest.cs b/Adyen.Test/CheckoutTest.cs index adad28d8b..31be9c673 100644 --- a/Adyen.Test/CheckoutTest.cs +++ b/Adyen.Test/CheckoutTest.cs @@ -651,6 +651,7 @@ public void FraudResultParsingTest() Assert.AreEqual(0, fraudResults[1].FraudCheckResult.AccountScore); Assert.AreEqual(3, fraudResults[1].FraudCheckResult.CheckId); } + /// <summary> /// Test if the fraud result are properly deseriazed /// POST /payments @@ -666,5 +667,29 @@ public void ThreeDS2Test() Assert.AreEqual(ResultCodeEnum.IdentifyShopper, paymentResponse.ResultCode); Assert.AreEqual("threeDS2", paymentResponseThreeDs2Action.Type); } + + /// <summary> + /// Test success sessions + /// POST /sessions + /// </summary> + [TestMethod] + public void CheckoutSessionSuccessTest() + { + var checkoutSessionRequest = new CreateCheckoutSessionRequest + { + merchantAccount = "TestMerchant", + reference = "TestReference", + returnUrl = "http://test-url.com", + amount = new Amount("EUR", 10000L) + }; + var client = CreateMockTestClientApiKeyBasedRequest("Mocks/checkout/sessions-success.json"); + var checkout = new Checkout(client); + var checkoutSessionResponse = checkout.Sessions(checkoutSessionRequest); + Assert.AreEqual("TestMerchant", checkoutSessionResponse.merchantAccount); + Assert.AreEqual("TestReference", checkoutSessionResponse.reference); + Assert.AreEqual("http://test-url.com", checkoutSessionResponse.returnUrl); + Assert.AreEqual("EUR", checkoutSessionResponse.amount.Currency); + Assert.AreEqual("1000", checkoutSessionResponse.amount.Value.ToString()); + } } } \ No newline at end of file diff --git a/Adyen.Test/Mocks/checkout/sessions-success.json b/Adyen.Test/Mocks/checkout/sessions-success.json new file mode 100644 index 000000000..21a559ab3 --- /dev/null +++ b/Adyen.Test/Mocks/checkout/sessions-success.json @@ -0,0 +1,11 @@ +{ + "id": "session-test-id", + "amount": { + "currency": "EUR", + "value": 1000 + }, + "reference": "TestReference", + "returnUrl": "http://test-url.com", + "expiresAt": "2021-09-30T06:45:06Z", + "merchantAccount": "TestMerchant" +} \ No newline at end of file diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index d9677302f..5aecd8196 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -49,7 +49,7 @@ public class ClientConfig public static string RecurringApiVersion = "v49"; public static string ApiVersion = "v51"; public static string PayoutApiVersion = "v51"; - public static string CheckoutApiVersion = "v67"; + public static string CheckoutApiVersion = "v68"; public static string PosTerminalManagementVersion = "v1"; public static string UserAgentSuffix = "adyen-dotnet-api-library/"; public static string EndpointProtocol = "https://"; diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs new file mode 100644 index 000000000..e0a135c02 --- /dev/null +++ b/Adyen/Model/Checkout/CreateCheckoutSessionRequest.cs @@ -0,0 +1,1026 @@ +#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.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Adyen.Model.ApplicationInformation; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using Adyen.Util; + +namespace Adyen.Model.Checkout +{ + /// <summary> + /// CreateCheckoutSessionRequest + /// </summary> + [DataContract] + public partial class CreateCheckoutSessionRequest : IEquatable<CreateCheckoutSessionRequest>, IValidatableObject + { + /// <summary> + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// </summary> + /// <value>The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web</value> + [JsonConverter(typeof(StringEnumConverter))] + public enum ChannelEnum + { + /// <summary> + /// Enum IOS for value: iOS + /// </summary> + [EnumMember(Value = "iOS")] + IOS = 1, + + /// <summary> + /// Enum Android for value: Android + /// </summary> + [EnumMember(Value = "Android")] + Android = 2, + + /// <summary> + /// Enum Web for value: Web + /// </summary> + [EnumMember(Value = "Web")] + Web = 3 + + } + + /// <summary> + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// </summary> + /// <value>The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web</value> + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? channel { get; set; } + /// <summary> + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// </summary> + /// <value>Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. </value> + [JsonConverter(typeof(StringEnumConverter))] + public enum RecurringProcessingModelEnum + { + /// <summary> + /// Enum CardOnFile for value: CardOnFile + /// </summary> + [EnumMember(Value = "CardOnFile")] + CardOnFile = 1, + + /// <summary> + /// Enum Subscription for value: Subscription + /// </summary> + [EnumMember(Value = "Subscription")] + Subscription = 2, + + /// <summary> + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile + /// </summary> + [EnumMember(Value = "UnscheduledCardOnFile")] + UnscheduledCardOnFile = 3 + + } + + /// <summary> + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// </summary> + /// <value>Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. </value> + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? recurringProcessingModel { get; set; } + /// <summary> + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// </summary> + /// <value>Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.</value> + [JsonConverter(typeof(StringEnumConverter))] + public enum ShopperInteractionEnum + { + /// <summary> + /// Enum Ecommerce for value: Ecommerce + /// </summary> + [EnumMember(Value = "Ecommerce")] + Ecommerce = 1, + + /// <summary> + /// Enum ContAuth for value: ContAuth + /// </summary> + [EnumMember(Value = "ContAuth")] + ContAuth = 2, + + /// <summary> + /// Enum Moto for value: Moto + /// </summary> + [EnumMember(Value = "Moto")] + Moto = 3, + + /// <summary> + /// Enum POS for value: POS + /// </summary> + [EnumMember(Value = "POS")] + POS = 4 + + } + + /// <summary> + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// </summary> + /// <value>Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.</value> + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? shopperInteraction { get; set; } + /// <summary> + /// Initializes a new instance of the <see cref="CreateCheckoutSessionRequest" /> class. + /// </summary> + [JsonConstructorAttribute] + protected CreateCheckoutSessionRequest() { } + /// <summary> + /// Initializes a new instance of the <see cref="CreateCheckoutSessionRequest" /> class. + /// </summary> + /// <param name="accountInfo">accountInfo.</param> + /// <param name="additionalAmount">additionalAmount.</param> + /// <param name="additionalData">This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value..</param> + /// <param name="allowedPaymentMethods">List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`.</param> + /// <param name="amount">amount (required).</param> + /// <param name="applicationInfo">applicationInfo.</param> + /// <param name="billingAddress">billingAddress.</param> + /// <param name="blockedPaymentMethods">List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`.</param> + /// <param name="captureDelayHours">The delay between the authorisation and scheduled auto-capture, specified in hours..</param> + /// <param name="channel">The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web.</param> + /// <param name="company">company.</param> + /// <param name="countryCode">The shopper's two-letter country code..</param> + /// <param name="dateOfBirth">The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD.</param> + /// <param name="deliveryAddress">deliveryAddress.</param> + /// <param name="enableOneClick">When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments..</param> + /// <param name="enablePayOut">When true and `shopperReference` is provided, the payment details will be tokenized for payouts..</param> + /// <param name="enableRecurring">When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments..</param> + /// <param name="expiresAt">The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation..</param> + /// <param name="lineItems">Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip..</param> + /// <param name="mandate">mandate.</param> + /// <param name="mcc">The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant..</param> + /// <param name="merchantAccount">The merchant account identifier, with which you want to process the transaction. (required).</param> + /// <param name="merchantOrderReference">This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`..</param> + /// <param name="metadata">Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. .</param> + /// <param name="mpiData">mpiData.</param> + /// <param name="recurringExpiry">Date after which no further authorisations shall be performed. Only for 3D Secure 2..</param> + /// <param name="recurringFrequency">Minimum number of days between authorisations. Only for 3D Secure 2..</param> + /// <param name="recurringProcessingModel">Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. .</param> + /// <param name="redirectFromIssuerMethod">Specifies the redirect method (GET or POST) when redirecting back from the issuer..</param> + /// <param name="redirectToIssuerMethod">Specifies the redirect method (GET or POST) when redirecting to the issuer..</param> + /// <param name="reference">The reference to uniquely identify a payment. (required).</param> + /// <param name="returnUrl">The URL to return to when a redirect payment is completed. (required).</param> + /// <param name="riskData">riskData.</param> + /// <param name="shopperEmail">The shopper's email address..</param> + /// <param name="shopperIP">The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new)..</param> + /// <param name="shopperInteraction">Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal..</param> + /// <param name="shopperLocale">The combination of a language code and a country code to specify the language to be used in the payment..</param> + /// <param name="shopperName">shopperName.</param> + /// <param name="shopperReference">Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address..</param> + /// <param name="shopperStatement">The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string..</param> + /// <param name="socialSecurityNumber">The shopper's social security number..</param> + /// <param name="splitCardFundingSources">Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false).</param> + /// <param name="splits">An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split)..</param> + /// <param name="storePaymentMethod">When this is set to **true** and the `shopperReference` is provided, the payment details will be stored..</param> + /// <param name="telephoneNumber">The shopper's telephone number..</param> + /// <param name="threeDSAuthenticationOnly">If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false).</param> + /// <param name="trustedShopper">Set to true if the payment should be routed to a trusted MID..</param> + public CreateCheckoutSessionRequest(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary<string, string> additionalData = default(Dictionary<string, string>), List<string> allowedPaymentMethods = default(List<string>), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List<string> blockedPaymentMethods = default(List<string>), int captureDelayHours = default(int), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), Address deliveryAddress = default(Address), bool enableOneClick = default(bool), bool enablePayOut = default(bool), bool enableRecurring = default(bool), DateTime expiresAt = default(DateTime), List<LineItem> lineItems = default(List<LineItem>), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary<string, string> metadata = default(Dictionary<string, string>), ThreeDSecureData mpiData = default(ThreeDSecureData), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), bool splitCardFundingSources = false, List<Split> splits = default(List<Split>), bool storePaymentMethod = default(bool), string telephoneNumber = default(string), bool threeDSAuthenticationOnly = false, bool trustedShopper = default(bool)) + { + this.amount = amount; + this.merchantAccount = merchantAccount; + this.reference = reference; + this.returnUrl = returnUrl; + this.accountInfo = accountInfo; + this.additionalAmount = additionalAmount; + this.additionalData = additionalData; + this.allowedPaymentMethods = allowedPaymentMethods; + this.applicationInfo = applicationInfo; + this.billingAddress = billingAddress; + this.blockedPaymentMethods = blockedPaymentMethods; + this.captureDelayHours = captureDelayHours; + this.channel = channel; + this.company = company; + this.countryCode = countryCode; + this.dateOfBirth = dateOfBirth; + this.deliveryAddress = deliveryAddress; + this.enableOneClick = enableOneClick; + this.enablePayOut = enablePayOut; + this.enableRecurring = enableRecurring; + this.expiresAt = expiresAt; + this.lineItems = lineItems; + this.mandate = mandate; + this.mcc = mcc; + this.merchantOrderReference = merchantOrderReference; + this.metadata = metadata; + this.mpiData = mpiData; + this.recurringExpiry = recurringExpiry; + this.recurringFrequency = recurringFrequency; + this.recurringProcessingModel = recurringProcessingModel; + this.redirectFromIssuerMethod = redirectFromIssuerMethod; + this.redirectToIssuerMethod = redirectToIssuerMethod; + this.riskData = riskData; + this.shopperEmail = shopperEmail; + this.shopperIP = shopperIP; + this.shopperInteraction = shopperInteraction; + this.shopperLocale = shopperLocale; + this.shopperName = shopperName; + this.shopperReference = shopperReference; + this.shopperStatement = shopperStatement; + this.socialSecurityNumber = socialSecurityNumber; + // use default value if no "splitCardFundingSources" provided + if (splitCardFundingSources == null) + { + this.splitCardFundingSources = false; + } + else + { + this.splitCardFundingSources = splitCardFundingSources; + } + this.splits = splits; + this.storePaymentMethod = storePaymentMethod; + this.telephoneNumber = telephoneNumber; + // use default value if no "threeDSAuthenticationOnly" provided + if (threeDSAuthenticationOnly == null) + { + this.threeDSAuthenticationOnly = false; + } + else + { + this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + } + this.trustedShopper = trustedShopper; + } + + /// <summary> + /// Gets or Sets accountInfo + /// </summary> + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo accountInfo { get; set; } + + /// <summary> + /// Gets or Sets additionalAmount + /// </summary> + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount additionalAmount { get; set; } + + /// <summary> + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// </summary> + /// <value>This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.</value> + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary<string, string> additionalData { get; set; } + + /// <summary> + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// </summary> + /// <value>List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`</value> + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List<string> allowedPaymentMethods { get; set; } + + /// <summary> + /// Gets or Sets amount + /// </summary> + [DataMember(Name = "amount", EmitDefaultValue = true)] + public Amount amount { get; set; } + + /// <summary> + /// Gets or Sets applicationInfo + /// </summary> + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInformation.ApplicationInfo applicationInfo { get; set; } + + /// <summary> + /// Gets or Sets billingAddress + /// </summary> + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address billingAddress { get; set; } + + /// <summary> + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// </summary> + /// <value>List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`</value> + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List<string> blockedPaymentMethods { get; set; } + + /// <summary> + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// </summary> + /// <value>The delay between the authorisation and scheduled auto-capture, specified in hours.</value> + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int captureDelayHours { get; set; } + + + /// <summary> + /// Gets or Sets company + /// </summary> + [DataMember(Name = "company", EmitDefaultValue = false)] + public Company company { get; set; } + + /// <summary> + /// The shopper's two-letter country code. + /// </summary> + /// <value>The shopper's two-letter country code.</value> + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string countryCode { get; set; } + + /// <summary> + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// </summary> + /// <value>The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD</value> + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime dateOfBirth { get; set; } + + /// <summary> + /// Gets or Sets deliveryAddress + /// </summary> + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address deliveryAddress { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + /// </summary> + /// <value>When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.</value> + [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] + public bool enableOneClick { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// </summary> + /// <value>When true and `shopperReference` is provided, the payment details will be tokenized for payouts.</value> + [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] + public bool enablePayOut { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + /// </summary> + /// <value>When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.</value> + [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] + public bool enableRecurring { get; set; } + + /// <summary> + /// The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation. + /// </summary> + /// <value>The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation.</value> + [DataMember(Name = "expiresAt", EmitDefaultValue = false)] + public DateTime expiresAt { get; set; } + + /// <summary> + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. + /// </summary> + /// <value>Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip.</value> + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List<LineItem> lineItems { get; set; } + + /// <summary> + /// Gets or Sets mandate + /// </summary> + [DataMember(Name = "mandate", EmitDefaultValue = false)] + public Mandate mandate { get; set; } + + /// <summary> + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// </summary> + /// <value>The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.</value> + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string mcc { get; set; } + + /// <summary> + /// The merchant account identifier, with which you want to process the transaction. + /// </summary> + /// <value>The merchant account identifier, with which you want to process the transaction.</value> + [DataMember(Name = "merchantAccount", EmitDefaultValue = true)] + public string merchantAccount { get; set; } + + /// <summary> + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// </summary> + /// <value>This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.</value> + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string merchantOrderReference { get; set; } + + /// <summary> + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. + /// </summary> + /// <value>Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. </value> + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary<string, string> metadata { get; set; } + + /// <summary> + /// Gets or Sets mpiData + /// </summary> + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData mpiData { get; set; } + + /// <summary> + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// </summary> + /// <value>Date after which no further authorisations shall be performed. Only for 3D Secure 2.</value> + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string recurringExpiry { get; set; } + + /// <summary> + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// </summary> + /// <value>Minimum number of days between authorisations. Only for 3D Secure 2.</value> + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string recurringFrequency { get; set; } + + + /// <summary> + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// </summary> + /// <value>Specifies the redirect method (GET or POST) when redirecting back from the issuer.</value> + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string redirectFromIssuerMethod { get; set; } + + /// <summary> + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// </summary> + /// <value>Specifies the redirect method (GET or POST) when redirecting to the issuer.</value> + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string redirectToIssuerMethod { get; set; } + + /// <summary> + /// The reference to uniquely identify a payment. + /// </summary> + /// <value>The reference to uniquely identify a payment.</value> + [DataMember(Name = "reference", EmitDefaultValue = true)] + public string reference { get; set; } + + /// <summary> + /// The URL to return to when a redirect payment is completed. + /// </summary> + /// <value>The URL to return to when a redirect payment is completed.</value> + [DataMember(Name = "returnUrl", EmitDefaultValue = true)] + public string returnUrl { get; set; } + + /// <summary> + /// Gets or Sets riskData + /// </summary> + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData riskData { get; set; } + + /// <summary> + /// The shopper's email address. + /// </summary> + /// <value>The shopper's email address.</value> + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string shopperEmail { get; set; } + + /// <summary> + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// </summary> + /// <value>The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).</value> + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string shopperIP { get; set; } + + + /// <summary> + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// </summary> + /// <value>The combination of a language code and a country code to specify the language to be used in the payment.</value> + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string shopperLocale { get; set; } + + /// <summary> + /// Gets or Sets shopperName + /// </summary> + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name shopperName { get; set; } + + /// <summary> + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// </summary> + /// <value>Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.</value> + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string shopperReference { get; set; } + + /// <summary> + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. + /// </summary> + /// <value>The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string.</value> + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string shopperStatement { get; set; } + + /// <summary> + /// The shopper's social security number. + /// </summary> + /// <value>The shopper's social security number.</value> + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string socialSecurityNumber { get; set; } + + /// <summary> + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. + /// </summary> + /// <value>Boolean value indicating whether the card payment method should be split into separate debit and credit options.</value> + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool splitCardFundingSources { get; set; } + + /// <summary> + /// An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// </summary> + /// <value>An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).</value> + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List<Split> splits { get; set; } + + /// <summary> + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + /// </summary> + /// <value>When this is set to **true** and the `shopperReference` is provided, the payment details will be stored.</value> + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool storePaymentMethod { get; set; } + + /// <summary> + /// The shopper's telephone number. + /// </summary> + /// <value>The shopper's telephone number.</value> + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string telephoneNumber { get; set; } + + /// <summary> + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + /// </summary> + /// <value>If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation.</value> + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool threeDSAuthenticationOnly { get; set; } + + /// <summary> + /// Set to true if the payment should be routed to a trusted MID. + /// </summary> + /// <value>Set to true if the payment should be routed to a trusted MID.</value> + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool trustedShopper { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CreateCheckoutSessionRequest {\n"); + sb.Append(" accountInfo: ").Append(accountInfo).Append("\n"); + sb.Append(" additionalAmount: ").Append(additionalAmount).Append("\n"); + sb.Append(" additionalData: ").Append(additionalData.ToCollectionsString()).Append("\n"); + sb.Append(" allowedPaymentMethods: ").Append(allowedPaymentMethods).Append("\n"); + sb.Append(" amount: ").Append(amount).Append("\n"); + sb.Append(" applicationInfo: ").Append(applicationInfo).Append("\n"); + sb.Append(" billingAddress: ").Append(billingAddress).Append("\n"); + sb.Append(" blockedPaymentMethods: ").Append(blockedPaymentMethods).Append("\n"); + sb.Append(" captureDelayHours: ").Append(captureDelayHours).Append("\n"); + sb.Append(" channel: ").Append(channel).Append("\n"); + sb.Append(" company: ").Append(company).Append("\n"); + sb.Append(" countryCode: ").Append(countryCode).Append("\n"); + sb.Append(" dateOfBirth: ").Append(dateOfBirth).Append("\n"); + sb.Append(" deliveryAddress: ").Append(deliveryAddress).Append("\n"); + sb.Append(" enableOneClick: ").Append(enableOneClick).Append("\n"); + sb.Append(" enablePayOut: ").Append(enablePayOut).Append("\n"); + sb.Append(" enableRecurring: ").Append(enableRecurring).Append("\n"); + sb.Append(" expiresAt: ").Append(expiresAt).Append("\n"); + sb.Append(" lineItems: ").Append(lineItems).Append("\n"); + sb.Append(" mandate: ").Append(mandate).Append("\n"); + sb.Append(" mcc: ").Append(mcc).Append("\n"); + sb.Append(" merchantAccount: ").Append(merchantAccount).Append("\n"); + sb.Append(" merchantOrderReference: ").Append(merchantOrderReference).Append("\n"); + sb.Append(" metadata: ").Append(metadata).Append("\n"); + sb.Append(" mpiData: ").Append(mpiData).Append("\n"); + sb.Append(" recurringExpiry: ").Append(recurringExpiry).Append("\n"); + sb.Append(" recurringFrequency: ").Append(recurringFrequency).Append("\n"); + sb.Append(" recurringProcessingModel: ").Append(recurringProcessingModel).Append("\n"); + sb.Append(" redirectFromIssuerMethod: ").Append(redirectFromIssuerMethod).Append("\n"); + sb.Append(" redirectToIssuerMethod: ").Append(redirectToIssuerMethod).Append("\n"); + sb.Append(" reference: ").Append(reference).Append("\n"); + sb.Append(" returnUrl: ").Append(returnUrl).Append("\n"); + sb.Append(" riskData: ").Append(riskData).Append("\n"); + sb.Append(" shopperEmail: ").Append(shopperEmail).Append("\n"); + sb.Append(" shopperIP: ").Append(shopperIP).Append("\n"); + sb.Append(" shopperInteraction: ").Append(shopperInteraction).Append("\n"); + sb.Append(" shopperLocale: ").Append(shopperLocale).Append("\n"); + sb.Append(" shopperName: ").Append(shopperName).Append("\n"); + sb.Append(" shopperReference: ").Append(shopperReference).Append("\n"); + sb.Append(" shopperStatement: ").Append(shopperStatement).Append("\n"); + sb.Append(" socialSecurityNumber: ").Append(socialSecurityNumber).Append("\n"); + sb.Append(" splitCardFundingSources: ").Append(splitCardFundingSources).Append("\n"); + sb.Append(" splits: ").Append(splits).Append("\n"); + sb.Append(" storePaymentMethod: ").Append(storePaymentMethod).Append("\n"); + sb.Append(" telephoneNumber: ").Append(telephoneNumber).Append("\n"); + sb.Append(" threeDSAuthenticationOnly: ").Append(threeDSAuthenticationOnly).Append("\n"); + sb.Append(" trustedShopper: ").Append(trustedShopper).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as CreateCheckoutSessionRequest); + } + + /// <summary> + /// Returns true if CreateCheckoutSessionRequest instances are equal + /// </summary> + /// <param name="input">Instance of CreateCheckoutSessionRequest to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(CreateCheckoutSessionRequest input) + { + if (input == null) + return false; + + return + ( + this.accountInfo == input.accountInfo || + (this.accountInfo != null && + this.accountInfo.Equals(input.accountInfo)) + ) && + ( + this.additionalAmount == input.additionalAmount || + (this.additionalAmount != null && + this.additionalAmount.Equals(input.additionalAmount)) + ) && + ( + this.additionalData == input.additionalData || + this.additionalData != null && + input.additionalData != null && + this.additionalData.SequenceEqual(input.additionalData) + ) && + ( + this.allowedPaymentMethods == input.allowedPaymentMethods || + this.allowedPaymentMethods != null && + input.allowedPaymentMethods != null && + this.allowedPaymentMethods.SequenceEqual(input.allowedPaymentMethods) + ) && + ( + this.amount == input.amount || + (this.amount != null && + this.amount.Equals(input.amount)) + ) && + ( + this.applicationInfo == input.applicationInfo || + (this.applicationInfo != null && + this.applicationInfo.Equals(input.applicationInfo)) + ) && + ( + this.billingAddress == input.billingAddress || + (this.billingAddress != null && + this.billingAddress.Equals(input.billingAddress)) + ) && + ( + this.blockedPaymentMethods == input.blockedPaymentMethods || + this.blockedPaymentMethods != null && + input.blockedPaymentMethods != null && + this.blockedPaymentMethods.SequenceEqual(input.blockedPaymentMethods) + ) && + ( + this.captureDelayHours == input.captureDelayHours || + (this.captureDelayHours != null && + this.captureDelayHours.Equals(input.captureDelayHours)) + ) && + ( + this.channel == input.channel || + (this.channel != null && + this.channel.Equals(input.channel)) + ) && + ( + this.company == input.company || + (this.company != null && + this.company.Equals(input.company)) + ) && + ( + this.countryCode == input.countryCode || + (this.countryCode != null && + this.countryCode.Equals(input.countryCode)) + ) && + ( + this.dateOfBirth == input.dateOfBirth || + (this.dateOfBirth != null && + this.dateOfBirth.Equals(input.dateOfBirth)) + ) && + ( + this.deliveryAddress == input.deliveryAddress || + (this.deliveryAddress != null && + this.deliveryAddress.Equals(input.deliveryAddress)) + ) && + ( + this.enableOneClick == input.enableOneClick || + (this.enableOneClick != null && + this.enableOneClick.Equals(input.enableOneClick)) + ) && + ( + this.enablePayOut == input.enablePayOut || + (this.enablePayOut != null && + this.enablePayOut.Equals(input.enablePayOut)) + ) && + ( + this.enableRecurring == input.enableRecurring || + (this.enableRecurring != null && + this.enableRecurring.Equals(input.enableRecurring)) + ) && + ( + this.expiresAt == input.expiresAt || + (this.expiresAt != null && + this.expiresAt.Equals(input.expiresAt)) + ) && + ( + this.lineItems == input.lineItems || + this.lineItems != null && + input.lineItems != null && + this.lineItems.SequenceEqual(input.lineItems) + ) && + ( + this.mandate == input.mandate || + (this.mandate != null && + this.mandate.Equals(input.mandate)) + ) && + ( + this.mcc == input.mcc || + (this.mcc != null && + this.mcc.Equals(input.mcc)) + ) && + ( + this.merchantAccount == input.merchantAccount || + (this.merchantAccount != null && + this.merchantAccount.Equals(input.merchantAccount)) + ) && + ( + this.merchantOrderReference == input.merchantOrderReference || + (this.merchantOrderReference != null && + this.merchantOrderReference.Equals(input.merchantOrderReference)) + ) && + ( + this.metadata == input.metadata || + this.metadata != null && + input.metadata != null && + this.metadata.SequenceEqual(input.metadata) + ) && + ( + this.mpiData == input.mpiData || + (this.mpiData != null && + this.mpiData.Equals(input.mpiData)) + ) && + ( + this.recurringExpiry == input.recurringExpiry || + (this.recurringExpiry != null && + this.recurringExpiry.Equals(input.recurringExpiry)) + ) && + ( + this.recurringFrequency == input.recurringFrequency || + (this.recurringFrequency != null && + this.recurringFrequency.Equals(input.recurringFrequency)) + ) && + ( + this.recurringProcessingModel == input.recurringProcessingModel || + (this.recurringProcessingModel != null && + this.recurringProcessingModel.Equals(input.recurringProcessingModel)) + ) && + ( + this.redirectFromIssuerMethod == input.redirectFromIssuerMethod || + (this.redirectFromIssuerMethod != null && + this.redirectFromIssuerMethod.Equals(input.redirectFromIssuerMethod)) + ) && + ( + this.redirectToIssuerMethod == input.redirectToIssuerMethod || + (this.redirectToIssuerMethod != null && + this.redirectToIssuerMethod.Equals(input.redirectToIssuerMethod)) + ) && + ( + this.reference == input.reference || + (this.reference != null && + this.reference.Equals(input.reference)) + ) && + ( + this.returnUrl == input.returnUrl || + (this.returnUrl != null && + this.returnUrl.Equals(input.returnUrl)) + ) && + ( + this.riskData == input.riskData || + (this.riskData != null && + this.riskData.Equals(input.riskData)) + ) && + ( + this.shopperEmail == input.shopperEmail || + (this.shopperEmail != null && + this.shopperEmail.Equals(input.shopperEmail)) + ) && + ( + this.shopperIP == input.shopperIP || + (this.shopperIP != null && + this.shopperIP.Equals(input.shopperIP)) + ) && + ( + this.shopperInteraction == input.shopperInteraction || + (this.shopperInteraction != null && + this.shopperInteraction.Equals(input.shopperInteraction)) + ) && + ( + this.shopperLocale == input.shopperLocale || + (this.shopperLocale != null && + this.shopperLocale.Equals(input.shopperLocale)) + ) && + ( + this.shopperName == input.shopperName || + (this.shopperName != null && + this.shopperName.Equals(input.shopperName)) + ) && + ( + this.shopperReference == input.shopperReference || + (this.shopperReference != null && + this.shopperReference.Equals(input.shopperReference)) + ) && + ( + this.shopperStatement == input.shopperStatement || + (this.shopperStatement != null && + this.shopperStatement.Equals(input.shopperStatement)) + ) && + ( + this.socialSecurityNumber == input.socialSecurityNumber || + (this.socialSecurityNumber != null && + this.socialSecurityNumber.Equals(input.socialSecurityNumber)) + ) && + ( + this.splitCardFundingSources == input.splitCardFundingSources || + (this.splitCardFundingSources != null && + this.splitCardFundingSources.Equals(input.splitCardFundingSources)) + ) && + ( + this.splits == input.splits || + this.splits != null && + input.splits != null && + this.splits.SequenceEqual(input.splits) + ) && + ( + this.storePaymentMethod == input.storePaymentMethod || + (this.storePaymentMethod != null && + this.storePaymentMethod.Equals(input.storePaymentMethod)) + ) && + ( + this.telephoneNumber == input.telephoneNumber || + (this.telephoneNumber != null && + this.telephoneNumber.Equals(input.telephoneNumber)) + ) && + ( + this.threeDSAuthenticationOnly == input.threeDSAuthenticationOnly || + (this.threeDSAuthenticationOnly != null && + this.threeDSAuthenticationOnly.Equals(input.threeDSAuthenticationOnly)) + ) && + ( + this.trustedShopper == input.trustedShopper || + (this.trustedShopper != null && + this.trustedShopper.Equals(input.trustedShopper)) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.accountInfo != null) + hashCode = hashCode * 59 + this.accountInfo.GetHashCode(); + if (this.additionalAmount != null) + hashCode = hashCode * 59 + this.additionalAmount.GetHashCode(); + if (this.additionalData != null) + hashCode = hashCode * 59 + this.additionalData.GetHashCode(); + if (this.allowedPaymentMethods != null) + hashCode = hashCode * 59 + this.allowedPaymentMethods.GetHashCode(); + if (this.amount != null) + hashCode = hashCode * 59 + this.amount.GetHashCode(); + if (this.applicationInfo != null) + hashCode = hashCode * 59 + this.applicationInfo.GetHashCode(); + if (this.billingAddress != null) + hashCode = hashCode * 59 + this.billingAddress.GetHashCode(); + if (this.blockedPaymentMethods != null) + hashCode = hashCode * 59 + this.blockedPaymentMethods.GetHashCode(); + if (this.captureDelayHours != null) + hashCode = hashCode * 59 + this.captureDelayHours.GetHashCode(); + if (this.channel != null) + hashCode = hashCode * 59 + this.channel.GetHashCode(); + if (this.company != null) + hashCode = hashCode * 59 + this.company.GetHashCode(); + if (this.countryCode != null) + hashCode = hashCode * 59 + this.countryCode.GetHashCode(); + if (this.dateOfBirth != null) + hashCode = hashCode * 59 + this.dateOfBirth.GetHashCode(); + if (this.deliveryAddress != null) + hashCode = hashCode * 59 + this.deliveryAddress.GetHashCode(); + if (this.enableOneClick != null) + hashCode = hashCode * 59 + this.enableOneClick.GetHashCode(); + if (this.enablePayOut != null) + hashCode = hashCode * 59 + this.enablePayOut.GetHashCode(); + if (this.enableRecurring != null) + hashCode = hashCode * 59 + this.enableRecurring.GetHashCode(); + if (this.expiresAt != null) + hashCode = hashCode * 59 + this.expiresAt.GetHashCode(); + if (this.lineItems != null) + hashCode = hashCode * 59 + this.lineItems.GetHashCode(); + if (this.mandate != null) + hashCode = hashCode * 59 + this.mandate.GetHashCode(); + if (this.mcc != null) + hashCode = hashCode * 59 + this.mcc.GetHashCode(); + if (this.merchantAccount != null) + hashCode = hashCode * 59 + this.merchantAccount.GetHashCode(); + if (this.merchantOrderReference != null) + hashCode = hashCode * 59 + this.merchantOrderReference.GetHashCode(); + if (this.metadata != null) + hashCode = hashCode * 59 + this.metadata.GetHashCode(); + if (this.mpiData != null) + hashCode = hashCode * 59 + this.mpiData.GetHashCode(); + if (this.recurringExpiry != null) + hashCode = hashCode * 59 + this.recurringExpiry.GetHashCode(); + if (this.recurringFrequency != null) + hashCode = hashCode * 59 + this.recurringFrequency.GetHashCode(); + if (this.recurringProcessingModel != null) + hashCode = hashCode * 59 + this.recurringProcessingModel.GetHashCode(); + if (this.redirectFromIssuerMethod != null) + hashCode = hashCode * 59 + this.redirectFromIssuerMethod.GetHashCode(); + if (this.redirectToIssuerMethod != null) + hashCode = hashCode * 59 + this.redirectToIssuerMethod.GetHashCode(); + if (this.reference != null) + hashCode = hashCode * 59 + this.reference.GetHashCode(); + if (this.returnUrl != null) + hashCode = hashCode * 59 + this.returnUrl.GetHashCode(); + if (this.riskData != null) + hashCode = hashCode * 59 + this.riskData.GetHashCode(); + if (this.shopperEmail != null) + hashCode = hashCode * 59 + this.shopperEmail.GetHashCode(); + if (this.shopperIP != null) + hashCode = hashCode * 59 + this.shopperIP.GetHashCode(); + if (this.shopperInteraction != null) + hashCode = hashCode * 59 + this.shopperInteraction.GetHashCode(); + if (this.shopperLocale != null) + hashCode = hashCode * 59 + this.shopperLocale.GetHashCode(); + if (this.shopperName != null) + hashCode = hashCode * 59 + this.shopperName.GetHashCode(); + if (this.shopperReference != null) + hashCode = hashCode * 59 + this.shopperReference.GetHashCode(); + if (this.shopperStatement != null) + hashCode = hashCode * 59 + this.shopperStatement.GetHashCode(); + if (this.socialSecurityNumber != null) + hashCode = hashCode * 59 + this.socialSecurityNumber.GetHashCode(); + if (this.splitCardFundingSources != null) + hashCode = hashCode * 59 + this.splitCardFundingSources.GetHashCode(); + if (this.splits != null) + hashCode = hashCode * 59 + this.splits.GetHashCode(); + if (this.storePaymentMethod != null) + hashCode = hashCode * 59 + this.storePaymentMethod.GetHashCode(); + if (this.telephoneNumber != null) + hashCode = hashCode * 59 + this.telephoneNumber.GetHashCode(); + if (this.threeDSAuthenticationOnly != null) + hashCode = hashCode * 59 + this.threeDSAuthenticationOnly.GetHashCode(); + if (this.trustedShopper != null) + hashCode = hashCode * 59 + this.trustedShopper.GetHashCode(); + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs new file mode 100644 index 000000000..14b604372 --- /dev/null +++ b/Adyen/Model/Checkout/CreateCheckoutSessionResponse.cs @@ -0,0 +1,1097 @@ +#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.Linq; +using System.IO; +using System.Text; +using System.Collections.Generic; +using Adyen.Model.ApplicationInformation; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using Adyen.Util; + +namespace Adyen.Model.Checkout +{ + /// <summary> + /// CreateCheckoutSessionResponse + /// </summary> + [DataContract] + public partial class CreateCheckoutSessionResponse : IEquatable<CreateCheckoutSessionResponse>, IValidatableObject + { + /// <summary> + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// </summary> + /// <value>The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web</value> + [JsonConverter(typeof(StringEnumConverter))] + public enum ChannelEnum + { + /// <summary> + /// Enum IOS for value: iOS + /// </summary> + [EnumMember(Value = "iOS")] + IOS = 1, + + /// <summary> + /// Enum Android for value: Android + /// </summary> + [EnumMember(Value = "Android")] + Android = 2, + + /// <summary> + /// Enum Web for value: Web + /// </summary> + [EnumMember(Value = "Web")] + Web = 3 + + } + + /// <summary> + /// The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web + /// </summary> + /// <value>The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web</value> + [DataMember(Name = "channel", EmitDefaultValue = false)] + public ChannelEnum? channel { get; set; } + /// <summary> + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// </summary> + /// <value>Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. </value> + [JsonConverter(typeof(StringEnumConverter))] + public enum RecurringProcessingModelEnum + { + /// <summary> + /// Enum CardOnFile for value: CardOnFile + /// </summary> + [EnumMember(Value = "CardOnFile")] + CardOnFile = 1, + + /// <summary> + /// Enum Subscription for value: Subscription + /// </summary> + [EnumMember(Value = "Subscription")] + Subscription = 2, + + /// <summary> + /// Enum UnscheduledCardOnFile for value: UnscheduledCardOnFile + /// </summary> + [EnumMember(Value = "UnscheduledCardOnFile")] + UnscheduledCardOnFile = 3 + + } + + /// <summary> + /// Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. + /// </summary> + /// <value>Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. </value> + [DataMember(Name = "recurringProcessingModel", EmitDefaultValue = false)] + public RecurringProcessingModelEnum? recurringProcessingModel { get; set; } + /// <summary> + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// </summary> + /// <value>Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.</value> + [JsonConverter(typeof(StringEnumConverter))] + public enum ShopperInteractionEnum + { + /// <summary> + /// Enum Ecommerce for value: Ecommerce + /// </summary> + [EnumMember(Value = "Ecommerce")] + Ecommerce = 1, + + /// <summary> + /// Enum ContAuth for value: ContAuth + /// </summary> + [EnumMember(Value = "ContAuth")] + ContAuth = 2, + + /// <summary> + /// Enum Moto for value: Moto + /// </summary> + [EnumMember(Value = "Moto")] + Moto = 3, + + /// <summary> + /// Enum POS for value: POS + /// </summary> + [EnumMember(Value = "POS")] + POS = 4 + + } + + /// <summary> + /// Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal. + /// </summary> + /// <value>Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.</value> + [DataMember(Name = "shopperInteraction", EmitDefaultValue = false)] + public ShopperInteractionEnum? shopperInteraction { get; set; } + /// <summary> + /// Initializes a new instance of the <see cref="CreateCheckoutSessionResponse" /> class. + /// </summary> + [JsonConstructorAttribute] + protected CreateCheckoutSessionResponse() { } + /// <summary> + /// Initializes a new instance of the <see cref="CreateCheckoutSessionResponse" /> class. + /// </summary> + /// <param name="accountInfo">accountInfo.</param> + /// <param name="additionalAmount">additionalAmount.</param> + /// <param name="additionalData">This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value..</param> + /// <param name="allowedPaymentMethods">List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`.</param> + /// <param name="amount">amount (required).</param> + /// <param name="applicationInfo">applicationInfo.</param> + /// <param name="billingAddress">billingAddress.</param> + /// <param name="blockedPaymentMethods">List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`.</param> + /// <param name="captureDelayHours">The delay between the authorisation and scheduled auto-capture, specified in hours..</param> + /// <param name="channel">The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web.</param> + /// <param name="company">company.</param> + /// <param name="countryCode">The shopper's two-letter country code..</param> + /// <param name="dateOfBirth">The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD.</param> + /// <param name="deliveryAddress">deliveryAddress.</param> + /// <param name="enableOneClick">When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments..</param> + /// <param name="enablePayOut">When true and `shopperReference` is provided, the payment details will be tokenized for payouts..</param> + /// <param name="enableRecurring">When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments..</param> + /// <param name="expiresAt">The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation. (required).</param> + /// <param name="lineItems">Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip..</param> + /// <param name="mandate">mandate.</param> + /// <param name="mcc">The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant..</param> + /// <param name="merchantAccount">The merchant account identifier, with which you want to process the transaction. (required).</param> + /// <param name="merchantOrderReference">This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`..</param> + /// <param name="metadata">Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. .</param> + /// <param name="mpiData">mpiData.</param> + /// <param name="recurringExpiry">Date after which no further authorisations shall be performed. Only for 3D Secure 2..</param> + /// <param name="recurringFrequency">Minimum number of days between authorisations. Only for 3D Secure 2..</param> + /// <param name="recurringProcessingModel">Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – With a card-on-file (CoF) transaction, card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – An unscheduled card-on-file (UCoF) transaction is a transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount. .</param> + /// <param name="redirectFromIssuerMethod">Specifies the redirect method (GET or POST) when redirecting back from the issuer..</param> + /// <param name="redirectToIssuerMethod">Specifies the redirect method (GET or POST) when redirecting to the issuer..</param> + /// <param name="reference">The reference to uniquely identify a payment. (required).</param> + /// <param name="returnUrl">The URL to return to when a redirect payment is completed. (required).</param> + /// <param name="riskData">riskData.</param> + /// <param name="sessionData">sessionData.</param> + /// <param name="shopperEmail">The shopper's email address..</param> + /// <param name="shopperIP">The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new)..</param> + /// <param name="shopperInteraction">Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal..</param> + /// <param name="shopperLocale">The combination of a language code and a country code to specify the language to be used in the payment..</param> + /// <param name="shopperName">shopperName.</param> + /// <param name="shopperReference">Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address..</param> + /// <param name="shopperStatement">The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string..</param> + /// <param name="socialSecurityNumber">The shopper's social security number..</param> + /// <param name="splitCardFundingSources">Boolean value indicating whether the card payment method should be split into separate debit and credit options. (default to false).</param> + /// <param name="splits">An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split)..</param> + /// <param name="storePaymentMethod">When this is set to **true** and the `shopperReference` is provided, the payment details will be stored..</param> + /// <param name="telephoneNumber">The shopper's telephone number..</param> + /// <param name="threeDSAuthenticationOnly">If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. (default to false).</param> + /// <param name="trustedShopper">Set to true if the payment should be routed to a trusted MID..</param> + public CreateCheckoutSessionResponse(AccountInfo accountInfo = default(AccountInfo), Amount additionalAmount = default(Amount), Dictionary<string, string> additionalData = default(Dictionary<string, string>), List<string> allowedPaymentMethods = default(List<string>), Amount amount = default(Amount), ApplicationInfo applicationInfo = default(ApplicationInfo), Address billingAddress = default(Address), List<string> blockedPaymentMethods = default(List<string>), int captureDelayHours = default(int), ChannelEnum? channel = default(ChannelEnum?), Company company = default(Company), string countryCode = default(string), DateTime dateOfBirth = default(DateTime), Address deliveryAddress = default(Address), bool enableOneClick = default(bool), bool enablePayOut = default(bool), bool enableRecurring = default(bool), DateTime expiresAt = default(DateTime), List<LineItem> lineItems = default(List<LineItem>), Mandate mandate = default(Mandate), string mcc = default(string), string merchantAccount = default(string), string merchantOrderReference = default(string), Dictionary<string, string> metadata = default(Dictionary<string, string>), ThreeDSecureData mpiData = default(ThreeDSecureData), string recurringExpiry = default(string), string recurringFrequency = default(string), RecurringProcessingModelEnum? recurringProcessingModel = default(RecurringProcessingModelEnum?), string redirectFromIssuerMethod = default(string), string redirectToIssuerMethod = default(string), string reference = default(string), string returnUrl = default(string), RiskData riskData = default(RiskData), string sessionData = default(string), string shopperEmail = default(string), string shopperIP = default(string), ShopperInteractionEnum? shopperInteraction = default(ShopperInteractionEnum?), string shopperLocale = default(string), Name shopperName = default(Name), string shopperReference = default(string), string shopperStatement = default(string), string socialSecurityNumber = default(string), bool splitCardFundingSources = false, List<Split> splits = default(List<Split>), bool storePaymentMethod = default(bool), string telephoneNumber = default(string), bool threeDSAuthenticationOnly = false, bool trustedShopper = default(bool)) + { + // to ensure "amount" is required (not null) + if (amount == null) + { + throw new InvalidDataException("amount is a required property for CreateCheckoutSessionResponse and cannot be null"); + } + else + { + this.amount = amount; + } + + // to ensure "expiresAt" is required (not null) + if (expiresAt == null) + { + throw new InvalidDataException("expiresAt is a required property for CreateCheckoutSessionResponse and cannot be null"); + } + else + { + this.expiresAt = expiresAt; + } + + // to ensure "merchantAccount" is required (not null) + if (merchantAccount == null) + { + throw new InvalidDataException("merchantAccount is a required property for CreateCheckoutSessionResponse and cannot be null"); + } + else + { + this.merchantAccount = merchantAccount; + } + + // to ensure "reference" is required (not null) + if (reference == null) + { + throw new InvalidDataException("reference is a required property for CreateCheckoutSessionResponse and cannot be null"); + } + else + { + this.reference = reference; + } + + // to ensure "returnUrl" is required (not null) + if (returnUrl == null) + { + throw new InvalidDataException("returnUrl is a required property for CreateCheckoutSessionResponse and cannot be null"); + } + else + { + this.returnUrl = returnUrl; + } + + this.accountInfo = accountInfo; + this.additionalAmount = additionalAmount; + this.additionalData = additionalData; + this.allowedPaymentMethods = allowedPaymentMethods; + this.applicationInfo = applicationInfo; + this.billingAddress = billingAddress; + this.blockedPaymentMethods = blockedPaymentMethods; + this.captureDelayHours = captureDelayHours; + this.channel = channel; + this.company = company; + this.countryCode = countryCode; + this.dateOfBirth = dateOfBirth; + this.deliveryAddress = deliveryAddress; + this.enableOneClick = enableOneClick; + this.enablePayOut = enablePayOut; + this.enableRecurring = enableRecurring; + this.lineItems = lineItems; + this.mandate = mandate; + this.mcc = mcc; + this.merchantOrderReference = merchantOrderReference; + this.metadata = metadata; + this.mpiData = mpiData; + this.recurringExpiry = recurringExpiry; + this.recurringFrequency = recurringFrequency; + this.recurringProcessingModel = recurringProcessingModel; + this.redirectFromIssuerMethod = redirectFromIssuerMethod; + this.redirectToIssuerMethod = redirectToIssuerMethod; + this.riskData = riskData; + this.sessionData = sessionData; + this.shopperEmail = shopperEmail; + this.shopperIP = shopperIP; + this.shopperInteraction = shopperInteraction; + this.shopperLocale = shopperLocale; + this.shopperName = shopperName; + this.shopperReference = shopperReference; + this.shopperStatement = shopperStatement; + this.socialSecurityNumber = socialSecurityNumber; + // use default value if no "splitCardFundingSources" provided + if (splitCardFundingSources == null) + { + this.splitCardFundingSources = false; + } + else + { + this.splitCardFundingSources = splitCardFundingSources; + } + this.splits = splits; + this.storePaymentMethod = storePaymentMethod; + this.telephoneNumber = telephoneNumber; + // use default value if no "threeDSAuthenticationOnly" provided + if (threeDSAuthenticationOnly == null) + { + this.threeDSAuthenticationOnly = false; + } + else + { + this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + } + this.trustedShopper = trustedShopper; + } + + /// <summary> + /// Gets or Sets accountInfo + /// </summary> + [DataMember(Name = "accountInfo", EmitDefaultValue = false)] + public AccountInfo accountInfo { get; set; } + + /// <summary> + /// Gets or Sets additionalAmount + /// </summary> + [DataMember(Name = "additionalAmount", EmitDefaultValue = false)] + public Amount additionalAmount { get; set; } + + /// <summary> + /// This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. + /// </summary> + /// <value>This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value.</value> + [DataMember(Name = "additionalData", EmitDefaultValue = false)] + public Dictionary<string, string> additionalData { get; set; } + + /// <summary> + /// List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// </summary> + /// <value>List of payment methods to be presented to the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"allowedPaymentMethods\":[\"ideal\",\"giropay\"]`</value> + [DataMember(Name = "allowedPaymentMethods", EmitDefaultValue = false)] + public List<string> allowedPaymentMethods { get; set; } + + /// <summary> + /// Gets or Sets amount + /// </summary> + [DataMember(Name = "amount", EmitDefaultValue = true)] + public Amount amount { get; set; } + + /// <summary> + /// Gets or Sets applicationInfo + /// </summary> + [DataMember(Name = "applicationInfo", EmitDefaultValue = false)] + public ApplicationInfo applicationInfo { get; set; } + + /// <summary> + /// Gets or Sets billingAddress + /// </summary> + [DataMember(Name = "billingAddress", EmitDefaultValue = false)] + public Address billingAddress { get; set; } + + /// <summary> + /// List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]` + /// </summary> + /// <value>List of payment methods to be hidden from the shopper. To refer to payment methods, use their `paymentMethod.type`from [Payment methods overview](https://docs.adyen.com/payment-methods). Example: `\"blockedPaymentMethods\":[\"ideal\",\"giropay\"]`</value> + [DataMember(Name = "blockedPaymentMethods", EmitDefaultValue = false)] + public List<string> blockedPaymentMethods { get; set; } + + /// <summary> + /// The delay between the authorisation and scheduled auto-capture, specified in hours. + /// </summary> + /// <value>The delay between the authorisation and scheduled auto-capture, specified in hours.</value> + [DataMember(Name = "captureDelayHours", EmitDefaultValue = false)] + public int captureDelayHours { get; set; } + + + /// <summary> + /// Gets or Sets company + /// </summary> + [DataMember(Name = "company", EmitDefaultValue = false)] + public Company company { get; set; } + + /// <summary> + /// The shopper's two-letter country code. + /// </summary> + /// <value>The shopper's two-letter country code.</value> + [DataMember(Name = "countryCode", EmitDefaultValue = false)] + public string countryCode { get; set; } + + /// <summary> + /// The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD + /// </summary> + /// <value>The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD</value> + [DataMember(Name = "dateOfBirth", EmitDefaultValue = false)] + public DateTime dateOfBirth { get; set; } + + /// <summary> + /// Gets or Sets deliveryAddress + /// </summary> + [DataMember(Name = "deliveryAddress", EmitDefaultValue = false)] + public Address deliveryAddress { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments. + /// </summary> + /// <value>When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.</value> + [DataMember(Name = "enableOneClick", EmitDefaultValue = false)] + public bool enableOneClick { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the payment details will be tokenized for payouts. + /// </summary> + /// <value>When true and `shopperReference` is provided, the payment details will be tokenized for payouts.</value> + [DataMember(Name = "enablePayOut", EmitDefaultValue = false)] + public bool enablePayOut { get; set; } + + /// <summary> + /// When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments. + /// </summary> + /// <value>When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.</value> + [DataMember(Name = "enableRecurring", EmitDefaultValue = false)] + public bool enableRecurring { get; set; } + + /// <summary> + /// The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation. + /// </summary> + /// <value>The date the session expires in ISO8601 format. When not specified, it defaults to 1h after creation.</value> + [DataMember(Name = "expiresAt", EmitDefaultValue = true)] + public DateTime expiresAt { get; set; } + + /// <summary> + /// A unique identifier of the session. + /// </summary> + /// <value>A unique identifier of the session.</value> + [DataMember(Name = "id", EmitDefaultValue = true)] + public string id { get; private set; } + + /// <summary> + /// Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip. + /// </summary> + /// <value>Price and product information about the purchased items, to be included on the invoice sent to the shopper. > This field is required for 3x 4x Oney, Affirm, Afterpay, Clearpay, Klarna, Ratepay, and Zip.</value> + [DataMember(Name = "lineItems", EmitDefaultValue = false)] + public List<LineItem> lineItems { get; set; } + + /// <summary> + /// Gets or Sets mandate + /// </summary> + [DataMember(Name = "mandate", EmitDefaultValue = false)] + public Mandate mandate { get; set; } + + /// <summary> + /// The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. + /// </summary> + /// <value>The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.</value> + [DataMember(Name = "mcc", EmitDefaultValue = false)] + public string mcc { get; set; } + + /// <summary> + /// The merchant account identifier, with which you want to process the transaction. + /// </summary> + /// <value>The merchant account identifier, with which you want to process the transaction.</value> + [DataMember(Name = "merchantAccount", EmitDefaultValue = true)] + public string merchantAccount { get; set; } + + /// <summary> + /// This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`. + /// </summary> + /// <value>This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.</value> + [DataMember(Name = "merchantOrderReference", EmitDefaultValue = false)] + public string merchantOrderReference { get; set; } + + /// <summary> + /// Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. + /// </summary> + /// <value>Metadata consists of entries, each of which includes a key and a value. Limits: * Maximum 20 key-value pairs per request.* Maximum 20 characters per key. * Maximum 80 characters per value. </value> + [DataMember(Name = "metadata", EmitDefaultValue = false)] + public Dictionary<string, string> metadata { get; set; } + + /// <summary> + /// Gets or Sets mpiData + /// </summary> + [DataMember(Name = "mpiData", EmitDefaultValue = false)] + public ThreeDSecureData mpiData { get; set; } + + /// <summary> + /// Date after which no further authorisations shall be performed. Only for 3D Secure 2. + /// </summary> + /// <value>Date after which no further authorisations shall be performed. Only for 3D Secure 2.</value> + [DataMember(Name = "recurringExpiry", EmitDefaultValue = false)] + public string recurringExpiry { get; set; } + + /// <summary> + /// Minimum number of days between authorisations. Only for 3D Secure 2. + /// </summary> + /// <value>Minimum number of days between authorisations. Only for 3D Secure 2.</value> + [DataMember(Name = "recurringFrequency", EmitDefaultValue = false)] + public string recurringFrequency { get; set; } + + + /// <summary> + /// Specifies the redirect method (GET or POST) when redirecting back from the issuer. + /// </summary> + /// <value>Specifies the redirect method (GET or POST) when redirecting back from the issuer.</value> + [DataMember(Name = "redirectFromIssuerMethod", EmitDefaultValue = false)] + public string redirectFromIssuerMethod { get; set; } + + /// <summary> + /// Specifies the redirect method (GET or POST) when redirecting to the issuer. + /// </summary> + /// <value>Specifies the redirect method (GET or POST) when redirecting to the issuer.</value> + [DataMember(Name = "redirectToIssuerMethod", EmitDefaultValue = false)] + public string redirectToIssuerMethod { get; set; } + + /// <summary> + /// The reference to uniquely identify a payment. + /// </summary> + /// <value>The reference to uniquely identify a payment.</value> + [DataMember(Name = "reference", EmitDefaultValue = true)] + public string reference { get; set; } + + /// <summary> + /// The URL to return to when a redirect payment is completed. + /// </summary> + /// <value>The URL to return to when a redirect payment is completed.</value> + [DataMember(Name = "returnUrl", EmitDefaultValue = true)] + public string returnUrl { get; set; } + + /// <summary> + /// Gets or Sets riskData + /// </summary> + [DataMember(Name = "riskData", EmitDefaultValue = false)] + public RiskData riskData { get; set; } + + /// <summary> + /// Gets or Sets sessionData + /// </summary> + [DataMember(Name = "sessionData", EmitDefaultValue = false)] + public string sessionData { get; set; } + + /// <summary> + /// The shopper's email address. + /// </summary> + /// <value>The shopper's email address.</value> + [DataMember(Name = "shopperEmail", EmitDefaultValue = false)] + public string shopperEmail { get; set; } + + /// <summary> + /// The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + /// </summary> + /// <value>The shopper's IP address. In general, we recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > For 3D Secure 2 transactions, schemes require `shopperIP` for all browser-based implementations. This field is also mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).</value> + [DataMember(Name = "shopperIP", EmitDefaultValue = false)] + public string shopperIP { get; set; } + + + /// <summary> + /// The combination of a language code and a country code to specify the language to be used in the payment. + /// </summary> + /// <value>The combination of a language code and a country code to specify the language to be used in the payment.</value> + [DataMember(Name = "shopperLocale", EmitDefaultValue = false)] + public string shopperLocale { get; set; } + + /// <summary> + /// Gets or Sets shopperName + /// </summary> + [DataMember(Name = "shopperName", EmitDefaultValue = false)] + public Name shopperName { get; set; } + + /// <summary> + /// Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. + /// </summary> + /// <value>Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address.</value> + [DataMember(Name = "shopperReference", EmitDefaultValue = false)] + public string shopperReference { get; set; } + + /// <summary> + /// The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string. + /// </summary> + /// <value>The text to be shown on the shopper's bank statement. To enable this field, contact our [Support Team](https://support.adyen.com/hc/en-us/requests/new). We recommend sending a maximum of 22 characters, otherwise banks might truncate the string.</value> + [DataMember(Name = "shopperStatement", EmitDefaultValue = false)] + public string shopperStatement { get; set; } + + /// <summary> + /// The shopper's social security number. + /// </summary> + /// <value>The shopper's social security number.</value> + [DataMember(Name = "socialSecurityNumber", EmitDefaultValue = false)] + public string socialSecurityNumber { get; set; } + + /// <summary> + /// Boolean value indicating whether the card payment method should be split into separate debit and credit options. + /// </summary> + /// <value>Boolean value indicating whether the card payment method should be split into separate debit and credit options.</value> + [DataMember(Name = "splitCardFundingSources", EmitDefaultValue = false)] + public bool splitCardFundingSources { get; set; } + + /// <summary> + /// An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + /// </summary> + /// <value>An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).</value> + [DataMember(Name = "splits", EmitDefaultValue = false)] + public List<Split> splits { get; set; } + + /// <summary> + /// When this is set to **true** and the `shopperReference` is provided, the payment details will be stored. + /// </summary> + /// <value>When this is set to **true** and the `shopperReference` is provided, the payment details will be stored.</value> + [DataMember(Name = "storePaymentMethod", EmitDefaultValue = false)] + public bool storePaymentMethod { get; set; } + + /// <summary> + /// The shopper's telephone number. + /// </summary> + /// <value>The shopper's telephone number.</value> + [DataMember(Name = "telephoneNumber", EmitDefaultValue = false)] + public string telephoneNumber { get; set; } + + /// <summary> + /// If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation. + /// </summary> + /// <value>If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only), and not the payment authorisation.</value> + [DataMember(Name = "threeDSAuthenticationOnly", EmitDefaultValue = false)] + public bool threeDSAuthenticationOnly { get; set; } + + /// <summary> + /// Set to true if the payment should be routed to a trusted MID. + /// </summary> + /// <value>Set to true if the payment should be routed to a trusted MID.</value> + [DataMember(Name = "trustedShopper", EmitDefaultValue = false)] + public bool trustedShopper { get; set; } + + /// <summary> + /// Returns the string presentation of the object + /// </summary> + /// <returns>String presentation of the object</returns> + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CreateCheckoutSessionResponse {\n"); + sb.Append(" accountInfo: ").Append(accountInfo).Append("\n"); + sb.Append(" additionalAmount: ").Append(additionalAmount).Append("\n"); + sb.Append(" additionalData: ").Append(additionalData.ToCollectionsString()).Append("\n"); + sb.Append(" allowedPaymentMethods: ").Append(allowedPaymentMethods).Append("\n"); + sb.Append(" amount: ").Append(amount).Append("\n"); + sb.Append(" applicationInfo: ").Append(applicationInfo).Append("\n"); + sb.Append(" billingAddress: ").Append(billingAddress).Append("\n"); + sb.Append(" blockedPaymentMethods: ").Append(blockedPaymentMethods).Append("\n"); + sb.Append(" captureDelayHours: ").Append(captureDelayHours).Append("\n"); + sb.Append(" channel: ").Append(channel).Append("\n"); + sb.Append(" company: ").Append(company).Append("\n"); + sb.Append(" countryCode: ").Append(countryCode).Append("\n"); + sb.Append(" dateOfBirth: ").Append(dateOfBirth).Append("\n"); + sb.Append(" deliveryAddress: ").Append(deliveryAddress).Append("\n"); + sb.Append(" enableOneClick: ").Append(enableOneClick).Append("\n"); + sb.Append(" enablePayOut: ").Append(enablePayOut).Append("\n"); + sb.Append(" enableRecurring: ").Append(enableRecurring).Append("\n"); + sb.Append(" expiresAt: ").Append(expiresAt).Append("\n"); + sb.Append(" id: ").Append(id).Append("\n"); + sb.Append(" lineItems: ").Append(lineItems).Append("\n"); + sb.Append(" mandate: ").Append(mandate).Append("\n"); + sb.Append(" mcc: ").Append(mcc).Append("\n"); + sb.Append(" merchantAccount: ").Append(merchantAccount).Append("\n"); + sb.Append(" merchantOrderReference: ").Append(merchantOrderReference).Append("\n"); + sb.Append(" metadata: ").Append(metadata).Append("\n"); + sb.Append(" mpiData: ").Append(mpiData).Append("\n"); + sb.Append(" recurringExpiry: ").Append(recurringExpiry).Append("\n"); + sb.Append(" recurringFrequency: ").Append(recurringFrequency).Append("\n"); + sb.Append(" recurringProcessingModel: ").Append(recurringProcessingModel).Append("\n"); + sb.Append(" redirectFromIssuerMethod: ").Append(redirectFromIssuerMethod).Append("\n"); + sb.Append(" redirectToIssuerMethod: ").Append(redirectToIssuerMethod).Append("\n"); + sb.Append(" reference: ").Append(reference).Append("\n"); + sb.Append(" returnUrl: ").Append(returnUrl).Append("\n"); + sb.Append(" riskData: ").Append(riskData).Append("\n"); + sb.Append(" sessionData: ").Append(sessionData).Append("\n"); + sb.Append(" shopperEmail: ").Append(shopperEmail).Append("\n"); + sb.Append(" shopperIP: ").Append(shopperIP).Append("\n"); + sb.Append(" shopperInteraction: ").Append(shopperInteraction).Append("\n"); + sb.Append(" shopperLocale: ").Append(shopperLocale).Append("\n"); + sb.Append(" shopperName: ").Append(shopperName).Append("\n"); + sb.Append(" shopperReference: ").Append(shopperReference).Append("\n"); + sb.Append(" shopperStatement: ").Append(shopperStatement).Append("\n"); + sb.Append(" socialSecurityNumber: ").Append(socialSecurityNumber).Append("\n"); + sb.Append(" splitCardFundingSources: ").Append(splitCardFundingSources).Append("\n"); + sb.Append(" splits: ").Append(splits).Append("\n"); + sb.Append(" storePaymentMethod: ").Append(storePaymentMethod).Append("\n"); + sb.Append(" telephoneNumber: ").Append(telephoneNumber).Append("\n"); + sb.Append(" threeDSAuthenticationOnly: ").Append(threeDSAuthenticationOnly).Append("\n"); + sb.Append(" trustedShopper: ").Append(trustedShopper).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// <summary> + /// Returns the JSON string presentation of the object + /// </summary> + /// <returns>JSON string presentation of the object</returns> + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// <summary> + /// Returns true if objects are equal + /// </summary> + /// <param name="input">Object to be compared</param> + /// <returns>Boolean</returns> + public override bool Equals(object input) + { + return this.Equals(input as CreateCheckoutSessionResponse); + } + + /// <summary> + /// Returns true if CreateCheckoutSessionResponse instances are equal + /// </summary> + /// <param name="input">Instance of CreateCheckoutSessionResponse to be compared</param> + /// <returns>Boolean</returns> + public bool Equals(CreateCheckoutSessionResponse input) + { + if (input == null) + return false; + + return + ( + this.accountInfo == input.accountInfo || + (this.accountInfo != null && + this.accountInfo.Equals(input.accountInfo)) + ) && + ( + this.additionalAmount == input.additionalAmount || + (this.additionalAmount != null && + this.additionalAmount.Equals(input.additionalAmount)) + ) && + ( + this.additionalData == input.additionalData || + this.additionalData != null && + input.additionalData != null && + this.additionalData.SequenceEqual(input.additionalData) + ) && + ( + this.allowedPaymentMethods == input.allowedPaymentMethods || + this.allowedPaymentMethods != null && + input.allowedPaymentMethods != null && + this.allowedPaymentMethods.SequenceEqual(input.allowedPaymentMethods) + ) && + ( + this.amount == input.amount || + (this.amount != null && + this.amount.Equals(input.amount)) + ) && + ( + this.applicationInfo == input.applicationInfo || + (this.applicationInfo != null && + this.applicationInfo.Equals(input.applicationInfo)) + ) && + ( + this.billingAddress == input.billingAddress || + (this.billingAddress != null && + this.billingAddress.Equals(input.billingAddress)) + ) && + ( + this.blockedPaymentMethods == input.blockedPaymentMethods || + this.blockedPaymentMethods != null && + input.blockedPaymentMethods != null && + this.blockedPaymentMethods.SequenceEqual(input.blockedPaymentMethods) + ) && + ( + this.captureDelayHours == input.captureDelayHours || + (this.captureDelayHours != null && + this.captureDelayHours.Equals(input.captureDelayHours)) + ) && + ( + this.channel == input.channel || + (this.channel != null && + this.channel.Equals(input.channel)) + ) && + ( + this.company == input.company || + (this.company != null && + this.company.Equals(input.company)) + ) && + ( + this.countryCode == input.countryCode || + (this.countryCode != null && + this.countryCode.Equals(input.countryCode)) + ) && + ( + this.dateOfBirth == input.dateOfBirth || + (this.dateOfBirth != null && + this.dateOfBirth.Equals(input.dateOfBirth)) + ) && + ( + this.deliveryAddress == input.deliveryAddress || + (this.deliveryAddress != null && + this.deliveryAddress.Equals(input.deliveryAddress)) + ) && + ( + this.enableOneClick == input.enableOneClick || + (this.enableOneClick != null && + this.enableOneClick.Equals(input.enableOneClick)) + ) && + ( + this.enablePayOut == input.enablePayOut || + (this.enablePayOut != null && + this.enablePayOut.Equals(input.enablePayOut)) + ) && + ( + this.enableRecurring == input.enableRecurring || + (this.enableRecurring != null && + this.enableRecurring.Equals(input.enableRecurring)) + ) && + ( + this.expiresAt == input.expiresAt || + (this.expiresAt != null && + this.expiresAt.Equals(input.expiresAt)) + ) && + ( + this.id == input.id || + (this.id != null && + this.id.Equals(input.id)) + ) && + ( + this.lineItems == input.lineItems || + this.lineItems != null && + input.lineItems != null && + this.lineItems.SequenceEqual(input.lineItems) + ) && + ( + this.mandate == input.mandate || + (this.mandate != null && + this.mandate.Equals(input.mandate)) + ) && + ( + this.mcc == input.mcc || + (this.mcc != null && + this.mcc.Equals(input.mcc)) + ) && + ( + this.merchantAccount == input.merchantAccount || + (this.merchantAccount != null && + this.merchantAccount.Equals(input.merchantAccount)) + ) && + ( + this.merchantOrderReference == input.merchantOrderReference || + (this.merchantOrderReference != null && + this.merchantOrderReference.Equals(input.merchantOrderReference)) + ) && + ( + this.metadata == input.metadata || + this.metadata != null && + input.metadata != null && + this.metadata.SequenceEqual(input.metadata) + ) && + ( + this.mpiData == input.mpiData || + (this.mpiData != null && + this.mpiData.Equals(input.mpiData)) + ) && + ( + this.recurringExpiry == input.recurringExpiry || + (this.recurringExpiry != null && + this.recurringExpiry.Equals(input.recurringExpiry)) + ) && + ( + this.recurringFrequency == input.recurringFrequency || + (this.recurringFrequency != null && + this.recurringFrequency.Equals(input.recurringFrequency)) + ) && + ( + this.recurringProcessingModel == input.recurringProcessingModel || + (this.recurringProcessingModel != null && + this.recurringProcessingModel.Equals(input.recurringProcessingModel)) + ) && + ( + this.redirectFromIssuerMethod == input.redirectFromIssuerMethod || + (this.redirectFromIssuerMethod != null && + this.redirectFromIssuerMethod.Equals(input.redirectFromIssuerMethod)) + ) && + ( + this.redirectToIssuerMethod == input.redirectToIssuerMethod || + (this.redirectToIssuerMethod != null && + this.redirectToIssuerMethod.Equals(input.redirectToIssuerMethod)) + ) && + ( + this.reference == input.reference || + (this.reference != null && + this.reference.Equals(input.reference)) + ) && + ( + this.returnUrl == input.returnUrl || + (this.returnUrl != null && + this.returnUrl.Equals(input.returnUrl)) + ) && + ( + this.riskData == input.riskData || + (this.riskData != null && + this.riskData.Equals(input.riskData)) + ) && + ( + this.sessionData == input.sessionData || + (this.sessionData != null && + this.sessionData.Equals(input.sessionData)) + ) && + ( + this.shopperEmail == input.shopperEmail || + (this.shopperEmail != null && + this.shopperEmail.Equals(input.shopperEmail)) + ) && + ( + this.shopperIP == input.shopperIP || + (this.shopperIP != null && + this.shopperIP.Equals(input.shopperIP)) + ) && + ( + this.shopperInteraction == input.shopperInteraction || + (this.shopperInteraction != null && + this.shopperInteraction.Equals(input.shopperInteraction)) + ) && + ( + this.shopperLocale == input.shopperLocale || + (this.shopperLocale != null && + this.shopperLocale.Equals(input.shopperLocale)) + ) && + ( + this.shopperName == input.shopperName || + (this.shopperName != null && + this.shopperName.Equals(input.shopperName)) + ) && + ( + this.shopperReference == input.shopperReference || + (this.shopperReference != null && + this.shopperReference.Equals(input.shopperReference)) + ) && + ( + this.shopperStatement == input.shopperStatement || + (this.shopperStatement != null && + this.shopperStatement.Equals(input.shopperStatement)) + ) && + ( + this.socialSecurityNumber == input.socialSecurityNumber || + (this.socialSecurityNumber != null && + this.socialSecurityNumber.Equals(input.socialSecurityNumber)) + ) && + ( + this.splitCardFundingSources == input.splitCardFundingSources || + (this.splitCardFundingSources != null && + this.splitCardFundingSources.Equals(input.splitCardFundingSources)) + ) && + ( + this.splits == input.splits || + this.splits != null && + input.splits != null && + this.splits.SequenceEqual(input.splits) + ) && + ( + this.storePaymentMethod == input.storePaymentMethod || + (this.storePaymentMethod != null && + this.storePaymentMethod.Equals(input.storePaymentMethod)) + ) && + ( + this.telephoneNumber == input.telephoneNumber || + (this.telephoneNumber != null && + this.telephoneNumber.Equals(input.telephoneNumber)) + ) && + ( + this.threeDSAuthenticationOnly == input.threeDSAuthenticationOnly || + (this.threeDSAuthenticationOnly != null && + this.threeDSAuthenticationOnly.Equals(input.threeDSAuthenticationOnly)) + ) && + ( + this.trustedShopper == input.trustedShopper || + (this.trustedShopper != null && + this.trustedShopper.Equals(input.trustedShopper)) + ); + } + + /// <summary> + /// Gets the hash code + /// </summary> + /// <returns>Hash code</returns> + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.accountInfo != null) + hashCode = hashCode * 59 + this.accountInfo.GetHashCode(); + if (this.additionalAmount != null) + hashCode = hashCode * 59 + this.additionalAmount.GetHashCode(); + if (this.additionalData != null) + hashCode = hashCode * 59 + this.additionalData.GetHashCode(); + if (this.allowedPaymentMethods != null) + hashCode = hashCode * 59 + this.allowedPaymentMethods.GetHashCode(); + if (this.amount != null) + hashCode = hashCode * 59 + this.amount.GetHashCode(); + if (this.applicationInfo != null) + hashCode = hashCode * 59 + this.applicationInfo.GetHashCode(); + if (this.billingAddress != null) + hashCode = hashCode * 59 + this.billingAddress.GetHashCode(); + if (this.blockedPaymentMethods != null) + hashCode = hashCode * 59 + this.blockedPaymentMethods.GetHashCode(); + if (this.captureDelayHours != null) + hashCode = hashCode * 59 + this.captureDelayHours.GetHashCode(); + if (this.channel != null) + hashCode = hashCode * 59 + this.channel.GetHashCode(); + if (this.company != null) + hashCode = hashCode * 59 + this.company.GetHashCode(); + if (this.countryCode != null) + hashCode = hashCode * 59 + this.countryCode.GetHashCode(); + if (this.dateOfBirth != null) + hashCode = hashCode * 59 + this.dateOfBirth.GetHashCode(); + if (this.deliveryAddress != null) + hashCode = hashCode * 59 + this.deliveryAddress.GetHashCode(); + if (this.enableOneClick != null) + hashCode = hashCode * 59 + this.enableOneClick.GetHashCode(); + if (this.enablePayOut != null) + hashCode = hashCode * 59 + this.enablePayOut.GetHashCode(); + if (this.enableRecurring != null) + hashCode = hashCode * 59 + this.enableRecurring.GetHashCode(); + if (this.expiresAt != null) + hashCode = hashCode * 59 + this.expiresAt.GetHashCode(); + if (this.id != null) + hashCode = hashCode * 59 + this.id.GetHashCode(); + if (this.lineItems != null) + hashCode = hashCode * 59 + this.lineItems.GetHashCode(); + if (this.mandate != null) + hashCode = hashCode * 59 + this.mandate.GetHashCode(); + if (this.mcc != null) + hashCode = hashCode * 59 + this.mcc.GetHashCode(); + if (this.merchantAccount != null) + hashCode = hashCode * 59 + this.merchantAccount.GetHashCode(); + if (this.merchantOrderReference != null) + hashCode = hashCode * 59 + this.merchantOrderReference.GetHashCode(); + if (this.metadata != null) + hashCode = hashCode * 59 + this.metadata.GetHashCode(); + if (this.mpiData != null) + hashCode = hashCode * 59 + this.mpiData.GetHashCode(); + if (this.recurringExpiry != null) + hashCode = hashCode * 59 + this.recurringExpiry.GetHashCode(); + if (this.recurringFrequency != null) + hashCode = hashCode * 59 + this.recurringFrequency.GetHashCode(); + if (this.recurringProcessingModel != null) + hashCode = hashCode * 59 + this.recurringProcessingModel.GetHashCode(); + if (this.redirectFromIssuerMethod != null) + hashCode = hashCode * 59 + this.redirectFromIssuerMethod.GetHashCode(); + if (this.redirectToIssuerMethod != null) + hashCode = hashCode * 59 + this.redirectToIssuerMethod.GetHashCode(); + if (this.reference != null) + hashCode = hashCode * 59 + this.reference.GetHashCode(); + if (this.returnUrl != null) + hashCode = hashCode * 59 + this.returnUrl.GetHashCode(); + if (this.riskData != null) + hashCode = hashCode * 59 + this.riskData.GetHashCode(); + if (this.sessionData != null) + hashCode = hashCode * 59 + this.sessionData.GetHashCode(); + if (this.shopperEmail != null) + hashCode = hashCode * 59 + this.shopperEmail.GetHashCode(); + if (this.shopperIP != null) + hashCode = hashCode * 59 + this.shopperIP.GetHashCode(); + if (this.shopperInteraction != null) + hashCode = hashCode * 59 + this.shopperInteraction.GetHashCode(); + if (this.shopperLocale != null) + hashCode = hashCode * 59 + this.shopperLocale.GetHashCode(); + if (this.shopperName != null) + hashCode = hashCode * 59 + this.shopperName.GetHashCode(); + if (this.shopperReference != null) + hashCode = hashCode * 59 + this.shopperReference.GetHashCode(); + if (this.shopperStatement != null) + hashCode = hashCode * 59 + this.shopperStatement.GetHashCode(); + if (this.socialSecurityNumber != null) + hashCode = hashCode * 59 + this.socialSecurityNumber.GetHashCode(); + if (this.splitCardFundingSources != null) + hashCode = hashCode * 59 + this.splitCardFundingSources.GetHashCode(); + if (this.splits != null) + hashCode = hashCode * 59 + this.splits.GetHashCode(); + if (this.storePaymentMethod != null) + hashCode = hashCode * 59 + this.storePaymentMethod.GetHashCode(); + if (this.telephoneNumber != null) + hashCode = hashCode * 59 + this.telephoneNumber.GetHashCode(); + if (this.threeDSAuthenticationOnly != null) + hashCode = hashCode * 59 + this.threeDSAuthenticationOnly.GetHashCode(); + if (this.trustedShopper != null) + hashCode = hashCode * 59 + this.trustedShopper.GetHashCode(); + return hashCode; + } + } + + /// <summary> + /// To validate all properties of the instance + /// </summary> + /// <param name="validationContext">Validation context</param> + /// <returns>Validation Result</returns> + IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/Adyen/Service/Checkout.cs b/Adyen/Service/Checkout.cs index 392db42bb..c20a810f2 100644 --- a/Adyen/Service/Checkout.cs +++ b/Adyen/Service/Checkout.cs @@ -39,6 +39,7 @@ public class Checkout : AbstractService private PaymentSession _paymentSession; private PaymentsResult _paymentsResult; private PaymentLinks _paymentLinksResult; + private Sessions _sessions; public Checkout(Client client) : base(client) { @@ -49,6 +50,7 @@ public Checkout(Client client) : base(client) _paymentSession = new PaymentSession(this); _paymentsResult = new PaymentsResult(this); _paymentLinksResult = new PaymentLinks(this); + _sessions = new Sessions(this); } /// <summary> @@ -196,5 +198,29 @@ public async Task<PaymentLinkResource> PaymentLinksAsync(CreatePaymentLinkReques var jsonResponse = await _paymentLinksResult.RequestAsync(jsonRequest); return JsonConvert.DeserializeObject<PaymentLinkResource>(jsonResponse); } + + /// <summary> + /// POST /sessions API call + /// </summary> + /// <param name="createCheckoutSessionRequest"></param> + /// <returns>CreateCheckoutSessionResponse</returns> + public CreateCheckoutSessionResponse Sessions(CreateCheckoutSessionRequest createCheckoutSessionRequest) + { + var jsonRequest = Util.JsonOperation.SerializeRequest(createCheckoutSessionRequest); + var jsonResponse =_sessions.Request(jsonRequest); + return JsonConvert.DeserializeObject<CreateCheckoutSessionResponse>(jsonResponse); + } + + /// <summary> + /// POST /sessions API call async + /// </summary> + /// <param name="createPaymentLinkRequest"></param> + /// <returns>CreateCheckoutSessionResponse</returns> + public async Task<CreateCheckoutSessionResponse> SessionsAsync(CreateCheckoutSessionRequest createCheckoutSessionRequest) + { + var jsonRequest = Util.JsonOperation.SerializeRequest(createCheckoutSessionRequest); + var jsonResponse = await _sessions.RequestAsync(jsonRequest); + return JsonConvert.DeserializeObject<CreateCheckoutSessionResponse>(jsonResponse); + } } } diff --git a/Adyen/Service/Resource/Checkout/Sessions.cs b/Adyen/Service/Resource/Checkout/Sessions.cs new file mode 100644 index 000000000..ae464aff5 --- /dev/null +++ b/Adyen/Service/Resource/Checkout/Sessions.cs @@ -0,0 +1,36 @@ +#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.Constants; +using System.Collections.Generic; + +namespace Adyen.Service.Resource.Checkout +{ + public class Sessions : ServiceResource + { + public Sessions(AbstractService abstractService) + : base(abstractService, abstractService.Client.Config.CheckoutEndpoint + "/" + ClientConfig.CheckoutApiVersion + "/sessions", new List<string> { "amount", "reference", "returnUrl", "merchantAccount" }) + { + } + } +} diff --git a/README.md b/README.md index 8e3c60edd..209fd3a76 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 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** +* [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v68/overview): Our latest integration for accepting online payments. Current supported version: **v68** * [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/v49/overview): Endpoints for managing saved payment details. Current supported version: **v49** * [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v51/overview): Endpoints for sending funds to your customers. Current supported version: **v51** From 7f04c0690d8e396ccc6bb074a08485e6c576d250 Mon Sep 17 00:00:00 2001 From: alexandros <alexandros.moraitis@adyen.com> Date: Thu, 7 Oct 2021 14:30:13 +0200 Subject: [PATCH 12/12] bump the version --- Adyen.Test/Adyen.Test.csproj | 6 ++--- Adyen/Adyen.csproj | 8 +++---- Adyen/Constants/ClientConfig.cs | 42 ++++++++++++++++----------------- Adyen/Service/Checkout.cs | 40 +++++++++++++++---------------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index 069137ae5..cb5f4e450 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -5,11 +5,11 @@ <IsPackable>false</IsPackable> - <AssemblyVersion>7.3.0</AssemblyVersion> + <AssemblyVersion>8.0.0</AssemblyVersion> - <FileVersion>7.3.0</FileVersion> + <FileVersion>8.0.0</FileVersion> - <Version>7.3.0</Version> + <Version>8.0.0</Version> <LangVersion>7.2</LangVersion> </PropertyGroup> diff --git a/Adyen/Adyen.csproj b/Adyen/Adyen.csproj index 26ab70e96..71b845789 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -4,15 +4,15 @@ <TargetFrameworks>netstandard2.0</TargetFrameworks> <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <Copyright>Adyen</Copyright> - <Version>7.3.0</Version> - <AssemblyVersion>7.3.0</AssemblyVersion> - <FileVersion>7.3.0</FileVersion> + <Version>8.0.0</Version> + <AssemblyVersion>8.0.0</AssemblyVersion> + <FileVersion>8.0.0</FileVersion> <GeneratePackageOnBuild>true</GeneratePackageOnBuild> <Description>The Adyen API Library for .net core enables you to work with Adyen APIs, Hosted Payment Pages and terminal api with any .net application.</Description> <PackageProjectUrl>https://github.com/Adyen/adyen-dotnet-api-library</PackageProjectUrl> <RepositoryUrl>https://github.com/Adyen/adyen-dotnet-api-library</RepositoryUrl> <RepositoryType>git</RepositoryType> - <PackageTags>7.3.0</PackageTags> + <PackageTags>8.0.0</PackageTags> <PackageLicenseExpression>MIT</PackageLicenseExpression> <Authors>Adyen</Authors> <Company>Adyen</Company> diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index 5aecd8196..b294067df 100644 --- a/Adyen/Constants/ClientConfig.cs +++ b/Adyen/Constants/ClientConfig.cs @@ -1,24 +1,24 @@ #region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Dotnet API Library + * + * Copyright (c) 2021 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ #endregion namespace Adyen.Constants @@ -58,6 +58,6 @@ public class ClientConfig public static string BinLookupApiVersion = "v50"; public static string LibName = "adyen-dotnet-api-library"; - public static string LibVersion = "7.3.0"; + public static string LibVersion = "8.0.0"; } } diff --git a/Adyen/Service/Checkout.cs b/Adyen/Service/Checkout.cs index c20a810f2..fae3f6fe6 100644 --- a/Adyen/Service/Checkout.cs +++ b/Adyen/Service/Checkout.cs @@ -1,24 +1,24 @@ #region License -// /* -// * ###### -// * ###### -// * ############ ####( ###### #####. ###### ############ ############ -// * ############# #####( ###### #####. ###### ############# ############# -// * ###### #####( ###### #####. ###### ##### ###### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### -// * ###### ###### #####( ###### #####. ###### ##### ##### ###### -// * ############# ############# ############# ############# ##### ###### -// * ############ ############ ############# ############ ##### ###### -// * ###### -// * ############# -// * ############ -// * -// * Adyen Dotnet API Library -// * -// * Copyright (c) 2020 Adyen B.V. -// * This file is open source and available under the MIT license. -// * See the LICENSE file for more info. -// */ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Dotnet API Library + * + * Copyright (c) 2021 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ #endregion using System.Threading.Tasks;