public coupons_fixture() { CouponCreateOptions = new StripeCouponCreateOptions() { // Add a space at the end to ensure the ID is properly URL encoded // when passed in the URL for other methods Id = "test-coupon-" + Guid.NewGuid().ToString() + " ", PercentOff = 25, Duration = "repeating", DurationInMonths = 3, }; CouponUpdateOptions = new StripeCouponUpdateOptions { Metadata = new Dictionary <string, string> { { "key_1", "value_1" } } }; var service = new StripeCouponService(Cache.ApiKey); Coupon = service.Create(CouponCreateOptions); CouponRetrieved = service.Get(Coupon.Id); CouponUpdated = service.Update(Coupon.Id, CouponUpdateOptions); CouponsList = service.List(); CouponDeleted = service.Delete(Coupon.Id); }
public StripeCouponServiceTest() { this.service = new StripeCouponService(); this.createOptions = new StripeCouponCreateOptions() { PercentOff = 25, Duration = "forever", }; this.updateOptions = new StripeCouponUpdateOptions() { Metadata = new Dictionary <string, string>() { { "key", "value" }, }, }; this.listOptions = new StripeCouponListOptions() { Limit = 1, }; }