Skip to content

Commit

Permalink
Merge pull request #44 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
sandilya-narahari authored Apr 7, 2020
2 parents fdefac9 + e52a0bd commit 83b0fe8
Show file tree
Hide file tree
Showing 19 changed files with 373 additions and 149 deletions.
4 changes: 2 additions & 2 deletions GoCardless/GoCardless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>GoCardless</PackageId>
<PackageVersion>3.5.0</PackageVersion>
<PackageVersion>3.5.1</PackageVersion>
<Authors>GoCardless Ltd</Authors>
<Description>Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -11,7 +11,7 @@
<Copyright>GoCardless Ltd</Copyright>
<PackageTags>gocardless payments rest api direct debit</PackageTags>
<PackageLicenseUrl>https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt</PackageLicenseUrl>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v3.5.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v3.5.1</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;net46</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
4 changes: 2 additions & 2 deletions GoCardless/GoCardlessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ private HttpRequestMessage BuildHttpRequestMessage<T>(string method, string path
var httpMethod = new HttpMethod(method);

var requestMessage = new HttpRequestMessage(httpMethod, new Uri(_baseUrl, path));
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.5.0");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.5.1");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "3.5.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "3.5.1");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
9 changes: 5 additions & 4 deletions GoCardless/Resources/BankDetailsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public class BankDetailsLookup
public string BankName { get; set; }

