Skip to content
Merged
  •  
  •  
  •  
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 51.1.0 - 2026-04-23
This release changes the pinned API version to 2026-04-22.dahlia.

* [#3365](https://github.com/stripe/stripe-dotnet/pull/3365) Update generated code
* Add support for `BalanceReport` and `PayoutReconciliationReport` on `AccountSession.Components` and `AccountSessionComponentsOptions`
* Add support for `AppDistribution` and `SunbitPayments` on `Account.Capabilities` and `AccountCapabilitiesOptions`
* Add support for `Sunbit` on `Charge.PaymentMethodDetails`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenPaymentMethodDataOptions`, `PaymentAttemptRecord.PaymentMethodDetails`, `PaymentIntentPaymentMethodDataOptions`, `PaymentMethodConfigurationCreateOptions`, `PaymentMethodConfigurationUpdateOptions`, `PaymentMethodConfiguration`, `PaymentMethodCreateOptions`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetails`, and `SetupIntentPaymentMethodDataOptions`
* Add support for `Location` and `Reader` on `Charge.PaymentMethodDetails.Klarna`, `PaymentAttemptRecord.PaymentMethodDetails.Klarna`, and `PaymentRecord.PaymentMethodDetails.Klarna`
* Add support for `Mandate` on `Charge.PaymentMethodDetails.Pix`, `PaymentAttemptRecord.PaymentMethodDetails.Pix`, and `PaymentRecord.PaymentMethodDetails.Pix`
* Add support for `ManagedPayments` on `Checkout.SessionCreateOptions`, `Checkout.Session`, `PaymentIntent`, `PaymentLinkCreateOptions`, `PaymentLink`, `SetupIntent`, and `Subscription`
* Add support for `MandateOptions` on `Checkout.Session.PaymentMethodOptions.Pix`, `CheckoutSessionPaymentMethodOptionsPixOptions`, `PaymentIntent.PaymentMethodOptions.Pix`, and `PaymentIntentPaymentMethodOptionsPixOptions`
* Change type of `CheckoutSessionPaymentMethodOptionsPixOptions.SetupFutureUsage` and `PaymentIntentPaymentMethodOptionsPixOptions.SetupFutureUsage` from `literal('none')` to `enum('none'|'off_session')`
* ⚠️ Change type of `Checkout.Session.PaymentMethodOptions.Pix.SetupFutureUsage` and `PaymentIntent.PaymentMethodOptions.Pix.SetupFutureUsage` from `literal('none')` to `enum('none'|'off_session')`
* Add support for `Pix` on `Invoice.PaymentSettings.PaymentMethodOptions`, `InvoicePaymentSettingsPaymentMethodOptionsOptions`, `Mandate.PaymentMethodDetails`, `SetupAttempt.PaymentMethodDetails`, `SetupIntent.PaymentMethodOptions`, `SetupIntentPaymentMethodOptionsOptions`, `Subscription.PaymentSettings.PaymentMethodOptions`, and `SubscriptionPaymentSettingsPaymentMethodOptionsOptions`
* Add support for `Upi` on `Invoice.PaymentSettings.PaymentMethodOptions`, `InvoicePaymentSettingsPaymentMethodOptionsOptions`, `Subscription.PaymentSettings.PaymentMethodOptions`, and `SubscriptionPaymentSettingsPaymentMethodOptionsOptions`
* Add support for `CardPresence` on `Issuing.Authorization`
* Add support for `AllowedCardPresences` and `BlockedCardPresences` on `Issuing.Card.SpendingControls`, `Issuing.Cardholder.SpendingControls`, `IssuingCardSpendingControlsOptions`, and `IssuingCardholderSpendingControlsOptions`
* Add support for `Amount` and `Currency` on `Mandate.MultiUse`
* Add support for `AmountToConfirm` on `PaymentIntentConfirmOptions`
* Add support for `KlarnaDisplayQrCode` on `PaymentIntent.NextAction`
* Add support for `Moto` on `SetupAttempt.PaymentMethodDetails.Card`
* Add support for `PixDisplayQrCode` on `SetupIntent.NextAction`

## 51.1.0-alpha.4 - 2026-04-15
* [#3368](https://github.com/stripe/stripe-dotnet/pull/3368) Update generated code for private-preview
* Add support for `LatestVersion` on `V2.Billing.LicenseFee`, `V2.Billing.PricingPlan`, and `V2.Billing.RateCard`
Expand Down Expand Up @@ -170,6 +193,11 @@ This release changes the pinned API version to 2026-03-25.preview and contains a
* Release specs are identical.
* [#3335](https://github.com/stripe/stripe-dotnet/pull/3335) Merge dotnet private preview

## 51.0.1 - 2026-04-17
* [#3366](https://github.com/stripe/stripe-dotnet/pull/3366) Fix emptyable property serialization for third-party serializers

* Fixes a bug where serializing Options objects through a third-party serializer (e.g. AWS Lambda) could cause the SDK to unintentionally clear fields on the API. Emptyable properties now have null-skipping annotations so third-party serializers omit unset properties during round-trips.

## 51.0.0 - 2026-03-25

This release changes the pinned API version to `2026-03-25.dahlia` and contains breaking changes (prefixed with ⚠️ below). There's also a [detailed migration guide](https://github.com/stripe/stripe-dotnet/wiki/Migration-guide-for-v51) to simplify your upgrade process.
Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a527d1f955ea1eab1b7ccdb63001a69d1786fc37
6bd90d0c763120698bef2e92514641c64e20980c
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2240
v2253
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-04-08.preview";
public const string Current = "2026-04-22.preview";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,20 @@ namespace Stripe
[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class AccountSessionComponentsBillsFeatures : StripeEntity<AccountSessionComponentsBillsFeatures>
{
/// <summary>
/// Whether to enable the bill management feature that grants access to bill creation and
/// payment.
/// </summary>
[JsonProperty("bill_management")]
[STJS.JsonPropertyName("bill_management")]
public bool BillManagement { get; set; }

/// <summary>
/// Whether to enable the send money feature that grants access to bill creation and
/// payment.
/// </summary>
[JsonProperty("send_money")]
[STJS.JsonPropertyName("send_money")]
public bool SendMoney { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public class ChargePaymentMethodDetails : StripeEntity<ChargePaymentMethodDetail
[STJS.JsonPropertyName("fpx")]
public ChargePaymentMethodDetailsFpx Fpx { get; set; }

[JsonProperty("gift_card")]
[STJS.JsonPropertyName("gift_card")]
public ChargePaymentMethodDetailsGiftCard GiftCard { get; set; }

[JsonProperty("giropay")]
[STJS.JsonPropertyName("giropay")]
public ChargePaymentMethodDetailsGiropay Giropay { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class ChargePaymentMethodDetailsGiftCard : StripeEntity<ChargePaymentMethodDetailsGiftCard>
{
[JsonProperty("balance")]
[STJS.JsonPropertyName("balance")]
public ChargePaymentMethodDetailsGiftCardBalance Balance { get; set; }

/// <summary>
/// The brand of the gift card.
/// One of: <c>fiserv_valuelink</c>, <c>givex</c>, or <c>svs</c>.
/// </summary>
[JsonProperty("brand")]
[STJS.JsonPropertyName("brand")]
public string Brand { get; set; }

/// <summary>
/// The expiration month of the gift card.
/// </summary>
[JsonProperty("exp_month")]
[STJS.JsonPropertyName("exp_month")]
public long? ExpMonth { get; set; }

/// <summary>
/// The expiration year of the gift card.
/// </summary>
[JsonProperty("exp_year")]
[STJS.JsonPropertyName("exp_year")]
public long? ExpYear { get; set; }

/// <summary>
/// The first six digits of the gift card number.
/// </summary>
[JsonProperty("first6")]
[STJS.JsonPropertyName("first6")]
public string First6 { get; set; }

/// <summary>
/// The transaction ID from the gift card processor.
/// </summary>
[JsonProperty("transaction_id")]
[STJS.JsonPropertyName("transaction_id")]
public string TransactionId { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class ChargePaymentMethodDetailsGiftCardBalance : StripeEntity<ChargePaymentMethodDetailsGiftCardBalance>
{
/// <summary>
/// The balance amount in the smallest currency unit.
/// </summary>
[JsonProperty("amount")]
[STJS.JsonPropertyName("amount")]
public long Amount { get; set; }

/// <summary>
/// The currency of the balance.
/// </summary>
[JsonProperty("currency")]
[STJS.JsonPropertyName("currency")]
public string Currency { get; set; }
}
}
46 changes: 46 additions & 0 deletions src/Stripe.net/Entities/Checkout/Sessions/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ public class Session : StripeEntity<Session>, IHasId, IHasMetadata, IHasObject
[STJS.JsonPropertyName("custom_fields")]
public List<SessionCustomField> CustomFields { get; set; }

/// <summary>
/// A list of the types of <a
/// href="https://docs.stripe.com/payments/payment-methods/custom-payment-methods">custom
/// payment methods</a> (e.g. cpmt_123) this Checkout Session is allowed to accept.
/// </summary>
[JsonProperty("custom_payment_method_types")]
[STJS.JsonPropertyName("custom_payment_method_types")]
public List<string> CustomPaymentMethodTypes { get; set; }

[JsonProperty("custom_text")]
[STJS.JsonPropertyName("custom_text")]
public SessionCustomText CustomText { get; set; }
Expand Down Expand Up @@ -552,6 +561,43 @@ public PaymentLink PaymentLink
[STJS.JsonPropertyName("payment_method_types")]
public List<string> PaymentMethodTypes { get; set; }

#region Expandable PaymentRecord

/// <summary>
/// (ID of the PaymentRecord)
/// The <a href="https://docs.stripe.com/api/payment-record">Payment Record</a> for this
/// Checkout Session.
/// </summary>
[JsonIgnore]
[STJS.JsonIgnore]
public string PaymentRecordId
{
get => this.InternalPaymentRecord?.Id;
set => this.InternalPaymentRecord = SetExpandableFieldId(value, this.InternalPaymentRecord);
}

/// <summary>
/// (Expanded)
/// The <a href="https://docs.stripe.com/api/payment-record">Payment Record</a> for this
/// Checkout Session.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
[STJS.JsonIgnore]
public PaymentRecord PaymentRecord
{
get => this.InternalPaymentRecord?.ExpandedObject;
set => this.InternalPaymentRecord = SetExpandableFieldObject(value, this.InternalPaymentRecord);
}

[JsonProperty("payment_record")]
[JsonConverter(typeof(ExpandableFieldConverter<PaymentRecord>))]
[STJS.JsonPropertyName("payment_record")]
[STJS.JsonConverter(typeof(STJExpandableFieldConverter<PaymentRecord>))]
internal ExpandableField<PaymentRecord> InternalPaymentRecord { get; set; }
#endregion

/// <summary>
/// The payment status of the Checkout Session, one of <c>paid</c>, <c>unpaid</c>, or
/// <c>no_payment_required</c>. You can use this value to decide when to fulfill your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ public Charge Charge
internal ExpandableField<Charge> InternalCharge { get; set; }
#endregion

#region Expandable PaymentMethod

/// <summary>
/// (ID of the PaymentMethod)
/// The ID of the PaymentMethod that generated this PaymentMethod, if any.
/// </summary>
[JsonIgnore]
[STJS.JsonIgnore]
public string PaymentMethodId
{
get => this.InternalPaymentMethod?.Id;
set => this.InternalPaymentMethod = SetExpandableFieldId(value, this.InternalPaymentMethod);
}

/// <summary>
/// (Expanded)
/// The ID of the PaymentMethod that generated this PaymentMethod, if any.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
[STJS.JsonIgnore]
public PaymentMethod PaymentMethod
{
get => this.InternalPaymentMethod?.ExpandedObject;
set => this.InternalPaymentMethod = SetExpandableFieldObject(value, this.InternalPaymentMethod);
}

[JsonProperty("payment_method")]
[JsonConverter(typeof(ExpandableFieldConverter<PaymentMethod>))]
[STJS.JsonPropertyName("payment_method")]
[STJS.JsonConverter(typeof(STJExpandableFieldConverter<PaymentMethod>))]
internal ExpandableField<PaymentMethod> InternalPaymentMethod { get; set; }
#endregion

#region Expandable SetupAttempt

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ public class RequestedSession : StripeEntity<RequestedSession>, IHasId, IHasMeta
[STJS.JsonPropertyName("amount_total")]
public long? AmountTotal { get; set; }

/// <summary>
/// The buyer consent options for this requested session, including marketing preferences.
/// </summary>
[JsonProperty("buyer_consents")]
[STJS.JsonPropertyName("buyer_consents")]
public RequestedSessionBuyerConsents BuyerConsents { get; set; }

/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// File generated from our OpenAPI spec
namespace Stripe.DelegatedCheckout
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class RequestedSessionBuyerConsents : StripeEntity<RequestedSessionBuyerConsents>
{
/// <summary>
/// The marketing consent options.
/// </summary>
[JsonProperty("marketing")]
[STJS.JsonPropertyName("marketing")]
public RequestedSessionBuyerConsentsMarketing Marketing { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// File generated from our OpenAPI spec
namespace Stripe.DelegatedCheckout
{
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class RequestedSessionBuyerConsentsMarketing : StripeEntity<RequestedSessionBuyerConsentsMarketing>
{
/// <summary>
/// The available marketing consent options.
/// </summary>
[JsonProperty("options")]
[STJS.JsonPropertyName("options")]
public List<RequestedSessionBuyerConsentsMarketingOption> Options { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// File generated from our OpenAPI spec
namespace Stripe.DelegatedCheckout
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
using STJS = System.Text.Json.Serialization;

[STJS.JsonConverter(typeof(STJStripeEntityConverter))]
public class RequestedSessionBuyerConsentsMarketingOption : StripeEntity<RequestedSessionBuyerConsentsMarketingOption>
{
/// <summary>
/// The marketing channel type.
/// One of: <c>email</c>, or <c>sms</c>.
/// </summary>
[JsonProperty("channel")]
[STJS.JsonPropertyName("channel")]
public string Channel { get; set; }

/// <summary>
/// The description of the marketing consent option.
/// </summary>
[JsonProperty("description")]
[STJS.JsonPropertyName("description")]
public string Description { get; set; }

/// <summary>
/// The privacy policy URL for this marketing channel.
/// </summary>
[JsonProperty("privacy_policy_url")]
[STJS.JsonPropertyName("privacy_policy_url")]
public string PrivacyPolicyUrl { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class RequestedSessionFulfillmentDetailsFulfillmentOption : StripeEntity<

/// <summary>
/// The type of the fulfillment option.
/// One of: <c>digital</c>, or <c>shipping</c>.
/// </summary>
[JsonProperty("type")]
[STJS.JsonPropertyName("type")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class RequestedSessionFulfillmentDetailsSelectedFulfillmentOption : Strip

/// <summary>
/// The type of the selected fulfillment option.
/// One of: <c>digital</c>, or <c>shipping</c>.
/// </summary>
[JsonProperty("type")]
[STJS.JsonPropertyName("type")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class RequestedSessionFulfillmentDetailsSelectedFulfillmentOptionOverride

/// <summary>
/// The type of the selected fulfillment option.
/// One of: <c>digital</c>, or <c>shipping</c>.
/// </summary>
[JsonProperty("type")]
[STJS.JsonPropertyName("type")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class InvoicePaymentSettings : StripeEntity<InvoicePaymentSettings>
/// <c>crypto</c>, <c>custom</c>, <c>customer_balance</c>, <c>eps</c>, <c>fpx</c>,
/// <c>giropay</c>, <c>grabpay</c>, <c>id_bank_transfer</c>, <c>ideal</c>,
/// <c>jp_credit_transfer</c>, <c>kakao_pay</c>, <c>klarna</c>, <c>konbini</c>,
/// <c>kr_card</c>, <c>link</c>, <c>multibanco</c>, <c>naver_pay</c>,
/// <c>kr_card</c>, <c>link</c>, <c>momo</c>, <c>multibanco</c>, <c>naver_pay</c>,
/// <c>nz_bank_account</c>, <c>p24</c>, <c>pay_by_bank</c>, <c>payco</c>, <c>paynow</c>,
/// <c>paypal</c>, <c>payto</c>, <c>pix</c>, <c>promptpay</c>, <c>revolut_pay</c>,
/// <c>sepa_credit_transfer</c>, <c>sepa_debit</c>, <c>sofort</c>, <c>stripe_balance</c>,
Expand Down
Loading
Loading