From c53a790b64952eae7aa0d88e1b1cd825b2b1430f Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Thu, 17 Oct 2019 17:36:49 -0700 Subject: [PATCH] Add various API changes --- .../Charges/ChargePaymentMethodDetails.cs | 3 + .../ChargePaymentMethodDetailsAuBecsDebit.cs | 33 +++++++++++ .../Issuing/Cardholders/Cardholder.cs | 56 ++++++++++++++++++- .../Cardholders/CardholderRequirements.cs | 22 ++++++++ .../SessionSubscriptionDataOptions.cs | 8 +++ .../SubscriptionItemSharedOptions.cs | 8 +++ .../SubscriptionItemUpdateOptions.cs | 7 --- 7 files changed, 129 insertions(+), 8 deletions(-) create mode 100644 src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsAuBecsDebit.cs create mode 100644 src/Stripe.net/Entities/Issuing/Cardholders/CardholderRequirements.cs diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails.cs index 89aa9c0b4f..63a5a4e511 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails.cs @@ -17,6 +17,9 @@ public class ChargePaymentMethodDetails : StripeEntity + { + /// + /// Bank-State-Branch number of the bank account. + /// + [JsonProperty("bsb_number")] + public string BsbNumber { get; set; } + + /// + /// Uniquely identifies this particular bank account. You can use this attribute to check + /// whether two bank accounts are the same. + /// + [JsonProperty("fingerprint")] + public string Fingerprint { get; set; } + + /// + /// Last four digits of the bank account number. + /// + [JsonProperty("last4")] + public string Last4 { get; set; } + + /// + /// ID of the mandate used to make this payment. + /// + [JsonProperty("mandate")] + public string Mandate { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs b/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs index a1b9da5036..60f0043f24 100644 --- a/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs +++ b/src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs @@ -7,37 +7,91 @@ namespace Stripe.Issuing public class Cardholder : StripeEntity, IHasId, IHasMetadata, IHasObject { + /// + /// Unique identifier for the object. + /// [JsonProperty("id")] public string Id { get; set; } + /// + /// String representing the object’s type. Objects of the same type share the same value. + /// [JsonProperty("object")] public string Object { get; set; } + /// + /// The cardholder’s billing address. + /// [JsonProperty("billing")] public Billing Billing { get; set; } + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// [JsonProperty("created")] [JsonConverter(typeof(DateTimeConverter))] public DateTime Created { get; set; } + /// + /// The cardholder’s email address. + /// [JsonProperty("email")] public string Email { get; set; } + /// + /// Whether or not this cardholder is the default cardholder. + /// + [JsonProperty("is_default")] + public bool IsDefault { get; set; } + + /// + /// Has the value true if the object exists in live mode or the value + /// false if the object exists in test mode. + /// [JsonProperty("livemode")] public bool Livemode { get; set; } + /// + /// A set of key/value pairs that you can attach to a subscription object. + /// [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; } + [Obsolete("Use PhoneNumber instead")] + [JsonIgnore] + public string PhonNumber + { + get => this.PhoneNumber; + set => this.PhoneNumber = value; + } + + /// + /// The cardholder’s phone number. + /// [JsonProperty("phone_number")] - public string PhonNumber { get; set; } + public string PhoneNumber { get; set; } + + /// + /// Information about verification requirements for the cardholder, including what information needs to be collected. + /// + [JsonProperty("requirements")] + public CardholderRequirements Requirements { get; set; } + /// + /// One of active, inactive, or blocked. + /// [JsonProperty("status")] public string Status { get; set; } + /// + /// One of individual or business_entity. + /// [JsonProperty("type")] public string Type { get; set; } } diff --git a/src/Stripe.net/Entities/Issuing/Cardholders/CardholderRequirements.cs b/src/Stripe.net/Entities/Issuing/Cardholders/CardholderRequirements.cs new file mode 100644 index 0000000000..e18e6bd852 --- /dev/null +++ b/src/Stripe.net/Entities/Issuing/Cardholders/CardholderRequirements.cs @@ -0,0 +1,22 @@ +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; + + public class CardholderRequirements : StripeEntity + { + /// + /// If the cardholder is disabled, this string describes why. Can be one of listed, + /// rejected.listed, or under_review. + /// + [JsonProperty("disabled_reason")] + public string DisabledReason { get; set; } + + /// + /// If not empty, this field contains the list of fields that need to be collected in order + /// to verify and re-enable the cardholder. + /// + [JsonProperty("past_due")] + public List PastDue { get; set; } + } +} diff --git a/src/Stripe.net/Services/Checkout/SessionSubscriptionDataOptions.cs b/src/Stripe.net/Services/Checkout/SessionSubscriptionDataOptions.cs index 33b58f461f..bed4899ce1 100644 --- a/src/Stripe.net/Services/Checkout/SessionSubscriptionDataOptions.cs +++ b/src/Stripe.net/Services/Checkout/SessionSubscriptionDataOptions.cs @@ -38,6 +38,14 @@ public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata [JsonConverter(typeof(DateTimeConverter))] public DateTime? TrialEnd { get; set; } + /// + /// Indicates if a plan’s should be applied to the + /// subscription. Setting TrialEnd on DubscriptionData is preferred. Defaults + /// to false. + /// + [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/SubscriptionItems/SubscriptionItemSharedOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs index 23c657eaaf..c9aec22aee 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemSharedOptions.cs @@ -14,6 +14,14 @@ public abstract class SubscriptionItemSharedOptions : BaseOptions [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. /// diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs index a9d3254a97..ae9b160fc0 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemUpdateOptions.cs @@ -17,12 +17,5 @@ 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 update cannot be paid. Otherwise use allow_incomplete. - /// - [JsonProperty("payment_behavior")] - public string PaymentBehavior { get; set; } } }