Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RefreshURL and ReturnURL on AccountLink #2074

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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