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
2 changes: 1 addition & 1 deletion API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-08-27.basil
2025-09-30.clover
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f4b80890ea17e89a543a77a389f29ca9be6fe615
9de7288a5c444f47d15545549303c3de4c226c71
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ci-test: (_test "--no-build" "" "Release")
# ⭐ format all files
format *args:
# This sets TargetFramework because of a race condition in dotnet format when it tries to format to multiple targets at a time, which could lead to code with compiler errors after it completes
TargetFramework=net5.0 dotnet format src/Stripe.net/Stripe.net.csproj --severity warn {{args}}
TargetFramework=net5.0 dotnet format src/Stripe.net.sln --severity warn {{args}}

# verify, but don't modify, the project's formatting
format-check: (format "--verify-no-changes")
Expand Down
2 changes: 1 addition & 1 deletion src/Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Program()
/// are set before running the example.
///
/// </summary>
/// <param name="args">command line args</param>
/// <param name="args">command line args.</param>
/// <returns></returns>
public static async Task Main(string[] args)
{
Expand Down
10 changes: 5 additions & 5 deletions src/Examples/V2/PushedEventWebhookHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
[ApiController]
public class PushedEventWebhookHandler : ControllerBase
{
private readonly StripeClient _client;
private readonly string _webhookSecret;
private readonly StripeClient client;
private readonly string webhookSecret;

public PushedEventWebhookHandler()

Check warning on line 26 in src/Examples/V2/PushedEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Non-nullable field 'webhookSecret' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY");
_client = new StripeClient(apiKey);
client = new StripeClient(apiKey);

_webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");
webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");

Check warning on line 31 in src/Examples/V2/PushedEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Possible null reference assignment.
}

[HttpPost]
Expand All @@ -37,7 +37,7 @@
var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
try
{
var pushedEvent = _client.ParseThinEvent__Experimental(json, Request.Headers["Stripe-Signature"], _webhookSecret);
var pushedEvent = client.ParseThinEvent__Experimental(json, Request.Headers["Stripe-Signature"], webhookSecret);
if (pushedEvent is PushedV1BillingMeterErrorReportTriggeredEvent pushedV1BillingEvent)
{
var pulledEvent = await pushedV1BillingEvent.PullAsync();
Expand Down
12 changes: 6 additions & 6 deletions src/Examples/V2/ThinEventWebhookHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
[ApiController]
public class ThinEventWebhookHandler : ControllerBase
{
private readonly StripeClient _client;
private readonly string _webhookSecret;
private readonly StripeClient client;
private readonly string webhookSecret;

public ThinEventWebhookHandler()

Check warning on line 28 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Non-nullable field 'webhookSecret' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY");
_client = new StripeClient(apiKey);
client = new StripeClient(apiKey);

_webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");
webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");

Check warning on line 33 in src/Examples/V2/ThinEventWebhookHandler.cs

View workflow job for this annotation

GitHub Actions / Build and test

Possible null reference assignment.
}

[HttpPost]
Expand All @@ -39,10 +39,10 @@
var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
try
{
var thinEvent = _client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], _webhookSecret);
var thinEvent = client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], webhookSecret);

// Fetch the event data to understand the failure
var baseEvent = await _client.V2.Core.Events.GetAsync(thinEvent.Id);
var baseEvent = await client.V2.Core.Events.GetAsync(thinEvent.Id);
if (baseEvent is V1BillingMeterErrorReportTriggeredEvent fullEvent)
{
var meter = await fullEvent.FetchRelatedObjectAsync();
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Entities/V2/Billing/Cadences/Cadence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class Cadence : StripeEntity<Cadence>, IHasId, IHasMetadata, IHasObject
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("next_billing_date")]
#endif
public DateTime? NextBillingDate { get; set; }
public DateTime NextBillingDate { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// The payer determines the entity financially responsible for the bill.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class CadenceBillingCycleDayTime : StripeEntity<CadenceBillingCycleDayTim
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("second")]
#endif
public long? Second { get; set; }
public long Second { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ public class CadenceBillingCycleMonth : StripeEntity<CadenceBillingCycleMonth>
#endif
public long DayOfMonth { get; set; }

/// <summary>
/// The month to anchor the billing on for a type="month" billing cycle from 1-12.
/// Occurrences are calculated from the month anchor.
/// </summary>
[JsonProperty("month_of_year")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("month_of_year")]
#endif
public long? MonthOfYear { get; set; }

/// <summary>
/// The time at which the billing cycle ends.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class CadenceBillingCycleMonthTime : StripeEntity<CadenceBillingCycleMont
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("second")]
#endif
public long? Second { get; set; }
public long Second { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class CadenceBillingCycleWeekTime : StripeEntity<CadenceBillingCycleWeekT
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("second")]
#endif
public long? Second { get; set; }
public long Second { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public class CadenceBillingCycleYearTime : StripeEntity<CadenceBillingCycleYearT
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("second")]
#endif
public long? Second { get; set; }
public long Second { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class CadenceInvoiceDiscountRulePercentOff : StripeEntity<CadenceInvoiceD
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("percent_off")]
#endif
public string PercentOff { get; set; }
public decimal PercentOff { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe.V2.Billing
{
using System.Collections.Generic;
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
Expand Down Expand Up @@ -52,7 +53,7 @@ public class CollectionSettingVersionPaymentMethodOptions : StripeEntity<Collect
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("konbini")]
#endif
public CollectionSettingVersionPaymentMethodOptionsKonbini Konbini { get; set; }
public Dictionary<string, object> Konbini { get; set; }

/// <summary>
/// This sub-hash contains details about the SEPA Direct Debit payment method options.
Expand All @@ -61,7 +62,7 @@ public class CollectionSettingVersionPaymentMethodOptions : StripeEntity<Collect
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("sepa_debit")]
#endif
public CollectionSettingVersionPaymentMethodOptionsSepaDebit SepaDebit { get; set; }
public Dictionary<string, object> SepaDebit { get; set; }

