public products_fixture() { ProductCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }", Type = "good", PackageDimensions = new StripePackageDimensionOptions { Height = 100, Length = 100, Weight = 100, Width = 100, }, Attributes = new string[] { "color", "size" }, }; ProductTwoCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }", Type = "good", }; ProductUpdateOptions = new StripeProductUpdateOptions { Name = $"test-product-{ Guid.NewGuid() }", }; var service = new StripeProductService(Cache.ApiKey); Product = service.Create(ProductCreateOptions); ProductTwo = service.Create(ProductTwoCreateOptions); ProductUpdated = service.Update(Product.Id, ProductUpdateOptions); ProductRetrieved = service.Get(Product.Id); ProductListOptions = new StripeProductListOptions { Url = Product.Url, Ids = new [] { Product.Id, ProductTwo.Id } }; ProductList = service.List(ProductListOptions); service.Delete(Product.Id); service.Delete(ProductTwo.Id); }
public skus_fixture() { var productService = new StripeProductService(Cache.ApiKey); Product = productService.Create(new StripeProductCreateOptions { Name = "T-shirt", Type = "good", Description = "stripe-dotnet product description", Attributes = new string[] { "size", "color" }, }); SkuCreateOptions = new StripeSkuCreateOptions { Id = $"test-sku-{ Guid.NewGuid() }", Attributes = new Dictionary <string, string> { { "size", "medium" }, { "color", "red" }, }, Currency = "usd", Inventory = new StripeInventoryOptions { Quantity = 100, Type = "finite", }, PackageDimensions = new StripePackageDimensionOptions { Height = 100, Length = 100, Weight = 100, Width = 100, }, Price = 1234, Product = Product.Id }; SkuTwoCreateOptions = new StripeSkuCreateOptions { Id = $"test-sku-{ Guid.NewGuid() }", Attributes = new Dictionary <string, string> { { "size", "large" }, { "color", "blue" }, }, Currency = "usd", Inventory = new StripeInventoryOptions { Type = "infinite", }, Price = 1345, Product = Product.Id }; SkuUpdateOptions = new StripeSkuUpdateOptions { Price = 9999, }; var service = new StripeSkuService(Cache.ApiKey); Sku = service.Create(SkuCreateOptions); SkuTwo = service.Create(SkuTwoCreateOptions); SkuUpdated = service.Update(Sku.Id, SkuUpdateOptions); SkuRetrieved = service.Get(Sku.Id); var SkuListOptions = new StripeSkuListOptions { Attributes = new Dictionary <string, string> { { "size", "large" }, }, Product = Product.Id }; SkuList = service.List(SkuListOptions); service.Delete(Sku.Id); service.Delete(SkuTwo.Id); productService.Delete(Product.Id); }