Exemple #1
0
        public SubscriptionItemServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new SubscriptionItemService(this.StripeClient);

            this.createOptions = new SubscriptionItemCreateOptions
            {
                Plan         = "plan_123",
                Quantity     = 1,
                Subscription = "sub_123",
            };

            this.deleteOptions = new SubscriptionItemDeleteOptions
            {
                ClearUsage = true,
            };

            this.updateOptions = new SubscriptionItemUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new SubscriptionItemListOptions
            {
                Limit        = 1,
                Subscription = "sub_123",
            };
        }
Exemple #2
0
        public SubscriptionItemServiceTest()
        {
            this.service = new SubscriptionItemService();

            this.createOptions = new SubscriptionItemCreateOptions
            {
                PlanId         = "plan_123",
                Quantity       = 1,
                SubscriptionId = "sub_123",
            };

            this.updateOptions = new SubscriptionItemUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new SubscriptionItemListOptions
            {
                Limit          = 1,
                SubscriptionId = "sub_123",
            };
        }
        public SubscriptionItemServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new SubscriptionItemService(this.StripeClient);

            this.createOptions = new SubscriptionItemCreateOptions
            {
                PriceData = new SubscriptionItemPriceDataOptions
                {
                    Currency  = "usd",
                    Product   = "prod_123",
                    Recurring = new SubscriptionItemPriceDataRecurringOptions
                    {
                        Interval      = "day",
                        IntervalCount = 15,
                    },
                    UnitAmountDecimal = 0.01234567890m, // Ensure decimals work
                },
                Quantity     = 1,
                Subscription = "sub_123",
            };

            this.deleteOptions = new SubscriptionItemDeleteOptions
            {
                ClearUsage = true,
            };

            this.updateOptions = new SubscriptionItemUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.listOptions = new SubscriptionItemListOptions
            {
                Limit        = 1,
                Subscription = "sub_123",
            };
        }