diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f1fb42139..7d4c07a1d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek @deepu105 +* @Aleffio @AlexandrosMor @martinsrenato @rikterbeek @zaiddreakh @wboereboom diff --git a/Adyen.Test/Adyen.Test.csproj b/Adyen.Test/Adyen.Test.csproj index 235026765..069137ae5 100644 --- a/Adyen.Test/Adyen.Test.csproj +++ b/Adyen.Test/Adyen.Test.csproj @@ -5,11 +5,11 @@ false - 7.2.0 + 7.3.0 - 7.2.0 + 7.3.0 - 7.2.0 + 7.3.0 7.2 @@ -33,12 +33,12 @@ - + - + - + 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) /// IClient implementation 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/Adyen.csproj b/Adyen/Adyen.csproj index e97b5dd9b..26ab70e96 100644 --- a/Adyen/Adyen.csproj +++ b/Adyen/Adyen.csproj @@ -4,15 +4,15 @@ netstandard2.0 false Adyen - 7.2.0 - 7.2.0 - 7.2.0 + 7.3.0 + 7.3.0 + 7.3.0 true The Adyen API Library for .net core enables you to work with Adyen APIs, Hosted Payment Pages and terminal api with any .net application. https://github.com/Adyen/adyen-dotnet-api-library https://github.com/Adyen/adyen-dotnet-api-library git - 7.2.0 + 7.3.0 MIT Adyen Adyen 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/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"; } } diff --git a/Adyen/Constants/ClientConfig.cs b/Adyen/Constants/ClientConfig.cs index 876d319ae..d9677302f 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"; @@ -53,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"; } } 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 /// [EnumMember(Value = "Success")] - Success = 12 + Success = 12, + /// + /// Enum Refused for value: AuthenticationNotRequired + /// + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 13 } /// /// 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 /// /// Enum Refused for value: Refused /// - [EnumMember(Value = "Refused")] Refused = 11 + [EnumMember(Value = "Refused")] Refused = 11, + + /// + /// Enum Refused for value: AuthenticationNotRequired + /// + [EnumMember(Value = "AuthenticationNotRequired")] AuthenticationNotRequired = 12, } /// @@ -460,4 +465,4 @@ public override int GetHashCode() yield break; } } -} \ No newline at end of file +} 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 /// verification (required). public CreateAccountHolderResponse(string accountCode = default(string), string accountHolderCode = default(string), AccountHolderDetails accountHolderDetails = default(AccountHolderDetails), AccountHolderStatus accountHolderStatus = default(AccountHolderStatus), string description = default(string), List invalidFields = default(List), 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; 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) { 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.