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 Errors in Requirements on Account, Capability and Person #1940

Merged
merged 1 commit into from
Mar 4, 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
7 changes: 7 additions & 0 deletions src/Stripe.net/Entities/Accounts/AccountRequirements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public class AccountRequirements : StripeEntity<AccountRequirements>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }

/// <summary>
/// The fields that need to be collected again because validation or verification failed
/// for some reason.
/// </summary>
[JsonProperty("errors")]
public List<AccountRequirementsError> Errors { get; set; }

/// <summary>
/// The fields that need to be collected assuming all volume thresholds are reached. As
/// fields are needed, they are moved to <c>currently_due</c> and the
Expand Down
30 changes: 30 additions & 0 deletions src/Stripe.net/Entities/Accounts/AccountRequirementsError.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace Stripe
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class AccountRequirementsError : StripeEntity<AccountRequirementsError>
{
/// <summary>
/// The code for the type of error.
/// </summary>
[JsonProperty("code")]
public string Code { get; set; }

/// <summary>
/// An informative message that indicates the error type and provides additional details
/// about the error.
/// </summary>
[JsonProperty("reason")]
public string Reason { get; set; }

/// <summary>
/// The specific user onboarding requirement field (in the requirements hash) that needs to
/// be resolved.
/// </summary>
[JsonProperty("requirement")]
public string Requirement { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public class CapabilityRequirements : StripeEntity<CapabilityRequirements>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }

/// <summary>
/// The fields that need to be collected again because validation or verification failed
/// for some reason.
/// </summary>
[JsonProperty("errors")]
public List<AccountRequirementsError> Errors { get; set; }

/// <summary>
/// The fields that need to be collected assuming all volume thresholds are reached. As
/// they become required, these fields appear in <c>currently_due</c> as well, and the
Expand Down
7 changes: 7 additions & 0 deletions src/Stripe.net/Entities/Persons/PersonRequirements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public class PersonRequirements : StripeEntity<PersonRequirements>
[JsonProperty("currently_due")]
public List<string> CurrentlyDue { get; set; }

/// <summary>
/// The fields that need to be collected again because validation or verification failed
/// for some reason.
/// </summary>
[JsonProperty("errors")]
public List<AccountRequirementsError> Errors { get; set; }

/// <summary>
/// Fields that need to be collected assuming all volume thresholds are reached. As fields
/// are needed, they are moved to <c>currently_due</c> and the account’s
Expand Down