﻿namespace Stripe
{
    using System;
    using System.Collections.Generic;
    using Newtonsoft.Json;
    using Stripe.Infrastructure;

    public class StripeCoupon : StripeEntityWithId, ISupportMetadata
    {
        [JsonProperty("object")]
        public string Object { get; set; }

        [JsonProperty("amount_off")]
        public int? AmountOff { get; set; }

        [JsonProperty("created")]
        [JsonConverter(typeof(StripeDateTimeConverter))]
        public DateTime Created { get; set; }

        [JsonProperty("currency")]
        public string Currency { get; set; }

        [JsonProperty("duration")]
        public string Duration { get; set; }

        [JsonProperty("duration_in_months")]
        public int? DurationInMonths { get; set; }

        [JsonProperty("livemode")]
        public bool LiveMode { get; set; }

        [JsonProperty("max_redemptions")]
        public int? MaxRedemptions { get; set; }

        [JsonProperty("metadata")]
        public Dictionary<string, string> Metadata { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("percent_off")]
        public int? PercentOff { get; set; }

        [JsonProperty("redeem_by")]
        [JsonConverter(typeof(StripeDateTimeConverter))]
        public DateTime? RedeemBy { get; set; }

        [JsonProperty("times_redeemed")]
        public int TimesRedeemed { get; private set; }

        [JsonProperty("valid")]
        public bool Valid { get; set; }
    }
}

﻿namespace Stripe
{
    using System;
    using System.Collections.Generic;
    using Newtonsoft.Json;
    using Stripe.Infrastructure;

    public class StripeCoupon : StripeEntityWithId, ISupportMetadata
    {
        [JsonProperty("object")]
        public string Object { get; set; }

        [JsonProperty("amount_off")]
        public int? AmountOff { get; set; }

        [JsonProperty("created")]
        [JsonConverter(typeof(StripeDateTimeConverter))]
        public DateTime Created { get; set; }

        [JsonProperty("currency")]
        public string Currency { get; set; }

        [JsonProperty("duration")]
        public string Duration { get; set; }

        [JsonProperty("duration_in_months")]
        public int? DurationInMonths { get; set; }

        [JsonProperty("livemode")]
        public bool LiveMode { get; set; }

        [JsonProperty("max_redemptions")]
        public int? MaxRedemptions { get; set; }

        [JsonProperty("metadata")]
        public Dictionary<string, string> Metadata { get; set; }

        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("percent_off")]
        public decimal? PercentOff { get; set; }

        [JsonProperty("redeem_by")]
        [JsonConverter(typeof(StripeDateTimeConverter))]
        public DateTime? RedeemBy { get; set; }

        [JsonProperty("times_redeemed")]
        public int TimesRedeemed { get; private set; }

        [JsonProperty("valid")]
        public bool Valid { get; set; }
    }
}

Fix the Coupon resource as percent_off is now a decimal
Fix the Coupon resource as percent_off is now a decimal
