@@ -20,14 +20,19 @@ public plans_fixture()
20
20
// Add a space at the end to ensure the ID is properly URL encoded
21
21
// when passed in the URL for other methods
22
22
Id = "test-plan-" + Guid . NewGuid ( ) . ToString ( ) + " " ,
23
- Name = "plan-name" ,
23
+ Nickname = "plan-name" ,
24
24
Amount = 5000 ,
25
25
Currency = "usd" ,
26
26
Interval = "month" ,
27
+ Product = new StripePlanProductCreateOptions
28
+ {
29
+ Name = "Test Product" ,
30
+ StatementDescriptor = "TEST THIS PRODUCT"
31
+ } ,
27
32
} ;
28
33
29
34
PlanUpdateOptions = new StripePlanUpdateOptions {
30
- Name = "plan-name-2"
35
+ Nickname = "plan-name-2"
31
36
} ;
32
37
33
38
var service = new StripePlanService ( Cache . ApiKey ) ;
@@ -40,4 +45,40 @@ public plans_fixture()
40
45
41
46
public void Dispose ( ) { }
42
47
}
48
+
49
+ public class add_plan_to_product_fixture : IDisposable
50
+ {
51
+ public StripeProductCreateOptions ProductCreateOptions { get ; set ; }
52
+ public StripePlanCreateOptions PlanCreateOptions { get ; set ; }
53
+
54
+ public StripeProduct Product { get ; set ; }
55
+ public StripePlan Plan { get ; set ; }
56
+ public StripePlan PlanRetrieved { get ; set ; }
57
+
58
+ public add_plan_to_product_fixture ( )
59
+ {
60
+ ProductCreateOptions = new StripeProductCreateOptions
61
+ {
62
+ Name = $ "test-product-{ Guid . NewGuid ( ) } ",
63
+ Type = "service"
64
+ } ;
65
+
66
+ var productService = new StripeProductService ( Cache . ApiKey ) ;
67
+ Product = productService . Create ( ProductCreateOptions ) ;
68
+
69
+ PlanCreateOptions = new StripePlanCreateOptions ( ) {
70
+ Nickname = "plan-name" ,
71
+ Amount = 5000 ,
72
+ Currency = "usd" ,
73
+ Interval = "month" ,
74
+ ProductId = Product . Id
75
+ } ;
76
+
77
+ var planService = new StripePlanService ( Cache . ApiKey ) ;
78
+ Plan = planService . Create ( PlanCreateOptions ) ;
79
+ PlanRetrieved = planService . Get ( Plan . Id ) ;
80
+ }
81
+
82
+ public void Dispose ( ) { }
83
+ }
43
84
}
0 commit comments