diff --git a/src/CheckoutSdk/Common/Exemption.cs b/src/CheckoutSdk/Common/Exemption.cs index ef2974e6..0b04ecb6 100644 --- a/src/CheckoutSdk/Common/Exemption.cs +++ b/src/CheckoutSdk/Common/Exemption.cs @@ -4,14 +4,20 @@ namespace Checkout.Common { public enum Exemption { - [EnumMember(Value = "3ds_outage")] ThreeDsOutage, + [EnumMember(Value = "3ds_outage")] + ThreeDsOutage, [EnumMember(Value = "low_risk_program")] LowRiskProgram, - [EnumMember(Value = "low_value")] LowValue, - [EnumMember(Value = "none")] None, - [EnumMember(Value = "other")] Other, + [EnumMember(Value = "low_value")] + LowValue, + + [EnumMember(Value = "none")] + None, + + [EnumMember(Value = "other")] + Other, [EnumMember(Value = "out_of_sca_scope")] OutOfScaScope, @@ -19,7 +25,11 @@ public enum Exemption [EnumMember(Value = "recurring_operation")] RecurringOperation, - [EnumMember(Value = "sca_delegation")] ScaDelegation, + [EnumMember(Value = "data_share")] + DataShare, + + [EnumMember(Value = "sca_delegation")] + ScaDelegation, [EnumMember(Value = "secure_corporate_payment")] SecureCorporatePayment, diff --git a/src/CheckoutSdk/Payments/PreferredExperiences.cs b/src/CheckoutSdk/Payments/PreferredExperiences.cs new file mode 100644 index 00000000..3b6769b6 --- /dev/null +++ b/src/CheckoutSdk/Payments/PreferredExperiences.cs @@ -0,0 +1,13 @@ +using System.Runtime.Serialization; + +namespace Checkout.Payments +{ + public enum PreferredExperiences + { + [EnumMember(Value = "google_spa")] + GoogleSpa, + + [EnumMember(Value = "3ds")] + ThreeDs, + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Payments/Request/Authentication.cs b/src/CheckoutSdk/Payments/Request/Authentication.cs new file mode 100644 index 00000000..d5a544c0 --- /dev/null +++ b/src/CheckoutSdk/Payments/Request/Authentication.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Checkout.Payments.Request +{ + public class Authentication + { + public IList PreferredExperiences { get; set; } + } +} \ No newline at end of file diff --git a/src/CheckoutSdk/Payments/Request/PaymentRequest.cs b/src/CheckoutSdk/Payments/Request/PaymentRequest.cs index 00db7708..562d5361 100644 --- a/src/CheckoutSdk/Payments/Request/PaymentRequest.cs +++ b/src/CheckoutSdk/Payments/Request/PaymentRequest.cs @@ -26,6 +26,8 @@ public class PaymentRequest public string Reference { get; set; } public string Description { get; set; } + + public Authentication Authentication { get; set; } public AuthorizationType? AuthorizationType { get; set; } diff --git a/test/CheckoutSdkTest/Disputes/DisputesClientTest.cs b/test/CheckoutSdkTest/Disputes/DisputesClientTest.cs index 97f6ed3e..ea77c0d6 100644 --- a/test/CheckoutSdkTest/Disputes/DisputesClientTest.cs +++ b/test/CheckoutSdkTest/Disputes/DisputesClientTest.cs @@ -132,6 +132,24 @@ private async Task ShouldSubmitEvidence() response.ShouldNotBeNull(); } + [Fact] + private async Task ShouldSubmitArbitrationEvidence() + { + const string disputeId = "dsp_s5151531"; + + _apiClient.Setup(apiClient => + apiClient.Post($"disputes/{disputeId}/evidence/arbitration", _authorization, null, + CancellationToken.None, + null)) + .ReturnsAsync(() => new EmptyResponse()); + + IDisputesClient client = new DisputesClient(_apiClient.Object, _configuration.Object); + + var response = await client.SubmitArbitrationEvidence(disputeId); + + response.ShouldNotBeNull(); + } + [Fact] private async Task ShouldGetCompiledSubmittedEvidence() { @@ -148,6 +166,23 @@ private async Task ShouldGetCompiledSubmittedEvidence() response.ShouldNotBeNull(); } + + [Fact] + private async Task ShouldGetCompiledSubmittedArbitrationEvidence() + { + const string disputeId = "dispute_id"; + + _apiClient.Setup(apiClient => + apiClient.Get($"disputes/{disputeId}/evidence/arbitration/submitted", _authorization, + CancellationToken.None)) + .ReturnsAsync(() => new DisputeCompiledSubmittedEvidenceResponse()); + + IDisputesClient client = new DisputesClient(_apiClient.Object, _configuration.Object); + + var response = await client.GetCompiledSubmittedArbitrationEvidence(disputeId); + + response.ShouldNotBeNull(); + } [Fact] private async Task ShouldGetDisputeSchemeFiles() diff --git a/test/CheckoutSdkTest/Payments/Hosted/HostedPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Hosted/HostedPaymentsIntegrationTest.cs index 4c16876d..4309da63 100644 --- a/test/CheckoutSdkTest/Payments/Hosted/HostedPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Hosted/HostedPaymentsIntegrationTest.cs @@ -25,7 +25,6 @@ private async Task ShouldCreateAndGetHostedPayment() createResponse.Reference.ShouldNotBeNullOrEmpty(); createResponse.Links.ShouldNotBeNull(); createResponse.Links.ContainsKey("redirect").ShouldBeTrue(); - createResponse.Warnings.Count.ShouldBe(1); var getResponse = await DefaultApi.HostedPaymentsClient().GetHostedPaymentsPageDetails(createResponse.Id); diff --git a/test/CheckoutSdkTest/Payments/Links/PaymentLinksIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Links/PaymentLinksIntegrationTest.cs index e4abc03d..08a25828 100644 --- a/test/CheckoutSdkTest/Payments/Links/PaymentLinksIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Links/PaymentLinksIntegrationTest.cs @@ -60,7 +60,6 @@ private async Task ShouldCreateAndGetPaymentLink() response.Links.ShouldNotBeNull(); response.Links.Count.ShouldBe(2); response.Reference.ShouldNotBeNull(); - response.Warnings.Count.ShouldBe(1); var responseGet = await DefaultApi.PaymentLinksClient().Get(response.Id); diff --git a/test/CheckoutSdkTest/Payments/PaymentAuthorizationsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/PaymentAuthorizationsIntegrationTest.cs index 6a7def29..46ed0147 100644 --- a/test/CheckoutSdkTest/Payments/PaymentAuthorizationsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/PaymentAuthorizationsIntegrationTest.cs @@ -5,6 +5,7 @@ using Checkout.Payments.Sender; using Shouldly; using System; +using System.Collections.Generic; using System.Threading.Tasks; using Xunit; @@ -98,7 +99,15 @@ private async Task MakeAuthorizationEstimatedPayment() PartialAuthorization = new PartialAuthorization { Enabled = true + }, + Authentication = new Authentication + { + PreferredExperiences = new List + { + PreferredExperiences.GoogleSpa + } } + }; var paymentResponse = await DefaultApi.PaymentsClient().RequestPayment(paymentRequest); diff --git a/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs index eb36b100..7bbc8502 100644 --- a/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/RequestApmPaymentsIntegrationTest.cs @@ -81,7 +81,7 @@ private async Task ShouldMakeIdealPayment() source.Type().ShouldBe(PaymentSourceType.Ideal); } - [Fact] + [Fact(Skip = "payment method not supported")] private async Task ShouldMakeSofortPayment() { var sofortSource = new RequestSofortSource();