From d34e7f46c14ec76767ebe033aad6e97a11d57f74 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Mon, 21 Sep 2020 16:20:24 -0700 Subject: [PATCH] Add support for `CheckoutSession` on `Discount` --- src/Stripe.net/Entities/Discounts/Discount.cs | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/src/Stripe.net/Entities/Discounts/Discount.cs b/src/Stripe.net/Entities/Discounts/Discount.cs index 1c96bac572..95c14d791a 100644 --- a/src/Stripe.net/Entities/Discounts/Discount.cs +++ b/src/Stripe.net/Entities/Discounts/Discount.cs @@ -6,17 +6,37 @@ namespace Stripe public class Discount : StripeEntity, IHasId, 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 Checkout session that this coupon is applied to, if it is applied to a particular + /// session in payment mode. Will not be present for subscription mode. + /// + [JsonProperty("checkout_session")] + public string CheckoutSession { get; set; } + + /// + /// Hash describing the coupon applied to create this discount. + /// [JsonProperty("coupon")] public Coupon Coupon { get; set; } #region Expandable Customer + /// + /// (ID of the Customer) + /// The ID of the customer associated with this discount. + /// [JsonIgnore] public string CustomerId { @@ -24,6 +44,10 @@ public string CustomerId set => this.InternalCustomer = SetExpandableFieldId(value, this.InternalCustomer); } + /// + /// (Expanded) + /// The ID of the customer associated with this discount. + /// [JsonIgnore] public Customer Customer { @@ -36,21 +60,42 @@ public Customer Customer internal ExpandableField InternalCustomer { get; set; } #endregion + /// + /// Whether this object is deleted or not. + /// [JsonProperty("deleted", NullValueHandling = NullValueHandling.Ignore)] public bool? Deleted { get; set; } + /// + /// If the coupon has a duration of repeating, the date that this discount + /// will end. If the coupon has a duration of once or forever, this attribute + /// will be null. + /// [JsonProperty("end")] [JsonConverter(typeof(UnixDateTimeConverter))] public DateTime? End { get; set; } + /// + /// The invoice that the discount’s coupon was applied to, if it was applied directly to a + /// particular invoice. + /// [JsonProperty("invoice")] public string Invoice { get; set; } + /// + /// The invoice item id (or invoice line item id for invoice line items of + /// type=‘subscription’) that the discount’s coupon was applied to, if it was applied + /// directly to a particular invoice item or invoice line item. + /// [JsonProperty("invoice_item")] public string InvoiceItem { get; set; } #region Expandable PromotionCode + /// + /// (ID of the PromotionCode) + /// The promotion code applied to create this discount. + /// [JsonIgnore] public string PromotionCodeId { @@ -58,6 +103,10 @@ public string PromotionCodeId set => this.InternalPromotionCode = SetExpandableFieldId(value, this.InternalPromotionCode); } + /// + /// (Expanded) + /// The promotion code applied to create this discount. + /// [JsonIgnore] public PromotionCode PromotionCode { @@ -70,12 +119,20 @@ public PromotionCode PromotionCode internal ExpandableField InternalPromotionCode { get; set; } #endregion + /// + /// Date that the coupon was applied. + /// [JsonProperty("start")] [JsonConverter(typeof(UnixDateTimeConverter))] public DateTime? Start { get; set; } #region Expandable Subscription + /// + /// (ID of the Subscription) + /// The subscription that this coupon is applied to, if it is applied to a particular + /// subscription. + /// [JsonIgnore] public string SubscriptionId { @@ -83,6 +140,11 @@ public string SubscriptionId set => this.InternalSubscription = SetExpandableFieldId(value, this.InternalSubscription); } + /// + /// (Expanded) + /// The subscription that this coupon is applied to, if it is applied to a particular + /// subscription. + /// [JsonIgnore] public Subscription Subscription {