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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
50 changes: 50 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# stripe-dotnet

## Testing

- Run all tests: `just test` (auto-installs correct .NET version)
- Run a specific test: `just test-one TestClassName` or `just test-one FullyQualifiedName`

## Formatting

- Format: `just format`
- Format check: `just format-check`
- Uses `dotnet format` (whitespace + analyzers)

## Key Locations

- HTTP client interface: `src/Stripe.net/Infrastructure/Public/IHttpClient.cs`
- HTTP implementation: `src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs`
- Main client class: `src/Stripe.net/Infrastructure/Public/StripeClient.cs`
- Client options: `src/Stripe.net/Infrastructure/Public/StripeClientOptions.cs`
- Request building: `src/Stripe.net/Infrastructure/Public/StripeRequest.cs`
- API requestor: `src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs`
- Version: `src/Stripe.net/Constants/Version.cs`
- Tests: `src/StripeTests/`

## Generated Code

- Files containing `File generated from our OpenAPI spec` at the top are generated; do not edit. Similarly, any code block starting with `The beginning of the section generated from our OpenAPI spec` is generated and should not be edited directly.
- If something in a generated file/range needs to be updated, add a summary of the change to your report but don't attempt to edit it directly.
- The `Infrastructure/` directory is NOT generated.

## Conventions

- Uses .NET `System.Net.Http.HttpClient`
- Multi-target framework (net461+, net6.0+, etc.)
- Solution file: `src/Stripe.net.sln`
- .NET version managed via mise
- All code must run on all supported .NET versions (full list in the test section of @.github/workflows/ci.yml)
- Work is not complete until `just test`, `just format` complete successfully.

### Comments

