File tree 2 files changed +30
-1
lines changed
Pipedrive.net/Models/Request/Subscriptions
Pipedrive.net.Tests.Integration/Clients
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,35 @@ public async Task CanRetrievePayments()
49
49
50
50
public class TheCreateRecurringMethod
51
51
{
52
+ [ IntegrationTest ]
53
+ public async Task CanCreateWithoutPayment ( )
54
+ {
55
+ var pipedrive = Helper . GetAuthenticatedClient ( ) ;
56
+ var fixture = pipedrive . Subscription ;
57
+
58
+ var newRecurringSubscription = new NewRecurringSubscription ( )
59
+ {
60
+ DealId = 1 ,
61
+ Description = "a subscription" ,
62
+ Currency = "EUR" ,
63
+ CadenceType = "monthly" ,
64
+ CycleAmount = 200 ,
65
+ Infinite = true ,
66
+ StartDate = DateTime . UtcNow . AddDays ( 3 ) . Date ,
67
+ } ;
68
+
69
+ var subscription = await fixture . CreateRecurring ( newRecurringSubscription ) ;
70
+ Assert . NotNull ( subscription ) ;
71
+
72
+ var retrieved = await fixture . Get ( subscription . Id ) ;
73
+ Assert . NotNull ( retrieved ) ;
74
+ Assert . True ( newRecurringSubscription . Infinite ) ;
75
+ Assert . Equal ( DateTime . UtcNow . AddDays ( 3 ) . Date , subscription . StartDate ) ;
76
+
77
+ // Cleanup
78
+ await fixture . Delete ( subscription . Id ) ;
79
+ }
80
+
52
81
[ IntegrationTest ]
53
82
public async Task CanCreateInfinite ( )
54
83
{
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public class NewRecurringSubscription
32
32
[ JsonProperty ( "infinite" , NullValueHandling = NullValueHandling . Ignore ) ]
33
33
public bool ? Infinite { get ; set ; }
34
34
35
- [ JsonProperty ( "payments" ) ]
35
+ [ JsonProperty ( "payments" , NullValueHandling = NullValueHandling . Ignore ) ]
36
36
public List < NewPayment > Payments { get ; set ; }
37
37
38
38
[ JsonProperty ( "update_deal_value" ) ]
You can’t perform that action at this time.
0 commit comments