/// <summary>
/// ISO 9362 SWIFT BIC of the bank with which the account is held. <p
/// class="notice">Even if no BIC is returned for an account, GoCardless
/// may still be able to collect payments from it - you should refer to
/// the `available_debit_schemes` attribute to determine
/// ISO 9362 SWIFT BIC of the bank with which the account is held.
///
/// <p class="notice">Even if no BIC is returned for an account,
/// GoCardless may still be able to collect payments from it - you
/// should refer to the `available_debit_schemes` attribute to determine
/// reachability.</p>
/// </summary>
[JsonProperty("bic")]
Expand Down
3 changes: 1 addition & 2 deletions GoCardless/Resources/CreditorBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace GoCardless.Resources
/// `links[creditor_bank_account]` in the error response.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// not available for
/// partner integrations.</p>
/// not available for partner integrations.</p>
/// </summary>
public class CreditorBankAccount
{
Expand Down
8 changes: 3 additions & 5 deletions GoCardless/Resources/CustomerNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ namespace GoCardless.Resources
/// way, it is no longer visible using this API.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
///
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>
public class CustomerNotification
{
Expand Down
13 changes: 5 additions & 8 deletions GoCardless/Resources/MandateImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ namespace GoCardless.Resources
/// system](#mandate-import-entries-list-all-mandate-import-entries).
///
/// <p class="notice">Note that all Mandate Imports have an upper limit of
/// 30,000 entries, so
/// we recommend you split your import into several smaller imports if
/// you're planning to
/// exceed this threshold.</p>
/// 30,000 entries, so we recommend you split your import into several
/// smaller imports if you're planning to exceed this threshold.</p>
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>
public class MandateImport
{
Expand Down
11 changes: 5 additions & 6 deletions GoCardless/Resources/MandateImportEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ namespace GoCardless.Resources
/// been imported.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
///
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>
public class MandateImportEntry
{
Expand All @@ -62,7 +60,8 @@ public class MandateImportEntry
/// A unique identifier for this entry, which you can use (once the
/// import has been
/// processed by GoCardless) to identify the records that have been
/// created.
/// created. Limited
/// to 255 characters.
///
/// </summary>
[JsonProperty("record_identifier")]
Expand Down
12 changes: 4 additions & 8 deletions GoCardless/Resources/PayoutItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ public class PayoutItem
/// the lowest denomination for the currency (e.g. pence in GBP, cents
/// in EUR), to one decimal place.
/// <p class="notice">For accuracy, we store some of our fees to greater
/// precision than
/// we can actually pay out (for example, a GoCardless fee we record
/// might come to 0.5
/// pence, but it is not possible to send a payout via bank transfer
/// including a half
/// penny).<br><br>To calculate the final amount of the payout, we sum
/// all of the items
/// precision than we can actually pay out (for example, a GoCardless
/// fee we record might come to 0.5 pence, but it is not possible to
/// send a payout via bank transfer including a half penny).<br><br>To
/// calculate the final amount of the payout, we sum all of the items
/// and then round to the nearest currency unit.</p>
///
/// </summary>
[JsonProperty("amount")]
public string Amount { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions GoCardless/Resources/RedirectFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ public class RedirectFlow
[JsonProperty("links")]
public RedirectFlowLinks Links { 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>
/// The URL of the hosted payment pages for this redirect flow. This is
/// the URL you should redirect your customer to.
Expand Down
104 changes: 65 additions & 39 deletions GoCardless/Resources/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,46 @@ namespace GoCardless.Resources
/// The following rules apply when specifying recurrence:
///
/// - The first payment must be charged within 1 year.
/// - When neither `month` nor `day_of_month` are present, the subscription
/// will recur from the `start_date` based on the `interval_unit`.
/// - If `month` or `day_of_month` are present, the recurrence rules will be
/// applied from the `start_date`, and the following validations apply:
/// - If `day_of_month` and `start_date` are not provided `start_date` will
/// be the [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`
/// and the subscription will then recur based on the `interval` &
/// `interval_unit`
/// - If `month` or `day_of_month` are present the following validations
/// apply:
///
/// | interval_unit | month |
/// day_of_month |
/// | :-------------- | :--------------------------------------------- |
/// :-------------------------------------- |
/// | yearly | optional (required if `day_of_month` provided) |
/// optional (required if `month` provided) |
/// | monthly | invalid |
/// required |
/// | weekly | invalid |
/// invalid |
/// | __interval_unit__ | __month__ |
/// __day_of_month__ |
/// | :---------------- | :--------------------------------------------- |
/// :----------------------------------------- |
/// | yearly | optional (required if `day_of_month` provided) |
/// optional (invalid if `month` not provided) |
/// | monthly | invalid |
/// optional |
/// | weekly | invalid |
/// invalid |
///
/// Examples:
///
/// | interval_unit | interval | month | day_of_month | valid?
/// |
/// | :-------------- | :--------- | :------ | :------------- |
/// | __interval_unit__ | __interval__ | __month__ | __day_of_month__ |
/// valid? |
/// | :---------------- | :----------- | :-------- | :--------------- |
/// :------------------------------------------------- |
/// | yearly | 1 | january | -1 | valid
/// |
/// | yearly | 1 | march | | invalid -
/// missing `day_of_month` |
/// | monthly | 6 | | 12 | valid
/// |
/// | monthly | 6 | august | 12 | invalid -
/// `month` must be blank |
/// | weekly | 2 | | | valid
/// |
/// | weekly | 2 | october | 10 | invalid -
/// `month` and `day_of_month` must be blank |
/// | yearly | 1 | january | -1 |
/// valid |
/// | monthly | 6 | | |
/// valid |
/// | monthly | 6 | | 12 |
/// valid |
/// | weekly | 2 | | |
/// valid |
/// | yearly | 1 | march | |
/// invalid - missing `day_of_month` |
/// | yearly | 1 | | 2 |
/// invalid - missing `month` |
/// | monthly | 6 | august | 12 |
/// invalid - `month` must be blank |
/// | weekly | 2 | october | 10 |
/// invalid - `month` and `day_of_month` must be blank |
///
/// ### Rolling dates
///
Expand Down Expand Up @@ -113,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 @@ -175,11 +192,14 @@ public class Subscription

/// <summary>
/// An optional payment reference. This will be set as the reference on
/// each payment created and will appear on your customer's bank
/// statement. See the documentation for the [create payment
/// endpoint](#payments-create-a-payment) for more details. <p
/// class='restricted-notice'><strong>Restricted</strong>: You need your
/// own Service User Number to specify a payment reference for Bacs
/// each payment
/// created and will appear on your customer's bank statement. See the
/// documentation for
/// the [create payment endpoint](#payments-create-a-payment) for more
/// details.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: You need
/// your own Service User Number to specify a payment reference for Bacs
/// payments.</p>
/// </summary>
[JsonProperty("payment_reference")]
Expand Down Expand Up @@ -215,6 +235,8 @@ public class Subscription
/// this subscription have been created</li>
/// <li>`cancelled`: the subscription has been cancelled and will no
/// longer create payments</li>
/// <li>`paused`: the subscription has been paused and will not create
/// payments</li>
/// </ul>
/// </summary>
[JsonProperty("status")]
Expand Down Expand Up @@ -313,6 +335,7 @@ public enum SubscriptionMonth {
/// <li>`finished`: all of the payments scheduled for creation under this subscription have been
/// created</li>
/// <li>`cancelled`: the subscription has been cancelled and will no longer create payments</li>
/// <li>`paused`: the subscription has been paused and will not create payments</li>
/// </ul>
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
Expand All @@ -333,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
3 changes: 1 addition & 2 deletions GoCardless/Services/CreditorBankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ namespace GoCardless.Services
/// `links[creditor_bank_account]` in the error response.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// not available for
/// partner integrations.</p>
/// not available for partner integrations.</p>
/// </summary>

public class CreditorBankAccountService
Expand Down
8 changes: 3 additions & 5 deletions GoCardless/Services/CustomerNotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ namespace GoCardless.Services
/// way, it is no longer visible using this API.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
///
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>

public class CustomerNotificationService
Expand Down
6 changes: 2 additions & 4 deletions GoCardless/Services/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ public Task<CustomerResponse> UpdateAsync(string identity, CustomerUpdateRequest
/// ID.
///
/// <p class="restricted-notice"><strong>The action of removing a
/// customer cannot be
/// reversed, so please use with care.</strong></p>
/// customer cannot be reversed, so please use with care.</strong></p>
/// </summary>
/// <param name="identity">Unique identifier, beginning with "CU".</param>
/// <param name="request">An optional `CustomerRemoveRequest` representing the body for this remove request.</param>
Expand Down Expand Up @@ -562,8 +561,7 @@ public class CustomerUpdateRequest
/// ID.
///
/// <p class="restricted-notice"><strong>The action of removing a customer
/// cannot be
/// reversed, so please use with care.</strong></p>
/// cannot be reversed, so please use with care.</strong></p>
/// </summary>
public class CustomerRemoveRequest
{
Expand Down
11 changes: 5 additions & 6 deletions GoCardless/Services/MandateImportEntryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ namespace GoCardless.Services
/// been imported.
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
///
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>

public class MandateImportEntryService
Expand Down Expand Up @@ -405,7 +403,8 @@ public class MandateImportEntryLinks
/// A unique identifier for this entry, which you can use (once the
/// import has been
/// processed by GoCardless) to identify the records that have been
/// created.
/// created. Limited
/// to 255 characters.
///
/// </summary>
[JsonProperty("record_identifier")]
Expand Down
13 changes: 5 additions & 8 deletions GoCardless/Services/MandateImportService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,13 @@ namespace GoCardless.Services
/// system](#mandate-import-entries-list-all-mandate-import-entries).
///
/// <p class="notice">Note that all Mandate Imports have an upper limit of
/// 30,000 entries, so
/// we recommend you split your import into several smaller imports if
/// you're planning to
/// exceed this threshold.</p>
/// 30,000 entries, so we recommend you split your import into several
/// smaller imports if you're planning to exceed this threshold.</p>
///
/// <p class="restricted-notice"><strong>Restricted</strong>: This API is
/// currently
/// only available for approved integrators - please <a
/// href="mailto:[email protected]">get
/// in touch</a> if you would like to use this API.</p>
/// currently only available for approved integrators - please <a
/// href="mailto:[email protected]">get in touch</a> if you would like to
/// use this API.</p>
/// </summary>

public class MandateImportService
Expand Down
Loading

0 comments on commit 83b0fe8

Please sign in to comment.