- Comments MUST only be used to:
1. Document a function
2. Explain the WHY of a piece of code
3. Explain a particularly complicated piece of code
- Comments NEVER should be used to:
1. Say what used to be there. That's no longer relevant!
2. Explain the WHAT of a piece of code (unless it's very non-obvious)

It's ok not to put comments on/in a function if their addition wouldn't meaningfully clarify anything.
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e10daa4ed23a4fe87d6ea60836226446e042fdd3
3c01247cc15d88decd374e4f4af77d05388fb986
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2186
v2189
2 changes: 1 addition & 1 deletion src/Stripe.net/Constants/ApiVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ namespace Stripe
{
internal class ApiVersion
{
public const string Current = "2026-01-28.preview";
public const string Current = "2026-03-04.preview";
}
}
40 changes: 40 additions & 0 deletions src/Stripe.net/Constants/EventTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public static class EventTypes
/// </summary>
public const string BillingPortalSessionCreated = "billing_portal.session.created";

/// <summary>
/// Occurs whenever your custom alert threshold is recovered from a previous exceeded state.
/// </summary>
public const string BillingAlertRecovered = "billing.alert.recovered";

/// <summary>
/// Occurs whenever your custom alert threshold is met.
/// </summary>
Expand Down Expand Up @@ -1172,6 +1177,41 @@ public static class EventTypes
/// </summary>
public const string ReportingReportTypeUpdated = "reporting.report_type.updated";

/// <summary>
/// Occurs when a reserve hold is created.
/// </summary>
public const string ReserveHoldCreated = "reserve.hold.created";

/// <summary>
/// Occurs when a reserve hold is updated.
/// </summary>
public const string ReserveHoldUpdated = "reserve.hold.updated";

/// <summary>
/// Occurs when a reserve plan is created.
/// </summary>
public const string ReservePlanCreated = "reserve.plan.created";

/// <summary>
/// Occurs when a reserve plan is disabled.
/// </summary>
public const string ReservePlanDisabled = "reserve.plan.disabled";

/// <summary>
/// Occurs when a reserve plan expires.
/// </summary>
public const string ReservePlanExpired = "reserve.plan.expired";

/// <summary>
/// Occurs when a reserve plan is updated.
/// </summary>
public const string ReservePlanUpdated = "reserve.plan.updated";

/// <summary>
/// Occurs when a reserve release is created.
/// </summary>
public const string ReserveReleaseCreated = "reserve.release.created";

/// <summary>
/// Occurs whenever a review is closed. The review's <c>reason</c> field indicates why:
/// <c>approved</c>, <c>disputed</c>, <c>refunded</c>, <c>refunded_as_fraud</c>, or
Expand Down
4 changes: 4 additions & 0 deletions src/Stripe.net/Constants/FilePurpose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ public static class FilePurpose
public const string TerminalAndroidApk = "terminal_android_apk";

public const string TerminalReaderSplashscreen = "terminal_reader_splashscreen";

public const string TerminalWifiCertificate = "terminal_wifi_certificate";

public const string TerminalWifiPrivateKey = "terminal_wifi_private_key";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ public class AccountSessionComponents : StripeEntity<AccountSessionComponents>
#endif
public AccountSessionComponentsIssuingCardsList IssuingCardsList { get; set; }

/// <summary>
/// Configuration for the <a
/// href="https://stripe.com/connect/supported-embedded-components/network-cost-passthrough-report/">network
/// cost passthrough report</a> embedded component.
/// </summary>
[JsonProperty("network_cost_passthrough_report")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("network_cost_passthrough_report")]
#endif
public AccountSessionComponentsNetworkCostPassthroughReport NetworkCostPassthroughReport { get; set; }

[JsonProperty("notification_banner")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("notification_banner")]
Expand Down Expand Up @@ -162,17 +173,6 @@ public class AccountSessionComponents : StripeEntity<AccountSessionComponents>
#endif
public AccountSessionComponentsTaxSettings TaxSettings { get; set; }

/// <summary>
/// Configuration for the <a
/// href="https://stripe.com/connect/supported-embedded-components/network-cost-passthrough-report/">network
/// cost passthrough report</a> embedded component.
/// </summary>
[JsonProperty("network_cost_passthrough_report")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("network_cost_passthrough_report")]
#endif
public AccountSessionComponentsNetworkCostPassthroughReport NetworkCostPassthroughReport { get; set; }

/// <summary>
/// Configuration for the <a
/// href="https://stripe.com/connect/supported-embedded-components/terminal-hardware-orders/">Terminal
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Entities/Accounts/AccountSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ public class AccountSettings : StripeEntity<AccountSettings>
#endif
public AccountSettingsSepaDebitPayments SepaDebitPayments { get; set; }

[JsonProperty("smart_disputes")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("smart_disputes")]
#endif
public AccountSettingsSmartDisputes SmartDisputes { get; set; }

[JsonProperty("tax_forms")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("tax_forms")]
Expand Down
10 changes: 10 additions & 0 deletions src/Stripe.net/Entities/Accounts/AccountSettingsPayments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ namespace Stripe

public class AccountSettingsPayments : StripeEntity<AccountSettingsPayments>
{
/// <summary>
/// When enabled, the customer of this Account will receive an email receipt when their
/// payment is successful. If this parameter is not set, the default value is <c>false</c>.
/// </summary>
[JsonProperty("email_customers_on_successful_payment")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("email_customers_on_successful_payment")]
#endif
public bool? EmailCustomersOnSuccessfulPayment { get; set; }

/// <summary>
/// The default text that appears on credit card statements when a charge is made. This
/// field prefixes any dynamic <c>statement_descriptor</c> specified on the charge.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class AccountSettingsSmartDisputes : StripeEntity<AccountSettingsSmartDisputes>
{
[JsonProperty("auto_respond")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("auto_respond")]
#endif
public AccountSettingsSmartDisputesAutoRespond AutoRespond { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class AccountSettingsSmartDisputesAutoRespond : StripeEntity<AccountSettingsSmartDisputesAutoRespond>
{
/// <summary>
/// The preference setting for auto-respond. Can be 'on', 'off', or 'inherit'.
/// One of: <c>inherit</c>, <c>off</c>, or <c>on</c>.
/// </summary>
[JsonProperty("preference")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("preference")]
#endif
public string Preference { get; set; }

/// <summary>
/// The effective value for auto-respond. Can be 'on' or 'off'.
/// One of: <c>off</c>, or <c>on</c>.
/// </summary>
[JsonProperty("value")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("value")]
#endif
public string Value { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Stripe.net/Entities/BalanceTransfers/BalanceTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public class BalanceTransfer : StripeEntity<BalanceTransfer>, IHasId, IHasMetada
public string HostedRegulatoryReceiptUrl { get; set; }

/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
/// the object exists in test mode.
/// If the object exists in live mode, the value is <c>true</c>. If the object exists in
/// test mode, the value is <c>false</c>.
/// </summary>
[JsonProperty("livemode")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// File generated from our OpenAPI spec
namespace Stripe.Billing
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class AlertRecovered : StripeEntity<AlertRecovered>, IHasObject
{
/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("object")]
#endif
public string Object { get; set; }

/// <summary>
/// A billing alert is a resource that notifies you when a certain usage threshold on a
/// meter is crossed. For example, you might create a billing alert to notify you when a
/// certain user made 100 API requests.
/// </summary>
[JsonProperty("alert")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("alert")]
#endif
public Alert Alert { get; set; }

/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("created")]
[JsonConverter(typeof(UnixDateTimeConverter))]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("created")]
[STJS.JsonConverter(typeof(STJUnixDateTimeConverter))]
#endif
public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Currency for the threshold value.
/// </summary>
[JsonProperty("currency")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("currency")]
#endif
public string Currency { get; set; }

/// <summary>
/// Custom pricing unit for the threshold value.
/// </summary>
[JsonProperty("custom_pricing_unit")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("custom_pricing_unit")]
#endif
public string CustomPricingUnit { get; set; }

/// <summary>
/// ID of customer for which the alert recovered.
/// </summary>
[JsonProperty("customer")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("customer")]
#endif
public string Customer { get; set; }

/// <summary>
/// External customer ID for the customer for which the alert recovered.
/// </summary>
[JsonProperty("external_customer_id")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("external_customer_id")]
#endif
public string ExternalCustomerId { get; set; }

/// <summary>
/// If the object exists in live mode, the value is <c>true</c>. If the object exists in
/// test mode, the value is <c>false</c>.
/// </summary>
[JsonProperty("livemode")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("livemode")]
#endif
public bool Livemode { get; set; }

/// <summary>
/// The value at which the alert recovered.
/// </summary>
[JsonProperty("value")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("value")]
#endif
public decimal Value { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ public class CreditBalanceSummaryBalance : StripeEntity<CreditBalanceSummaryBala
[STJS.JsonPropertyName("ledger_balance")]
#endif
public CreditBalanceSummaryBalanceLedgerBalance LedgerBalance { get; set; }

[JsonProperty("balance_update_details")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("balance_update_details")]
#endif
public CreditBalanceSummaryBalanceBalanceUpdateDetails BalanceUpdateDetails { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec
namespace Stripe.Billing
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class CreditBalanceSummaryBalanceBalanceUpdateDetails : StripeEntity<CreditBalanceSummaryBalanceBalanceUpdateDetails>
{
/// <summary>
/// The details of the most recent meter event included in the balance update.
/// </summary>
[JsonProperty("latest_meter_event")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("latest_meter_event")]
#endif
public CreditBalanceSummaryBalanceBalanceUpdateDetailsLatestMeterEvent LatestMeterEvent { get; set; }
}
}
Loading
Loading