Skip to content

Commit

Permalink
Add the ability to pause and resume a subscription. Modify earliest c…
Browse files Browse the repository at this point in the history
…harge date for paused subscriptions
  • Loading branch information
Sandilya Narahari committed Apr 7, 2020
1 parent 2a3a1cf commit e52a0bd
Show file tree
Hide file tree
Showing 3 changed files with 274 additions and 50 deletions.
24 changes: 19 additions & 5 deletions GoCardless/Resources/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,23 @@ public class Subscription
public int? DayOfMonth { get; set; }

/// <summary>
/// Date on or after which no further payments should be created. If
/// this field is blank and `count` is not specified, the subscription
/// will continue forever. <p
/// class='deprecated-notice'><strong>Deprecated</strong>: This field
/// The earliest date that will be used as a `charge_date` on payments
/// created for this subscription if it is resumed. Only present for
/// `paused` subscriptions.
/// This value will change over time.
/// </summary>
[JsonProperty("earliest_charge_date_after_resume")]
public string EarliestChargeDateAfterResume { get; set; }

/// <summary>
/// Date on or after which no further payments should be created.
///
/// If this field is blank and `count` is not specified, the
/// subscription will continue forever.
///
/// <p class="deprecated-notice"><strong>Deprecated</strong>: This field
/// will be removed in a future API version. Use `count` to specify a
/// number of payments instead. </p>
/// number of payments instead.</p>
/// </summary>
[JsonProperty("end_date")]
public string EndDate { get; set; }
Expand Down Expand Up @@ -345,6 +356,9 @@ public enum SubscriptionStatus {
/// <summary>`status` with a value of "cancelled"</summary>
[EnumMember(Value = "cancelled")]
Cancelled,
/// <summary>`status` with a value of "paused"</summary>
[EnumMember(Value = "paused")]
Paused,
}

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions GoCardless/Services/RedirectFlowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ public class RedirectFlowLinks
public string Creditor { get; set; }
}

/// <summary>
/// Key-value store of custom data. Up to 3 keys are permitted, with key
/// names up to 50 characters and values up to 500 characters.
/// </summary>
[JsonProperty("metadata")]
public IDictionary<String, String> Metadata { get; set; }

/// <summary>
/// Information used to prefill the payment page so your customer
/// doesn't have to re-type details you already hold about them. It will
Expand Down
Loading

0 comments on commit e52a0bd

Please sign in to comment.