From de43024b5461dc3f5af45a6dd0485663f1b6f9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:07:11 +0100 Subject: [PATCH 1/2] Add discount enum item --- src/CheckoutSdk/Payments/Contexts/PaymentContextItemType.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CheckoutSdk/Payments/Contexts/PaymentContextItemType.cs b/src/CheckoutSdk/Payments/Contexts/PaymentContextItemType.cs index 91601a27..5084c22a 100644 --- a/src/CheckoutSdk/Payments/Contexts/PaymentContextItemType.cs +++ b/src/CheckoutSdk/Payments/Contexts/PaymentContextItemType.cs @@ -9,5 +9,8 @@ public enum PaymentContextItemType [EnumMember(Value = "digital")] Digital, + + [EnumMember(Value = "discount")] + Discount, } } \ No newline at end of file From 5dfd182389e9156ec93ff8e3cd44206d933cbdd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:59:32 +0100 Subject: [PATCH 2/2] Update test. Previous unavailable --- test/CheckoutSdkTest/CheckoutSdkIntegrationTest.cs | 14 ++++++-------- .../Instruments/InstrumentsIntegrationTest.cs | 4 ++-- .../CheckoutSdkTest/Payments/PaymentsClientTest.cs | 2 +- .../Payments/PayoutsIntegrationTest.cs | 4 ++-- .../Previous/RefundPaymentsIntegrationTest.cs | 4 ++-- .../Previous/RequestPaymentsIntegrationTest.cs | 2 +- .../Previous/RequestPayoutsIntegrationTest.cs | 2 +- .../CheckoutSdkTest/Sessions/SessionsClientTest.cs | 2 +- 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/test/CheckoutSdkTest/CheckoutSdkIntegrationTest.cs b/test/CheckoutSdkTest/CheckoutSdkIntegrationTest.cs index cb699569..288322ee 100644 --- a/test/CheckoutSdkTest/CheckoutSdkIntegrationTest.cs +++ b/test/CheckoutSdkTest/CheckoutSdkIntegrationTest.cs @@ -17,10 +17,9 @@ public async Task ShouldInstantiateClientWithCustomHttpClientFactory() { var checkoutApi = CheckoutSdk .Builder() - .Previous() .StaticKeys() - .PublicKey(System.Environment.GetEnvironmentVariable("CHECKOUT_PREVIOUS_PUBLIC_KEY")) - .SecretKey(System.Environment.GetEnvironmentVariable("CHECKOUT_PREVIOUS_SECRET_KEY")) + .PublicKey(System.Environment.GetEnvironmentVariable("CHECKOUT_DEFAULT_PUBLIC_KEY")) + .SecretKey(System.Environment.GetEnvironmentVariable("CHECKOUT_DEFAULT_SECRET_KEY")) .Environment(Environment.Sandbox) .HttpClientFactory(new TestingClientFactory()) .Build(); @@ -29,7 +28,7 @@ public async Task ShouldInstantiateClientWithCustomHttpClientFactory() try { - await checkoutApi.EventsClient().RetrieveAllEventTypes(); + await checkoutApi.WorkflowsClient().GetWorkflows(); throw new XunitException(); } catch (CheckoutApiException ex) @@ -45,10 +44,9 @@ public async Task ShouldInstantiateClientWithSubdomainFactory() { var checkoutApi = CheckoutSdk .Builder() - .Previous() .StaticKeys() - .PublicKey(System.Environment.GetEnvironmentVariable("CHECKOUT_PREVIOUS_PUBLIC_KEY")) - .SecretKey(System.Environment.GetEnvironmentVariable("CHECKOUT_PREVIOUS_SECRET_KEY")) + .PublicKey(System.Environment.GetEnvironmentVariable("CHECKOUT_DEFAULT_PUBLIC_KEY")) + .SecretKey(System.Environment.GetEnvironmentVariable("CHECKOUT_DEFAULT_SECRET_KEY")) .Environment(Environment.Sandbox) .EnvironmentSubdomain(System.Environment.GetEnvironmentVariable("CHECKOUT_MERCHANT_SUBDOMAIN")) .HttpClientFactory(new TestingClientFactory()) @@ -58,7 +56,7 @@ public async Task ShouldInstantiateClientWithSubdomainFactory() try { - await checkoutApi.EventsClient().RetrieveAllEventTypes(); + await checkoutApi.WorkflowsClient().GetWorkflows(); throw new XunitException(); } catch (CheckoutApiException ex) diff --git a/test/CheckoutSdkTest/Instruments/InstrumentsIntegrationTest.cs b/test/CheckoutSdkTest/Instruments/InstrumentsIntegrationTest.cs index 57b71e27..abdc840c 100644 --- a/test/CheckoutSdkTest/Instruments/InstrumentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Instruments/InstrumentsIntegrationTest.cs @@ -114,7 +114,7 @@ private async Task ShouldUpdateCardInstrument() var updateCardInstrument = new UpdateCardInstrumentRequest { ExpiryMonth = 12, - ExpiryYear = 2024, + ExpiryYear = 2030, Name = "John Doe", Customer = new UpdateCustomerRequest {Id = tokenInstrument.Customer.Id, Default = true}, AccountHolder = new AccountHolder @@ -148,7 +148,7 @@ private async Task ShouldUpdateCardInstrument() cardResponse.Id.ShouldNotBeNull(); cardResponse.Fingerprint.ShouldNotBeNull(); cardResponse.ExpiryMonth.ShouldBe(12); - cardResponse.ExpiryYear.ShouldBe(2024); + cardResponse.ExpiryYear.ShouldBe(2030); cardResponse.Customer.Default.ShouldBeTrue(); cardResponse.AccountHolder.FirstName.ShouldBe("John"); cardResponse.AccountHolder.LastName.ShouldBe("Doe"); diff --git a/test/CheckoutSdkTest/Payments/PaymentsClientTest.cs b/test/CheckoutSdkTest/Payments/PaymentsClientTest.cs index 36c5b83b..28b35e61 100644 --- a/test/CheckoutSdkTest/Payments/PaymentsClientTest.cs +++ b/test/CheckoutSdkTest/Payments/PaymentsClientTest.cs @@ -135,7 +135,7 @@ private async Task ShouldRequestPayment_IdempotencyKey() Stored = false, BillingAddress = new Address(), ExpiryMonth = 12, - ExpiryYear = 2024, + ExpiryYear = 2030, TokenType = NetworkTokenType.Vts } }; diff --git a/test/CheckoutSdkTest/Payments/PayoutsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/PayoutsIntegrationTest.cs index 31562f6f..9634e9b4 100644 --- a/test/CheckoutSdkTest/Payments/PayoutsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/PayoutsIntegrationTest.cs @@ -27,7 +27,7 @@ private async Task ShouldMakeCardPayoutPayments() { Number = "5219565036325411", ExpiryMonth = 12, - ExpiryYear = 2024, + ExpiryYear = 2030, AccountHolder = new AccountHolder { Type = AccountHolderType.Individual, @@ -50,7 +50,7 @@ private async Task ShouldMakeCardPayoutPayments() Type = AccountHolderIdentificationType.Passport, Number = "E2341", IssuingCountry = CountryCode.FR, - DateOfExpiry = "2024-05-05" + DateOfExpiry = "2030-05-05" }, Email = "jonh.smith@checkout.com" } diff --git a/test/CheckoutSdkTest/Payments/Previous/RefundPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Previous/RefundPaymentsIntegrationTest.cs index 470cc263..b227bf64 100644 --- a/test/CheckoutSdkTest/Payments/Previous/RefundPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Previous/RefundPaymentsIntegrationTest.cs @@ -7,7 +7,7 @@ namespace Checkout.Payments.Previous { public class RefundPaymentsIntegrationTest : AbstractPaymentsIntegrationTest { - [Fact] + [Fact(Skip = "unavailable")] private async Task ShouldRefundCardPayment() { var paymentResponse = await MakeCardPayment(true); @@ -23,7 +23,7 @@ private async Task ShouldRefundCardPayment() response.GetLink("payment").ShouldNotBeNull(); } - [Fact] + [Fact(Skip = "unavailable")] private async Task ShouldRefundCardPayment_Idempotently() { var paymentResponse = await MakeCardPayment(true); diff --git a/test/CheckoutSdkTest/Payments/Previous/RequestPaymentsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Previous/RequestPaymentsIntegrationTest.cs index a3b9b061..0a431219 100644 --- a/test/CheckoutSdkTest/Payments/Previous/RequestPaymentsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Previous/RequestPaymentsIntegrationTest.cs @@ -159,7 +159,7 @@ private async Task ShouldMakeCardVerification() paymentResponse.HasLink("void").ShouldBeFalse(); } - [Fact] + [Fact(Skip = "unavailable")] private async Task ShouldMakeCard3dsPayment() { var paymentResponse = await Make3dsCardPayment(); diff --git a/test/CheckoutSdkTest/Payments/Previous/RequestPayoutsIntegrationTest.cs b/test/CheckoutSdkTest/Payments/Previous/RequestPayoutsIntegrationTest.cs index 92d3bac4..42de8cc0 100644 --- a/test/CheckoutSdkTest/Payments/Previous/RequestPayoutsIntegrationTest.cs +++ b/test/CheckoutSdkTest/Payments/Previous/RequestPayoutsIntegrationTest.cs @@ -11,7 +11,7 @@ namespace Checkout.Payments.Previous { public class RequestPayoutsIntegrationTest : AbstractPaymentsIntegrationTest { - [Fact] + [Fact(Skip = "unavailable")] private async Task ShouldRequestPayout() { var phone = new Phone {CountryCode = "44", Number = "020 222333"}; diff --git a/test/CheckoutSdkTest/Sessions/SessionsClientTest.cs b/test/CheckoutSdkTest/Sessions/SessionsClientTest.cs index 014389f0..44b3db17 100644 --- a/test/CheckoutSdkTest/Sessions/SessionsClientTest.cs +++ b/test/CheckoutSdkTest/Sessions/SessionsClientTest.cs @@ -56,7 +56,7 @@ private async Task ShouldRequestSessionCreateSessionOkResponse() { Source = new SessionNetworkTokenSource { - Token = "token", ExpiryMonth = 12, ExpiryYear = 2024, Name = "name" + Token = "token", ExpiryMonth = 12, ExpiryYear = 2030, Name = "name" } }; var response = new CreateSessionOkResponse