Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public enum EntityRoles
ControlPerson,

[EnumMember(Value = "legal_representative")]
LegalRepresentative,
LegalRepresentative
}
}
1 change: 1 addition & 0 deletions src/CheckoutSdk/Payments/Contexts/PaymentContextsItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace Checkout.Payments.Contexts
public class PaymentContextsItems
{
public PaymentContextItemType? Type { get; set; }

public string Name { get; set; }

public int? Quantity { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/CheckoutSdk/Payments/Hosted/HostedPaymentRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class HostedPaymentRequest
public string CancelUrl { get; set; }

public string FailureUrl { get; set; }

public long? Amount { get; set; }

public PaymentType? PaymentType { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/CheckoutSdk/Payments/Links/PaymentLinkRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class PaymentLinkRequest

public string ReturnUrl { get; set; }

public LocaleType Locale { get; set; }
public LocaleType? Locale { get; set; }

public bool? Capture { get; set; }

Expand All @@ -70,4 +70,4 @@ public class PaymentLinkRequest

public PaymentMethodConfiguration PaymentMethodConfiguration { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion src/CheckoutSdk/Payments/PaymentInstruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace Checkout.Payments
{
public class PaymentInstruction
{
public PaymentPurposeType Purpose { get; set; }
public PaymentPurposeType? Purpose { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.Serialization;

namespace Checkout.Payments.Hosted
namespace Checkout.Payments
{
public enum PaymentPurposeType
{
Expand Down
1 change: 0 additions & 1 deletion src/CheckoutSdk/Payments/RefundRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class RefundRequest

public IDictionary<string, object> Metadata { get; set; } = new Dictionary<string, object>();

// Not available on Previous
public IList<AmountAllocations> AmountAllocations { get; set; }

public string CaptureActionId { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/CheckoutSdk/Payments/Response/GetPaymentResponse.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Checkout.Common;
using Checkout.Payments.Request;
using Checkout.Payments.Response.Destination;
using Checkout.Payments.Response.Source;
using Checkout.Payments.Sender;
Expand Down
2 changes: 1 addition & 1 deletion test/CheckoutSdkTest/Apm/Ideal/IdealIntegrationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private async Task ShouldGetInfo()
idealInfo.Links.Curies.Count.ShouldBePositive();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldGetIssuers()
{
var idealInfo = await PreviousApi.IdealClient().GetIssuers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public KlarnaIntegrationTest() : base(PlatformType.Previous)
{
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldCreateAndGetKlarnaSession()
{
var creditSessionRequest = new CreditSessionRequest()
Expand Down
11 changes: 11 additions & 0 deletions test/CheckoutSdkTest/CheckoutSdkTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<Content Include="Resources\AppSettingsPreviousTest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\OnBoardSubEntityEEACompany30Response.json" />
<Content Include="Resources\OnBoardSubEntityGBCompany30Response.json" />
<Content Include="Resources\Sender\GetPaymentResponseAlternativeSender.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -96,9 +98,18 @@
<Content Include="Resources\OnBoardSubEntityUSCompanyResponse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Remove="Resources\OnBoardSubEntityCompanyResponse.json" />
<Content Update="Resources\OnBoardSubEntityCompanyResponse.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Remove="Resources\OnBoardSubEntityEEACompany30Response.json" />
<Content Update="Resources\OnBoardSubEntityEEACompany30Response.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Remove="Resources\OnBoardSubEntityGBCompany30Response.json" />
<Content Update="Resources\OnBoardSubEntityGBCompany30Response.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Apm\Previous" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Checkout.Disputes.Previous
{
public class DisputesIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldQueryDisputes()
{
var from = DateTime.UtcNow.Subtract(TimeSpan.FromHours(24));
Expand Down Expand Up @@ -38,7 +38,7 @@ private async Task ShouldQueryDisputes()
}
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldCreateAndRetrieveFile()
{
const string filePath = "./Resources/checkout.jpeg";
Expand All @@ -56,7 +56,7 @@ private async Task ShouldCreateAndRetrieveFile()
fileDetails.UploadedOn.ShouldNotBeNull();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldGetDisputeSchemeFiles()
{
var query = new DisputesQueryFilter { Limit = 5 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class EventsIntegrationTest : AbstractPaymentsIntegrationTest
"payment_voided",
};

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldRetrieveDefaultEventTypes()
{
var allEventTypesWrapper = await PreviousApi.EventsClient().RetrieveAllEventTypes();
Expand Down
28 changes: 25 additions & 3 deletions test/CheckoutSdkTest/JsonSerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void ShouldDeserializeDefaultCardCTypeResponse()
}

[Fact]
public void ShouldSerializeDateTimeFormatsFromJson()
public void ShouldDeserializeDateTimeFormatsFromJson()
{
var fileContent = GetJsonFileContent("./Resources/get_financial_actions_response.json");
FinancialActionsQueryResponse financialActionsQueryResponse =
Expand All @@ -130,7 +130,7 @@ public void ShouldSerializeDateTimeFormatsFromJson()
}

[Fact]
public void ShouldSerializeOnBoardSubEntityCompanyFromJson()
public void ShouldDeserializeOnBoardSubEntityCompanyFromJson()
{
var fileContent = GetJsonFileContent("./Resources/OnBoardSubEntityCompanyResponse.json");
OnboardEntityDetailsResponse onboardEntityDetailsResponse =
Expand All @@ -141,7 +141,29 @@ public void ShouldSerializeOnBoardSubEntityCompanyFromJson()
}

[Fact]
public void ShouldSerializePaymentContextsPayPalDetailsResponseFromJson()
public void ShouldDeserializeOnBoardSubEntityGBCompany30FromJson()
{
var fileContent = GetJsonFileContent("./Resources/OnBoardSubEntityGBCompany30Response.json");
OnboardEntityDetailsResponse onboardEntityDetailsResponse =
(OnboardEntityDetailsResponse)new JsonSerializer().Deserialize(fileContent,
typeof(OnboardEntityDetailsResponse));
onboardEntityDetailsResponse.ShouldNotBeNull();
onboardEntityDetailsResponse.Company.BusinessType.ShouldBeOfType<BusinessType>();
}

[Fact]
public void ShouldDeserializeOnBoardSubEntityEEACompany30FromJson()
{
var fileContent = GetJsonFileContent("./Resources/OnBoardSubEntityEEACompany30Response.json");
OnboardEntityDetailsResponse onboardEntityDetailsResponse =
(OnboardEntityDetailsResponse)new JsonSerializer().Deserialize(fileContent,
typeof(OnboardEntityDetailsResponse));
onboardEntityDetailsResponse.ShouldNotBeNull();
onboardEntityDetailsResponse.Company.BusinessType.ShouldBeOfType<BusinessType>();
}

[Fact]
public void ShouldDeserializePaymentContextsPayPalDetailsResponseFromJson()
{
var fileContent = GetJsonFileContent("./Resources/PaymentContextsPayPalDetailsResponse.json");
PaymentContextDetailsResponse paymentContextsPayPalResponseSource =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Checkout.Payments.Previous
{
public class CapturePaymentsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldFullCaptureCardPayment()
{
var paymentResponse = await MakeCardPayment();
Expand All @@ -24,7 +24,7 @@ private async Task ShouldFullCaptureCardPayment()
response.ActionId.ShouldNotBeNullOrEmpty();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldPartiallyCaptureCardPayment()
{
var paymentResponse = await MakeCardPayment();
Expand All @@ -41,7 +41,7 @@ private async Task ShouldPartiallyCaptureCardPayment()
response.ActionId.ShouldNotBeNullOrEmpty();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldFullCaptureCardPaymentWithoutRequest()
{
var paymentResponse = await MakeCardPayment();
Expand All @@ -52,7 +52,7 @@ private async Task ShouldFullCaptureCardPaymentWithoutRequest()
response.ShouldNotBeNull();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldCaptureCardPaymentIdempotently()
{
var paymentResponse = await MakeCardPayment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Checkout.Payments.Previous
{
public class GetPaymentDetailsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldGetPaymentDetails()
{
var paymentResponse = await MakeCardPayment(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Checkout.Payments.Previous
{
public class GetPaymentsListIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldGetPaymentsList()
{
var paymentResponse = await MakeCardPayment(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Checkout.Payments.Previous.Hosted
{
public class HostedPaymentsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldCreateAndGetHostedPayment()
{
var hostedPaymentRequest = CreateHostedPaymentRequest("ORD-123A");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Checkout.Payments.Previous
{
public class PaymentActionsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldGetPaymentActions()
{
var paymentResponse = await MakeCardPayment(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Checkout.Payments.Previous
{
public class RequestApmPaymentsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeAliPayPayment()
{
var paymentRequest = new PaymentRequest
Expand Down Expand Up @@ -211,7 +211,7 @@ private async Task ShouldMakeEpsPayment()
source.Type().ShouldBe(PaymentSourceType.EPS);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeFawryPayment()
{
var fawrySource = new RequestFawrySource
Expand Down Expand Up @@ -470,7 +470,7 @@ private async Task ShouldMakeRapiPagoPayment()
source.Type().ShouldBe(PaymentSourceType.RapiPago);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeSofortPayment()
{
var sofortSource = new RequestSofortSource
Expand Down Expand Up @@ -508,7 +508,7 @@ private async Task ShouldMakeSofortPayment()
source.Type().ShouldBe(PaymentSourceType.Sofort);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeKnetPayment()
{
var paymentRequest = new PaymentRequest
Expand Down Expand Up @@ -583,7 +583,7 @@ private async Task ShouldMakePrzelewy24Payment()
source.Type().ShouldBe(PaymentSourceType.Przelewy24);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakePayPalPayment()
{
var paymentRequest = new PaymentRequest
Expand Down Expand Up @@ -614,7 +614,7 @@ private async Task ShouldMakePayPalPayment()
source.Type().ShouldBe(PaymentSourceType.PayPal);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakePoliPayment()
{
var paymentRequest = new PaymentRequest
Expand Down Expand Up @@ -678,7 +678,7 @@ private async Task ShouldMakeBancontactPayment()
source.Type().ShouldBe(PaymentSourceType.Bancontact);
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeQPayPayment()
{
var paymentRequest = new PaymentRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Checkout.Payments.Previous
{
public class RequestPaymentsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeCardPayment()
{
var paymentResponse = await MakeCardPayment(true, captureOn: DateTime.Now.AddDays(1));
Expand Down Expand Up @@ -69,7 +69,7 @@ private async Task ShouldMakeCardPayment()
paymentResponse.HasLink("void").ShouldBeTrue();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeCardVerification()
{
var phone = new Phone {CountryCode = "44", Number = "020 222333"};
Expand Down Expand Up @@ -181,7 +181,7 @@ private async Task ShouldMakeCard3dsPayment()
paymentResponse.HasLink("redirect").ShouldBeTrue();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakeCard3dsPayment_N3d()
{
var paymentResponse = await Make3dsCardPayment(true);
Expand Down Expand Up @@ -295,7 +295,7 @@ private async Task ShouldTokenPayment()
paymentResponse.HasLink("void").ShouldBeTrue();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldMakePaymentsIdempotently()
{
var phone = new Phone {CountryCode = "44", Number = "020 222333"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Checkout.Payments.Previous
{
public class VoidPaymentsIntegrationTest : AbstractPaymentsIntegrationTest
{
[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldVoidCardPayment()
{
var paymentResponse = await MakeCardPayment();
Expand All @@ -22,7 +22,7 @@ private async Task ShouldVoidCardPayment()
response.GetLink("payment").ShouldNotBeNull();
}

[Fact]
[Fact(Skip = "unavailable")]
private async Task ShouldVoidCardPaymentIdempotently()
{
var paymentResponse = await MakeCardPayment();
Expand Down
Loading
Loading