Skip to content

Commit

Permalink
Merge pull request #76 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
tallosan committed Oct 21, 2021
2 parents 34d49e6 + cc23cde commit 93a3b3f
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 39 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>5.0.0</PackageVersion>
<PackageVersion>5.0.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/v5.0.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.0.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 @@ -277,11 +277,11 @@ private static string GetBaseUrl(Environment env)
runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
#endif

var userAgentInformation = $" gocardless-dotnet/5.0.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.0.1 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";

requestMessage.Headers.Add("User-Agent", userAgentInformation);
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.0.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.0.1");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
7 changes: 0 additions & 7 deletions GoCardless/Resources/BankAuthorisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ public class BankAuthorisationLinks
/// </summary>
[JsonProperty("institution")]
public string Institution { get; set; }

/// <summary>
/// ID of the payment request against which this authorisation was
/// created.
/// </summary>
[JsonProperty("payment_request")]
public string PaymentRequest { get; set; }
}

}
8 changes: 4 additions & 4 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ public class BillingRequestMandateRequest
public BillingRequestMandateRequestLinks Links { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down Expand Up @@ -474,8 +474,8 @@ public class BillingRequestPaymentRequest
public BillingRequestPaymentRequestLinks Links { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions GoCardless/Resources/BillingRequestTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public class BillingRequestTemplate
public IDictionary<string, string> MandateRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("mandate_request_scheme")]
public string MandateRequestScheme { get; set; }
Expand Down Expand Up @@ -123,8 +123,8 @@ public class BillingRequestTemplate
public IDictionary<string, string> PaymentRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions GoCardless/Resources/CustomerNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class CustomerNotification
/// <li>`payment_created`</li>
/// <li>`payment_cancelled`</li>
/// <li>`mandate_created`</li>
/// <li>`mandate_blocked`</li>
/// <li>`subscription_created`</li>
/// <li>`subscription_cancelled`</li>
/// <li>`instalment_schedule_created`</li>
Expand Down Expand Up @@ -145,6 +146,7 @@ public class CustomerNotificationLinks
/// <li>`payment_created`</li>
/// <li>`payment_cancelled`</li>
/// <li>`mandate_created`</li>
/// <li>`mandate_blocked`</li>
/// <li>`subscription_created`</li>
/// <li>`subscription_cancelled`</li>
/// <li>`instalment_schedule_created`</li>
Expand All @@ -166,6 +168,9 @@ public enum CustomerNotificationType {
/// <summary>`type` with a value of "mandate_created"</summary>
[EnumMember(Value = "mandate_created")]
MandateCreated,
/// <summary>`type` with a value of "mandate_blocked"</summary>
[EnumMember(Value = "mandate_blocked")]
MandateBlocked,
/// <summary>`type` with a value of "subscription_created"</summary>
[EnumMember(Value = "subscription_created")]
SubscriptionCreated,
Expand Down
44 changes: 44 additions & 0 deletions GoCardless/Resources/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public class EventCustomerNotification
/// <li>`payment_created`</li>
/// <li>`payment_cancelled`</li>
/// <li>`mandate_created`</li>
/// <li>`mandate_blocked`</li>
/// <li>`subscription_created`</li>
/// <li>`subscription_cancelled`</li>
/// <li>`instalment_schedule_created`</li>
Expand All @@ -139,6 +140,7 @@ public class EventCustomerNotification
/// <li>`payment_created`</li>
/// <li>`payment_cancelled`</li>
/// <li>`mandate_created`</li>
/// <li>`mandate_blocked`</li>
/// <li>`subscription_created`</li>
/// <li>`subscription_cancelled`</li>
/// <li>`instalment_schedule_created`</li>
Expand All @@ -160,6 +162,9 @@ public enum EventCustomerNotificationType {
/// <summary>`type` with a value of "mandate_created"</summary>
[EnumMember(Value = "mandate_created")]
MandateCreated,
/// <summary>`type` with a value of "mandate_blocked"</summary>
[EnumMember(Value = "mandate_blocked")]
MandateBlocked,
/// <summary>`type` with a value of "subscription_created"</summary>
[EnumMember(Value = "subscription_created")]
SubscriptionCreated,
Expand Down Expand Up @@ -227,6 +232,7 @@ public class EventDetails
/// automatically</li>
/// <li>`api`: this event was triggered by an API endpoint</li>
/// <li>`customer`: this event was triggered by a Customer</li>
/// <li>`payer`: this event was triggered by a Payer</li>
/// </ul>
/// </summary>
[JsonProperty("origin")]
Expand Down Expand Up @@ -272,6 +278,7 @@ public class EventDetails
/// <li>`gocardless`: this event was performed by GoCardless automatically</li>
/// <li>`api`: this event was triggered by an API endpoint</li>
/// <li>`customer`: this event was triggered by a Customer</li>
/// <li>`payer`: this event was triggered by a Payer</li>
/// </ul>
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
Expand All @@ -292,6 +299,9 @@ public enum EventDetailsOrigin {
/// <summary>`origin` with a value of "customer"</summary>
[EnumMember(Value = "customer")]
Customer,
/// <summary>`origin` with a value of "payer"</summary>
[EnumMember(Value = "payer")]
Payer,
}

/// <summary>
Expand Down Expand Up @@ -337,6 +347,25 @@ public enum EventDetailsScheme {
/// </summary>
public class EventLinks
{
/// <summary>
/// ID of a [bank authorisation](#billing-requests-bank-authorisations).
/// </summary>
[JsonProperty("bank_authorisation")]
public string BankAuthorisation { get; set; }

/// <summary>
/// ID of a [billing request](#billing-requests-billing-requests).
/// </summary>
[JsonProperty("billing_request")]
public string BillingRequest { get; set; }

/// <summary>
/// ID of a [billing request
/// flow](#billing-requests-billing-request-flows).
/// </summary>
[JsonProperty("billing_request_flow")]
public string BillingRequestFlow { get; set; }

/// <summary>
/// If `resource_type` is `creditor`, this is the ID of the
/// [creditor](#core-endpoints-creditors) which has been updated.
Expand Down Expand Up @@ -372,6 +401,13 @@ public class EventLinks
[JsonProperty("mandate")]
public string Mandate { get; set; }

/// <summary>
/// If `resource_type` is `billing_requests`, this is the ID of the
/// [mandate](#core-endpoints-mandates) which has been created.
/// </summary>
[JsonProperty("mandate_request_mandate")]
public string MandateRequestMandate { get; set; }

/// <summary>
/// This is only included for mandate transfer events, when it is the ID
/// of the [customer bank
Expand Down Expand Up @@ -420,6 +456,14 @@ public class EventLinks
[JsonProperty("payment")]
public string Payment { get; set; }

/// <summary>
/// If `resource_type` is `billing_requests`, this is the ID of the
/// [payment](#core-endpoints-payments) which has been created for
/// Instant Bank Payment.
/// </summary>
[JsonProperty("payment_request_payment")]
public string PaymentRequestPayment { get; set; }

/// <summary>
/// If `resource_type` is `payouts`, this is the ID of the
/// [payout](#core-endpoints-payouts) which has been updated.
Expand Down
8 changes: 8 additions & 0 deletions GoCardless/Resources/Institution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ namespace GoCardless.Resources
/// </summary>
public class Institution
{
/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code. The country code of the institution.
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }

/// <summary>
/// A URL pointing to the icon for this institution
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions GoCardless/Resources/RedirectFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public class RedirectFlow
[JsonProperty("links")]
public RedirectFlowLinks Links { get; set; }

/// <summary>
/// Mandate reference generated by GoCardless or submitted by an
/// integrator.
/// </summary>
[JsonProperty("mandate_reference")]
public string MandateReference { 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.
Expand Down
7 changes: 0 additions & 7 deletions GoCardless/Services/BankAuthorisationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,6 @@ public class BankAuthorisationLinks
/// </summary>
[JsonProperty("institution")]
public string Institution { get; set; }

/// <summary>
/// ID of the payment request against which this authorisation was
/// created.
/// </summary>
[JsonProperty("payment_request")]
public string PaymentRequest { get; set; }
}

/// <summary>
Expand Down
13 changes: 11 additions & 2 deletions GoCardless/Services/BillingRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ public class BillingRequestMandateRequest
public string Currency { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs",
/// "becs", "becs_nz", "betalingsservice", "pad" and "sepa_core" are
/// A Direct Debit scheme. Currently "ach", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are
/// supported.
/// </summary>
[JsonProperty("scheme")]
Expand Down Expand Up @@ -486,6 +486,15 @@ public class BillingRequestPaymentRequest
[JsonProperty("amount")]
public int? Amount { get; set; }

/// <summary>
/// The amount to be deducted from the payment as an app fee, to be
/// paid to the partner integration which created the billing
/// request, in the lowest denomination for the currency (e.g. pence
/// in GBP, cents in EUR).
/// </summary>
[JsonProperty("app_fee")]
public int? AppFee { get; set; }

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. Currently only "GBP" is supported as we only have
Expand Down
16 changes: 8 additions & 8 deletions GoCardless/Services/BillingRequestTemplateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ public class BillingRequestTemplateLinks
public IDictionary<String, String> MandateRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("mandate_request_scheme")]
public string MandateRequestScheme { get; set; }
Expand Down Expand Up @@ -326,8 +326,8 @@ public enum BillingRequestTemplateMandateRequestVerify
public IDictionary<String, String> PaymentRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down Expand Up @@ -373,8 +373,8 @@ public class BillingRequestTemplateUpdateRequest
public IDictionary<String, String> MandateRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("mandate_request_scheme")]
public string MandateRequestScheme { get; set; }
Expand Down Expand Up @@ -476,8 +476,8 @@ public enum BillingRequestTemplateMandateRequestVerify
public IDictionary<String, String> PaymentRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "pad" and "sepa_core" are supported.
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions GoCardless/Services/EventService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public class CreatedAtParam
/// <li>`subscription`</li>
/// <li>`instalment_schedule`</li>
/// <li>`creditor`</li>
/// <li>`billing_request`<\li>
/// <li>`billing_request`</li>
/// </ul>
/// </summary>
[JsonProperty("include")]
Expand All @@ -211,7 +211,7 @@ public class CreatedAtParam
/// <li>`subscription`</li>
/// <li>`instalment_schedule`</li>
/// <li>`creditor`</li>
/// <li>`billing_request`<\li>
/// <li>`billing_request`</li>
/// </ul>
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
Expand Down
8 changes: 8 additions & 0 deletions GoCardless/Services/InstitutionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public Task<InstitutionListResponse> ListAsync(InstitutionListRequest request =
/// </summary>
public class InstitutionListRequest
{

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code. The country code of the institution.
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
}

/// <summary>
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 5.0.0`
`Install-Package GoCardless -Version 5.0.1`


## Usage
Expand Down

0 comments on commit 93a3b3f

Please sign in to comment.