From 310aff3e575b76aecaa3606d80a709e819881a45 Mon Sep 17 00:00:00 2001 From: CJ Avilla Date: Fri, 27 Dec 2019 12:35:32 -0800 Subject: [PATCH 1/3] Flatten SharedOptions into their Create/Update classes for auto-gen prep --- .../Services/Account/AccountCreateOptions.cs | 101 ++++++++++- .../Services/Account/AccountSharedOptions.cs | 56 ------ .../Services/Account/AccountUpdateOptions.cs | 93 +++++++++- .../FileLinks/FileLinkCreateOptions.cs | 16 +- .../FileLinks/FileLinkSharedOptions.cs | 24 --- .../FileLinks/FileLinkUpdateOptions.cs | 15 +- .../Cardholders/CardholderCreateOptions.cs | 66 ++++++- .../Cardholders/CardholderSharedOptions.cs | 72 -------- .../Cardholders/CardholderUpdateOptions.cs | 65 ++++++- .../Issuing/Cards/CardCreateOptions.cs | 45 ++++- .../Issuing/Cards/CardSharedOptions.cs | 20 --- .../Issuing/Cards/CardUpdateOptions.cs | 25 ++- .../Issuing/Disputes/DisputeCreateOptions.cs | 25 ++- .../Issuing/Disputes/DisputeSharedOptions.cs | 11 -- .../Issuing/Disputes/DisputeUpdateOptions.cs | 9 +- .../Services/Persons/PersonCreateOptions.cs | 131 +++++++++++++- .../Services/Persons/PersonSharedOptions.cs | 137 --------------- .../Services/Persons/PersonUpdateOptions.cs | 131 +++++++++++++- .../Services/Products/ProductCreateOptions.cs | 92 +++++++++- .../Services/Products/ProductSharedOptions.cs | 86 ---------- .../Services/Products/ProductUpdateOptions.cs | 82 ++++++++- .../ValueLists/ValueListCreateOptions.cs | 29 +++- .../ValueLists/ValueListSharedOptions.cs | 17 -- .../ValueLists/ValueListUpdateOptions.cs | 21 ++- .../Services/Skus/SkuCreateOptions.cs | 59 ++++++- .../Services/Skus/SkuSharedOptions.cs | 64 ------- .../Services/Skus/SkuUpdateOptions.cs | 60 ++++++- .../SubscriptionItemCreateOptions.cs | 61 ++++++- .../SubscriptionItemSharedOptions.cs | 58 ------- .../SubscriptionItemUpdateOptions.cs | 56 +++++- .../SubscriptionScheduleCreateOptions.cs | 37 +++- .../SubscriptionScheduleSharedOptions.cs | 44 ----- .../SubscriptionScheduleUpdateOptions.cs | 36 +++- .../SubscriptionCreateOptions.cs | 154 ++++++++++++++++- .../SubscriptionSharedOptions.cs | 162 ------------------ .../SubscriptionUpdateOptions.cs | 154 ++++++++++++++++- .../Locations/LocationCreateOptions.cs | 17 +- .../Locations/LocationSharedOptions.cs | 23 --- .../Locations/LocationUpdateOptions.cs | 17 +- .../Terminal/Readers/ReaderCreateOptions.cs | 15 +- .../Terminal/Readers/ReaderSharedOptions.cs | 20 --- .../Terminal/Readers/ReaderUpdateOptions.cs | 14 +- .../WebhookEndpointCreateOptions.cs | 14 +- .../WebhookEndpointSharedOptions.cs | 20 --- .../WebhookEndpointUpdateOptions.cs | 14 +- 45 files changed, 1619 insertions(+), 849 deletions(-) delete mode 100644 src/Stripe.net/Services/Account/AccountSharedOptions.cs delete mode 100644 src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Persons/PersonSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Products/ProductSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Radar/ValueLists/ValueListSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Skus/SkuSharedOptions.cs delete mode 100644 src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs delete mode 100644 src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Terminal/Locations/LocationSharedOptions.cs delete mode 100644 src/Stripe.net/Services/Terminal/Readers/ReaderSharedOptions.cs delete mode 100644 src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointSharedOptions.cs diff --git a/src/Stripe.net/Services/Account/AccountCreateOptions.cs b/src/Stripe.net/Services/Account/AccountCreateOptions.cs index 846075b9f1..dfed5a3082 100644 --- a/src/Stripe.net/Services/Account/AccountCreateOptions.cs +++ b/src/Stripe.net/Services/Account/AccountCreateOptions.cs @@ -1,15 +1,114 @@ namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class AccountCreateOptions : AccountSharedOptions + public class AccountCreateOptions : BaseOptions, IHasMetadata { + [JsonProperty("account_token")] + public string AccountToken { get; set; } + + /// + /// Optional information related to the business. + /// + [JsonProperty("business_profile")] + public AccountBusinessProfileOptions BusinessProfile { get; set; } + + /// + /// The business type. One of individual or company. + /// + [JsonProperty("business_type")] + public string BusinessType { get; set; } + + /// + /// Information about the company or business. This field is null + /// unless BusinessType is set to company. + /// + [JsonProperty("company")] + public AccountCompanyOptions Company { get; set; } + + /// + /// The country in which the account holder resides, or in which the + /// business is legally established. This should be an ISO 3166-1 + /// alpha-2 country code. For example, if you are in the United States + /// and the business for which you’re creating an account is legally + /// represented in Canada, you would use CA as the country for the + /// account being created. + /// [JsonProperty("country")] public string Country { get; set; } + /// + /// Three-letter ISO currency code representing the default currency + /// for the account. This must be a currency that Stripe supports in + /// the account’s country. + /// + [JsonProperty("default_currency")] + public string DefaultCurrency { get; set; } + + /// + /// The email address of the account holder. For Custom accounts, this + /// is only to make the account easier to identify to you: Stripe will + /// never directly email your users. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// + /// A card or bank account to attach to the account. You can provide either a token, like + /// the ones returned by Stripe.js, or a + /// or instance. + /// + /// + /// By default, providing an external account sets it as the new default external account + /// for its currency, and deletes the old default if one exists. To add additional external + /// accounts without replacing the existing default for the currency, use the bank account + /// or card creation API. + /// + /// + [JsonProperty("external_account")] + [JsonConverter(typeof(AnyOfConverter))] + public AnyOf ExternalAccount { get; set; } + + /// + /// Information about the person represented by the account. This field + /// is null unless BusinessType is set to individual. + /// [JsonProperty("individual")] public PersonCreateOptions Individual { get; set; } + /// + /// A set of key-value pairs that you can attach to an object. + /// This can be useful for storing additional information about the + /// object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The set of capabilities you want to unlock for this account. Each + /// capability will be inactive until you have provided its specific + /// requirements and Stripe has verified them. An account may have some + /// of its requested capabilities be active and some be inactive. + /// + [JsonProperty("requested_capabilities")] + public List RequestedCapabilities { get; set; } + + /// + /// Options for customizing how the account functions within Stripe. + /// + [JsonProperty("settings")] + public AccountSettingsOptions Settings { get; set; } + + /// + /// Details on the account’s acceptance of the + /// Stripe Services Agreement. + /// + [JsonProperty("tos_acceptance")] + public AccountTosAcceptanceOptions TosAcceptance { get; set; } + /// /// One of . /// diff --git a/src/Stripe.net/Services/Account/AccountSharedOptions.cs b/src/Stripe.net/Services/Account/AccountSharedOptions.cs deleted file mode 100644 index 1fbf8a5851..0000000000 --- a/src/Stripe.net/Services/Account/AccountSharedOptions.cs +++ /dev/null @@ -1,56 +0,0 @@ -namespace Stripe -{ - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public abstract class AccountSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("account_token")] - public string AccountToken { get; set; } - - [JsonProperty("business_profile")] - public AccountBusinessProfileOptions BusinessProfile { get; set; } - - [JsonProperty("business_type")] - public string BusinessType { get; set; } - - [JsonProperty("company")] - public AccountCompanyOptions Company { get; set; } - - [JsonProperty("default_currency")] - public string DefaultCurrency { get; set; } - - [JsonProperty("email")] - public string Email { get; set; } - - /// - /// - /// A card or bank account to attach to the account. You can provide either a token, like - /// the ones returned by Stripe.js, or a - /// or instance. - /// - /// - /// By default, providing an external account sets it as the new default external account - /// for its currency, and deletes the old default if one exists. To add additional external - /// accounts without replacing the existing default for the currency, use the bank account - /// or card creation API. - /// - /// - [JsonProperty("external_account")] - [JsonConverter(typeof(AnyOfConverter))] - public AnyOf ExternalAccount { get; set; } - - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - [JsonProperty("requested_capabilities")] - public List RequestedCapabilities { get; set; } - - [JsonProperty("settings")] - public AccountSettingsOptions Settings { get; set; } - - [JsonProperty("tos_acceptance")] - public AccountTosAcceptanceOptions TosAcceptance { get; set; } - } -} diff --git a/src/Stripe.net/Services/Account/AccountUpdateOptions.cs b/src/Stripe.net/Services/Account/AccountUpdateOptions.cs index e5da6cb55d..c433443de6 100644 --- a/src/Stripe.net/Services/Account/AccountUpdateOptions.cs +++ b/src/Stripe.net/Services/Account/AccountUpdateOptions.cs @@ -1,10 +1,101 @@ namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class AccountUpdateOptions : AccountSharedOptions + public class AccountUpdateOptions : BaseOptions, IHasMetadata { + [JsonProperty("account_token")] + public string AccountToken { get; set; } + + /// + /// Optional information related to the business. + /// + [JsonProperty("business_profile")] + public AccountBusinessProfileOptions BusinessProfile { get; set; } + + /// + /// The business type. One of individual or company. + /// + [JsonProperty("business_type")] + public string BusinessType { get; set; } + + /// + /// Information about the company or business. This field is null + /// unless BusinessType is set to company. + /// + [JsonProperty("company")] + public AccountCompanyOptions Company { get; set; } + + /// + /// Three-letter ISO currency code representing the default currency + /// for the account. This must be a currency that Stripe supports in + /// the account’s country. + /// + [JsonProperty("default_currency")] + public string DefaultCurrency { get; set; } + + /// + /// The email address of the account holder. For Custom accounts, this + /// is only to make the account easier to identify to you: Stripe will + /// never directly email your users. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// + /// A card or bank account to attach to the account. You can provide either a token, like + /// the ones returned by Stripe.js, or a + /// or instance. + /// + /// + /// By default, providing an external account sets it as the new default external account + /// for its currency, and deletes the old default if one exists. To add additional external + /// accounts without replacing the existing default for the currency, use the bank account + /// or card creation API. + /// + /// + [JsonProperty("external_account")] + [JsonConverter(typeof(AnyOfConverter))] + public AnyOf ExternalAccount { get; set; } + + /// + /// Information about the person represented by the account. This field + /// is null unless BusinessType is set to individual. + /// [JsonProperty("individual")] public PersonUpdateOptions Individual { get; set; } + + /// + /// A set of key-value pairs that you can attach to an object. + /// This can be useful for storing additional information about the + /// object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The set of capabilities you want to unlock for this account. Each + /// capability will be inactive until you have provided its specific + /// requirements and Stripe has verified them. An account may have some + /// of its requested capabilities be active and some be inactive. + /// + [JsonProperty("requested_capabilities")] + public List RequestedCapabilities { get; set; } + + /// + /// Options for customizing how the account functions within Stripe. + /// + [JsonProperty("settings")] + public AccountSettingsOptions Settings { get; set; } + + /// + /// Details on the account’s acceptance of the + /// Stripe Services Agreement. + /// + [JsonProperty("tos_acceptance")] + public AccountTosAcceptanceOptions TosAcceptance { get; set; } } } diff --git a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs index ec96bdc3d6..42e7ba2edc 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs @@ -5,8 +5,22 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class FileLinkCreateOptions : FileLinkSharedOptions + public class FileLinkCreateOptions : BaseOptions, IHasMetadata { + /// + /// A future timestamp after which the link will no longer be usable. + /// + [JsonProperty("expires_at")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? ExpiresAt { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + /// /// The ID of the file. /// diff --git a/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs deleted file mode 100644 index bdad1f3f91..0000000000 --- a/src/Stripe.net/Services/FileLinks/FileLinkSharedOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace Stripe -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public class FileLinkSharedOptions : BaseOptions, IHasMetadata - { - /// - /// A future timestamp after which the link will no longer be usable. - /// - [JsonProperty("expires_at")] - [JsonConverter(typeof(DateTimeConverter))] - public DateTime? ExpiresAt { get; set; } - - /// - /// Set of key-value pairs that you can attach to an object. This can be useful for storing - /// additional information about the object in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - } -} diff --git a/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs index 73978cadea..4768f6b7c2 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkUpdateOptions.cs @@ -5,7 +5,20 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class FileLinkUpdateOptions : FileLinkSharedOptions + public class FileLinkUpdateOptions : BaseOptions, IHasMetadata { + /// + /// A future timestamp after which the link will no longer be usable. + /// + [JsonProperty("expires_at")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? ExpiresAt { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } } } diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderCreateOptions.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderCreateOptions.cs index 1721583dc3..2d537d282a 100644 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cardholders/CardholderCreateOptions.cs @@ -3,8 +3,72 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardholderCreateOptions : CardholderSharedOptions + public class CardholderCreateOptions : BaseOptions, IHasMetadata { + /// + /// Spending rules that give you control over how your cardholders can make charges. + /// + [JsonProperty("authorization_controls")] + public CardholderAuthorizationControlsOptions AuthorizationControls { get; set; } + + /// + /// The cardholder’s billing address. + /// + [JsonProperty("billing")] + public BillingOptions Billing { get; set; } + + /// + /// Additional information about a business entity cardholder. + /// + [JsonProperty("company")] + public CardholderCompanyOptions Company { get; set; } + + /// + /// The cardholder’s email address. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// Additional information about an individual cardholder. + /// + [JsonProperty("individual")] + public CardholderIndividualOptions Individual { get; set; } + + /// + /// Whether or not this cardholder is the default cardholder. + /// + [JsonProperty("is_default")] + public bool? IsDefault { get; set; } + + /// + /// A set of key/value pairs that you can attach to a charge object. It can be useful for + /// storing additional information about the customer in a structured format. It's often a + /// good idea to store an email address in metadata for tracking later. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The cardholder’s name. This will be printed on cards issued to them. + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// The cardholder’s phone number. This will be transformed to E.164 if it is not provided + /// in that format already. + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; set; } + + /// + /// Specifies whether to permit authorizations on this cardholder’s cards. Possible values + /// are active or inactive. + /// + [JsonProperty("status")] + public string Status { get; set; } + /// /// The type of cardholder. Possible values are individual or business_entity. /// diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs deleted file mode 100644 index 7d1e9534a3..0000000000 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderSharedOptions.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace Stripe.Issuing -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public class CardholderSharedOptions : BaseOptions, IHasMetadata - { - /// - /// Spending rules that give you control over how your cardholders can make charges. - /// - [JsonProperty("authorization_controls")] - public CardholderAuthorizationControlsOptions AuthorizationControls { get; set; } - - /// - /// The cardholder’s billing address. - /// - [JsonProperty("billing")] - public BillingOptions Billing { get; set; } - - /// - /// Additional information about a business entity cardholder. - /// - [JsonProperty("company")] - public CardholderCompanyOptions Company { get; set; } - - /// - /// The cardholder’s email address. - /// - [JsonProperty("email")] - public string Email { get; set; } - - /// - /// Additional information about an individual cardholder. - /// - [JsonProperty("individual")] - public CardholderIndividualOptions Individual { get; set; } - - /// - /// Whether or not this cardholder is the default cardholder. - /// - [JsonProperty("is_default")] - public bool? IsDefault { get; set; } - - /// - /// A set of key/value pairs that you can attach to a charge object. It can be useful for - /// storing additional information about the customer in a structured format. It's often a - /// good idea to store an email address in metadata for tracking later. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// The cardholder’s name. This will be printed on cards issued to them. - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// The cardholder’s phone number. This will be transformed to E.164 if it is not provided - /// in that format already. - /// - [JsonProperty("phone_number")] - public string PhoneNumber { get; set; } - - /// - /// Specifies whether to permit authorizations on this cardholder’s cards. Possible values - /// are active or inactive. - /// - [JsonProperty("status")] - public string Status { get; set; } - } -} diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderUpdateOptions.cs index b34a0382d5..44bdb28980 100644 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cardholders/CardholderUpdateOptions.cs @@ -3,7 +3,70 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardholderUpdateOptions : CardholderSharedOptions + public class CardholderUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Spending rules that give you control over how your cardholders can make charges. + /// + [JsonProperty("authorization_controls")] + public CardholderAuthorizationControlsOptions AuthorizationControls { get; set; } + + /// + /// The cardholder’s billing address. + /// + [JsonProperty("billing")] + public BillingOptions Billing { get; set; } + + /// + /// Additional information about a business entity cardholder. + /// + [JsonProperty("company")] + public CardholderCompanyOptions Company { get; set; } + + /// + /// The cardholder’s email address. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// Additional information about an individual cardholder. + /// + [JsonProperty("individual")] + public CardholderIndividualOptions Individual { get; set; } + + /// + /// Whether or not this cardholder is the default cardholder. + /// + [JsonProperty("is_default")] + public bool? IsDefault { get; set; } + + /// + /// A set of key/value pairs that you can attach to a charge object. It can be useful for + /// storing additional information about the customer in a structured format. It's often a + /// good idea to store an email address in metadata for tracking later. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The cardholder’s name. This will be printed on cards issued to them. + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// The cardholder’s phone number. This will be transformed to E.164 if it is not provided + /// in that format already. + /// + [JsonProperty("phone_number")] + public string PhoneNumber { get; set; } + + /// + /// Specifies whether to permit authorizations on this cardholder’s cards. Possible values + /// are active or inactive. + /// + [JsonProperty("status")] + public string Status { get; set; } } } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs index 9e8fed58bb..b588e01597 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs @@ -3,26 +3,69 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardCreateOptions : CardSharedOptions + public class CardCreateOptions : BaseOptions, IHasMetadata { + /// + /// Spending rules that give you some control over how your cards can + /// be used. + /// + [JsonProperty("authorization_controls")] + public AuthorizationControlsOptions AuthorizationControls { get; set; } + + [JsonProperty("billing")] + public BillingOptions Billing { get; set; } + + /// + /// The Cardholder object with which the card will be associated. + /// [JsonProperty("cardholder")] public string Cardholder { get; set; } + /// + /// The currency for the card. This currently must be usd. + /// [JsonProperty("currency")] public string Currency { get; set; } + /// + /// A set of key-value pairs that you can attach to an object. It + /// can be useful for storing additional information about the object + /// in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + [JsonProperty("name")] public string Name { get; set; } + /// + /// The card this is meant to be a replacement for (if any). + /// [JsonProperty("replacement_for")] public string ReplacementFor { get; set; } + /// + /// If ReplacementFor is specified, this should indicate why + /// that card is being replaced. + /// [JsonProperty("replacement_reason")] public string ReplacementReason { get; set; } + /// + /// The address where the card will be shipped. + /// [JsonProperty("shipping")] public CardShippingOptions Shipping { get; set; } + /// + /// Whether authorizations can be approved on this card. Defaults to inactive. + /// + [JsonProperty("status")] + public string Status { get; set; } + + /// + /// The type of card to issue. Possible values are physical or virtual. + /// [JsonProperty("type")] public string Type { get; set; } } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs deleted file mode 100644 index a78ac6f78f..0000000000 --- a/src/Stripe.net/Services/Issuing/Cards/CardSharedOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Stripe.Issuing -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public class CardSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("authorization_controls")] - public AuthorizationControlsOptions AuthorizationControls { get; set; } - - [JsonProperty("billing")] - public BillingOptions Billing { get; set; } - - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - [JsonProperty("status")] - public string Status { get; set; } - } -} diff --git a/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs index 3f74fa9c39..23f7336b78 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardUpdateOptions.cs @@ -3,7 +3,30 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class CardUpdateOptions : CardSharedOptions + public class CardUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Spending rules that give you some control over how your cards can + /// be used. + /// + [JsonProperty("authorization_controls")] + public AuthorizationControlsOptions AuthorizationControls { get; set; } + + [JsonProperty("billing")] + public BillingOptions Billing { get; set; } + + /// + /// A set of key-value pairs that you can attach to an object. It + /// can be useful for storing additional information about the object + /// in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// Whether authorizations can be approved on this card. Defaults to inactive. + /// + [JsonProperty("status")] + public string Status { get; set; } } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs index 2c31709633..480890a629 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs @@ -3,17 +3,40 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class DisputeCreateOptions : CardholderSharedOptions + public class DisputeCreateOptions : BaseOptions, IHasMetadata { + /// + /// Amount to dispute, defaults to full value, given in the currency + /// the transaction was made in. + /// [JsonProperty("amount")] public long? Amount { get; set; } + /// + /// The ID of the issuing transaction to create a dispute for. + /// [JsonProperty("disputed_transaction")] public string DisputedTransaction { get; set; } + /// + /// A hash containing all the evidence related to the dispute. This + /// should have a single key, equal to the provided Reason, mapping to + /// an appropriate evidence object. + /// [JsonProperty("evidence")] public EvidenceOptions Evidence { get; set; } + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The reason for the dispute. One of other or fraudulent. + /// [JsonProperty("reason")] public string Reason { get; set; } } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs deleted file mode 100644 index 654506aa09..0000000000 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeSharedOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Stripe.Issuing -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public class DisputeSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - } -} diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs index 2ea464f438..cc62db9cc9 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs @@ -3,7 +3,14 @@ namespace Stripe.Issuing using System.Collections.Generic; using Newtonsoft.Json; - public class DisputeUpdateOptions : DisputeSharedOptions + public class DisputeUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } } } diff --git a/src/Stripe.net/Services/Persons/PersonCreateOptions.cs b/src/Stripe.net/Services/Persons/PersonCreateOptions.cs index 5dd4253255..c5e3872b70 100644 --- a/src/Stripe.net/Services/Persons/PersonCreateOptions.cs +++ b/src/Stripe.net/Services/Persons/PersonCreateOptions.cs @@ -1,8 +1,137 @@ namespace Stripe { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class PersonCreateOptions : PersonSharedOptions + public class PersonCreateOptions : BaseOptions, IHasMetadata { + /// + /// The person’s address. + /// + [JsonProperty("address")] + public AddressOptions Address { get; set; } + + /// + /// The Kana variation of the person’s address (Japan only). + /// + [JsonProperty("address_kana")] + public AddressJapanOptions AddressKana { get; set; } + + /// + /// The Kanji variation of the person’s address (Japan only). + /// + [JsonProperty("address_kanji")] + public AddressJapanOptions AddressKanji { get; set; } + + /// + /// The person’s date of birth. + /// + [JsonProperty("dob")] + public DobOptions Dob { get; set; } + + /// + /// The person’s email address. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// The person’s first name. + /// + [JsonProperty("first_name")] + public string FirstName { get; set; } + + /// + /// The Kana variation of the person’s first name (Japan only). + /// + [JsonProperty("first_name_kana")] + public string FirstNameKana { get; set; } + + /// + /// The Kanji variation of the person’s first name (Japan only). + /// + [JsonProperty("first_name_kanji")] + public string FirstNameKanji { get; set; } + + /// + /// The person’s gender (International regulations require either male or + /// female). + /// + [JsonProperty("gender")] + public string Gender { get; set; } + + /// + /// The person’s ID number, as appropriate for their country. For example, a social + /// security number in the U.S., social insurance number in Canada, etc. Instead of the + /// number itself, you can also provide a PII token provided by Stripe.js. + /// + [JsonProperty("id_number")] + public string IdNumber { get; set; } + + /// + /// The person’s last name. + /// + [JsonProperty("last_name")] + public string LastName { get; set; } + + /// + /// The Kana variation of the person’s last name (Japan only). + /// + [JsonProperty("last_name_kana")] + public string LastNameKana { get; set; } + + /// + /// The Kanji variation of the person’s last name (Japan only). + /// + [JsonProperty("last_name_kanji")] + public string LastNameKanji { get; set; } + + /// + /// The person’s maiden name. + /// + [JsonProperty("maiden_name")] + public string MaidenName { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. Individual keys can be + /// unset by posting an empty value to them. All keys can be unset by posting an empty + /// value to metadata. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// A person token, used to securely provide details to the person. + /// + [JsonProperty("person_token")] + public string PersonToken { get; set; } + + /// + /// The person’s phone number. + /// + [JsonProperty("phone")] + public string Phone { get; set; } + + /// + /// The relationship that this person has with the account’s legal entity. + /// + [JsonProperty("relationship")] + public PersonRelationshipOptions Relationship { get; set; } + + /// + /// The last 4 digits of the person’s social security number. + /// + [JsonProperty("ssn_last_4")] + [AllowNameMismatch] + public string SSNLast4 { get; set; } + + /// + /// The person’s verification status. + /// + [JsonProperty("verification")] + public PersonVerificationOptions Verification { get; set; } } } diff --git a/src/Stripe.net/Services/Persons/PersonSharedOptions.cs b/src/Stripe.net/Services/Persons/PersonSharedOptions.cs deleted file mode 100644 index ea3bdfa89a..0000000000 --- a/src/Stripe.net/Services/Persons/PersonSharedOptions.cs +++ /dev/null @@ -1,137 +0,0 @@ -namespace Stripe -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public abstract class PersonSharedOptions : BaseOptions, IHasMetadata - { - /// - /// The person’s address. - /// - [JsonProperty("address")] - public AddressOptions Address { get; set; } - - /// - /// The Kana variation of the person’s address (Japan only). - /// - [JsonProperty("address_kana")] - public AddressJapanOptions AddressKana { get; set; } - - /// - /// The Kanji variation of the person’s address (Japan only). - /// - [JsonProperty("address_kanji")] - public AddressJapanOptions AddressKanji { get; set; } - - /// - /// The person’s date of birth. - /// - [JsonProperty("dob")] - public DobOptions Dob { get; set; } - - /// - /// The person’s email address. - /// - [JsonProperty("email")] - public string Email { get; set; } - - /// - /// The person’s first name. - /// - [JsonProperty("first_name")] - public string FirstName { get; set; } - - /// - /// The Kana variation of the person’s first name (Japan only). - /// - [JsonProperty("first_name_kana")] - public string FirstNameKana { get; set; } - - /// - /// The Kanji variation of the person’s first name (Japan only). - /// - [JsonProperty("first_name_kanji")] - public string FirstNameKanji { get; set; } - - /// - /// The person’s gender (International regulations require either male or - /// female). - /// - [JsonProperty("gender")] - public string Gender { get; set; } - - /// - /// The person’s ID number, as appropriate for their country. For example, a social - /// security number in the U.S., social insurance number in Canada, etc. Instead of the - /// number itself, you can also provide a PII token provided by Stripe.js. - /// - [JsonProperty("id_number")] - public string IdNumber { get; set; } - - /// - /// The person’s last name. - /// - [JsonProperty("last_name")] - public string LastName { get; set; } - - /// - /// The Kana variation of the person’s last name (Japan only). - /// - [JsonProperty("last_name_kana")] - public string LastNameKana { get; set; } - - /// - /// The Kanji variation of the person’s last name (Japan only). - /// - [JsonProperty("last_name_kanji")] - public string LastNameKanji { get; set; } - - /// - /// The person’s maiden name. - /// - [JsonProperty("maiden_name")] - public string MaidenName { get; set; } - - /// - /// Set of key-value pairs that you can attach to an object. This can be useful for storing - /// additional information about the object in a structured format. Individual keys can be - /// unset by posting an empty value to them. All keys can be unset by posting an empty - /// value to metadata. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// A person token, used to securely provide details to the person. - /// - [JsonProperty("person_token")] - public string PersonToken { get; set; } - - /// - /// The person’s phone number. - /// - [JsonProperty("phone")] - public string Phone { get; set; } - - /// - /// The relationship that this person has with the account’s legal entity. - /// - [JsonProperty("relationship")] - public PersonRelationshipOptions Relationship { get; set; } - - /// - /// The last 4 digits of the person’s social security number. - /// - [JsonProperty("ssn_last_4")] - [AllowNameMismatch] - public string SSNLast4 { get; set; } - - /// - /// The person’s verification status. - /// - [JsonProperty("verification")] - public PersonVerificationOptions Verification { get; set; } - } -} diff --git a/src/Stripe.net/Services/Persons/PersonUpdateOptions.cs b/src/Stripe.net/Services/Persons/PersonUpdateOptions.cs index 7b191ade93..3d1d8d64b2 100644 --- a/src/Stripe.net/Services/Persons/PersonUpdateOptions.cs +++ b/src/Stripe.net/Services/Persons/PersonUpdateOptions.cs @@ -1,8 +1,137 @@ namespace Stripe { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class PersonUpdateOptions : PersonSharedOptions + public class PersonUpdateOptions : BaseOptions, IHasMetadata { + /// + /// The person’s address. + /// + [JsonProperty("address")] + public AddressOptions Address { get; set; } + + /// + /// The Kana variation of the person’s address (Japan only). + /// + [JsonProperty("address_kana")] + public AddressJapanOptions AddressKana { get; set; } + + /// + /// The Kanji variation of the person’s address (Japan only). + /// + [JsonProperty("address_kanji")] + public AddressJapanOptions AddressKanji { get; set; } + + /// + /// The person’s date of birth. + /// + [JsonProperty("dob")] + public DobOptions Dob { get; set; } + + /// + /// The person’s email address. + /// + [JsonProperty("email")] + public string Email { get; set; } + + /// + /// The person’s first name. + /// + [JsonProperty("first_name")] + public string FirstName { get; set; } + + /// + /// The Kana variation of the person’s first name (Japan only). + /// + [JsonProperty("first_name_kana")] + public string FirstNameKana { get; set; } + + /// + /// The Kanji variation of the person’s first name (Japan only). + /// + [JsonProperty("first_name_kanji")] + public string FirstNameKanji { get; set; } + + /// + /// The person’s gender (International regulations require either male or + /// female). + /// + [JsonProperty("gender")] + public string Gender { get; set; } + + /// + /// The person’s ID number, as appropriate for their country. For example, a social + /// security number in the U.S., social insurance number in Canada, etc. Instead of the + /// number itself, you can also provide a PII token provided by Stripe.js. + /// + [JsonProperty("id_number")] + public string IdNumber { get; set; } + + /// + /// The person’s last name. + /// + [JsonProperty("last_name")] + public string LastName { get; set; } + + /// + /// The Kana variation of the person’s last name (Japan only). + /// + [JsonProperty("last_name_kana")] + public string LastNameKana { get; set; } + + /// + /// The Kanji variation of the person’s last name (Japan only). + /// + [JsonProperty("last_name_kanji")] + public string LastNameKanji { get; set; } + + /// + /// The person’s maiden name. + /// + [JsonProperty("maiden_name")] + public string MaidenName { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. Individual keys can be + /// unset by posting an empty value to them. All keys can be unset by posting an empty + /// value to metadata. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// A person token, used to securely provide details to the person. + /// + [JsonProperty("person_token")] + public string PersonToken { get; set; } + + /// + /// The person’s phone number. + /// + [JsonProperty("phone")] + public string Phone { get; set; } + + /// + /// The relationship that this person has with the account’s legal entity. + /// + [JsonProperty("relationship")] + public PersonRelationshipOptions Relationship { get; set; } + + /// + /// The last 4 digits of the person’s social security number. + /// + [JsonProperty("ssn_last_4")] + [AllowNameMismatch] + public string SSNLast4 { get; set; } + + /// + /// The person’s verification status. + /// + [JsonProperty("verification")] + public PersonVerificationOptions Verification { get; set; } } } diff --git a/src/Stripe.net/Services/Products/ProductCreateOptions.cs b/src/Stripe.net/Services/Products/ProductCreateOptions.cs index 60c95f5937..5b48a16b60 100644 --- a/src/Stripe.net/Services/Products/ProductCreateOptions.cs +++ b/src/Stripe.net/Services/Products/ProductCreateOptions.cs @@ -1,19 +1,105 @@ namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; - public class ProductCreateOptions : ProductSharedOptions, IHasId + public class ProductCreateOptions : BaseOptions, IHasId, IHasMetadata { /// - /// The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. + /// Whether or not the product is currently available for purchase. Defaults to true. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// A list of up to 5 alphanumeric attributes that each SKU can provide + /// values for (e.g. ["color", "size"]). + /// + [JsonProperty("attributes")] + public List Attributes { get; set; } + + /// + /// A short one-line description of the product, meant to be displayable to the customer. + /// + [JsonProperty("caption")] + public string Caption { get; set; } + + /// + /// An array of Connect application names or identifiers that should + /// not be able to order the SKUs for this product. + /// + [JsonProperty("deactivate_on")] + public List DeactivateOn { get; set; } + + /// + /// The product’s description, meant to be displayable to the customer. + /// + [JsonProperty("description")] + public string Description { get; set; } + + /// + /// The identifier for the product. Must be unique. If not provided, an + /// identifier will be randomly generated. /// [JsonProperty("id")] public string Id { get; set; } /// - /// The type of the product. Either 'service' or 'good'. + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + /// + [JsonProperty("images")] + public List Images { get; set; } + + /// + /// A set of key/value pairs that you can attach to a product object. + /// It can be useful for storing additional information about the + /// product in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// REQUIRED: The product’s name, meant to be displayable to the customer. + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// The dimensions of this product for shipping purposes. A SKU + /// associated with this product can override this value by having its + /// own package_dimensions. + /// + [JsonProperty("package_dimensions")] + public PackageDimensionOptions PackageDimensions { get; set; } + + /// + /// Whether this product is shipped (i.e. physical goods). Defaults to true. + /// + [JsonProperty("shippable")] + public bool? Shippable { get; set; } + + /// + /// What appears on the customers credit card statement. + /// + [JsonProperty("statement_descriptor")] + public string StatementDescriptor { get; set; } + + /// + /// The type of the product. Either service or good. /// [JsonProperty("type")] public string Type { get; set; } + + /// + /// A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices. + /// + [JsonProperty("unit_label")] + public string UnitLabel { get; set; } + + /// + /// A URL of a publicly-accessible webpage for this product. + /// + [JsonProperty("url")] + public string Url { get; set; } } } diff --git a/src/Stripe.net/Services/Products/ProductSharedOptions.cs b/src/Stripe.net/Services/Products/ProductSharedOptions.cs deleted file mode 100644 index e5e5d384c5..0000000000 --- a/src/Stripe.net/Services/Products/ProductSharedOptions.cs +++ /dev/null @@ -1,86 +0,0 @@ -namespace Stripe -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public abstract class ProductSharedOptions : BaseOptions, IHasMetadata - { - /// - /// Whether or not the product is currently available for purchase. Defaults to true. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - - /// - /// A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g. ["color", "size"]). - /// - [JsonProperty("attributes")] - public List Attributes { get; set; } - - /// - /// A short one-line description of the product, meant to be displayable to the customer. - /// - [JsonProperty("caption")] - public string Caption { get; set; } - - /// - /// An array of Connect application names or identifiers that should not be able to order the SKUs for this product. - /// - [JsonProperty("deactivate_on")] - public List DeactivateOn { get; set; } - - /// - /// The product’s description, meant to be displayable to the customer. - /// - [JsonProperty("description")] - public string Description { get; set; } - - /// - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - /// - [JsonProperty("images")] - public List Images { get; set; } - - /// - /// A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// REQUIRED: The product’s name, meant to be displayable to the customer. - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own package_dimensions. - /// - [JsonProperty("package_dimensions")] - public PackageDimensionOptions PackageDimensions { get; set; } - - /// - /// Whether this product is shipped (i.e. physical goods). Defaults to true. - /// - [JsonProperty("shippable")] - public bool? Shippable { get; set; } - - /// - /// What appears on the customers credit card statement. - /// - [JsonProperty("statement_descriptor")] - public string StatementDescriptor { get; set; } - - /// - /// A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices. - /// - [JsonProperty("unit_label")] - public string UnitLabel { get; set; } - - /// - /// A URL of a publicly-accessible webpage for this product. - /// - [JsonProperty("url")] - public string Url { get; set; } - } -} diff --git a/src/Stripe.net/Services/Products/ProductUpdateOptions.cs b/src/Stripe.net/Services/Products/ProductUpdateOptions.cs index 76f9d395a8..bf7be586d4 100644 --- a/src/Stripe.net/Services/Products/ProductUpdateOptions.cs +++ b/src/Stripe.net/Services/Products/ProductUpdateOptions.cs @@ -1,6 +1,86 @@ namespace Stripe { - public class ProductUpdateOptions : ProductSharedOptions + using System.Collections.Generic; + using Newtonsoft.Json; + + public class ProductUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Whether or not the product is currently available for purchase. Defaults to true. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g. ["color", "size"]). + /// + [JsonProperty("attributes")] + public List Attributes { get; set; } + + /// + /// A short one-line description of the product, meant to be displayable to the customer. + /// + [JsonProperty("caption")] + public string Caption { get; set; } + + /// + /// An array of Connect application names or identifiers that should not be able to order the SKUs for this product. + /// + [JsonProperty("deactivate_on")] + public List DeactivateOn { get; set; } + + /// + /// The product’s description, meant to be displayable to the customer. + /// + [JsonProperty("description")] + public string Description { get; set; } + + /// + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + /// + [JsonProperty("images")] + public List Images { get; set; } + + /// + /// A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// REQUIRED: The product’s name, meant to be displayable to the customer. + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own package_dimensions. + /// + [JsonProperty("package_dimensions")] + public PackageDimensionOptions PackageDimensions { get; set; } + + /// + /// Whether this product is shipped (i.e. physical goods). Defaults to true. + /// + [JsonProperty("shippable")] + public bool? Shippable { get; set; } + + /// + /// What appears on the customers credit card statement. + /// + [JsonProperty("statement_descriptor")] + public string StatementDescriptor { get; set; } + + /// + /// A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices. + /// + [JsonProperty("unit_label")] + public string UnitLabel { get; set; } + + /// + /// A URL of a publicly-accessible webpage for this product. + /// + [JsonProperty("url")] + public string Url { get; set; } } } diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListCreateOptions.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListCreateOptions.cs index 5e37d3c877..15d90e2330 100644 --- a/src/Stripe.net/Services/Radar/ValueLists/ValueListCreateOptions.cs +++ b/src/Stripe.net/Services/Radar/ValueLists/ValueListCreateOptions.cs @@ -3,9 +3,36 @@ namespace Stripe.Radar using System.Collections.Generic; using Newtonsoft.Json; - public class ValueListCreateOptions : ValueListSharedOptions + public class ValueListCreateOptions : BaseOptions, IHasMetadata { + /// + /// The name of the value list for use in rules. + /// + [JsonProperty("alias")] + public string Alias { get; set; } + + /// + /// Type of the items in the value list. One of + /// card_fingerprint, card_bin, email, + /// ip_address, country, string, or + /// case_sensitive_string. Use string if the item type is + /// unknown or mixed. + /// [JsonProperty("item_type")] public string ItemType { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The human-readable name of the value list. + /// + [JsonProperty("name")] + public string Name { get; set; } } } diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListSharedOptions.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListSharedOptions.cs deleted file mode 100644 index 075e130028..0000000000 --- a/src/Stripe.net/Services/Radar/ValueLists/ValueListSharedOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Stripe.Radar -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public class ValueListSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("alias")] - public string Alias { get; set; } - - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - [JsonProperty("name")] - public string Name { get; set; } - } -} diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListUpdateOptions.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListUpdateOptions.cs index 17a5fcdc40..0cd9b6cf23 100644 --- a/src/Stripe.net/Services/Radar/ValueLists/ValueListUpdateOptions.cs +++ b/src/Stripe.net/Services/Radar/ValueLists/ValueListUpdateOptions.cs @@ -3,7 +3,26 @@ namespace Stripe.Radar using System.Collections.Generic; using Newtonsoft.Json; - public class ValueListUpdateOptions : ValueListSharedOptions + public class ValueListUpdateOptions : BaseOptions, IHasMetadata { + /// + /// The name of the value list for use in rules. + /// + [JsonProperty("alias")] + public string Alias { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The human-readable name of the value list. + /// + [JsonProperty("name")] + public string Name { get; set; } } } diff --git a/src/Stripe.net/Services/Skus/SkuCreateOptions.cs b/src/Stripe.net/Services/Skus/SkuCreateOptions.cs index 53e2fa4a4a..d45eae63fc 100644 --- a/src/Stripe.net/Services/Skus/SkuCreateOptions.cs +++ b/src/Stripe.net/Services/Skus/SkuCreateOptions.cs @@ -1,13 +1,70 @@ namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; - public class SkuCreateOptions : SkuSharedOptions, IHasId + public class SkuCreateOptions : BaseOptions, IHasId, IHasMetadata { + /// + /// Whether or not the SKU is currently available for purchase. Defaults to true. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// A dictionary of attributes and values for the attributes defined by the product. If, for + /// example, a product’s attributes are ["size", "gender"], a valid SKU has the + /// following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. + /// + [JsonProperty("attributes")] + public Dictionary Attributes { get; set; } + + /// + /// Three-letter ISO currency code, in lowercase. Must be a supported currency. + /// + [JsonProperty("currency")] + public string Currency { get; set; } + /// /// The identifier for the SKU. Must be unique. If not provided, an identifier will be randomly generated. /// [JsonProperty("id")] public string Id { get; set; } + + /// + /// The URL of an image for this SKU, meant to be displayable to the customer. + /// + [JsonProperty("image")] + public string Image { get; set; } + + /// + /// Description of the SKU’s inventory. + /// + [JsonProperty("inventory")] + public InventoryOptions Inventory { get; set; } + + /// + /// Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The dimensions of this SKU for shipping purposes. + /// + [JsonProperty("package_dimensions")] + public PackageDimensionOptions PackageDimensions { get; set; } + + /// + /// The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a 0-decimal currency). + /// + [JsonProperty("price")] + public long? Price { get; set; } + + /// + /// The ID of the product this SKU is associated with. The product must be currently active. + /// + [JsonProperty("product")] + public string Product { get; set; } } } diff --git a/src/Stripe.net/Services/Skus/SkuSharedOptions.cs b/src/Stripe.net/Services/Skus/SkuSharedOptions.cs deleted file mode 100644 index a47630b74f..0000000000 --- a/src/Stripe.net/Services/Skus/SkuSharedOptions.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace Stripe -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public abstract class SkuSharedOptions : BaseOptions, IHasMetadata - { - /// - /// Whether or not the SKU is currently available for purchase. Defaults to true. - /// - [JsonProperty("active")] - public bool? Active { get; set; } - - /// - /// A dictionary of attributes and values for the attributes defined by the product. If, for - /// example, a product’s attributes are ["size", "gender"], a valid SKU has the - /// following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. - /// - [JsonProperty("attributes")] - public Dictionary Attributes { get; set; } - - /// - /// Three-letter ISO currency code, in lowercase. Must be a supported currency. - /// - [JsonProperty("currency")] - public string Currency { get; set; } - - /// - /// The URL of an image for this SKU, meant to be displayable to the customer. - /// - [JsonProperty("image")] - public string Image { get; set; } - - /// - /// Description of the SKU’s inventory. - /// - [JsonProperty("inventory")] - public InventoryOptions Inventory { get; set; } - - /// - /// Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the object in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// The dimensions of this SKU for shipping purposes. - /// - [JsonProperty("package_dimensions")] - public PackageDimensionOptions PackageDimensions { get; set; } - - /// - /// The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a 0-decimal currency). - /// - [JsonProperty("price")] - public long? Price { get; set; } - - /// - /// The ID of the product this SKU is associated with. The product must be currently active. - /// - [JsonProperty("product")] - public string Product { get; set; } - } -} diff --git a/src/Stripe.net/Services/Skus/SkuUpdateOptions.cs b/src/Stripe.net/Services/Skus/SkuUpdateOptions.cs index e681a49647..8074b77ddd 100644 --- a/src/Stripe.net/Services/Skus/SkuUpdateOptions.cs +++ b/src/Stripe.net/Services/Skus/SkuUpdateOptions.cs @@ -1,6 +1,64 @@ namespace Stripe { - public class SkuUpdateOptions : SkuSharedOptions + using System.Collections.Generic; + using Newtonsoft.Json; + + public class SkuUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Whether or not the SKU is currently available for purchase. Defaults to true. + /// + [JsonProperty("active")] + public bool? Active { get; set; } + + /// + /// A dictionary of attributes and values for the attributes defined by the product. If, for + /// example, a product’s attributes are ["size", "gender"], a valid SKU has the + /// following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. + /// + [JsonProperty("attributes")] + public Dictionary Attributes { get; set; } + + /// + /// Three-letter ISO currency code, in lowercase. Must be a supported currency. + /// + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// The URL of an image for this SKU, meant to be displayable to the customer. + /// + [JsonProperty("image")] + public string Image { get; set; } + + /// + /// Description of the SKU’s inventory. + /// + [JsonProperty("inventory")] + public InventoryOptions Inventory { get; set; } + + /// + /// Set of key/value pairs that you can attach to an object. It can be useful for storing additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// The dimensions of this SKU for shipping purposes. + /// + [JsonProperty("package_dimensions")] + public PackageDimensionOptions PackageDimensions { get; set; } + + /// + /// The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a 0-decimal currency). + /// + [JsonProperty("price")] + public long? Price { get; set; } + + /// + /// The ID of the product this SKU is associated with. The product must be currently active. + /// + [JsonProperty("product")] + public string Product { get; set; } } } diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs index e4a7734f3b..076b94f717 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemCreateOptions.cs @@ -1,17 +1,72 @@ namespace Stripe { + using System; using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class SubscriptionItemCreateOptions : SubscriptionItemSharedOptions, IHasMetadata + public class SubscriptionItemCreateOptions : BaseOptions, IHasMetadata { + /// + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a + /// new billing period. + /// + [JsonProperty("billing_thresholds")] + public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if + /// the invoice caused by the item creation cannot be paid. Otherwise use + /// allow_incomplete. + /// + [JsonProperty("payment_behavior")] + public string PaymentBehavior { get; set; } + + /// + /// REQUIRED: The identifier of the plan to add to the subscription. + /// + [JsonProperty("plan")] + public string Plan { get; set; } + + /// + /// Flag indicating whether to prorate switching plans during a billing cycle. + /// + [JsonProperty("prorate")] + public bool? Prorate { get; set; } + + /// + /// If set, the proration will be calculated as though the subscription was updated at the + /// given time. This can be used to apply the same proration that was previewed with the + /// upcoming invoice endpoint. + /// + [JsonProperty("proration_date")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? ProrationDate { get; set; } + + /// + /// The quantity you’d like to apply to the subscription item you’re creating. + /// + [JsonProperty("quantity")] + public long? Quantity { get; set; } + /// /// REQUIRED: The identifier of the subscription to modify. /// [JsonProperty("subscription")] public string Subscription { get; set; } - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } + /// + /// Ids of the tax rates to apply to this subscription item. + /// + [JsonProperty("tax_rates")] + public List TaxRates { get; set; } } } diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs deleted file mode 100644 index c9aec22aee..0000000000 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs +++ /dev/null @@ -1,58 +0,0 @@ -namespace Stripe -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public abstract class SubscriptionItemSharedOptions : BaseOptions - { - /// - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a - /// new billing period. - /// - [JsonProperty("billing_thresholds")] - public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } - - /// - /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if - /// the invoice caused by the item creation cannot be paid. Otherwise use - /// allow_incomplete. - /// - [JsonProperty("payment_behavior")] - public string PaymentBehavior { get; set; } - - /// - /// REQUIRED: The identifier of the plan to add to the subscription. - /// - [JsonProperty("plan")] - public string Plan { get; set; } - - /// - /// Flag indicating whether to prorate switching plans during a billing cycle. - /// - [JsonProperty("prorate")] - public bool? Prorate { get; set; } - - /// - /// If set, the proration will be calculated as though the subscription was updated at the - /// given time. This can be used to apply the same proration that was previewed with the - /// upcoming invoice endpoint. - /// - [JsonProperty("proration_date")] - [JsonConverter(typeof(DateTimeConverter))] - public DateTime? ProrationDate { get; set; } - - /// - /// The quantity you’d like to apply to the subscription item you’re creating. - /// - [JsonProperty("quantity")] - public long? Quantity { get; set; } - - /// - /// Ids of the tax rates to apply to this subscription item. - /// - [JsonProperty("tax_rates")] - public List TaxRates { get; set; } - } -} diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs index ae9b160fc0..038df90142 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs @@ -1,12 +1,23 @@ namespace Stripe { + using System; using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class SubscriptionItemUpdateOptions : SubscriptionItemSharedOptions, IHasMetadata + public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata { /// - /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a + /// new billing period. + /// + [JsonProperty("billing_thresholds")] + public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. /// [JsonProperty("metadata")] public Dictionary Metadata { get; set; } @@ -17,5 +28,46 @@ public class SubscriptionItemUpdateOptions : SubscriptionItemSharedOptions, IHas /// [JsonProperty("off_session")] public bool? OffSession { get; set; } + + /// + /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if + /// the invoice caused by the item creation cannot be paid. Otherwise use + /// allow_incomplete. + /// + [JsonProperty("payment_behavior")] + public string PaymentBehavior { get; set; } + + /// + /// REQUIRED: The identifier of the plan to add to the subscription. + /// + [JsonProperty("plan")] + public string Plan { get; set; } + + /// + /// Flag indicating whether to prorate switching plans during a billing cycle. + /// + [JsonProperty("prorate")] + public bool? Prorate { get; set; } + + /// + /// If set, the proration will be calculated as though the subscription was updated at the + /// given time. This can be used to apply the same proration that was previewed with the + /// upcoming invoice endpoint. + /// + [JsonProperty("proration_date")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? ProrationDate { get; set; } + + /// + /// The quantity you’d like to apply to the subscription item you’re creating. + /// + [JsonProperty("quantity")] + public long? Quantity { get; set; } + + /// + /// Ids of the tax rates to apply to this subscription item. + /// + [JsonProperty("tax_rates")] + public List TaxRates { get; set; } } } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs index eade1f5cc3..f47564ce07 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleCreateOptions.cs @@ -1,10 +1,11 @@ namespace Stripe { using System; + using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; - public class SubscriptionScheduleCreateOptions : SubscriptionScheduleSharedOptions + public class SubscriptionScheduleCreateOptions : BaseOptions, IHasMetadata { /// /// The identifier of the customer to create the subscription schedule for. @@ -12,6 +13,19 @@ public class SubscriptionScheduleCreateOptions : SubscriptionScheduleSharedOptio [JsonProperty("customer")] public string Customer { get; set; } + /// + /// Object representing the subscription schedule’s default settings. + /// + [JsonProperty("default_settings")] + public SubscriptionScheduleDefaultSettingsOptions DefaultSettings { get; set; } + + /// + /// Behavior of the subscription schedule and underlying subscription when it ends. Possible + /// values are cancel, none, release and renew. + /// + [JsonProperty("end_behavior")] + public string EndBehavior { get; set; } + /// /// Migrate an existing subscription to be managed by a subscription schedule. If this /// parameter is set, a subscription schedule will be created using the subscription’s @@ -21,6 +35,27 @@ public class SubscriptionScheduleCreateOptions : SubscriptionScheduleSharedOptio [JsonProperty("from_subscription")] public string FromSubscription { get; set; } + /// + /// Define the default settings applied to invoices created by this subscription schedule. + /// + [JsonProperty("invoice_settings")] + public SubscriptionScheduleInvoiceSettingsOptions InvoiceSettings { get; set; } + + /// + /// A set of key/value pairs that you can attach to a subscription schedule object. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// List representing phases of the subscription schedule. Each phase can be customized to + /// have different durations, plans, and coupons. If there are multiple phases, the + /// end_date of one phase will always equal the start_date of the + /// next phase. + /// + [JsonProperty("phases")] + public List Phases { get; set; } + /// /// The date at which the subscription schedule starts. /// diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleSharedOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleSharedOptions.cs deleted file mode 100644 index db76d54b33..0000000000 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleSharedOptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace Stripe -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public abstract class SubscriptionScheduleSharedOptions : BaseOptions, IHasMetadata - { - /// - /// Object representing the subscription schedule’s default settings. - /// - [JsonProperty("default_settings")] - public SubscriptionScheduleDefaultSettingsOptions DefaultSettings { get; set; } - - /// - /// Behavior of the subscription schedule and underlying subscription when it ends. Possible - /// values are cancel, none, release and renew. - /// - [JsonProperty("end_behavior")] - public string EndBehavior { get; set; } - - /// - /// Define the default settings applied to invoices created by this subscription schedule. - /// - [JsonProperty("invoice_settings")] - public SubscriptionScheduleInvoiceSettingsOptions InvoiceSettings { get; set; } - - /// - /// A set of key/value pairs that you can attach to a subscription schedule object. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// List representing phases of the subscription schedule. Each phase can be customized to - /// have different durations, plans, and coupons. If there are multiple phases, the - /// end_date of one phase will always equal the start_date of the - /// next phase. - /// - [JsonProperty("phases")] - public List Phases { get; set; } - } -} diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs index 6ab909026e..c14f618a71 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleUpdateOptions.cs @@ -5,8 +5,42 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SubscriptionScheduleUpdateOptions : SubscriptionScheduleSharedOptions + public class SubscriptionScheduleUpdateOptions : BaseOptions, IHasMetadata { + /// + /// Object representing the subscription schedule’s default settings. + /// + [JsonProperty("default_settings")] + public SubscriptionScheduleDefaultSettingsOptions DefaultSettings { get; set; } + + /// + /// Behavior of the subscription schedule and underlying subscription when it ends. Possible + /// values are cancel, none, release and renew. + /// + [JsonProperty("end_behavior")] + public string EndBehavior { get; set; } + + /// + /// Define the default settings applied to invoices created by this subscription schedule. + /// + [JsonProperty("invoice_settings")] + public SubscriptionScheduleInvoiceSettingsOptions InvoiceSettings { get; set; } + + /// + /// A set of key/value pairs that you can attach to a subscription schedule object. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// List representing phases of the subscription schedule. Each phase can be customized to + /// have different durations, plans, and coupons. If there are multiple phases, the + /// end_date of one phase will always equal the start_date of the + /// next phase. + /// + [JsonProperty("phases")] + public List Phases { get; set; } + /// /// If the update changes the current phase, indicates if the changes should be prorated. /// Defaults to true. diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs index f27e5f6606..ab4b11af6e 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs @@ -5,8 +5,14 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SubscriptionCreateOptions : SubscriptionSharedOptions + public class SubscriptionCreateOptions : BaseOptions, IHasMetadata { + /// + /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. + /// + [JsonProperty("application_fee_percent")] + public decimal? ApplicationFeePercent { get; set; } + /// /// For new subscriptions, a past timestamp to backdate the subscription’s start date to. /// If set, the first invoice will contain a proration for the timespan between the start @@ -25,12 +31,158 @@ public class SubscriptionCreateOptions : SubscriptionSharedOptions [JsonConverter(typeof(DateTimeConverter))] public DateTime? BillingCycleAnchor { get; set; } + /// + /// 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")] + public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } + + /// + /// A timestamp at which the subscription should cancel. If set to a date before the + /// current period ends this will cause a proration if prorate=true. + /// + [JsonProperty("cancel_at")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? CancelAt { get; set; } + + /// + /// Boolean indicating whether this subscription should cancel at the end of the current period. + /// + [JsonProperty("cancel_at_period_end")] + public bool? CancelAtPeriodEnd { get; set; } + + /// + /// Either charge_automatically, or send_invoice. When + /// charging automatically, Stripe will attempt to pay this invoice + /// using the default source attached to the customer. When sending an + /// invoice, Stripe will email invoices for this subscription to the + /// customer with payment instructions. Defaults to + /// charge_automatically. + /// + [JsonProperty("collection_method")] + public string CollectionMethod { get; set; } + + /// + /// The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + /// + [JsonProperty("coupon")] + public string Coupon { get; set; } + /// /// REQUIRED: The identifier of the customer to subscribe. /// [JsonProperty("customer")] public string Customer { get; set; } + /// + /// Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice. + /// + [JsonProperty("days_until_due")] + public long? DaysUntilDue { get; set; } + + /// + /// ID of the default payment method for the subscription. + /// + [JsonProperty("default_payment_method")] + public string DefaultPaymentMethod { get; set; } + + [JsonProperty("default_source")] + public string DefaultSource { get; set; } + + /// + /// Ids of the tax rates to apply to this subscription. + /// + [JsonProperty("default_tax_rates")] + public List DefaultTaxRates { get; set; } + + /// + /// List of subscription items, each with an attached plan. + /// + [JsonProperty("items")] + public List Items { get; set; } + + /// + /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// Indicates if a customer is on session while an invoice payment is attempted. + /// + [JsonProperty("off_session")] + public bool? OffSession { get; set; } + + /// + /// + /// Use allow_incomplete to create subscriptions with status=incomplete if its + /// first invoice cannot be paid. Creating subscriptions with this status allows you to + /// manage scenarios where additional user actions are needed to pay a subscription's + /// invoice. For example, SCA regulation may require 3DS authentication to complete payment. + /// See the SCA Migration Guide + /// for Billing to learn more. This is the default behavior. + /// + /// + /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if + /// a subscription's first invoice cannot be paid. For example, if a payment method requires + /// 3DS authentication due to SCA regulation and further user action is needed, this + /// parameter does not create a subscription and returns an error instead. This was the + /// default behavior for API versions prior to 2019-03-14. See the changelog + /// to learn more. + /// + /// + [JsonProperty("payment_behavior")] + public string PaymentBehavior { get; set; } + + /// + /// Specifies an interval for how often to bill for any pending invoice items. It is + /// analogous to creating an invoice for the given subscription at the specified interval. + /// + [JsonProperty("pending_invoice_item_interval")] + public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } + + [Obsolete("Use Items")] + [JsonProperty("plan")] + public string Plan { get; set; } + + /// + /// Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until the anchor date. If false, the anchor period will be free (similar to a trial). + /// + [JsonProperty("prorate")] + public bool? Prorate { get; set; } + + [Obsolete("Use Items")] + [JsonProperty("quantity")] + public long? Quantity { get; set; } + + /// + /// A non-negative decimal (with at most four decimal places) between 0 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. + /// + [Obsolete("Use DefaultTaxRates")] + [JsonProperty("tax_percent")] + public decimal? TaxPercent { get; set; } + + [JsonProperty("transfer_data")] + public SubscriptionTransferDataOptions TransferData { get; set; } + + /// + /// representing the end of the trial period the customer will get + /// before being charged for the first time. This will always overwrite any trials that + /// might apply via a subscribed plan. If set, will override the + /// default trial period of the plan the customer is being subscribed to. The special value + /// can be provided to end the customer’s trial + /// immediately. + /// + [JsonProperty("trial_end")] + [JsonConverter(typeof(AnyOfConverter))] + public AnyOf TrialEnd { get; set; } + + /// + /// Boolean. Decide whether to use the default trial on the plan when creating a subscription. + /// + [JsonProperty("trial_from_plan")] + public bool? TrialFromPlan { get; set; } + /// /// Integer representing the number of trial period days before the customer is charged for the first time. /// diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs deleted file mode 100644 index 35c861f591..0000000000 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionSharedOptions.cs +++ /dev/null @@ -1,162 +0,0 @@ -namespace Stripe -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public abstract class SubscriptionSharedOptions : BaseOptions, IHasMetadata - { - /// - /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. - /// - [JsonProperty("application_fee_percent")] - public decimal? ApplicationFeePercent { get; set; } - - /// - /// 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")] - public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } - - /// - /// A timestamp at which the subscription should cancel. If set to a date before the - /// current period ends this will cause a proration if prorate=true. - /// - [JsonProperty("cancel_at")] - [JsonConverter(typeof(DateTimeConverter))] - public DateTime? CancelAt { get; set; } - - /// - /// Boolean indicating whether this subscription should cancel at the end of the current period. - /// - [JsonProperty("cancel_at_period_end")] - public bool? CancelAtPeriodEnd { get; set; } - - /// - /// Either charge_automatically, or send_invoice. When - /// charging automatically, Stripe will attempt to pay this invoice - /// using the default source attached to the customer. When sending an - /// invoice, Stripe will email invoices for this subscription to the - /// customer with payment instructions. Defaults to - /// charge_automatically. - /// - [JsonProperty("collection_method")] - public string CollectionMethod { get; set; } - - /// - /// The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. - /// - [JsonProperty("coupon")] - public string Coupon { get; set; } - - /// - /// Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice. - /// - [JsonProperty("days_until_due")] - public long? DaysUntilDue { get; set; } - - /// - /// ID of the default payment method for the subscription. - /// - [JsonProperty("default_payment_method")] - public string DefaultPaymentMethod { get; set; } - - [JsonProperty("default_source")] - public string DefaultSource { get; set; } - - /// - /// Ids of the tax rates to apply to this subscription. - /// - [JsonProperty("default_tax_rates")] - public List DefaultTaxRates { get; set; } - - /// - /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - /// - /// List of subscription items, each with an attached plan. - /// - [JsonProperty("items")] - public List Items { get; set; } - - /// - /// Indicates if a customer is on session while an invoice payment is attempted. - /// - [JsonProperty("off_session")] - public bool? OffSession { get; set; } - - /// - /// - /// Use allow_incomplete to create subscriptions with status=incomplete if its - /// first invoice cannot be paid. Creating subscriptions with this status allows you to - /// manage scenarios where additional user actions are needed to pay a subscription's - /// invoice. For example, SCA regulation may require 3DS authentication to complete payment. - /// See the SCA Migration Guide - /// for Billing to learn more. This is the default behavior. - /// - /// - /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if - /// a subscription's first invoice cannot be paid. For example, if a payment method requires - /// 3DS authentication due to SCA regulation and further user action is needed, this - /// parameter does not create a subscription and returns an error instead. This was the - /// default behavior for API versions prior to 2019-03-14. See the changelog - /// to learn more. - /// - /// - [JsonProperty("payment_behavior")] - public string PaymentBehavior { get; set; } - - /// - /// Specifies an interval for how often to bill for any pending invoice items. It is - /// analogous to creating an invoice for the given subscription at the specified interval. - /// - [JsonProperty("pending_invoice_item_interval")] - public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } - - /// - /// Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until the anchor date. If false, the anchor period will be free (similar to a trial). - /// - [JsonProperty("prorate")] - public bool? Prorate { get; set; } - - /// - /// A non-negative decimal (with at most four decimal places) between 0 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. - /// - [Obsolete("Use DefaultTaxRates")] - [JsonProperty("tax_percent")] - public decimal? TaxPercent { get; set; } - - /// - /// representing the end of the trial period the customer will get - /// before being charged for the first time. This will always overwrite any trials that - /// might apply via a subscribed plan. If set, will override the - /// default trial period of the plan the customer is being subscribed to. The special value - /// can be provided to end the customer’s trial - /// immediately. - /// - [JsonProperty("trial_end")] - [JsonConverter(typeof(AnyOfConverter))] - public AnyOf TrialEnd { get; set; } - - /// - /// Boolean. Decide whether to use the default trial on the plan when creating a subscription. - /// - [JsonProperty("trial_from_plan")] - public bool? TrialFromPlan { get; set; } - - [Obsolete("Use Items")] - [JsonProperty("plan")] - public string Plan { get; set; } - - [Obsolete("Use Items")] - [JsonProperty("quantity")] - public long? Quantity { get; set; } - - [JsonProperty("transfer_data")] - public SubscriptionTransferDataOptions TransferData { get; set; } - } -} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs index 227d15e345..26d74995ee 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs @@ -5,8 +5,14 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class SubscriptionUpdateOptions : SubscriptionSharedOptions + public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata { + /// + /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. + /// + [JsonProperty("application_fee_percent")] + public decimal? ApplicationFeePercent { get; set; } + /// /// One of . Setting the value to /// resets the subscription’s billing @@ -16,11 +22,157 @@ public class SubscriptionUpdateOptions : SubscriptionSharedOptions [JsonProperty("billing_cycle_anchor")] public SubscriptionBillingCycleAnchor BillingCycleAnchor { get; set; } + /// + /// 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")] + public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } + + /// + /// A timestamp at which the subscription should cancel. If set to a date before the + /// current period ends this will cause a proration if prorate=true. + /// + [JsonProperty("cancel_at")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? CancelAt { get; set; } + + /// + /// Boolean indicating whether this subscription should cancel at the end of the current period. + /// + [JsonProperty("cancel_at_period_end")] + public bool? CancelAtPeriodEnd { get; set; } + + /// + /// Either charge_automatically, or send_invoice. When + /// charging automatically, Stripe will attempt to pay this invoice + /// using the default source attached to the customer. When sending an + /// invoice, Stripe will email invoices for this subscription to the + /// customer with payment instructions. Defaults to + /// charge_automatically. + /// + [JsonProperty("collection_method")] + public string CollectionMethod { get; set; } + + /// + /// The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + /// + [JsonProperty("coupon")] + public string Coupon { get; set; } + + /// + /// Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice. + /// + [JsonProperty("days_until_due")] + public long? DaysUntilDue { get; set; } + + /// + /// ID of the default payment method for the subscription. + /// + [JsonProperty("default_payment_method")] + public string DefaultPaymentMethod { get; set; } + + [JsonProperty("default_source")] + public string DefaultSource { get; set; } + + /// + /// Ids of the tax rates to apply to this subscription. + /// + [JsonProperty("default_tax_rates")] + public List DefaultTaxRates { get; set; } + + /// + /// List of subscription items, each with an attached plan. + /// + [JsonProperty("items")] + public List Items { get; set; } + + /// + /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + + /// + /// Indicates if a customer is on session while an invoice payment is attempted. + /// + [JsonProperty("off_session")] + public bool? OffSession { get; set; } + + /// + /// + /// Use allow_incomplete to create subscriptions with status=incomplete if its + /// first invoice cannot be paid. Creating subscriptions with this status allows you to + /// manage scenarios where additional user actions are needed to pay a subscription's + /// invoice. For example, SCA regulation may require 3DS authentication to complete payment. + /// See the SCA Migration Guide + /// for Billing to learn more. This is the default behavior. + /// + /// + /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if + /// a subscription's first invoice cannot be paid. For example, if a payment method requires + /// 3DS authentication due to SCA regulation and further user action is needed, this + /// parameter does not create a subscription and returns an error instead. This was the + /// default behavior for API versions prior to 2019-03-14. See the changelog + /// to learn more. + /// + /// + [JsonProperty("payment_behavior")] + public string PaymentBehavior { get; set; } + + /// + /// Specifies an interval for how often to bill for any pending invoice items. It is + /// analogous to creating an invoice for the given subscription at the specified interval. + /// + [JsonProperty("pending_invoice_item_interval")] + public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } + + [Obsolete("Use Items")] + [JsonProperty("plan")] + public string Plan { get; set; } + + /// + /// Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until the anchor date. If false, the anchor period will be free (similar to a trial). + /// + [JsonProperty("prorate")] + public bool? Prorate { get; set; } + /// /// If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. /// [JsonProperty("proration_date")] [JsonConverter(typeof(DateTimeConverter))] public DateTime? ProrationDate { get; set; } + + [Obsolete("Use Items")] + [JsonProperty("quantity")] + public long? Quantity { get; set; } + + /// + /// A non-negative decimal (with at most four decimal places) between 0 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. + /// + [Obsolete("Use DefaultTaxRates")] + [JsonProperty("tax_percent")] + public decimal? TaxPercent { get; set; } + + [JsonProperty("transfer_data")] + public SubscriptionTransferDataOptions TransferData { get; set; } + + /// + /// representing the end of the trial period the customer will get + /// before being charged for the first time. This will always overwrite any trials that + /// might apply via a subscribed plan. If set, will override the + /// default trial period of the plan the customer is being subscribed to. The special value + /// can be provided to end the customer’s trial + /// immediately. + /// + [JsonProperty("trial_end")] + [JsonConverter(typeof(AnyOfConverter))] + public AnyOf TrialEnd { get; set; } + + /// + /// Boolean. Decide whether to use the default trial on the plan when creating a subscription. + /// + [JsonProperty("trial_from_plan")] + public bool? TrialFromPlan { get; set; } } } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs index 27d70e4de1..1adcfeb8bd 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs @@ -1,8 +1,23 @@ namespace Stripe.Terminal { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class LocationCreateOptions : LocationSharedOptions + public class LocationCreateOptions : BaseOptions, IHasMetadata { + [JsonProperty("address")] + public AddressOptions Address { get; set; } + + [JsonProperty("display_name")] + public string DisplayName { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } } } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationSharedOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationSharedOptions.cs deleted file mode 100644 index 52401dde4a..0000000000 --- a/src/Stripe.net/Services/Terminal/Locations/LocationSharedOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Stripe.Terminal -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public class LocationSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("address")] - public AddressOptions Address { get; set; } - - [JsonProperty("display_name")] - public string DisplayName { get; set; } - - /// - /// Set of key-value pairs that you can attach to an object. This can be useful for storing - /// additional information about the object in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - } -} diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs index 7a366b815a..71ba55b55b 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs @@ -1,8 +1,23 @@ namespace Stripe.Terminal { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class LocationUpdateOptions : LocationSharedOptions + public class LocationUpdateOptions : BaseOptions, IHasMetadata { + [JsonProperty("address")] + public AddressOptions Address { get; set; } + + [JsonProperty("display_name")] + public string DisplayName { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } } } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs index 16270baae4..c2afd1e7c1 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs @@ -1,12 +1,25 @@ namespace Stripe.Terminal { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class ReaderCreateOptions : ReaderSharedOptions + public class ReaderCreateOptions : BaseOptions, IHasMetadata { + [JsonProperty("label")] + public string Label { get; set; } + [JsonProperty("location")] public string Location { get; set; } + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + [JsonProperty("registration_code")] public string RegistrationCode { get; set; } } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderSharedOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderSharedOptions.cs deleted file mode 100644 index d85a6393f9..0000000000 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderSharedOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Stripe.Terminal -{ - using System; - using System.Collections.Generic; - using Newtonsoft.Json; - using Stripe.Infrastructure; - - public class ReaderSharedOptions : BaseOptions, IHasMetadata - { - [JsonProperty("label")] - public string Label { get; set; } - - /// - /// Set of key-value pairs that you can attach to an object. This can be useful for storing - /// additional information about the object in a structured format. - /// - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - } -} diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs index 6210d78925..3a762d1527 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs @@ -1,8 +1,20 @@ namespace Stripe.Terminal { + using System; + using System.Collections.Generic; using Newtonsoft.Json; + using Stripe.Infrastructure; - public class ReaderUpdateOptions : ReaderSharedOptions + public class ReaderUpdateOptions : BaseOptions, IHasMetadata { + [JsonProperty("label")] + public string Label { get; set; } + + /// + /// Set of key-value pairs that you can attach to an object. This can be useful for storing + /// additional information about the object in a structured format. + /// + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } } } diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs index b1522727b7..398297edb3 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs @@ -5,7 +5,7 @@ namespace Stripe using Newtonsoft.Json; using Stripe.Infrastructure; - public class WebhookEndpointCreateOptions : WebhookEndpointSharedOptions + public class WebhookEndpointCreateOptions : BaseOptions { /// /// Events sent to this endpoint will be generated with this API version instead of your @@ -20,5 +20,17 @@ public class WebhookEndpointCreateOptions : WebhookEndpointSharedOptions /// [JsonProperty("connect")] public bool? Connect { get; set; } + + /// + /// The list of events to enable for this endpoint. + /// + [JsonProperty("enabled_events")] + public List EnabledEvents { get; set; } + + /// + /// The URL of the webhook endpoint. + /// + [JsonProperty("url")] + public string Url { get; set; } } } diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointSharedOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointSharedOptions.cs deleted file mode 100644 index 37a21186ac..0000000000 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointSharedOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Stripe -{ - using System.Collections.Generic; - using Newtonsoft.Json; - - public abstract class WebhookEndpointSharedOptions : BaseOptions - { - /// - /// The list of events to enable for this endpoint. - /// - [JsonProperty("enabled_events")] - public List EnabledEvents { get; set; } - - /// - /// The URL of the webhook endpoint. - /// - [JsonProperty("url")] - public string Url { get; set; } - } -} diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs index b7f3437c60..7af30dba5d 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointUpdateOptions.cs @@ -3,9 +3,21 @@ namespace Stripe using System.Collections.Generic; using Newtonsoft.Json; - public class WebhookEndpointUpdateOptions : WebhookEndpointSharedOptions + public class WebhookEndpointUpdateOptions : BaseOptions { [JsonProperty("disabled")] public bool? Disabled { get; set; } + + /// + /// The list of events to enable for this endpoint. + /// + [JsonProperty("enabled_events")] + public List EnabledEvents { get; set; } + + /// + /// The URL of the webhook endpoint. + /// + [JsonProperty("url")] + public string Url { get; set; } } } From 508fd1621bf53f1ce33c21ad1f2d408ce1602a62 Mon Sep 17 00:00:00 2001 From: CJ Avilla Date: Mon, 30 Dec 2019 12:41:44 -0800 Subject: [PATCH 2/3] Improve docstrings for flattened shared options --- .../Services/Account/AccountCreateOptions.cs | 10 +- .../Services/Account/AccountUpdateOptions.cs | 8 +- .../Services/Cards/CardCreateOptions.cs | 5 + .../Issuing/Cards/CardCreateOptions.cs | 2 +- .../Issuing/Disputes/DisputeCreateOptions.cs | 4 +- .../SubscriptionCreateOptions.cs | 95 +++++++++++++------ .../SubscriptionUpdateOptions.cs | 75 +++++++++++---- .../Locations/LocationCreateOptions.cs | 6 ++ .../Locations/LocationUpdateOptions.cs | 6 ++ .../Terminal/Readers/ReaderCreateOptions.cs | 11 +++ .../Terminal/Readers/ReaderUpdateOptions.cs | 3 + 11 files changed, 171 insertions(+), 54 deletions(-) diff --git a/src/Stripe.net/Services/Account/AccountCreateOptions.cs b/src/Stripe.net/Services/Account/AccountCreateOptions.cs index dfed5a3082..74d94f4319 100644 --- a/src/Stripe.net/Services/Account/AccountCreateOptions.cs +++ b/src/Stripe.net/Services/Account/AccountCreateOptions.cs @@ -6,11 +6,15 @@ namespace Stripe public class AccountCreateOptions : BaseOptions, IHasMetadata { + /// + /// An account token, + /// used to securely provide details to the account. + /// [JsonProperty("account_token")] public string AccountToken { get; set; } /// - /// Optional information related to the business. + /// Non-essential business information about the account. /// [JsonProperty("business_profile")] public AccountBusinessProfileOptions BusinessProfile { get; set; } @@ -23,7 +27,7 @@ public class AccountCreateOptions : BaseOptions, IHasMetadata /// /// Information about the company or business. This field is null - /// unless BusinessType is set to company. + /// unless is set to company. /// [JsonProperty("company")] public AccountCompanyOptions Company { get; set; } @@ -74,7 +78,7 @@ public class AccountCreateOptions : BaseOptions, IHasMetadata /// /// Information about the person represented by the account. This field - /// is null unless BusinessType is set to individual. + /// is null unless is set to individual. /// [JsonProperty("individual")] public PersonCreateOptions Individual { get; set; } diff --git a/src/Stripe.net/Services/Account/AccountUpdateOptions.cs b/src/Stripe.net/Services/Account/AccountUpdateOptions.cs index c433443de6..0411a55353 100644 --- a/src/Stripe.net/Services/Account/AccountUpdateOptions.cs +++ b/src/Stripe.net/Services/Account/AccountUpdateOptions.cs @@ -6,6 +6,10 @@ namespace Stripe public class AccountUpdateOptions : BaseOptions, IHasMetadata { + /// + /// An account token, + /// used to securely provide details to the account. + /// [JsonProperty("account_token")] public string AccountToken { get; set; } @@ -23,7 +27,7 @@ public class AccountUpdateOptions : BaseOptions, IHasMetadata /// /// Information about the company or business. This field is null - /// unless BusinessType is set to company. + /// unless is set to company. /// [JsonProperty("company")] public AccountCompanyOptions Company { get; set; } @@ -63,7 +67,7 @@ public class AccountUpdateOptions : BaseOptions, IHasMetadata /// /// Information about the person represented by the account. This field - /// is null unless BusinessType is set to individual. + /// is null unless is set to individual. /// [JsonProperty("individual")] public PersonUpdateOptions Individual { get; set; } diff --git a/src/Stripe.net/Services/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Cards/CardCreateOptions.cs index 2aa0d84be7..da0845fb88 100644 --- a/src/Stripe.net/Services/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardCreateOptions.cs @@ -9,6 +9,11 @@ public class CardCreateOptions : BaseOptions, IHasMetadata [JsonProperty("default_for_currency")] public bool? DefaultForCurrency { get; set; } + /// + /// Set of key-value pairs that you can attach to an object. This can + /// be useful for storing additional information about the object in a + /// structured format. + /// [JsonProperty("metadata")] public Dictionary Metadata { get; set; } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs index b588e01597..7bcb81da41 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs @@ -45,7 +45,7 @@ public class CardCreateOptions : BaseOptions, IHasMetadata public string ReplacementFor { get; set; } /// - /// If ReplacementFor is specified, this should indicate why + /// If is specified, this should indicate why /// that card is being replaced. /// [JsonProperty("replacement_reason")] diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs index 480890a629..0f2b14a46f 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeCreateOptions.cs @@ -20,7 +20,7 @@ public class DisputeCreateOptions : BaseOptions, IHasMetadata /// /// A hash containing all the evidence related to the dispute. This - /// should have a single key, equal to the provided Reason, mapping to + /// should have a single key, equal to the provided , mapping to /// an appropriate evidence object. /// [JsonProperty("evidence")] @@ -35,7 +35,7 @@ public class DisputeCreateOptions : BaseOptions, IHasMetadata public Dictionary Metadata { get; set; } /// - /// The reason for the dispute. One of other or fraudulent. + /// The reason for the dispute. One of other or fraudulent. /// [JsonProperty("reason")] public string Reason { get; set; } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs index ab4b11af6e..af900e0437 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs @@ -8,22 +8,29 @@ namespace Stripe public class SubscriptionCreateOptions : BaseOptions, IHasMetadata { /// - /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. + /// A non-negative decimal between 0 and 100, with at most two decimal + /// places. This represents the percentage of the subscription invoice + /// subtotal that will be transferred to the application owner’s Stripe + /// account. The request must be made with an OAuth key in order to set + /// an application fee percentage. For more information, see the + /// application fees documentation. /// [JsonProperty("application_fee_percent")] public decimal? ApplicationFeePercent { get; set; } /// - /// For new subscriptions, a past timestamp to backdate the subscription’s start date to. - /// If set, the first invoice will contain a proration for the timespan between the start - /// date and the current time. Can be combined with trials and the billing cycle anchor. + /// For new subscriptions, a past timestamp to backdate the + /// subscription’s start date to. If set, the first invoice will + /// contain a proration for the timespan between the start date and the + /// current time. Can be combined with trials and the billing cycle + /// anchor. /// [JsonProperty("backdate_start_date")] [JsonConverter(typeof(DateTimeConverter))] public DateTime? BackdateStartDate { get; set; } /// - /// A future date to anchor the subscription’s billing cycle. + /// A future date to anchor the subscription's billing cycle. /// This is used to determine the date of the first full invoice, and, for plans with /// month or year intervals, the day of the month for subsequent invoices. /// @@ -32,7 +39,9 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public DateTime? BillingCycleAnchor { get; set; } /// - /// 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. + /// 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")] public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } @@ -46,7 +55,8 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public DateTime? CancelAt { get; set; } /// - /// Boolean indicating whether this subscription should cancel at the end of the current period. + /// Boolean indicating whether this subscription should cancel at the + /// end of the current period. /// [JsonProperty("cancel_at_period_end")] public bool? CancelAtPeriodEnd { get; set; } @@ -63,7 +73,9 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public string CollectionMethod { get; set; } /// - /// The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + /// The code of the coupon to apply to this subscription. A coupon + /// applied to a subscription will only affect invoices created for + /// that particular subscription. /// [JsonProperty("coupon")] public string Coupon { get; set; } @@ -75,7 +87,9 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public string Customer { get; set; } /// - /// Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice. + /// Number of days a customer has to pay invoices generated by this + /// subscription. Only valid for subscriptions where + /// billing=send_invoice. /// [JsonProperty("days_until_due")] public long? DaysUntilDue { get; set; } @@ -86,11 +100,17 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata [JsonProperty("default_payment_method")] public string DefaultPaymentMethod { get; set; } + /// + /// ID of the default payment source for the subscription. It must + /// belong to the customer associated with the subscription and be in a + /// chargeable state. If not set, defaults to the customer’s default + /// source. + /// [JsonProperty("default_source")] public string DefaultSource { get; set; } /// - /// Ids of the tax rates to apply to this subscription. + /// IDs of the tax rates to apply to this subscription. /// [JsonProperty("default_tax_rates")] public List DefaultTaxRates { get; set; } @@ -102,32 +122,39 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public List Items { get; set; } /// - /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. + /// A set of key/value pairs that you can attach to a subscription + /// object. It can be useful for storing additional information about + /// the subscription in a structured format. /// [JsonProperty("metadata")] public Dictionary Metadata { get; set; } /// - /// Indicates if a customer is on session while an invoice payment is attempted. + /// Indicates if a customer is on session while an invoice payment is + /// attempted. /// [JsonProperty("off_session")] public bool? OffSession { get; set; } /// /// - /// Use allow_incomplete to create subscriptions with status=incomplete if its - /// first invoice cannot be paid. Creating subscriptions with this status allows you to - /// manage scenarios where additional user actions are needed to pay a subscription's - /// invoice. For example, SCA regulation may require 3DS authentication to complete payment. - /// See the SCA Migration Guide + /// Use allow_incomplete to create subscriptions with + /// status=incomplete if its first invoice cannot be paid. + /// Creating subscriptions with this status allows you to manage + /// scenarios where additional user actions are needed to pay a + /// subscription's invoice. For example, SCA regulation may require 3DS + /// authentication to complete payment. See the + /// SCA Migration Guide /// for Billing to learn more. This is the default behavior. /// /// - /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if - /// a subscription's first invoice cannot be paid. For example, if a payment method requires - /// 3DS authentication due to SCA regulation and further user action is needed, this - /// parameter does not create a subscription and returns an error instead. This was the - /// default behavior for API versions prior to 2019-03-14. See the changelog + /// Use error_if_incomplete if you want Stripe to return an HTTP + /// 402 status code if a subscription's first invoice cannot be paid. + /// For example, if a payment method requires 3DS authentication due to + /// SCA regulation and further user action is needed, this parameter + /// does not create a subscription and returns an error instead. This + /// was the default behavior for API versions prior to 2019-03-14. + /// See the changelog /// to learn more. /// /// @@ -135,8 +162,9 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public string PaymentBehavior { get; set; } /// - /// Specifies an interval for how often to bill for any pending invoice items. It is - /// analogous to creating an invoice for the given subscription at the specified interval. + /// Specifies an interval for how often to bill for any pending invoice + /// items. It is analogous to creating an invoice for the given + /// subscription at the specified interval. /// [JsonProperty("pending_invoice_item_interval")] public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } @@ -146,7 +174,11 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public string Plan { get; set; } /// - /// Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until the anchor date. If false, the anchor period will be free (similar to a trial). + /// Boolean (default true). Use with a + /// billing_cycle_anchor timestamp to determine whether the + /// customer will be invoiced a prorated amount until the anchor date. + /// If false, the anchor period will be free (similar to a + /// trial). /// [JsonProperty("prorate")] public bool? Prorate { get; set; } @@ -156,7 +188,12 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public long? Quantity { get; set; } /// - /// A non-negative decimal (with at most four decimal places) between 0 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. + /// A non-negative decimal (with at most four decimal places) between 0 + /// and 100. This represents the percentage of the subscription invoice + /// subtotal that will be calculated and added as tax to the final + /// amount each billing period. For example, a plan which charges + /// $10/month with a tax_percent of 20.0 will charge $12 per + /// invoice. /// [Obsolete("Use DefaultTaxRates")] [JsonProperty("tax_percent")] @@ -178,13 +215,15 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata public AnyOf TrialEnd { get; set; } /// - /// Boolean. Decide whether to use the default trial on the plan when creating a subscription. + /// Boolean. Decide whether to use the default trial on the plan when + /// creating a subscription. /// [JsonProperty("trial_from_plan")] public bool? TrialFromPlan { get; set; } /// - /// Integer representing the number of trial period days before the customer is charged for the first time. + /// Integer representing the number of trial period days before the + /// customer is charged for the first time. /// [JsonProperty("trial_period_days")] public long? TrialPeriodDays { get; set; } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs index 26d74995ee..59b4846521 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs @@ -8,7 +8,13 @@ namespace Stripe public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata { /// - /// A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. The request must be made with an OAuth key in order to set an application fee percentage. For more information, see the application fees documentation. + /// A non-negative decimal between 0 and 100, with at most two decimal + /// places. This represents the percentage of the subscription invoice + /// subtotal that will be transferred to the application owner’s Stripe + /// account. The request must be made with an OAuth key in order to set + /// an application fee percentage. For more information, see the + /// application fees documentation. /// [JsonProperty("application_fee_percent")] public decimal? ApplicationFeePercent { get; set; } @@ -23,7 +29,9 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public SubscriptionBillingCycleAnchor BillingCycleAnchor { get; set; } /// - /// 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. + /// 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")] public SubscriptionBillingThresholdsOptions BillingThresholds { get; set; } @@ -37,7 +45,8 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public DateTime? CancelAt { get; set; } /// - /// Boolean indicating whether this subscription should cancel at the end of the current period. + /// Boolean indicating whether this subscription should cancel at the + /// end of the current period. /// [JsonProperty("cancel_at_period_end")] public bool? CancelAtPeriodEnd { get; set; } @@ -54,13 +63,17 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public string CollectionMethod { get; set; } /// - /// The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. + /// The code of the coupon to apply to this subscription. A coupon + /// applied to a subscription will only affect invoices created for + /// that particular subscription. /// [JsonProperty("coupon")] public string Coupon { get; set; } /// - /// Number of days a customer has to pay invoices generated by this subscription. Only valid for subscriptions where billing=send_invoice. + /// Number of days a customer has to pay invoices generated by this + /// subscription. Only valid for subscriptions where + /// billing=send_invoice. /// [JsonProperty("days_until_due")] public long? DaysUntilDue { get; set; } @@ -71,6 +84,12 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata [JsonProperty("default_payment_method")] public string DefaultPaymentMethod { get; set; } + /// + /// ID of the default payment source for the subscription. It must + /// belong to the customer associated with the subscription and be in a + /// chargeable state. If not set, defaults to the customer’s default + /// source. + /// [JsonProperty("default_source")] public string DefaultSource { get; set; } @@ -87,7 +106,9 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public List Items { get; set; } /// - /// A set of key/value pairs that you can attach to a subscription object. It can be useful for storing additional information about the subscription in a structured format. + /// A set of key/value pairs that you can attach to a subscription + /// object. It can be useful for storing additional information about + /// the subscription in a structured format. /// [JsonProperty("metadata")] public Dictionary Metadata { get; set; } @@ -120,8 +141,9 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public string PaymentBehavior { get; set; } /// - /// Specifies an interval for how often to bill for any pending invoice items. It is - /// analogous to creating an invoice for the given subscription at the specified interval. + /// Specifies an interval for how often to bill for any pending invoice + /// items. It is analogous to creating an invoice for the given + /// subscription at the specified interval. /// [JsonProperty("pending_invoice_item_interval")] public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; } @@ -131,13 +153,23 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public string Plan { get; set; } /// - /// Boolean (default true). Use with a billing_cycle_anchor timestamp to determine whether the customer will be invoiced a prorated amount until the anchor date. If false, the anchor period will be free (similar to a trial). + /// Boolean (default true). Use with a + /// billing_cycle_anchor timestamp to determine whether the + /// customer will be invoiced a prorated amount until the anchor date. + /// If false, the anchor period will be free (similar to a + /// trial). /// [JsonProperty("prorate")] public bool? Prorate { get; set; } /// - /// If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. + /// If set, the proration will be calculated as though the subscription + /// was updated at the given time. This can be used to apply exactly + /// the same proration that was previewed with + /// upcoming invoice + /// endpoint. It can also be used to implement custom + /// proration logic, such as prorating by day instead of by second, by + /// providing the time that you wish to use for proration calculations. /// [JsonProperty("proration_date")] [JsonConverter(typeof(DateTimeConverter))] @@ -148,7 +180,12 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public long? Quantity { get; set; } /// - /// A non-negative decimal (with at most four decimal places) between 0 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period. For example, a plan which charges $10/month with a tax_percent of 20.0 will charge $12 per invoice. + /// A non-negative decimal (with at most four decimal places) between 0 + /// and 100. This represents the percentage of the subscription invoice + /// subtotal that will be calculated and added as tax to the final + /// amount each billing period. For example, a plan which charges + /// $10/month with a tax_percent of 20.0 will charge $12 per + /// invoice. /// [Obsolete("Use DefaultTaxRates")] [JsonProperty("tax_percent")] @@ -158,19 +195,21 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata public SubscriptionTransferDataOptions TransferData { get; set; } /// - /// representing the end of the trial period the customer will get - /// before being charged for the first time. This will always overwrite any trials that - /// might apply via a subscribed plan. If set, will override the - /// default trial period of the plan the customer is being subscribed to. The special value - /// can be provided to end the customer’s trial - /// immediately. + /// representing the end of the trial period the + /// customer will get before being charged for the first time. This + /// will always overwrite any trials that might apply via a subscribed + /// plan. If set, will override the default + /// trial period of the plan the customer is being subscribed to. The + /// special value can be + /// provided to end the customer’s trial immediately. /// [JsonProperty("trial_end")] [JsonConverter(typeof(AnyOfConverter))] public AnyOf TrialEnd { get; set; } /// - /// Boolean. Decide whether to use the default trial on the plan when creating a subscription. + /// Boolean. Decide whether to use the default trial on the plan when + /// creating a subscription. /// [JsonProperty("trial_from_plan")] public bool? TrialFromPlan { get; set; } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs index 1adcfeb8bd..bd37caf3ff 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationCreateOptions.cs @@ -7,9 +7,15 @@ namespace Stripe.Terminal public class LocationCreateOptions : BaseOptions, IHasMetadata { + /// + /// The full address of the location. + /// [JsonProperty("address")] public AddressOptions Address { get; set; } + /// + /// A name for the location. + /// [JsonProperty("display_name")] public string DisplayName { get; set; } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs index 71ba55b55b..b70ab295f5 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationUpdateOptions.cs @@ -7,9 +7,15 @@ namespace Stripe.Terminal public class LocationUpdateOptions : BaseOptions, IHasMetadata { + /// + /// The full address of the location. + /// [JsonProperty("address")] public AddressOptions Address { get; set; } + /// + /// A name for the location. + /// [JsonProperty("display_name")] public string DisplayName { get; set; } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs index c2afd1e7c1..a5781b89f4 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderCreateOptions.cs @@ -7,9 +7,17 @@ namespace Stripe.Terminal public class ReaderCreateOptions : BaseOptions, IHasMetadata { + /// + /// Custom label given to the reader for easier identification. If no + /// label is specified, the registration code will be used. + /// [JsonProperty("label")] public string Label { get; set; } + /// + /// The location to assign the reader to. If no location is specified, + /// the reader will be assigned to the account’s default location. + /// [JsonProperty("location")] public string Location { get; set; } @@ -20,6 +28,9 @@ public class ReaderCreateOptions : BaseOptions, IHasMetadata [JsonProperty("metadata")] public Dictionary Metadata { get; set; } + /// + /// A code generated by the reader used for registering to an account. + /// [JsonProperty("registration_code")] public string RegistrationCode { get; set; } } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs index 3a762d1527..9243f7c728 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderUpdateOptions.cs @@ -7,6 +7,9 @@ namespace Stripe.Terminal public class ReaderUpdateOptions : BaseOptions, IHasMetadata { + /// + /// The new label of the reader. + /// [JsonProperty("label")] public string Label { get; set; } From 7ed8afbaaa9bf40e98123275b1aa4d4842462cec Mon Sep 17 00:00:00 2001 From: CJ Avilla Date: Mon, 30 Dec 2019 13:30:35 -0800 Subject: [PATCH 3/3] Remove API version specifics from payment behavior comment --- .../Services/Subscriptions/SubscriptionCreateOptions.cs | 5 +---- .../Services/Subscriptions/SubscriptionUpdateOptions.cs | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs index af900e0437..bf9fdcdeae 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs @@ -152,10 +152,7 @@ public class SubscriptionCreateOptions : BaseOptions, IHasMetadata /// 402 status code if a subscription's first invoice cannot be paid. /// For example, if a payment method requires 3DS authentication due to /// SCA regulation and further user action is needed, this parameter - /// does not create a subscription and returns an error instead. This - /// was the default behavior for API versions prior to 2019-03-14. - /// See the changelog - /// to learn more. + /// does not create a subscription and returns an error instead. /// /// [JsonProperty("payment_behavior")] diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs index 59b4846521..e7644be74e 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionUpdateOptions.cs @@ -132,9 +132,7 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata /// Use error_if_incomplete if you want Stripe to return an HTTP 402 status code if /// a subscription's first invoice cannot be paid. For example, if a payment method requires /// 3DS authentication due to SCA regulation and further user action is needed, this - /// parameter does not create a subscription and returns an error instead. This was the - /// default behavior for API versions prior to 2019-03-14. See the changelog - /// to learn more. + /// parameter does not create a subscription and returns an error instead. /// /// [JsonProperty("payment_behavior")]