From 99429d1488542da4a5996cd433ecd8413c810d8f Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Tue, 16 Jun 2020 15:24:13 -0700 Subject: [PATCH] Add support for `RefreshURL` and `ReturnURL` on `AccountLink` --- appveyor.yml | 2 +- .../Entities/AccountLinks/AccountLink.cs | 12 +++++++++ .../AccountLinks/AccountLinkCreateOptions.cs | 25 +++++++++++++++++++ .../AccountLinks/AccountLinkServiceTest.cs | 4 +-- src/StripeTests/StripeMockFixture.cs | 2 +- 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7b60a6d653..555b56efe4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ environment: COVERALLS_REPO_TOKEN: secure: T0PmP8uyzCseacBCDRBlti2y9Tz5DL6fknea0MKWvbPYrzADmLY2/5kOTfYIsPUk # If you bump this, don't forget to bump `MinimumMockVersion` in `StripeMockFixture.cs` as well. - STRIPE_MOCK_VERSION: 0.92.0 + STRIPE_MOCK_VERSION: 0.93.0 deploy: - provider: NuGet diff --git a/src/Stripe.net/Entities/AccountLinks/AccountLink.cs b/src/Stripe.net/Entities/AccountLinks/AccountLink.cs index 2c657a044f..c7bd27a429 100644 --- a/src/Stripe.net/Entities/AccountLinks/AccountLink.cs +++ b/src/Stripe.net/Entities/AccountLinks/AccountLink.cs @@ -6,17 +6,29 @@ namespace Stripe public class AccountLink : StripeEntity, IHasObject { + /// + /// String representing the object’s type. Objects of the same type share the same value. + /// [JsonProperty("object")] public string Object { get; set; } + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// [JsonProperty("created")] [JsonConverter(typeof(DateTimeConverter))] public DateTime Created { get; set; } + /// + /// The timestamp at which this account link will expire. + /// [JsonProperty("expires_at")] [JsonConverter(typeof(DateTimeConverter))] public DateTime ExpiresAt { get; set; } + /// + /// The URL for the account link. + /// [JsonProperty("url")] public string Url { get; set; } } diff --git a/src/Stripe.net/Services/AccountLinks/AccountLinkCreateOptions.cs b/src/Stripe.net/Services/AccountLinks/AccountLinkCreateOptions.cs index 14c6cd5de3..9361100e27 100644 --- a/src/Stripe.net/Services/AccountLinks/AccountLinkCreateOptions.cs +++ b/src/Stripe.net/Services/AccountLinks/AccountLinkCreateOptions.cs @@ -1,21 +1,46 @@ namespace Stripe { + using System; using Newtonsoft.Json; public class AccountLinkCreateOptions : BaseOptions { + /// + /// The identifier of the account to create an account link for. + /// [JsonProperty("account")] public string Account { get; set; } + /// + /// The identifier of the account to create an account link for. + /// [JsonProperty("collect")] public string Collect { get; set; } + [Obsolete("Use RefreshUrl instead.")] [JsonProperty("failure_url")] public string FailureUrl { get; set; } + /// + /// The URL that the user will be redirected to if the account link is no longer valid. + /// + [JsonProperty("refresh_url")] + public string RefreshUrl { get; set; } + + /// + /// The URL that the user will be redirected to upon leaving or completing the linked flow + /// successfully. + /// + [JsonProperty("return_url")] + public string ReturnUrl { get; set; } + + [Obsolete("Use ReturnUrl instead.")] [JsonProperty("success_url")] public string SuccessUrl { get; set; } + /// + /// The identifier of the account to create an account link for. + /// [JsonProperty("type")] public string Type { get; set; } } diff --git a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs index a2b87862a0..98a45a17d6 100644 --- a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs +++ b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs @@ -23,8 +23,8 @@ public AccountLinkServiceTest( { Account = "acct_123", Collect = "eventually_due", - FailureUrl = "https://stripe.com/failure", - SuccessUrl = "https://stripe.com/success", + RefreshUrl = "https://stripe.com/refresh", + ReturnUrl = "https://stripe.com/return", Type = "custom_account_verification", }; } diff --git a/src/StripeTests/StripeMockFixture.cs b/src/StripeTests/StripeMockFixture.cs index bb81e2140b..82bb176d20 100644 --- a/src/StripeTests/StripeMockFixture.cs +++ b/src/StripeTests/StripeMockFixture.cs @@ -13,7 +13,7 @@ public class StripeMockFixture : IDisposable /// If you bump this, don't forget to bump STRIPE_MOCK_VERSION in appveyor.yml /// as well. /// - private const string MockMinimumVersion = "0.92.0"; + private const string MockMinimumVersion = "0.93.0"; private readonly string port;