Skip to content

Commit

Permalink
Merge pull request #52 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
ankithads authored May 18, 2020
2 parents 99e40bc + 2d36f3d commit fc24aa8
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 31 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.7.0</PackageVersion>
<PackageVersion>4.0.0</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.7.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v4.0.0</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.7.0");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/4.0.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "3.7.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "4.0.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
2 changes: 1 addition & 1 deletion GoCardless/Resources/CreditorBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class CreditorBankAccount
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public CreditorBankAccountAccountType? AccountType { get; set; }

/// <summary>
/// Name of bank, taken from the bank details.
Expand Down
6 changes: 3 additions & 3 deletions GoCardless/Resources/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ public class Customer

/// <summary>
/// The customer's address region, county or department. For US
/// customers a 2 letter state code ([ISO
/// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
/// required.
/// customers a 2 letter
/// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
/// code is required (e.g. `CA` for California).
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion GoCardless/Resources/CustomerBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class CustomerBankAccount
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public CustomerBankAccountAccountType? AccountType { get; set; }

/// <summary>
/// Name of bank, taken from the bank details.
Expand Down
2 changes: 1 addition & 1 deletion GoCardless/Services/CreditorBankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public class CreditorBankAccountCreateRequest : IHasIdempotencyKey
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public CreditorBankAccountAccountType? AccountType { get; set; }

/// <summary>
/// Bank account type. Required for USD-denominated bank accounts. Must
Expand Down
2 changes: 1 addition & 1 deletion GoCardless/Services/CustomerBankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public class CustomerBankAccountCreateRequest : IHasIdempotencyKey
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public CustomerBankAccountAccountType? AccountType { get; set; }

/// <summary>
/// Bank account type. Required for USD-denominated bank accounts. Must
Expand Down
12 changes: 6 additions & 6 deletions GoCardless/Services/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ public class CustomerCreateRequest : IHasIdempotencyKey

/// <summary>
/// The customer's address region, county or department. For US
/// customers a 2 letter state code ([ISO
/// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
/// required.
/// customers a 2 letter
/// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
/// code is required (e.g. `CA` for California).
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
Expand Down Expand Up @@ -535,9 +535,9 @@ public class CustomerUpdateRequest

/// <summary>
/// The customer's address region, county or department. For US
/// customers a 2 letter state code ([ISO
/// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
/// required.
/// customers a 2 letter
/// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
/// code is required (e.g. `CA` for California).
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
Expand Down
37 changes: 37 additions & 0 deletions GoCardless/Services/InstalmentScheduleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,27 @@ public Task<InstalmentScheduleResponse> GetAsync(string identity, InstalmentSche
return _goCardlessClient.ExecuteAsync<InstalmentScheduleResponse>("GET", "/instalment_schedules/:identity", urlParams, request, null, null, customiseRequestMessage);
}

/// <summary>
/// Updates an instalment schedule. This accepts only the metadata
/// parameter.
/// </summary>
/// <param name="identity">Unique identifier, beginning with "IS".</param>
/// <param name="request">An optional `InstalmentScheduleUpdateRequest` representing the body for this update request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single instalment schedule resource</returns>
public Task<InstalmentScheduleResponse> UpdateAsync(string identity, InstalmentScheduleUpdateRequest request = null, RequestSettings customiseRequestMessage = null)
{
request = request ?? new InstalmentScheduleUpdateRequest();
if (identity == null) throw new ArgumentException(nameof(identity));

var urlParams = new List<KeyValuePair<string, object>>
{
new KeyValuePair<string, object>("identity", identity),
};

return _goCardlessClient.ExecuteAsync<InstalmentScheduleResponse>("PUT", "/instalment_schedules/:identity", urlParams, request, null, "instalment_schedules", customiseRequestMessage);
}

/// <summary>
/// Immediately cancels an instalment schedule; no further payments will
/// be collected for it.
Expand Down Expand Up @@ -770,6 +791,22 @@ public class InstalmentScheduleGetRequest
}


/// <summary>
/// Updates an instalment schedule. This accepts only the metadata
/// parameter.
/// </summary>
public class InstalmentScheduleUpdateRequest
{

/// <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>
/// Immediately cancels an instalment schedule; no further payments will be
/// collected for it.
Expand Down
6 changes: 3 additions & 3 deletions GoCardless/Services/MandateImportEntryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ public class MandateImportEntryCustomer

/// <summary>
/// The customer's address region, county or department. For US
/// customers a 2 letter state code ([ISO
/// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA)
/// is required.
/// customers a 2 letter
/// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US)
/// state code is required (e.g. `CA` for California).
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions GoCardless/Services/MandatePdfService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public class MandatePdfCreateRequest
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public MandatePdfAccountType? AccountType { get; set; }

/// <summary>
/// Bank account type. Required for USD-denominated bank accounts. Must
Expand Down Expand Up @@ -303,9 +303,9 @@ public class MandatePdfLinks

/// <summary>
/// The customer's address region, county or department. For US
/// customers a 2 letter state code ([ISO
/// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
/// required.
/// customers a 2 letter
/// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state
/// code is required (e.g. `CA` for California).
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }
Expand Down
12 changes: 6 additions & 6 deletions GoCardless/Services/RedirectFlowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ public class RedirectFlowPrefilledBankAccount
{

/// <summary>
/// Bank account type. Required for USD-denominated bank accounts.
/// Must not be provided for bank accounts in other currencies. See
/// [local details](#local-bank-details-united-states) for more
/// Bank account type for USD-denominated bank accounts. Must not be
/// provided for bank accounts in other currencies. See [local
/// details](#local-bank-details-united-states) for more
/// information.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
public RedirectFlowAccountType? AccountType { get; set; }
/// <summary>
/// Bank account type. Required for USD-denominated bank accounts. Must
/// not be provided for bank accounts in other currencies. See [local
/// Bank account type for USD-denominated bank accounts. Must not be
/// provided for bank accounts in other currencies. See [local
/// details](#local-bank-details-united-states) for more information.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For full details of the GoCardless API, see the [API docs](https://developer.goc

To install `GoCardless`, run the following command in the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console)

`Install-Package GoCardless -Version 3.7.0`
`Install-Package GoCardless -Version 4.0.0`


## Usage
Expand Down

0 comments on commit fc24aa8

Please sign in to comment.