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
@@ -1,10 +1,11 @@
using Checkout.Common;
using Checkout.Payments.Contexts;
using System;
using System.Collections.Generic;

namespace Checkout.Payments.Contexts
namespace Checkout.Payments
{
public class PaymentContextsAccommodationData
public class AccommodationData
{
public string Name { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Checkout.Payments.Request.Source.Contexts;
using System.Collections.Generic;

namespace Checkout.Payments.Contexts
Expand All @@ -23,12 +22,12 @@ public class PaymentContextsProcessing

public UserAction? UserAction { get; set; }

public PaymentContextsPartnerCustomerRiskData PartnerCustomerRiskData { get; set; }
public PartnerCustomerRiskData PartnerCustomerRiskData { get; set; }

public IList<string> CustomPaymentMethodIds { get; set; }

public IList<PaymentContextsAirlineData> AirlineData { get; set; }

public IList<PaymentContextsAccommodationData> AccommodationData { get; set; }
public IList<AccommodationData> AccommodationData { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Checkout.Payments.Contexts
namespace Checkout.Payments
{
public class PaymentContextsPartnerCustomerRiskData
public class PartnerCustomerRiskData
{
public string Key { get; set; }

Expand Down
73 changes: 40 additions & 33 deletions src/CheckoutSdk/Payments/ProcessingSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,77 @@ namespace Checkout.Payments
{
public class ProcessingSettings
{
public string OrderId { get; set; }

public bool? Aft { get; set; }

public long? DiscountAmount { get; set; }

public long? ShippingAmount { get; set; }

public long? TaxAmount { get; set; }

public string InvoiceId { get; set; }

public string BrandName { get; set; }

public long? DiscountAmount { get; set; }
public string Locale { get; set; }


public PartnerCustomerRiskData PartnerCustomerRiskData { get; set; }

public IList<string> CustomPaymentMethodIds { get; set; }

public IList<AirlineData> AirlineData { get; set; }

public IList<AccommodationData> AccommodationData { get; set; }

public string OrderId { get; set; }

public long? SurchargeAmount { get; set; }

public long? DutyAmount { get; set; }

public long? ShippingAmount { get; set; }

public long? ShippingTaxAmount { get; set; }

public bool? Aft { get; set; }

public PreferredSchema? PreferredScheme { get; set; }

public CountryCode? PurchaseCountry { get; set; }
public MerchantInitiatedReason? MerchantInitiatedReason { get; set; }

public long? CampaignId { get; set; }

public long? OriginalOrderAmount { get; set; }

public string ReceiptId { get; set; }

public string MerchantCallbackUrl { get; set; }

public string LineOfBusiness { get; set; }

public PanProcessedType? PanPreference { get; set; }

public bool? ProvisionNetworkToken { get; set; }

public PreferredSchema? PreferredScheme { get; set; }

public ProductType? ProductType { get; set; }

public string OpenId { get; set; }

public long? OriginalOrderAmount { get; set; }

public string ReceiptId { get; set; }

public TerminalType? TerminalType { get; set; }

public OsType? OsType { get; set; }

public string InvoiceId { get; set; }

public string BrandName { get; set; }

public string Locale { get; set; }


public ShippingPreference? ShippingPreference { get; set; }

public UserAction? UserAction { get; set; }

public IList<IDictionary<string, string>> SetTransactionContext { get; set; }

public IList<AirlineData> AirlineData { get; set; }

public DLocalProcessingSettings Dlocal { get; set; }

public string OtpValue { get; set; }

public CountryCode? PurchaseCountry { get; set; }

public IList<string> CustomPaymentMethodIds { get; set; }

public string MerchantCallbackUrl { get; set; }

public string LineOfBusiness { get; set; }

public long? ShippingDelay { get; set; }

public IList<ShippingInfo> ShippingInfo { get; set; }

public PanProcessedType? PanPreference { get; set; }

[JsonProperty(PropertyName = "senderInformation")]
public string SenderInformation { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion src/CheckoutSdk/Payments/Response/GetPaymentResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class GetPaymentResponse : Resource

public bool? CkoNetworkTokenAvailable { get; set; }

public Request.PaymentInstruction Instruction { get; set; }
public PaymentInstruction Instruction { get; set; }


}
Expand Down
2 changes: 1 addition & 1 deletion src/CheckoutSdk/Payments/Sessions/PaymentSessionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class PaymentSessionsClient : AbstractClient, IPaymentSessionsClient
private const string PaymentSessionsPath = "payment-sessions";

public PaymentSessionsClient(IApiClient apiClient, CheckoutConfiguration configuration) : base(apiClient,
configuration, SdkAuthorizationType.SecretKey)
configuration, SdkAuthorizationType.SecretKeyOrOAuth)
{
}

Expand Down
14 changes: 9 additions & 5 deletions src/CheckoutSdk/Payments/Sessions/PaymentSessionsRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ public class PaymentSessionsRequest

public Currency? Currency { get; set; }

public BillingInformation Billing { get; set; }

public string SuccessUrl { get; set; }

public string FailureUrl { get; set; }

public PaymentType? PaymentType { get; set; }

public BillingInformation Billing { get; set; }

public BillingDescriptor BillingDescriptor { get; set; }

Expand All @@ -31,6 +36,8 @@ public class PaymentSessionsRequest
public PaymentRecipient Recipient { get; set; }

public ProcessingSettings Processing { get; set; }

public PaymentInstruction Instruction { get; set; }

public string ProcessingChannelId { get; set; }

Expand All @@ -52,13 +59,10 @@ public class PaymentSessionsRequest

public string DisplayName { get; set; }

public string SuccessUrl { get; set; }

public string FailureUrl { get; set; }

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

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

[JsonProperty(PropertyName = "3ds")]
public ThreeDsRequest ThreeDs { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions src/CheckoutSdk/Payments/Sessions/PaymentSessionsResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ public class PaymentSessionsResponse : Resource
public string Id { get; set; }

public string PaymentSessionToken { get; set; }

public string PaymentSessionSecret { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected static HostedPaymentRequest CreateHostedPaymentRequest()
CaptureOn = DateTime.UtcNow,
Instruction = new PaymentInstruction
{
Purpose = PaymentPurposeType.Donations
Purpose = PaymentPurposeType.Donations,
},
PaymentMethodConfiguration = new PaymentMethodConfiguration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class PaymentSessionsClientTest : UnitTestFixture

public PaymentSessionsClientTest()
{
_sdkCredentials.Setup(credentials => credentials.GetSdkAuthorization(SdkAuthorizationType.SecretKey))
_sdkCredentials.Setup(credentials => credentials.GetSdkAuthorization(SdkAuthorizationType.SecretKeyOrOAuth))
.Returns(_authorization);

_configuration = new Mock<CheckoutConfiguration>(_sdkCredentials.Object,
Expand All @@ -33,14 +33,14 @@ public PaymentSessionsClientTest()
private async Task ShouldRequestAPaymentSessions()
{
PaymentSessionsRequest paymentSessionsRequest = new PaymentSessionsRequest();
PaymentSessionsResponse paymentSessionsRequestResponse = new PaymentSessionsResponse();
PaymentSessionsResponse paymentSessionsResponse = new PaymentSessionsResponse();

_apiClient.Setup(apiClient =>
apiClient.Post<PaymentSessionsResponse>(PaymentSessions, _authorization,
paymentSessionsRequest,
CancellationToken.None,
null))
.ReturnsAsync(() => paymentSessionsRequestResponse);
.ReturnsAsync(() => paymentSessionsResponse);

PaymentSessionsClient client = new PaymentSessionsClient(_apiClient.Object, _configuration.Object);
PaymentSessionsResponse response =
Expand Down
Loading