Skip to content

Commit

Permalink
Merge pull request #137 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless/gocardless-dotnet-template
  • Loading branch information
bekundayo authored Nov 6, 2024
2 parents ebf2f8c + 73ffb2e commit 1d8f2b9
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 373 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>7.0.0</PackageVersion>
<PackageVersion>7.1.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/v7.0.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v7.1.0</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;net46;net8.0</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 HttpRequestMessage BuildHttpRequestMessage<T>(string method, string path
runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
#endif

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

requestMessage.Headers.Add("User-Agent", userAgentInformation);
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "7.0.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "7.1.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
197 changes: 6 additions & 191 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public class BillingRequest
[JsonProperty("fallback_enabled")]
public bool? FallbackEnabled { get; set; }

/// <summary>
/// True if the billing request was completed with direct debit.
/// </summary>
[JsonProperty("fallback_occurred")]
public bool? FallbackOccurred { get; set; }

/// <summary>
/// Unique identifier, beginning with "BRQ".
/// </summary>
Expand Down Expand Up @@ -114,12 +120,6 @@ public class BillingRequest
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }

/// <summary>
/// Request for a subscription
/// </summary>
[JsonProperty("subscription_request")]
public BillingRequestSubscriptionRequest SubscriptionRequest { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -472,12 +472,6 @@ public class BillingRequestLinks
/// </summary>
[JsonProperty("payment_request_payment")]
public string PaymentRequestPayment { get; set; }

/// <summary>
/// (Optional) ID of the associated subscription request
/// </summary>
[JsonProperty("subscription_request")]
public string SubscriptionRequest { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -1361,183 +1355,4 @@ public enum BillingRequestStatus {
Cancelled,
}

/// <summary>
/// Represents a billing request subscription request resource.
///
/// Request for a subscription
/// </summary>
public class BillingRequestSubscriptionRequest
{
/// <summary>
/// Amount in the lowest denomination for the currency (e.g. pence in
/// GBP, cents in EUR).
/// </summary>
[JsonProperty("amount")]
public int? Amount { get; set; }

/// <summary>
/// The amount to be deducted from each payment as an app fee, to be
/// paid to the partner integration which created the subscription, 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>
/// The total number of payments that should be taken by this
/// subscription.
/// </summary>
[JsonProperty("count")]
public int? Count { get; set; }

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
/// "SEK" and "USD" are supported.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// As per RFC 2445. The day of the month to charge customers on.
/// `1`-`28` or `-1` to indicate the last day of the month.
/// </summary>
[JsonProperty("day_of_month")]
public int? DayOfMonth { get; set; }

/// <summary>
/// Number of `interval_units` between customer charge dates. Must be
/// greater than or equal to `1`. Must result in at least one charge
/// date per year. Defaults to `1`.
/// </summary>
[JsonProperty("interval")]
public int? Interval { get; set; }

/// <summary>
/// The unit of time between customer charge dates. One of `weekly`,
/// `monthly` or `yearly`.
/// </summary>
[JsonProperty("interval_unit")]
public BillingRequestSubscriptionRequestIntervalUnit? IntervalUnit { 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>
/// Name of the month on which to charge a customer. Must be lowercase.
/// Only applies
/// when the interval_unit is `yearly`.
///
/// </summary>
[JsonProperty("month")]
public BillingRequestSubscriptionRequestMonth? Month { get; set; }

/// <summary>
/// Optional name for the subscription. This will be set as the
/// description on each payment created. Must not exceed 255 characters.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }

/// <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.
/// <br />
/// <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")]
public string PaymentReference { get; set; }

/// <summary>
/// The date on which the first payment should be charged. Must be on or
/// after the [mandate](#core-endpoints-mandates)'s
/// `next_possible_charge_date`. When left blank and `month` or
/// `day_of_month` are provided, this will be set to the date of the
/// first payment. If created without `month` or `day_of_month` this
/// will be set as the mandate's `next_possible_charge_date`
/// </summary>
[JsonProperty("start_date")]
public string StartDate { get; set; }
}

/// <summary>
/// The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`.
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestSubscriptionRequestIntervalUnit {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`interval_unit` with a value of "weekly"</summary>
[EnumMember(Value = "weekly")]
Weekly,
/// <summary>`interval_unit` with a value of "monthly"</summary>
[EnumMember(Value = "monthly")]
Monthly,
/// <summary>`interval_unit` with a value of "yearly"</summary>
[EnumMember(Value = "yearly")]
Yearly,
}

/// <summary>
/// Name of the month on which to charge a customer. Must be lowercase. Only applies
/// when the interval_unit is `yearly`.
///
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestSubscriptionRequestMonth {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`month` with a value of "january"</summary>
[EnumMember(Value = "january")]
January,
/// <summary>`month` with a value of "february"</summary>
[EnumMember(Value = "february")]
February,
/// <summary>`month` with a value of "march"</summary>
[EnumMember(Value = "march")]
March,
/// <summary>`month` with a value of "april"</summary>
[EnumMember(Value = "april")]
April,
/// <summary>`month` with a value of "may"</summary>
[EnumMember(Value = "may")]
May,
/// <summary>`month` with a value of "june"</summary>
[EnumMember(Value = "june")]
June,
/// <summary>`month` with a value of "july"</summary>
[EnumMember(Value = "july")]
July,
/// <summary>`month` with a value of "august"</summary>
[EnumMember(Value = "august")]
August,
/// <summary>`month` with a value of "september"</summary>
[EnumMember(Value = "september")]
September,
/// <summary>`month` with a value of "october"</summary>
[EnumMember(Value = "october")]
October,
/// <summary>`month` with a value of "november"</summary>
[EnumMember(Value = "november")]
November,
/// <summary>`month` with a value of "december"</summary>
[EnumMember(Value = "december")]
December,
}

}
8 changes: 8 additions & 0 deletions GoCardless/Resources/BillingRequestFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ public class BillingRequestFlow
/// </summary>
[JsonProperty("show_success_redirect_button")]
public bool? ShowSuccessRedirectButton { get; set; }

/// <summary>
/// If true, the payer will not be redirected to the success screen
/// after completing the flow. A redirect_uri needs to be provided for
/// this parameter to be taken into account.
/// </summary>
[JsonProperty("skip_success_screen")]
public bool? SkipSuccessScreen { get; set; }
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions GoCardless/Services/BillingRequestFlowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ public class BillingRequestFlowPrefilledCustomer
/// </summary>
[JsonProperty("show_success_redirect_button")]
public bool? ShowSuccessRedirectButton { get; set; }

/// <summary>
/// If true, the payer will not be redirected to the success screen
/// after completing the flow. A redirect_uri needs to be provided for
/// this parameter to be taken into account.
/// </summary>
[JsonProperty("skip_success_screen")]
public bool? SkipSuccessScreen { get; set; }
}


Expand Down
Loading

0 comments on commit 1d8f2b9

Please sign in to comment.