diff --git a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs index e425fbaca3..6a5643287c 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs @@ -277,6 +277,14 @@ private static List> FlattenParamsOptions( // reference types), so skip those to avoid encoding them in the request. if (value == null) { + // If this is an emptyable property that was explicitly set to null, + // encode it as an empty string to clear the field on the server. + if (options is IHasSetTracking tracked && tracked.IsPropertySet(property.Name)) + { + string newPrefixForNull = NewPrefix(key, keyPrefix); + flatParams.Add(new KeyValuePair(newPrefixForNull, string.Empty)); + } + continue; } diff --git a/src/Stripe.net/Infrastructure/IHasSetTracking.cs b/src/Stripe.net/Infrastructure/IHasSetTracking.cs new file mode 100644 index 0000000000..58d45b1f4d --- /dev/null +++ b/src/Stripe.net/Infrastructure/IHasSetTracking.cs @@ -0,0 +1,17 @@ +namespace Stripe.Infrastructure +{ + /// + /// Implemented by options classes that support set-tracking for emptyable fields. + /// Allows encoders to check whether a null property was explicitly set (clear the field) + /// vs never set (omit from the request). + /// + internal interface IHasSetTracking + { + /// + /// Returns whether the given property was explicitly set by the caller. + /// + /// The C# property name to check. + /// True if the property was explicitly set. + bool IsPropertySet(string propertyName); + } +} diff --git a/src/Stripe.net/Infrastructure/JsonConverters/EmptyableConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/EmptyableConverter.cs deleted file mode 100644 index befe7361e0..0000000000 --- a/src/Stripe.net/Infrastructure/JsonConverters/EmptyableConverter.cs +++ /dev/null @@ -1,84 +0,0 @@ -namespace Stripe.Infrastructure -{ - using System; - using System.Reflection; - using Newtonsoft.Json; - using Newtonsoft.Json.Linq; - - /// - /// Converts a to and from JSON. - /// - /// Type of the field when expanded. - internal class EmptyableConverter : JsonConverter - { - /// - /// Gets a value indicating whether this can write JSON. - /// - /// - /// true if this can write JSON; otherwise, false. - /// - public override bool CanWrite => true; - - /// - /// Writes the JSON representation of the object. - /// - /// The to write to. - /// The value. - /// The calling serializer. - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - switch (value) - { - case null: - break; - - case Emptyable emptyable: - if (emptyable.Empty) - { - serializer.Serialize(writer, null); - } - else - { - serializer.Serialize(writer, emptyable.Value); - } - - break; - - default: - throw new JsonSerializationException(string.Format( - "Unexpected value when converting Emptyable. Expected Emptyable, got {0}.", - value.GetType())); - } - } - - /// - /// Determines whether this instance can convert the specified object type. - /// - /// Type of the object. - /// - /// true if this instance can convert the specified object type; otherwise, false. - /// - public override bool CanConvert(Type objectType) - { - if (!objectType.IsGenericType) - { - return false; - } - - return typeof(Emptyable<>).GetTypeInfo().IsAssignableFrom(objectType.GetGenericTypeDefinition()); - } - - /// - /// Reads the JSON representation of the object. - /// - /// The to read from. - /// Type of the object. - /// The existing value of object being read. - /// The calling serializer. - /// The object value. - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - throw new NotSupportedException("Cannot deserialize Emptyable objects."); - } - } -} diff --git a/src/Stripe.net/Infrastructure/JsonConverters/NewtonsoftStringEnumConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/NewtonsoftStringEnumConverter.cs new file mode 100644 index 0000000000..12b0b42445 --- /dev/null +++ b/src/Stripe.net/Infrastructure/JsonConverters/NewtonsoftStringEnumConverter.cs @@ -0,0 +1,35 @@ +namespace Stripe.Infrastructure +{ + using System; + using Newtonsoft.Json; + + /// + /// Newtonsoft converter that serializes any + /// subclass as its string. + /// + internal class NewtonsoftStringEnumConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return typeof(StringEnum).IsAssignableFrom(objectType); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if (value == null) + { + writer.WriteNull(); + } + else + { + writer.WriteValue(((StringEnum)value).Value); + } + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + throw new NotSupportedException( + $"Deserialization of {objectType.Name} (StringEnum) is not supported."); + } + } +} diff --git a/src/Stripe.net/Infrastructure/JsonConverters/STJDefaultConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/STJDefaultConverter.cs index eba571bb8b..8e0098f7e7 100644 --- a/src/Stripe.net/Infrastructure/JsonConverters/STJDefaultConverter.cs +++ b/src/Stripe.net/Infrastructure/JsonConverters/STJDefaultConverter.cs @@ -142,11 +142,17 @@ public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions switch (valueToSerialize) { case null: + // If this is an emptyable property that was explicitly set to null, + // write null even if the global ignore condition would skip it. + bool forceWriteNull = value is IHasSetTracking tracked + && tracked.IsPropertySet(property.PropertyInfo.Name); + // Use property-level ignore condition if set, otherwise use global setting var effectiveIgnoreCondition = property.IgnoreCondition ?? options.DefaultIgnoreCondition; - if (effectiveIgnoreCondition != JsonIgnoreCondition.WhenWritingNull && - effectiveIgnoreCondition != JsonIgnoreCondition.Always) + if (forceWriteNull || + (effectiveIgnoreCondition != JsonIgnoreCondition.WhenWritingNull && + effectiveIgnoreCondition != JsonIgnoreCondition.Always)) { writer.WritePropertyName(property.JsonPropertyName); writer.WriteNullValue(); diff --git a/src/Stripe.net/Infrastructure/JsonConverters/STJEmptyableConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/STJEmptyableConverter.cs deleted file mode 100644 index de7fb871f0..0000000000 --- a/src/Stripe.net/Infrastructure/JsonConverters/STJEmptyableConverter.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace Stripe.Infrastructure -{ - using System; - using System.Reflection; - using System.Text.Json; - using System.Text.Json.Serialization; - - /// - /// Converts a to and from JSON. - /// - /// Type of the field when expanded. - internal class STJEmptyableConverter : JsonConverter> - { - /// - /// Writes the JSON representation of the object. - /// - /// The to write to. - /// The value. - /// The calling serializer's options. - public override void Write(Utf8JsonWriter writer, Emptyable value, JsonSerializerOptions options) - { - switch (value) - { - case null: - break; - - case Emptyable emptyable: - if (emptyable.Empty) - { - writer.WriteNullValue(); - } - else - { - JsonSerializer.Serialize(writer, emptyable.Value, options); - } - - break; - - default: - throw new JsonException(string.Format( - "Unexpected value when converting Emptyable. Expected Emptyable, got {0}.", - value.GetType())); - } - } - - /// - /// Determines whether this instance can convert the specified object type. - /// - /// Type of the object. - /// - /// true if this instance can convert the specified object type; otherwise, false. - /// - public override bool CanConvert(Type objectType) - { - if (!objectType.IsGenericType) - { - return false; - } - - return typeof(IEmptyable).GetTypeInfo().IsAssignableFrom(objectType.GetGenericTypeDefinition()); - } - - /// - /// Reads the JSON representation of the object. - /// - /// The to read from. - /// Type of the object. - /// The calling serializer's options. - /// The object value. - public override Emptyable Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - throw new NotSupportedException("Cannot deserialize Emptyable objects."); - } - } -} diff --git a/src/Stripe.net/Infrastructure/JsonConverters/STJNullPreservingDictionaryConverter.cs b/src/Stripe.net/Infrastructure/JsonConverters/STJNullPreservingDictionaryConverter.cs new file mode 100644 index 0000000000..1f758090db --- /dev/null +++ b/src/Stripe.net/Infrastructure/JsonConverters/STJNullPreservingDictionaryConverter.cs @@ -0,0 +1,80 @@ +namespace Stripe.Infrastructure +{ + using System; + using System.Collections.Generic; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// Serializes dictionary entries preserving null values. The global + /// setting in + /// JsonEncodedContent would normally skip null dictionary entries, but for + /// metadata fields on update operations, {"key": null} means "delete this key." + /// Apply this converter per-property via attribute. + /// + internal class STJNullPreservingDictionaryConverter : JsonConverterFactory + { + /// + public override bool CanConvert(Type typeToConvert) + { + if (!typeToConvert.IsGenericType) + { + return false; + } + + return typeToConvert.GetGenericTypeDefinition() == typeof(Dictionary<,>); + } + + /// + public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) + { + var keyType = typeToConvert.GenericTypeArguments[0]; + var valueType = typeToConvert.GenericTypeArguments[1]; + + var converterType = typeof(InnerConverter<,>).MakeGenericType(keyType, valueType); + return (JsonConverter)Activator.CreateInstance(converterType); + } + + private class InnerConverter : JsonConverter> + { + public override Dictionary Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options) + { + // Standard deserialization handles null values fine. + // No recursion risk because this converter is per-property (via attribute), + // not registered globally in the options. + return JsonSerializer.Deserialize>(ref reader, options); + } + + public override void Write( + Utf8JsonWriter writer, + Dictionary value, + JsonSerializerOptions options) + { + writer.WriteStartObject(); + foreach (var kvp in value) + { + var key = kvp.Key?.ToString(); + if (key == null) + { + continue; + } + + writer.WritePropertyName(key); + if (kvp.Value == null) + { + writer.WriteNullValue(); + } + else + { + JsonSerializer.Serialize(writer, kvp.Value, options); + } + } + + writer.WriteEndObject(); + } + } + } +} diff --git a/src/Stripe.net/Infrastructure/JsonConverters/STJStringEnumConverterFactory.cs b/src/Stripe.net/Infrastructure/JsonConverters/STJStringEnumConverterFactory.cs new file mode 100644 index 0000000000..ddfe2dc88f --- /dev/null +++ b/src/Stripe.net/Infrastructure/JsonConverters/STJStringEnumConverterFactory.cs @@ -0,0 +1,46 @@ +namespace Stripe.Infrastructure +{ + using System; + using System.Text.Json; + using System.Text.Json.Serialization; + + /// + /// STJ converter factory that serializes any + /// subclass as its string. + /// + internal class STJStringEnumConverterFactory : JsonConverterFactory + { + public override bool CanConvert(Type typeToConvert) + { + return typeof(StringEnum).IsAssignableFrom(typeToConvert); + } + + public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options) + { + return (JsonConverter)Activator.CreateInstance( + typeof(STJStringEnumConverterInner<>).MakeGenericType(typeToConvert)); + } + + private class STJStringEnumConverterInner : JsonConverter + where T : StringEnum + { + public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + throw new NotSupportedException( + $"Deserialization of {typeToConvert.Name} (StringEnum) is not supported."); + } + + public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) + { + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(value.Value); + } + } + } + } +} diff --git a/src/Stripe.net/Infrastructure/Public/StripeClient.cs b/src/Stripe.net/Infrastructure/Public/StripeClient.cs index 8421cb46cf..b4766eb8f3 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeClient.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeClient.cs @@ -7,6 +7,7 @@ namespace Stripe using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; + using Newtonsoft.Json.Linq; using Stripe.V2.Core; /// @@ -228,6 +229,15 @@ public EventNotification ParseEventNotification( { EventUtility.ValidateSignature(json, stripeSignatureHeader, secret, tolerance, DateTimeOffset.UtcNow.ToUnixTimeSeconds()); + var parsed = JObject.Parse(json); + var objectValue = (string)parsed["object"]; + if (objectValue == "event") + { + throw new ArgumentException( + "You passed a webhook payload to ParseEventNotification, which expects " + + "a thin event notification. Use EventUtility.ConstructEvent instead."); + } + return EventNotification.FromJson(json, this); } diff --git a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs index ebdad9f91d..2685f39e56 100644 --- a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs +++ b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs @@ -70,6 +70,7 @@ private static readonly Lazy LazyDefaultHttpClient ("CODEX_CI", "codex_cli"), ("CURSOR_AGENT", "cursor"), ("GEMINI_CLI", "gemini_cli"), + ("OPENCLAW_SHELL", "openclaw"), ("OPENCODE", "open_code"), // The end of the section generated from our OpenAPI spec diff --git a/src/Stripe.net/Infrastructure/SetTracker.cs b/src/Stripe.net/Infrastructure/SetTracker.cs new file mode 100644 index 0000000000..810a0d3b8b --- /dev/null +++ b/src/Stripe.net/Infrastructure/SetTracker.cs @@ -0,0 +1,35 @@ +namespace Stripe.Infrastructure +{ + using System.Collections.Generic; + using System.Runtime.CompilerServices; + + /// + /// Tracks which properties have been explicitly set by the caller. + /// Used by emptyable fields so that setting a property to null is + /// distinguishable from never setting it. + /// + internal class SetTracker + { + private HashSet properties; + + /// + /// Records that a property was explicitly set. + /// + /// The name of the property (auto-populated by CallerMemberName). + public void Track([CallerMemberName] string propertyName = null) + { + this.properties ??= new HashSet(); + this.properties.Add(propertyName); + } + + /// + /// Returns whether the given property was explicitly set. + /// + /// The C# property name to check. + /// True if the property was explicitly set. + public bool IsSet(string propertyName) + { + return this.properties != null && this.properties.Contains(propertyName); + } + } +} diff --git a/src/Stripe.net/Services/AccountExternalAccounts/AccountExternalAccountUpdateOptions.cs b/src/Stripe.net/Services/AccountExternalAccounts/AccountExternalAccountUpdateOptions.cs index b6670e8f8c..6e4a7f5c84 100644 --- a/src/Stripe.net/Services/AccountExternalAccounts/AccountExternalAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/AccountExternalAccounts/AccountExternalAccountUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AccountExternalAccountUpdateOptions : BaseOptions, IHasMetadata { + private string accountHolderType; + private Dictionary metadata; + /// /// The name of the person or business that owns the bank account. /// @@ -23,7 +26,15 @@ public class AccountExternalAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("account_holder_type")] [STJS.JsonPropertyName("account_holder_type")] - public string AccountHolderType { get; set; } + public string AccountHolderType + { + get => this.accountHolderType; + set + { + this.accountHolderType = value; + this.SetTracker.Track(); + } + } /// /// The bank account type. This can only be checking or savings in most @@ -112,7 +123,15 @@ public class AccountExternalAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Cardholder name. diff --git a/src/Stripe.net/Services/AccountPersons/AccountPersonAdditionalTosAcceptancesAccountOptions.cs b/src/Stripe.net/Services/AccountPersons/AccountPersonAdditionalTosAcceptancesAccountOptions.cs index 1e2f3d43d1..61026cbaee 100644 --- a/src/Stripe.net/Services/AccountPersons/AccountPersonAdditionalTosAcceptancesAccountOptions.cs +++ b/src/Stripe.net/Services/AccountPersons/AccountPersonAdditionalTosAcceptancesAccountOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountPersonAdditionalTosAcceptancesAccountOptions : INestedOptions + public class AccountPersonAdditionalTosAcceptancesAccountOptions : INestedOptions, IHasSetTracking { + private string userAgent; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The Unix timestamp marking when the account representative accepted the service /// agreement. @@ -32,6 +38,19 @@ public class AccountPersonAdditionalTosAcceptancesAccountOptions : INestedOption /// [JsonProperty("user_agent")] [STJS.JsonPropertyName("user_agent")] - public string UserAgent { get; set; } + public string UserAgent + { + get => this.userAgent; + set + { + this.userAgent = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs b/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs index 289bb2e232..65a1e00821 100644 --- a/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs +++ b/src/Stripe.net/Services/AccountPersons/AccountPersonCreateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AccountPersonCreateOptions : BaseOptions, IHasMetadata { + private AccountPersonDobOptions dob; + private List fullNameAliases; + private Dictionary metadata; + /// /// Details on the legal guardian's or authorizer's acceptance of the required Stripe /// agreements. @@ -43,7 +47,15 @@ public class AccountPersonCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("dob")] [STJS.JsonPropertyName("dob")] - public AccountPersonDobOptions Dob { get; set; } + public AccountPersonDobOptions Dob + { + get => this.dob; + set + { + this.dob = value; + this.SetTracker.Track(); + } + } /// /// Documents that may be submitted to satisfy various informational requests. @@ -85,7 +97,15 @@ public class AccountPersonCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("full_name_aliases")] [STJS.JsonPropertyName("full_name_aliases")] - public List FullNameAliases { get; set; } + public List FullNameAliases + { + get => this.fullNameAliases; + set + { + this.fullNameAliases = value; + this.SetTracker.Track(); + } + } /// /// The person's gender (International regulations require either "male" or "female"). @@ -152,7 +172,15 @@ public class AccountPersonCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The country where the person is a national. Two-letter country code ( /// A filter on the list of people returned based on whether these people are authorizers of /// the account's representative. @@ -54,7 +60,15 @@ public class AccountPersonRelationshipOptions : INestedOptions /// [JsonProperty("percent_ownership")] [STJS.JsonPropertyName("percent_ownership")] - public decimal? PercentOwnership { get; set; } + public decimal? PercentOwnership + { + get => this.percentOwnership; + set + { + this.percentOwnership = value; + this.SetTracker.Track(); + } + } /// /// Whether the person is authorized as the primary representative of the account. This is @@ -73,5 +87,10 @@ public class AccountPersonRelationshipOptions : INestedOptions [JsonProperty("title")] [STJS.JsonPropertyName("title")] public string Title { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs b/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs index f644bb5584..f8bcc5a703 100644 --- a/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs +++ b/src/Stripe.net/Services/AccountPersons/AccountPersonUpdateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AccountPersonUpdateOptions : BaseOptions, IHasMetadata { + private AccountPersonDobOptions dob; + private List fullNameAliases; + private Dictionary metadata; + /// /// Details on the legal guardian's or authorizer's acceptance of the required Stripe /// agreements. @@ -43,7 +47,15 @@ public class AccountPersonUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("dob")] [STJS.JsonPropertyName("dob")] - public AccountPersonDobOptions Dob { get; set; } + public AccountPersonDobOptions Dob + { + get => this.dob; + set + { + this.dob = value; + this.SetTracker.Track(); + } + } /// /// Documents that may be submitted to satisfy various informational requests. @@ -85,7 +97,15 @@ public class AccountPersonUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("full_name_aliases")] [STJS.JsonPropertyName("full_name_aliases")] - public List FullNameAliases { get; set; } + public List FullNameAliases + { + get => this.fullNameAliases; + set + { + this.fullNameAliases = value; + this.SetTracker.Track(); + } + } /// /// The person's gender (International regulations require either "male" or "female"). @@ -152,7 +172,15 @@ public class AccountPersonUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The country where the person is a national. Two-letter country code ( allowedApps; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The list of apps allowed to be enabled in the embedded component. /// [JsonProperty("allowed_apps")] [STJS.JsonPropertyName("allowed_apps")] - public List AllowedApps { get; set; } + public List AllowedApps + { + get => this.allowedApps; + set + { + this.allowedApps = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsAppViewportFeaturesOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsAppViewportFeaturesOptions.cs index ec9e01f4ef..4a4d5893f7 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsAppViewportFeaturesOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsAppViewportFeaturesOptions.cs @@ -7,13 +7,32 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountSessionComponentsAppViewportFeaturesOptions : INestedOptions + public class AccountSessionComponentsAppViewportFeaturesOptions : INestedOptions, IHasSetTracking { + private List allowedApps; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The list of apps allowed to be enabled in the embedded component. /// [JsonProperty("allowed_apps")] [STJS.JsonPropertyName("allowed_apps")] - public List AllowedApps { get; set; } + public List AllowedApps + { + get => this.allowedApps; + set + { + this.allowedApps = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs b/src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs index 5a502e10f3..1326c96110 100644 --- a/src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountBusinessProfileOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountBusinessProfileOptions : INestedOptions + public class AccountBusinessProfileOptions : INestedOptions, IHasSetTracking { + private string specifiedCommercialTransactionsActUrl; + private string supportUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The applicant's gross annual revenue for its preceding fiscal year. /// @@ -71,7 +78,15 @@ public class AccountBusinessProfileOptions : INestedOptions /// [JsonProperty("specified_commercial_transactions_act_url")] [STJS.JsonPropertyName("specified_commercial_transactions_act_url")] - public string SpecifiedCommercialTransactionsActUrl { get; set; } + public string SpecifiedCommercialTransactionsActUrl + { + get => this.specifiedCommercialTransactionsActUrl; + set + { + this.specifiedCommercialTransactionsActUrl = value; + this.SetTracker.Track(); + } + } /// /// A publicly available mailing address for sending support issues to. @@ -99,7 +114,15 @@ public class AccountBusinessProfileOptions : INestedOptions /// [JsonProperty("support_url")] [STJS.JsonPropertyName("support_url")] - public string SupportUrl { get; set; } + public string SupportUrl + { + get => this.supportUrl; + set + { + this.supportUrl = value; + this.SetTracker.Track(); + } + } /// /// The business's publicly available website. @@ -107,5 +130,10 @@ public class AccountBusinessProfileOptions : INestedOptions [JsonProperty("url")] [STJS.JsonPropertyName("url")] public string Url { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountCompanyOptions.cs b/src/Stripe.net/Services/Accounts/AccountCompanyOptions.cs index 510d401d46..b05ac2e0b1 100644 --- a/src/Stripe.net/Services/Accounts/AccountCompanyOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountCompanyOptions.cs @@ -6,8 +6,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountCompanyOptions : INestedOptions + public class AccountCompanyOptions : INestedOptions, IHasSetTracking { + private string ownershipExemptionReason; + private AccountCompanyRegistrationDateOptions registrationDate; + private string structure; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The company's primary address. /// @@ -124,7 +132,15 @@ public class AccountCompanyOptions : INestedOptions /// [JsonProperty("ownership_exemption_reason")] [STJS.JsonPropertyName("ownership_exemption_reason")] - public string OwnershipExemptionReason { get; set; } + public string OwnershipExemptionReason + { + get => this.ownershipExemptionReason; + set + { + this.ownershipExemptionReason = value; + this.SetTracker.Track(); + } + } /// /// The company's phone number (used for verification). @@ -138,7 +154,15 @@ public class AccountCompanyOptions : INestedOptions /// [JsonProperty("registration_date")] [STJS.JsonPropertyName("registration_date")] - public AccountCompanyRegistrationDateOptions RegistrationDate { get; set; } + public AccountCompanyRegistrationDateOptions RegistrationDate + { + get => this.registrationDate; + set + { + this.registrationDate = value; + this.SetTracker.Track(); + } + } /// /// The identification number given to a company when it is registered or incorporated, if @@ -175,7 +199,15 @@ public class AccountCompanyOptions : INestedOptions /// [JsonProperty("structure")] [STJS.JsonPropertyName("structure")] - public string Structure { get; set; } + public string Structure + { + get => this.structure; + set + { + this.structure = value; + this.SetTracker.Track(); + } + } /// /// The business ID number of the company, as appropriate for the company’s country. @@ -207,5 +239,10 @@ public class AccountCompanyOptions : INestedOptions [JsonProperty("verification")] [STJS.JsonPropertyName("verification")] public AccountCompanyVerificationOptions Verification { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountCreateOptions.cs b/src/Stripe.net/Services/Accounts/AccountCreateOptions.cs index a161ca4396..051a599ffb 100644 --- a/src/Stripe.net/Services/Accounts/AccountCreateOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AccountCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An account token, used to /// securely provide details to the account. @@ -166,7 +168,15 @@ public class AccountCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// A hash to configure risk controls on the account. Please see /// The group the account is in to determine their payments pricing, and null if the account /// is on customized pricing. [JsonProperty("payments_pricing")] [STJS.JsonPropertyName("payments_pricing")] - public string PaymentsPricing { get; set; } + public string PaymentsPricing + { + get => this.paymentsPricing; + set + { + this.paymentsPricing = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs b/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs index 729f7f8600..65d3108d91 100644 --- a/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountIndividualOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountIndividualOptions : INestedOptions, IHasMetadata + public class AccountIndividualOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private DobOptions dob; + private List fullNameAliases; + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The individual's primary address. /// @@ -35,7 +43,15 @@ public class AccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("dob")] [STJS.JsonPropertyName("dob")] - public DobOptions Dob { get; set; } + public DobOptions Dob + { + get => this.dob; + set + { + this.dob = value; + this.SetTracker.Track(); + } + } /// /// The individual's email address. @@ -70,7 +86,15 @@ public class AccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("full_name_aliases")] [STJS.JsonPropertyName("full_name_aliases")] - public List FullNameAliases { get; set; } + public List FullNameAliases + { + get => this.fullNameAliases; + set + { + this.fullNameAliases = value; + this.SetTracker.Track(); + } + } /// /// The individual's gender. @@ -138,7 +162,15 @@ public class AccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The individual's phone number. @@ -184,5 +216,10 @@ public class AccountIndividualOptions : INestedOptions, IHasMetadata [JsonProperty("verification")] [STJS.JsonPropertyName("verification")] public AccountIndividualVerificationOptions Verification { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountIndividualRelationshipOptions.cs b/src/Stripe.net/Services/Accounts/AccountIndividualRelationshipOptions.cs index 2a9160a340..6a2959990f 100644 --- a/src/Stripe.net/Services/Accounts/AccountIndividualRelationshipOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountIndividualRelationshipOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountIndividualRelationshipOptions : INestedOptions + public class AccountIndividualRelationshipOptions : INestedOptions, IHasSetTracking { + private decimal? percentOwnership; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Whether the person is a director of the account's legal entity. Directors are typically /// members of the governing board of the company, or responsible for ensuring the company @@ -37,7 +43,15 @@ public class AccountIndividualRelationshipOptions : INestedOptions /// [JsonProperty("percent_ownership")] [STJS.JsonPropertyName("percent_ownership")] - public decimal? PercentOwnership { get; set; } + public decimal? PercentOwnership + { + get => this.percentOwnership; + set + { + this.percentOwnership = value; + this.SetTracker.Track(); + } + } /// /// The person's title (e.g., CEO, Support Engineer). @@ -45,5 +59,10 @@ public class AccountIndividualRelationshipOptions : INestedOptions [JsonProperty("title")] [STJS.JsonPropertyName("title")] public string Title { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountSettingsCardIssuingTosAcceptanceOptions.cs b/src/Stripe.net/Services/Accounts/AccountSettingsCardIssuingTosAcceptanceOptions.cs index 4bc252427e..10296d467c 100644 --- a/src/Stripe.net/Services/Accounts/AccountSettingsCardIssuingTosAcceptanceOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountSettingsCardIssuingTosAcceptanceOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountSettingsCardIssuingTosAcceptanceOptions : INestedOptions + public class AccountSettingsCardIssuingTosAcceptanceOptions : INestedOptions, IHasSetTracking { + private string userAgent; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The Unix timestamp marking when the account representative accepted the service /// agreement. @@ -32,6 +38,19 @@ public class AccountSettingsCardIssuingTosAcceptanceOptions : INestedOptions /// [JsonProperty("user_agent")] [STJS.JsonPropertyName("user_agent")] - public string UserAgent { get; set; } + public string UserAgent + { + get => this.userAgent; + set + { + this.userAgent = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountSettingsCardPaymentsOptions.cs b/src/Stripe.net/Services/Accounts/AccountSettingsCardPaymentsOptions.cs index ed9134e84d..b7c76219e8 100644 --- a/src/Stripe.net/Services/Accounts/AccountSettingsCardPaymentsOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountSettingsCardPaymentsOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountSettingsCardPaymentsOptions : INestedOptions + public class AccountSettingsCardPaymentsOptions : INestedOptions, IHasSetTracking { + private string statementDescriptorPrefixKana; + private string statementDescriptorPrefixKanji; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Automatically declines certain charge types regardless of whether the card issuer /// accepted or declined the charge. @@ -35,7 +42,15 @@ public class AccountSettingsCardPaymentsOptions : INestedOptions /// [JsonProperty("statement_descriptor_prefix_kana")] [STJS.JsonPropertyName("statement_descriptor_prefix_kana")] - public string StatementDescriptorPrefixKana { get; set; } + public string StatementDescriptorPrefixKana + { + get => this.statementDescriptorPrefixKana; + set + { + this.statementDescriptorPrefixKana = value; + this.SetTracker.Track(); + } + } /// /// The Kanji variation of the default text that appears on credit card statements when a @@ -46,6 +61,19 @@ public class AccountSettingsCardPaymentsOptions : INestedOptions /// [JsonProperty("statement_descriptor_prefix_kanji")] [STJS.JsonPropertyName("statement_descriptor_prefix_kanji")] - public string StatementDescriptorPrefixKanji { get; set; } + public string StatementDescriptorPrefixKanji + { + get => this.statementDescriptorPrefixKanji; + set + { + this.statementDescriptorPrefixKanji = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountSettingsInvoicesOptions.cs b/src/Stripe.net/Services/Accounts/AccountSettingsInvoicesOptions.cs index bc8c2b08d5..850130bc16 100644 --- a/src/Stripe.net/Services/Accounts/AccountSettingsInvoicesOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountSettingsInvoicesOptions.cs @@ -7,15 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountSettingsInvoicesOptions : INestedOptions + public class AccountSettingsInvoicesOptions : INestedOptions, IHasSetTracking { + private List defaultAccountTaxIds; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The list of default Account Tax IDs to automatically include on invoices. Account Tax /// IDs get added when an invoice is finalized. /// [JsonProperty("default_account_tax_ids")] [STJS.JsonPropertyName("default_account_tax_ids")] - public List DefaultAccountTaxIds { get; set; } + public List DefaultAccountTaxIds + { + get => this.defaultAccountTaxIds; + set + { + this.defaultAccountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Whether to save the payment method after a payment is completed for a one-time invoice @@ -26,5 +40,10 @@ public class AccountSettingsInvoicesOptions : INestedOptions [JsonProperty("hosted_payment_method_save")] [STJS.JsonPropertyName("hosted_payment_method_save")] public string HostedPaymentMethodSave { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountSettingsTreasuryTosAcceptanceOptions.cs b/src/Stripe.net/Services/Accounts/AccountSettingsTreasuryTosAcceptanceOptions.cs index 631fe9ff5f..43ad70fdf9 100644 --- a/src/Stripe.net/Services/Accounts/AccountSettingsTreasuryTosAcceptanceOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountSettingsTreasuryTosAcceptanceOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountSettingsTreasuryTosAcceptanceOptions : INestedOptions + public class AccountSettingsTreasuryTosAcceptanceOptions : INestedOptions, IHasSetTracking { + private string userAgent; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The Unix timestamp marking when the account representative accepted the service /// agreement. @@ -32,6 +38,19 @@ public class AccountSettingsTreasuryTosAcceptanceOptions : INestedOptions /// [JsonProperty("user_agent")] [STJS.JsonPropertyName("user_agent")] - public string UserAgent { get; set; } + public string UserAgent + { + get => this.userAgent; + set + { + this.userAgent = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Accounts/AccountUpdateOptions.cs b/src/Stripe.net/Services/Accounts/AccountUpdateOptions.cs index a396033144..b43a008249 100644 --- a/src/Stripe.net/Services/Accounts/AccountUpdateOptions.cs +++ b/src/Stripe.net/Services/Accounts/AccountUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AccountUpdateOptions : BaseOptions, IHasMetadata { + private AnyOf externalAccount; + private Dictionary metadata; + /// /// An account token, used to /// securely provide details to the account. @@ -114,7 +117,15 @@ public class AccountUpdateOptions : BaseOptions, IHasMetadata [JsonConverter(typeof(AnyOfConverter))] [STJS.JsonPropertyName("external_account")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] - public AnyOf ExternalAccount { get; set; } + public AnyOf ExternalAccount + { + get => this.externalAccount; + set + { + this.externalAccount = value; + this.SetTracker.Track(); + } + } /// /// A hash of account group type to tokens. These are account groups this account should be @@ -145,7 +156,15 @@ public class AccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// A hash to configure risk controls on the account. Please see metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class ApplicationFeeRefundUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsPayoutsOptions.cs b/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsPayoutsOptions.cs index c5e7f773e3..bceb75f8da 100644 --- a/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsPayoutsOptions.cs +++ b/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsPayoutsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class BalanceSettingsPaymentsPayoutsOptions : INestedOptions + public class BalanceSettingsPaymentsPayoutsOptions : INestedOptions, IHasSetTracking { + private Dictionary minimumBalanceByCurrency; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The minimum balance amount to retain per currency after automatic payouts. Only funds /// that exceed these amounts are paid out. Learn more about the [JsonProperty("minimum_balance_by_currency")] [STJS.JsonPropertyName("minimum_balance_by_currency")] - public Dictionary MinimumBalanceByCurrency { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary MinimumBalanceByCurrency + { + get => this.minimumBalanceByCurrency; + set + { + this.minimumBalanceByCurrency = value; + this.SetTracker.Track(); + } + } /// /// Details on when funds from charges are available, and when they are paid out to an @@ -36,5 +51,10 @@ public class BalanceSettingsPaymentsPayoutsOptions : INestedOptions [JsonProperty("statement_descriptor")] [STJS.JsonPropertyName("statement_descriptor")] public string StatementDescriptor { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsSettlementTimingOptions.cs b/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsSettlementTimingOptions.cs index 53a2f92944..fae48b952b 100644 --- a/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsSettlementTimingOptions.cs +++ b/src/Stripe.net/Services/BalanceSettings/BalanceSettingsPaymentsSettlementTimingOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class BalanceSettingsPaymentsSettlementTimingOptions : INestedOptions + public class BalanceSettingsPaymentsSettlementTimingOptions : INestedOptions, IHasSetTracking { + private long? delayDaysOverride; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Change delay_days for this account, which determines the number of days charge /// funds are held before becoming available. The maximum value is 31. Passing an empty @@ -18,6 +24,19 @@ public class BalanceSettingsPaymentsSettlementTimingOptions : INestedOptions /// [JsonProperty("delay_days_override")] [STJS.JsonPropertyName("delay_days_override")] - public long? DelayDaysOverride { get; set; } + public long? DelayDaysOverride + { + get => this.delayDaysOverride; + set + { + this.delayDaysOverride = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs b/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs index cda62c7523..efa4a06253 100644 --- a/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/BankAccounts/BankAccountUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class BankAccountUpdateOptions : BaseOptions, IHasMetadata { + private string accountHolderType; + private Dictionary metadata; + /// /// The name of the person or business that owns the bank account. /// @@ -23,7 +26,15 @@ public class BankAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("account_holder_type")] [STJS.JsonPropertyName("account_holder_type")] - public string AccountHolderType { get; set; } + public string AccountHolderType + { + get => this.accountHolderType; + set + { + this.accountHolderType = value; + this.SetTracker.Track(); + } + } /// /// The bank account type. This can only be checking or savings in most @@ -49,6 +60,14 @@ public class BankAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Billing/CreditGrants/CreditGrantUpdateOptions.cs b/src/Stripe.net/Services/Billing/CreditGrants/CreditGrantUpdateOptions.cs index 72fb417005..8d4c415a85 100644 --- a/src/Stripe.net/Services/Billing/CreditGrants/CreditGrantUpdateOptions.cs +++ b/src/Stripe.net/Services/Billing/CreditGrants/CreditGrantUpdateOptions.cs @@ -10,6 +10,8 @@ namespace Stripe.Billing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CreditGrantUpdateOptions : BaseOptions, IHasMetadata { + private DateTime? expiresAt; + /// /// The time when the billing credits created by this credit grant expire. If set to empty, /// the billing credits never expire. @@ -18,7 +20,15 @@ public class CreditGrantUpdateOptions : BaseOptions, IHasMetadata [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("expires_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ExpiresAt { get; set; } + public DateTime? ExpiresAt + { + get => this.expiresAt; + set + { + this.expiresAt = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs you can attach to an object. You can use this to store additional diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationBusinessProfileOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationBusinessProfileOptions.cs index 243ff066bb..f28965f9cd 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationBusinessProfileOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationBusinessProfileOptions.cs @@ -6,27 +6,64 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationBusinessProfileOptions : INestedOptions + public class ConfigurationBusinessProfileOptions : INestedOptions, IHasSetTracking { + private string headline; + private string privacyPolicyUrl; + private string termsOfServiceUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The messaging shown to customers in the portal. /// [JsonProperty("headline")] [STJS.JsonPropertyName("headline")] - public string Headline { get; set; } + public string Headline + { + get => this.headline; + set + { + this.headline = value; + this.SetTracker.Track(); + } + } /// /// A link to the business’s publicly available privacy policy. /// [JsonProperty("privacy_policy_url")] [STJS.JsonPropertyName("privacy_policy_url")] - public string PrivacyPolicyUrl { get; set; } + public string PrivacyPolicyUrl + { + get => this.privacyPolicyUrl; + set + { + this.privacyPolicyUrl = value; + this.SetTracker.Track(); + } + } /// /// A link to the business’s publicly available terms of service. /// [JsonProperty("terms_of_service_url")] [STJS.JsonPropertyName("terms_of_service_url")] - public string TermsOfServiceUrl { get; set; } + public string TermsOfServiceUrl + { + get => this.termsOfServiceUrl; + set + { + this.termsOfServiceUrl = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs index 8a52161107..cc780f9d1f 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe.BillingPortal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ConfigurationCreateOptions : BaseOptions, IHasMetadata { + private string defaultReturnUrl; + private string name; + /// /// The business information shown to customers in the portal. /// @@ -24,7 +27,15 @@ public class ConfigurationCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_return_url")] [STJS.JsonPropertyName("default_return_url")] - public string DefaultReturnUrl { get; set; } + public string DefaultReturnUrl + { + get => this.defaultReturnUrl; + set + { + this.defaultReturnUrl = value; + this.SetTracker.Track(); + } + } /// /// Information about the features available in the portal. @@ -58,6 +69,14 @@ public class ConfigurationCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesCustomerUpdateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesCustomerUpdateOptions.cs index 6586d7fd3a..f9ea5819b1 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesCustomerUpdateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesCustomerUpdateOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationFeaturesCustomerUpdateOptions : INestedOptions + public class ConfigurationFeaturesCustomerUpdateOptions : INestedOptions, IHasSetTracking { + private List allowedUpdates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The types of customer updates that are supported. When empty, customers are not /// updateable. @@ -17,7 +23,15 @@ public class ConfigurationFeaturesCustomerUpdateOptions : INestedOptions /// [JsonProperty("allowed_updates")] [STJS.JsonPropertyName("allowed_updates")] - public List AllowedUpdates { get; set; } + public List AllowedUpdates + { + get => this.allowedUpdates; + set + { + this.allowedUpdates = value; + this.SetTracker.Track(); + } + } /// /// Whether the feature is enabled. @@ -25,5 +39,10 @@ public class ConfigurationFeaturesCustomerUpdateOptions : INestedOptions [JsonProperty("enabled")] [STJS.JsonPropertyName("enabled")] public bool? Enabled { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesPaymentMethodUpdateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesPaymentMethodUpdateOptions.cs index 9e6ff9b588..fe953af988 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesPaymentMethodUpdateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesPaymentMethodUpdateOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationFeaturesPaymentMethodUpdateOptions : INestedOptions + public class ConfigurationFeaturesPaymentMethodUpdateOptions : INestedOptions, IHasSetTracking { + private string paymentMethodConfiguration; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Whether the feature is enabled. /// @@ -24,6 +30,19 @@ public class ConfigurationFeaturesPaymentMethodUpdateOptions : INestedOptions /// [JsonProperty("payment_method_configuration")] [STJS.JsonPropertyName("payment_method_configuration")] - public string PaymentMethodConfiguration { get; set; } + public string PaymentMethodConfiguration + { + get => this.paymentMethodConfiguration; + set + { + this.paymentMethodConfiguration = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions.cs index d3c8f77b7d..054fe308b0 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions : INestedOptions + public class ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions : INestedOptions, IHasSetTracking { + private List options; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Whether the feature is enabled. /// @@ -24,6 +30,19 @@ public class ConfigurationFeaturesSubscriptionCancelCancellationReasonOptions : /// [JsonProperty("options")] [STJS.JsonPropertyName("options")] - public List Options { get; set; } + public List Options + { + get => this.options; + set + { + this.options = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs index 65775efb75..82b1da99ab 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateOptions.cs @@ -7,8 +7,15 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationFeaturesSubscriptionUpdateOptions : INestedOptions + public class ConfigurationFeaturesSubscriptionUpdateOptions : INestedOptions, IHasSetTracking { + private List defaultAllowedUpdates; + private List products; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Determines the value to use for the billing cycle anchor on subscription updates. Valid /// values are now or unchanged, and the default value is unchanged. @@ -28,7 +35,15 @@ public class ConfigurationFeaturesSubscriptionUpdateOptions : INestedOptions /// [JsonProperty("default_allowed_updates")] [STJS.JsonPropertyName("default_allowed_updates")] - public List DefaultAllowedUpdates { get; set; } + public List DefaultAllowedUpdates + { + get => this.defaultAllowedUpdates; + set + { + this.defaultAllowedUpdates = value; + this.SetTracker.Track(); + } + } /// /// Whether the feature is enabled. @@ -42,7 +57,15 @@ public class ConfigurationFeaturesSubscriptionUpdateOptions : INestedOptions /// [JsonProperty("products")] [STJS.JsonPropertyName("products")] - public List Products { get; set; } + public List Products + { + get => this.products; + set + { + this.products = value; + this.SetTracker.Track(); + } + } /// /// Determines how to handle prorations resulting from subscription updates. Valid values @@ -68,5 +91,10 @@ public class ConfigurationFeaturesSubscriptionUpdateOptions : INestedOptions [JsonProperty("trial_update_behavior")] [STJS.JsonPropertyName("trial_update_behavior")] public string TrialUpdateBehavior { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions.cs index c2f9efb9ba..40cd7713a7 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions.cs @@ -7,14 +7,33 @@ namespace Stripe.BillingPortal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions : INestedOptions + public class ConfigurationFeaturesSubscriptionUpdateScheduleAtPeriodEndOptions : INestedOptions, IHasSetTracking { + private List conditions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// List of conditions. When any condition is true, the update will be scheduled at the end /// of the current period. /// [JsonProperty("conditions")] [STJS.JsonPropertyName("conditions")] - public List Conditions { get; set; } + public List Conditions + { + get => this.conditions; + set + { + this.conditions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs index e2709d8d17..e55cdec2ec 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe.BillingPortal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ConfigurationUpdateOptions : BaseOptions, IHasMetadata { + private string defaultReturnUrl; + private Dictionary metadata; + private string name; + /// /// Whether the configuration is active and can be used to create portal sessions. /// @@ -31,7 +35,15 @@ public class ConfigurationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_return_url")] [STJS.JsonPropertyName("default_return_url")] - public string DefaultReturnUrl { get; set; } + public string DefaultReturnUrl + { + get => this.defaultReturnUrl; + set + { + this.defaultReturnUrl = value; + this.SetTracker.Track(); + } + } /// /// Information about the features available in the portal. @@ -58,13 +70,29 @@ public class ConfigurationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The name of the configuration. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs index 000409a6ee..37fc912b28 100644 --- a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CardUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The bank account type. This can only be checking or savings in most /// countries. In Japan, this can only be futsu or toza. @@ -89,7 +91,15 @@ public class CardUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Cardholder name. diff --git a/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs b/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs index b7cbc6c3c2..79add5d38d 100644 --- a/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ChargeCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Amount intended to be collected by this payment. A positive integer representing how /// much to charge in the smallest @@ -93,7 +95,15 @@ public class ChargeCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The Stripe account ID for which these funds are intended. You can specify the business diff --git a/src/Stripe.net/Services/Charges/ChargeFraudDetailsOptions.cs b/src/Stripe.net/Services/Charges/ChargeFraudDetailsOptions.cs index 3839bc1d40..78df628e75 100644 --- a/src/Stripe.net/Services/Charges/ChargeFraudDetailsOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeFraudDetailsOptions.cs @@ -6,14 +6,33 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargeFraudDetailsOptions : INestedOptions + public class ChargeFraudDetailsOptions : INestedOptions, IHasSetTracking { + private string userReport; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Either safe or fraudulent. /// One of: fraudulent, or safe. /// [JsonProperty("user_report")] [STJS.JsonPropertyName("user_report")] - public string UserReport { get; set; } + public string UserReport + { + get => this.userReport; + set + { + this.userReport = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs index 3bf77d2845..34d38ab8bf 100644 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs @@ -7,8 +7,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsOptions : INestedOptions + public class ChargePaymentDetailsOptions : INestedOptions, IHasSetTracking { + private List carRentalData; + private string customerReference; + private List flightData; + private List lodgingData; + private string orderReference; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Car rental details for this PaymentIntent. /// @@ -21,7 +31,15 @@ public class ChargePaymentDetailsOptions : INestedOptions /// [JsonProperty("car_rental_data")] [STJS.JsonPropertyName("car_rental_data")] - public List CarRentalData { get; set; } + public List CarRentalData + { + get => this.carRentalData; + set + { + this.carRentalData = value; + this.SetTracker.Track(); + } + } /// /// A unique value to identify the customer. This field is available only for card payments. @@ -31,7 +49,15 @@ public class ChargePaymentDetailsOptions : INestedOptions /// [JsonProperty("customer_reference")] [STJS.JsonPropertyName("customer_reference")] - public string CustomerReference { get; set; } + public string CustomerReference + { + get => this.customerReference; + set + { + this.customerReference = value; + this.SetTracker.Track(); + } + } /// /// Event details for this PaymentIntent. @@ -52,7 +78,15 @@ public class ChargePaymentDetailsOptions : INestedOptions /// [JsonProperty("flight_data")] [STJS.JsonPropertyName("flight_data")] - public List FlightData { get; set; } + public List FlightData + { + get => this.flightData; + set + { + this.flightData = value; + this.SetTracker.Track(); + } + } /// /// Lodging reservation details for this PaymentIntent. @@ -66,7 +100,15 @@ public class ChargePaymentDetailsOptions : INestedOptions /// [JsonProperty("lodging_data")] [STJS.JsonPropertyName("lodging_data")] - public List LodgingData { get; set; } + public List LodgingData + { + get => this.lodgingData; + set + { + this.lodgingData = value; + this.SetTracker.Track(); + } + } /// /// A unique value assigned by the business to identify the transaction. Required for L2 and @@ -78,7 +120,15 @@ public class ChargePaymentDetailsOptions : INestedOptions /// [JsonProperty("order_reference")] [STJS.JsonPropertyName("order_reference")] - public string OrderReference { get; set; } + public string OrderReference + { + get => this.orderReference; + set + { + this.orderReference = value; + this.SetTracker.Track(); + } + } /// /// Subscription details for this PaymentIntent. @@ -86,5 +136,10 @@ public class ChargePaymentDetailsOptions : INestedOptions [JsonProperty("subscription")] [STJS.JsonPropertyName("subscription")] public ChargePaymentDetailsSubscriptionOptions Subscription { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs b/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs index 2469884b60..8d6579dcf0 100644 --- a/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ChargeUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The ID of an existing customer that will be associated with this request. This field may /// only be updated if there is no existing associated customer with this charge. @@ -52,7 +54,15 @@ public class ChargeUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Provides industry-specific information about the charge. diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionBrandingSettingsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionBrandingSettingsOptions.cs index 327a61afc5..271b0c7dac 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionBrandingSettingsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionBrandingSettingsOptions.cs @@ -6,15 +6,32 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionBrandingSettingsOptions : INestedOptions + public class SessionBrandingSettingsOptions : INestedOptions, IHasSetTracking { + private string backgroundColor; + private string borderStyle; + private string buttonColor; + private string fontFamily; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A hex color value starting with # representing the background color for the /// Checkout Session. /// [JsonProperty("background_color")] [STJS.JsonPropertyName("background_color")] - public string BackgroundColor { get; set; } + public string BackgroundColor + { + get => this.backgroundColor; + set + { + this.backgroundColor = value; + this.SetTracker.Track(); + } + } /// /// The border style for the Checkout Session. @@ -22,7 +39,15 @@ public class SessionBrandingSettingsOptions : INestedOptions /// [JsonProperty("border_style")] [STJS.JsonPropertyName("border_style")] - public string BorderStyle { get; set; } + public string BorderStyle + { + get => this.borderStyle; + set + { + this.borderStyle = value; + this.SetTracker.Track(); + } + } /// /// A hex color value starting with # representing the button color for the Checkout @@ -30,7 +55,15 @@ public class SessionBrandingSettingsOptions : INestedOptions /// [JsonProperty("button_color")] [STJS.JsonPropertyName("button_color")] - public string ButtonColor { get; set; } + public string ButtonColor + { + get => this.buttonColor; + set + { + this.buttonColor = value; + this.SetTracker.Track(); + } + } /// /// A string to override the business name shown on the Checkout Session. This only shows at @@ -55,7 +88,15 @@ public class SessionBrandingSettingsOptions : INestedOptions /// [JsonProperty("font_family")] [STJS.JsonPropertyName("font_family")] - public string FontFamily { get; set; } + public string FontFamily + { + get => this.fontFamily; + set + { + this.fontFamily = value; + this.SetTracker.Track(); + } + } /// /// The icon for the Checkout Session. For best results, use a square image. @@ -70,5 +111,10 @@ public class SessionBrandingSettingsOptions : INestedOptions [JsonProperty("logo")] [STJS.JsonPropertyName("logo")] public SessionBrandingSettingsLogoOptions Logo { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionCustomTextOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionCustomTextOptions.cs index 310d26b796..5ef2b44c7e 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionCustomTextOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionCustomTextOptions.cs @@ -6,28 +6,61 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionCustomTextOptions : INestedOptions + public class SessionCustomTextOptions : INestedOptions, IHasSetTracking { + private SessionCustomTextAfterSubmitOptions afterSubmit; + private SessionCustomTextShippingAddressOptions shippingAddress; + private SessionCustomTextSubmitOptions submit; + private SessionCustomTextTermsOfServiceAcceptanceOptions termsOfServiceAcceptance; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Custom text that should be displayed after the payment confirmation button. /// [JsonProperty("after_submit")] [STJS.JsonPropertyName("after_submit")] - public SessionCustomTextAfterSubmitOptions AfterSubmit { get; set; } + public SessionCustomTextAfterSubmitOptions AfterSubmit + { + get => this.afterSubmit; + set + { + this.afterSubmit = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed alongside shipping address collection. /// [JsonProperty("shipping_address")] [STJS.JsonPropertyName("shipping_address")] - public SessionCustomTextShippingAddressOptions ShippingAddress { get; set; } + public SessionCustomTextShippingAddressOptions ShippingAddress + { + get => this.shippingAddress; + set + { + this.shippingAddress = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed alongside the payment confirmation button. /// [JsonProperty("submit")] [STJS.JsonPropertyName("submit")] - public SessionCustomTextSubmitOptions Submit { get; set; } + public SessionCustomTextSubmitOptions Submit + { + get => this.submit; + set + { + this.submit = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed in place of the default terms of service agreement @@ -35,6 +68,19 @@ public class SessionCustomTextOptions : INestedOptions /// [JsonProperty("terms_of_service_acceptance")] [STJS.JsonPropertyName("terms_of_service_acceptance")] - public SessionCustomTextTermsOfServiceAcceptanceOptions TermsOfServiceAcceptance { get; set; } + public SessionCustomTextTermsOfServiceAcceptanceOptions TermsOfServiceAcceptance + { + get => this.termsOfServiceAcceptance; + set + { + this.termsOfServiceAcceptance = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionDiscountCouponDataOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionDiscountCouponDataOptions.cs index 3b7f257590..f1b4e52688 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionDiscountCouponDataOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionDiscountCouponDataOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionDiscountCouponDataOptions : INestedOptions, IHasMetadata + public class SessionDiscountCouponDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A positive integer representing the amount to subtract from an invoice total (required /// if percent_off is not passed). @@ -42,7 +48,15 @@ public class SessionDiscountCouponDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Name of the coupon displayed to customers on, for instance invoices, or receipts. By @@ -59,5 +73,10 @@ public class SessionDiscountCouponDataOptions : INestedOptions, IHasMetadata [JsonProperty("percent_off")] [STJS.JsonPropertyName("percent_off")] public decimal? PercentOff { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataOptions.cs index d3697f8cd9..66838cda49 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataOptions.cs @@ -7,21 +7,45 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMetadata + public class SessionInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List accountTaxIds; + private List customFields; + private SessionInvoiceCreationInvoiceDataRenderingOptionsOptions renderingOptions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with the invoice. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Default custom fields to be displayed on invoices for this customer. /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// An arbitrary string attached to the object. Often useful for displaying to users. @@ -60,6 +84,19 @@ public class SessionInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMeta /// [JsonProperty("rendering_options")] [STJS.JsonPropertyName("rendering_options")] - public SessionInvoiceCreationInvoiceDataRenderingOptionsOptions RenderingOptions { get; set; } + public SessionInvoiceCreationInvoiceDataRenderingOptionsOptions RenderingOptions + { + get => this.renderingOptions; + set + { + this.renderingOptions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataRenderingOptionsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataRenderingOptionsOptions.cs index 7b6d983163..05ac1a44cc 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataRenderingOptionsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionInvoiceCreationInvoiceDataRenderingOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedOptions + public class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedOptions, IHasSetTracking { + private string amountTaxDisplay; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. /// One of exclude_tax or include_inclusive_tax. include_inclusive_tax @@ -18,7 +24,15 @@ public class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedO /// [JsonProperty("amount_tax_display")] [STJS.JsonPropertyName("amount_tax_display")] - public string AmountTaxDisplay { get; set; } + public string AmountTaxDisplay + { + get => this.amountTaxDisplay; + set + { + this.amountTaxDisplay = value; + this.SetTracker.Track(); + } + } /// /// ID of the invoice rendering template to use for this invoice. @@ -26,5 +40,10 @@ public class SessionInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedO [JsonProperty("template")] [STJS.JsonPropertyName("template")] public string Template { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemOptions.cs index 49b2312e2c..2d023b900a 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemOptions.cs @@ -7,8 +7,15 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionLineItemOptions : INestedOptions, IHasMetadata, IHasId + public class SessionLineItemOptions : INestedOptions, IHasMetadata, IHasId, IHasSetTracking { + private Dictionary metadata; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// When set, provides configuration for this item’s quantity to be adjusted by the customer /// during Checkout. @@ -42,7 +49,15 @@ public class SessionLineItemOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The ID of the Price or [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemPriceDataProductDataTaxDetailsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemPriceDataProductDataTaxDetailsOptions.cs index 05bb101214..173d9968cc 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemPriceDataProductDataTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionLineItemPriceDataProductDataTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions + public class SessionLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class SessionLineItemPriceDataProductDataTaxDetailsOptions : INestedOptio /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs index b0203f74a8..71baddb019 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions + public class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string customMandateUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A URL for custom mandate text to render during confirmation step. The URL will be /// rendered with additional GET parameters payment_intent and @@ -18,7 +24,15 @@ public class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions : INested /// [JsonProperty("custom_mandate_url")] [STJS.JsonPropertyName("custom_mandate_url")] - public string CustomMandateUrl { get; set; } + public string CustomMandateUrl + { + get => this.customMandateUrl; + set + { + this.customMandateUrl = value; + this.SetTracker.Track(); + } + } /// /// List of Stripe products where this mandate can be selected automatically. Only usable in @@ -52,5 +66,10 @@ public class SessionPaymentMethodOptionsAcssDebitMandateOptionsOptions : INested [JsonProperty("transaction_type")] [STJS.JsonPropertyName("transaction_type")] public string TransactionType { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs index f22a3b4a17..d29fe16b91 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions + public class SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class SessionPaymentMethodOptionsBacsDebitMandateOptionsOptions : INested /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsKlarnaOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsKlarnaOptions.cs index 2fc172a93c..f498581efa 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsKlarnaOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsKlarnaOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsKlarnaOptions : INestedOptions + public class SessionPaymentMethodOptionsKlarnaOptions : INestedOptions, IHasSetTracking { + private List subscriptions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds will be captured from the customer's account. /// @@ -45,6 +51,19 @@ public class SessionPaymentMethodOptionsKlarnaOptions : INestedOptions /// [JsonProperty("subscriptions")] [STJS.JsonPropertyName("subscriptions")] - public List Subscriptions { get; set; } + public List Subscriptions + { + get => this.subscriptions; + set + { + this.subscriptions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaypalOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaypalOptions.cs index 0d57899945..d48c09df8b 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaypalOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaypalOptions.cs @@ -7,14 +7,29 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsPaypalOptions : INestedOptions + public class SessionPaymentMethodOptionsPaypalOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds will be captured from the customer's account. /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Preferred locale @@ -80,7 +95,15 @@ public class SessionPaymentMethodOptionsPaypalOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// The Stripe connected account IDs of the sellers on the platform for this transaction @@ -91,5 +114,10 @@ public class SessionPaymentMethodOptionsPaypalOptions : INestedOptions [JsonProperty("subsellers")] [STJS.JsonPropertyName("subsellers")] public List Subsellers { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaytoMandateOptionsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaytoMandateOptionsOptions.cs index 92d2ec5970..176bfbbc38 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaytoMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPaytoMandateOptionsOptions.cs @@ -6,14 +6,34 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions + public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions, IHasSetTracking { + private long? amount; + private string amountType; + private string endDate; + private string paymentSchedule; + private long? paymentsPerPeriod; + private string purpose; + private string startDate; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Amount that will be collected. It is required when amount_type is fixed. /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// The type of amount that will be collected. The amount charged must be exact or up to the @@ -23,7 +43,15 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("amount_type")] [STJS.JsonPropertyName("amount_type")] - public string AmountType { get; set; } + public string AmountType + { + get => this.amountType; + set + { + this.amountType = value; + this.SetTracker.Track(); + } + } /// /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no @@ -31,7 +59,15 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("end_date")] [STJS.JsonPropertyName("end_date")] - public string EndDate { get; set; } + public string EndDate + { + get => this.endDate; + set + { + this.endDate = value; + this.SetTracker.Track(); + } + } /// /// The periodicity at which payments will be collected. Defaults to adhoc. @@ -40,7 +76,15 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("payment_schedule")] [STJS.JsonPropertyName("payment_schedule")] - public string PaymentSchedule { get; set; } + public string PaymentSchedule + { + get => this.paymentSchedule; + set + { + this.paymentSchedule = value; + this.SetTracker.Track(); + } + } /// /// The number of payments that will be made during a payment period. Defaults to 1 except @@ -48,7 +92,15 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("payments_per_period")] [STJS.JsonPropertyName("payments_per_period")] - public long? PaymentsPerPeriod { get; set; } + public long? PaymentsPerPeriod + { + get => this.paymentsPerPeriod; + set + { + this.paymentsPerPeriod = value; + this.SetTracker.Track(); + } + } /// /// The purpose for which payments are made. Has a default value based on your merchant @@ -59,7 +111,15 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("purpose")] [STJS.JsonPropertyName("purpose")] - public string Purpose { get; set; } + public string Purpose + { + get => this.purpose; + set + { + this.purpose = value; + this.SetTracker.Track(); + } + } /// /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to @@ -67,6 +127,19 @@ public class SessionPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOpti /// [JsonProperty("start_date")] [STJS.JsonPropertyName("start_date")] - public string StartDate { get; set; } + public string StartDate + { + get => this.startDate; + set + { + this.startDate = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs index 36f8897b88..3623772143 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions + public class SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class SessionPaymentMethodOptionsSepaDebitMandateOptionsOptions : INested /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsUpiOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsUpiOptions.cs index 2ab641aaf2..177c73eb23 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsUpiOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsUpiOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionPaymentMethodOptionsUpiOptions : INestedOptions + public class SessionPaymentMethodOptionsUpiOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -20,6 +26,19 @@ public class SessionPaymentMethodOptionsUpiOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionSubscriptionDataOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionSubscriptionDataOptions.cs index 6080cc8694..2b1513a67f 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionSubscriptionDataOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionSubscriptionDataOptions.cs @@ -8,8 +8,15 @@ namespace Stripe.Checkout using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata + public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private SessionSubscriptionDataPendingInvoiceItemIntervalOptions pendingInvoiceItemInterval; + private long? trialPeriodDays; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A non-negative decimal between 0 and 100, with at most two decimal places. This /// represents the percentage of the subscription invoice total that will be transferred to @@ -88,7 +95,15 @@ public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("pending_invoice_item_interval")] [STJS.JsonPropertyName("pending_invoice_item_interval")] - public SessionSubscriptionDataPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } + public SessionSubscriptionDataPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval + { + get => this.pendingInvoiceItemInterval; + set + { + this.pendingInvoiceItemInterval = value; + this.SetTracker.Track(); + } + } /// /// Determines how to handle prorations resulting from the billing_cycle_anchor. If @@ -124,7 +139,15 @@ public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("trial_period_days")] [STJS.JsonPropertyName("trial_period_days")] - public long? TrialPeriodDays { get; set; } + public long? TrialPeriodDays + { + get => this.trialPeriodDays; + set + { + this.trialPeriodDays = value; + this.SetTracker.Track(); + } + } /// /// Settings related to subscription trials. @@ -132,5 +155,10 @@ public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata [JsonProperty("trial_settings")] [STJS.JsonPropertyName("trial_settings")] public SessionSubscriptionDataTrialSettingsOptions TrialSettings { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionUpdateOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionUpdateOptions.cs index 99dcf13133..ba0ca5a0d7 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionUpdateOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionUpdateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe.Checkout [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SessionUpdateOptions : BaseOptions, IHasMetadata { + private List discounts; + private Dictionary metadata; + private List shippingOptions; + /// /// Settings for automatic tax lookup for this session and resulting payments, invoices, and /// subscriptions. @@ -30,7 +34,15 @@ public class SessionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Generate a post-purchase Invoice for one-time payments. @@ -68,14 +80,30 @@ public class SessionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The shipping rate options to apply to this Session. Up to a maximum of 5. /// [JsonProperty("shipping_options")] [STJS.JsonPropertyName("shipping_options")] - public List ShippingOptions { get; set; } + public List ShippingOptions + { + get => this.shippingOptions; + set + { + this.shippingOptions = value; + this.SetTracker.Track(); + } + } /// /// A subset of parameters to be passed to subscription creation for Checkout Sessions in diff --git a/src/Stripe.net/Services/Climate/Orders/OrderBeneficiaryOptions.cs b/src/Stripe.net/Services/Climate/Orders/OrderBeneficiaryOptions.cs index ffe94aa578..2094f96bed 100644 --- a/src/Stripe.net/Services/Climate/Orders/OrderBeneficiaryOptions.cs +++ b/src/Stripe.net/Services/Climate/Orders/OrderBeneficiaryOptions.cs @@ -6,13 +6,32 @@ namespace Stripe.Climate using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderBeneficiaryOptions : INestedOptions + public class OrderBeneficiaryOptions : INestedOptions, IHasSetTracking { + private string publicName; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Publicly displayable name for the end beneficiary of carbon removal. /// [JsonProperty("public_name")] [STJS.JsonPropertyName("public_name")] - public string PublicName { get; set; } + public string PublicName + { + get => this.publicName; + set + { + this.publicName = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Climate/Orders/OrderUpdateOptions.cs b/src/Stripe.net/Services/Climate/Orders/OrderUpdateOptions.cs index 9300efbca9..53a20aed87 100644 --- a/src/Stripe.net/Services/Climate/Orders/OrderUpdateOptions.cs +++ b/src/Stripe.net/Services/Climate/Orders/OrderUpdateOptions.cs @@ -9,13 +9,23 @@ namespace Stripe.Climate [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class OrderUpdateOptions : BaseOptions, IHasMetadata { + private OrderBeneficiaryOptions beneficiary; + /// /// Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the /// Stripe account if not set. /// [JsonProperty("beneficiary")] [STJS.JsonPropertyName("beneficiary")] - public OrderBeneficiaryOptions Beneficiary { get; set; } + public OrderBeneficiaryOptions Beneficiary + { + get => this.beneficiary; + set + { + this.beneficiary = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can diff --git a/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs b/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs index 17b8234230..416eaeb7a6 100644 --- a/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs +++ b/src/Stripe.net/Services/Coupons/CouponCreateOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CouponCreateOptions : BaseOptions, IHasId, IHasMetadata { + private Dictionary metadata; + /// /// A positive integer representing the amount to subtract from an invoice total (required /// if percent_off is not passed). @@ -86,7 +88,15 @@ public class CouponCreateOptions : BaseOptions, IHasId, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Name of the coupon displayed to customers on, for instance invoices, or receipts. By diff --git a/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs b/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs index 133fac944e..b5244b76a6 100644 --- a/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs +++ b/src/Stripe.net/Services/Coupons/CouponUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CouponUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Coupons defined in each available currency option (only supported if the coupon is /// amount-based). Each key must be a three-letter [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Name of the coupon displayed to customers on, for instance invoices, or receipts. By diff --git a/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesLineOptions.cs b/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesLineOptions.cs index 8a62443362..70ed5266d4 100644 --- a/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesLineOptions.cs +++ b/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesLineOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CreditNotePreviewLinesLineOptions : INestedOptions, IHasMetadata + public class CreditNotePreviewLinesLineOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List taxAmounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The line item amount to credit. Only valid when type is invoice_line_item. /// If invoice is set up with automatic_tax[enabled]=true, this amount is tax @@ -58,7 +65,15 @@ public class CreditNotePreviewLinesLineOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_amounts")] [STJS.JsonPropertyName("tax_amounts")] - public List TaxAmounts { get; set; } + public List TaxAmounts + { + get => this.taxAmounts; + set + { + this.taxAmounts = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the credit note line item. Only valid when the type @@ -66,7 +81,15 @@ public class CreditNotePreviewLinesLineOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Type of the credit note line item, one of invoice_line_item or @@ -97,5 +120,10 @@ public class CreditNotePreviewLinesLineOptions : INestedOptions, IHasMetadata [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] [STJS.JsonPropertyName("unit_amount_decimal")] public decimal? UnitAmountDecimal { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/CreditNotes/CreditNoteLineOptions.cs b/src/Stripe.net/Services/CreditNotes/CreditNoteLineOptions.cs index a084eafb18..95f48f7fb5 100644 --- a/src/Stripe.net/Services/CreditNotes/CreditNoteLineOptions.cs +++ b/src/Stripe.net/Services/CreditNotes/CreditNoteLineOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CreditNoteLineOptions : INestedOptions, IHasMetadata + public class CreditNoteLineOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List taxAmounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The line item amount to credit. Only valid when type is invoice_line_item. /// If invoice is set up with automatic_tax[enabled]=true, this amount is tax @@ -58,7 +65,15 @@ public class CreditNoteLineOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_amounts")] [STJS.JsonPropertyName("tax_amounts")] - public List TaxAmounts { get; set; } + public List TaxAmounts + { + get => this.taxAmounts; + set + { + this.taxAmounts = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the credit note line item. Only valid when the type @@ -66,7 +81,15 @@ public class CreditNoteLineOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Type of the credit note line item, one of invoice_line_item or @@ -97,5 +120,10 @@ public class CreditNoteLineOptions : INestedOptions, IHasMetadata [STJS.JsonNumberHandling(STJS.JsonNumberHandling.AllowReadingFromString | STJS.JsonNumberHandling.WriteAsString)] [STJS.JsonPropertyName("unit_amount_decimal")] public decimal? UnitAmountDecimal { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionCreateOptions.cs b/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionCreateOptions.cs index ebd90f7e30..0b0c96359b 100644 --- a/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionCreateOptions.cs +++ b/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CustomerBalanceTransactionCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The integer amount in cents (or local equivalent) to apply to the /// customer's credit balance. @@ -44,6 +46,14 @@ public class CustomerBalanceTransactionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionUpdateOptions.cs b/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionUpdateOptions.cs index b2d4ac560c..c09691ee6a 100644 --- a/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionUpdateOptions.cs +++ b/src/Stripe.net/Services/CustomerBalanceTransactions/CustomerBalanceTransactionUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CustomerBalanceTransactionUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An arbitrary string attached to the object. Often useful for displaying to users. /// @@ -24,6 +26,14 @@ public class CustomerBalanceTransactionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/CustomerPaymentSources/CustomerPaymentSourceUpdateOptions.cs b/src/Stripe.net/Services/CustomerPaymentSources/CustomerPaymentSourceUpdateOptions.cs index d2992f4815..a0b2e783ac 100644 --- a/src/Stripe.net/Services/CustomerPaymentSources/CustomerPaymentSourceUpdateOptions.cs +++ b/src/Stripe.net/Services/CustomerPaymentSources/CustomerPaymentSourceUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CustomerPaymentSourceUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The name of the person or business that owns the bank account. /// @@ -89,7 +91,15 @@ public class CustomerPaymentSourceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Cardholder name. diff --git a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs index 151165156f..2f5b202271 100644 --- a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs @@ -9,6 +9,13 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CustomerCreateOptions : BaseOptions, IHasMetadata { + private AddressOptions address; + private string businessName; + private string individualName; + private Dictionary metadata; + private ShippingOptions shipping; + private string taxExempt; + /// /// The customer's address. Learn about country-specific @@ -16,7 +23,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// An integer amount in cents (or local equivalent) that represents the customer's current @@ -33,7 +48,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("business_name")] [STJS.JsonPropertyName("business_name")] - public string BusinessName { get; set; } + public string BusinessName + { + get => this.businessName; + set + { + this.businessName = value; + this.SetTracker.Track(); + } + } /// /// Balance information and default balance settings for this customer. @@ -63,7 +86,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("individual_name")] [STJS.JsonPropertyName("individual_name")] - public string IndividualName { get; set; } + public string IndividualName + { + get => this.individualName; + set + { + this.individualName = value; + this.SetTracker.Track(); + } + } /// /// The prefix for the customer used to generate unique invoice numbers. Must be 3–12 @@ -88,7 +119,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The customer's full name or business name. @@ -131,7 +170,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public ShippingOptions Shipping { get; set; } + public ShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } [JsonProperty("source")] [JsonConverter(typeof(AnyOfConverter))] @@ -152,7 +199,15 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_exempt")] [STJS.JsonPropertyName("tax_exempt")] - public string TaxExempt { get; set; } + public string TaxExempt + { + get => this.taxExempt; + set + { + this.taxExempt = value; + this.SetTracker.Track(); + } + } /// /// The customer's tax IDs. diff --git a/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsOptions.cs b/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsOptions.cs index d181f494bf..603879c399 100644 --- a/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsOptions.cs @@ -7,15 +7,30 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CustomerInvoiceSettingsOptions : INestedOptions + public class CustomerInvoiceSettingsOptions : INestedOptions, IHasSetTracking { + private List customFields; + private CustomerInvoiceSettingsRenderingOptionsOptions renderingOptions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The list of up to 4 default custom fields to be displayed on invoices for this customer. /// When updating, pass an empty string to remove previously-defined fields. /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// ID of a payment method that's attached to the customer, to be used as the customer's @@ -37,6 +52,19 @@ public class CustomerInvoiceSettingsOptions : INestedOptions /// [JsonProperty("rendering_options")] [STJS.JsonPropertyName("rendering_options")] - public CustomerInvoiceSettingsRenderingOptionsOptions RenderingOptions { get; set; } + public CustomerInvoiceSettingsRenderingOptionsOptions RenderingOptions + { + get => this.renderingOptions; + set + { + this.renderingOptions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsRenderingOptionsOptions.cs b/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsRenderingOptionsOptions.cs index be8ca293b2..09977b8cd9 100644 --- a/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsRenderingOptionsOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerInvoiceSettingsRenderingOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CustomerInvoiceSettingsRenderingOptionsOptions : INestedOptions + public class CustomerInvoiceSettingsRenderingOptionsOptions : INestedOptions, IHasSetTracking { + private string amountTaxDisplay; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. /// One of exclude_tax or include_inclusive_tax. include_inclusive_tax @@ -18,7 +24,15 @@ public class CustomerInvoiceSettingsRenderingOptionsOptions : INestedOptions /// [JsonProperty("amount_tax_display")] [STJS.JsonPropertyName("amount_tax_display")] - public string AmountTaxDisplay { get; set; } + public string AmountTaxDisplay + { + get => this.amountTaxDisplay; + set + { + this.amountTaxDisplay = value; + this.SetTracker.Track(); + } + } /// /// ID of the invoice rendering template to use for future invoices. @@ -26,5 +40,10 @@ public class CustomerInvoiceSettingsRenderingOptionsOptions : INestedOptions [JsonProperty("template")] [STJS.JsonPropertyName("template")] public string Template { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Customers/CustomerTaxOptions.cs b/src/Stripe.net/Services/Customers/CustomerTaxOptions.cs index 538cdca3f3..f5f410a5d5 100644 --- a/src/Stripe.net/Services/Customers/CustomerTaxOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerTaxOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CustomerTaxOptions : INestedOptions + public class CustomerTaxOptions : INestedOptions, IHasSetTracking { + private string ipAddress; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A recent IP address of the customer used for tax reporting and tax location inference. /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the @@ -16,7 +22,15 @@ public class CustomerTaxOptions : INestedOptions /// [JsonProperty("ip_address")] [STJS.JsonPropertyName("ip_address")] - public string IpAddress { get; set; } + public string IpAddress + { + get => this.ipAddress; + set + { + this.ipAddress = value; + this.SetTracker.Track(); + } + } /// /// A flag that indicates when Stripe should validate the customer tax location. Defaults to @@ -26,5 +40,10 @@ public class CustomerTaxOptions : INestedOptions [JsonProperty("validate_location")] [STJS.JsonPropertyName("validate_location")] public string ValidateLocation { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs index b53f436131..7116969829 100644 --- a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs @@ -9,6 +9,13 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CustomerUpdateOptions : BaseOptions, IHasMetadata { + private AddressOptions address; + private string businessName; + private string individualName; + private Dictionary metadata; + private ShippingOptions shipping; + private string taxExempt; + /// /// The customer's address. Learn about country-specific @@ -16,7 +23,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// An integer amount in cents (or local equivalent) that represents the customer's current @@ -33,7 +48,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("business_name")] [STJS.JsonPropertyName("business_name")] - public string BusinessName { get; set; } + public string BusinessName + { + get => this.businessName; + set + { + this.businessName = value; + this.SetTracker.Track(); + } + } /// /// Balance information and default balance settings for this customer. @@ -79,7 +102,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("individual_name")] [STJS.JsonPropertyName("individual_name")] - public string IndividualName { get; set; } + public string IndividualName + { + get => this.individualName; + set + { + this.individualName = value; + this.SetTracker.Track(); + } + } /// /// The prefix for the customer used to generate unique invoice numbers. Must be 3–12 @@ -104,7 +135,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The customer's full name or business name. @@ -139,7 +178,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public ShippingOptions Shipping { get; set; } + public ShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } [JsonProperty("source")] [JsonConverter(typeof(AnyOfConverter))] @@ -160,7 +207,15 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_exempt")] [STJS.JsonPropertyName("tax_exempt")] - public string TaxExempt { get; set; } + public string TaxExempt + { + get => this.taxExempt; + set + { + this.taxExempt = value; + this.SetTracker.Track(); + } + } [JsonProperty("validate")] [STJS.JsonPropertyName("validate")] diff --git a/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions.cs b/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions.cs index ee940566bb..332182faeb 100644 --- a/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions.cs +++ b/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions.cs @@ -6,14 +6,33 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions : INestedOptions + public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionOptions : INestedOptions, IHasSetTracking { + private string customerAccountId; + private string customerDeviceFingerprint; + private string customerDeviceId; + private string customerEmailAddress; + private string customerPurchaseIp; + private string productDescription; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// User Account ID used to log into business platform. Must be recognizable by the user. /// [JsonProperty("customer_account_id")] [STJS.JsonPropertyName("customer_account_id")] - public string CustomerAccountId { get; set; } + public string CustomerAccountId + { + get => this.customerAccountId; + set + { + this.customerAccountId = value; + this.SetTracker.Track(); + } + } /// /// Unique identifier of the cardholder’s device derived from a combination of at least two @@ -21,7 +40,15 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTrans /// [JsonProperty("customer_device_fingerprint")] [STJS.JsonPropertyName("customer_device_fingerprint")] - public string CustomerDeviceFingerprint { get; set; } + public string CustomerDeviceFingerprint + { + get => this.customerDeviceFingerprint; + set + { + this.customerDeviceFingerprint = value; + this.SetTracker.Track(); + } + } /// /// Unique identifier of the cardholder’s device such as a device serial number (e.g., @@ -29,21 +56,45 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTrans /// [JsonProperty("customer_device_id")] [STJS.JsonPropertyName("customer_device_id")] - public string CustomerDeviceId { get; set; } + public string CustomerDeviceId + { + get => this.customerDeviceId; + set + { + this.customerDeviceId = value; + this.SetTracker.Track(); + } + } /// /// The email address of the customer. /// [JsonProperty("customer_email_address")] [STJS.JsonPropertyName("customer_email_address")] - public string CustomerEmailAddress { get; set; } + public string CustomerEmailAddress + { + get => this.customerEmailAddress; + set + { + this.customerEmailAddress = value; + this.SetTracker.Track(); + } + } /// /// The IP address that the customer used when making the purchase. /// [JsonProperty("customer_purchase_ip")] [STJS.JsonPropertyName("customer_purchase_ip")] - public string CustomerPurchaseIp { get; set; } + public string CustomerPurchaseIp + { + get => this.customerPurchaseIp; + set + { + this.customerPurchaseIp = value; + this.SetTracker.Track(); + } + } /// /// Categorization of disputed payment. @@ -58,7 +109,15 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTrans /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// The address to which a physical product was shipped. All fields are required for Visa @@ -67,5 +126,10 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTrans [JsonProperty("shipping_address")] [STJS.JsonPropertyName("shipping_address")] public AddressOptions ShippingAddress { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions.cs b/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions.cs index bccca8898a..c283e43f11 100644 --- a/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions.cs +++ b/src/Stripe.net/Services/Disputes/DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions.cs @@ -6,8 +6,19 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions : INestedOptions + public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisputedTransactionOptions : INestedOptions, IHasSetTracking { + private string customerAccountId; + private string customerDeviceFingerprint; + private string customerDeviceId; + private string customerEmailAddress; + private string customerPurchaseIp; + private string productDescription; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. /// @@ -20,7 +31,15 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisput /// [JsonProperty("customer_account_id")] [STJS.JsonPropertyName("customer_account_id")] - public string CustomerAccountId { get; set; } + public string CustomerAccountId + { + get => this.customerAccountId; + set + { + this.customerAccountId = value; + this.SetTracker.Track(); + } + } /// /// Unique identifier of the cardholder’s device derived from a combination of at least two @@ -28,7 +47,15 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisput /// [JsonProperty("customer_device_fingerprint")] [STJS.JsonPropertyName("customer_device_fingerprint")] - public string CustomerDeviceFingerprint { get; set; } + public string CustomerDeviceFingerprint + { + get => this.customerDeviceFingerprint; + set + { + this.customerDeviceFingerprint = value; + this.SetTracker.Track(); + } + } /// /// Unique identifier of the cardholder’s device such as a device serial number (e.g., @@ -36,28 +63,60 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisput /// [JsonProperty("customer_device_id")] [STJS.JsonPropertyName("customer_device_id")] - public string CustomerDeviceId { get; set; } + public string CustomerDeviceId + { + get => this.customerDeviceId; + set + { + this.customerDeviceId = value; + this.SetTracker.Track(); + } + } /// /// The email address of the customer. /// [JsonProperty("customer_email_address")] [STJS.JsonPropertyName("customer_email_address")] - public string CustomerEmailAddress { get; set; } + public string CustomerEmailAddress + { + get => this.customerEmailAddress; + set + { + this.customerEmailAddress = value; + this.SetTracker.Track(); + } + } /// /// The IP address that the customer used when making the purchase. /// [JsonProperty("customer_purchase_ip")] [STJS.JsonPropertyName("customer_purchase_ip")] - public string CustomerPurchaseIp { get; set; } + public string CustomerPurchaseIp + { + get => this.customerPurchaseIp; + set + { + this.customerPurchaseIp = value; + this.SetTracker.Track(); + } + } /// /// A description of the product or service that was sold. /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// The address to which a physical product was shipped. All fields are required for Visa @@ -66,5 +125,10 @@ public class DisputeEvidenceEnhancedEvidenceVisaCompellingEvidence3PriorUndisput [JsonProperty("shipping_address")] [STJS.JsonPropertyName("shipping_address")] public AddressOptions ShippingAddress { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Disputes/DisputeEvidenceOptions.cs b/src/Stripe.net/Services/Disputes/DisputeEvidenceOptions.cs index 75592e9248..92a25a2514 100644 --- a/src/Stripe.net/Services/Disputes/DisputeEvidenceOptions.cs +++ b/src/Stripe.net/Services/Disputes/DisputeEvidenceOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceOptions : INestedOptions + public class DisputeEvidenceOptions : INestedOptions, IHasSetTracking { + private DisputeEvidenceEnhancedEvidenceOptions enhancedEvidence; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Any server or activity logs showing proof that the customer accessed or downloaded the /// purchased digital product. This information should include IP addresses, corresponding @@ -118,7 +124,15 @@ public class DisputeEvidenceOptions : INestedOptions /// [JsonProperty("enhanced_evidence")] [STJS.JsonPropertyName("enhanced_evidence")] - public DisputeEvidenceEnhancedEvidenceOptions EnhancedEvidence { get; set; } + public DisputeEvidenceEnhancedEvidenceOptions EnhancedEvidence + { + get => this.enhancedEvidence; + set + { + this.enhancedEvidence = value; + this.SetTracker.Track(); + } + } /// /// A description of the product or service that was sold. Has a maximum character count of @@ -234,5 +248,10 @@ public class DisputeEvidenceOptions : INestedOptions [JsonProperty("uncategorized_text")] [STJS.JsonPropertyName("uncategorized_text")] public string UncategorizedText { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs b/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs index 3be677c05d..b80b5e46cf 100644 --- a/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs +++ b/src/Stripe.net/Services/Disputes/DisputeUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class DisputeUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Evidence to upload, to respond to a dispute. Updating any field in the hash will submit /// all fields in the hash for review. The combined character count of all fields is limited @@ -35,7 +37,15 @@ public class DisputeUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Whether to immediately submit evidence to the bank. If false, evidence is staged diff --git a/src/Stripe.net/Services/Entitlements/Features/FeatureUpdateOptions.cs b/src/Stripe.net/Services/Entitlements/Features/FeatureUpdateOptions.cs index 496d17f960..6eedd0358c 100644 --- a/src/Stripe.net/Services/Entitlements/Features/FeatureUpdateOptions.cs +++ b/src/Stripe.net/Services/Entitlements/Features/FeatureUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Entitlements [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FeatureUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Inactive features cannot be attached to new products and will not be returned from the /// features list endpoint. @@ -23,7 +25,15 @@ public class FeatureUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The feature's name, for your own purpose, not meant to be displayable to the customer. diff --git a/src/Stripe.net/Services/Events/EventUtility.cs b/src/Stripe.net/Services/Events/EventUtility.cs index 27e807227a..76bf855015 100644 --- a/src/Stripe.net/Services/Events/EventUtility.cs +++ b/src/Stripe.net/Services/Events/EventUtility.cs @@ -65,6 +65,17 @@ public static bool IsCompatibleApiVersion(string eventApiVersion) /// public static Event ParseEvent(string json, bool throwOnApiVersionMismatch = true) { + using (var doc = System.Text.Json.JsonDocument.Parse(json)) + { + if (doc.RootElement.TryGetProperty("object", out var objectProp) && + objectProp.GetString() == "v2.core.event") + { + throw new ArgumentException( + "You passed a thin event notification to ConstructEvent, which expects " + + "a webhook payload. Use StripeClient.ParseEventNotification instead."); + } + } + var stripeEvent = System.Text.Json.JsonSerializer.Deserialize( json, StripeConfiguration.SerializerOptions); diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs index 64ca88eae4..993da37133 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ExternalAccountUpdateOptions : BaseOptions, IHasMetadata { + private string accountHolderType; + private Dictionary metadata; + /// /// The name of the person or business that owns the bank account. /// @@ -23,7 +26,15 @@ public class ExternalAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("account_holder_type")] [STJS.JsonPropertyName("account_holder_type")] - public string AccountHolderType { get; set; } + public string AccountHolderType + { + get => this.accountHolderType; + set + { + this.accountHolderType = value; + this.SetTracker.Track(); + } + } /// /// The bank account type. This can only be checking or savings in most @@ -112,7 +123,15 @@ public class ExternalAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Cardholder name. diff --git a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs index f58316d2c1..900eb99ec1 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FileLinkCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The link isn't usable after this future timestamp. /// @@ -40,6 +42,14 @@ public class FileLinkCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs index bd850e2833..4fd33e69bf 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FileLinkUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A future timestamp after which the link will no longer be usable, or now to /// expire the link immediately. @@ -28,6 +30,14 @@ public class FileLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs b/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs index 95052860e2..7cccf08d83 100644 --- a/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs +++ b/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs @@ -8,8 +8,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class FileFileLinkDataOptions : INestedOptions, IHasMetadata + public class FileFileLinkDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Set this to true to create a file link for the newly created file. Creating a /// link is only possible when the file's purpose is one of the following: @@ -39,6 +45,19 @@ public class FileFileLinkDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Identity/VerificationSessions/VerificationSessionOptionsOptions.cs b/src/Stripe.net/Services/Identity/VerificationSessions/VerificationSessionOptionsOptions.cs index d5107ed10b..571e4ae127 100644 --- a/src/Stripe.net/Services/Identity/VerificationSessions/VerificationSessionOptionsOptions.cs +++ b/src/Stripe.net/Services/Identity/VerificationSessions/VerificationSessionOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.Identity using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class VerificationSessionOptionsOptions : INestedOptions + public class VerificationSessionOptionsOptions : INestedOptions, IHasSetTracking { + private VerificationSessionOptionsDocumentOptions document; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Options that apply to the document @@ -15,6 +21,19 @@ public class VerificationSessionOptionsOptions : INestedOptions /// [JsonProperty("document")] [STJS.JsonPropertyName("document")] - public VerificationSessionOptionsDocumentOptions Document { get; set; } + public VerificationSessionOptionsDocumentOptions Document + { + get => this.document; + set + { + this.document = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs index d81e7bbbf8..5b6ea28057 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata { + private List discounts; + private Dictionary metadata; + private string taxCode; + /// /// The integer amount in cents (or local equivalent) of the charge to be applied to the /// upcoming invoice. Passing in a negative amount will reduce the amount_due @@ -63,7 +67,15 @@ public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The ID of an existing invoice to add this invoice item to. For subscription invoices, @@ -93,7 +105,15 @@ public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The period associated with this invoice item. When set to different values, the period @@ -170,7 +190,15 @@ public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the invoice item. When set, the default_tax_rates on diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs index 5e23e767ad..33e5a3872f 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs @@ -9,6 +9,12 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata { + private List discounts; + private List margins; + private Dictionary metadata; + private string taxCode; + private List taxRates; + /// /// The integer amount in cents (or local equivalent) of the charge to be applied to the /// upcoming invoice. If you want to apply a credit to the customer's account, pass a @@ -42,7 +48,15 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The ids of the margins to apply to the invoice item. When set, the @@ -50,7 +64,15 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("margins")] [STJS.JsonPropertyName("margins")] - public List Margins { get; set; } + public List Margins + { + get => this.margins; + set + { + this.margins = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -60,7 +82,15 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The period associated with this invoice item. When set to different values, the period @@ -126,7 +156,15 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the invoice item. When set, the default_tax_rates on @@ -135,7 +173,15 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// The decimal unit amount in cents (or local equivalent) of the charge to be applied to diff --git a/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemPriceDataProductDataTaxDetailsOptions.cs b/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemPriceDataProductDataTaxDetailsOptions.cs index c38040604e..f1da284afc 100644 --- a/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemPriceDataProductDataTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemPriceDataProductDataTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions + public class InvoiceLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class InvoiceLineItemPriceDataProductDataTaxDetailsOptions : INestedOptio /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemUpdateOptions.cs b/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemUpdateOptions.cs index 46ebfaaac4..c5f1709d6c 100644 --- a/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemUpdateOptions.cs +++ b/src/Stripe.net/Services/InvoiceLineItems/InvoiceLineItemUpdateOptions.cs @@ -9,6 +9,12 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata { + private List discounts; + private List margins; + private Dictionary metadata; + private List taxAmounts; + private List taxRates; + /// /// The integer amount in cents (or local equivalent) of the charge to be applied to the /// upcoming invoice. If you want to apply a credit to the customer's account, pass a @@ -42,7 +48,15 @@ public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The IDs of the margins to apply to the line item. When set, the default_margins @@ -50,7 +64,15 @@ public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("margins")] [STJS.JsonPropertyName("margins")] - public List Margins { get; set; } + public List Margins + { + get => this.margins; + set + { + this.margins = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -65,7 +87,15 @@ public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The period associated with this invoice item. When set to different values, the period @@ -125,7 +155,15 @@ public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_amounts")] [STJS.JsonPropertyName("tax_amounts")] - public List TaxAmounts { get; set; } + public List TaxAmounts + { + get => this.taxAmounts; + set + { + this.taxAmounts = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the line item. When set, the default_tax_rates on @@ -134,6 +172,14 @@ public class InvoiceLineItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceAddLinesOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceAddLinesOptions.cs index 476c16649c..cdc5818d59 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceAddLinesOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceAddLinesOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceAddLinesOptions : BaseOptions { + private Dictionary invoiceMetadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,7 +19,15 @@ public class InvoiceAddLinesOptions : BaseOptions /// [JsonProperty("invoice_metadata")] [STJS.JsonPropertyName("invoice_metadata")] - public Dictionary InvoiceMetadata { get; set; } + public Dictionary InvoiceMetadata + { + get => this.invoiceMetadata; + set + { + this.invoiceMetadata = value; + this.SetTracker.Track(); + } + } /// /// The line items to add. diff --git a/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs index 20d671d2c9..d4434e24de 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCreateOptions.cs @@ -10,13 +10,27 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceCreateOptions : BaseOptions, IHasMetadata { + private List accountTaxIds; + private List amountsDue; + private List customFields; + private List discounts; + private Dictionary metadata; + /// /// The account tax IDs associated with the invoice. Only editable when the invoice is a /// draft. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// List of expected payments and corresponding due dates. Valid only for invoices where @@ -24,7 +38,15 @@ public class InvoiceCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("amounts_due")] [STJS.JsonPropertyName("amounts_due")] - public List AmountsDue { get; set; } + public List AmountsDue + { + get => this.amountsDue; + set + { + this.amountsDue = value; + this.SetTracker.Track(); + } + } /// /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred @@ -88,7 +110,15 @@ public class InvoiceCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// The ID of the customer to bill. @@ -160,7 +190,15 @@ public class InvoiceCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The date on which payment for this invoice is due. Valid only for invoices where @@ -215,7 +253,15 @@ public class InvoiceCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Set the number for this invoice. If no number is present then a number will be assigned diff --git a/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs index 0dbe62d7bf..b47a3ab9e1 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCreatePreviewOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceCreatePreviewOptions : BaseOptions { + private List discounts; + private string onBehalfOf; + /// /// Settings for automatic tax lookup for this invoice preview. /// @@ -60,7 +63,15 @@ public class InvoiceCreatePreviewOptions : BaseOptions /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// List of invoice items to add or update in the upcoming invoice preview (up to 250). @@ -85,7 +96,15 @@ public class InvoiceCreatePreviewOptions : BaseOptions /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// Customizes the types of values to include when calculating the invoice. Defaults to diff --git a/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsOptions.cs index b36a0b0259..a4de84be7b 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceCustomerDetailsOptions : INestedOptions + public class InvoiceCustomerDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private ShippingOptions shipping; + private string taxExempt; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The customer's address. Learn about country-specific @@ -16,14 +24,30 @@ public class InvoiceCustomerDetailsOptions : INestedOptions /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// The customer's shipping information. Appears on invoices emailed to this customer. /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public ShippingOptions Shipping { get; set; } + public ShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } /// /// Tax details about the customer. @@ -38,7 +62,15 @@ public class InvoiceCustomerDetailsOptions : INestedOptions /// [JsonProperty("tax_exempt")] [STJS.JsonPropertyName("tax_exempt")] - public string TaxExempt { get; set; } + public string TaxExempt + { + get => this.taxExempt; + set + { + this.taxExempt = value; + this.SetTracker.Track(); + } + } /// /// The customer's tax IDs. @@ -46,5 +78,10 @@ public class InvoiceCustomerDetailsOptions : INestedOptions [JsonProperty("tax_ids")] [STJS.JsonPropertyName("tax_ids")] public List TaxIds { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsTaxOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsTaxOptions.cs index 672a6c0d8d..768bd587ea 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsTaxOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceCustomerDetailsTaxOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceCustomerDetailsTaxOptions : INestedOptions + public class InvoiceCustomerDetailsTaxOptions : INestedOptions, IHasSetTracking { + private string ipAddress; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A recent IP address of the customer used for tax reporting and tax location inference. /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the @@ -16,6 +22,19 @@ public class InvoiceCustomerDetailsTaxOptions : INestedOptions /// [JsonProperty("ip_address")] [STJS.JsonPropertyName("ip_address")] - public string IpAddress { get; set; } + public string IpAddress + { + get => this.ipAddress; + set + { + this.ipAddress = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceLineOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceLineOptions.cs index 8ea0d200ef..baf41b3787 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceLineOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceLineOptions.cs @@ -7,8 +7,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId + public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId, IHasSetTracking { + private List discounts; + private List margins; + private Dictionary metadata; + private List taxAmounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The integer amount in cents (or local equivalent) of the charge to be applied to the /// upcoming invoice. If you want to apply a credit to the customer's account, pass a @@ -51,7 +61,15 @@ public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// ID of an existing line item to remove from this invoice. @@ -74,7 +92,15 @@ public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("margins")] [STJS.JsonPropertyName("margins")] - public List Margins { get; set; } + public List Margins + { + get => this.margins; + set + { + this.margins = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -89,7 +115,15 @@ public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The period associated with this invoice item. When set to different values, the period @@ -149,7 +183,15 @@ public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("tax_amounts")] [STJS.JsonPropertyName("tax_amounts")] - public List TaxAmounts { get; set; } + public List TaxAmounts + { + get => this.taxAmounts; + set + { + this.taxAmounts = value; + this.SetTracker.Track(); + } + } /// /// The tax rates which apply to the line item. When set, the default_tax_rates on @@ -158,6 +200,19 @@ public class InvoiceLineOptions : INestedOptions, IHasMetadata, IHasId /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceLinePriceDataProductDataTaxDetailsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceLinePriceDataProductDataTaxDetailsOptions.cs index 41135f933e..946954b00c 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceLinePriceDataProductDataTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceLinePriceDataProductDataTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceLinePriceDataProductDataTaxDetailsOptions : INestedOptions + public class InvoiceLinePriceDataProductDataTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class InvoiceLinePriceDataProductDataTaxDetailsOptions : INestedOptions /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoicePayOptions.cs b/src/Stripe.net/Services/Invoices/InvoicePayOptions.cs index 5b63515d18..f75d24914c 100644 --- a/src/Stripe.net/Services/Invoices/InvoicePayOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoicePayOptions.cs @@ -8,6 +8,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoicePayOptions : BaseOptions { + private string mandate; + /// /// In cases where the source used to pay the invoice has insufficient funds, passing /// forgive=true controls whether a charge should be attempted for the full amount @@ -30,7 +32,15 @@ public class InvoicePayOptions : BaseOptions /// [JsonProperty("mandate")] [STJS.JsonPropertyName("mandate")] - public string Mandate { get; set; } + public string Mandate + { + get => this.mandate; + set + { + this.mandate = value; + this.SetTracker.Track(); + } + } /// /// Indicates if a customer is on or off-session while an invoice payment is attempted. diff --git a/src/Stripe.net/Services/Invoices/InvoicePaymentRecordDataOptions.cs b/src/Stripe.net/Services/Invoices/InvoicePaymentRecordDataOptions.cs index 8b3fa2e5a0..8b1212150d 100644 --- a/src/Stripe.net/Services/Invoices/InvoicePaymentRecordDataOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoicePaymentRecordDataOptions.cs @@ -8,8 +8,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoicePaymentRecordDataOptions : INestedOptions, IHasMetadata + public class InvoicePaymentRecordDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The amount that was paid out of band. /// @@ -32,7 +38,15 @@ public class InvoicePaymentRecordDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The type of money movement for this out of band payment record. @@ -56,5 +70,10 @@ public class InvoicePaymentRecordDataOptions : INestedOptions, IHasMetadata [JsonProperty("payment_reference")] [STJS.JsonPropertyName("payment_reference")] public string PaymentReference { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsOptions.cs b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsOptions.cs index 5217246d3a..f5728b52a1 100644 --- a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoicePaymentSettingsOptions : INestedOptions + public class InvoicePaymentSettingsOptions : INestedOptions, IHasSetTracking { + private string defaultMandate; + private List paymentMethodTypes; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// ID of the mandate to be used for this invoice. It must correspond to the payment method /// used to pay the invoice, including the invoice's default_payment_method or @@ -16,7 +23,15 @@ public class InvoicePaymentSettingsOptions : INestedOptions /// [JsonProperty("default_mandate")] [STJS.JsonPropertyName("default_mandate")] - public string DefaultMandate { get; set; } + public string DefaultMandate + { + get => this.defaultMandate; + set + { + this.defaultMandate = value; + this.SetTracker.Track(); + } + } /// /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. @@ -46,6 +61,19 @@ public class InvoicePaymentSettingsOptions : INestedOptions /// [JsonProperty("payment_method_types")] [STJS.JsonPropertyName("payment_method_types")] - public List PaymentMethodTypes { get; set; } + public List PaymentMethodTypes + { + get => this.paymentMethodTypes; + set + { + this.paymentMethodTypes = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions.cs b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions.cs index 1aa0a07962..1180a0351c 100644 --- a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions : INestedOptions + public class InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions : INestedOptions, IHasSetTracking { + private InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanOptions plan; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Setting to true enables installments for this invoice. Setting to false will prevent any /// selected plan from applying to a payment. @@ -21,6 +27,19 @@ public class InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsOptions : /// [JsonProperty("plan")] [STJS.JsonPropertyName("plan")] - public InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanOptions Plan { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanOptions Plan + { + get => this.plan; + set + { + this.plan = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsOptions.cs index 32617f4de2..f7a2c2d6f9 100644 --- a/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoicePaymentSettingsPaymentMethodOptionsOptions.cs @@ -6,15 +6,39 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions + public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private InvoicePaymentSettingsPaymentMethodOptionsAcssDebitOptions acssDebit; + private InvoicePaymentSettingsPaymentMethodOptionsBancontactOptions bancontact; + private InvoicePaymentSettingsPaymentMethodOptionsCardOptions card; + private InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceOptions customerBalance; + private InvoicePaymentSettingsPaymentMethodOptionsIdBankTransferOptions idBankTransfer; + private InvoicePaymentSettingsPaymentMethodOptionsKonbiniOptions konbini; + private InvoicePaymentSettingsPaymentMethodOptionsPaytoOptions payto; + private InvoicePaymentSettingsPaymentMethodOptionsPixOptions pix; + private InvoicePaymentSettingsPaymentMethodOptionsSepaDebitOptions sepaDebit; + private InvoicePaymentSettingsPaymentMethodOptionsUpiOptions upi; + private InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountOptions usBankAccount; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// If paying by acss_debit, this sub-hash contains details about the Canadian /// pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. /// [JsonProperty("acss_debit")] [STJS.JsonPropertyName("acss_debit")] - public InvoicePaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit + { + get => this.acssDebit; + set + { + this.acssDebit = value; + this.SetTracker.Track(); + } + } /// /// If paying by bancontact, this sub-hash contains details about the Bancontact @@ -22,7 +46,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("bancontact")] [STJS.JsonPropertyName("bancontact")] - public InvoicePaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact + { + get => this.bancontact; + set + { + this.bancontact = value; + this.SetTracker.Track(); + } + } /// /// If paying by card, this sub-hash contains details about the Card payment method @@ -30,7 +62,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("card")] [STJS.JsonPropertyName("card")] - public InvoicePaymentSettingsPaymentMethodOptionsCardOptions Card { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsCardOptions Card + { + get => this.card; + set + { + this.card = value; + this.SetTracker.Track(); + } + } /// /// If paying by customer_balance, this sub-hash contains details about the Bank @@ -38,7 +78,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("customer_balance")] [STJS.JsonPropertyName("customer_balance")] - public InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance + { + get => this.customerBalance; + set + { + this.customerBalance = value; + this.SetTracker.Track(); + } + } /// /// If paying by id_bank_transfer, this sub-hash contains details about the Indonesia @@ -46,7 +94,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("id_bank_transfer")] [STJS.JsonPropertyName("id_bank_transfer")] - public InvoicePaymentSettingsPaymentMethodOptionsIdBankTransferOptions IdBankTransfer { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsIdBankTransferOptions IdBankTransfer + { + get => this.idBankTransfer; + set + { + this.idBankTransfer = value; + this.SetTracker.Track(); + } + } /// /// If paying by konbini, this sub-hash contains details about the Konbini payment @@ -54,7 +110,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("konbini")] [STJS.JsonPropertyName("konbini")] - public InvoicePaymentSettingsPaymentMethodOptionsKonbiniOptions Konbini { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsKonbiniOptions Konbini + { + get => this.konbini; + set + { + this.konbini = value; + this.SetTracker.Track(); + } + } /// /// If paying by payto, this sub-hash contains details about the PayTo payment method @@ -62,7 +126,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("payto")] [STJS.JsonPropertyName("payto")] - public InvoicePaymentSettingsPaymentMethodOptionsPaytoOptions Payto { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsPaytoOptions Payto + { + get => this.payto; + set + { + this.payto = value; + this.SetTracker.Track(); + } + } /// /// If paying by pix, this sub-hash contains details about the Pix payment method @@ -70,7 +142,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("pix")] [STJS.JsonPropertyName("pix")] - public InvoicePaymentSettingsPaymentMethodOptionsPixOptions Pix { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsPixOptions Pix + { + get => this.pix; + set + { + this.pix = value; + this.SetTracker.Track(); + } + } /// /// If paying by sepa_debit, this sub-hash contains details about the SEPA Direct @@ -78,7 +158,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("sepa_debit")] [STJS.JsonPropertyName("sepa_debit")] - public InvoicePaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit + { + get => this.sepaDebit; + set + { + this.sepaDebit = value; + this.SetTracker.Track(); + } + } /// /// If paying by upi, this sub-hash contains details about the UPI payment method @@ -86,7 +174,15 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("upi")] [STJS.JsonPropertyName("upi")] - public InvoicePaymentSettingsPaymentMethodOptionsUpiOptions Upi { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsUpiOptions Upi + { + get => this.upi; + set + { + this.upi = value; + this.SetTracker.Track(); + } + } /// /// If paying by us_bank_account, this sub-hash contains details about the ACH direct @@ -94,6 +190,19 @@ public class InvoicePaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("us_bank_account")] [STJS.JsonPropertyName("us_bank_account")] - public InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountOptions UsBankAccount { get; set; } + public InvoicePaymentSettingsPaymentMethodOptionsUsBankAccountOptions UsBankAccount + { + get => this.usBankAccount; + set + { + this.usBankAccount = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceRemoveLinesOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceRemoveLinesOptions.cs index 4acca42e14..b92e61b5cf 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceRemoveLinesOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceRemoveLinesOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceRemoveLinesOptions : BaseOptions { + private Dictionary invoiceMetadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,7 +19,15 @@ public class InvoiceRemoveLinesOptions : BaseOptions /// [JsonProperty("invoice_metadata")] [STJS.JsonPropertyName("invoice_metadata")] - public Dictionary InvoiceMetadata { get; set; } + public Dictionary InvoiceMetadata + { + get => this.invoiceMetadata; + set + { + this.invoiceMetadata = value; + this.SetTracker.Track(); + } + } /// /// The line items to remove. diff --git a/src/Stripe.net/Services/Invoices/InvoiceRenderingOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceRenderingOptions.cs index 1f8eecf022..ce30809e2b 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceRenderingOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceRenderingOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceRenderingOptions : INestedOptions + public class InvoiceRenderingOptions : INestedOptions, IHasSetTracking { + private string amountTaxDisplay; + private long? templateVersion; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. /// One of exclude_tax or include_inclusive_tax. include_inclusive_tax @@ -18,7 +25,15 @@ public class InvoiceRenderingOptions : INestedOptions /// [JsonProperty("amount_tax_display")] [STJS.JsonPropertyName("amount_tax_display")] - public string AmountTaxDisplay { get; set; } + public string AmountTaxDisplay + { + get => this.amountTaxDisplay; + set + { + this.amountTaxDisplay = value; + this.SetTracker.Track(); + } + } /// /// Invoice pdf rendering options. @@ -39,6 +54,19 @@ public class InvoiceRenderingOptions : INestedOptions /// [JsonProperty("template_version")] [STJS.JsonPropertyName("template_version")] - public long? TemplateVersion { get; set; } + public long? TemplateVersion + { + get => this.templateVersion; + set + { + this.templateVersion = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsAmendmentMetadataActionOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsAmendmentMetadataActionOptions.cs index 53ddb6744c..f6733348df 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsAmendmentMetadataActionOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsAmendmentMetadataActionOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsAmendmentMetadataActionOptions : INestedOptions + public class InvoiceScheduleDetailsAmendmentMetadataActionOptions : INestedOptions, IHasSetTracking { + private Dictionary set; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Key-value pairs to add to schedule phase metadata. These values will merge with existing /// schedule phase metadata. @@ -30,7 +36,15 @@ public class InvoiceScheduleDetailsAmendmentMetadataActionOptions : INestedOptio /// [JsonProperty("set")] [STJS.JsonPropertyName("set")] - public Dictionary Set { get; set; } + public Dictionary Set + { + get => this.set; + set + { + this.set = value; + this.SetTracker.Track(); + } + } /// /// Select one of three ways to update phase-level metadata on subscription @@ -40,5 +54,10 @@ public class InvoiceScheduleDetailsAmendmentMetadataActionOptions : INestedOptio [JsonProperty("type")] [STJS.JsonPropertyName("type")] public string Type { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsOptions.cs index 65fbfd1586..eb5a89cf12 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsOptions : INestedOptions + public class InvoiceScheduleDetailsOptions : INestedOptions, IHasSetTracking { + private List prebilling; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Changes to apply to the phases of the subscription schedule, in the order provided. /// @@ -61,7 +67,15 @@ public class InvoiceScheduleDetailsOptions : INestedOptions /// [JsonProperty("prebilling")] [STJS.JsonPropertyName("prebilling")] - public List Prebilling { get; set; } + public List Prebilling + { + get => this.prebilling; + set + { + this.prebilling = value; + this.SetTracker.Track(); + } + } /// /// In cases where the schedule_details params update the currently active phase, @@ -71,5 +85,10 @@ public class InvoiceScheduleDetailsOptions : INestedOptions [JsonProperty("proration_behavior")] [STJS.JsonPropertyName("proration_behavior")] public string ProrationBehavior { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs index caa590723c..acbfaec38c 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata + public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The coupons to redeem into discounts for the item. /// @@ -63,6 +69,19 @@ public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions, /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseInvoiceSettingsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseInvoiceSettingsOptions.cs index 91d278a880..1083763b31 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseInvoiceSettingsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseInvoiceSettingsOptions.cs @@ -7,15 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsPhaseInvoiceSettingsOptions : INestedOptions + public class InvoiceScheduleDetailsPhaseInvoiceSettingsOptions : INestedOptions, IHasSetTracking { + private List accountTaxIds; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with this phase of the subscription schedule. Will be set /// on invoices generated by this phase of the subscription schedule. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Number of days within which a customer must pay invoices generated by this subscription @@ -33,5 +47,10 @@ public class InvoiceScheduleDetailsPhaseInvoiceSettingsOptions : INestedOptions [JsonProperty("issuer")] [STJS.JsonPropertyName("issuer")] public InvoiceScheduleDetailsPhaseInvoiceSettingsIssuerOptions Issuer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseItemOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseItemOptions.cs index 718d980df6..1fe85e4a4c 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseItemOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseItemOptions.cs @@ -7,22 +7,46 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsPhaseItemOptions : INestedOptions, IHasMetadata + public class InvoiceScheduleDetailsPhaseItemOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private InvoiceScheduleDetailsPhaseItemBillingThresholdsOptions billingThresholds; + private List discounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public InvoiceScheduleDetailsPhaseItemBillingThresholdsOptions BillingThresholds { get; set; } + public InvoiceScheduleDetailsPhaseItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// The coupons to redeem into discounts for the subscription item. /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -78,7 +102,15 @@ public class InvoiceScheduleDetailsPhaseItemOptions : INestedOptions, IHasMetada /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Options that configure the trial on the subscription item. @@ -93,5 +125,10 @@ public class InvoiceScheduleDetailsPhaseItemOptions : INestedOptions, IHasMetada [JsonProperty("trial_offer")] [STJS.JsonPropertyName("trial_offer")] public string TrialOffer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseOptions.cs index eb3c0d8f70..84a7299178 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseOptions.cs @@ -8,8 +8,17 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata + public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private InvoiceScheduleDetailsPhaseBillingThresholdsOptions billingThresholds; + private List defaultTaxRates; + private string description; + private List discounts; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A list of prices and quantities that will generate invoice items appended to the next /// invoice for this phase. You may pass up to 20 items. @@ -55,7 +64,15 @@ public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public InvoiceScheduleDetailsPhaseBillingThresholdsOptions BillingThresholds { get; set; } + public InvoiceScheduleDetailsPhaseBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// Either charge_automatically, or send_invoice. When charging automatically, @@ -97,7 +114,15 @@ public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// Subscription description, meant to be displayable to the customer. Use this field to @@ -106,7 +131,15 @@ public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The coupons to redeem into discounts for the schedule phase. If not specified, inherits @@ -115,7 +148,15 @@ public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The number of intervals the phase should last. If set, end_date must not be set. @@ -245,5 +286,10 @@ public class InvoiceScheduleDetailsPhaseOptions : INestedOptions, IHasMetadata [JsonProperty("trial_settings")] [STJS.JsonPropertyName("trial_settings")] public InvoiceScheduleDetailsPhaseTrialSettingsOptions TrialSettings { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceShippingDetailsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceShippingDetailsOptions.cs index d15b8f6485..b65a8dcf98 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceShippingDetailsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceShippingDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceShippingDetailsOptions : INestedOptions + public class InvoiceShippingDetailsOptions : INestedOptions, IHasSetTracking { + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Shipping address. /// @@ -27,6 +33,19 @@ public class InvoiceShippingDetailsOptions : INestedOptions /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsItemOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsItemOptions.cs index 20dc08d911..5ae3097d9d 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsItemOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsItemOptions.cs @@ -7,15 +7,32 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceSubscriptionDetailsItemOptions : INestedOptions, IHasId, IHasMetadata + public class InvoiceSubscriptionDetailsItemOptions : INestedOptions, IHasId, IHasMetadata, IHasSetTracking { + private InvoiceSubscriptionDetailsItemBillingThresholdsOptions billingThresholds; + private List discounts; + private Dictionary metadata; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public InvoiceSubscriptionDetailsItemBillingThresholdsOptions BillingThresholds { get; set; } + public InvoiceSubscriptionDetailsItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// Delete all usage for a given subscription item. You must pass this when deleting a usage @@ -45,7 +62,15 @@ public class InvoiceSubscriptionDetailsItemOptions : INestedOptions, IHasId, IHa /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Subscription item to update. @@ -62,7 +87,15 @@ public class InvoiceSubscriptionDetailsItemOptions : INestedOptions, IHasId, IHa /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Plan ID for this item, as a string. @@ -104,6 +137,19 @@ public class InvoiceSubscriptionDetailsItemOptions : INestedOptions, IHasId, IHa /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsOptions.cs index 27a0a8036b..f3d3056b95 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceSubscriptionDetailsOptions.cs @@ -8,8 +8,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class InvoiceSubscriptionDetailsOptions : INestedOptions + public class InvoiceSubscriptionDetailsOptions : INestedOptions, IHasSetTracking { + private List billingSchedules; + private AnyOf cancelAt; + private List defaultTaxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is @@ -35,7 +43,15 @@ public class InvoiceSubscriptionDetailsOptions : INestedOptions /// [JsonProperty("billing_schedules")] [STJS.JsonPropertyName("billing_schedules")] - public List BillingSchedules { get; set; } + public List BillingSchedules + { + get => this.billingSchedules; + set + { + this.billingSchedules = value; + this.SetTracker.Track(); + } + } /// /// A timestamp at which the subscription should cancel. If set to a date before the current @@ -47,7 +63,15 @@ public class InvoiceSubscriptionDetailsOptions : INestedOptions [JsonConverter(typeof(AnyOfConverter))] [STJS.JsonPropertyName("cancel_at")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] - public AnyOf CancelAt { get; set; } + public AnyOf CancelAt + { + get => this.cancelAt; + set + { + this.cancelAt = value; + this.SetTracker.Track(); + } + } /// /// Indicate whether this subscription should cancel at the end of the current period @@ -71,7 +95,15 @@ public class InvoiceSubscriptionDetailsOptions : INestedOptions /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// A list of up to 20 subscription items, each with an attached price. @@ -141,5 +173,10 @@ public class InvoiceSubscriptionDetailsOptions : INestedOptions [STJS.JsonPropertyName("trial_end")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] public AnyOf TrialEnd { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Invoices/InvoiceUpdateLinesOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceUpdateLinesOptions.cs index ac7c7271d2..7f53378e35 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceUpdateLinesOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceUpdateLinesOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceUpdateLinesOptions : BaseOptions { + private Dictionary invoiceMetadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -22,7 +24,15 @@ public class InvoiceUpdateLinesOptions : BaseOptions /// [JsonProperty("invoice_metadata")] [STJS.JsonPropertyName("invoice_metadata")] - public Dictionary InvoiceMetadata { get; set; } + public Dictionary InvoiceMetadata + { + get => this.invoiceMetadata; + set + { + this.invoiceMetadata = value; + this.SetTracker.Track(); + } + } /// /// The line items to update. diff --git a/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs index 3ea4daad7d..6eefd8ce2c 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceUpdateOptions.cs @@ -10,13 +10,36 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class InvoiceUpdateOptions : BaseOptions, IHasMetadata { + private List accountTaxIds; + private List amountsDue; + private List customFields; + private List defaultMargins; + private string defaultSource; + private List defaultTaxRates; + private List discounts; + private DateTime? effectiveAt; + private Dictionary metadata; + private string number; + private string onBehalfOf; + private InvoiceShippingCostOptions shippingCost; + private InvoiceShippingDetailsOptions shippingDetails; + private InvoiceTransferDataOptions transferData; + /// /// The account tax IDs associated with the invoice. Only editable when the invoice is a /// draft. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// List of expected payments and corresponding due dates. Valid only for invoices where @@ -24,7 +47,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("amounts_due")] [STJS.JsonPropertyName("amounts_due")] - public List AmountsDue { get; set; } + public List AmountsDue + { + get => this.amountsDue; + set + { + this.amountsDue = value; + this.SetTracker.Track(); + } + } /// /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred @@ -80,7 +111,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// The number of days from which the invoice is created until it is due. Only valid for @@ -97,7 +136,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_margins")] [STJS.JsonPropertyName("default_margins")] - public List DefaultMargins { get; set; } + public List DefaultMargins + { + get => this.defaultMargins; + set + { + this.defaultMargins = value; + this.SetTracker.Track(); + } + } /// /// ID of the default payment method for the invoice. It must belong to the customer @@ -115,7 +162,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_source")] [STJS.JsonPropertyName("default_source")] - public string DefaultSource { get; set; } + public string DefaultSource + { + get => this.defaultSource; + set + { + this.defaultSource = value; + this.SetTracker.Track(); + } + } /// /// The tax rates that will apply to any line item that does not have tax_rates set. @@ -123,7 +178,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// An arbitrary string attached to the object. Often useful for displaying to users. @@ -139,7 +202,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The date on which payment for this invoice is due. Only valid for invoices where @@ -161,7 +232,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("effective_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? EffectiveAt { get; set; } + public DateTime? EffectiveAt + { + get => this.effectiveAt; + set + { + this.effectiveAt = value; + this.SetTracker.Track(); + } + } /// /// Footer to be displayed on the invoice. @@ -186,7 +265,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Set the number for this invoice. If no number is present then a number will be assigned @@ -198,7 +285,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("number")] [STJS.JsonPropertyName("number")] - public string Number { get; set; } + public string Number + { + get => this.number; + set + { + this.number = value; + this.SetTracker.Track(); + } + } /// /// The account (if any) for which the funds of the invoice payment are intended. If set, @@ -208,7 +303,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// Configuration settings for the PaymentIntent that is generated when the invoice is @@ -231,7 +334,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping_cost")] [STJS.JsonPropertyName("shipping_cost")] - public InvoiceShippingCostOptions ShippingCost { get; set; } + public InvoiceShippingCostOptions ShippingCost + { + get => this.shippingCost; + set + { + this.shippingCost = value; + this.SetTracker.Track(); + } + } /// /// Shipping details for the invoice. The Invoice PDF will use the shipping_details @@ -240,7 +351,15 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping_details")] [STJS.JsonPropertyName("shipping_details")] - public InvoiceShippingDetailsOptions ShippingDetails { get; set; } + public InvoiceShippingDetailsOptions ShippingDetails + { + get => this.shippingDetails; + set + { + this.shippingDetails = value; + this.SetTracker.Track(); + } + } /// /// Extra information about a charge for the customer's credit card statement. It must @@ -259,6 +378,14 @@ public class InvoiceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public InvoiceTransferDataOptions TransferData { get; set; } + public InvoiceTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Invoices/UpcomingInvoiceSubscriptionResumeAt.cs b/src/Stripe.net/Services/Invoices/UpcomingInvoiceSubscriptionResumeAt.cs index b2168d706b..2e7c83935b 100644 --- a/src/Stripe.net/Services/Invoices/UpcomingInvoiceSubscriptionResumeAt.cs +++ b/src/Stripe.net/Services/Invoices/UpcomingInvoiceSubscriptionResumeAt.cs @@ -1,5 +1,8 @@ namespace Stripe { + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))] public class UpcomingInvoiceSubscriptionResumeAt : StringEnum { /// When viewing an upcoming invoice for a subscription, simulates it resuming to the current time. diff --git a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationApproveOptions.cs b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationApproveOptions.cs index 0a2d862ebc..4b9681e7e7 100644 --- a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationApproveOptions.cs +++ b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationApproveOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AuthorizationApproveOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// If the authorization's pending_request.is_amount_controllable property is /// true, you may provide this value to control how much to hold for the @@ -28,6 +30,14 @@ public class AuthorizationApproveOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationDeclineOptions.cs b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationDeclineOptions.cs index 6188a0dc23..15dee8b96a 100644 --- a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationDeclineOptions.cs +++ b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationDeclineOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AuthorizationDeclineOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class AuthorizationDeclineOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs index b4fc9bed8e..9263d9eac1 100644 --- a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class AuthorizationUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class AuthorizationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderIndividualCardIssuingUserTermsAcceptanceOptions.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderIndividualCardIssuingUserTermsAcceptanceOptions.cs index 95314082d9..bb09a2bfdc 100644 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderIndividualCardIssuingUserTermsAcceptanceOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cardholders/CardholderIndividualCardIssuingUserTermsAcceptanceOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class CardholderIndividualCardIssuingUserTermsAcceptanceOptions : INestedOptions + public class CardholderIndividualCardIssuingUserTermsAcceptanceOptions : INestedOptions, IHasSetTracking { + private string userAgent; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. /// @@ -31,6 +37,19 @@ public class CardholderIndividualCardIssuingUserTermsAcceptanceOptions : INested /// [JsonProperty("user_agent")] [STJS.JsonPropertyName("user_agent")] - public string UserAgent { get; set; } + public string UserAgent + { + get => this.userAgent; + set + { + this.userAgent = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs index 39b0ed53b9..86cc2c4419 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CardCreateOptions : BaseOptions, IHasMetadata { + private string secondLine; + /// /// The Cardholder /// object with which the card will be associated. @@ -104,7 +106,15 @@ public class CardCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("second_line")] [STJS.JsonPropertyName("second_line")] - public string SecondLine { get; set; } + public string SecondLine + { + get => this.secondLine; + set + { + this.secondLine = value; + this.SetTracker.Track(); + } + } /// /// The address where the card will be shipped. diff --git a/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs index bc76a02883..4496f3bdbe 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CardUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Reason why the status of this card is canceled. /// One of: lost, or stolen. @@ -25,7 +27,15 @@ public class CardUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } [JsonProperty("personalization_design")] [STJS.JsonPropertyName("personalization_design")] diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceCanceledOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceCanceledOptions.cs index 043e34aa7e..330cd9badc 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceCanceledOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceCanceledOptions.cs @@ -7,15 +7,38 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceCanceledOptions : INestedOptions + public class DisputeEvidenceCanceledOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private DateTime? canceledAt; + private bool? cancellationPolicyProvided; + private string cancellationReason; + private DateTime? expectedAt; + private string explanation; + private string productDescription; + private string productType; + private string returnStatus; + private DateTime? returnedAt; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Date when order was canceled. @@ -24,21 +47,45 @@ public class DisputeEvidenceCanceledOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("canceled_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? CanceledAt { get; set; } + public DateTime? CanceledAt + { + get => this.canceledAt; + set + { + this.canceledAt = value; + this.SetTracker.Track(); + } + } /// /// Whether the cardholder was provided with a cancellation policy. /// [JsonProperty("cancellation_policy_provided")] [STJS.JsonPropertyName("cancellation_policy_provided")] - public bool? CancellationPolicyProvided { get; set; } + public bool? CancellationPolicyProvided + { + get => this.cancellationPolicyProvided; + set + { + this.cancellationPolicyProvided = value; + this.SetTracker.Track(); + } + } /// /// Reason for canceling the order. /// [JsonProperty("cancellation_reason")] [STJS.JsonPropertyName("cancellation_reason")] - public string CancellationReason { get; set; } + public string CancellationReason + { + get => this.cancellationReason; + set + { + this.cancellationReason = value; + this.SetTracker.Track(); + } + } /// /// Date when the cardholder expected to receive the product. @@ -47,21 +94,45 @@ public class DisputeEvidenceCanceledOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("expected_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ExpectedAt { get; set; } + public DateTime? ExpectedAt + { + get => this.expectedAt; + set + { + this.expectedAt = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Description of the merchandise or service that was purchased. /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// Whether the product was a merchandise or service. @@ -69,7 +140,15 @@ public class DisputeEvidenceCanceledOptions : INestedOptions /// [JsonProperty("product_type")] [STJS.JsonPropertyName("product_type")] - public string ProductType { get; set; } + public string ProductType + { + get => this.productType; + set + { + this.productType = value; + this.SetTracker.Track(); + } + } /// /// Result of cardholder's attempt to return the product. @@ -77,7 +156,15 @@ public class DisputeEvidenceCanceledOptions : INestedOptions /// [JsonProperty("return_status")] [STJS.JsonPropertyName("return_status")] - public string ReturnStatus { get; set; } + public string ReturnStatus + { + get => this.returnStatus; + set + { + this.returnStatus = value; + this.SetTracker.Track(); + } + } /// /// Date when the product was returned or attempted to be returned. @@ -86,6 +173,19 @@ public class DisputeEvidenceCanceledOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("returned_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ReturnedAt { get; set; } + public DateTime? ReturnedAt + { + get => this.returnedAt; + set + { + this.returnedAt = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceDuplicateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceDuplicateOptions.cs index 1c71b29caa..596195436f 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceDuplicateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceDuplicateOptions.cs @@ -6,15 +6,33 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceDuplicateOptions : INestedOptions + public class DisputeEvidenceDuplicateOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private string cardStatement; + private string cashReceipt; + private string checkImage; + private string explanation; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// (ID of a file upload) Copy of @@ -22,7 +40,15 @@ public class DisputeEvidenceDuplicateOptions : INestedOptions /// [JsonProperty("card_statement")] [STJS.JsonPropertyName("card_statement")] - public string CardStatement { get; set; } + public string CardStatement + { + get => this.cardStatement; + set + { + this.cardStatement = value; + this.SetTracker.Track(); + } + } /// /// (ID of a file upload) Copy of @@ -30,7 +56,15 @@ public class DisputeEvidenceDuplicateOptions : INestedOptions /// [JsonProperty("cash_receipt")] [STJS.JsonPropertyName("cash_receipt")] - public string CashReceipt { get; set; } + public string CashReceipt + { + get => this.cashReceipt; + set + { + this.cashReceipt = value; + this.SetTracker.Track(); + } + } /// /// (ID of a file upload) Image of @@ -38,14 +72,30 @@ public class DisputeEvidenceDuplicateOptions : INestedOptions /// [JsonProperty("check_image")] [STJS.JsonPropertyName("check_image")] - public string CheckImage { get; set; } + public string CheckImage + { + get => this.checkImage; + set + { + this.checkImage = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two @@ -54,5 +104,10 @@ public class DisputeEvidenceDuplicateOptions : INestedOptions [JsonProperty("original_transaction")] [STJS.JsonPropertyName("original_transaction")] public string OriginalTransaction { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceFraudulentOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceFraudulentOptions.cs index 61cb76d08c..574c5ff898 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceFraudulentOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceFraudulentOptions.cs @@ -6,21 +6,49 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceFraudulentOptions : INestedOptions + public class DisputeEvidenceFraudulentOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private string explanation; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceMerchandiseNotAsDescribedOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceMerchandiseNotAsDescribedOptions.cs index a71fc618b2..6741fc23cb 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceMerchandiseNotAsDescribedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceMerchandiseNotAsDescribedOptions.cs @@ -7,22 +7,49 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceMerchandiseNotAsDescribedOptions : INestedOptions + public class DisputeEvidenceMerchandiseNotAsDescribedOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private string explanation; + private DateTime? receivedAt; + private string returnDescription; + private string returnStatus; + private DateTime? returnedAt; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Date when the product was received. @@ -31,14 +58,30 @@ public class DisputeEvidenceMerchandiseNotAsDescribedOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("received_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ReceivedAt { get; set; } + public DateTime? ReceivedAt + { + get => this.receivedAt; + set + { + this.receivedAt = value; + this.SetTracker.Track(); + } + } /// /// Description of the cardholder's attempt to return the product. /// [JsonProperty("return_description")] [STJS.JsonPropertyName("return_description")] - public string ReturnDescription { get; set; } + public string ReturnDescription + { + get => this.returnDescription; + set + { + this.returnDescription = value; + this.SetTracker.Track(); + } + } /// /// Result of cardholder's attempt to return the product. @@ -46,7 +89,15 @@ public class DisputeEvidenceMerchandiseNotAsDescribedOptions : INestedOptions /// [JsonProperty("return_status")] [STJS.JsonPropertyName("return_status")] - public string ReturnStatus { get; set; } + public string ReturnStatus + { + get => this.returnStatus; + set + { + this.returnStatus = value; + this.SetTracker.Track(); + } + } /// /// Date when the product was returned or attempted to be returned. @@ -55,6 +106,19 @@ public class DisputeEvidenceMerchandiseNotAsDescribedOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("returned_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ReturnedAt { get; set; } + public DateTime? ReturnedAt + { + get => this.returnedAt; + set + { + this.returnedAt = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNoValidAuthorizationOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNoValidAuthorizationOptions.cs index 354367d20b..54f263a33d 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNoValidAuthorizationOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNoValidAuthorizationOptions.cs @@ -6,21 +6,49 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceNoValidAuthorizationOptions : INestedOptions + public class DisputeEvidenceNoValidAuthorizationOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private string explanation; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNotReceivedOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNotReceivedOptions.cs index 1d15cd1396..f48ad8dbdf 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNotReceivedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceNotReceivedOptions.cs @@ -7,15 +7,33 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceNotReceivedOptions : INestedOptions + public class DisputeEvidenceNotReceivedOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private DateTime? expectedAt; + private string explanation; + private string productDescription; + private string productType; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Date when the cardholder expected to receive the product. @@ -24,21 +42,45 @@ public class DisputeEvidenceNotReceivedOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("expected_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ExpectedAt { get; set; } + public DateTime? ExpectedAt + { + get => this.expectedAt; + set + { + this.expectedAt = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Description of the merchandise or service that was purchased. /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// Whether the product was a merchandise or service. @@ -46,6 +88,19 @@ public class DisputeEvidenceNotReceivedOptions : INestedOptions /// [JsonProperty("product_type")] [STJS.JsonPropertyName("product_type")] - public string ProductType { get; set; } + public string ProductType + { + get => this.productType; + set + { + this.productType = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOptions.cs index 1a9c6eb602..1e396e7478 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOptions.cs @@ -6,56 +6,125 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceOptions : INestedOptions + public class DisputeEvidenceOptions : INestedOptions, IHasSetTracking { + private DisputeEvidenceCanceledOptions canceled; + private DisputeEvidenceDuplicateOptions duplicate; + private DisputeEvidenceFraudulentOptions fraudulent; + private DisputeEvidenceMerchandiseNotAsDescribedOptions merchandiseNotAsDescribed; + private DisputeEvidenceNoValidAuthorizationOptions noValidAuthorization; + private DisputeEvidenceNotReceivedOptions notReceived; + private DisputeEvidenceOtherOptions other; + private DisputeEvidenceServiceNotAsDescribedOptions serviceNotAsDescribed; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Evidence provided when reason is 'canceled'. /// [JsonProperty("canceled")] [STJS.JsonPropertyName("canceled")] - public DisputeEvidenceCanceledOptions Canceled { get; set; } + public DisputeEvidenceCanceledOptions Canceled + { + get => this.canceled; + set + { + this.canceled = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'duplicate'. /// [JsonProperty("duplicate")] [STJS.JsonPropertyName("duplicate")] - public DisputeEvidenceDuplicateOptions Duplicate { get; set; } + public DisputeEvidenceDuplicateOptions Duplicate + { + get => this.duplicate; + set + { + this.duplicate = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'fraudulent'. /// [JsonProperty("fraudulent")] [STJS.JsonPropertyName("fraudulent")] - public DisputeEvidenceFraudulentOptions Fraudulent { get; set; } + public DisputeEvidenceFraudulentOptions Fraudulent + { + get => this.fraudulent; + set + { + this.fraudulent = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'merchandise_not_as_described'. /// [JsonProperty("merchandise_not_as_described")] [STJS.JsonPropertyName("merchandise_not_as_described")] - public DisputeEvidenceMerchandiseNotAsDescribedOptions MerchandiseNotAsDescribed { get; set; } + public DisputeEvidenceMerchandiseNotAsDescribedOptions MerchandiseNotAsDescribed + { + get => this.merchandiseNotAsDescribed; + set + { + this.merchandiseNotAsDescribed = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'no_valid_authorization'. /// [JsonProperty("no_valid_authorization")] [STJS.JsonPropertyName("no_valid_authorization")] - public DisputeEvidenceNoValidAuthorizationOptions NoValidAuthorization { get; set; } + public DisputeEvidenceNoValidAuthorizationOptions NoValidAuthorization + { + get => this.noValidAuthorization; + set + { + this.noValidAuthorization = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'not_received'. /// [JsonProperty("not_received")] [STJS.JsonPropertyName("not_received")] - public DisputeEvidenceNotReceivedOptions NotReceived { get; set; } + public DisputeEvidenceNotReceivedOptions NotReceived + { + get => this.notReceived; + set + { + this.notReceived = value; + this.SetTracker.Track(); + } + } /// /// Evidence provided when reason is 'other'. /// [JsonProperty("other")] [STJS.JsonPropertyName("other")] - public DisputeEvidenceOtherOptions Other { get; set; } + public DisputeEvidenceOtherOptions Other + { + get => this.other; + set + { + this.other = value; + this.SetTracker.Track(); + } + } /// /// The reason for filing the dispute. The evidence should be submitted in the field of the @@ -73,6 +142,19 @@ public class DisputeEvidenceOptions : INestedOptions /// [JsonProperty("service_not_as_described")] [STJS.JsonPropertyName("service_not_as_described")] - public DisputeEvidenceServiceNotAsDescribedOptions ServiceNotAsDescribed { get; set; } + public DisputeEvidenceServiceNotAsDescribedOptions ServiceNotAsDescribed + { + get => this.serviceNotAsDescribed; + set + { + this.serviceNotAsDescribed = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOtherOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOtherOptions.cs index b3638ef3c8..cca22a4fd0 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOtherOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceOtherOptions.cs @@ -6,29 +6,62 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceOtherOptions : INestedOptions + public class DisputeEvidenceOtherOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private string explanation; + private string productDescription; + private string productType; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Description of the merchandise or service that was purchased. /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// Whether the product was a merchandise or service. @@ -36,6 +69,19 @@ public class DisputeEvidenceOtherOptions : INestedOptions /// [JsonProperty("product_type")] [STJS.JsonPropertyName("product_type")] - public string ProductType { get; set; } + public string ProductType + { + get => this.productType; + set + { + this.productType = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceServiceNotAsDescribedOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceServiceNotAsDescribedOptions.cs index a58695a4b8..bbac5a9480 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceServiceNotAsDescribedOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeEvidenceServiceNotAsDescribedOptions.cs @@ -7,15 +7,33 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class DisputeEvidenceServiceNotAsDescribedOptions : INestedOptions + public class DisputeEvidenceServiceNotAsDescribedOptions : INestedOptions, IHasSetTracking { + private string additionalDocumentation; + private DateTime? canceledAt; + private string cancellationReason; + private string explanation; + private DateTime? receivedAt; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// (ID of a file upload) /// Additional documentation supporting the dispute. /// [JsonProperty("additional_documentation")] [STJS.JsonPropertyName("additional_documentation")] - public string AdditionalDocumentation { get; set; } + public string AdditionalDocumentation + { + get => this.additionalDocumentation; + set + { + this.additionalDocumentation = value; + this.SetTracker.Track(); + } + } /// /// Date when order was canceled. @@ -24,21 +42,45 @@ public class DisputeEvidenceServiceNotAsDescribedOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("canceled_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? CanceledAt { get; set; } + public DateTime? CanceledAt + { + get => this.canceledAt; + set + { + this.canceledAt = value; + this.SetTracker.Track(); + } + } /// /// Reason for canceling the order. /// [JsonProperty("cancellation_reason")] [STJS.JsonPropertyName("cancellation_reason")] - public string CancellationReason { get; set; } + public string CancellationReason + { + get => this.cancellationReason; + set + { + this.cancellationReason = value; + this.SetTracker.Track(); + } + } /// /// Explanation of why the cardholder is disputing this transaction. /// [JsonProperty("explanation")] [STJS.JsonPropertyName("explanation")] - public string Explanation { get; set; } + public string Explanation + { + get => this.explanation; + set + { + this.explanation = value; + this.SetTracker.Track(); + } + } /// /// Date when the product was received. @@ -47,6 +89,19 @@ public class DisputeEvidenceServiceNotAsDescribedOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("received_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ReceivedAt { get; set; } + public DateTime? ReceivedAt + { + get => this.receivedAt; + set + { + this.receivedAt = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeSubmitOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeSubmitOptions.cs index ec640a6639..294f208992 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeSubmitOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeSubmitOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class DisputeSubmitOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class DisputeSubmitOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs index 63d5945f03..b5b04031c1 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class DisputeUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The dispute amount in the card's currency and in the smallest currency unit. @@ -32,6 +34,14 @@ public class DisputeUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignCarrierTextOptions.cs b/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignCarrierTextOptions.cs index 7d670baca7..e6df3bf2a8 100644 --- a/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignCarrierTextOptions.cs +++ b/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignCarrierTextOptions.cs @@ -6,34 +6,80 @@ namespace Stripe.Issuing using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PersonalizationDesignCarrierTextOptions : INestedOptions + public class PersonalizationDesignCarrierTextOptions : INestedOptions, IHasSetTracking { + private string footerBody; + private string footerTitle; + private string headerBody; + private string headerTitle; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The footer body text of the carrier letter. /// [JsonProperty("footer_body")] [STJS.JsonPropertyName("footer_body")] - public string FooterBody { get; set; } + public string FooterBody + { + get => this.footerBody; + set + { + this.footerBody = value; + this.SetTracker.Track(); + } + } /// /// The footer title text of the carrier letter. /// [JsonProperty("footer_title")] [STJS.JsonPropertyName("footer_title")] - public string FooterTitle { get; set; } + public string FooterTitle + { + get => this.footerTitle; + set + { + this.footerTitle = value; + this.SetTracker.Track(); + } + } /// /// The header body text of the carrier letter. /// [JsonProperty("header_body")] [STJS.JsonPropertyName("header_body")] - public string HeaderBody { get; set; } + public string HeaderBody + { + get => this.headerBody; + set + { + this.headerBody = value; + this.SetTracker.Track(); + } + } /// /// The header title text of the carrier letter. /// [JsonProperty("header_title")] [STJS.JsonPropertyName("header_title")] - public string HeaderTitle { get; set; } + public string HeaderTitle + { + get => this.headerTitle; + set + { + this.headerTitle = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignUpdateOptions.cs b/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignUpdateOptions.cs index f9e360a568..eddb0a44ee 100644 --- a/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/PersonalizationDesigns/PersonalizationDesignUpdateOptions.cs @@ -9,20 +9,41 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PersonalizationDesignUpdateOptions : BaseOptions, IHasMetadata { + private string cardLogo; + private PersonalizationDesignCarrierTextOptions carrierText; + private string lookupKey; + private string name; + /// /// The file for the card logo, for use with physical bundles that support card logos. Must /// have a purpose value of issuing_logo. /// [JsonProperty("card_logo")] [STJS.JsonPropertyName("card_logo")] - public string CardLogo { get; set; } + public string CardLogo + { + get => this.cardLogo; + set + { + this.cardLogo = value; + this.SetTracker.Track(); + } + } /// /// Hash containing carrier text, for use with physical bundles that support carrier text. /// [JsonProperty("carrier_text")] [STJS.JsonPropertyName("carrier_text")] - public PersonalizationDesignCarrierTextOptions CarrierText { get; set; } + public PersonalizationDesignCarrierTextOptions CarrierText + { + get => this.carrierText; + set + { + this.carrierText = value; + this.SetTracker.Track(); + } + } /// /// A lookup key used to retrieve personalization designs dynamically from a static string. @@ -30,7 +51,15 @@ public class PersonalizationDesignUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("lookup_key")] [STJS.JsonPropertyName("lookup_key")] - public string LookupKey { get; set; } + public string LookupKey + { + get => this.lookupKey; + set + { + this.lookupKey = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -47,7 +76,15 @@ public class PersonalizationDesignUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// The physical bundle object belonging to this personalization design. diff --git a/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs index ad71e1409c..add97d8fb8 100644 --- a/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Transactions/TransactionUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Issuing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TransactionUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class TransactionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Orders/OrderCreateOptions.cs b/src/Stripe.net/Services/Orders/OrderCreateOptions.cs index 3a293d6de2..4359ceeac2 100644 --- a/src/Stripe.net/Services/Orders/OrderCreateOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderCreateOptions.cs @@ -9,6 +9,11 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class OrderCreateOptions : BaseOptions, IHasMetadata { + private OrderBillingDetailsOptions billingDetails; + private List discounts; + private OrderShippingCostOptions shippingCost; + private OrderShippingDetailsOptions shippingDetails; + /// /// Settings for automatic tax calculation for this order. /// @@ -22,7 +27,15 @@ public class OrderCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("billing_details")] [STJS.JsonPropertyName("billing_details")] - public OrderBillingDetailsOptions BillingDetails { get; set; } + public OrderBillingDetailsOptions BillingDetails + { + get => this.billingDetails; + set + { + this.billingDetails = value; + this.SetTracker.Track(); + } + } /// /// Three-letter ISO currency @@ -52,7 +65,15 @@ public class OrderCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The IP address of the purchaser for this order. @@ -91,14 +112,30 @@ public class OrderCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping_cost")] [STJS.JsonPropertyName("shipping_cost")] - public OrderShippingCostOptions ShippingCost { get; set; } + public OrderShippingCostOptions ShippingCost + { + get => this.shippingCost; + set + { + this.shippingCost = value; + this.SetTracker.Track(); + } + } /// /// Shipping details for the order. /// [JsonProperty("shipping_details")] [STJS.JsonPropertyName("shipping_details")] - public OrderShippingDetailsOptions ShippingDetails { get; set; } + public OrderShippingDetailsOptions ShippingDetails + { + get => this.shippingDetails; + set + { + this.shippingDetails = value; + this.SetTracker.Track(); + } + } /// /// Additional tax details about the purchaser to be used for this order. diff --git a/src/Stripe.net/Services/Orders/OrderLineItemOptions.cs b/src/Stripe.net/Services/Orders/OrderLineItemOptions.cs index e9b46b5184..325ab832e7 100644 --- a/src/Stripe.net/Services/Orders/OrderLineItemOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderLineItemOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderLineItemOptions : INestedOptions, IHasId + public class OrderLineItemOptions : INestedOptions, IHasId, IHasSetTracking { + private List discounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The description for the line item. Will default to the name of the associated product. /// @@ -21,7 +28,15 @@ public class OrderLineItemOptions : INestedOptions, IHasId /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The ID of an existing line item on the order. @@ -99,6 +114,19 @@ public class OrderLineItemOptions : INestedOptions, IHasId /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderLineItemProductDataOptions.cs b/src/Stripe.net/Services/Orders/OrderLineItemProductDataOptions.cs index 57e81dfca5..d94bf27f54 100644 --- a/src/Stripe.net/Services/Orders/OrderLineItemProductDataOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderLineItemProductDataOptions.cs @@ -7,8 +7,19 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetadata + public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetadata, IHasSetTracking { + private string description; + private List images; + private Dictionary metadata; + private OrderLineItemProductDataPackageDimensionsOptions packageDimensions; + private string taxCode; + private string url; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The product's description, meant to be displayable to the customer. Use this field to /// optionally store a long form explanation of the product being sold for your own @@ -16,7 +27,15 @@ public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetad /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// A unique identifier for this product. @@ -38,7 +57,15 @@ public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetad /// [JsonProperty("images")] [STJS.JsonPropertyName("images")] - public List Images { get; set; } + public List Images + { + get => this.images; + set + { + this.images = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -48,7 +75,15 @@ public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetad /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The product's name, meant to be displayable to the customer. @@ -62,7 +97,15 @@ public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetad /// [JsonProperty("package_dimensions")] [STJS.JsonPropertyName("package_dimensions")] - public OrderLineItemProductDataPackageDimensionsOptions PackageDimensions { get; set; } + public OrderLineItemProductDataPackageDimensionsOptions PackageDimensions + { + get => this.packageDimensions; + set + { + this.packageDimensions = value; + this.SetTracker.Track(); + } + } /// /// Whether this product is shipped (i.e., physical goods). @@ -76,13 +119,34 @@ public class OrderLineItemProductDataOptions : INestedOptions, IHasId, IHasMetad /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } /// /// A URL of a publicly-accessible webpage for this product. /// [JsonProperty("url")] [STJS.JsonPropertyName("url")] - public string Url { get; set; } + public string Url + { + get => this.url; + set + { + this.url = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsOptions.cs index ad0522c463..0535394b83 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsOptions.cs @@ -7,15 +7,31 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsOptions : INestedOptions + public class OrderPaymentSettingsOptions : INestedOptions, IHasSetTracking { + private long? applicationFeeAmount; + private string returnUrl; + private OrderPaymentSettingsTransferDataOptions transferData; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The amount of the application fee (if any) that will be requested to be applied to the /// payment and transferred to the application owner's Stripe account. /// [JsonProperty("application_fee_amount")] [STJS.JsonPropertyName("application_fee_amount")] - public long? ApplicationFeeAmount { get; set; } + public long? ApplicationFeeAmount + { + get => this.applicationFeeAmount; + set + { + this.applicationFeeAmount = value; + this.SetTracker.Track(); + } + } /// /// PaymentMethod-specific configuration to provide to the order's PaymentIntent. @@ -44,7 +60,15 @@ public class OrderPaymentSettingsOptions : INestedOptions /// [JsonProperty("return_url")] [STJS.JsonPropertyName("return_url")] - public string ReturnUrl { get; set; } + public string ReturnUrl + { + get => this.returnUrl; + set + { + this.returnUrl = value; + this.SetTracker.Track(); + } + } /// /// For non-card charges, you can use this value as the complete description that appears on @@ -69,6 +93,19 @@ public class OrderPaymentSettingsOptions : INestedOptions /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public OrderPaymentSettingsTransferDataOptions TransferData { get; set; } + public OrderPaymentSettingsTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs index 4438a5c866..50ceef8825 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string customMandateUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A URL for custom mandate text to render during confirmation step. The URL will be /// rendered with additional GET parameters payment_intent and @@ -17,7 +23,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOpti /// [JsonProperty("custom_mandate_url")] [STJS.JsonPropertyName("custom_mandate_url")] - public string CustomMandateUrl { get; set; } + public string CustomMandateUrl + { + get => this.customMandateUrl; + set + { + this.customMandateUrl = value; + this.SetTracker.Track(); + } + } /// /// Description of the mandate interval. Only required if 'payment_schedule' parameter is @@ -42,5 +56,10 @@ public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsOpti [JsonProperty("transaction_type")] [STJS.JsonPropertyName("transaction_type")] public string TransactionType { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions.cs index e57344dfe6..949c725073 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -42,7 +48,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions : INestedO /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -60,5 +74,10 @@ public class OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions : INestedO [JsonProperty("verification_method")] [STJS.JsonPropertyName("verification_method")] public string VerificationMethod { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAlipayOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAlipayOptions.cs index 5eade78e3f..5974dc4e0c 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAlipayOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsAlipayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsAlipayOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsAlipayOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,6 +41,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsAlipayOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsBancontactOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsBancontactOptions.cs index ec2308ef68..6086083950 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsBancontactOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsBancontactOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsBancontactOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsBancontactOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Preferred language of the Bancontact authorization page that the customer is redirected /// to. @@ -44,6 +50,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsBancontactOptions : INested /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsIdealOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsIdealOptions.cs index 0e09767107..2445013bc2 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsIdealOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsIdealOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsIdealOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsIdealOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,6 +41,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsIdealOptions : INestedOptio /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions.cs index 15073da03e..56cfed45e4 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private List subscriptions; + private OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions supplementaryPurchaseData; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -21,7 +29,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions : INestedOpti /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// On-demand details if setting up or charging an on-demand payment. @@ -79,13 +95,34 @@ public class OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions : INestedOpti /// [JsonProperty("subscriptions")] [STJS.JsonPropertyName("subscriptions")] - public List Subscriptions { get; set; } + public List Subscriptions + { + get => this.subscriptions; + set + { + this.subscriptions = value; + this.SetTracker.Track(); + } + } /// /// Supplementary Purchase Data for the corresponding Klarna payment. /// [JsonProperty("supplementary_purchase_data")] [STJS.JsonPropertyName("supplementary_purchase_data")] - public OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions SupplementaryPurchaseData { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions SupplementaryPurchaseData + { + get => this.supplementaryPurchaseData; + set + { + this.supplementaryPurchaseData = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs index 39560e5b8a..975eeb6e35 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs @@ -7,62 +7,144 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions : INestedOptions, IHasSetTracking { + private List busReservationDetails; + private List eventReservationDetails; + private List ferryReservationDetails; + private List insurances; + private List marketplaceSellers; + private List roundTripReservationDetails; + private List trainReservationDetails; + private List vouchers; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Supplementary bus reservation details. /// [JsonProperty("bus_reservation_details")] [STJS.JsonPropertyName("bus_reservation_details")] - public List BusReservationDetails { get; set; } + public List BusReservationDetails + { + get => this.busReservationDetails; + set + { + this.busReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary event reservation details. /// [JsonProperty("event_reservation_details")] [STJS.JsonPropertyName("event_reservation_details")] - public List EventReservationDetails { get; set; } + public List EventReservationDetails + { + get => this.eventReservationDetails; + set + { + this.eventReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary ferry reservation details. /// [JsonProperty("ferry_reservation_details")] [STJS.JsonPropertyName("ferry_reservation_details")] - public List FerryReservationDetails { get; set; } + public List FerryReservationDetails + { + get => this.ferryReservationDetails; + set + { + this.ferryReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary insurance details. /// [JsonProperty("insurances")] [STJS.JsonPropertyName("insurances")] - public List Insurances { get; set; } + public List Insurances + { + get => this.insurances; + set + { + this.insurances = value; + this.SetTracker.Track(); + } + } /// /// Supplementary marketplace seller details. /// [JsonProperty("marketplace_sellers")] [STJS.JsonPropertyName("marketplace_sellers")] - public List MarketplaceSellers { get; set; } + public List MarketplaceSellers + { + get => this.marketplaceSellers; + set + { + this.marketplaceSellers = value; + this.SetTracker.Track(); + } + } /// /// Supplementary round trip reservation details. /// [JsonProperty("round_trip_reservation_details")] [STJS.JsonPropertyName("round_trip_reservation_details")] - public List RoundTripReservationDetails { get; set; } + public List RoundTripReservationDetails + { + get => this.roundTripReservationDetails; + set + { + this.roundTripReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary train reservation details. /// [JsonProperty("train_reservation_details")] [STJS.JsonPropertyName("train_reservation_details")] - public List TrainReservationDetails { get; set; } + public List TrainReservationDetails + { + get => this.trainReservationDetails; + set + { + this.trainReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Voucher details, such as a gift card or discount code. /// [JsonProperty("vouchers")] [STJS.JsonPropertyName("vouchers")] - public List Vouchers { get; set; } + public List Vouchers + { + get => this.vouchers; + set + { + this.vouchers = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsLinkOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsLinkOptions.cs index ed5c048150..215d0d90ab 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsLinkOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsLinkOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsLinkOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsLinkOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -21,7 +28,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsLinkOptions : INestedOption /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// [Deprecated] This is a legacy parameter that no longer has any function. @@ -58,6 +73,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsLinkOptions : INestedOption /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsOptions.cs index 05457929b9..1db9613cf1 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsOptions.cs @@ -6,15 +6,43 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions acssDebit; + private OrderPaymentSettingsPaymentMethodOptionsAfterpayClearpayOptions afterpayClearpay; + private OrderPaymentSettingsPaymentMethodOptionsAlipayOptions alipay; + private OrderPaymentSettingsPaymentMethodOptionsBancontactOptions bancontact; + private OrderPaymentSettingsPaymentMethodOptionsCardOptions card; + private OrderPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions customerBalance; + private OrderPaymentSettingsPaymentMethodOptionsIdealOptions ideal; + private OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions klarna; + private OrderPaymentSettingsPaymentMethodOptionsLinkOptions link; + private OrderPaymentSettingsPaymentMethodOptionsOxxoOptions oxxo; + private OrderPaymentSettingsPaymentMethodOptionsP24Options p24; + private OrderPaymentSettingsPaymentMethodOptionsPaypalOptions paypal; + private OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions sepaDebit; + private OrderPaymentSettingsPaymentMethodOptionsSofortOptions sofort; + private OrderPaymentSettingsPaymentMethodOptionsWechatPayOptions wechatPay; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// If paying by acss_debit, this sub-hash contains details about the ACSS Debit /// payment method options to pass to the order's PaymentIntent. /// [JsonProperty("acss_debit")] [STJS.JsonPropertyName("acss_debit")] - public OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit + { + get => this.acssDebit; + set + { + this.acssDebit = value; + this.SetTracker.Track(); + } + } /// /// If paying by afterpay_clearpay, this sub-hash contains details about the @@ -22,7 +50,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("afterpay_clearpay")] [STJS.JsonPropertyName("afterpay_clearpay")] - public OrderPaymentSettingsPaymentMethodOptionsAfterpayClearpayOptions AfterpayClearpay { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsAfterpayClearpayOptions AfterpayClearpay + { + get => this.afterpayClearpay; + set + { + this.afterpayClearpay = value; + this.SetTracker.Track(); + } + } /// /// If paying by alipay, this sub-hash contains details about the Alipay payment @@ -30,7 +66,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("alipay")] [STJS.JsonPropertyName("alipay")] - public OrderPaymentSettingsPaymentMethodOptionsAlipayOptions Alipay { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsAlipayOptions Alipay + { + get => this.alipay; + set + { + this.alipay = value; + this.SetTracker.Track(); + } + } /// /// If paying by bancontact, this sub-hash contains details about the Bancontact @@ -38,7 +82,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("bancontact")] [STJS.JsonPropertyName("bancontact")] - public OrderPaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact + { + get => this.bancontact; + set + { + this.bancontact = value; + this.SetTracker.Track(); + } + } /// /// If paying by card, this sub-hash contains details about the Card payment method @@ -46,7 +98,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("card")] [STJS.JsonPropertyName("card")] - public OrderPaymentSettingsPaymentMethodOptionsCardOptions Card { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsCardOptions Card + { + get => this.card; + set + { + this.card = value; + this.SetTracker.Track(); + } + } /// /// If paying by customer_balance, this sub-hash contains details about the Customer @@ -54,7 +114,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("customer_balance")] [STJS.JsonPropertyName("customer_balance")] - public OrderPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance + { + get => this.customerBalance; + set + { + this.customerBalance = value; + this.SetTracker.Track(); + } + } /// /// If paying by ideal, this sub-hash contains details about the iDEAL payment method @@ -62,7 +130,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("ideal")] [STJS.JsonPropertyName("ideal")] - public OrderPaymentSettingsPaymentMethodOptionsIdealOptions Ideal { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsIdealOptions Ideal + { + get => this.ideal; + set + { + this.ideal = value; + this.SetTracker.Track(); + } + } /// /// If paying by klarna, this sub-hash contains details about the Klarna payment @@ -70,7 +146,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("klarna")] [STJS.JsonPropertyName("klarna")] - public OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions Klarna { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsKlarnaOptions Klarna + { + get => this.klarna; + set + { + this.klarna = value; + this.SetTracker.Track(); + } + } /// /// If paying by link, this sub-hash contains details about the Link payment method @@ -78,7 +162,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("link")] [STJS.JsonPropertyName("link")] - public OrderPaymentSettingsPaymentMethodOptionsLinkOptions Link { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsLinkOptions Link + { + get => this.link; + set + { + this.link = value; + this.SetTracker.Track(); + } + } /// /// If paying by oxxo, this sub-hash contains details about the OXXO payment method @@ -86,7 +178,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("oxxo")] [STJS.JsonPropertyName("oxxo")] - public OrderPaymentSettingsPaymentMethodOptionsOxxoOptions Oxxo { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsOxxoOptions Oxxo + { + get => this.oxxo; + set + { + this.oxxo = value; + this.SetTracker.Track(); + } + } /// /// If paying by p24, this sub-hash contains details about the P24 payment method @@ -94,7 +194,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("p24")] [STJS.JsonPropertyName("p24")] - public OrderPaymentSettingsPaymentMethodOptionsP24Options P24 { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsP24Options P24 + { + get => this.p24; + set + { + this.p24 = value; + this.SetTracker.Track(); + } + } /// /// If paying by paypal, this sub-hash contains details about the PayPal payment @@ -102,7 +210,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("paypal")] [STJS.JsonPropertyName("paypal")] - public OrderPaymentSettingsPaymentMethodOptionsPaypalOptions Paypal { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsPaypalOptions Paypal + { + get => this.paypal; + set + { + this.paypal = value; + this.SetTracker.Track(); + } + } /// /// If paying by sepa_debit, this sub-hash contains details about the SEPA Debit @@ -110,7 +226,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("sepa_debit")] [STJS.JsonPropertyName("sepa_debit")] - public OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit + { + get => this.sepaDebit; + set + { + this.sepaDebit = value; + this.SetTracker.Track(); + } + } /// /// If paying by sofort, this sub-hash contains details about the Sofort payment @@ -118,7 +242,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("sofort")] [STJS.JsonPropertyName("sofort")] - public OrderPaymentSettingsPaymentMethodOptionsSofortOptions Sofort { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsSofortOptions Sofort + { + get => this.sofort; + set + { + this.sofort = value; + this.SetTracker.Track(); + } + } /// /// If paying by wechat_pay, this sub-hash contains details about the WeChat Pay @@ -126,6 +258,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("wechat_pay")] [STJS.JsonPropertyName("wechat_pay")] - public OrderPaymentSettingsPaymentMethodOptionsWechatPayOptions WechatPay { get; set; } + public OrderPaymentSettingsPaymentMethodOptionsWechatPayOptions WechatPay + { + get => this.wechatPay; + set + { + this.wechatPay = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsPaypalOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsPaypalOptions.cs index 02e1ee3252..f31989b696 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsPaypalOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsPaypalOptions.cs @@ -7,14 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsPaypalOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsPaypalOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds will be captured from the customer's account. /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// The line items purchased by the customer. @@ -87,7 +102,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsPaypalOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// The Stripe connected account IDs of the sellers on the platform for this transaction @@ -98,5 +121,10 @@ public class OrderPaymentSettingsPaymentMethodOptionsPaypalOptions : INestedOpti [JsonProperty("subsellers")] [STJS.JsonPropertyName("subsellers")] public List Subsellers { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs index 76fafcb92d..ad00c4d8b2 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitMandateOptionsOpti /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions.cs index 008e4a524f..e6a6434d41 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -42,7 +48,15 @@ public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions : INestedO /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -52,5 +66,10 @@ public class OrderPaymentSettingsPaymentMethodOptionsSepaDebitOptions : INestedO [JsonProperty("target_date")] [STJS.JsonPropertyName("target_date")] public string TargetDate { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSofortOptions.cs b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSofortOptions.cs index 0234354064..5c1db7fc3a 100644 --- a/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSofortOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderPaymentSettingsPaymentMethodOptionsSofortOptions.cs @@ -6,15 +6,30 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderPaymentSettingsPaymentMethodOptionsSofortOptions : INestedOptions + public class OrderPaymentSettingsPaymentMethodOptionsSofortOptions : INestedOptions, IHasSetTracking { + private string preferredLanguage; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Language shown to the payer on redirect. /// One of: de, en, es, fr, it, nl, or pl. /// [JsonProperty("preferred_language")] [STJS.JsonPropertyName("preferred_language")] - public string PreferredLanguage { get; set; } + public string PreferredLanguage + { + get => this.preferredLanguage; + set + { + this.preferredLanguage = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -43,6 +58,19 @@ public class OrderPaymentSettingsPaymentMethodOptionsSofortOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderShippingDetailsOptions.cs b/src/Stripe.net/Services/Orders/OrderShippingDetailsOptions.cs index 8f9f736526..55b0c26c69 100644 --- a/src/Stripe.net/Services/Orders/OrderShippingDetailsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderShippingDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderShippingDetailsOptions : INestedOptions + public class OrderShippingDetailsOptions : INestedOptions, IHasSetTracking { + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The shipping address for the order. /// @@ -27,6 +33,19 @@ public class OrderShippingDetailsOptions : INestedOptions /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderTaxDetailsOptions.cs b/src/Stripe.net/Services/Orders/OrderTaxDetailsOptions.cs index 2f854dcdfa..63593f5d84 100644 --- a/src/Stripe.net/Services/Orders/OrderTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderTaxDetailsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OrderTaxDetailsOptions : INestedOptions + public class OrderTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxExempt; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The purchaser's tax exemption status. One of none, exempt, or /// reverse. @@ -16,7 +22,15 @@ public class OrderTaxDetailsOptions : INestedOptions /// [JsonProperty("tax_exempt")] [STJS.JsonPropertyName("tax_exempt")] - public string TaxExempt { get; set; } + public string TaxExempt + { + get => this.taxExempt; + set + { + this.taxExempt = value; + this.SetTracker.Track(); + } + } /// /// The purchaser's tax IDs to be used for this order. @@ -24,5 +38,10 @@ public class OrderTaxDetailsOptions : INestedOptions [JsonProperty("tax_ids")] [STJS.JsonPropertyName("tax_ids")] public List TaxIds { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs b/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs index 827d99c4fe..1fcb1ef285 100644 --- a/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs +++ b/src/Stripe.net/Services/Orders/OrderUpdateOptions.cs @@ -9,6 +9,13 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class OrderUpdateOptions : BaseOptions, IHasMetadata { + private OrderBillingDetailsOptions billingDetails; + private string description; + private List discounts; + private Dictionary metadata; + private OrderShippingCostOptions shippingCost; + private OrderShippingDetailsOptions shippingDetails; + /// /// Settings for automatic tax calculation for this order. /// @@ -22,7 +29,15 @@ public class OrderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("billing_details")] [STJS.JsonPropertyName("billing_details")] - public OrderBillingDetailsOptions BillingDetails { get; set; } + public OrderBillingDetailsOptions BillingDetails + { + get => this.billingDetails; + set + { + this.billingDetails = value; + this.SetTracker.Track(); + } + } /// /// Three-letter ISO currency @@ -45,7 +60,15 @@ public class OrderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The coupons, promotion codes, and/or discounts to apply to the order. Pass the empty @@ -53,7 +76,15 @@ public class OrderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The IP address of the purchaser for this order. @@ -78,7 +109,15 @@ public class OrderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Payment information associated with the order, including payment settings. @@ -92,14 +131,30 @@ public class OrderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("shipping_cost")] [STJS.JsonPropertyName("shipping_cost")] - public OrderShippingCostOptions ShippingCost { get; set; } + public OrderShippingCostOptions ShippingCost + { + get => this.shippingCost; + set + { + this.shippingCost = value; + this.SetTracker.Track(); + } + } /// /// Shipping details for the order. /// [JsonProperty("shipping_details")] [STJS.JsonPropertyName("shipping_details")] - public OrderShippingDetailsOptions ShippingDetails { get; set; } + public OrderShippingDetailsOptions ShippingDetails + { + get => this.shippingDetails; + set + { + this.shippingDetails = value; + this.SetTracker.Track(); + } + } /// /// Additional tax details about the purchaser to be used for this order. diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsOptions.cs index b35133e878..8b91928b09 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsOptions.cs @@ -7,8 +7,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentAmountDetailsOptions : INestedOptions + public class PaymentIntentAmountDetailsOptions : INestedOptions, IHasSetTracking { + private long? discountAmount; + private List lineItems; + private PaymentIntentAmountDetailsShippingOptions shipping; + private PaymentIntentAmountDetailsSurchargeOptions surcharge; + private PaymentIntentAmountDetailsTaxOptions tax; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The total discount applied on the transaction represented in the smallest currency unit. An @@ -19,7 +29,15 @@ public class PaymentIntentAmountDetailsOptions : INestedOptions /// [JsonProperty("discount_amount")] [STJS.JsonPropertyName("discount_amount")] - public long? DiscountAmount { get; set; } + public long? DiscountAmount + { + get => this.discountAmount; + set + { + this.discountAmount = value; + this.SetTracker.Track(); + } + } /// /// Set to false to return arithmetic validation errors in the response without @@ -43,27 +61,64 @@ public class PaymentIntentAmountDetailsOptions : INestedOptions /// [JsonProperty("line_items")] [STJS.JsonPropertyName("line_items")] - public List LineItems { get; set; } + public List LineItems + { + get => this.lineItems; + set + { + this.lineItems = value; + this.SetTracker.Track(); + } + } /// /// Contains information about the shipping portion of the amount. /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public PaymentIntentAmountDetailsShippingOptions Shipping { get; set; } + public PaymentIntentAmountDetailsShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } /// /// Contains information about the surcharge portion of the amount. /// [JsonProperty("surcharge")] [STJS.JsonPropertyName("surcharge")] - public PaymentIntentAmountDetailsSurchargeOptions Surcharge { get; set; } + public PaymentIntentAmountDetailsSurchargeOptions Surcharge + { + get => this.surcharge; + set + { + this.surcharge = value; + this.SetTracker.Track(); + } + } /// /// Contains information about the tax portion of the amount. /// [JsonProperty("tax")] [STJS.JsonPropertyName("tax")] - public PaymentIntentAmountDetailsTaxOptions Tax { get; set; } + public PaymentIntentAmountDetailsTaxOptions Tax + { + get => this.tax; + set + { + this.tax = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsShippingOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsShippingOptions.cs index 7bfd81bae8..4294c947b4 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsShippingOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsShippingOptions.cs @@ -6,8 +6,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentAmountDetailsShippingOptions : INestedOptions + public class PaymentIntentAmountDetailsShippingOptions : INestedOptions, IHasSetTracking { + private long? amount; + private string fromPostalCode; + private string toPostalCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// If a physical good is being shipped, the cost of shipping represented in the smallest currency unit. An @@ -15,7 +23,15 @@ public class PaymentIntentAmountDetailsShippingOptions : INestedOptions /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// If a physical good is being shipped, the postal code of where it is being shipped from. @@ -23,7 +39,15 @@ public class PaymentIntentAmountDetailsShippingOptions : INestedOptions /// [JsonProperty("from_postal_code")] [STJS.JsonPropertyName("from_postal_code")] - public string FromPostalCode { get; set; } + public string FromPostalCode + { + get => this.fromPostalCode; + set + { + this.fromPostalCode = value; + this.SetTracker.Track(); + } + } /// /// If a physical good is being shipped, the postal code of where it is being shipped to. At @@ -31,6 +55,19 @@ public class PaymentIntentAmountDetailsShippingOptions : INestedOptions /// [JsonProperty("to_postal_code")] [STJS.JsonPropertyName("to_postal_code")] - public string ToPostalCode { get; set; } + public string ToPostalCode + { + get => this.toPostalCode; + set + { + this.toPostalCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsSurchargeOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsSurchargeOptions.cs index 4cd7d21387..1acc7fc73b 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsSurchargeOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentAmountDetailsSurchargeOptions.cs @@ -6,14 +6,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentAmountDetailsSurchargeOptions : INestedOptions + public class PaymentIntentAmountDetailsSurchargeOptions : INestedOptions, IHasSetTracking { + private long? amount; + private string enforceValidation; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Portion of the amount that corresponds to a surcharge. /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// Indicate whether to enforce validations on the surcharge amount. @@ -21,6 +36,19 @@ public class PaymentIntentAmountDetailsSurchargeOptions : INestedOptions /// [JsonProperty("enforce_validation")] [STJS.JsonPropertyName("enforce_validation")] - public string EnforceValidation { get; set; } + public string EnforceValidation + { + get => this.enforceValidation; + set + { + this.enforceValidation = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCaptureOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCaptureOptions.cs index 8576db2c48..9ac195a0c0 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCaptureOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCaptureOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentCaptureOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + private PaymentIntentPaymentDetailsOptions paymentDetails; + /// /// Provides industry-specific information about the amount. /// @@ -62,14 +65,30 @@ public class PaymentIntentCaptureOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Provides industry-specific information about the charge. /// [JsonProperty("payment_details")] [STJS.JsonPropertyName("payment_details")] - public PaymentIntentPaymentDetailsOptions PaymentDetails { get; set; } + public PaymentIntentPaymentDetailsOptions PaymentDetails + { + get => this.paymentDetails; + set + { + this.paymentDetails = value; + this.SetTracker.Track(); + } + } /// /// Text that appears on the customer's statement as the statement descriptor for a non-card diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentConfirmOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentConfirmOptions.cs index 70af1e4389..65d379823b 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentConfirmOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentConfirmOptions.cs @@ -9,12 +9,29 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentConfirmOptions : BaseOptions { + private PaymentIntentAmountDetailsOptions amountDetails; + private long? applicationFeeAmount; + private List excludedPaymentMethodTypes; + private PaymentIntentMandateDataOptions mandateData; + private PaymentIntentPaymentDetailsOptions paymentDetails; + private string receiptEmail; + private string setupFutureUsage; + private ChargeShippingOptions shipping; + /// /// Provides industry-specific information about the amount. /// [JsonProperty("amount_details")] [STJS.JsonPropertyName("amount_details")] - public PaymentIntentAmountDetailsOptions AmountDetails { get; set; } + public PaymentIntentAmountDetailsOptions AmountDetails + { + get => this.amountDetails; + set + { + this.amountDetails = value; + this.SetTracker.Track(); + } + } /// /// The amount of the application fee (if any) that will be requested to be applied to the @@ -26,7 +43,15 @@ public class PaymentIntentConfirmOptions : BaseOptions /// [JsonProperty("application_fee_amount")] [STJS.JsonPropertyName("application_fee_amount")] - public long? ApplicationFeeAmount { get; set; } + public long? ApplicationFeeAmount + { + get => this.applicationFeeAmount; + set + { + this.applicationFeeAmount = value; + this.SetTracker.Track(); + } + } /// /// Controls when the funds will be captured from the customer's account. @@ -79,7 +104,15 @@ public class PaymentIntentConfirmOptions : BaseOptions /// [JsonProperty("excluded_payment_method_types")] [STJS.JsonPropertyName("excluded_payment_method_types")] - public List ExcludedPaymentMethodTypes { get; set; } + public List ExcludedPaymentMethodTypes + { + get => this.excludedPaymentMethodTypes; + set + { + this.excludedPaymentMethodTypes = value; + this.SetTracker.Track(); + } + } /// /// The FX rate in the quote is validated and used to convert the presentment amount to the @@ -105,7 +138,15 @@ public class PaymentIntentConfirmOptions : BaseOptions [JsonProperty("mandate_data")] [STJS.JsonPropertyName("mandate_data")] - public PaymentIntentMandateDataOptions MandateData { get; set; } + public PaymentIntentMandateDataOptions MandateData + { + get => this.mandateData; + set + { + this.mandateData = value; + this.SetTracker.Track(); + } + } /// /// Set to true to indicate that the customer isn't in your checkout flow during this @@ -123,7 +164,15 @@ public class PaymentIntentConfirmOptions : BaseOptions /// [JsonProperty("payment_details")] [STJS.JsonPropertyName("payment_details")] - public PaymentIntentPaymentDetailsOptions PaymentDetails { get; set; } + public PaymentIntentPaymentDetailsOptions PaymentDetails + { + get => this.paymentDetails; + set + { + this.paymentDetails = value; + this.SetTracker.Track(); + } + } /// /// ID of the payment method (a PaymentMethod, Card, or [JsonProperty("receipt_email")] [STJS.JsonPropertyName("receipt_email")] - public string ReceiptEmail { get; set; } + public string ReceiptEmail + { + get => this.receiptEmail; + set + { + this.receiptEmail = value; + this.SetTracker.Track(); + } + } /// /// The URL to redirect your customer back to after they authenticate or cancel their @@ -220,14 +277,30 @@ public class PaymentIntentConfirmOptions : BaseOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Shipping information for this PaymentIntent. /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public ChargeShippingOptions Shipping { get; set; } + public ChargeShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } /// /// Set to true when confirming server-side and using Stripe.js, iOS, or Android diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs index a0d58b478d..a092142e79 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentCreateOptions : BaseOptions, IHasMetadata { + private PaymentIntentMandateDataOptions mandateData; + /// /// Amount intended to be collected by this PaymentIntent. A positive integer representing /// how much to charge in the [JsonProperty("mandate_data")] [STJS.JsonPropertyName("mandate_data")] - public PaymentIntentMandateDataOptions MandateData { get; set; } + public PaymentIntentMandateDataOptions MandateData + { + get => this.mandateData; + set + { + this.mandateData = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentHooksInputsTaxOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentHooksInputsTaxOptions.cs index f7721e7bda..65e3555009 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentHooksInputsTaxOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentHooksInputsTaxOptions.cs @@ -6,13 +6,32 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentHooksInputsTaxOptions : INestedOptions + public class PaymentIntentHooksInputsTaxOptions : INestedOptions, IHasSetTracking { + private string calculation; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The TaxCalculation id. /// [JsonProperty("calculation")] [STJS.JsonPropertyName("calculation")] - public string Calculation { get; set; } + public string Calculation + { + get => this.calculation; + set + { + this.calculation = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsOptions.cs index f99a3cd41d..ab056a9d15 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentDetailsOptions.cs @@ -7,8 +7,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentDetailsOptions : INestedOptions + public class PaymentIntentPaymentDetailsOptions : INestedOptions, IHasSetTracking { + private List carRentalData; + private string customerReference; + private List flightData; + private List lodgingData; + private string orderReference; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Car rental details for this PaymentIntent. /// @@ -21,7 +31,15 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions /// [JsonProperty("car_rental_data")] [STJS.JsonPropertyName("car_rental_data")] - public List CarRentalData { get; set; } + public List CarRentalData + { + get => this.carRentalData; + set + { + this.carRentalData = value; + this.SetTracker.Track(); + } + } /// /// A unique value to identify the customer. This field is available only for card payments. @@ -31,7 +49,15 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions /// [JsonProperty("customer_reference")] [STJS.JsonPropertyName("customer_reference")] - public string CustomerReference { get; set; } + public string CustomerReference + { + get => this.customerReference; + set + { + this.customerReference = value; + this.SetTracker.Track(); + } + } /// /// Event details for this PaymentIntent. @@ -52,7 +78,15 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions /// [JsonProperty("flight_data")] [STJS.JsonPropertyName("flight_data")] - public List FlightData { get; set; } + public List FlightData + { + get => this.flightData; + set + { + this.flightData = value; + this.SetTracker.Track(); + } + } /// /// Lodging reservation details for this PaymentIntent. @@ -66,7 +100,15 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions /// [JsonProperty("lodging_data")] [STJS.JsonPropertyName("lodging_data")] - public List LodgingData { get; set; } + public List LodgingData + { + get => this.lodgingData; + set + { + this.lodgingData = value; + this.SetTracker.Track(); + } + } /// /// A unique value assigned by the business to identify the transaction. Required for L2 and @@ -78,7 +120,15 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions /// [JsonProperty("order_reference")] [STJS.JsonPropertyName("order_reference")] - public string OrderReference { get; set; } + public string OrderReference + { + get => this.orderReference; + set + { + this.orderReference = value; + this.SetTracker.Track(); + } + } /// /// Subscription details for this PaymentIntent. @@ -86,5 +136,10 @@ public class PaymentIntentPaymentDetailsOptions : INestedOptions [JsonProperty("subscription")] [STJS.JsonPropertyName("subscription")] public PaymentIntentPaymentDetailsSubscriptionOptions Subscription { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodDataBillingDetailsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodDataBillingDetailsOptions.cs index 771bcfe074..f624e5bc00 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodDataBillingDetailsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodDataBillingDetailsOptions.cs @@ -6,35 +6,76 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodDataBillingDetailsOptions : INestedOptions + public class PaymentIntentPaymentMethodDataBillingDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private string email; + private string name; + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Billing address. /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// Email address. /// [JsonProperty("email")] [STJS.JsonPropertyName("email")] - public string Email { get; set; } + public string Email + { + get => this.email; + set + { + this.email = value; + this.SetTracker.Track(); + } + } /// /// Full name. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// Billing phone number (including extension). /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } /// /// Taxpayer identification number. Used only for transactions between LATAM buyers and @@ -43,5 +84,10 @@ public class PaymentIntentPaymentMethodDataBillingDetailsOptions : INestedOption [JsonProperty("tax_id")] [STJS.JsonPropertyName("tax_id")] public string TaxId { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs index 8d1f720520..61779a6d8e 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string customMandateUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A URL for custom mandate text to render during confirmation step. The URL will be /// rendered with additional GET parameters payment_intent and @@ -17,7 +23,15 @@ public class PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : I /// [JsonProperty("custom_mandate_url")] [STJS.JsonPropertyName("custom_mandate_url")] - public string CustomMandateUrl { get; set; } + public string CustomMandateUrl + { + get => this.customMandateUrl; + set + { + this.customMandateUrl = value; + this.SetTracker.Track(); + } + } /// /// Description of the mandate interval. Only required if 'payment_schedule' parameter is @@ -42,5 +56,10 @@ public class PaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : I [JsonProperty("transaction_type")] [STJS.JsonPropertyName("transaction_type")] public string TransactionType { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitOptions.cs index ff4d1d794b..4f800d4108 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAcssDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAcssDebitOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAcssDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -42,7 +48,15 @@ public class PaymentIntentPaymentMethodOptionsAcssDebitOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -60,5 +74,10 @@ public class PaymentIntentPaymentMethodOptionsAcssDebitOptions : INestedOptions [JsonProperty("verification_method")] [STJS.JsonPropertyName("verification_method")] public string VerificationMethod { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAffirmOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAffirmOptions.cs index f07f2c732f..48006b1a42 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAffirmOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAffirmOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAffirmOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAffirmOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +26,15 @@ public class PaymentIntentPaymentMethodOptionsAffirmOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Preferred language of the Affirm authorization page that the customer is redirected to. @@ -56,5 +70,10 @@ public class PaymentIntentPaymentMethodOptionsAffirmOptions : INestedOptions [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] public string SetupFutureUsage { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions.cs index 9b19d89a82..532b62a13a 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +26,15 @@ public class PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions : INestedO /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// An internal identifier or reference that this payment corresponds to. You must limit the @@ -58,5 +72,10 @@ public class PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions : INestedO [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] public string SetupFutureUsage { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlipayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlipayOptions.cs index 8a3f208889..b074844ac8 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlipayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlipayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAlipayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAlipayOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,6 +41,19 @@ public class PaymentIntentPaymentMethodOptionsAlipayOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlmaOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlmaOptions.cs index 2ce85fa4da..d0eaed3eda 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlmaOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAlmaOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAlmaOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAlmaOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsAlmaOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAmazonPayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAmazonPayOptions.cs index 86bba8ebe3..35409bb4d9 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAmazonPayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAmazonPayOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAmazonPayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAmazonPayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsAmazonPayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -45,6 +60,19 @@ public class PaymentIntentPaymentMethodOptionsAmazonPayOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAuBecsDebitOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAuBecsDebitOptions.cs index e92a2af925..c1010b99c0 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAuBecsDebitOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsAuBecsDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsAuBecsDebitOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsAuBecsDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,7 +41,15 @@ public class PaymentIntentPaymentMethodOptionsAuBecsDebitOptions : INestedOption /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -45,5 +59,10 @@ public class PaymentIntentPaymentMethodOptionsAuBecsDebitOptions : INestedOption [JsonProperty("target_date")] [STJS.JsonPropertyName("target_date")] public string TargetDate { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs index e5410770fe..466f931afc 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : I /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitOptions.cs index a9ffbbcccc..4cba53fc46 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBacsDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBacsDebitOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBacsDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -42,7 +48,15 @@ public class PaymentIntentPaymentMethodOptionsBacsDebitOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -52,5 +66,10 @@ public class PaymentIntentPaymentMethodOptionsBacsDebitOptions : INestedOptions [JsonProperty("target_date")] [STJS.JsonPropertyName("target_date")] public string TargetDate { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBancontactOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBancontactOptions.cs index 8410cf99bb..39cf7f0e5a 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBancontactOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBancontactOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBancontactOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBancontactOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Preferred language of the Bancontact authorization page that the customer is redirected /// to. @@ -44,6 +50,19 @@ public class PaymentIntentPaymentMethodOptionsBancontactOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBillieOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBillieOptions.cs index f698899782..818424babc 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBillieOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBillieOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBillieOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBillieOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsBillieOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBlikOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBlikOptions.cs index 9a74cc13e4..1bf0a103d5 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBlikOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBlikOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBlikOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBlikOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The 6-digit BLIK code that a customer has generated using their banking application. Can /// only be set on confirmation. @@ -42,6 +48,19 @@ public class PaymentIntentPaymentMethodOptionsBlikOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBoletoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBoletoOptions.cs index cba5d0f871..909cd224a3 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBoletoOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsBoletoOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsBoletoOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsBoletoOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The number of calendar days before a Boleto voucher expires. For example, if you create /// a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will @@ -44,6 +50,19 @@ public class PaymentIntentPaymentMethodOptionsBoletoOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardInstallmentsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardInstallmentsOptions.cs index 7bc79c3714..4567d74d0c 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardInstallmentsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardInstallmentsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardInstallmentsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsCardInstallmentsOptions : INestedOptions, IHasSetTracking { + private PaymentIntentPaymentMethodOptionsCardInstallmentsPlanOptions plan; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Setting to true enables installments for this PaymentIntent. This will cause the /// response to contain a list of available installment plans. Setting to false will prevent @@ -23,6 +29,19 @@ public class PaymentIntentPaymentMethodOptionsCardInstallmentsOptions : INestedO /// [JsonProperty("plan")] [STJS.JsonPropertyName("plan")] - public PaymentIntentPaymentMethodOptionsCardInstallmentsPlanOptions Plan { get; set; } + public PaymentIntentPaymentMethodOptionsCardInstallmentsPlanOptions Plan + { + get => this.plan; + set + { + this.plan = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs index 3dbdb3c2d2..39d166aaac 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs @@ -6,8 +6,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + private string statementDescriptorSuffixKana; + private string statementDescriptorSuffixKanji; + private PaymentIntentPaymentMethodOptionsCardStatementDetailsOptions statementDetails; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +30,15 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// A single-use cvc_update Token that represents a card CVC value. When provided, @@ -176,7 +194,15 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Provides information about a card payment that customers see on their statements. @@ -187,7 +213,15 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions /// [JsonProperty("statement_descriptor_suffix_kana")] [STJS.JsonPropertyName("statement_descriptor_suffix_kana")] - public string StatementDescriptorSuffixKana { get; set; } + public string StatementDescriptorSuffixKana + { + get => this.statementDescriptorSuffixKana; + set + { + this.statementDescriptorSuffixKana = value; + this.SetTracker.Track(); + } + } /// /// Provides information about a card payment that customers see on their statements. @@ -198,7 +232,15 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions /// [JsonProperty("statement_descriptor_suffix_kanji")] [STJS.JsonPropertyName("statement_descriptor_suffix_kanji")] - public string StatementDescriptorSuffixKanji { get; set; } + public string StatementDescriptorSuffixKanji + { + get => this.statementDescriptorSuffixKanji; + set + { + this.statementDescriptorSuffixKanji = value; + this.SetTracker.Track(); + } + } /// /// Statement details for this payment intent. You can use this to override the merchant @@ -206,7 +248,15 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions /// [JsonProperty("statement_details")] [STJS.JsonPropertyName("statement_details")] - public PaymentIntentPaymentMethodOptionsCardStatementDetailsOptions StatementDetails { get; set; } + public PaymentIntentPaymentMethodOptionsCardStatementDetailsOptions StatementDetails + { + get => this.statementDetails; + set + { + this.statementDetails = value; + this.SetTracker.Track(); + } + } /// /// If 3D Secure authentication was performed with a third-party provider, the @@ -215,5 +265,10 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions [JsonProperty("three_d_secure")] [STJS.JsonPropertyName("three_d_secure")] public PaymentIntentPaymentMethodOptionsCardThreeDSecureOptions ThreeDSecure { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCashappOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCashappOptions.cs index 4d68310bc5..3458ee7dd7 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCashappOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCashappOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCashappOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsCashappOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsCashappOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -49,6 +64,19 @@ public class PaymentIntentPaymentMethodOptionsCashappOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsIdealOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsIdealOptions.cs index af15b77e8b..6e2f5af47d 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsIdealOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsIdealOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsIdealOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsIdealOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,6 +41,19 @@ public class PaymentIntentPaymentMethodOptionsIdealOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKakaoPayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKakaoPayOptions.cs index b995dc7c7d..ed779d29a3 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKakaoPayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKakaoPayOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsKakaoPayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsKakaoPayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsKakaoPayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -45,6 +60,19 @@ public class PaymentIntentPaymentMethodOptionsKakaoPayOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaOptions.cs index a428b9c44d..457874891f 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsKlarnaOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsKlarnaOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private List subscriptions; + private PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions supplementaryPurchaseData; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -21,7 +29,15 @@ public class PaymentIntentPaymentMethodOptionsKlarnaOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// On-demand details if setting up or charging an on-demand payment. @@ -79,13 +95,34 @@ public class PaymentIntentPaymentMethodOptionsKlarnaOptions : INestedOptions /// [JsonProperty("subscriptions")] [STJS.JsonPropertyName("subscriptions")] - public List Subscriptions { get; set; } + public List Subscriptions + { + get => this.subscriptions; + set + { + this.subscriptions = value; + this.SetTracker.Track(); + } + } /// /// Supplementary Purchase Data for the corresponding Klarna payment. /// [JsonProperty("supplementary_purchase_data")] [STJS.JsonPropertyName("supplementary_purchase_data")] - public PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions SupplementaryPurchaseData { get; set; } + public PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions SupplementaryPurchaseData + { + get => this.supplementaryPurchaseData; + set + { + this.supplementaryPurchaseData = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs index 0f333bde22..2358e9afba 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions.cs @@ -7,62 +7,144 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsKlarnaSupplementaryPurchaseDataOptions : INestedOptions, IHasSetTracking { + private List busReservationDetails; + private List eventReservationDetails; + private List ferryReservationDetails; + private List insurances; + private List marketplaceSellers; + private List roundTripReservationDetails; + private List trainReservationDetails; + private List vouchers; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Supplementary bus reservation details. /// [JsonProperty("bus_reservation_details")] [STJS.JsonPropertyName("bus_reservation_details")] - public List BusReservationDetails { get; set; } + public List BusReservationDetails + { + get => this.busReservationDetails; + set + { + this.busReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary event reservation details. /// [JsonProperty("event_reservation_details")] [STJS.JsonPropertyName("event_reservation_details")] - public List EventReservationDetails { get; set; } + public List EventReservationDetails + { + get => this.eventReservationDetails; + set + { + this.eventReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary ferry reservation details. /// [JsonProperty("ferry_reservation_details")] [STJS.JsonPropertyName("ferry_reservation_details")] - public List FerryReservationDetails { get; set; } + public List FerryReservationDetails + { + get => this.ferryReservationDetails; + set + { + this.ferryReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary insurance details. /// [JsonProperty("insurances")] [STJS.JsonPropertyName("insurances")] - public List Insurances { get; set; } + public List Insurances + { + get => this.insurances; + set + { + this.insurances = value; + this.SetTracker.Track(); + } + } /// /// Supplementary marketplace seller details. /// [JsonProperty("marketplace_sellers")] [STJS.JsonPropertyName("marketplace_sellers")] - public List MarketplaceSellers { get; set; } + public List MarketplaceSellers + { + get => this.marketplaceSellers; + set + { + this.marketplaceSellers = value; + this.SetTracker.Track(); + } + } /// /// Supplementary round trip reservation details. /// [JsonProperty("round_trip_reservation_details")] [STJS.JsonPropertyName("round_trip_reservation_details")] - public List RoundTripReservationDetails { get; set; } + public List RoundTripReservationDetails + { + get => this.roundTripReservationDetails; + set + { + this.roundTripReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Supplementary train reservation details. /// [JsonProperty("train_reservation_details")] [STJS.JsonPropertyName("train_reservation_details")] - public List TrainReservationDetails { get; set; } + public List TrainReservationDetails + { + get => this.trainReservationDetails; + set + { + this.trainReservationDetails = value; + this.SetTracker.Track(); + } + } /// /// Voucher details, such as a gift card or discount code. /// [JsonProperty("vouchers")] [STJS.JsonPropertyName("vouchers")] - public List Vouchers { get; set; } + public List Vouchers + { + get => this.vouchers; + set + { + this.vouchers = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKonbiniOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKonbiniOptions.cs index 7f3fca9799..2c822a27c0 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKonbiniOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKonbiniOptions.cs @@ -7,8 +7,17 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions, IHasSetTracking { + private string confirmationNumber; + private long? expiresAfterDays; + private DateTime? expiresAt; + private string productDescription; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// An optional 10 to 11 digit numeric-only string determining the confirmation code at /// applicable convenience stores. Must not consist of only zeroes and could be rejected in @@ -16,7 +25,15 @@ public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions /// [JsonProperty("confirmation_number")] [STJS.JsonPropertyName("confirmation_number")] - public string ConfirmationNumber { get; set; } + public string ConfirmationNumber + { + get => this.confirmationNumber; + set + { + this.confirmationNumber = value; + this.SetTracker.Track(); + } + } /// /// The number of calendar days (between 1 and 60) after which Konbini payment instructions @@ -26,7 +43,15 @@ public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions /// [JsonProperty("expires_after_days")] [STJS.JsonPropertyName("expires_after_days")] - public long? ExpiresAfterDays { get; set; } + public long? ExpiresAfterDays + { + get => this.expiresAfterDays; + set + { + this.expiresAfterDays = value; + this.SetTracker.Track(); + } + } /// /// The timestamp at which the Konbini payment instructions will expire. Only one of @@ -36,7 +61,15 @@ public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions [JsonConverter(typeof(UnixDateTimeConverter))] [STJS.JsonPropertyName("expires_at")] [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ExpiresAt { get; set; } + public DateTime? ExpiresAt + { + get => this.expiresAt; + set + { + this.expiresAt = value; + this.SetTracker.Track(); + } + } /// /// A product descriptor of up to 22 characters, which will appear to customers at the @@ -44,7 +77,15 @@ public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions /// [JsonProperty("product_description")] [STJS.JsonPropertyName("product_description")] - public string ProductDescription { get; set; } + public string ProductDescription + { + get => this.productDescription; + set + { + this.productDescription = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -73,5 +114,10 @@ public class PaymentIntentPaymentMethodOptionsKonbiniOptions : INestedOptions [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] public string SetupFutureUsage { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKrCardOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKrCardOptions.cs index aa03fe8d0b..6a675a7731 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKrCardOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsKrCardOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsKrCardOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsKrCardOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsKrCardOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -45,6 +60,19 @@ public class PaymentIntentPaymentMethodOptionsKrCardOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsLinkOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsLinkOptions.cs index b05910e26b..bfbfd30725 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsLinkOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsLinkOptions.cs @@ -7,8 +7,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsLinkOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsLinkOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -21,7 +28,15 @@ public class PaymentIntentPaymentMethodOptionsLinkOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// [Deprecated] This is a legacy parameter that no longer has any function. @@ -58,6 +73,19 @@ public class PaymentIntentPaymentMethodOptionsLinkOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsMobilepayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsMobilepayOptions.cs index 46a9f22bf6..5c5c727bb7 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsMobilepayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsMobilepayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsMobilepayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsMobilepayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +26,15 @@ public class PaymentIntentPaymentMethodOptionsMobilepayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -49,5 +63,10 @@ public class PaymentIntentPaymentMethodOptionsMobilepayOptions : INestedOptions [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] public string SetupFutureUsage { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNaverPayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNaverPayOptions.cs index 17df8f851b..845747ab40 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNaverPayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNaverPayOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsNaverPayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsNaverPayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsNaverPayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -45,6 +60,19 @@ public class PaymentIntentPaymentMethodOptionsNaverPayOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNzBankAccountOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNzBankAccountOptions.cs index 1596788735..34186b2eac 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNzBankAccountOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsNzBankAccountOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsNzBankAccountOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsNzBankAccountOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,7 +41,15 @@ public class PaymentIntentPaymentMethodOptionsNzBankAccountOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -45,5 +59,10 @@ public class PaymentIntentPaymentMethodOptionsNzBankAccountOptions : INestedOpti [JsonProperty("target_date")] [STJS.JsonPropertyName("target_date")] public string TargetDate { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsOptions.cs index 3469267ff2..4efdf6c31a 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsOptions.cs @@ -6,15 +6,87 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private PaymentIntentPaymentMethodOptionsAcssDebitOptions acssDebit; + private PaymentIntentPaymentMethodOptionsAffirmOptions affirm; + private PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions afterpayClearpay; + private PaymentIntentPaymentMethodOptionsAlipayOptions alipay; + private PaymentIntentPaymentMethodOptionsAlmaOptions alma; + private PaymentIntentPaymentMethodOptionsAmazonPayOptions amazonPay; + private PaymentIntentPaymentMethodOptionsAuBecsDebitOptions auBecsDebit; + private PaymentIntentPaymentMethodOptionsBacsDebitOptions bacsDebit; + private PaymentIntentPaymentMethodOptionsBancontactOptions bancontact; + private PaymentIntentPaymentMethodOptionsBillieOptions billie; + private PaymentIntentPaymentMethodOptionsBlikOptions blik; + private PaymentIntentPaymentMethodOptionsBoletoOptions boleto; + private PaymentIntentPaymentMethodOptionsCardPresentOptions cardPresent; + private PaymentIntentPaymentMethodOptionsCashappOptions cashapp; + private PaymentIntentPaymentMethodOptionsCryptoOptions crypto; + private PaymentIntentPaymentMethodOptionsCustomerBalanceOptions customerBalance; + private PaymentIntentPaymentMethodOptionsEpsOptions eps; + private PaymentIntentPaymentMethodOptionsFpxOptions fpx; + private PaymentIntentPaymentMethodOptionsGiropayOptions giropay; + private PaymentIntentPaymentMethodOptionsGopayOptions gopay; + private PaymentIntentPaymentMethodOptionsGrabpayOptions grabpay; + private PaymentIntentPaymentMethodOptionsIdBankTransferOptions idBankTransfer; + private PaymentIntentPaymentMethodOptionsIdealOptions ideal; + private PaymentIntentPaymentMethodOptionsInteracPresentOptions interacPresent; + private PaymentIntentPaymentMethodOptionsKakaoPayOptions kakaoPay; + private PaymentIntentPaymentMethodOptionsKlarnaOptions klarna; + private PaymentIntentPaymentMethodOptionsKonbiniOptions konbini; + private PaymentIntentPaymentMethodOptionsKrCardOptions krCard; + private PaymentIntentPaymentMethodOptionsLinkOptions link; + private PaymentIntentPaymentMethodOptionsMbWayOptions mbWay; + private PaymentIntentPaymentMethodOptionsMobilepayOptions mobilepay; + private PaymentIntentPaymentMethodOptionsMultibancoOptions multibanco; + private PaymentIntentPaymentMethodOptionsNaverPayOptions naverPay; + private PaymentIntentPaymentMethodOptionsNzBankAccountOptions nzBankAccount; + private PaymentIntentPaymentMethodOptionsOxxoOptions oxxo; + private PaymentIntentPaymentMethodOptionsP24Options p24; + private PaymentIntentPaymentMethodOptionsPayByBankOptions payByBank; + private PaymentIntentPaymentMethodOptionsPaycoOptions payco; + private PaymentIntentPaymentMethodOptionsPaynowOptions paynow; + private PaymentIntentPaymentMethodOptionsPaypalOptions paypal; + private PaymentIntentPaymentMethodOptionsPaypayOptions paypay; + private PaymentIntentPaymentMethodOptionsPaytoOptions payto; + private PaymentIntentPaymentMethodOptionsPixOptions pix; + private PaymentIntentPaymentMethodOptionsPromptpayOptions promptpay; + private PaymentIntentPaymentMethodOptionsQrisOptions qris; + private PaymentIntentPaymentMethodOptionsRechnungOptions rechnung; + private PaymentIntentPaymentMethodOptionsRevolutPayOptions revolutPay; + private PaymentIntentPaymentMethodOptionsSamsungPayOptions samsungPay; + private PaymentIntentPaymentMethodOptionsSatispayOptions satispay; + private PaymentIntentPaymentMethodOptionsSepaDebitOptions sepaDebit; + private PaymentIntentPaymentMethodOptionsShopeepayOptions shopeepay; + private PaymentIntentPaymentMethodOptionsSofortOptions sofort; + private PaymentIntentPaymentMethodOptionsStripeBalanceOptions stripeBalance; + private PaymentIntentPaymentMethodOptionsSwishOptions swish; + private PaymentIntentPaymentMethodOptionsTwintOptions twint; + private PaymentIntentPaymentMethodOptionsUpiOptions upi; + private PaymentIntentPaymentMethodOptionsUsBankAccountOptions usBankAccount; + private PaymentIntentPaymentMethodOptionsWechatPayOptions wechatPay; + private PaymentIntentPaymentMethodOptionsZipOptions zip; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// If this is a acss_debit PaymentMethod, this sub-hash contains details about the /// ACSS Debit payment method options. /// [JsonProperty("acss_debit")] [STJS.JsonPropertyName("acss_debit")] - public PaymentIntentPaymentMethodOptionsAcssDebitOptions AcssDebit { get; set; } + public PaymentIntentPaymentMethodOptionsAcssDebitOptions AcssDebit + { + get => this.acssDebit; + set + { + this.acssDebit = value; + this.SetTracker.Track(); + } + } /// /// If this is an affirm PaymentMethod, this sub-hash contains details about the @@ -22,7 +94,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("affirm")] [STJS.JsonPropertyName("affirm")] - public PaymentIntentPaymentMethodOptionsAffirmOptions Affirm { get; set; } + public PaymentIntentPaymentMethodOptionsAffirmOptions Affirm + { + get => this.affirm; + set + { + this.affirm = value; + this.SetTracker.Track(); + } + } /// /// If this is a afterpay_clearpay PaymentMethod, this sub-hash contains details @@ -30,7 +110,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("afterpay_clearpay")] [STJS.JsonPropertyName("afterpay_clearpay")] - public PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions AfterpayClearpay { get; set; } + public PaymentIntentPaymentMethodOptionsAfterpayClearpayOptions AfterpayClearpay + { + get => this.afterpayClearpay; + set + { + this.afterpayClearpay = value; + this.SetTracker.Track(); + } + } /// /// If this is a alipay PaymentMethod, this sub-hash contains details about the @@ -38,7 +126,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("alipay")] [STJS.JsonPropertyName("alipay")] - public PaymentIntentPaymentMethodOptionsAlipayOptions Alipay { get; set; } + public PaymentIntentPaymentMethodOptionsAlipayOptions Alipay + { + get => this.alipay; + set + { + this.alipay = value; + this.SetTracker.Track(); + } + } /// /// If this is a alma PaymentMethod, this sub-hash contains details about the Alma @@ -46,7 +142,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("alma")] [STJS.JsonPropertyName("alma")] - public PaymentIntentPaymentMethodOptionsAlmaOptions Alma { get; set; } + public PaymentIntentPaymentMethodOptionsAlmaOptions Alma + { + get => this.alma; + set + { + this.alma = value; + this.SetTracker.Track(); + } + } /// /// If this is a amazon_pay PaymentMethod, this sub-hash contains details about the @@ -54,7 +158,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("amazon_pay")] [STJS.JsonPropertyName("amazon_pay")] - public PaymentIntentPaymentMethodOptionsAmazonPayOptions AmazonPay { get; set; } + public PaymentIntentPaymentMethodOptionsAmazonPayOptions AmazonPay + { + get => this.amazonPay; + set + { + this.amazonPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a au_becs_debit PaymentMethod, this sub-hash contains details about @@ -62,7 +174,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("au_becs_debit")] [STJS.JsonPropertyName("au_becs_debit")] - public PaymentIntentPaymentMethodOptionsAuBecsDebitOptions AuBecsDebit { get; set; } + public PaymentIntentPaymentMethodOptionsAuBecsDebitOptions AuBecsDebit + { + get => this.auBecsDebit; + set + { + this.auBecsDebit = value; + this.SetTracker.Track(); + } + } /// /// If this is a bacs_debit PaymentMethod, this sub-hash contains details about the @@ -70,7 +190,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("bacs_debit")] [STJS.JsonPropertyName("bacs_debit")] - public PaymentIntentPaymentMethodOptionsBacsDebitOptions BacsDebit { get; set; } + public PaymentIntentPaymentMethodOptionsBacsDebitOptions BacsDebit + { + get => this.bacsDebit; + set + { + this.bacsDebit = value; + this.SetTracker.Track(); + } + } /// /// If this is a bancontact PaymentMethod, this sub-hash contains details about the @@ -78,7 +206,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("bancontact")] [STJS.JsonPropertyName("bancontact")] - public PaymentIntentPaymentMethodOptionsBancontactOptions Bancontact { get; set; } + public PaymentIntentPaymentMethodOptionsBancontactOptions Bancontact + { + get => this.bancontact; + set + { + this.bancontact = value; + this.SetTracker.Track(); + } + } /// /// If this is a billie PaymentMethod, this sub-hash contains details about the @@ -86,7 +222,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("billie")] [STJS.JsonPropertyName("billie")] - public PaymentIntentPaymentMethodOptionsBillieOptions Billie { get; set; } + public PaymentIntentPaymentMethodOptionsBillieOptions Billie + { + get => this.billie; + set + { + this.billie = value; + this.SetTracker.Track(); + } + } /// /// If this is a blik PaymentMethod, this sub-hash contains details about the BLIK @@ -94,7 +238,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("blik")] [STJS.JsonPropertyName("blik")] - public PaymentIntentPaymentMethodOptionsBlikOptions Blik { get; set; } + public PaymentIntentPaymentMethodOptionsBlikOptions Blik + { + get => this.blik; + set + { + this.blik = value; + this.SetTracker.Track(); + } + } /// /// If this is a boleto PaymentMethod, this sub-hash contains details about the @@ -102,7 +254,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("boleto")] [STJS.JsonPropertyName("boleto")] - public PaymentIntentPaymentMethodOptionsBoletoOptions Boleto { get; set; } + public PaymentIntentPaymentMethodOptionsBoletoOptions Boleto + { + get => this.boleto; + set + { + this.boleto = value; + this.SetTracker.Track(); + } + } /// /// Configuration for any card payments attempted on this PaymentIntent. @@ -117,7 +277,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("card_present")] [STJS.JsonPropertyName("card_present")] - public PaymentIntentPaymentMethodOptionsCardPresentOptions CardPresent { get; set; } + public PaymentIntentPaymentMethodOptionsCardPresentOptions CardPresent + { + get => this.cardPresent; + set + { + this.cardPresent = value; + this.SetTracker.Track(); + } + } /// /// If this is a cashapp PaymentMethod, this sub-hash contains details about the Cash @@ -125,7 +293,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("cashapp")] [STJS.JsonPropertyName("cashapp")] - public PaymentIntentPaymentMethodOptionsCashappOptions Cashapp { get; set; } + public PaymentIntentPaymentMethodOptionsCashappOptions Cashapp + { + get => this.cashapp; + set + { + this.cashapp = value; + this.SetTracker.Track(); + } + } /// /// If this is a crypto PaymentMethod, this sub-hash contains details about the @@ -133,7 +309,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("crypto")] [STJS.JsonPropertyName("crypto")] - public PaymentIntentPaymentMethodOptionsCryptoOptions Crypto { get; set; } + public PaymentIntentPaymentMethodOptionsCryptoOptions Crypto + { + get => this.crypto; + set + { + this.crypto = value; + this.SetTracker.Track(); + } + } /// /// If this is a customer balance PaymentMethod, this sub-hash contains details about @@ -141,7 +325,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("customer_balance")] [STJS.JsonPropertyName("customer_balance")] - public PaymentIntentPaymentMethodOptionsCustomerBalanceOptions CustomerBalance { get; set; } + public PaymentIntentPaymentMethodOptionsCustomerBalanceOptions CustomerBalance + { + get => this.customerBalance; + set + { + this.customerBalance = value; + this.SetTracker.Track(); + } + } /// /// If this is a eps PaymentMethod, this sub-hash contains details about the EPS @@ -149,7 +341,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("eps")] [STJS.JsonPropertyName("eps")] - public PaymentIntentPaymentMethodOptionsEpsOptions Eps { get; set; } + public PaymentIntentPaymentMethodOptionsEpsOptions Eps + { + get => this.eps; + set + { + this.eps = value; + this.SetTracker.Track(); + } + } /// /// If this is a fpx PaymentMethod, this sub-hash contains details about the FPX @@ -157,7 +357,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("fpx")] [STJS.JsonPropertyName("fpx")] - public PaymentIntentPaymentMethodOptionsFpxOptions Fpx { get; set; } + public PaymentIntentPaymentMethodOptionsFpxOptions Fpx + { + get => this.fpx; + set + { + this.fpx = value; + this.SetTracker.Track(); + } + } /// /// If this is a giropay PaymentMethod, this sub-hash contains details about the @@ -165,7 +373,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("giropay")] [STJS.JsonPropertyName("giropay")] - public PaymentIntentPaymentMethodOptionsGiropayOptions Giropay { get; set; } + public PaymentIntentPaymentMethodOptionsGiropayOptions Giropay + { + get => this.giropay; + set + { + this.giropay = value; + this.SetTracker.Track(); + } + } /// /// If this is a gopay PaymentMethod, this sub-hash contains details about the Gopay @@ -173,7 +389,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("gopay")] [STJS.JsonPropertyName("gopay")] - public PaymentIntentPaymentMethodOptionsGopayOptions Gopay { get; set; } + public PaymentIntentPaymentMethodOptionsGopayOptions Gopay + { + get => this.gopay; + set + { + this.gopay = value; + this.SetTracker.Track(); + } + } /// /// If this is a grabpay PaymentMethod, this sub-hash contains details about the @@ -181,7 +405,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("grabpay")] [STJS.JsonPropertyName("grabpay")] - public PaymentIntentPaymentMethodOptionsGrabpayOptions Grabpay { get; set; } + public PaymentIntentPaymentMethodOptionsGrabpayOptions Grabpay + { + get => this.grabpay; + set + { + this.grabpay = value; + this.SetTracker.Track(); + } + } /// /// If this is a id_bank_transfer PaymentMethod, this sub-hash contains details about @@ -189,7 +421,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("id_bank_transfer")] [STJS.JsonPropertyName("id_bank_transfer")] - public PaymentIntentPaymentMethodOptionsIdBankTransferOptions IdBankTransfer { get; set; } + public PaymentIntentPaymentMethodOptionsIdBankTransferOptions IdBankTransfer + { + get => this.idBankTransfer; + set + { + this.idBankTransfer = value; + this.SetTracker.Track(); + } + } /// /// If this is a ideal PaymentMethod, this sub-hash contains details about the Ideal @@ -197,7 +437,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("ideal")] [STJS.JsonPropertyName("ideal")] - public PaymentIntentPaymentMethodOptionsIdealOptions Ideal { get; set; } + public PaymentIntentPaymentMethodOptionsIdealOptions Ideal + { + get => this.ideal; + set + { + this.ideal = value; + this.SetTracker.Track(); + } + } /// /// If this is a interac_present PaymentMethod, this sub-hash contains details about @@ -205,7 +453,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("interac_present")] [STJS.JsonPropertyName("interac_present")] - public PaymentIntentPaymentMethodOptionsInteracPresentOptions InteracPresent { get; set; } + public PaymentIntentPaymentMethodOptionsInteracPresentOptions InteracPresent + { + get => this.interacPresent; + set + { + this.interacPresent = value; + this.SetTracker.Track(); + } + } /// /// If this is a kakao_pay PaymentMethod, this sub-hash contains details about the @@ -213,7 +469,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("kakao_pay")] [STJS.JsonPropertyName("kakao_pay")] - public PaymentIntentPaymentMethodOptionsKakaoPayOptions KakaoPay { get; set; } + public PaymentIntentPaymentMethodOptionsKakaoPayOptions KakaoPay + { + get => this.kakaoPay; + set + { + this.kakaoPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a klarna PaymentMethod, this sub-hash contains details about the @@ -221,7 +485,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("klarna")] [STJS.JsonPropertyName("klarna")] - public PaymentIntentPaymentMethodOptionsKlarnaOptions Klarna { get; set; } + public PaymentIntentPaymentMethodOptionsKlarnaOptions Klarna + { + get => this.klarna; + set + { + this.klarna = value; + this.SetTracker.Track(); + } + } /// /// If this is a konbini PaymentMethod, this sub-hash contains details about the @@ -229,7 +501,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("konbini")] [STJS.JsonPropertyName("konbini")] - public PaymentIntentPaymentMethodOptionsKonbiniOptions Konbini { get; set; } + public PaymentIntentPaymentMethodOptionsKonbiniOptions Konbini + { + get => this.konbini; + set + { + this.konbini = value; + this.SetTracker.Track(); + } + } /// /// If this is a kr_card PaymentMethod, this sub-hash contains details about the KR @@ -237,7 +517,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("kr_card")] [STJS.JsonPropertyName("kr_card")] - public PaymentIntentPaymentMethodOptionsKrCardOptions KrCard { get; set; } + public PaymentIntentPaymentMethodOptionsKrCardOptions KrCard + { + get => this.krCard; + set + { + this.krCard = value; + this.SetTracker.Track(); + } + } /// /// If this is a link PaymentMethod, this sub-hash contains details about the Link @@ -245,7 +533,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("link")] [STJS.JsonPropertyName("link")] - public PaymentIntentPaymentMethodOptionsLinkOptions Link { get; set; } + public PaymentIntentPaymentMethodOptionsLinkOptions Link + { + get => this.link; + set + { + this.link = value; + this.SetTracker.Track(); + } + } /// /// If this is a mb_way PaymentMethod, this sub-hash contains details about the MB @@ -253,7 +549,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("mb_way")] [STJS.JsonPropertyName("mb_way")] - public PaymentIntentPaymentMethodOptionsMbWayOptions MbWay { get; set; } + public PaymentIntentPaymentMethodOptionsMbWayOptions MbWay + { + get => this.mbWay; + set + { + this.mbWay = value; + this.SetTracker.Track(); + } + } /// /// If this is a MobilePay PaymentMethod, this sub-hash contains details about the @@ -261,7 +565,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("mobilepay")] [STJS.JsonPropertyName("mobilepay")] - public PaymentIntentPaymentMethodOptionsMobilepayOptions Mobilepay { get; set; } + public PaymentIntentPaymentMethodOptionsMobilepayOptions Mobilepay + { + get => this.mobilepay; + set + { + this.mobilepay = value; + this.SetTracker.Track(); + } + } /// /// If this is a multibanco PaymentMethod, this sub-hash contains details about the @@ -269,7 +581,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("multibanco")] [STJS.JsonPropertyName("multibanco")] - public PaymentIntentPaymentMethodOptionsMultibancoOptions Multibanco { get; set; } + public PaymentIntentPaymentMethodOptionsMultibancoOptions Multibanco + { + get => this.multibanco; + set + { + this.multibanco = value; + this.SetTracker.Track(); + } + } /// /// If this is a naver_pay PaymentMethod, this sub-hash contains details about the @@ -277,7 +597,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("naver_pay")] [STJS.JsonPropertyName("naver_pay")] - public PaymentIntentPaymentMethodOptionsNaverPayOptions NaverPay { get; set; } + public PaymentIntentPaymentMethodOptionsNaverPayOptions NaverPay + { + get => this.naverPay; + set + { + this.naverPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a nz_bank_account PaymentMethod, this sub-hash contains details about @@ -285,7 +613,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("nz_bank_account")] [STJS.JsonPropertyName("nz_bank_account")] - public PaymentIntentPaymentMethodOptionsNzBankAccountOptions NzBankAccount { get; set; } + public PaymentIntentPaymentMethodOptionsNzBankAccountOptions NzBankAccount + { + get => this.nzBankAccount; + set + { + this.nzBankAccount = value; + this.SetTracker.Track(); + } + } /// /// If this is a oxxo PaymentMethod, this sub-hash contains details about the OXXO @@ -293,7 +629,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("oxxo")] [STJS.JsonPropertyName("oxxo")] - public PaymentIntentPaymentMethodOptionsOxxoOptions Oxxo { get; set; } + public PaymentIntentPaymentMethodOptionsOxxoOptions Oxxo + { + get => this.oxxo; + set + { + this.oxxo = value; + this.SetTracker.Track(); + } + } /// /// If this is a p24 PaymentMethod, this sub-hash contains details about the @@ -301,7 +645,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("p24")] [STJS.JsonPropertyName("p24")] - public PaymentIntentPaymentMethodOptionsP24Options P24 { get; set; } + public PaymentIntentPaymentMethodOptionsP24Options P24 + { + get => this.p24; + set + { + this.p24 = value; + this.SetTracker.Track(); + } + } /// /// If this is a pay_by_bank PaymentMethod, this sub-hash contains details about the @@ -309,7 +661,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("pay_by_bank")] [STJS.JsonPropertyName("pay_by_bank")] - public PaymentIntentPaymentMethodOptionsPayByBankOptions PayByBank { get; set; } + public PaymentIntentPaymentMethodOptionsPayByBankOptions PayByBank + { + get => this.payByBank; + set + { + this.payByBank = value; + this.SetTracker.Track(); + } + } /// /// If this is a payco PaymentMethod, this sub-hash contains details about the PAYCO @@ -317,7 +677,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("payco")] [STJS.JsonPropertyName("payco")] - public PaymentIntentPaymentMethodOptionsPaycoOptions Payco { get; set; } + public PaymentIntentPaymentMethodOptionsPaycoOptions Payco + { + get => this.payco; + set + { + this.payco = value; + this.SetTracker.Track(); + } + } /// /// If this is a paynow PaymentMethod, this sub-hash contains details about the @@ -325,7 +693,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("paynow")] [STJS.JsonPropertyName("paynow")] - public PaymentIntentPaymentMethodOptionsPaynowOptions Paynow { get; set; } + public PaymentIntentPaymentMethodOptionsPaynowOptions Paynow + { + get => this.paynow; + set + { + this.paynow = value; + this.SetTracker.Track(); + } + } /// /// If this is a paypal PaymentMethod, this sub-hash contains details about the @@ -333,7 +709,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("paypal")] [STJS.JsonPropertyName("paypal")] - public PaymentIntentPaymentMethodOptionsPaypalOptions Paypal { get; set; } + public PaymentIntentPaymentMethodOptionsPaypalOptions Paypal + { + get => this.paypal; + set + { + this.paypal = value; + this.SetTracker.Track(); + } + } /// /// If this is a paypay PaymentMethod, this sub-hash contains details about the @@ -341,7 +725,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("paypay")] [STJS.JsonPropertyName("paypay")] - public PaymentIntentPaymentMethodOptionsPaypayOptions Paypay { get; set; } + public PaymentIntentPaymentMethodOptionsPaypayOptions Paypay + { + get => this.paypay; + set + { + this.paypay = value; + this.SetTracker.Track(); + } + } /// /// If this is a payto PaymentMethod, this sub-hash contains details about the PayTo @@ -349,7 +741,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("payto")] [STJS.JsonPropertyName("payto")] - public PaymentIntentPaymentMethodOptionsPaytoOptions Payto { get; set; } + public PaymentIntentPaymentMethodOptionsPaytoOptions Payto + { + get => this.payto; + set + { + this.payto = value; + this.SetTracker.Track(); + } + } /// /// If this is a pix PaymentMethod, this sub-hash contains details about the Pix @@ -357,7 +757,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("pix")] [STJS.JsonPropertyName("pix")] - public PaymentIntentPaymentMethodOptionsPixOptions Pix { get; set; } + public PaymentIntentPaymentMethodOptionsPixOptions Pix + { + get => this.pix; + set + { + this.pix = value; + this.SetTracker.Track(); + } + } /// /// If this is a promptpay PaymentMethod, this sub-hash contains details about the @@ -365,7 +773,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("promptpay")] [STJS.JsonPropertyName("promptpay")] - public PaymentIntentPaymentMethodOptionsPromptpayOptions Promptpay { get; set; } + public PaymentIntentPaymentMethodOptionsPromptpayOptions Promptpay + { + get => this.promptpay; + set + { + this.promptpay = value; + this.SetTracker.Track(); + } + } /// /// If this is a qris PaymentMethod, this sub-hash contains details about the QRIS @@ -373,7 +789,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("qris")] [STJS.JsonPropertyName("qris")] - public PaymentIntentPaymentMethodOptionsQrisOptions Qris { get; set; } + public PaymentIntentPaymentMethodOptionsQrisOptions Qris + { + get => this.qris; + set + { + this.qris = value; + this.SetTracker.Track(); + } + } /// /// If this is a rechnung PaymentMethod, this sub-hash contains details about the @@ -381,7 +805,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("rechnung")] [STJS.JsonPropertyName("rechnung")] - public PaymentIntentPaymentMethodOptionsRechnungOptions Rechnung { get; set; } + public PaymentIntentPaymentMethodOptionsRechnungOptions Rechnung + { + get => this.rechnung; + set + { + this.rechnung = value; + this.SetTracker.Track(); + } + } /// /// If this is a revolut_pay PaymentMethod, this sub-hash contains details about the @@ -389,7 +821,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("revolut_pay")] [STJS.JsonPropertyName("revolut_pay")] - public PaymentIntentPaymentMethodOptionsRevolutPayOptions RevolutPay { get; set; } + public PaymentIntentPaymentMethodOptionsRevolutPayOptions RevolutPay + { + get => this.revolutPay; + set + { + this.revolutPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a samsung_pay PaymentMethod, this sub-hash contains details about the @@ -397,7 +837,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("samsung_pay")] [STJS.JsonPropertyName("samsung_pay")] - public PaymentIntentPaymentMethodOptionsSamsungPayOptions SamsungPay { get; set; } + public PaymentIntentPaymentMethodOptionsSamsungPayOptions SamsungPay + { + get => this.samsungPay; + set + { + this.samsungPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a satispay PaymentMethod, this sub-hash contains details about the @@ -405,7 +853,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("satispay")] [STJS.JsonPropertyName("satispay")] - public PaymentIntentPaymentMethodOptionsSatispayOptions Satispay { get; set; } + public PaymentIntentPaymentMethodOptionsSatispayOptions Satispay + { + get => this.satispay; + set + { + this.satispay = value; + this.SetTracker.Track(); + } + } /// /// If this is a sepa_debit PaymentIntent, this sub-hash contains details about the @@ -413,7 +869,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("sepa_debit")] [STJS.JsonPropertyName("sepa_debit")] - public PaymentIntentPaymentMethodOptionsSepaDebitOptions SepaDebit { get; set; } + public PaymentIntentPaymentMethodOptionsSepaDebitOptions SepaDebit + { + get => this.sepaDebit; + set + { + this.sepaDebit = value; + this.SetTracker.Track(); + } + } /// /// If this is a shopeepay PaymentMethod, this sub-hash contains details about the @@ -421,7 +885,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("shopeepay")] [STJS.JsonPropertyName("shopeepay")] - public PaymentIntentPaymentMethodOptionsShopeepayOptions Shopeepay { get; set; } + public PaymentIntentPaymentMethodOptionsShopeepayOptions Shopeepay + { + get => this.shopeepay; + set + { + this.shopeepay = value; + this.SetTracker.Track(); + } + } /// /// If this is a sofort PaymentMethod, this sub-hash contains details about the @@ -429,7 +901,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("sofort")] [STJS.JsonPropertyName("sofort")] - public PaymentIntentPaymentMethodOptionsSofortOptions Sofort { get; set; } + public PaymentIntentPaymentMethodOptionsSofortOptions Sofort + { + get => this.sofort; + set + { + this.sofort = value; + this.SetTracker.Track(); + } + } /// /// If this is a stripe_balance PaymentMethod, this sub-hash contains details about @@ -437,7 +917,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("stripe_balance")] [STJS.JsonPropertyName("stripe_balance")] - public PaymentIntentPaymentMethodOptionsStripeBalanceOptions StripeBalance { get; set; } + public PaymentIntentPaymentMethodOptionsStripeBalanceOptions StripeBalance + { + get => this.stripeBalance; + set + { + this.stripeBalance = value; + this.SetTracker.Track(); + } + } /// /// If this is a Swish PaymentMethod, this sub-hash contains details about the Swish @@ -445,7 +933,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("swish")] [STJS.JsonPropertyName("swish")] - public PaymentIntentPaymentMethodOptionsSwishOptions Swish { get; set; } + public PaymentIntentPaymentMethodOptionsSwishOptions Swish + { + get => this.swish; + set + { + this.swish = value; + this.SetTracker.Track(); + } + } /// /// If this is a twint PaymentMethod, this sub-hash contains details about the TWINT @@ -453,7 +949,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("twint")] [STJS.JsonPropertyName("twint")] - public PaymentIntentPaymentMethodOptionsTwintOptions Twint { get; set; } + public PaymentIntentPaymentMethodOptionsTwintOptions Twint + { + get => this.twint; + set + { + this.twint = value; + this.SetTracker.Track(); + } + } /// /// If this is a upi PaymentIntent, this sub-hash contains details about the UPI @@ -461,7 +965,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("upi")] [STJS.JsonPropertyName("upi")] - public PaymentIntentPaymentMethodOptionsUpiOptions Upi { get; set; } + public PaymentIntentPaymentMethodOptionsUpiOptions Upi + { + get => this.upi; + set + { + this.upi = value; + this.SetTracker.Track(); + } + } /// /// If this is a us_bank_account PaymentMethod, this sub-hash contains details about @@ -469,7 +981,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("us_bank_account")] [STJS.JsonPropertyName("us_bank_account")] - public PaymentIntentPaymentMethodOptionsUsBankAccountOptions UsBankAccount { get; set; } + public PaymentIntentPaymentMethodOptionsUsBankAccountOptions UsBankAccount + { + get => this.usBankAccount; + set + { + this.usBankAccount = value; + this.SetTracker.Track(); + } + } /// /// If this is a wechat_pay PaymentMethod, this sub-hash contains details about the @@ -477,7 +997,15 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("wechat_pay")] [STJS.JsonPropertyName("wechat_pay")] - public PaymentIntentPaymentMethodOptionsWechatPayOptions WechatPay { get; set; } + public PaymentIntentPaymentMethodOptionsWechatPayOptions WechatPay + { + get => this.wechatPay; + set + { + this.wechatPay = value; + this.SetTracker.Track(); + } + } /// /// If this is a zip PaymentMethod, this sub-hash contains details about the Zip @@ -485,6 +1013,19 @@ public class PaymentIntentPaymentMethodOptionsOptions : INestedOptions /// [JsonProperty("zip")] [STJS.JsonPropertyName("zip")] - public PaymentIntentPaymentMethodOptionsZipOptions Zip { get; set; } + public PaymentIntentPaymentMethodOptionsZipOptions Zip + { + get => this.zip; + set + { + this.zip = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaycoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaycoOptions.cs index 473ac23bb7..3753ca8acd 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaycoOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaycoOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsPaycoOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsPaycoOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsPaycoOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypalOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypalOptions.cs index 0e901da488..b7d2f5eaa2 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypalOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypalOptions.cs @@ -7,14 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsPaypalOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsPaypalOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds will be captured from the customer's account. /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// The line items purchased by the customer. @@ -87,7 +102,15 @@ public class PaymentIntentPaymentMethodOptionsPaypalOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// The Stripe connected account IDs of the sellers on the platform for this transaction @@ -98,5 +121,10 @@ public class PaymentIntentPaymentMethodOptionsPaypalOptions : INestedOptions [JsonProperty("subsellers")] [STJS.JsonPropertyName("subsellers")] public List Subsellers { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypayOptions.cs index cef0e3b1c3..1081e083e5 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaypayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsPaypayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsPaypayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsPaypayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs index cc869aec09..d0354ffef4 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs @@ -6,14 +6,33 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions, IHasSetTracking { + private long? amount; + private string amountType; + private string endDate; + private string paymentSchedule; + private long? paymentsPerPeriod; + private string purpose; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Amount that will be collected. It is required when amount_type is fixed. /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// The type of amount that will be collected. The amount charged must be exact or up to the @@ -23,7 +42,15 @@ public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INest /// [JsonProperty("amount_type")] [STJS.JsonPropertyName("amount_type")] - public string AmountType { get; set; } + public string AmountType + { + get => this.amountType; + set + { + this.amountType = value; + this.SetTracker.Track(); + } + } /// /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no @@ -31,7 +58,15 @@ public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INest /// [JsonProperty("end_date")] [STJS.JsonPropertyName("end_date")] - public string EndDate { get; set; } + public string EndDate + { + get => this.endDate; + set + { + this.endDate = value; + this.SetTracker.Track(); + } + } /// /// The periodicity at which payments will be collected. Defaults to adhoc. @@ -40,7 +75,15 @@ public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INest /// [JsonProperty("payment_schedule")] [STJS.JsonPropertyName("payment_schedule")] - public string PaymentSchedule { get; set; } + public string PaymentSchedule + { + get => this.paymentSchedule; + set + { + this.paymentSchedule = value; + this.SetTracker.Track(); + } + } /// /// The number of payments that will be made during a payment period. Defaults to 1 except @@ -48,7 +91,15 @@ public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INest /// [JsonProperty("payments_per_period")] [STJS.JsonPropertyName("payments_per_period")] - public long? PaymentsPerPeriod { get; set; } + public long? PaymentsPerPeriod + { + get => this.paymentsPerPeriod; + set + { + this.paymentsPerPeriod = value; + this.SetTracker.Track(); + } + } /// /// The purpose for which payments are made. Has a default value based on your merchant @@ -59,6 +110,19 @@ public class PaymentIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INest /// [JsonProperty("purpose")] [STJS.JsonPropertyName("purpose")] - public string Purpose { get; set; } + public string Purpose + { + get => this.purpose; + set + { + this.purpose = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoOptions.cs index ccedc899dc..d99ac69b78 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPaytoOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsPaytoOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsPaytoOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. Only purpose field is configurable for /// PayTo PaymentIntent with setup_future_usage=none. Other fields are only @@ -44,6 +50,19 @@ public class PaymentIntentPaymentMethodOptionsPaytoOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsRevolutPayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsRevolutPayOptions.cs index 62ba739329..8df79450ca 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsRevolutPayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsRevolutPayOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsRevolutPayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsRevolutPayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,7 +27,15 @@ public class PaymentIntentPaymentMethodOptionsRevolutPayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -45,6 +60,19 @@ public class PaymentIntentPaymentMethodOptionsRevolutPayOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSamsungPayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSamsungPayOptions.cs index 635d1b882f..6a4d0fe720 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSamsungPayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSamsungPayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSamsungPayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSamsungPayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsSamsungPayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSatispayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSatispayOptions.cs index d40acdb3d9..6a3924e8a2 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSatispayOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSatispayOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSatispayOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSatispayOptions : INestedOptions, IHasSetTracking { + private string captureMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds are captured from the customer's account. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsSatispayOptions : INestedOptions /// [JsonProperty("capture_method")] [STJS.JsonPropertyName("capture_method")] - public string CaptureMethod { get; set; } + public string CaptureMethod + { + get => this.captureMethod; + set + { + this.captureMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs index 3c747c7db2..2af1d96ab4 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : I /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitOptions.cs index edcedb37a9..aeee1efb45 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSepaDebitOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSepaDebitOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSepaDebitOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Mandate creation. /// @@ -42,7 +48,15 @@ public class PaymentIntentPaymentMethodOptionsSepaDebitOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -52,5 +66,10 @@ public class PaymentIntentPaymentMethodOptionsSepaDebitOptions : INestedOptions [JsonProperty("target_date")] [STJS.JsonPropertyName("target_date")] public string TargetDate { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSofortOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSofortOptions.cs index 1d43bd16fe..246c3d1e71 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSofortOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSofortOptions.cs @@ -6,15 +6,30 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSofortOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSofortOptions : INestedOptions, IHasSetTracking { + private string preferredLanguage; + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Language shown to the payer on redirect. /// One of: de, en, es, fr, it, nl, or pl. /// [JsonProperty("preferred_language")] [STJS.JsonPropertyName("preferred_language")] - public string PreferredLanguage { get; set; } + public string PreferredLanguage + { + get => this.preferredLanguage; + set + { + this.preferredLanguage = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -43,6 +58,19 @@ public class PaymentIntentPaymentMethodOptionsSofortOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsStripeBalanceOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsStripeBalanceOptions.cs index 24d9bf61c8..f0be94c0ac 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsStripeBalanceOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsStripeBalanceOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsStripeBalanceOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsStripeBalanceOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. @@ -35,6 +41,19 @@ public class PaymentIntentPaymentMethodOptionsStripeBalanceOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSwishOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSwishOptions.cs index 24c6ebc0f3..cf45d4fea2 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSwishOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsSwishOptions.cs @@ -6,14 +6,28 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsSwishOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsSwishOptions : INestedOptions, IHasSetTracking { + private string reference; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A reference for this payment to be displayed in the Swish app. /// [JsonProperty("reference")] [STJS.JsonPropertyName("reference")] - public string Reference { get; set; } + public string Reference + { + get => this.reference; + set + { + this.reference = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -42,5 +56,10 @@ public class PaymentIntentPaymentMethodOptionsSwishOptions : INestedOptions [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] public string SetupFutureUsage { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUpiOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUpiOptions.cs index efcc6fb09a..494935b725 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUpiOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUpiOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsUpiOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsUpiOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Configuration options for setting up an eMandate. /// @@ -20,6 +26,19 @@ public class PaymentIntentPaymentMethodOptionsUpiOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs index 8ed44eb2d0..d017971148 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs @@ -6,13 +6,32 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string collectionMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The method used to collect offline mandate customer acceptance. /// [JsonProperty("collection_method")] [STJS.JsonPropertyName("collection_method")] - public string CollectionMethod { get; set; } + public string CollectionMethod + { + get => this.collectionMethod; + set + { + this.collectionMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountOptions.cs index e6fb6461e0..fcd00f5d8f 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsUsBankAccountOptions : INestedOptions + public class PaymentIntentPaymentMethodOptionsUsBankAccountOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + private string transactionPurpose; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional fields for Financial Connections Session creation. /// @@ -56,7 +63,15 @@ public class PaymentIntentPaymentMethodOptionsUsBankAccountOptions : INestedOpti /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Controls when Stripe will attempt to debit the funds from the customer's account. The @@ -73,7 +88,15 @@ public class PaymentIntentPaymentMethodOptionsUsBankAccountOptions : INestedOpti /// [JsonProperty("transaction_purpose")] [STJS.JsonPropertyName("transaction_purpose")] - public string TransactionPurpose { get; set; } + public string TransactionPurpose + { + get => this.transactionPurpose; + set + { + this.transactionPurpose = value; + this.SetTracker.Track(); + } + } /// /// Bank account verification method. The default value is automatic. @@ -82,5 +105,10 @@ public class PaymentIntentPaymentMethodOptionsUsBankAccountOptions : INestedOpti [JsonProperty("verification_method")] [STJS.JsonPropertyName("verification_method")] public string VerificationMethod { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateOptions.cs index 98e8cf0791..a04b5edaf7 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateOptions.cs @@ -9,6 +9,15 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata { + private PaymentIntentAmountDetailsOptions amountDetails; + private long? applicationFeeAmount; + private List excludedPaymentMethodTypes; + private Dictionary metadata; + private PaymentIntentPaymentDetailsOptions paymentDetails; + private string receiptEmail; + private string setupFutureUsage; + private ChargeShippingOptions shipping; + /// /// Amount intended to be collected by this PaymentIntent. A positive integer representing /// how much to charge in the [JsonProperty("amount_details")] [STJS.JsonPropertyName("amount_details")] - public PaymentIntentAmountDetailsOptions AmountDetails { get; set; } + public PaymentIntentAmountDetailsOptions AmountDetails + { + get => this.amountDetails; + set + { + this.amountDetails = value; + this.SetTracker.Track(); + } + } /// /// The amount of the application fee (if any) that will be requested to be applied to the @@ -40,7 +57,15 @@ public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_amount")] [STJS.JsonPropertyName("application_fee_amount")] - public long? ApplicationFeeAmount { get; set; } + public long? ApplicationFeeAmount + { + get => this.applicationFeeAmount; + set + { + this.applicationFeeAmount = value; + this.SetTracker.Track(); + } + } /// /// Controls when the funds will be captured from the customer's account. @@ -120,7 +145,15 @@ public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("excluded_payment_method_types")] [STJS.JsonPropertyName("excluded_payment_method_types")] - public List ExcludedPaymentMethodTypes { get; set; } + public List ExcludedPaymentMethodTypes + { + get => this.excludedPaymentMethodTypes; + set + { + this.excludedPaymentMethodTypes = value; + this.SetTracker.Track(); + } + } /// /// The FX rate in the quote is validated and used to convert the presentment amount to the @@ -152,14 +185,30 @@ public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Provides industry-specific information about the charge. /// [JsonProperty("payment_details")] [STJS.JsonPropertyName("payment_details")] - public PaymentIntentPaymentDetailsOptions PaymentDetails { get; set; } + public PaymentIntentPaymentDetailsOptions PaymentDetails + { + get => this.paymentDetails; + set + { + this.paymentDetails = value; + this.SetTracker.Track(); + } + } [JsonProperty("payment_method")] [STJS.JsonPropertyName("payment_method")] @@ -210,7 +259,15 @@ public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("receipt_email")] [STJS.JsonPropertyName("receipt_email")] - public string ReceiptEmail { get; set; } + public string ReceiptEmail + { + get => this.receiptEmail; + set + { + this.receiptEmail = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to make future payments with this PaymentIntent's payment @@ -239,14 +296,30 @@ public class PaymentIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } /// /// Shipping information for this PaymentIntent. /// [JsonProperty("shipping")] [STJS.JsonPropertyName("shipping")] - public ChargeShippingOptions Shipping { get; set; } + public ChargeShippingOptions Shipping + { + get => this.shipping; + set + { + this.shipping = value; + this.SetTracker.Track(); + } + } /// /// Text that appears on the customer's statement as the statement descriptor for a non-card diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkCustomTextOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkCustomTextOptions.cs index d4a94deb04..6f3547bb54 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkCustomTextOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkCustomTextOptions.cs @@ -6,28 +6,61 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkCustomTextOptions : INestedOptions + public class PaymentLinkCustomTextOptions : INestedOptions, IHasSetTracking { + private PaymentLinkCustomTextAfterSubmitOptions afterSubmit; + private PaymentLinkCustomTextShippingAddressOptions shippingAddress; + private PaymentLinkCustomTextSubmitOptions submit; + private PaymentLinkCustomTextTermsOfServiceAcceptanceOptions termsOfServiceAcceptance; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Custom text that should be displayed after the payment confirmation button. /// [JsonProperty("after_submit")] [STJS.JsonPropertyName("after_submit")] - public PaymentLinkCustomTextAfterSubmitOptions AfterSubmit { get; set; } + public PaymentLinkCustomTextAfterSubmitOptions AfterSubmit + { + get => this.afterSubmit; + set + { + this.afterSubmit = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed alongside shipping address collection. /// [JsonProperty("shipping_address")] [STJS.JsonPropertyName("shipping_address")] - public PaymentLinkCustomTextShippingAddressOptions ShippingAddress { get; set; } + public PaymentLinkCustomTextShippingAddressOptions ShippingAddress + { + get => this.shippingAddress; + set + { + this.shippingAddress = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed alongside the payment confirmation button. /// [JsonProperty("submit")] [STJS.JsonPropertyName("submit")] - public PaymentLinkCustomTextSubmitOptions Submit { get; set; } + public PaymentLinkCustomTextSubmitOptions Submit + { + get => this.submit; + set + { + this.submit = value; + this.SetTracker.Track(); + } + } /// /// Custom text that should be displayed in place of the default terms of service agreement @@ -35,6 +68,19 @@ public class PaymentLinkCustomTextOptions : INestedOptions /// [JsonProperty("terms_of_service_acceptance")] [STJS.JsonPropertyName("terms_of_service_acceptance")] - public PaymentLinkCustomTextTermsOfServiceAcceptanceOptions TermsOfServiceAcceptance { get; set; } + public PaymentLinkCustomTextTermsOfServiceAcceptanceOptions TermsOfServiceAcceptance + { + get => this.termsOfServiceAcceptance; + set + { + this.termsOfServiceAcceptance = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataOptions.cs index 610cfc8699..2e139f9daa 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataOptions.cs @@ -7,21 +7,46 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMetadata + public class PaymentLinkInvoiceCreationInvoiceDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List accountTaxIds; + private List customFields; + private Dictionary metadata; + private PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions renderingOptions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with the invoice. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Default custom fields to be displayed on invoices for this customer. /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// An arbitrary string attached to the object. Often useful for displaying to users. @@ -53,13 +78,34 @@ public class PaymentLinkInvoiceCreationInvoiceDataOptions : INestedOptions, IHas /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Default options for invoice PDF rendering for this customer. /// [JsonProperty("rendering_options")] [STJS.JsonPropertyName("rendering_options")] - public PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions RenderingOptions { get; set; } + public PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions RenderingOptions + { + get => this.renderingOptions; + set + { + this.renderingOptions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions.cs index 9bcd498af4..3587c5049b 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedOptions + public class PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions : INestedOptions, IHasSetTracking { + private string amountTaxDisplay; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. /// One of exclude_tax or include_inclusive_tax. include_inclusive_tax @@ -18,7 +24,15 @@ public class PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions : INes /// [JsonProperty("amount_tax_display")] [STJS.JsonPropertyName("amount_tax_display")] - public string AmountTaxDisplay { get; set; } + public string AmountTaxDisplay + { + get => this.amountTaxDisplay; + set + { + this.amountTaxDisplay = value; + this.SetTracker.Track(); + } + } /// /// ID of the invoice rendering template to use for this invoice. @@ -26,5 +40,10 @@ public class PaymentLinkInvoiceCreationInvoiceDataRenderingOptionsOptions : INes [JsonProperty("template")] [STJS.JsonPropertyName("template")] public string Template { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions.cs index cc38c64349..25a8882c4e 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions + public class PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class PaymentLinkLineItemPriceDataProductDataTaxDetailsOptions : INestedO /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkPaymentIntentDataOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkPaymentIntentDataOptions.cs index a0d8a3bc71..6503208a2d 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkPaymentIntentDataOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkPaymentIntentDataOptions.cs @@ -7,8 +7,18 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkPaymentIntentDataOptions : INestedOptions, IHasMetadata + public class PaymentLinkPaymentIntentDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private string description; + private Dictionary metadata; + private string statementDescriptor; + private string statementDescriptorSuffix; + private string transferGroup; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Controls when the funds will be captured from the customer's account. /// One of: automatic, automatic_async, or manual. @@ -22,7 +32,15 @@ public class PaymentLinkPaymentIntentDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that will @@ -33,7 +51,15 @@ public class PaymentLinkPaymentIntentDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Indicates that you intend to [JsonProperty("statement_descriptor")] [STJS.JsonPropertyName("statement_descriptor")] - public string StatementDescriptor { get; set; } + public string StatementDescriptor + { + get => this.statementDescriptor; + set + { + this.statementDescriptor = value; + this.SetTracker.Track(); + } + } /// /// Provides information about a card charge. Concatenated to the account's [JsonProperty("statement_descriptor_suffix")] [STJS.JsonPropertyName("statement_descriptor_suffix")] - public string StatementDescriptorSuffix { get; set; } + public string StatementDescriptorSuffix + { + get => this.statementDescriptorSuffix; + set + { + this.statementDescriptorSuffix = value; + this.SetTracker.Track(); + } + } /// /// A string that identifies the resulting payment as part of a group. See the @@ -95,6 +137,19 @@ public class PaymentLinkPaymentIntentDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("transfer_group")] [STJS.JsonPropertyName("transfer_group")] - public string TransferGroup { get; set; } + public string TransferGroup + { + get => this.transferGroup; + set + { + this.transferGroup = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkSubscriptionDataOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkSubscriptionDataOptions.cs index 5c63e7317b..2913a8ecac 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkSubscriptionDataOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkSubscriptionDataOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentLinkSubscriptionDataOptions : INestedOptions, IHasMetadata + public class PaymentLinkSubscriptionDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private Dictionary metadata; + private long? trialPeriodDays; + private PaymentLinkSubscriptionDataTrialSettingsOptions trialSettings; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The subscription's description, meant to be displayable to the customer. Use this field /// to optionally store an explanation of the subscription for rendering in Stripe surfaces @@ -34,7 +42,15 @@ public class PaymentLinkSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Integer representing the number of trial period days before the customer is charged for @@ -42,13 +58,34 @@ public class PaymentLinkSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("trial_period_days")] [STJS.JsonPropertyName("trial_period_days")] - public long? TrialPeriodDays { get; set; } + public long? TrialPeriodDays + { + get => this.trialPeriodDays; + set + { + this.trialPeriodDays = value; + this.SetTracker.Track(); + } + } /// /// Settings related to subscription trials. /// [JsonProperty("trial_settings")] [STJS.JsonPropertyName("trial_settings")] - public PaymentLinkSubscriptionDataTrialSettingsOptions TrialSettings { get; set; } + public PaymentLinkSubscriptionDataTrialSettingsOptions TrialSettings + { + get => this.trialSettings; + set + { + this.trialSettings = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkUpdateOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkUpdateOptions.cs index d51cd63b95..d4019ab4fa 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkUpdateOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkUpdateOptions.cs @@ -9,6 +9,14 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata { + private List customFields; + private string inactiveMessage; + private PaymentLinkNameCollectionOptions nameCollection; + private List optionalItems; + private List paymentMethodTypes; + private PaymentLinkRestrictionsOptions restrictions; + private PaymentLinkShippingAddressCollectionOptions shippingAddressCollection; + /// /// Whether the payment link's url is active. If false, customers visiting the /// URL will be shown a page saying that the link has been deactivated. @@ -52,7 +60,15 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("custom_fields")] [STJS.JsonPropertyName("custom_fields")] - public List CustomFields { get; set; } + public List CustomFields + { + get => this.customFields; + set + { + this.customFields = value; + this.SetTracker.Track(); + } + } /// /// Display additional text for your customers using custom text. You can't set this @@ -78,7 +94,15 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("inactive_message")] [STJS.JsonPropertyName("inactive_message")] - public string InactiveMessage { get; set; } + public string InactiveMessage + { + get => this.inactiveMessage; + set + { + this.inactiveMessage = value; + this.SetTracker.Track(); + } + } /// /// Generate a post-purchase Invoice for one-time payments. @@ -113,7 +137,15 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("name_collection")] [STJS.JsonPropertyName("name_collection")] - public PaymentLinkNameCollectionOptions NameCollection { get; set; } + public PaymentLinkNameCollectionOptions NameCollection + { + get => this.nameCollection; + set + { + this.nameCollection = value; + this.SetTracker.Track(); + } + } /// /// A list of optional items the customer can add to their order at checkout. Use this @@ -125,7 +157,15 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("optional_items")] [STJS.JsonPropertyName("optional_items")] - public List OptionalItems { get; set; } + public List OptionalItems + { + get => this.optionalItems; + set + { + this.optionalItems = value; + this.SetTracker.Track(); + } + } /// /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in @@ -169,7 +209,15 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("payment_method_types")] [STJS.JsonPropertyName("payment_method_types")] - public List PaymentMethodTypes { get; set; } + public List PaymentMethodTypes + { + get => this.paymentMethodTypes; + set + { + this.paymentMethodTypes = value; + this.SetTracker.Track(); + } + } /// /// Controls phone number collection settings during checkout. @@ -185,14 +233,30 @@ public class PaymentLinkUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("restrictions")] [STJS.JsonPropertyName("restrictions")] - public PaymentLinkRestrictionsOptions Restrictions { get; set; } + public PaymentLinkRestrictionsOptions Restrictions + { + get => this.restrictions; + set + { + this.restrictions = value; + this.SetTracker.Track(); + } + } /// /// Configuration for collecting the customer's shipping address. /// [JsonProperty("shipping_address_collection")] [STJS.JsonPropertyName("shipping_address_collection")] - public PaymentLinkShippingAddressCollectionOptions ShippingAddressCollection { get; set; } + public PaymentLinkShippingAddressCollectionOptions ShippingAddressCollection + { + get => this.shippingAddressCollection; + set + { + this.shippingAddressCollection = value; + this.SetTracker.Track(); + } + } /// /// Describes the type of transaction being performed in order to customize relevant text on diff --git a/src/Stripe.net/Services/PaymentMethodConfigurations/PaymentMethodConfigurationListOptions.cs b/src/Stripe.net/Services/PaymentMethodConfigurations/PaymentMethodConfigurationListOptions.cs index 5041b603c3..0f28682a0e 100644 --- a/src/Stripe.net/Services/PaymentMethodConfigurations/PaymentMethodConfigurationListOptions.cs +++ b/src/Stripe.net/Services/PaymentMethodConfigurations/PaymentMethodConfigurationListOptions.cs @@ -8,11 +8,21 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentMethodConfigurationListOptions : ListOptions { + private string application; + /// /// The Connect application to filter by. /// [JsonProperty("application")] [STJS.JsonPropertyName("application")] - public string Application { get; set; } + public string Application + { + get => this.application; + set + { + this.application = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PaymentMethods/PaymentMethodBillingDetailsOptions.cs b/src/Stripe.net/Services/PaymentMethods/PaymentMethodBillingDetailsOptions.cs index a7fe267a7a..675a563d00 100644 --- a/src/Stripe.net/Services/PaymentMethods/PaymentMethodBillingDetailsOptions.cs +++ b/src/Stripe.net/Services/PaymentMethods/PaymentMethodBillingDetailsOptions.cs @@ -6,35 +6,76 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentMethodBillingDetailsOptions : INestedOptions + public class PaymentMethodBillingDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private string email; + private string name; + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Billing address. /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// Email address. /// [JsonProperty("email")] [STJS.JsonPropertyName("email")] - public string Email { get; set; } + public string Email + { + get => this.email; + set + { + this.email = value; + this.SetTracker.Track(); + } + } /// /// Full name. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// Billing phone number (including extension). /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } /// /// Taxpayer identification number. Used only for transactions between LATAM buyers and @@ -43,5 +84,10 @@ public class PaymentMethodBillingDetailsOptions : INestedOptions [JsonProperty("tax_id")] [STJS.JsonPropertyName("tax_id")] public string TaxId { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentMethods/PaymentMethodCardNetworksOptions.cs b/src/Stripe.net/Services/PaymentMethods/PaymentMethodCardNetworksOptions.cs index 4c739472c3..84a0394ecd 100644 --- a/src/Stripe.net/Services/PaymentMethods/PaymentMethodCardNetworksOptions.cs +++ b/src/Stripe.net/Services/PaymentMethods/PaymentMethodCardNetworksOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentMethodCardNetworksOptions : INestedOptions + public class PaymentMethodCardNetworksOptions : INestedOptions, IHasSetTracking { + private string preferred; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The customer's preferred card network for co-branded cards. Supports /// cartes_bancaires, mastercard, or visa. Selection of a network that @@ -16,6 +22,19 @@ public class PaymentMethodCardNetworksOptions : INestedOptions /// [JsonProperty("preferred")] [STJS.JsonPropertyName("preferred")] - public string Preferred { get; set; } + public string Preferred + { + get => this.preferred; + set + { + this.preferred = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/PaymentMethods/PaymentMethodUpdateOptions.cs b/src/Stripe.net/Services/PaymentMethods/PaymentMethodUpdateOptions.cs index 0e0611abf0..bbeef4fd90 100644 --- a/src/Stripe.net/Services/PaymentMethods/PaymentMethodUpdateOptions.cs +++ b/src/Stripe.net/Services/PaymentMethods/PaymentMethodUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentMethodUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// This field indicates whether this payment method can be shown again to its customer in a /// checkout flow. Stripe products such as Checkout and Elements use this field to determine @@ -43,7 +45,15 @@ public class PaymentMethodUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// If this is a payto PaymentMethod, this hash contains details about the PayTo diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs index d2c6f0eeed..4d34800dea 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentAttemptCanceledOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// When the reported payment was canceled. Measured in seconds since the Unix epoch. /// @@ -27,6 +29,14 @@ public class PaymentRecordReportPaymentAttemptCanceledOptions : BaseOptions, IHa /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptFailedOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptFailedOptions.cs index 767db36f81..d3b01b53a1 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptFailedOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptFailedOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentAttemptFailedOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// When the reported payment failed. Measured in seconds since the Unix epoch. /// @@ -27,6 +29,14 @@ public class PaymentRecordReportPaymentAttemptFailedOptions : BaseOptions, IHasM /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptGuaranteedOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptGuaranteedOptions.cs index 3548d9377d..9abeef558a 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptGuaranteedOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptGuaranteedOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentAttemptGuaranteedOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// When the reported payment was guaranteed. Measured in seconds since the Unix epoch. /// @@ -27,6 +29,14 @@ public class PaymentRecordReportPaymentAttemptGuaranteedOptions : BaseOptions, I /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptInformationalOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptInformationalOptions.cs index c944fa6b6a..1b95adc6f3 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptInformationalOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptInformationalOptions.cs @@ -9,6 +9,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentAttemptInformationalOptions : BaseOptions, IHasMetadata { + private string description; + private Dictionary metadata; + private PaymentRecordShippingDetailsOptions shippingDetails; + /// /// Customer information for this payment. /// @@ -21,7 +25,15 @@ public class PaymentRecordReportPaymentAttemptInformationalOptions : BaseOptions /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -31,13 +43,29 @@ public class PaymentRecordReportPaymentAttemptInformationalOptions : BaseOptions /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Shipping information for this payment. /// [JsonProperty("shipping_details")] [STJS.JsonPropertyName("shipping_details")] - public PaymentRecordShippingDetailsOptions ShippingDetails { get; set; } + public PaymentRecordShippingDetailsOptions ShippingDetails + { + get => this.shippingDetails; + set + { + this.shippingDetails = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptOptions.cs index 2117da4ead..0acfceeadb 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentAttemptOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An arbitrary string attached to the object. Often useful for displaying to users. /// @@ -48,7 +50,15 @@ public class PaymentRecordReportPaymentAttemptOptions : BaseOptions, IHasMetadat /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The outcome of the reported payment. diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentOptions.cs index 60c98cffa6..1085e89164 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportPaymentOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The amount you initially requested for this payment. /// @@ -70,7 +72,15 @@ public class PaymentRecordReportPaymentOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The outcome of the reported payment. diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportRefundOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportRefundOptions.cs index 41721f951b..71c96095cc 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportRefundOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportRefundOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentRecordReportRefundOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A positive integer in the smallest currency unit @@ -37,7 +39,15 @@ public class PaymentRecordReportRefundOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The outcome of the reported refund. diff --git a/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs b/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs index 197aab8d49..4e1244cbfe 100644 --- a/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs +++ b/src/Stripe.net/Services/Payouts/PayoutUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PayoutUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class PayoutUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Plans/PlanCreateOptions.cs b/src/Stripe.net/Services/Plans/PlanCreateOptions.cs index 87195bee19..dc6874f354 100644 --- a/src/Stripe.net/Services/Plans/PlanCreateOptions.cs +++ b/src/Stripe.net/Services/Plans/PlanCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PlanCreateOptions : BaseOptions, IHasId, IHasMetadata { + private Dictionary metadata; + /// /// Whether the plan is currently available for new subscriptions. Defaults to true. /// @@ -92,7 +94,15 @@ public class PlanCreateOptions : BaseOptions, IHasId, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The meter tracking the usage of a metered price. diff --git a/src/Stripe.net/Services/Plans/PlanProductTaxDetailsOptions.cs b/src/Stripe.net/Services/Plans/PlanProductTaxDetailsOptions.cs index 40897e04f1..a7eb0d522d 100644 --- a/src/Stripe.net/Services/Plans/PlanProductTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Plans/PlanProductTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PlanProductTaxDetailsOptions : INestedOptions + public class PlanProductTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class PlanProductTaxDetailsOptions : INestedOptions /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs b/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs index 5c1af21c05..49ee7b858d 100644 --- a/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs +++ b/src/Stripe.net/Services/Plans/PlanUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PlanUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Whether the plan is currently available for new subscriptions. /// @@ -24,7 +26,15 @@ public class PlanUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// A brief description of the plan, hidden from customers. diff --git a/src/Stripe.net/Services/Prices/PriceProductDataTaxDetailsOptions.cs b/src/Stripe.net/Services/Prices/PriceProductDataTaxDetailsOptions.cs index ac1d9a0e70..5d2b37ecb5 100644 --- a/src/Stripe.net/Services/Prices/PriceProductDataTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Prices/PriceProductDataTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PriceProductDataTaxDetailsOptions : INestedOptions + public class PriceProductDataTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class PriceProductDataTaxDetailsOptions : INestedOptions /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Prices/PriceUpdateOptions.cs b/src/Stripe.net/Services/Prices/PriceUpdateOptions.cs index cd9fb3ad2f..eaa549c46d 100644 --- a/src/Stripe.net/Services/Prices/PriceUpdateOptions.cs +++ b/src/Stripe.net/Services/Prices/PriceUpdateOptions.cs @@ -9,6 +9,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PriceUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary currencyOptions; + private Dictionary metadata; + private PriceMigrateToOptions migrateTo; + /// /// Whether the price can be used for new purchases. Defaults to true. /// @@ -23,7 +27,15 @@ public class PriceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("currency_options")] [STJS.JsonPropertyName("currency_options")] - public Dictionary CurrencyOptions { get; set; } + public Dictionary CurrencyOptions + { + get => this.currencyOptions; + set + { + this.currencyOptions = value; + this.SetTracker.Track(); + } + } /// /// A lookup key used to retrieve prices dynamically from a static string. This may be up to @@ -41,7 +53,15 @@ public class PriceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// If specified, subscriptions using this price will be updated to use the new referenced @@ -49,7 +69,15 @@ public class PriceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("migrate_to")] [STJS.JsonPropertyName("migrate_to")] - public PriceMigrateToOptions MigrateTo { get; set; } + public PriceMigrateToOptions MigrateTo + { + get => this.migrateTo; + set + { + this.migrateTo = value; + this.SetTracker.Track(); + } + } /// /// A brief description of the price, hidden from customers. diff --git a/src/Stripe.net/Services/Products/ProductTaxDetailsOptions.cs b/src/Stripe.net/Services/Products/ProductTaxDetailsOptions.cs index 02c115019f..6a4beb12c2 100644 --- a/src/Stripe.net/Services/Products/ProductTaxDetailsOptions.cs +++ b/src/Stripe.net/Services/Products/ProductTaxDetailsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ProductTaxDetailsOptions : INestedOptions + public class ProductTaxDetailsOptions : INestedOptions, IHasSetTracking { + private string taxCode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A tax location ID. Depending on the tax @@ -22,6 +28,19 @@ public class ProductTaxDetailsOptions : INestedOptions /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Products/ProductUpdateOptions.cs b/src/Stripe.net/Services/Products/ProductUpdateOptions.cs index c48327e084..d542998b3d 100644 --- a/src/Stripe.net/Services/Products/ProductUpdateOptions.cs +++ b/src/Stripe.net/Services/Products/ProductUpdateOptions.cs @@ -9,6 +9,16 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ProductUpdateOptions : BaseOptions, IHasMetadata { + private string description; + private List images; + private List marketingFeatures; + private Dictionary metadata; + private ProductPackageDimensionsOptions packageDimensions; + private string taxCode; + private ProductTaxDetailsOptions taxDetails; + private string unitLabel; + private string url; + /// /// Whether the product is available for purchase. /// @@ -31,7 +41,15 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// A list of up to 8 URLs of images for this product, meant to be displayable to the @@ -39,7 +57,15 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("images")] [STJS.JsonPropertyName("images")] - public List Images { get; set; } + public List Images + { + get => this.images; + set + { + this.images = value; + this.SetTracker.Track(); + } + } /// /// A list of up to 15 marketing features for this product. These are displayed in [JsonProperty("marketing_features")] [STJS.JsonPropertyName("marketing_features")] - public List MarketingFeatures { get; set; } + public List MarketingFeatures + { + get => this.marketingFeatures; + set + { + this.marketingFeatures = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -57,7 +91,15 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The product's name, meant to be displayable to the customer. @@ -71,7 +113,15 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("package_dimensions")] [STJS.JsonPropertyName("package_dimensions")] - public ProductPackageDimensionsOptions PackageDimensions { get; set; } + public ProductPackageDimensionsOptions PackageDimensions + { + get => this.packageDimensions; + set + { + this.packageDimensions = value; + this.SetTracker.Track(); + } + } /// /// Whether this product is shipped (i.e., physical goods). @@ -100,7 +150,15 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_code")] [STJS.JsonPropertyName("tax_code")] - public string TaxCode { get; set; } + public string TaxCode + { + get => this.taxCode; + set + { + this.taxCode = value; + this.SetTracker.Track(); + } + } /// /// Tax details for this product, including the [JsonProperty("tax_details")] [STJS.JsonPropertyName("tax_details")] - public ProductTaxDetailsOptions TaxDetails { get; set; } + public ProductTaxDetailsOptions TaxDetails + { + get => this.taxDetails; + set + { + this.taxDetails = value; + this.SetTracker.Track(); + } + } /// /// A label that represents units of this product. When set, this will be included in @@ -118,13 +184,29 @@ public class ProductUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("unit_label")] [STJS.JsonPropertyName("unit_label")] - public string UnitLabel { get; set; } + public string UnitLabel + { + get => this.unitLabel; + set + { + this.unitLabel = value; + this.SetTracker.Track(); + } + } /// /// A URL of a publicly-accessible webpage for this product. /// [JsonProperty("url")] [STJS.JsonPropertyName("url")] - public string Url { get; set; } + public string Url + { + get => this.url; + set + { + this.url = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/PromotionCodes/PromotionCodeUpdateOptions.cs b/src/Stripe.net/Services/PromotionCodes/PromotionCodeUpdateOptions.cs index 40b4b3c5e6..fe6b8c8f48 100644 --- a/src/Stripe.net/Services/PromotionCodes/PromotionCodeUpdateOptions.cs +++ b/src/Stripe.net/Services/PromotionCodes/PromotionCodeUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PromotionCodeUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Whether the promotion code is currently active. A promotion code can only be reactivated /// when the coupon is still valid and the promotion code is otherwise redeemable. @@ -25,7 +27,15 @@ public class PromotionCodeUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Settings that restrict the redemption of the promotion code. diff --git a/src/Stripe.net/Services/Quotes/QuoteCreateOptions.cs b/src/Stripe.net/Services/Quotes/QuoteCreateOptions.cs index 0cba75a6ee..0bb32bbf12 100644 --- a/src/Stripe.net/Services/Quotes/QuoteCreateOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteCreateOptions.cs @@ -10,6 +10,16 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class QuoteCreateOptions : BaseOptions, IHasMetadata { + private long? applicationFeeAmount; + private decimal? applicationFeePercent; + private List defaultTaxRates; + private string description; + private List discounts; + private string footer; + private string header; + private string onBehalfOf; + private QuoteTransferDataOptions transferData; + /// /// Set to true to allow quote lines to have starts_at in the past if collection is /// paused between starts_at and now. @@ -25,7 +35,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_amount")] [STJS.JsonPropertyName("application_fee_amount")] - public long? ApplicationFeeAmount { get; set; } + public long? ApplicationFeeAmount + { + get => this.applicationFeeAmount; + set + { + this.applicationFeeAmount = value; + this.SetTracker.Track(); + } + } /// /// A non-negative decimal between 0 and 100, with at most two decimal places. This @@ -35,7 +53,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_percent")] [STJS.JsonPropertyName("application_fee_percent")] - public decimal? ApplicationFeePercent { get; set; } + public decimal? ApplicationFeePercent + { + get => this.applicationFeePercent; + set + { + this.applicationFeePercent = value; + this.SetTracker.Track(); + } + } /// /// Settings for automatic tax lookup for this quote and resulting invoices and @@ -79,7 +105,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// A description that will be displayed on the quote PDF. If no value is passed, the @@ -89,14 +123,30 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The discounts applied to the quote. /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// A future timestamp on which the quote will be canceled if in open or draft @@ -119,7 +169,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("footer")] [STJS.JsonPropertyName("footer")] - public string Footer { get; set; } + public string Footer + { + get => this.footer; + set + { + this.footer = value; + this.SetTracker.Track(); + } + } /// /// Clone an existing quote. The new quote will be created in status=draft. When @@ -138,7 +196,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("header")] [STJS.JsonPropertyName("header")] - public string Header { get; set; } + public string Header + { + get => this.header; + set + { + this.header = value; + this.SetTracker.Track(); + } + } /// /// All invoices will be billed using the specified settings. @@ -180,7 +246,15 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// When creating a subscription or subscription schedule, the specified configuration data @@ -213,6 +287,14 @@ public class QuoteCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public QuoteTransferDataOptions TransferData { get; set; } + public QuoteTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Quotes/QuoteLineActionOptions.cs b/src/Stripe.net/Services/Quotes/QuoteLineActionOptions.cs index 5166cdfc32..8e1c639df5 100644 --- a/src/Stripe.net/Services/Quotes/QuoteLineActionOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteLineActionOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class QuoteLineActionOptions : INestedOptions + public class QuoteLineActionOptions : INestedOptions, IHasSetTracking { + private Dictionary setMetadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Details for the add_discount type. /// @@ -70,7 +76,15 @@ public class QuoteLineActionOptions : INestedOptions /// [JsonProperty("set_metadata")] [STJS.JsonPropertyName("set_metadata")] - public Dictionary SetMetadata { get; set; } + public Dictionary SetMetadata + { + get => this.setMetadata; + set + { + this.setMetadata = value; + this.SetTracker.Track(); + } + } /// /// The type of action the quote line performs. @@ -82,5 +96,10 @@ public class QuoteLineActionOptions : INestedOptions [JsonProperty("type")] [STJS.JsonPropertyName("type")] public string Type { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Quotes/QuoteLineItemOptions.cs b/src/Stripe.net/Services/Quotes/QuoteLineItemOptions.cs index 9d0bd20cc0..700cc736e4 100644 --- a/src/Stripe.net/Services/Quotes/QuoteLineItemOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteLineItemOptions.cs @@ -7,14 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class QuoteLineItemOptions : INestedOptions, IHasId + public class QuoteLineItemOptions : INestedOptions, IHasId, IHasSetTracking { + private List discounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The discounts applied to this line item. /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The ID of an existing line item on the quote. @@ -51,6 +66,19 @@ public class QuoteLineItemOptions : INestedOptions, IHasId /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOptions.cs b/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOptions.cs index 0930a72e67..0c00fde2e6 100644 --- a/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOptions.cs @@ -8,14 +8,33 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata + public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private QuoteSubscriptionDataBillOnAcceptanceOptions billOnAcceptance; + private string billingCycleAnchor; + private string description; + private AnyOf effectiveDate; + private QuoteSubscriptionDataPrebillingOptions prebilling; + private long? trialPeriodDays; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Describes the period to bill for upon accepting the quote. /// [JsonProperty("bill_on_acceptance")] [STJS.JsonPropertyName("bill_on_acceptance")] - public QuoteSubscriptionDataBillOnAcceptanceOptions BillOnAcceptance { get; set; } + public QuoteSubscriptionDataBillOnAcceptanceOptions BillOnAcceptance + { + get => this.billOnAcceptance; + set + { + this.billOnAcceptance = value; + this.SetTracker.Track(); + } + } /// /// Configures when the subscription schedule generates prorations for phase transitions. @@ -35,7 +54,15 @@ public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("billing_cycle_anchor")] [STJS.JsonPropertyName("billing_cycle_anchor")] - public string BillingCycleAnchor { get; set; } + public string BillingCycleAnchor + { + get => this.billingCycleAnchor; + set + { + this.billingCycleAnchor = value; + this.SetTracker.Track(); + } + } /// /// Controls how prorations and invoices for subscriptions are calculated and orchestrated. @@ -51,7 +78,15 @@ public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// When creating a new subscription, the date of which the subscription schedule will start @@ -65,7 +100,15 @@ public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata [JsonConverter(typeof(AnyOfConverter))] [STJS.JsonPropertyName("effective_date")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] - public AnyOf EffectiveDate { get; set; } + public AnyOf EffectiveDate + { + get => this.effectiveDate; + set + { + this.effectiveDate = value; + this.SetTracker.Track(); + } + } /// /// Behavior of the subscription schedule and underlying subscription when it ends. @@ -103,7 +146,15 @@ public class QuoteSubscriptionDataOptions : INestedOptions, IHasMetadata /// [JsonProperty("prebilling")] [STJS.JsonPropertyName("prebilling")] - public QuoteSubscriptionDataPrebillingOptions Prebilling { get; set; } + public QuoteSubscriptionDataPrebillingOptions Prebilling + { + get => this.prebilling; + set + { + this.prebilling = value; + this.SetTracker.Track(); + } + } /// /// Determines how to handle [JsonProperty("trial_period_days")] [STJS.JsonPropertyName("trial_period_days")] - public long? TrialPeriodDays { get; set; } + public long? TrialPeriodDays + { + get => this.trialPeriodDays; + set + { + this.trialPeriodDays = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOverrideOptions.cs b/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOverrideOptions.cs index 5e1700b09d..dcc76928c9 100644 --- a/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOverrideOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteSubscriptionDataOverrideOptions.cs @@ -6,8 +6,15 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class QuoteSubscriptionDataOverrideOptions : INestedOptions + public class QuoteSubscriptionDataOverrideOptions : INestedOptions, IHasSetTracking { + private QuoteSubscriptionDataOverrideBillOnAcceptanceOptions billOnAcceptance; + private string description; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Whether the override applies to an existing Subscription Schedule or a new Subscription /// Schedule. @@ -21,7 +28,15 @@ public class QuoteSubscriptionDataOverrideOptions : INestedOptions /// [JsonProperty("bill_on_acceptance")] [STJS.JsonPropertyName("bill_on_acceptance")] - public QuoteSubscriptionDataOverrideBillOnAcceptanceOptions BillOnAcceptance { get; set; } + public QuoteSubscriptionDataOverrideBillOnAcceptanceOptions BillOnAcceptance + { + get => this.billOnAcceptance; + set + { + this.billOnAcceptance = value; + this.SetTracker.Track(); + } + } /// /// Configures when the subscription schedule generates prorations for phase transitions. @@ -50,7 +65,15 @@ public class QuoteSubscriptionDataOverrideOptions : INestedOptions /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// Behavior of the subscription schedule and underlying subscription when it ends. @@ -80,5 +103,10 @@ public class QuoteSubscriptionDataOverrideOptions : INestedOptions [JsonProperty("proration_behavior")] [STJS.JsonPropertyName("proration_behavior")] public string ProrationBehavior { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Quotes/QuoteUpdateOptions.cs b/src/Stripe.net/Services/Quotes/QuoteUpdateOptions.cs index fa547851c6..43c884d485 100644 --- a/src/Stripe.net/Services/Quotes/QuoteUpdateOptions.cs +++ b/src/Stripe.net/Services/Quotes/QuoteUpdateOptions.cs @@ -10,6 +10,17 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class QuoteUpdateOptions : BaseOptions, IHasMetadata { + private long? applicationFeeAmount; + private decimal? applicationFeePercent; + private List defaultTaxRates; + private string description; + private List discounts; + private string footer; + private string header; + private string onBehalfOf; + private List subscriptionDataOverrides; + private QuoteTransferDataOptions transferData; + /// /// Set to true to allow quote lines to have starts_at in the past if collection is /// paused between starts_at and now. @@ -25,7 +36,15 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_amount")] [STJS.JsonPropertyName("application_fee_amount")] - public long? ApplicationFeeAmount { get; set; } + public long? ApplicationFeeAmount + { + get => this.applicationFeeAmount; + set + { + this.applicationFeeAmount = value; + this.SetTracker.Track(); + } + } /// /// A non-negative decimal between 0 and 100, with at most two decimal places. This @@ -35,7 +54,15 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_percent")] [STJS.JsonPropertyName("application_fee_percent")] - public decimal? ApplicationFeePercent { get; set; } + public decimal? ApplicationFeePercent + { + get => this.applicationFeePercent; + set + { + this.applicationFeePercent = value; + this.SetTracker.Track(); + } + } /// /// Settings for automatic tax lookup for this quote and resulting invoices and @@ -79,21 +106,45 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// A description that will be displayed on the quote PDF. /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The discounts applied to the quote. /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// A future timestamp on which the quote will be canceled if in open or draft @@ -110,14 +161,30 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("footer")] [STJS.JsonPropertyName("footer")] - public string Footer { get; set; } + public string Footer + { + get => this.footer; + set + { + this.footer = value; + this.SetTracker.Track(); + } + } /// /// A header that will be displayed on the quote PDF. /// [JsonProperty("header")] [STJS.JsonPropertyName("header")] - public string Header { get; set; } + public string Header + { + get => this.header; + set + { + this.header = value; + this.SetTracker.Track(); + } + } /// /// All invoices will be billed using the specified settings. @@ -159,7 +226,15 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// When creating a subscription or subscription schedule, the specified configuration data @@ -178,13 +253,29 @@ public class QuoteUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("subscription_data_overrides")] [STJS.JsonPropertyName("subscription_data_overrides")] - public List SubscriptionDataOverrides { get; set; } + public List SubscriptionDataOverrides + { + get => this.subscriptionDataOverrides; + set + { + this.subscriptionDataOverrides = value; + this.SetTracker.Track(); + } + } /// /// The data with which to automatically create a Transfer for each of the invoices. /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public QuoteTransferDataOptions TransferData { get; set; } + public QuoteTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs b/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs index ac120cb970..c631cc2ab8 100644 --- a/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs +++ b/src/Stripe.net/Services/Refunds/RefundCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class RefundCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] public long? Amount { get; set; } @@ -52,7 +54,15 @@ public class RefundCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Origin of the refund. diff --git a/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs b/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs index e0184b0e45..151deb727a 100644 --- a/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs +++ b/src/Stripe.net/Services/Refunds/RefundUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class RefundUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class RefundUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentConfirmOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentConfirmOptions.cs index eda80915ac..2789cc1615 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentConfirmOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentConfirmOptions.cs @@ -8,6 +8,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SetupIntentConfirmOptions : BaseOptions { + private SetupIntentMandateDataOptions mandateData; + [JsonProperty("client_secret")] [STJS.JsonPropertyName("client_secret")] public string ClientSecret { get; set; } @@ -25,7 +27,15 @@ public class SetupIntentConfirmOptions : BaseOptions [JsonProperty("mandate_data")] [STJS.JsonPropertyName("mandate_data")] - public SetupIntentMandateDataOptions MandateData { get; set; } + public SetupIntentMandateDataOptions MandateData + { + get => this.mandateData; + set + { + this.mandateData = value; + this.SetTracker.Track(); + } + } /// /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentCreateOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentCreateOptions.cs index ddbe4aa58a..1c8bec67f7 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentCreateOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SetupIntentCreateOptions : BaseOptions, IHasMetadata { + private SetupIntentMandateDataOptions mandateData; + /// /// If present, the SetupIntent's payment method will be attached to the in-context Stripe /// Account. @@ -119,7 +121,15 @@ public class SetupIntentCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("mandate_data")] [STJS.JsonPropertyName("mandate_data")] - public SetupIntentMandateDataOptions MandateData { get; set; } + public SetupIntentMandateDataOptions MandateData + { + get => this.mandateData; + set + { + this.mandateData = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodDataBillingDetailsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodDataBillingDetailsOptions.cs index fa2e3e7660..478dc21e29 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodDataBillingDetailsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodDataBillingDetailsOptions.cs @@ -6,35 +6,76 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodDataBillingDetailsOptions : INestedOptions + public class SetupIntentPaymentMethodDataBillingDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private string email; + private string name; + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Billing address. /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// Email address. /// [JsonProperty("email")] [STJS.JsonPropertyName("email")] - public string Email { get; set; } + public string Email + { + get => this.email; + set + { + this.email = value; + this.SetTracker.Track(); + } + } /// /// Full name. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// Billing phone number (including extension). /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } /// /// Taxpayer identification number. Used only for transactions between LATAM buyers and @@ -43,5 +84,10 @@ public class SetupIntentPaymentMethodDataBillingDetailsOptions : INestedOptions [JsonProperty("tax_id")] [STJS.JsonPropertyName("tax_id")] public string TaxId { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs index 9b6578c32c..051b0a0d2f 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string customMandateUrl; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A URL for custom mandate text to render during confirmation step. The URL will be /// rendered with additional GET parameters payment_intent and @@ -18,7 +24,15 @@ public class SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INe /// [JsonProperty("custom_mandate_url")] [STJS.JsonPropertyName("custom_mandate_url")] - public string CustomMandateUrl { get; set; } + public string CustomMandateUrl + { + get => this.customMandateUrl; + set + { + this.customMandateUrl = value; + this.SetTracker.Track(); + } + } /// /// List of Stripe products where this mandate can be selected automatically. @@ -51,5 +65,10 @@ public class SetupIntentPaymentMethodOptionsAcssDebitMandateOptionsOptions : INe [JsonProperty("transaction_type")] [STJS.JsonPropertyName("transaction_type")] public string TransactionType { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs index 670ea05bcf..b313f575fc 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions : INe /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsKlarnaOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsKlarnaOptions.cs index 4d707a9c63..069b8448d7 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsKlarnaOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsKlarnaOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsKlarnaOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsKlarnaOptions : INestedOptions, IHasSetTracking { + private List subscriptions; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The currency of the SetupIntent. Three letter ISO currency code. /// @@ -43,6 +49,19 @@ public class SetupIntentPaymentMethodOptionsKlarnaOptions : INestedOptions /// [JsonProperty("subscriptions")] [STJS.JsonPropertyName("subscriptions")] - public List Subscriptions { get; set; } + public List Subscriptions + { + get => this.subscriptions; + set + { + this.subscriptions = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs index ce75e4a86b..d56286c515 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions.cs @@ -6,14 +6,34 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INestedOptions, IHasSetTracking { + private long? amount; + private string amountType; + private string endDate; + private string paymentSchedule; + private long? paymentsPerPeriod; + private string purpose; + private string startDate; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Amount that will be collected. It is required when amount_type is fixed. /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// The type of amount that will be collected. The amount charged must be exact or up to the @@ -23,7 +43,15 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("amount_type")] [STJS.JsonPropertyName("amount_type")] - public string AmountType { get; set; } + public string AmountType + { + get => this.amountType; + set + { + this.amountType = value; + this.SetTracker.Track(); + } + } /// /// Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no @@ -31,7 +59,15 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("end_date")] [STJS.JsonPropertyName("end_date")] - public string EndDate { get; set; } + public string EndDate + { + get => this.endDate; + set + { + this.endDate = value; + this.SetTracker.Track(); + } + } /// /// The periodicity at which payments will be collected. Defaults to adhoc. @@ -40,7 +76,15 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("payment_schedule")] [STJS.JsonPropertyName("payment_schedule")] - public string PaymentSchedule { get; set; } + public string PaymentSchedule + { + get => this.paymentSchedule; + set + { + this.paymentSchedule = value; + this.SetTracker.Track(); + } + } /// /// The number of payments that will be made during a payment period. Defaults to 1 except @@ -48,7 +92,15 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("payments_per_period")] [STJS.JsonPropertyName("payments_per_period")] - public long? PaymentsPerPeriod { get; set; } + public long? PaymentsPerPeriod + { + get => this.paymentsPerPeriod; + set + { + this.paymentsPerPeriod = value; + this.SetTracker.Track(); + } + } /// /// The purpose for which payments are made. Has a default value based on your merchant @@ -59,7 +111,15 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("purpose")] [STJS.JsonPropertyName("purpose")] - public string Purpose { get; set; } + public string Purpose + { + get => this.purpose; + set + { + this.purpose = value; + this.SetTracker.Track(); + } + } /// /// Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to @@ -67,6 +127,19 @@ public class SetupIntentPaymentMethodOptionsPaytoMandateOptionsOptions : INested /// [JsonProperty("start_date")] [STJS.JsonPropertyName("start_date")] - public string StartDate { get; set; } + public string StartDate + { + get => this.startDate; + set + { + this.startDate = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs index 2f81c779ac..13f26eb329 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string referencePrefix; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must /// consist of only uppercase letters, numbers, spaces, or the following special characters: @@ -15,6 +21,19 @@ public class SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions : INe /// [JsonProperty("reference_prefix")] [STJS.JsonPropertyName("reference_prefix")] - public string ReferencePrefix { get; set; } + public string ReferencePrefix + { + get => this.referencePrefix; + set + { + this.referencePrefix = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUpiOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUpiOptions.cs index ee257c2415..e11860e49a 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUpiOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUpiOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsUpiOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsUpiOptions : INestedOptions, IHasSetTracking { + private string setupFutureUsage; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Configuration options for setting up an eMandate. /// @@ -20,6 +26,19 @@ public class SetupIntentPaymentMethodOptionsUpiOptions : INestedOptions /// [JsonProperty("setup_future_usage")] [STJS.JsonPropertyName("setup_future_usage")] - public string SetupFutureUsage { get; set; } + public string SetupFutureUsage + { + get => this.setupFutureUsage; + set + { + this.setupFutureUsage = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs index fe4a8ecca2..e9daaeb775 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions.cs @@ -6,13 +6,32 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions : INestedOptions + public class SetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsOptions : INestedOptions, IHasSetTracking { + private string collectionMethod; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The method used to collect offline mandate customer acceptance. /// [JsonProperty("collection_method")] [STJS.JsonPropertyName("collection_method")] - public string CollectionMethod { get; set; } + public string CollectionMethod + { + get => this.collectionMethod; + set + { + this.collectionMethod = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SetupIntents/SetupIntentUpdateOptions.cs b/src/Stripe.net/Services/SetupIntents/SetupIntentUpdateOptions.cs index d637a72c5e..cbce69f94d 100644 --- a/src/Stripe.net/Services/SetupIntents/SetupIntentUpdateOptions.cs +++ b/src/Stripe.net/Services/SetupIntents/SetupIntentUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SetupIntentUpdateOptions : BaseOptions, IHasMetadata { + private List excludedPaymentMethodTypes; + private Dictionary metadata; + /// /// If present, the SetupIntent's payment method will be attached to the in-context Stripe /// Account. @@ -68,7 +71,15 @@ public class SetupIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("excluded_payment_method_types")] [STJS.JsonPropertyName("excluded_payment_method_types")] - public List ExcludedPaymentMethodTypes { get; set; } + public List ExcludedPaymentMethodTypes + { + get => this.excludedPaymentMethodTypes; + set + { + this.excludedPaymentMethodTypes = value; + this.SetTracker.Track(); + } + } /// /// Indicates the directions of money movement for which this payment method is intended to @@ -92,7 +103,15 @@ public class SetupIntentUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to diff --git a/src/Stripe.net/Services/ShippingRates/ShippingRateUpdateOptions.cs b/src/Stripe.net/Services/ShippingRates/ShippingRateUpdateOptions.cs index 4c2ab4e721..6b706a3a7c 100644 --- a/src/Stripe.net/Services/ShippingRates/ShippingRateUpdateOptions.cs +++ b/src/Stripe.net/Services/ShippingRates/ShippingRateUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ShippingRateUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Whether the shipping rate can be used for new purchases. Defaults to true. /// @@ -32,7 +34,15 @@ public class ShippingRateUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One diff --git a/src/Stripe.net/Services/Sources/SourceMandateOptions.cs b/src/Stripe.net/Services/Sources/SourceMandateOptions.cs index 101de06710..fc04224999 100644 --- a/src/Stripe.net/Services/Sources/SourceMandateOptions.cs +++ b/src/Stripe.net/Services/Sources/SourceMandateOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SourceMandateOptions : INestedOptions + public class SourceMandateOptions : INestedOptions, IHasSetTracking { + private long? amount; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The parameters required to notify Stripe of a mandate acceptance or refusal by the /// customer. @@ -21,7 +27,15 @@ public class SourceMandateOptions : INestedOptions /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public long? Amount { get; set; } + public long? Amount + { + get => this.amount; + set + { + this.amount = value; + this.SetTracker.Track(); + } + } /// /// The currency specified by the mandate. (Must match currency of the source). @@ -53,5 +67,10 @@ public class SourceMandateOptions : INestedOptions [JsonProperty("notification_method")] [STJS.JsonPropertyName("notification_method")] public string NotificationMethod { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs b/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs index 42d43adb16..edf0336b92 100644 --- a/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs +++ b/src/Stripe.net/Services/Sources/SourceUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SourceUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Amount associated with the source. /// @@ -36,7 +38,15 @@ public class SourceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Information about the owner of the payment instrument that may be used or required by diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs index ef67f28959..9011fb4516 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs @@ -10,13 +10,25 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionItemCreateOptions : BaseOptions, IHasMetadata { + private SubscriptionItemBillingThresholdsOptions billingThresholds; + private List discounts; + private List taxRates; + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// The trial offer to apply to this subscription item. @@ -30,7 +42,15 @@ public class SubscriptionItemCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -145,7 +165,15 @@ public class SubscriptionItemCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Options that configure the trial on the subscription item. diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs index bc0f5a64c0..5098a4d2a1 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs @@ -10,13 +10,26 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata { + private SubscriptionItemBillingThresholdsOptions billingThresholds; + private List discounts; + private Dictionary metadata; + private List taxRates; + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// The trial offer to apply to this subscription item. @@ -30,7 +43,15 @@ public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -40,7 +61,15 @@ public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Indicates if a customer is on or off-session while an invoice payment is attempted. @@ -148,6 +177,14 @@ public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendOptions.cs index 75d2d0ebec..049dce968a 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionScheduleAmendOptions : BaseOptions { + private List prebilling; + /// /// Changes to apply to the phases of the subscription schedule, in the order provided. /// @@ -21,7 +23,15 @@ public class SubscriptionScheduleAmendOptions : BaseOptions /// [JsonProperty("prebilling")] [STJS.JsonPropertyName("prebilling")] - public List Prebilling { get; set; } + public List Prebilling + { + get => this.prebilling; + set + { + this.prebilling = value; + this.SetTracker.Track(); + } + } /// /// In cases where the amendment changes the currently active phase, specifies if and how to diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendmentMetadataActionOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendmentMetadataActionOptions.cs index d07827fca5..268b2a2d63 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendmentMetadataActionOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleAmendmentMetadataActionOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionScheduleAmendmentMetadataActionOptions : INestedOptions + public class SubscriptionScheduleAmendmentMetadataActionOptions : INestedOptions, IHasSetTracking { + private Dictionary set; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Key-value pairs to add to schedule phase metadata. These values will merge with existing /// schedule phase metadata. @@ -30,7 +36,15 @@ public class SubscriptionScheduleAmendmentMetadataActionOptions : INestedOptions /// [JsonProperty("set")] [STJS.JsonPropertyName("set")] - public Dictionary Set { get; set; } + public Dictionary Set + { + get => this.set; + set + { + this.set = value; + this.SetTracker.Track(); + } + } /// /// Select one of three ways to update phase-level metadata on subscription @@ -40,5 +54,10 @@ public class SubscriptionScheduleAmendmentMetadataActionOptions : INestedOptions [JsonProperty("type")] [STJS.JsonPropertyName("type")] public string Type { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs index 624a331ab5..2da1c50925 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs @@ -10,6 +10,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionScheduleCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Configures when the subscription schedule generates prorations for phase transitions. /// Possible values are prorate_on_next_phase or prorate_up_front with the @@ -81,7 +83,15 @@ public class SubscriptionScheduleCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// List representing phases of the subscription schedule. Each phase can be customized to diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions.cs index 4d4a1449dd..9c9d793a4d 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions.cs @@ -7,15 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions : INestedOptions + public class SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions : INestedOptions, IHasSetTracking { + private List accountTaxIds; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with the subscription schedule. Will be set on invoices /// generated by the subscription schedule. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Number of days within which a customer must pay invoices generated by this subscription @@ -33,5 +47,10 @@ public class SubscriptionScheduleDefaultSettingsInvoiceSettingsOptions : INested [JsonProperty("issuer")] [STJS.JsonPropertyName("issuer")] public SubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerOptions Issuer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsOptions.cs index 6d0850f817..e46444e612 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleDefaultSettingsOptions.cs @@ -6,8 +6,17 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions + public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions, IHasSetTracking { + private SubscriptionScheduleDefaultSettingsBillingThresholdsOptions billingThresholds; + private string description; + private string onBehalfOf; + private SubscriptionScheduleDefaultSettingsTransferDataOptions transferData; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A non-negative decimal between 0 and 100, with at most two decimal places. This /// represents the percentage of the subscription invoice total that will be transferred to @@ -45,7 +54,15 @@ public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionScheduleDefaultSettingsBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionScheduleDefaultSettingsBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// Either charge_automatically, or send_invoice. When charging automatically, @@ -75,7 +92,15 @@ public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// All invoices will be billed using the specified settings. @@ -90,7 +115,15 @@ public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// The data with which to automatically create a Transfer for each of the associated @@ -98,6 +131,19 @@ public class SubscriptionScheduleDefaultSettingsOptions : INestedOptions /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public SubscriptionScheduleDefaultSettingsTransferDataOptions TransferData { get; set; } + public SubscriptionScheduleDefaultSettingsTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs index 9be7fac113..fd040e03d8 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata + public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The coupons to redeem into discounts for the item. /// @@ -63,6 +69,19 @@ public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions, IH /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseInvoiceSettingsOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseInvoiceSettingsOptions.cs index 148bc4b1e6..ffc904a6db 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseInvoiceSettingsOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseInvoiceSettingsOptions.cs @@ -7,15 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionSchedulePhaseInvoiceSettingsOptions : INestedOptions + public class SubscriptionSchedulePhaseInvoiceSettingsOptions : INestedOptions, IHasSetTracking { + private List accountTaxIds; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with this phase of the subscription schedule. Will be set /// on invoices generated by this phase of the subscription schedule. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// Number of days within which a customer must pay invoices generated by this subscription @@ -33,5 +47,10 @@ public class SubscriptionSchedulePhaseInvoiceSettingsOptions : INestedOptions [JsonProperty("issuer")] [STJS.JsonPropertyName("issuer")] public SubscriptionSchedulePhaseInvoiceSettingsIssuerOptions Issuer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseItemOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseItemOptions.cs index 0888c6dff1..32a4b6adf8 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseItemOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseItemOptions.cs @@ -7,22 +7,46 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionSchedulePhaseItemOptions : INestedOptions, IHasMetadata + public class SubscriptionSchedulePhaseItemOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private SubscriptionSchedulePhaseItemBillingThresholdsOptions billingThresholds; + private List discounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionSchedulePhaseItemBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionSchedulePhaseItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// The coupons to redeem into discounts for the subscription item. /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -78,7 +102,15 @@ public class SubscriptionSchedulePhaseItemOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Options that configure the trial on the subscription item. @@ -93,5 +125,10 @@ public class SubscriptionSchedulePhaseItemOptions : INestedOptions, IHasMetadata [JsonProperty("trial_offer")] [STJS.JsonPropertyName("trial_offer")] public string TrialOffer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseOptions.cs index 72cbfda6a6..b6a7fd0c81 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseOptions.cs @@ -8,8 +8,17 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata + public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private SubscriptionSchedulePhaseBillingThresholdsOptions billingThresholds; + private List defaultTaxRates; + private string description; + private List discounts; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A list of prices and quantities that will generate invoice items appended to the next /// invoice for this phase. You may pass up to 20 items. @@ -55,7 +64,15 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionSchedulePhaseBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionSchedulePhaseBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// Either charge_automatically, or send_invoice. When charging automatically, @@ -97,7 +114,15 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// Subscription description, meant to be displayable to the customer. Use this field to @@ -106,7 +131,15 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The coupons to redeem into discounts for the schedule phase. If not specified, inherits @@ -115,7 +148,15 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// The number of intervals the phase should last. If set, end_date must not be set. @@ -245,5 +286,10 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata [JsonProperty("trial_settings")] [STJS.JsonPropertyName("trial_settings")] public SubscriptionSchedulePhaseTrialSettingsOptions TrialSettings { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs index efbdc0e8d4..3b42feb5bf 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionScheduleUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Configures when the subscription schedule generates prorations for phase transitions. /// Possible values are prorate_on_next_phase or prorate_up_front with the @@ -48,7 +50,15 @@ public class SubscriptionScheduleUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// List representing phases of the subscription schedule. Each phase can be customized to diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs index e57347eb14..fc30c4920e 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionAddInvoiceItemOptions : INestedOptions, IHasMetadata + public class SubscriptionAddInvoiceItemOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The coupons to redeem into discounts for the item. /// @@ -63,6 +69,19 @@ public class SubscriptionAddInvoiceItemOptions : INestedOptions, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchor.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchor.cs index 022dfed7ff..e9a8eaf9d2 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchor.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchor.cs @@ -1,5 +1,8 @@ namespace Stripe { + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(Infrastructure.STJStringEnumConverterFactory))] public class SubscriptionBillingCycleAnchor : StringEnum { /// Resets the subscription's billing cycle anchor to the current time. diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCancellationDetailsOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCancellationDetailsOptions.cs index ddce4d3f33..575b89f23f 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCancellationDetailsOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCancellationDetailsOptions.cs @@ -6,15 +6,30 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionCancellationDetailsOptions : INestedOptions + public class SubscriptionCancellationDetailsOptions : INestedOptions, IHasSetTracking { + private string comment; + private string feedback; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional comments about why the user canceled the subscription, if the subscription /// was canceled explicitly by the user. /// [JsonProperty("comment")] [STJS.JsonPropertyName("comment")] - public string Comment { get; set; } + public string Comment + { + get => this.comment; + set + { + this.comment = value; + this.SetTracker.Track(); + } + } /// /// The customer submitted reason for why they canceled, if the subscription was canceled @@ -25,6 +40,19 @@ public class SubscriptionCancellationDetailsOptions : INestedOptions /// [JsonProperty("feedback")] [STJS.JsonPropertyName("feedback")] - public string Feedback { get; set; } + public string Feedback + { + get => this.feedback; + set + { + this.feedback = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs index ddc3103c94..b24604e80b 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs @@ -10,6 +10,14 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionCreateOptions : BaseOptions, IHasMetadata { + private decimal? applicationFeePercent; + private SubscriptionBillingThresholdsOptions billingThresholds; + private List defaultTaxRates; + private List discounts; + private Dictionary metadata; + private string onBehalfOf; + private SubscriptionPendingInvoiceItemIntervalOptions pendingInvoiceItemInterval; + /// /// A list of prices and quantities that will generate invoice items appended to the next /// invoice for this subscription. You may pass up to 20 items. @@ -28,7 +36,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_percent")] [STJS.JsonPropertyName("application_fee_percent")] - public decimal? ApplicationFeePercent { get; set; } + public decimal? ApplicationFeePercent + { + get => this.applicationFeePercent; + set + { + this.applicationFeePercent = value; + this.SetTracker.Track(); + } + } /// /// Automatic tax settings for this subscription. @@ -91,7 +107,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// A timestamp at which the subscription should cancel. If set to a date before the current @@ -188,7 +212,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// The subscription's description, meant to be displayable to the customer. Use this field @@ -205,7 +237,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// All invoices will be billed using the specified settings. @@ -229,7 +269,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Indicates if a customer is on or off-session while an invoice payment is attempted. @@ -244,7 +292,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// Only applies to subscriptions with collection_method=charge_automatically. @@ -300,7 +356,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("pending_invoice_item_interval")] [STJS.JsonPropertyName("pending_invoice_item_interval")] - public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } + public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval + { + get => this.pendingInvoiceItemInterval; + set + { + this.pendingInvoiceItemInterval = value; + this.SetTracker.Track(); + } + } /// /// If specified, the invoicing for the given billing cycle iterations will be processed diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionInvoiceSettingsOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionInvoiceSettingsOptions.cs index 74ea67d637..7335554b13 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionInvoiceSettingsOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionInvoiceSettingsOptions.cs @@ -7,15 +7,29 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionInvoiceSettingsOptions : INestedOptions + public class SubscriptionInvoiceSettingsOptions : INestedOptions, IHasSetTracking { + private List accountTaxIds; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The account tax IDs associated with the subscription. Will be set on invoices generated /// by the subscription. /// [JsonProperty("account_tax_ids")] [STJS.JsonPropertyName("account_tax_ids")] - public List AccountTaxIds { get; set; } + public List AccountTaxIds + { + get => this.accountTaxIds; + set + { + this.accountTaxIds = value; + this.SetTracker.Track(); + } + } /// /// The connected account that issues the invoice. The invoice is presented with the @@ -24,5 +38,10 @@ public class SubscriptionInvoiceSettingsOptions : INestedOptions [JsonProperty("issuer")] [STJS.JsonPropertyName("issuer")] public SubscriptionInvoiceSettingsIssuerOptions Issuer { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionItemOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionItemOptions.cs index 60e157beba..004cf32ba3 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionItemOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionItemOptions.cs @@ -7,15 +7,31 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionItemOptions : INestedOptions, IHasId, IHasMetadata + public class SubscriptionItemOptions : INestedOptions, IHasId, IHasMetadata, IHasSetTracking { + private SubscriptionItemBillingThresholdsOptions billingThresholds; + private List discounts; + private List taxRates; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a /// new billing period. Pass an empty string to remove previously-defined thresholds. /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionItemBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// Delete all usage for a given subscription item. You must pass this when deleting a usage @@ -45,7 +61,15 @@ public class SubscriptionItemOptions : INestedOptions, IHasId, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// Subscription item to update. @@ -104,7 +128,15 @@ public class SubscriptionItemOptions : INestedOptions, IHasId, IHasMetadata /// [JsonProperty("tax_rates")] [STJS.JsonPropertyName("tax_rates")] - public List TaxRates { get; set; } + public List TaxRates + { + get => this.taxRates; + set + { + this.taxRates = value; + this.SetTracker.Track(); + } + } /// /// Define options to configure the trial on the subscription item. @@ -112,5 +144,10 @@ public class SubscriptionItemOptions : INestedOptions, IHasId, IHasMetadata [JsonProperty("trial")] [STJS.JsonPropertyName("trial")] public SubscriptionItemTrialOptions Trial { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsOptions.cs index ca9f8e4919..01feb79a88 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionPaymentSettingsOptions : INestedOptions + public class SubscriptionPaymentSettingsOptions : INestedOptions, IHasSetTracking { + private List paymentMethodTypes; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Payment-method-specific configuration to provide to invoices created by the /// subscription. @@ -38,7 +44,15 @@ public class SubscriptionPaymentSettingsOptions : INestedOptions /// [JsonProperty("payment_method_types")] [STJS.JsonPropertyName("payment_method_types")] - public List PaymentMethodTypes { get; set; } + public List PaymentMethodTypes + { + get => this.paymentMethodTypes; + set + { + this.paymentMethodTypes = value; + this.SetTracker.Track(); + } + } /// /// Configure whether Stripe updates subscription.default_payment_method when payment @@ -48,5 +62,10 @@ public class SubscriptionPaymentSettingsOptions : INestedOptions [JsonProperty("save_default_payment_method")] [STJS.JsonPropertyName("save_default_payment_method")] public string SaveDefaultPaymentMethod { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsPaymentMethodOptionsOptions.cs index e7184c45d9..085f90bf26 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionPaymentSettingsPaymentMethodOptionsOptions.cs @@ -6,15 +6,39 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOptions + public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private SubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitOptions acssDebit; + private SubscriptionPaymentSettingsPaymentMethodOptionsBancontactOptions bancontact; + private SubscriptionPaymentSettingsPaymentMethodOptionsCardOptions card; + private SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions customerBalance; + private SubscriptionPaymentSettingsPaymentMethodOptionsIdBankTransferOptions idBankTransfer; + private SubscriptionPaymentSettingsPaymentMethodOptionsKonbiniOptions konbini; + private SubscriptionPaymentSettingsPaymentMethodOptionsPaytoOptions payto; + private SubscriptionPaymentSettingsPaymentMethodOptionsPixOptions pix; + private SubscriptionPaymentSettingsPaymentMethodOptionsSepaDebitOptions sepaDebit; + private SubscriptionPaymentSettingsPaymentMethodOptionsUpiOptions upi; + private SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountOptions usBankAccount; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// This sub-hash contains details about the Canadian pre-authorized debit payment method /// options to pass to the invoice’s PaymentIntent. /// [JsonProperty("acss_debit")] [STJS.JsonPropertyName("acss_debit")] - public SubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitOptions AcssDebit + { + get => this.acssDebit; + set + { + this.acssDebit = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Bancontact payment method options to pass to @@ -22,7 +46,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("bancontact")] [STJS.JsonPropertyName("bancontact")] - public SubscriptionPaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsBancontactOptions Bancontact + { + get => this.bancontact; + set + { + this.bancontact = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Card payment method options to pass to the @@ -30,7 +62,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("card")] [STJS.JsonPropertyName("card")] - public SubscriptionPaymentSettingsPaymentMethodOptionsCardOptions Card { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsCardOptions Card + { + get => this.card; + set + { + this.card = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Bank transfer payment method options to pass to @@ -38,7 +78,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("customer_balance")] [STJS.JsonPropertyName("customer_balance")] - public SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceOptions CustomerBalance + { + get => this.customerBalance; + set + { + this.customerBalance = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Indonesia bank transfer payment method options @@ -46,7 +94,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("id_bank_transfer")] [STJS.JsonPropertyName("id_bank_transfer")] - public SubscriptionPaymentSettingsPaymentMethodOptionsIdBankTransferOptions IdBankTransfer { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsIdBankTransferOptions IdBankTransfer + { + get => this.idBankTransfer; + set + { + this.idBankTransfer = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Konbini payment method options to pass to the @@ -54,7 +110,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("konbini")] [STJS.JsonPropertyName("konbini")] - public SubscriptionPaymentSettingsPaymentMethodOptionsKonbiniOptions Konbini { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsKonbiniOptions Konbini + { + get => this.konbini; + set + { + this.konbini = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the PayTo payment method options to pass to the @@ -62,7 +126,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("payto")] [STJS.JsonPropertyName("payto")] - public SubscriptionPaymentSettingsPaymentMethodOptionsPaytoOptions Payto { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsPaytoOptions Payto + { + get => this.payto; + set + { + this.payto = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the Pix payment method options to pass to the @@ -70,7 +142,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("pix")] [STJS.JsonPropertyName("pix")] - public SubscriptionPaymentSettingsPaymentMethodOptionsPixOptions Pix { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsPixOptions Pix + { + get => this.pix; + set + { + this.pix = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the SEPA Direct Debit payment method options to @@ -78,7 +158,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("sepa_debit")] [STJS.JsonPropertyName("sepa_debit")] - public SubscriptionPaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsSepaDebitOptions SepaDebit + { + get => this.sepaDebit; + set + { + this.sepaDebit = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the UPI payment method options to pass to the @@ -86,7 +174,15 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("upi")] [STJS.JsonPropertyName("upi")] - public SubscriptionPaymentSettingsPaymentMethodOptionsUpiOptions Upi { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsUpiOptions Upi + { + get => this.upi; + set + { + this.upi = value; + this.SetTracker.Track(); + } + } /// /// This sub-hash contains details about the ACH direct debit payment method options to pass @@ -94,6 +190,19 @@ public class SubscriptionPaymentSettingsPaymentMethodOptionsOptions : INestedOpt /// [JsonProperty("us_bank_account")] [STJS.JsonPropertyName("us_bank_account")] - public SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountOptions UsBankAccount { get; set; } + public SubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountOptions UsBankAccount + { + get => this.usBankAccount; + set + { + this.usBankAccount = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs index 7efa5cc33b..fc5548b2e8 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs @@ -10,6 +10,20 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata { + private decimal? applicationFeePercent; + private List billingSchedules; + private SubscriptionBillingThresholdsOptions billingThresholds; + private AnyOf cancelAt; + private string defaultSource; + private List defaultTaxRates; + private string description; + private List discounts; + private Dictionary metadata; + private string onBehalfOf; + private SubscriptionPauseCollectionOptions pauseCollection; + private SubscriptionPendingInvoiceItemIntervalOptions pendingInvoiceItemInterval; + private SubscriptionTransferDataOptions transferData; + /// /// A list of prices and quantities that will generate invoice items appended to the next /// invoice for this subscription. You may pass up to 20 items. @@ -28,7 +42,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("application_fee_percent")] [STJS.JsonPropertyName("application_fee_percent")] - public decimal? ApplicationFeePercent { get; set; } + public decimal? ApplicationFeePercent + { + get => this.applicationFeePercent; + set + { + this.applicationFeePercent = value; + this.SetTracker.Track(); + } + } /// /// Automatic tax settings for this subscription. We recommend you only include this @@ -54,7 +76,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("billing_schedules")] [STJS.JsonPropertyName("billing_schedules")] - public List BillingSchedules { get; set; } + public List BillingSchedules + { + get => this.billingSchedules; + set + { + this.billingSchedules = value; + this.SetTracker.Track(); + } + } /// /// Define thresholds at which an invoice will be sent, and the subscription advanced to a @@ -63,7 +93,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("billing_thresholds")] [STJS.JsonPropertyName("billing_thresholds")] - public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } + public SubscriptionBillingThresholdsOptions BillingThresholds + { + get => this.billingThresholds; + set + { + this.billingThresholds = value; + this.SetTracker.Track(); + } + } /// /// A timestamp at which the subscription should cancel. If set to a date before the current @@ -75,7 +113,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata [JsonConverter(typeof(AnyOfConverter))] [STJS.JsonPropertyName("cancel_at")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] - public AnyOf CancelAt { get; set; } + public AnyOf CancelAt + { + get => this.cancelAt; + set + { + this.cancelAt = value; + this.SetTracker.Track(); + } + } /// /// Indicate whether this subscription should cancel at the end of the current period @@ -135,7 +181,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_source")] [STJS.JsonPropertyName("default_source")] - public string DefaultSource { get; set; } + public string DefaultSource + { + get => this.defaultSource; + set + { + this.defaultSource = value; + this.SetTracker.Track(); + } + } /// /// The tax rates that will apply to any subscription item that does not have @@ -145,7 +199,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("default_tax_rates")] [STJS.JsonPropertyName("default_tax_rates")] - public List DefaultTaxRates { get; set; } + public List DefaultTaxRates + { + get => this.defaultTaxRates; + set + { + this.defaultTaxRates = value; + this.SetTracker.Track(); + } + } /// /// The subscription's description, meant to be displayable to the customer. Use this field @@ -154,7 +216,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The coupons to redeem into discounts for the subscription. If not specified or empty, @@ -162,7 +232,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("discounts")] [STJS.JsonPropertyName("discounts")] - public List Discounts { get; set; } + public List Discounts + { + get => this.discounts; + set + { + this.discounts = value; + this.SetTracker.Track(); + } + } /// /// All invoices will be billed using the specified settings. @@ -186,7 +264,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Indicates if a customer is on or off-session while an invoice payment is attempted. @@ -201,7 +287,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("on_behalf_of")] [STJS.JsonPropertyName("on_behalf_of")] - public string OnBehalfOf { get; set; } + public string OnBehalfOf + { + get => this.onBehalfOf; + set + { + this.onBehalfOf = value; + this.SetTracker.Track(); + } + } /// /// If specified, payment collection for this subscription will be paused. Note that the @@ -211,7 +305,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("pause_collection")] [STJS.JsonPropertyName("pause_collection")] - public SubscriptionPauseCollectionOptions PauseCollection { get; set; } + public SubscriptionPauseCollectionOptions PauseCollection + { + get => this.pauseCollection; + set + { + this.pauseCollection = value; + this.SetTracker.Track(); + } + } /// /// Use allow_incomplete to transition the subscription to status=past_due if @@ -262,7 +364,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("pending_invoice_item_interval")] [STJS.JsonPropertyName("pending_invoice_item_interval")] - public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } + public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval + { + get => this.pendingInvoiceItemInterval; + set + { + this.pendingInvoiceItemInterval = value; + this.SetTracker.Track(); + } + } /// /// If specified, the invoicing for the given billing cycle iterations will be processed @@ -305,7 +415,15 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("transfer_data")] [STJS.JsonPropertyName("transfer_data")] - public SubscriptionTransferDataOptions TransferData { get; set; } + public SubscriptionTransferDataOptions TransferData + { + get => this.transferData; + set + { + this.transferData = value; + this.SetTracker.Track(); + } + } /// /// Unix timestamp representing the end of the trial period the customer will get before diff --git a/src/Stripe.net/Services/Tax/Registrations/RegistrationUpdateOptions.cs b/src/Stripe.net/Services/Tax/Registrations/RegistrationUpdateOptions.cs index ae290db23e..d341d068e9 100644 --- a/src/Stripe.net/Services/Tax/Registrations/RegistrationUpdateOptions.cs +++ b/src/Stripe.net/Services/Tax/Registrations/RegistrationUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Tax [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class RegistrationUpdateOptions : BaseOptions { + private AnyOf expiresAt; + /// /// Time at which the registration becomes active. It can be either now to indicate /// the current time, or a timestamp measured in seconds since the Unix epoch. @@ -28,6 +30,14 @@ public class RegistrationUpdateOptions : BaseOptions [JsonConverter(typeof(AnyOfConverter))] [STJS.JsonPropertyName("expires_at")] [STJS.JsonConverter(typeof(STJAnyOfConverter))] - public AnyOf ExpiresAt { get; set; } + public AnyOf ExpiresAt + { + get => this.expiresAt; + set + { + this.expiresAt = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/TaxRates/TaxRateUpdateOptions.cs b/src/Stripe.net/Services/TaxRates/TaxRateUpdateOptions.cs index 8a5329c0a2..d40fcd7b23 100644 --- a/src/Stripe.net/Services/TaxRates/TaxRateUpdateOptions.cs +++ b/src/Stripe.net/Services/TaxRates/TaxRateUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TaxRateUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Flag determining whether the tax rate is active or inactive (archived). Inactive tax /// rates cannot be used with new applications or Checkout Sessions, but will still work for @@ -57,7 +59,15 @@ public class TaxRateUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// ISO 3166-2 subdivision code, diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWisepad3Options.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWisepad3Options.cs index 6d3bbe5cee..d7db60a1e3 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWisepad3Options.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWisepad3Options.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationBbposWisepad3Options : INestedOptions + public class ConfigurationBbposWisepad3Options : INestedOptions, IHasSetTracking { + private string splashscreen; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A File ID representing an image you want to display on the reader. /// [JsonProperty("splashscreen")] [STJS.JsonPropertyName("splashscreen")] - public string Splashscreen { get; set; } + public string Splashscreen + { + get => this.splashscreen; + set + { + this.splashscreen = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWiseposEOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWiseposEOptions.cs index 1636c11e5f..22d0a034fd 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWiseposEOptions.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationBbposWiseposEOptions.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationBbposWiseposEOptions : INestedOptions + public class ConfigurationBbposWiseposEOptions : INestedOptions, IHasSetTracking { + private string splashscreen; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A File ID representing an image to display on the reader. /// [JsonProperty("splashscreen")] [STJS.JsonPropertyName("splashscreen")] - public string Splashscreen { get; set; } + public string Splashscreen + { + get => this.splashscreen; + set + { + this.splashscreen = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationCreateOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationCreateOptions.cs index 10883c9bdc..dc22d72cd8 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationCreateOptions.cs @@ -8,6 +8,12 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ConfigurationCreateOptions : BaseOptions { + private ConfigurationCellularOptions cellular; + private ConfigurationOfflineOptions offline; + private ConfigurationReaderSecurityOptions readerSecurity; + private ConfigurationTippingOptions tipping; + private ConfigurationWifiOptions wifi; + /// /// An object containing device type specific settings for BBPOS WisePad 3 readers. /// @@ -27,7 +33,15 @@ public class ConfigurationCreateOptions : BaseOptions /// [JsonProperty("cellular")] [STJS.JsonPropertyName("cellular")] - public ConfigurationCellularOptions Cellular { get; set; } + public ConfigurationCellularOptions Cellular + { + get => this.cellular; + set + { + this.cellular = value; + this.SetTracker.Track(); + } + } /// /// Name of the configuration. @@ -41,14 +55,30 @@ public class ConfigurationCreateOptions : BaseOptions /// [JsonProperty("offline")] [STJS.JsonPropertyName("offline")] - public ConfigurationOfflineOptions Offline { get; set; } + public ConfigurationOfflineOptions Offline + { + get => this.offline; + set + { + this.offline = value; + this.SetTracker.Track(); + } + } /// /// Configurations for reader security settings. /// [JsonProperty("reader_security")] [STJS.JsonPropertyName("reader_security")] - public ConfigurationReaderSecurityOptions ReaderSecurity { get; set; } + public ConfigurationReaderSecurityOptions ReaderSecurity + { + get => this.readerSecurity; + set + { + this.readerSecurity = value; + this.SetTracker.Track(); + } + } /// /// Reboot time settings for readers. that support customized reboot time configuration. @@ -76,7 +106,15 @@ public class ConfigurationCreateOptions : BaseOptions /// [JsonProperty("tipping")] [STJS.JsonPropertyName("tipping")] - public ConfigurationTippingOptions Tipping { get; set; } + public ConfigurationTippingOptions Tipping + { + get => this.tipping; + set + { + this.tipping = value; + this.SetTracker.Track(); + } + } /// /// An object containing device type specific settings for Verifone P400 readers. @@ -90,6 +128,14 @@ public class ConfigurationCreateOptions : BaseOptions /// [JsonProperty("wifi")] [STJS.JsonPropertyName("wifi")] - public ConfigurationWifiOptions Wifi { get; set; } + public ConfigurationWifiOptions Wifi + { + get => this.wifi; + set + { + this.wifi = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationReaderSecurityOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationReaderSecurityOptions.cs index 90319763d0..ae3909f16b 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationReaderSecurityOptions.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationReaderSecurityOptions.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationReaderSecurityOptions : INestedOptions + public class ConfigurationReaderSecurityOptions : INestedOptions, IHasSetTracking { + private string adminMenuPasscode; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Passcode used to access a reader's admin menu. /// [JsonProperty("admin_menu_passcode")] [STJS.JsonPropertyName("admin_menu_passcode")] - public string AdminMenuPasscode { get; set; } + public string AdminMenuPasscode + { + get => this.adminMenuPasscode; + set + { + this.adminMenuPasscode = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS700Options.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS700Options.cs index 87d4c51b07..2f4792930c 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS700Options.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS700Options.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationStripeS700Options : INestedOptions + public class ConfigurationStripeS700Options : INestedOptions, IHasSetTracking { + private string splashscreen; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A File ID representing an image you want to display on the reader. /// [JsonProperty("splashscreen")] [STJS.JsonPropertyName("splashscreen")] - public string Splashscreen { get; set; } + public string Splashscreen + { + get => this.splashscreen; + set + { + this.splashscreen = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS710Options.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS710Options.cs index aa555a8500..678b955f57 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS710Options.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS710Options.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationStripeS710Options : INestedOptions + public class ConfigurationStripeS710Options : INestedOptions, IHasSetTracking { + private string splashscreen; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A File ID representing an image you want to display on the reader. /// [JsonProperty("splashscreen")] [STJS.JsonPropertyName("splashscreen")] - public string Splashscreen { get; set; } + public string Splashscreen + { + get => this.splashscreen; + set + { + this.splashscreen = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationUpdateOptions.cs index cf57686be7..61c091ac38 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationUpdateOptions.cs @@ -8,26 +8,62 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ConfigurationUpdateOptions : BaseOptions { + private ConfigurationBbposWisepad3Options bbposWisepad3; + private ConfigurationBbposWiseposEOptions bbposWiseposE; + private ConfigurationCellularOptions cellular; + private ConfigurationOfflineOptions offline; + private ConfigurationReaderSecurityOptions readerSecurity; + private ConfigurationRebootWindowOptions rebootWindow; + private ConfigurationStripeS700Options stripeS700; + private ConfigurationStripeS710Options stripeS710; + private ConfigurationTippingOptions tipping; + private ConfigurationVerifoneP400Options verifoneP400; + private ConfigurationWifiOptions wifi; + /// /// An object containing device type specific settings for BBPOS WisePad 3 readers. /// [JsonProperty("bbpos_wisepad3")] [STJS.JsonPropertyName("bbpos_wisepad3")] - public ConfigurationBbposWisepad3Options BbposWisepad3 { get; set; } + public ConfigurationBbposWisepad3Options BbposWisepad3 + { + get => this.bbposWisepad3; + set + { + this.bbposWisepad3 = value; + this.SetTracker.Track(); + } + } /// /// An object containing device type specific settings for BBPOS WisePOS E readers. /// [JsonProperty("bbpos_wisepos_e")] [STJS.JsonPropertyName("bbpos_wisepos_e")] - public ConfigurationBbposWiseposEOptions BbposWiseposE { get; set; } + public ConfigurationBbposWiseposEOptions BbposWiseposE + { + get => this.bbposWiseposE; + set + { + this.bbposWiseposE = value; + this.SetTracker.Track(); + } + } /// /// Configuration for cellular connectivity. /// [JsonProperty("cellular")] [STJS.JsonPropertyName("cellular")] - public ConfigurationCellularOptions Cellular { get; set; } + public ConfigurationCellularOptions Cellular + { + get => this.cellular; + set + { + this.cellular = value; + this.SetTracker.Track(); + } + } /// /// Name of the configuration. @@ -41,55 +77,119 @@ public class ConfigurationUpdateOptions : BaseOptions /// [JsonProperty("offline")] [STJS.JsonPropertyName("offline")] - public ConfigurationOfflineOptions Offline { get; set; } + public ConfigurationOfflineOptions Offline + { + get => this.offline; + set + { + this.offline = value; + this.SetTracker.Track(); + } + } /// /// Configurations for reader security settings. /// [JsonProperty("reader_security")] [STJS.JsonPropertyName("reader_security")] - public ConfigurationReaderSecurityOptions ReaderSecurity { get; set; } + public ConfigurationReaderSecurityOptions ReaderSecurity + { + get => this.readerSecurity; + set + { + this.readerSecurity = value; + this.SetTracker.Track(); + } + } /// /// Reboot time settings for readers. that support customized reboot time configuration. /// [JsonProperty("reboot_window")] [STJS.JsonPropertyName("reboot_window")] - public ConfigurationRebootWindowOptions RebootWindow { get; set; } + public ConfigurationRebootWindowOptions RebootWindow + { + get => this.rebootWindow; + set + { + this.rebootWindow = value; + this.SetTracker.Track(); + } + } /// /// An object containing device type specific settings for Stripe S700 readers. /// [JsonProperty("stripe_s700")] [STJS.JsonPropertyName("stripe_s700")] - public ConfigurationStripeS700Options StripeS700 { get; set; } + public ConfigurationStripeS700Options StripeS700 + { + get => this.stripeS700; + set + { + this.stripeS700 = value; + this.SetTracker.Track(); + } + } /// /// An object containing device type specific settings for Stripe S710 readers. /// [JsonProperty("stripe_s710")] [STJS.JsonPropertyName("stripe_s710")] - public ConfigurationStripeS710Options StripeS710 { get; set; } + public ConfigurationStripeS710Options StripeS710 + { + get => this.stripeS710; + set + { + this.stripeS710 = value; + this.SetTracker.Track(); + } + } /// /// Tipping configurations for readers that support on-reader tips. /// [JsonProperty("tipping")] [STJS.JsonPropertyName("tipping")] - public ConfigurationTippingOptions Tipping { get; set; } + public ConfigurationTippingOptions Tipping + { + get => this.tipping; + set + { + this.tipping = value; + this.SetTracker.Track(); + } + } /// /// An object containing device type specific settings for Verifone P400 readers. /// [JsonProperty("verifone_p400")] [STJS.JsonPropertyName("verifone_p400")] - public ConfigurationVerifoneP400Options VerifoneP400 { get; set; } + public ConfigurationVerifoneP400Options VerifoneP400 + { + get => this.verifoneP400; + set + { + this.verifoneP400 = value; + this.SetTracker.Track(); + } + } /// /// Configurations for connecting to a WiFi network. /// [JsonProperty("wifi")] [STJS.JsonPropertyName("wifi")] - public ConfigurationWifiOptions Wifi { get; set; } + public ConfigurationWifiOptions Wifi + { + get => this.wifi; + set + { + this.wifi = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationVerifoneP400Options.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationVerifoneP400Options.cs index b67944a9b1..5a62f4c4ef 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationVerifoneP400Options.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationVerifoneP400Options.cs @@ -6,13 +6,32 @@ namespace Stripe.Terminal using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfigurationVerifoneP400Options : INestedOptions + public class ConfigurationVerifoneP400Options : INestedOptions, IHasSetTracking { + private string splashscreen; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// A File ID representing an image you want to display on the reader. /// [JsonProperty("splashscreen")] [STJS.JsonPropertyName("splashscreen")] - public string Splashscreen { get; set; } + public string Splashscreen + { + get => this.splashscreen; + set + { + this.splashscreen = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs index a9af4aeff6..3e6db97988 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class LocationCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The full address of the location. /// @@ -68,7 +70,15 @@ public class LocationCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The phone number for the location. diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs index f82123748b..ffbd671d77 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs @@ -9,6 +9,13 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class LocationUpdateOptions : BaseOptions, IHasMetadata { + private string configurationOverrides; + private string displayName; + private string displayNameKana; + private string displayNameKanji; + private Dictionary metadata; + private string phone; + /// /// The full address of the location. You can't change the location's country. If you /// need to modify the country field, create a new Location object and @@ -37,28 +44,60 @@ public class LocationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("configuration_overrides")] [STJS.JsonPropertyName("configuration_overrides")] - public string ConfigurationOverrides { get; set; } + public string ConfigurationOverrides + { + get => this.configurationOverrides; + set + { + this.configurationOverrides = value; + this.SetTracker.Track(); + } + } /// /// A name for the location. /// [JsonProperty("display_name")] [STJS.JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string DisplayName + { + get => this.displayName; + set + { + this.displayName = value; + this.SetTracker.Track(); + } + } /// /// The Kana variation of the name for the location (Japan only). /// [JsonProperty("display_name_kana")] [STJS.JsonPropertyName("display_name_kana")] - public string DisplayNameKana { get; set; } + public string DisplayNameKana + { + get => this.displayNameKana; + set + { + this.displayNameKana = value; + this.SetTracker.Track(); + } + } /// /// The Kanji variation of the name for the location (Japan only). /// [JsonProperty("display_name_kanji")] [STJS.JsonPropertyName("display_name_kanji")] - public string DisplayNameKanji { get; set; } + public string DisplayNameKanji + { + get => this.displayNameKanji; + set + { + this.displayNameKanji = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -68,13 +107,29 @@ public class LocationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The phone number for the location. /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs index d2de78965b..7efbb258b0 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ReaderCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Custom label given to the reader for easier identification. If no label is specified, /// the registration code will be used. @@ -32,7 +34,15 @@ public class ReaderCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// A code generated by the reader used for registering to an account. diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs index 0183ec0ed7..9afd8b7879 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs @@ -9,12 +9,23 @@ namespace Stripe.Terminal [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ReaderUpdateOptions : BaseOptions, IHasMetadata { + private string label; + private Dictionary metadata; + /// /// The new label of the reader. /// [JsonProperty("label")] [STJS.JsonPropertyName("label")] - public string Label { get; set; } + public string Label + { + get => this.label; + set + { + this.label = value; + this.SetTracker.Track(); + } + } /// /// Set of key-value pairs that you can @@ -24,6 +35,14 @@ public class ReaderUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenPaymentMethodDataBillingDetailsOptions.cs b/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenPaymentMethodDataBillingDetailsOptions.cs index 975f6f8e85..eb7d9eb051 100644 --- a/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenPaymentMethodDataBillingDetailsOptions.cs +++ b/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenPaymentMethodDataBillingDetailsOptions.cs @@ -6,35 +6,76 @@ namespace Stripe.TestHelpers using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfirmationTokenPaymentMethodDataBillingDetailsOptions : INestedOptions + public class ConfirmationTokenPaymentMethodDataBillingDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private string email; + private string name; + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Billing address. /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// Email address. /// [JsonProperty("email")] [STJS.JsonPropertyName("email")] - public string Email { get; set; } + public string Email + { + get => this.email; + set + { + this.email = value; + this.SetTracker.Track(); + } + } /// /// Full name. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// Billing phone number (including extension). /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } /// /// Taxpayer identification number. Used only for transactions between LATAM buyers and @@ -43,5 +84,10 @@ public class ConfirmationTokenPaymentMethodDataBillingDetailsOptions : INestedOp [JsonProperty("tax_id")] [STJS.JsonPropertyName("tax_id")] public string TaxId { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenShippingOptions.cs b/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenShippingOptions.cs index 473f9772da..96dbd7a788 100644 --- a/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenShippingOptions.cs +++ b/src/Stripe.net/Services/TestHelpers/ConfirmationTokens/ConfirmationTokenShippingOptions.cs @@ -6,8 +6,14 @@ namespace Stripe.TestHelpers using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ConfirmationTokenShippingOptions : INestedOptions + public class ConfirmationTokenShippingOptions : INestedOptions, IHasSetTracking { + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Shipping address. /// @@ -27,6 +33,19 @@ public class ConfirmationTokenShippingOptions : INestedOptions /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Tokens/TokenAccountCompanyOptions.cs b/src/Stripe.net/Services/Tokens/TokenAccountCompanyOptions.cs index 154d4bdf8e..aa2e7d3e50 100644 --- a/src/Stripe.net/Services/Tokens/TokenAccountCompanyOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenAccountCompanyOptions.cs @@ -6,8 +6,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class TokenAccountCompanyOptions : INestedOptions + public class TokenAccountCompanyOptions : INestedOptions, IHasSetTracking { + private string ownershipExemptionReason; + private TokenAccountCompanyRegistrationDateOptions registrationDate; + private string structure; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The company's primary address. /// @@ -132,7 +140,15 @@ public class TokenAccountCompanyOptions : INestedOptions /// [JsonProperty("ownership_exemption_reason")] [STJS.JsonPropertyName("ownership_exemption_reason")] - public string OwnershipExemptionReason { get; set; } + public string OwnershipExemptionReason + { + get => this.ownershipExemptionReason; + set + { + this.ownershipExemptionReason = value; + this.SetTracker.Track(); + } + } /// /// The company's phone number (used for verification). @@ -146,7 +162,15 @@ public class TokenAccountCompanyOptions : INestedOptions /// [JsonProperty("registration_date")] [STJS.JsonPropertyName("registration_date")] - public TokenAccountCompanyRegistrationDateOptions RegistrationDate { get; set; } + public TokenAccountCompanyRegistrationDateOptions RegistrationDate + { + get => this.registrationDate; + set + { + this.registrationDate = value; + this.SetTracker.Track(); + } + } /// /// The identification number given to a company when it is registered or incorporated, if @@ -183,7 +207,15 @@ public class TokenAccountCompanyOptions : INestedOptions /// [JsonProperty("structure")] [STJS.JsonPropertyName("structure")] - public string Structure { get; set; } + public string Structure + { + get => this.structure; + set + { + this.structure = value; + this.SetTracker.Track(); + } + } /// /// The business ID number of the company, as appropriate for the company’s country. @@ -215,5 +247,10 @@ public class TokenAccountCompanyOptions : INestedOptions [JsonProperty("verification")] [STJS.JsonPropertyName("verification")] public TokenAccountCompanyVerificationOptions Verification { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs b/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs index 95a35065bc..a3add5d22f 100644 --- a/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenAccountIndividualOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata + public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private DobOptions dob; + private List fullNameAliases; + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The individual's primary address. /// @@ -35,7 +43,15 @@ public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("dob")] [STJS.JsonPropertyName("dob")] - public DobOptions Dob { get; set; } + public DobOptions Dob + { + get => this.dob; + set + { + this.dob = value; + this.SetTracker.Track(); + } + } /// /// The individual's email address. @@ -70,7 +86,15 @@ public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("full_name_aliases")] [STJS.JsonPropertyName("full_name_aliases")] - public List FullNameAliases { get; set; } + public List FullNameAliases + { + get => this.fullNameAliases; + set + { + this.fullNameAliases = value; + this.SetTracker.Track(); + } + } /// /// The individual's gender. @@ -138,7 +162,15 @@ public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The individual's phone number. @@ -184,5 +216,10 @@ public class TokenAccountIndividualOptions : INestedOptions, IHasMetadata [JsonProperty("verification")] [STJS.JsonPropertyName("verification")] public TokenAccountIndividualVerificationOptions Verification { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Tokens/TokenAccountIndividualRelationshipOptions.cs b/src/Stripe.net/Services/Tokens/TokenAccountIndividualRelationshipOptions.cs index 093b2604c3..2b338f5741 100644 --- a/src/Stripe.net/Services/Tokens/TokenAccountIndividualRelationshipOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenAccountIndividualRelationshipOptions.cs @@ -6,8 +6,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class TokenAccountIndividualRelationshipOptions : INestedOptions + public class TokenAccountIndividualRelationshipOptions : INestedOptions, IHasSetTracking { + private decimal? percentOwnership; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Whether the person is a director of the account's legal entity. Directors are typically /// members of the governing board of the company, or responsible for ensuring the company @@ -37,7 +43,15 @@ public class TokenAccountIndividualRelationshipOptions : INestedOptions /// [JsonProperty("percent_ownership")] [STJS.JsonPropertyName("percent_ownership")] - public decimal? PercentOwnership { get; set; } + public decimal? PercentOwnership + { + get => this.percentOwnership; + set + { + this.percentOwnership = value; + this.SetTracker.Track(); + } + } /// /// The person's title (e.g., CEO, Support Engineer). @@ -45,5 +59,10 @@ public class TokenAccountIndividualRelationshipOptions : INestedOptions [JsonProperty("title")] [STJS.JsonPropertyName("title")] public string Title { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Tokens/TokenPersonAdditionalTosAcceptancesAccountOptions.cs b/src/Stripe.net/Services/Tokens/TokenPersonAdditionalTosAcceptancesAccountOptions.cs index e17cd681ed..0ebb0ec8c5 100644 --- a/src/Stripe.net/Services/Tokens/TokenPersonAdditionalTosAcceptancesAccountOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenPersonAdditionalTosAcceptancesAccountOptions.cs @@ -7,8 +7,14 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class TokenPersonAdditionalTosAcceptancesAccountOptions : INestedOptions + public class TokenPersonAdditionalTosAcceptancesAccountOptions : INestedOptions, IHasSetTracking { + private string userAgent; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// The Unix timestamp marking when the account representative accepted the service /// agreement. @@ -32,6 +38,19 @@ public class TokenPersonAdditionalTosAcceptancesAccountOptions : INestedOptions /// [JsonProperty("user_agent")] [STJS.JsonPropertyName("user_agent")] - public string UserAgent { get; set; } + public string UserAgent + { + get => this.userAgent; + set + { + this.userAgent = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs b/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs index 8c4b936dda..58b2a57d15 100644 --- a/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs +++ b/src/Stripe.net/Services/Tokens/TokenPersonOptions.cs @@ -7,8 +7,16 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class TokenPersonOptions : INestedOptions, IHasMetadata + public class TokenPersonOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private DobOptions dob; + private List fullNameAliases; + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Details on the legal guardian's or authorizer's acceptance of the required Stripe /// agreements. @@ -43,7 +51,15 @@ public class TokenPersonOptions : INestedOptions, IHasMetadata /// [JsonProperty("dob")] [STJS.JsonPropertyName("dob")] - public DobOptions Dob { get; set; } + public DobOptions Dob + { + get => this.dob; + set + { + this.dob = value; + this.SetTracker.Track(); + } + } /// /// Documents that may be submitted to satisfy various informational requests. @@ -85,7 +101,15 @@ public class TokenPersonOptions : INestedOptions, IHasMetadata /// [JsonProperty("full_name_aliases")] [STJS.JsonPropertyName("full_name_aliases")] - public List FullNameAliases { get; set; } + public List FullNameAliases + { + get => this.fullNameAliases; + set + { + this.fullNameAliases = value; + this.SetTracker.Track(); + } + } /// /// The person's gender (International regulations require either "male" or "female"). @@ -152,7 +176,15 @@ public class TokenPersonOptions : INestedOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The country where the person is a national. Two-letter country code ( /// Whether the person is the authorizer of the account's representative. /// @@ -51,7 +57,15 @@ public class TokenPersonRelationshipOptions : INestedOptions /// [JsonProperty("percent_ownership")] [STJS.JsonPropertyName("percent_ownership")] - public decimal? PercentOwnership { get; set; } + public decimal? PercentOwnership + { + get => this.percentOwnership; + set + { + this.percentOwnership = value; + this.SetTracker.Track(); + } + } /// /// Whether the person is authorized as the primary representative of the account. This is @@ -70,5 +84,10 @@ public class TokenPersonRelationshipOptions : INestedOptions [JsonProperty("title")] [STJS.JsonPropertyName("title")] public string Title { get; set; } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Topups/TopupCreateOptions.cs b/src/Stripe.net/Services/Topups/TopupCreateOptions.cs index 8f1b0cc7f0..ec10997905 100644 --- a/src/Stripe.net/Services/Topups/TopupCreateOptions.cs +++ b/src/Stripe.net/Services/Topups/TopupCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TopupCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A positive integer representing how much to transfer. /// @@ -40,7 +42,15 @@ public class TopupCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The ID of a source to transfer funds from. For most users, this should be left diff --git a/src/Stripe.net/Services/Topups/TopupUpdateOptions.cs b/src/Stripe.net/Services/Topups/TopupUpdateOptions.cs index bcc9c85e2f..27c2349894 100644 --- a/src/Stripe.net/Services/Topups/TopupUpdateOptions.cs +++ b/src/Stripe.net/Services/Topups/TopupUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TopupUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An arbitrary string attached to the object. Often useful for displaying to users. /// @@ -24,6 +26,14 @@ public class TopupUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs b/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs index 2dedca1cdf..19e5a7d767 100644 --- a/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs +++ b/src/Stripe.net/Services/TransferReversals/TransferReversalCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TransferReversalCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A positive integer in cents (or local equivalent) representing how much of this transfer /// to reverse. Can only reverse up to the unreversed amount remaining of the transfer. @@ -35,7 +37,15 @@ public class TransferReversalCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Boolean indicating whether the application fee should be refunded when reversing this diff --git a/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs b/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs index 7ac84b8613..7390b86816 100644 --- a/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs +++ b/src/Stripe.net/Services/TransferReversals/TransferReversalUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TransferReversalUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Set of key-value pairs that you can /// attach to an object. This can be useful for storing additional information about the @@ -17,6 +19,14 @@ public class TransferReversalUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs b/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs index e0da85a204..afbfcaacd3 100644 --- a/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs +++ b/src/Stripe.net/Services/Transfers/TransferUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TransferUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An arbitrary string attached to the object. Often useful for displaying to users. /// @@ -24,6 +26,14 @@ public class TransferUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountCreateOptions.cs b/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountCreateOptions.cs index 716851933d..80e11eda89 100644 --- a/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountCreateOptions.cs +++ b/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountCreateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe.Treasury [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FinancialAccountCreateOptions : BaseOptions, IHasMetadata { + private string displayName; + private string nickname; + /// /// The display name for the FinancialAccount. Use this field to customize the names of the /// FinancialAccounts for your connected accounts. Unlike the nickname field, @@ -16,7 +19,15 @@ public class FinancialAccountCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("display_name")] [STJS.JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string DisplayName + { + get => this.displayName; + set + { + this.displayName = value; + this.SetTracker.Track(); + } + } /// /// Encodes whether a FinancialAccount has access to a particular feature. Stripe or the @@ -41,7 +52,15 @@ public class FinancialAccountCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("nickname")] [STJS.JsonPropertyName("nickname")] - public string Nickname { get; set; } + public string Nickname + { + get => this.nickname; + set + { + this.nickname = value; + this.SetTracker.Track(); + } + } /// /// The set of functionalities that the platform can restrict on the FinancialAccount. diff --git a/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountUpdateOptions.cs b/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountUpdateOptions.cs index d90c60a9a1..0610bdf3a0 100644 --- a/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/Treasury/FinancialAccounts/FinancialAccountUpdateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe.Treasury [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FinancialAccountUpdateOptions : BaseOptions, IHasMetadata { + private string displayName; + private string nickname; + /// /// The display name for the FinancialAccount. Use this field to customize the names of the /// FinancialAccounts for your connected accounts. Unlike the nickname field, @@ -16,7 +19,15 @@ public class FinancialAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("display_name")] [STJS.JsonPropertyName("display_name")] - public string DisplayName { get; set; } + public string DisplayName + { + get => this.displayName; + set + { + this.displayName = value; + this.SetTracker.Track(); + } + } /// /// Encodes whether a FinancialAccount has access to a particular feature, with a status @@ -50,7 +61,15 @@ public class FinancialAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("nickname")] [STJS.JsonPropertyName("nickname")] - public string Nickname { get; set; } + public string Nickname + { + get => this.nickname; + set + { + this.nickname = value; + this.SetTracker.Track(); + } + } /// /// The set of functionalities that the platform can restrict on the FinancialAccount. diff --git a/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions.cs b/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions.cs index cc89b17e42..a6f760cb02 100644 --- a/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions.cs +++ b/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions.cs @@ -6,34 +6,80 @@ namespace Stripe.Treasury using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions : INestedOptions + public class OutboundPaymentDestinationPaymentMethodDataBillingDetailsOptions : INestedOptions, IHasSetTracking { + private AddressOptions address; + private string email; + private string name; + private string phone; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Billing address. /// [JsonProperty("address")] [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } + public AddressOptions Address + { + get => this.address; + set + { + this.address = value; + this.SetTracker.Track(); + } + } /// /// Email address. /// [JsonProperty("email")] [STJS.JsonPropertyName("email")] - public string Email { get; set; } + public string Email + { + get => this.email; + set + { + this.email = value; + this.SetTracker.Track(); + } + } /// /// Full name. /// [JsonProperty("name")] [STJS.JsonPropertyName("name")] - public string Name { get; set; } + public string Name + { + get => this.name; + set + { + this.name = value; + this.SetTracker.Track(); + } + } /// /// Billing phone number (including extension). /// [JsonProperty("phone")] [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } + public string Phone + { + get => this.phone; + set + { + this.phone = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodOptionsOptions.cs index ab48f075aa..20e7bb21a7 100644 --- a/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/Treasury/OutboundPayments/OutboundPaymentDestinationPaymentMethodOptionsOptions.cs @@ -6,13 +6,32 @@ namespace Stripe.Treasury using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OutboundPaymentDestinationPaymentMethodOptionsOptions : INestedOptions + public class OutboundPaymentDestinationPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private OutboundPaymentDestinationPaymentMethodOptionsUsBankAccountOptions usBankAccount; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Optional fields for us_bank_account. /// [JsonProperty("us_bank_account")] [STJS.JsonPropertyName("us_bank_account")] - public OutboundPaymentDestinationPaymentMethodOptionsUsBankAccountOptions UsBankAccount { get; set; } + public OutboundPaymentDestinationPaymentMethodOptionsUsBankAccountOptions UsBankAccount + { + get => this.usBankAccount; + set + { + this.usBankAccount = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/Treasury/OutboundTransfers/OutboundTransferDestinationPaymentMethodOptionsOptions.cs b/src/Stripe.net/Services/Treasury/OutboundTransfers/OutboundTransferDestinationPaymentMethodOptionsOptions.cs index a0cc7686eb..a5cb9b8786 100644 --- a/src/Stripe.net/Services/Treasury/OutboundTransfers/OutboundTransferDestinationPaymentMethodOptionsOptions.cs +++ b/src/Stripe.net/Services/Treasury/OutboundTransfers/OutboundTransferDestinationPaymentMethodOptionsOptions.cs @@ -6,13 +6,32 @@ namespace Stripe.Treasury using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class OutboundTransferDestinationPaymentMethodOptionsOptions : INestedOptions + public class OutboundTransferDestinationPaymentMethodOptionsOptions : INestedOptions, IHasSetTracking { + private OutboundTransferDestinationPaymentMethodOptionsUsBankAccountOptions usBankAccount; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Optional fields for us_bank_account. /// [JsonProperty("us_bank_account")] [STJS.JsonPropertyName("us_bank_account")] - public OutboundTransferDestinationPaymentMethodOptionsUsBankAccountOptions UsBankAccount { get; set; } + public OutboundTransferDestinationPaymentMethodOptionsUsBankAccountOptions UsBankAccount + { + get => this.usBankAccount; + set + { + this.usBankAccount = value; + this.SetTracker.Track(); + } + } + + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } } } diff --git a/src/Stripe.net/Services/V2/Billing/Cadences/CadenceUpdateOptions.cs b/src/Stripe.net/Services/V2/Billing/Cadences/CadenceUpdateOptions.cs index 9dd32221c9..b4a46274c0 100644 --- a/src/Stripe.net/Services/V2/Billing/Cadences/CadenceUpdateOptions.cs +++ b/src/Stripe.net/Services/V2/Billing/Cadences/CadenceUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.Billing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class CadenceUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A lookup key used to retrieve cadences dynamically from a static string. Maximum length /// of 200 characters. @@ -24,7 +26,16 @@ public class CadenceUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The payer determines the entity financially responsible for the bill. diff --git a/src/Stripe.net/Services/V2/Billing/Profiles/ProfileUpdateOptions.cs b/src/Stripe.net/Services/V2/Billing/Profiles/ProfileUpdateOptions.cs index 4ef2e8fd62..aa59424cce 100644 --- a/src/Stripe.net/Services/V2/Billing/Profiles/ProfileUpdateOptions.cs +++ b/src/Stripe.net/Services/V2/Billing/Profiles/ProfileUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.Billing [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class ProfileUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// The ID of the payment method object. /// @@ -39,6 +41,15 @@ public class ProfileUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/V2/Core/AccountTokens/AccountTokenCreateIdentityIndividualOptions.cs b/src/Stripe.net/Services/V2/Core/AccountTokens/AccountTokenCreateIdentityIndividualOptions.cs index f64ac64a17..2c5aafac55 100644 --- a/src/Stripe.net/Services/V2/Core/AccountTokens/AccountTokenCreateIdentityIndividualOptions.cs +++ b/src/Stripe.net/Services/V2/Core/AccountTokens/AccountTokenCreateIdentityIndividualOptions.cs @@ -7,8 +7,14 @@ namespace Stripe.V2.Core using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class AccountTokenCreateIdentityIndividualOptions : INestedOptions, IHasMetadata + public class AccountTokenCreateIdentityIndividualOptions : INestedOptions, IHasMetadata, IHasSetTracking { + private Dictionary metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional addresses associated with the individual. /// @@ -79,7 +85,16 @@ public class AccountTokenCreateIdentityIndividualOptions : INestedOptions, IHasM /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The countries where the individual is a national. Two-letter country code ( metadata; + + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// /// Additional addresses associated with the individual. /// @@ -79,7 +85,16 @@ public class AccountUpdateIdentityIndividualOptions : INestedOptions, IHasMetada /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The countries where the individual is a national. Two-letter country code ( metadata; + /// /// The account token generated by the account token api. /// @@ -86,6 +88,15 @@ public class AccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/V2/Core/Accounts/PersonTokens/PersonTokenCreateOptions.cs b/src/Stripe.net/Services/V2/Core/Accounts/PersonTokens/PersonTokenCreateOptions.cs index fbb1ae9112..738ee15364 100644 --- a/src/Stripe.net/Services/V2/Core/Accounts/PersonTokens/PersonTokenCreateOptions.cs +++ b/src/Stripe.net/Services/V2/Core/Accounts/PersonTokens/PersonTokenCreateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.Core.Accounts [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PersonTokenCreateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Additional addresses associated with the person. /// @@ -86,7 +88,16 @@ public class PersonTokenCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The nationalities (countries) this person is associated with. diff --git a/src/Stripe.net/Services/V2/Core/Accounts/Persons/PersonUpdateOptions.cs b/src/Stripe.net/Services/V2/Core/Accounts/Persons/PersonUpdateOptions.cs index be849f061d..8ab6508406 100644 --- a/src/Stripe.net/Services/V2/Core/Accounts/Persons/PersonUpdateOptions.cs +++ b/src/Stripe.net/Services/V2/Core/Accounts/Persons/PersonUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.Core.Accounts [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PersonUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// Additional addresses associated with the person. /// @@ -86,7 +88,16 @@ public class PersonUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The nationalities (countries) this person is associated with. diff --git a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationUpdateOptions.cs b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationUpdateOptions.cs index 91c99e9b18..b7e44f2ee0 100644 --- a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationUpdateOptions.cs +++ b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.Core [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class EventDestinationUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// An optional description of what the event destination is used for. /// @@ -36,7 +38,16 @@ public class EventDestinationUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// Event destination name. diff --git a/src/Stripe.net/Services/V2/MoneyManagement/FinancialAccounts/FinancialAccountUpdateOptions.cs b/src/Stripe.net/Services/V2/MoneyManagement/FinancialAccounts/FinancialAccountUpdateOptions.cs index d332c23848..fa07fa9dac 100644 --- a/src/Stripe.net/Services/V2/MoneyManagement/FinancialAccounts/FinancialAccountUpdateOptions.cs +++ b/src/Stripe.net/Services/V2/MoneyManagement/FinancialAccounts/FinancialAccountUpdateOptions.cs @@ -9,6 +9,8 @@ namespace Stripe.V2.MoneyManagement [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class FinancialAccountUpdateOptions : BaseOptions, IHasMetadata { + private Dictionary metadata; + /// /// A descriptive name for the FinancialAccount, up to 50 characters long. This name will be /// used in the Stripe Dashboard and embedded components. @@ -22,6 +24,15 @@ public class FinancialAccountUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } } } diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs index f5a22da85f..7353d172f0 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs @@ -9,6 +9,9 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class WebhookEndpointCreateOptions : BaseOptions, IHasMetadata { + private string description; + private Dictionary metadata; + /// /// Events sent to this endpoint will be generated with this Stripe Version instead of your /// account's default Stripe Version. @@ -63,7 +66,15 @@ public class WebhookEndpointCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// The list of events to enable for this endpoint. You may specify ['*'] to enable @@ -236,7 +247,15 @@ public class WebhookEndpointCreateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The URL of the webhook endpoint. diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs index d284dbee19..e4df9941a3 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs @@ -9,12 +9,23 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class WebhookEndpointUpdateOptions : BaseOptions, IHasMetadata { + private string description; + private Dictionary metadata; + /// /// An optional description of what the webhook is used for. /// [JsonProperty("description")] [STJS.JsonPropertyName("description")] - public string Description { get; set; } + public string Description + { + get => this.description; + set + { + this.description = value; + this.SetTracker.Track(); + } + } /// /// Disable the webhook endpoint if set to true. @@ -194,7 +205,15 @@ public class WebhookEndpointUpdateOptions : BaseOptions, IHasMetadata /// [JsonProperty("metadata")] [STJS.JsonPropertyName("metadata")] - public Dictionary Metadata { get; set; } + public Dictionary Metadata + { + get => this.metadata; + set + { + this.metadata = value; + this.SetTracker.Track(); + } + } /// /// The URL of the webhook endpoint. diff --git a/src/Stripe.net/Services/_base/BaseOptions.cs b/src/Stripe.net/Services/_base/BaseOptions.cs index 05e50dce59..00b1beeb60 100644 --- a/src/Stripe.net/Services/_base/BaseOptions.cs +++ b/src/Stripe.net/Services/_base/BaseOptions.cs @@ -12,8 +12,12 @@ namespace Stripe /// [JsonObject(MemberSerialization.OptIn)] [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class BaseOptions : INestedOptions + public class BaseOptions : INestedOptions, IHasSetTracking { + [JsonIgnore] + [STJS.JsonIgnore] + internal SetTracker SetTracker { get; } = new SetTracker(); + /// Specifies which fields in the response should be expanded. [JsonProperty("expand", NullValueHandling = NullValueHandling.Ignore)] [STJS.JsonPropertyName("expand")] @@ -27,6 +31,11 @@ public class BaseOptions : INestedOptions public IDictionary ExtraParams { get; set; } = new Dictionary(); + bool IHasSetTracking.IsPropertySet(string propertyName) + { + return this.SetTracker.IsSet(propertyName); + } + internal BaseOptions Clone() { return (BaseOptions)this.MemberwiseClone(); diff --git a/src/Stripe.net/Services/_base/StringEnum.cs b/src/Stripe.net/Services/_base/StringEnum.cs index 71c43a40a7..f9a8a76f8e 100644 --- a/src/Stripe.net/Services/_base/StringEnum.cs +++ b/src/Stripe.net/Services/_base/StringEnum.cs @@ -1,7 +1,5 @@ namespace Stripe { - using System.Text.Json.Serialization; - /// /// Abstract base class for string enum parameters. /// @@ -25,6 +23,8 @@ namespace Stripe /// } /// /// + [Newtonsoft.Json.JsonConverter(typeof(Infrastructure.NewtonsoftStringEnumConverter))] + [NoSystemTextJsonAttributesNeeded("STJ converter is on each concrete subclass because STJ does not inherit converter attributes from base classes.")] public abstract class StringEnum { /// Initializes a new instance of the class. @@ -36,7 +36,7 @@ protected StringEnum(string value) /// Gets or sets the serialized value. /// The serialized value. - [JsonPropertyName("Value")] + [System.Text.Json.Serialization.JsonPropertyName("Value")] public string Value { get; protected set; } /// Returns the serialized value. diff --git a/src/Stripe.net/Services/_common/Emptyable.cs b/src/Stripe.net/Services/_common/Emptyable.cs deleted file mode 100644 index 04da6f8583..0000000000 --- a/src/Stripe.net/Services/_common/Emptyable.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace Stripe -{ - /// Represents a field that might be emptyble. - /// Type of the field when not empty. - internal class Emptyable : IEmptyable - { - private bool empty; - private T value; - - public T Value - { - get => this.value; - set - { - this.value = value; - this.empty = false; - } - } - - public bool Empty - { - get => this.empty; - set - { - this.empty = value; - if (value) - { - this.value = default(T); - } - } - } - - /// Gets or sets the expanded object. - /// The expanded object. - object IEmptyable.Value => this.Value; - } -} diff --git a/src/Stripe.net/Services/_interfaces/IEmptyable.cs b/src/Stripe.net/Services/_interfaces/IEmptyable.cs deleted file mode 100644 index 26205777da..0000000000 --- a/src/Stripe.net/Services/_interfaces/IEmptyable.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Stripe -{ - /// - /// Represents a value that may be of one of several different types. - /// - public interface IEmptyable - { - /// Gets whether or not the field is empty. - /// True if the value is empty; false if the value is set. - public bool Empty { get; } - - /// Gets the value of the current object. - /// The value of the current object. - object Value { get; } - } - - /// Represents a generic expandable field. - /// Type of the field when expanded. - public interface IEmptyable : IEmptyable - { - /// Gets the value of the current object. - /// The value of the current object. - new T Value { get; set; } - } -} diff --git a/src/StripeTests/Events/V2/EventTest.cs b/src/StripeTests/Events/V2/EventTest.cs index d46bb2228a..8f35cdcf06 100644 --- a/src/StripeTests/Events/V2/EventTest.cs +++ b/src/StripeTests/Events/V2/EventTest.cs @@ -24,7 +24,7 @@ public class EventTest : BaseStripeTest private static string v2UnknownEventPayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""this.event.doesnt.exist"", ""created"": ""2022-02-15T00:27:45.330Z"", ""livemode"": true, @@ -45,7 +45,7 @@ public class EventTest : BaseStripeTest private static string v2KnownEventNoRelatedObjectPayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""v1.billing.meter.no_meter_found"", ""created"": ""2022-02-15T00:27:45.330Z"", ""livemode"": true, @@ -54,7 +54,7 @@ public class EventTest : BaseStripeTest private static string v2KnownEventPayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""v1.billing.meter.error_report_triggered"", ""created"": ""2022-02-15T00:27:45.330Z"", ""context"": ""context 123"", @@ -70,7 +70,7 @@ public class EventTest : BaseStripeTest private static string v2KnownEventWithDataPayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""v1.billing.meter.error_report_triggered"", ""created"": ""2022-02-15T00:27:45.330Z"", ""context"": ""context 123"", @@ -106,7 +106,7 @@ public class EventTest : BaseStripeTest private static string v2KnownEventLivemodeFalsePayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""v1.billing.meter.no_meter_found"", ""created"": ""2022-02-15T00:27:45.330Z"", ""livemode"": false, @@ -115,7 +115,7 @@ public class EventTest : BaseStripeTest private static string v2KnownEventWithReasonPayload = @"{ ""id"": ""evt_234"", - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""v1.billing.meter.no_meter_found"", ""created"": ""2022-02-15T00:27:45.330Z"", ""livemode"": true, @@ -290,13 +290,34 @@ public void ParseEventNotificationWithInvalidSignature() Assert.Matches("header format is unexpected", exception.Message); } + [Fact] + public void RejectV1PayloadInParseEventNotification() + { + var v1Payload = @"{ + ""id"": ""evt_123"", + ""object"": ""event"", + ""type"": ""customer.created"", + ""api_version"": ""2017-05-25"", + ""created"": 1533204620, + ""livemode"": false + }"; + + var exception = Assert.Throws(() => + this.stripeClient.ParseEventNotification( + v1Payload, + GenerateSigHeader(v1Payload), + WebhookSecret)); + + Assert.Contains("EventUtility.ConstructEvent", exception.Message); + } + [Fact] public void ParseUnknownEventDirectly() { var stripeEvent = JsonUtils.DeserializeObject(v2UnknownEventPayload); Assert.NotNull(stripeEvent); Assert.Equal("evt_234", stripeEvent.Id); - Assert.Equal("event", stripeEvent.Object); + Assert.Equal("v2.core.event", stripeEvent.Object); Assert.Equal("this.event.doesnt.exist", stripeEvent.Type); Assert.Equal(new DateTime(2022, 2, 15, 0, 27, 45, 330, DateTimeKind.Utc), stripeEvent.Created); Assert.Null(stripeEvent.Requestor); diff --git a/src/StripeTests/Infrastructure/JsonConverters/EmptyableConverterTest.cs b/src/StripeTests/Infrastructure/JsonConverters/EmptyableConverterTest.cs deleted file mode 100644 index a3475a24f0..0000000000 --- a/src/StripeTests/Infrastructure/JsonConverters/EmptyableConverterTest.cs +++ /dev/null @@ -1,88 +0,0 @@ -namespace StripeTests -{ - using Stripe; - using Stripe.Infrastructure; - using Stripe.Infrastructure.FormEncoding; - using StripeTests.Infrastructure.TestData; - using Xunit; - - public class EmptyableConverterTest : BaseStripeTest - { - [Fact] - public async void SerializeEmpty() - { - var obj = new TestOptions() - { - EmptyEmptyStringable = true, - }; - - var expected = "{\"empty_stringable\":null}"; - var result = await ContentEncoder.CreateHttpContent(obj, ApiMode.V2).ReadAsStringAsync(); - Assert.Equal(expected, result); - } - - [Fact] - public async void SerializeMissing() - { - var obj = new TestOptions() - { - }; - - var expected = "{}"; - var result = await ContentEncoder.CreateHttpContent(obj, ApiMode.V2).ReadAsStringAsync(); - Assert.Equal(expected, result); - } - - [Fact] - public async void SerializeValue() - { - var obj = new TestOptions() - { - EmptyStringable = new TestOptions.Nested() - { - Bool = true, - }, - }; - - var expected = "{\"empty_stringable\":{\"bool\":true}}"; - var result = await ContentEncoder.CreateHttpContent(obj, ApiMode.V2).ReadAsStringAsync(); - Assert.Equal(expected, result); - } - - [Fact] - public async void SerializeEmptied() - { - var obj = new TestOptions() - { - }; - obj.EmptyStringable = new TestOptions.Nested() - { - Bool = true, - }; - - obj.EmptyEmptyStringable = true; - - var expected = "{\"empty_stringable\":null}"; - var result = await ContentEncoder.CreateHttpContent(obj, ApiMode.V2).ReadAsStringAsync(); - Assert.Equal(expected, result); - } - - [Fact] - public async void SerializeUnemptied() - { - var obj = new TestOptions() - { - }; - - obj.EmptyEmptyStringable = true; - obj.EmptyStringable = new TestOptions.Nested() - { - Bool = true, - }; - - var expected = "{\"empty_stringable\":{\"bool\":true}}"; - var result = await ContentEncoder.CreateHttpContent(obj, ApiMode.V2).ReadAsStringAsync(); - Assert.Equal(expected, result); - } - } -} diff --git a/src/StripeTests/Infrastructure/Public/StripeClientTest.cs b/src/StripeTests/Infrastructure/Public/StripeClientTest.cs index 68fc99ba0a..dceb8500b2 100644 --- a/src/StripeTests/Infrastructure/Public/StripeClientTest.cs +++ b/src/StripeTests/Infrastructure/Public/StripeClientTest.cs @@ -236,7 +236,7 @@ await this.stripeClient.RawRequestAsync( public void ConstructEventNotification() { string payload = @"{ - ""object"": ""event"", + ""object"": ""v2.core.event"", ""type"": ""unknown"", ""data"": {}, ""relatedObject"": { diff --git a/src/StripeTests/Infrastructure/SetTrackingTest.cs b/src/StripeTests/Infrastructure/SetTrackingTest.cs new file mode 100644 index 0000000000..0118df37e2 --- /dev/null +++ b/src/StripeTests/Infrastructure/SetTrackingTest.cs @@ -0,0 +1,163 @@ +namespace StripeTests +{ + using System.Collections.Generic; + using Stripe; + using Stripe.Infrastructure.FormEncoding; + using StripeTests.Infrastructure.TestData; + using Xunit; + + public class SetTrackingTest : BaseStripeTest + { + // v1 form encoding: set-tracked null sends field= (empty string to clear) + [Fact] + public void V1FormEncoding_SetToNull_SendsEmptyString() + { + var options = new TestOptions(); + options.EmptyableString = null; + + var result = ContentEncoder.CreateQueryString(options); + Assert.Equal("emptyable_string=", result); + } + + // v1 form encoding: unset property is omitted entirely + [Fact] + public void V1FormEncoding_NeverSet_Omitted() + { + var options = new TestOptions(); + + var result = ContentEncoder.CreateQueryString(options); + Assert.Equal(string.Empty, result); + } + + // v1 form encoding: set to a value sends normally + [Fact] + public void V1FormEncoding_SetToValue_SendsValue() + { + var options = new TestOptions(); + options.EmptyableString = "hello"; + + var result = ContentEncoder.CreateQueryString(options); + Assert.Equal("emptyable_string=hello", result); + } + + // v1 form encoding: set-tracked null nested object sends field= (empty string) + [Fact] + public void V1FormEncoding_SetNestedToNull_SendsEmptyString() + { + var options = new TestOptions(); + options.EmptyableNested = null; + + var result = ContentEncoder.CreateQueryString(options); + Assert.Equal("emptyable_nested=", result); + } + + // v1 form encoding: non-tracked string property with null is still omitted + [Fact] + public void V1FormEncoding_NonTrackedNull_Omitted() + { + var options = new TestOptions(); + options.String = null; + + var result = ContentEncoder.CreateQueryString(options); + Assert.Equal(string.Empty, result); + } + + // v2 JSON encoding: set-tracked null sends "field": null + [Fact] + public async void V2JsonEncoding_SetToNull_SendsNull() + { + var options = new TestOptions(); + options.EmptyableString = null; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Equal("{\"emptyable_string\":null}", result); + } + + // v2 JSON encoding: unset property is omitted + [Fact] + public async void V2JsonEncoding_NeverSet_Omitted() + { + var options = new TestOptions(); + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Equal("{}", result); + } + + // v2 JSON encoding: set to a value sends normally + [Fact] + public async void V2JsonEncoding_SetToValue_SendsValue() + { + var options = new TestOptions(); + options.EmptyableString = "hello"; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Equal("{\"emptyable_string\":\"hello\"}", result); + } + + // v2 JSON encoding: null-preserving dictionary sends {"key": null} + [Fact] + public async void V2JsonEncoding_MetadataDictWithNull_PreservesNull() + { + var options = new TestOptions + { + Metadata = new Dictionary + { + { "keep", "value" }, + { "delete", null }, + }, + }; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Contains("\"keep\":\"value\"", result); + Assert.Contains("\"delete\":null", result); + } + + // v2 JSON encoding: null-preserving dictionary with all non-null values works normally + [Fact] + public async void V2JsonEncoding_MetadataDictAllValues_Normal() + { + var options = new TestOptions + { + Metadata = new Dictionary + { + { "key1", "val1" }, + { "key2", "val2" }, + }, + }; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Contains("\"key1\":\"val1\"", result); + Assert.Contains("\"key2\":\"val2\"", result); + } + + // v2 JSON encoding: set-tracked null nested object sends null + [Fact] + public async void V2JsonEncoding_SetNestedToNull_SendsNull() + { + var options = new TestOptions(); + options.EmptyableNested = null; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Equal("{\"emptyable_nested\":null}", result); + } + + // Set then unset via null should still track + [Fact] + public async void V2JsonEncoding_SetValueThenNull_SendsNull() + { + var options = new TestOptions(); + options.EmptyableString = "hello"; + options.EmptyableString = null; + + var result = await ContentEncoder.CreateHttpContent(options, ApiMode.V2) + .ReadAsStringAsync(); + Assert.Equal("{\"emptyable_string\":null}", result); + } + } +} diff --git a/src/StripeTests/Infrastructure/TestData/TestOptions.cs b/src/StripeTests/Infrastructure/TestData/TestOptions.cs index 3bcb8fb06c..8eb9d64995 100644 --- a/src/StripeTests/Infrastructure/TestData/TestOptions.cs +++ b/src/StripeTests/Infrastructure/TestData/TestOptions.cs @@ -11,6 +11,9 @@ namespace StripeTests.Infrastructure.TestData [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class TestOptions : BaseOptions { + private string emptyableString; + private Nested emptyableNested; + [JsonProperty("any_of")] [STJS.JsonPropertyName("any_of")] [JsonConverter(typeof(AnyOfConverter))] @@ -64,33 +67,34 @@ public class TestOptions : BaseOptions [STJS.JsonPropertyName("string_enum")] public TestStringEnum StringEnum { get; set; } - [JsonIgnore] - public bool EmptyEmptyStringable + [JsonProperty("emptyable_string")] + [STJS.JsonPropertyName("emptyable_string")] + public string EmptyableString { - get => this.InternalEmptyStringable?.Empty ?? false; + get => this.emptyableString; set { - this.InternalEmptyStringable ??= new Emptyable(); - this.InternalEmptyStringable.Empty = value; + this.emptyableString = value; + this.SetTracker.Track(); } } - [JsonIgnore] - public Nested EmptyStringable + [JsonProperty("emptyable_nested")] + [STJS.JsonPropertyName("emptyable_nested")] + public Nested EmptyableNested { - get => this.InternalEmptyStringable?.Value; + get => this.emptyableNested; set { - this.InternalEmptyStringable ??= new Emptyable(); - this.InternalEmptyStringable.Value = value; + this.emptyableNested = value; + this.SetTracker.Track(); } } - [JsonProperty("empty_stringable")] - [STJS.JsonPropertyName("empty_stringable")] - [JsonConverter(typeof(EmptyableConverter))] - [STJS.JsonConverter(typeof(STJEmptyableConverter))] - internal Emptyable InternalEmptyStringable { get; set; } + [JsonProperty("metadata")] + [STJS.JsonPropertyName("metadata")] + [STJS.JsonConverter(typeof(STJNullPreservingDictionaryConverter))] + public Dictionary Metadata { get; set; } public class TestStringEnum : StringEnum { diff --git a/src/StripeTests/Services/Events/EventUtilityTest.cs b/src/StripeTests/Services/Events/EventUtilityTest.cs index 533bfa272a..2707b8bec5 100644 --- a/src/StripeTests/Services/Events/EventUtilityTest.cs +++ b/src/StripeTests/Services/Events/EventUtilityTest.cs @@ -1,5 +1,6 @@ namespace StripeTests { + using System; using Stripe; using Xunit; @@ -153,6 +154,44 @@ public void ValidateSignatureHandlesIncorrectHeaderValues(string headerValue) EventUtility.ValidateSignature("{}", headerValue, string.Empty)); } + [Fact] + public void RejectV2PayloadInParseEvent() + { + var v2Payload = @"{ + ""id"": ""evt_234"", + ""object"": ""v2.core.event"", + ""type"": ""v1.billing.meter.error_report_triggered"", + ""created"": ""2022-02-15T00:27:45.330Z"", + ""livemode"": true + }"; + + var exception = Assert.Throws(() => + EventUtility.ParseEvent(v2Payload, throwOnApiVersionMismatch: false)); + + Assert.Contains("StripeClient.ParseEventNotification", exception.Message); + } + + [Fact] + public void RejectV2PayloadInConstructEvent() + { + var v2Payload = @"{ + ""id"": ""evt_234"", + ""object"": ""v2.core.event"", + ""type"": ""v1.billing.meter.error_report_triggered"", + ""created"": ""2022-02-15T00:27:45.330Z"", + ""livemode"": true + }"; + + var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + var signature = EventUtility.ComputeSignature(this.secret, timestamp.ToString(), v2Payload); + var sigHeader = $"t={timestamp},v1={signature}"; + + var exception = Assert.Throws(() => + EventUtility.ConstructEvent(v2Payload, sigHeader, this.secret, throwOnApiVersionMismatch: false)); + + Assert.Contains("StripeClient.ParseEventNotification", exception.Message); + } + [Theory] [InlineData("2024-2-31.acacia", "1999-03-31", false)] [InlineData("2024-2-31.acacia", "2025-03-31.basil", false)] diff --git a/src/StripeTests/Wholesome/SystemTextJsonTestUtils.cs b/src/StripeTests/Wholesome/SystemTextJsonTestUtils.cs index 35d98d8204..c5108f5007 100644 --- a/src/StripeTests/Wholesome/SystemTextJsonTestUtils.cs +++ b/src/StripeTests/Wholesome/SystemTextJsonTestUtils.cs @@ -114,11 +114,6 @@ public static Tuple HasCorrectConverterType(Type type, MemberInf { expectedConverterType = typeof(STJUnixDateTimeConverter); } - else if (typeof(IEmptyable).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) - { - expectedConverterType = typeof(STJEmptyableConverter<>); - expectedGenericTypeArguments = type.GenericTypeArguments; - } else if (typeof(IAnyOf).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) { expectedConverterType = typeof(STJAnyOfConverter); @@ -180,6 +175,16 @@ public static Tuple HasCorrectConverterType(Type type, MemberInf actualConverterType, actualGenericTypeArguments); + // STJNullPreservingDictionaryConverter is applied by codegen to Dictionary + // properties where null values need to be preserved (e.g. metadata mutation). + // Whether a Dictionary property needs this is determined by API schema + // semantics, not the C# type, so accept it on any Dictionary property. + if (actualConverterType == typeof(STJNullPreservingDictionaryConverter) && + typeof(IDictionary).IsAssignableFrom(type)) + { + return null; + } + if (expectedConverterName == actualConverterName) { return null;