Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
77e6418
Initial proposal for the first payments/setup endpoint (incomplete)
david-ruiz-cko Nov 19, 2025
fcd3200
class division, must check
david-ruiz-cko Nov 19, 2025
0adf794
Final entities for PaymentSetupsCreateRequest
david-ruiz-cko Nov 20, 2025
5f696b9
PaymentSetupsClient path corrected, PaymentSetupsResponse checked.
david-ruiz-cko Nov 20, 2025
b20de5d
All methods for payments setup
david-ruiz-cko Nov 20, 2025
f4cfbad
CheckoutAPI update + unit & integration tests for PaymentSetups
david-ruiz-cko Nov 20, 2025
873ad29
update comments in the classes
david-ruiz-cko Nov 20, 2025
c13875f
Added more comments for the class members
david-ruiz-cko Nov 21, 2025
95d5a91
Extended info in some comments
david-ruiz-cko Nov 21, 2025
5120336
Enhanced PaymentSetup with new comments, checks and enums
david-ruiz-cko Nov 24, 2025
ab77e35
test enum fix
david-ruiz-cko Nov 24, 2025
1099bc9
PaymentMethodInitialization for all PaymentMethods
david-ruiz-cko Nov 24, 2025
f9a50c6
Removed redundant classes, using Payments Context for Industry
david-ruiz-cko Nov 24, 2025
824099b
codeql analysis action migration to v3 (v2 deprecated)
david-ruiz-cko Nov 24, 2025
281d5da
renaming of the PaymentSetup aux classes
david-ruiz-cko Nov 25, 2025
65c445f
Using PaymentContextsItems for Payment Setup Order
david-ruiz-cko Nov 25, 2025
cfe9c1a
Moved Shipping prop from Order to use the generic ShippingDetails class
david-ruiz-cko Nov 25, 2025
e8a6ad1
Klarna SDK rename
david-ruiz-cko Nov 25, 2025
de900e1
PaymentMethod actions and options simplified classes
david-ruiz-cko Nov 25, 2025
6729ad9
PaymentMethodOptions
david-ruiz-cko Nov 25, 2025
d5b942f
default value for paymentType
david-ruiz-cko Nov 25, 2025
d807560
InstrumentsIntegration test fix
david-ruiz-cko Nov 26, 2025
a10b095
Fallback method for the log factory, for tests that used NLog
david-ruiz-cko Nov 26, 2025
3a9f037
TestLoggerFactoryHelper reorg
david-ruiz-cko Nov 26, 2025
05102f1
Created a Singleton for the Logger in TestLoggerFactoryHelper
david-ruiz-cko Nov 26, 2025
a436d36
NonDisposableLoggerFactory
david-ruiz-cko Nov 26, 2025
03c9562
Modified LogProviderTest to use our singleton
david-ruiz-cko Nov 26, 2025
27e3da9
PaymentMethodBase class
david-ruiz-cko Nov 27, 2025
b42d5ce
Datetime typr where needed in Order and Industry subtypes
david-ruiz-cko Nov 27, 2025
6ff2d29
Fixed includes and payment setups integration tests for the new Datet…
david-ruiz-cko Nov 27, 2025
fb086fd
Rename parameter PaymentMethodOptionId to paymentMethodOptionId in Co…
armando-rodriguez-cko Nov 28, 2025
5ccc894
Payment status to enum
david-ruiz-cko Dec 1, 2025
4cd2c0d
Merge remote-tracking branch 'refs/remotes/origin/feature/new-endpoin…
david-ruiz-cko Dec 1, 2025
c5123eb
moved PaymentMethodInitialization to common
david-ruiz-cko Dec 1, 2025
033a710
PaymentMethodInitialization enum comment fix
david-ruiz-cko Dec 2, 2025
fb210f6
Enhance documentation for payment setup classes and properties
armando-rodriguez-cko Dec 2, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality
Expand All @@ -56,7 +56,7 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
8 changes: 8 additions & 0 deletions src/CheckoutSdk/CheckoutApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Checkout.Payments.Hosted;
using Checkout.Payments.Links;
using Checkout.Payments.Sessions;
using Checkout.Payments.Setups;
using Checkout.Reports;
using Checkout.Risk;
using Checkout.Tokens;
Expand Down Expand Up @@ -47,6 +48,7 @@ public class CheckoutApi : ICheckoutApi
private readonly IPaymentSessionsClient _paymentSessionsClient;
private readonly IForwardClient _forwardClient;
private readonly INetworkTokensClient _networkTokensClient;
private readonly IPaymentSetupsClient _paymentSetupsClient;

