From 11f5cbb7ea4eec9dcf5bbdf21466f70c56bb3494 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Wed, 9 Jan 2019 16:56:35 -0800 Subject: [PATCH] Add support for disabling card validation on card/customer --- .../Services/Cards/CardCreateOptions.cs | 13 +++++---- .../Services/Cards/CardUpdateOptions.cs | 27 ++++++++++--------- .../Customers/CustomerCreateOptions.cs | 6 ++--- .../Customers/CustomerUpdateOptions.cs | 15 ++++++----- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/Stripe.net/Services/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Cards/CardCreateOptions.cs index 414870f5a4..8043e08df3 100644 --- a/src/Stripe.net/Services/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardCreateOptions.cs @@ -6,16 +6,19 @@ namespace Stripe public class CardCreateOptions : BaseOptions { + [JsonProperty("default_for_currency")] + public bool? DefaultForCurrency { get; set; } + + [JsonProperty("metadata")] + public Dictionary Metadata { get; set; } + [JsonProperty("source")] public string SourceToken { get; set; } [JsonProperty("source")] public CardCreateNestedOptions SourceCard { get; set; } - [JsonProperty("metadata")] - public Dictionary Metadata { get; set; } - - [JsonProperty("default_for_currency")] - public bool? DefaultForCurrency { get; set; } + [JsonProperty("validate")] + public bool? Validate { get; set; } } } diff --git a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs index 984c119e42..efc9142799 100644 --- a/src/Stripe.net/Services/Cards/CardUpdateOptions.cs +++ b/src/Stripe.net/Services/Cards/CardUpdateOptions.cs @@ -5,14 +5,11 @@ namespace Stripe public class CardUpdateOptions : BaseOptions { - [JsonProperty("exp_month")] - public long? ExpMonth { get; set; } - - [JsonProperty("exp_year")] - public long? ExpYear { get; set; } + [JsonProperty("address_city")] + public string AddressCity { get; set; } - [JsonProperty("name")] - public string Name { get; set; } + [JsonProperty("address_country")] + public string AddressCountry { get; set; } [JsonProperty("address_line1")] public string AddressLine1 { get; set; } @@ -20,19 +17,25 @@ public class CardUpdateOptions : BaseOptions [JsonProperty("address_line2")] public string AddressLine2 { get; set; } - [JsonProperty("address_city")] - public string AddressCity { get; set; } - [JsonProperty("address_state")] public string AddressState { get; set; } [JsonProperty("address_zip")] public string AddressZip { get; set; } - [JsonProperty("address_country")] - public string AddressCountry { get; set; } + [JsonProperty("exp_month")] + public long? ExpMonth { get; set; } + + [JsonProperty("exp_year")] + public long? ExpYear { get; set; } [JsonProperty("metadata")] public Dictionary Metadata { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("validate")] + public bool? Validate { get; set; } } } diff --git a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs index cbb23f49c1..3796173835 100644 --- a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs @@ -46,9 +46,6 @@ public class CustomerCreateOptions : BaseOptions [JsonProperty("tax_percent")] public decimal? TaxPercent { get; set; } - [JsonProperty("validate")] - public bool? Validate { get; set; } - #region Trial End public DateTime? TrialEnd { get; set; } @@ -76,5 +73,8 @@ internal string TrialEndInternal } #endregion + + [JsonProperty("validate")] + public bool? Validate { get; set; } } } diff --git a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs index 45c7d363b4..74bcda5209 100644 --- a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs @@ -9,12 +9,6 @@ public class CustomerUpdateOptions : BaseOptions [JsonProperty("account_balance")] public long? AccountBalance { get; set; } - [JsonProperty("source")] - public string SourceToken { get; set; } - - [JsonProperty("source")] - public CardCreateNestedOptions SourceCard { get; set; } - [JsonProperty("coupon")] public string Coupon { get; set; } @@ -36,7 +30,16 @@ public class CustomerUpdateOptions : BaseOptions [JsonProperty("shipping")] public ShippingOptions Shipping { get; set; } + [JsonProperty("source")] + public string SourceToken { get; set; } + + [JsonProperty("source")] + public CardCreateNestedOptions SourceCard { get; set; } + [JsonProperty("tax_info")] public CustomerTaxInfoOptions TaxInfo { get; set; } + + [JsonProperty("validate")] + public bool? Validate { get; set; } } }