Skip to content

Commit

Permalink
Merge pull request #46 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
paprikati authored Apr 20, 2020
2 parents 08ed286 + a874c42 commit afb8ee5
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 32 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.2</PackageVersion>
<PackageVersion>3.6.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.5.2</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v3.6.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.5.2");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.6.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "3.5.2");
requestMessage.Headers.Add("GoCardless-Client-Version", "3.6.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
5 changes: 2 additions & 3 deletions GoCardless/Resources/Payment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ public class Payment
public string Reference { get; set; }

/// <summary>
/// On failure, automatically retry the payment using [Optimise Smart
/// Payment Retries](#optimise-smart-payment-retries). Default is
/// `false`.
/// On failure, automatically retry the payment using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions GoCardless/Resources/Payout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ public class Payout
[JsonProperty("links")]
public PayoutLinks 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>
/// Whether a payout contains merchant revenue or partner fees.
/// </summary>
Expand Down
5 changes: 2 additions & 3 deletions GoCardless/Resources/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ public class Subscription
public string PaymentReference { get; set; }

/// <summary>
/// On failure, automatically retry payments using [Optimise Smart
/// Payment Retries](#optimise-smart-payment-retries). Default is
/// `false`.
/// On failure, automatically retry payments using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down
10 changes: 4 additions & 6 deletions GoCardless/Services/InstalmentScheduleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,8 @@ public class InstalmentScheduleLinks
public string PaymentReference { get; set; }

/// <summary>
/// On failure, automatically retry payments using [Optimise Smart
/// Payment
/// Retries](#optimise-smart-payment-retries). Default is `false`.
/// On failure, automatically retry payments using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down Expand Up @@ -617,9 +616,8 @@ public class InstalmentScheduleLinks
public string PaymentReference { get; set; }

/// <summary>
/// On failure, automatically retry payments using [Optimise Smart
/// Payment
/// Retries](#optimise-smart-payment-retries). Default is `false`.
/// On failure, automatically retry payments using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down
10 changes: 4 additions & 6 deletions GoCardless/Services/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,8 @@ public class PaymentLinks
public string Reference { get; set; }

/// <summary>
/// On failure, automatically retry the payment using [Optimise Smart
/// Payment Retries](#optimise-smart-payment-retries). Default is
/// `false`.
/// On failure, automatically retry the payment using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down Expand Up @@ -633,9 +632,8 @@ public class PaymentUpdateRequest
public IDictionary<String, String> Metadata { get; set; }

/// <summary>
/// On failure, automatically retry the payment using [Optimise Smart
/// Payment Retries](#optimise-smart-payment-retries). Default is
/// `false`.
/// On failure, automatically retry the payment using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down
42 changes: 42 additions & 0 deletions GoCardless/Services/PayoutService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,26 @@ public Task<PayoutResponse> GetAsync(string identity, PayoutGetRequest request =

return _goCardlessClient.ExecuteAsync<PayoutResponse>("GET", "/payouts/:identity", urlParams, request, null, null, customiseRequestMessage);
}

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

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

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


Expand Down Expand Up @@ -232,6 +252,13 @@ public enum PayoutCurrency
[JsonProperty("limit")]
public int? Limit { 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>
/// Whether a payout contains merchant revenue or partner fees.
/// </summary>
Expand Down Expand Up @@ -308,6 +335,21 @@ public class PayoutGetRequest
{
}


/// <summary>
/// Updates a payout object. This accepts only the metadata parameter.
/// </summary>
public class PayoutUpdateRequest
{

/// <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>
/// An API response for a request returning a single payout.
/// </summary>
Expand Down
15 changes: 6 additions & 9 deletions GoCardless/Services/SubscriptionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ public Task<SubscriptionResponse> PauseAsync(string identity, SubscriptionPauseR
/// Resume a subscription object.
/// Payments will start to be created again based on the subscriptions
/// recurrence rules.
/// The `charge_date` on the next payment will be the same as the
/// subscriptions `earliest_charge_date_after_resume`
///
/// This fails with:
///
Expand All @@ -301,9 +303,6 @@ public Task<SubscriptionResponse> PauseAsync(string identity, SubscriptionPauseR
///
/// - `subscription_not_paused` if the subscription is not paused.
///
/// - `subscription_already_scheduled_to_resume` if a subscription
/// already has a scheduled resume date.
///
/// </summary>
/// <param name="identity">Unique identifier, beginning with "SB".</param>
/// <param name="request">An optional `SubscriptionResumeRequest` representing the body for this resume request.</param>
Expand Down Expand Up @@ -546,9 +545,8 @@ public enum SubscriptionMonth
public string PaymentReference { get; set; }

/// <summary>
/// On failure, automatically retry payments using [Optimise Smart
/// Payment Retries](#optimise-smart-payment-retries). Default is
/// `false`.
/// On failure, automatically retry payments using [intelligent
/// retries](#success-intelligent-retries). Default is `false`.
/// </summary>
[JsonProperty("retry_if_possible")]
public bool? RetryIfPossible { get; set; }
Expand Down Expand Up @@ -843,6 +841,8 @@ public class SubscriptionPauseRequest
/// Resume a subscription object.
/// Payments will start to be created again based on the subscriptions
/// recurrence rules.
/// The `charge_date` on the next payment will be the same as the
/// subscriptions `earliest_charge_date_after_resume`
///
/// This fails with:
///
Expand All @@ -855,9 +855,6 @@ public class SubscriptionPauseRequest
///
/// - `subscription_not_paused` if the subscription is not paused.
///
/// - `subscription_already_scheduled_to_resume` if a subscription already
/// has a scheduled resume date.
///
/// </summary>
public class SubscriptionResumeRequest
{
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.5.2`
`Install-Package GoCardless -Version 3.6.0`


## Usage
Expand Down

0 comments on commit afb8ee5

Please sign in to comment.