public CheckoutApi(CheckoutConfiguration configuration)
{
Expand Down Expand Up @@ -78,6 +80,7 @@ public CheckoutApi(CheckoutConfiguration configuration)
_paymentSessionsClient = new PaymentSessionsClient(baseApiClient, configuration);
_forwardClient = new ForwardClient(baseApiClient, configuration);
_networkTokensClient = new NetworkTokensClient(baseApiClient, configuration);
_paymentSetupsClient = new PaymentSetupsClient(baseApiClient, configuration);
}

private static ApiClient BaseApiClient(CheckoutConfiguration configuration)
Expand Down Expand Up @@ -220,6 +223,11 @@ public INetworkTokensClient NetworkTokensClient()
{
return _networkTokensClient;
}

public IPaymentSetupsClient PaymentSetupsClient()
{
return _paymentSetupsClient;
}

}
}
8 changes: 8 additions & 0 deletions src/CheckoutSdk/Common/Phone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ namespace Checkout.Common
{
public class Phone
{
/// <summary>
/// The international country calling code: https://www.checkout.com/docs/resources/codes/country-codes
/// [ 1 .. 7 ] characters
/// </summary>
public string CountryCode { get; set; }

/// <summary>
/// The phone number
/// [ 6 .. 25 ] characters
/// </summary>
public string Number { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Checkout.Common;

namespace Checkout.Payments.Setups.Entities
{
public class Customer
{
/// <summary>
/// Details of the customer's email
/// </summary>
public CustomerEmail Email { get; set; }

/// <summary>
/// The customer's full name
/// &lt;= 100 characters
/// </summary>
public string Name { get; set; }

/// <summary>
/// The customer's phone number
/// </summary>
public Phone Phone { get; set; }

/// <summary>
/// The customer's device details
/// </summary>
public CustomerDevice Device { get; set; }

/// <summary>
/// Details of the account the customer holds with the merchant
/// </summary>
public MerchantAccount MerchantAccount { get; set; }
}

public class CustomerEmail
{
/// <summary>
/// The customer's email address
/// </summary>
public string Address { get; set; }

/// <summary>
/// Specifies whether the customer's email address is verified
/// </summary>
public bool? Verified { get; set; }
}

public class CustomerDevice
{
/// <summary>
/// The device's locale, as an ISO 639-2 language code
/// </summary>
public string Locale { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;

namespace Checkout.Payments.Setups.Entities
{
public class MerchantAccount
{
/// <summary>
/// The merchant's unique identifier for the customer's account
/// </summary>
public string Id { get; set; }

/// <summary>
/// The date the customer registered their account with the merchant
/// </summary>
public DateTime? RegistrationDate { get; set; }

/// <summary>
/// The date the customer's account with the merchant was last modified
/// </summary>
public DateTime? LastModified { get; set; }

/// <summary>
/// Specifies if the customer is a returning customer
/// </summary>
public bool? ReturningCustomer { get; set; }

/// <summary>
/// The date of the customer's first transaction
/// </summary>
public DateTime? FirstTransactionDate { get; set; }

/// <summary>
/// The date of the customer's most recent transaction
/// </summary>
public DateTime? LastTransactionDate { get; set; }

/// <summary>
/// The total number of orders made by the customer
/// </summary>
public int? TotalOrderCount { get; set; }

/// <summary>
/// The payment amount of the customer's most recent transaction
/// </summary>
public long? LastPaymentAmount { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using Checkout.Payments.Contexts;

namespace Checkout.Payments.Setups.Entities
{
public class AirlineData
{
/// <summary>
/// Details about the airline ticket
/// </summary>
public PaymentContextsTicket Ticket { get; set; }

/// <summary>
/// Details about the flight passenger(s)
/// </summary>
public IList<PaymentContextsPassenger> Passengers { get; set; }

/// <summary>
/// Details about the flight leg(s) booked by the customer
/// </summary>
public IList<PaymentContextsFlightLegDetails> FlightLegDetails { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Collections.Generic;

namespace Checkout.Payments.Setups.Entities
{
public class Industry
{
/// <summary>
/// Details about the airline ticket and flights the customer booked
/// </summary>
public AirlineData AirlineData { get; set; }

/// <summary>
/// Contains information about the accommodation booked by the customer
/// </summary>
public IList<AccommodationData> AccommodationData { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Collections.Generic;
using Checkout.Common;
using Checkout.Payments.Contexts;

namespace Checkout.Payments.Setups.Entities
{
public class Order
{
/// <summary>
/// A list of items in the order
/// </summary>
public IList<PaymentContextsItems> Items { get; set; }

/// <summary>
/// The customer's shipping details
/// </summary>
public ShippingDetails Shipping { get; set; }

/// <summary>
/// The sub-merchants' details
/// </summary>
public IList<OrderSubMerchant> SubMerchants { get; set; }

/// <summary>
/// The discount amount the merchant applied to the transaction
/// &gt;= 0
/// </summary>
public long? DiscountAmount { get; set; }
}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;

namespace Checkout.Payments.Setups.Entities
{
public class OrderSubMerchant
{
/// <summary>
/// The unique identifier of the sub-merchant
/// </summary>
public string Id { get; set; }

/// <summary>
/// The sub-merchant's product category
/// </summary>
public string ProductCategory { get; set; }

/// <summary>
/// The number of orders the sub-merchant has processed
/// </summary>
public int? NumberOfTrades { get; set; }

/// <summary>
/// The sub-merchant's registration date
/// </summary>
public DateTime? RegistrationDate { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Checkout.Payments.Setups.Entities
{
public class Bizum : PaymentMethodBase
{
/// <summary>
/// Payment method options specific to Bizum
/// </summary>
public PaymentMethodOptions PaymentMethodOptions { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Checkout.Payments.Setups.Entities
{
public class PaymentMethodAction
{
/// <summary>
/// The type of action to be performed with the payment method
/// </summary>
public string Type { get; set; }

/// <summary>
/// The client token for payment method authentication
/// </summary>
public string ClientToken { get; set; }

/// <summary>
/// The session identifier for the payment method session
/// </summary>
public string SessionId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections.Generic;

namespace Checkout.Payments.Setups.Entities
{
/// <summary>
/// Base class for all payment methods with common properties
/// </summary>
public abstract class PaymentMethodBase
{
/// <summary>
/// The payment method's status
/// </summary>
public PaymentMethodStatus? Status { get; set; }

/// <summary>
/// Configuration flags for the payment method
/// </summary>
public IList<string> Flags { get; set; }

/// <summary>
/// Default: "disabled"
/// The initialization state of the payment method.
/// When you create a Payment Setup, this defaults to disabled.
/// Enum: "disabled" "enabled"
/// </summary>
public PaymentMethodInitialization Initialization { get; set; } = PaymentMethodInitialization.Disabled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

using System.Runtime.Serialization;

public enum PaymentMethodInitialization

Check warning on line 4 in src/CheckoutSdk/HandlePaymentsAndPayouts/PaymentSetups/Entities/PaymentMethods/Common/PaymentMethodInitialization.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Move 'PaymentMethodInitialization' into a named namespace.

See more on https://sonarcloud.io/project/issues?id=checkout_checkout-sdk-net&issues=AZrA1VkKKQ2WkMd_DWsW&open=AZrA1VkKKQ2WkMd_DWsW&pullRequest=507
{
[EnumMember(Value = "disabled")]
Disabled,

[EnumMember(Value = "enabled")]
Enabled
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Collections.Generic;

namespace Checkout.Payments.Setups.Entities
{
public class PaymentMethodOption
{
/// <summary>
/// The unique identifier for the payment method option
/// </summary>
public string Id { get; set; }

/// <summary>
/// The status of the payment method option
/// </summary>
public string Status { get; set; }

/// <summary>
/// Configuration flags for the payment method option
/// </summary>
public IList<string> Flags { get; set; }

/// <summary>
/// The action configuration for STC Pay full payment
/// </summary>
public PaymentMethodAction Action { get; set; }
}
}
Loading
Loading