/// <summary>
/// This sub-hash contains details about the ACH direct debit payment method options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CollectionSettingVersionPaymentMethodOptionsCardMandateOptions : St
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("amount")]
#endif
public long? Amount { get; set; }
public long Amount { get; set; }

/// <summary>
/// The AmountType for the mandate. One of <c>fixed</c> or <c>maximum</c>.
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe.V2.Billing
{
using System.Collections.Generic;
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
Expand Down Expand Up @@ -52,7 +53,7 @@ public class CollectionSettingPaymentMethodOptions : StripeEntity<CollectionSett
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("konbini")]
#endif
public CollectionSettingPaymentMethodOptionsKonbini Konbini { get; set; }
public Dictionary<string, object> Konbini { get; set; }

/// <summary>
/// This sub-hash contains details about the SEPA Direct Debit payment method options.
Expand All @@ -61,7 +62,7 @@ public class CollectionSettingPaymentMethodOptions : StripeEntity<CollectionSett
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("sepa_debit")]
#endif
public CollectionSettingPaymentMethodOptionsSepaDebit SepaDebit { get; set; }
public Dictionary<string, object> SepaDebit { get; set; }

/// <summary>
/// This sub-hash contains details about the ACH direct debit payment method options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CollectionSettingPaymentMethodOptionsCardMandateOptions : StripeEnt
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("amount")]
#endif
public long? Amount { get; set; }
public long Amount { get; set; }

/// <summary>
/// The AmountType for the mandate. One of <c>fixed</c> or <c>maximum</c>.
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public class IntentActionApplyInvoiceDiscountRulePercentOff : StripeEntity<Inten
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("percent_off")]
#endif
public string PercentOff { get; set; }
public decimal PercentOff { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ public class IntentActionDeactivateEffectiveAt : StripeEntity<IntentActionDeacti
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("timestamp")]
#endif
public DateTime? Timestamp { get; set; }
public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// When the deactivate action will take effect.
/// One of: <c>current_billing_period_end</c>, <c>current_billing_period_start</c>,
/// <c>on_reserve</c>, or <c>timestamp</c>.
/// One of: <c>current_billing_period_start</c>, <c>on_reserve</c>, or <c>timestamp</c>.
/// </summary>
[JsonProperty("type")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class IntentActionModifyEffectiveAt : StripeEntity<IntentActionModifyEffe
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("timestamp")]
#endif
public DateTime? Timestamp { get; set; }
public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// When the modify action will take effect.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class IntentActionModifyPricingPlanSubscriptionDetailsComponentConfigurat
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("quantity")]
#endif
public long? Quantity { get; set; }
public long Quantity { get; set; }

/// <summary>
/// Lookup key for the pricing plan component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class IntentActionSubscribeEffectiveAt : StripeEntity<IntentActionSubscri
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("timestamp")]
#endif
public DateTime? Timestamp { get; set; }
public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// When the subscribe action will take effect.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class IntentActionSubscribePricingPlanSubscriptionDetailsComponentConfigu
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("quantity")]
#endif
public long? Quantity { get; set; }
public long Quantity { get; set; }

/// <summary>
/// Lookup key for the pricing plan component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ public class IntentActionSubscribeV1SubscriptionDetailsItem : StripeEntity<Inten
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("quantity")]
#endif
public long? Quantity { get; set; }
public long Quantity { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class IntentStatusTransitions : StripeEntity<IntentStatusTransitions>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("canceled_at")]
#endif
public DateTime? CanceledAt { get; set; }
public DateTime CanceledAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Time at which the Billing Intent was committed.
Expand All @@ -25,7 +25,7 @@ public class IntentStatusTransitions : StripeEntity<IntentStatusTransitions>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("committed_at")]
#endif
public DateTime? CommittedAt { get; set; }
public DateTime CommittedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Time at which the Billing Intent was drafted.
Expand All @@ -34,7 +34,7 @@ public class IntentStatusTransitions : StripeEntity<IntentStatusTransitions>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("drafted_at")]
#endif
public DateTime? DraftedAt { get; set; }
public DateTime DraftedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;

/// <summary>
/// Time at which the Billing Intent was reserved.
Expand All @@ -43,6 +43,6 @@ public class IntentStatusTransitions : StripeEntity<IntentStatusTransitions>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("reserved_at")]
#endif
public DateTime? ReservedAt { get; set; }
public DateTime ReservedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class LicenseFeeVersionTier : StripeEntity<LicenseFeeVersionTier>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("up_to_decimal")]
#endif
public string UpToDecimal { get; set; }
public decimal UpToDecimal { get; set; }

/// <summary>
/// No upper bound to this tier. Only one of <c>up_to_decimal</c> and <c>up_to_inf</c> may
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public class LicenseFee : StripeEntity<LicenseFee>, IHasId, IHasMetadata, IHasOb
public string LatestVersion { get; set; }

/// <summary>
/// The Licensed Item that this License Fee binds to.
/// A Licensed Item represents a billable item whose pricing is based on license fees. You
/// can use license fees to specify the pricing and create subscriptions to these items.
/// </summary>
[JsonProperty("licensed_item")]
#if NET6_0_OR_GREATER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class LicenseFeeTier : StripeEntity<LicenseFeeTier>
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("up_to_decimal")]
#endif
public string UpToDecimal { get; set; }
public decimal UpToDecimal { get; set; }

/// <summary>
/// No upper bound to this tier. Only one of <c>up_to_decimal</c> and <c>up_to_inf</c> may
Expand Down
Loading
Loading