Skip to content

Commit

Permalink
Merge pull request #2074 from stripe/remi-account-link
Browse files Browse the repository at this point in the history
Add support for `RefreshURL` and `ReturnURL` on `AccountLink`
  • Loading branch information
remi-stripe authored Jun 18, 2020
2 parents 609af19 + 99429d1 commit ff116a0
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/Stripe.net/Entities/AccountLinks/AccountLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@ namespace Stripe

public class AccountLink : StripeEntity<AccountLink>, IHasObject
{
/// <summary>
/// String representing the object’s type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
[JsonProperty("created")]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime Created { get; set; }

/// <summary>
/// The timestamp at which this account link will expire.
/// </summary>
[JsonProperty("expires_at")]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime ExpiresAt { get; set; }

/// <summary>
/// The URL for the account link.
/// </summary>
[JsonProperty("url")]
public string Url { get; set; }
}
Expand Down
25 changes: 25 additions & 0 deletions src/Stripe.net/Services/AccountLinks/AccountLinkCreateOptions.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
namespace Stripe
{
using System;
using Newtonsoft.Json;

public class AccountLinkCreateOptions : BaseOptions
{
/// <summary>
/// The identifier of the account to create an account link for.
/// </summary>
[JsonProperty("account")]
public string Account { get; set; }

/// <summary>
/// The identifier of the account to create an account link for.
/// </summary>
[JsonProperty("collect")]
public string Collect { get; set; }

[Obsolete("Use RefreshUrl instead.")]
[JsonProperty("failure_url")]
public string FailureUrl { get; set; }

/// <summary>
/// The URL that the user will be redirected to if the account link is no longer valid.
/// </summary>
[JsonProperty("refresh_url")]
public string RefreshUrl { get; set; }

/// <summary>
/// The URL that the user will be redirected to upon leaving or completing the linked flow
/// successfully.
/// </summary>
[JsonProperty("return_url")]
public string ReturnUrl { get; set; }

[Obsolete("Use ReturnUrl instead.")]
[JsonProperty("success_url")]
public string SuccessUrl { get; set; }

/// <summary>
/// The identifier of the account to create an account link for.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/StripeMockFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class StripeMockFixture : IDisposable
/// If you bump this, don't forget to bump <c>STRIPE_MOCK_VERSION</c> in <c>appveyor.yml</c>
/// as well.
/// </remarks>
private const string MockMinimumVersion = "0.92.0";
private const string MockMinimumVersion = "0.93.0";

private readonly string port;

Expand Down

0 comments on commit ff116a0

Please sign in to comment.