Skip to content

Commit

Permalink
update account entity to include all properties and all nested proper…
Browse files Browse the repository at this point in the history
…ties/objects
  • Loading branch information
jaymedavis committed Jan 8, 2016
1 parent 5a553b6 commit 3f44650
Show file tree
Hide file tree
Showing 13 changed files with 306 additions and 8 deletions.
61 changes: 56 additions & 5 deletions src/Stripe/Entities/StripeAccount.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Stripe
{
Expand All @@ -7,6 +8,15 @@ public class StripeAccount : StripeObject
[JsonProperty("object")]
public string Object { get; set; }

[JsonProperty("business_name")]
public string BusinessName { get; set; }

[JsonProperty("business_primary_color")]
public string BusinessPrimaryColor { get; set; }

[JsonProperty("business_url")]
public string BusinessUrl { get; set; }

[JsonProperty("charges_enabled")]
public bool ChargesEnabled { get; set; }

Expand All @@ -16,25 +26,66 @@ public class StripeAccount : StripeObject
[JsonProperty("currencies_supported")]
public string[] CurrenciesSupported { get; set; }

[JsonProperty("debit_negative_balances")]
public bool DebitNegativeBalances { get; set; }

[JsonProperty("decline_charge_on")]
public StripeDeclineChargeOn DeclineChargeOn { get; set; }

[JsonProperty("default_currency")]
public string DefaultCurrency { get; set; }

[JsonProperty("details_submitted")]
public bool DetailsSubmitted { get; set; }

[JsonProperty("transfers_enabled")]
public bool TransfersEnabled { get; set; }

[JsonProperty("display_name")]
public string DisplayName { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

// this should work, but it probably needs to determine if it's a card
// or a bank account, and give back a list accordingly
[JsonProperty("external_accounts")]
public StripeList<dynamic> StripeExternalAccounts { get; set; }

[JsonProperty("legal_entity")]
public StripeLegalEntity StripeLegalEntity { get; set; }

[JsonProperty("managed")]
public bool Managed { get; set; }

[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

[JsonProperty("product_description")]
public string ProductDescription { get; set; }

[JsonProperty("statement_descriptor")]
public string StatementDescriptor { get; set; }

[JsonProperty("support_email")]
public string SupportEmail { get; set; }

[JsonProperty("support_phone")]
public string SupportPhone { get; set; }

[JsonProperty("support_url")]
public string SupportUrl { get; set; }

[JsonProperty("timezone")]
public string Timezone { get; set; }
}

[JsonProperty("tos_acceptance")]
public StripeTermsOfServiceAcceptance TermsOfServiceAcceptance { get; set; }

[JsonProperty("transfer_schedule")]
public StripeTransferSchedule TransferSchedule { get; set; }

[JsonProperty("transfers_enabled")]
public bool TransfersEnabled { get; set; }

[JsonProperty("verification")]
public StripeAccountVerification Verification { get; set; }
}
}
19 changes: 19 additions & 0 deletions src/Stripe/Entities/StripeAccountVerification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

namespace Stripe
{
public class StripeAccountVerification
{
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }

[JsonProperty("due_by")]
[JsonConverter(typeof(StripeDateTimeConverter))]
public DateTime DueBy { get; set; }

[JsonProperty("fields_needed")]
public string[] FieldsNeeded { get; set; }
}
}
22 changes: 22 additions & 0 deletions src/Stripe/Entities/StripeAdditionalOwners.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Newtonsoft.Json;

namespace Stripe
{
public class StripeAdditionalOwners
{
[JsonProperty("address")]
public StripeAddress Address { get; set; }

[JsonProperty("dob")]
public StripeBirthDay StripeBirthDay { get; set; }

[JsonProperty("first_name")]
public string FirstName { get; set; }

[JsonProperty("last_name")]
public string LastName { get; set; }

[JsonProperty("verification")]
public StripeLegalEntityVerification Verification { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/Stripe/Entities/StripeAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Newtonsoft.Json;

namespace Stripe
{
public class StripeAddress
{
[JsonProperty("city")]
public string City { get; set; }

[JsonProperty("country")]
public string Country { get; set; }

[JsonProperty("line1")]
public string Line1 { get; set; }

[JsonProperty("line2")]
public string Line2 { get; set; }

[JsonProperty("postal_code")]
public string PostalCode { get; set; }

[JsonProperty("state")]
public string State { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Stripe/Entities/StripeBirthDay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace Stripe
{
public class StripeBirthDay
{
[JsonProperty("day")]
public int Day { get; set; }

[JsonProperty("month")]
public int Month { get; set; }

[JsonProperty("year")]
public int Year { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/Stripe/Entities/StripeDeclineChargeOn.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Newtonsoft.Json;

namespace Stripe
{
public class StripeDeclineChargeOn
{
[JsonProperty("avs_failure")]
public bool AvsFailure { get; set; }

[JsonProperty("cvc_failure")]
public bool CvcFailure { get; set; }
}
}
28 changes: 28 additions & 0 deletions src/Stripe/Entities/StripeFileUpload.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

namespace Stripe
{
public class StripeFileUpload : StripeObject
{
[JsonProperty("object")]
public string Object { get; set; }

[JsonProperty("created")]
[JsonConverter(typeof(StripeDateTimeConverter))]
public DateTime Created { get; set; }

[JsonProperty("purpose")]
public string Purpose { get; set; }

[JsonProperty("size")]
public int Size { get; set; }

[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("url")]
public string Url { get; set; }
}
}
41 changes: 41 additions & 0 deletions src/Stripe/Entities/StripeLegalEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Stripe
{
public class StripeLegalEntity
{
[JsonProperty("additional_owners")]
public StripeList<StripeAdditionalOwners> StripAdditionalOwners { get; set; }

[JsonProperty("address")]
public StripeAddress Address { get; set; }

[JsonProperty("business_name")]
public string BusinessName { get; set; }

[JsonProperty("dob")]
public StripeBirthDay StripeBirthDay { get; set; }

[JsonProperty("first_name")]
public string FirstName { get; set; }

[JsonProperty("last_name")]
public string LastName { get; set; }

[JsonProperty("personal_address")]
public StripeAddress PersonalAddress { get; set; }

[JsonProperty("personal_id_number_provided")]
public bool PersonalIdNumberProvided { get; set; }

[JsonProperty("ssn_last_4_provided")]
public bool SocialSecurityNumberLastFourProvided { get; set; }

[JsonProperty("type")]
public string Type { get; set; }

[JsonProperty("verification")]
public StripeLegalEntityVerification StripeLegalEntityVerification { get; set; }
}
}
33 changes: 33 additions & 0 deletions src/Stripe/Entities/StripeLegalEntityVerification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Newtonsoft.Json;
using Stripe.Infrastructure;

namespace Stripe
{
public class StripeLegalEntityVerification
{
[JsonProperty("details")]
public string Details { get; set; }

[JsonProperty("details_code")]
public string DetailsCode { get; set; }

#region Expandable Document
public string DocumentId { get; set; }

[JsonIgnore]
public StripeFileUpload Document { get; set; }

[JsonProperty("document")]
internal object InternalDocument
{
set
{
ExpandableProperty<StripeFileUpload>.Map(value, s => DocumentId = s, o => Document = o);
}
}
#endregion

[JsonProperty("status")]
public string Status { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/Stripe/Entities/StripeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class StripeList<T>
[JsonProperty("has_more")]
public bool HasMore { get; set; }

[JsonProperty("url")]
public string Url { get; set; }

[JsonProperty("total_count")]
public int TotalCount { get; set; }

[JsonProperty("url")]
public string Url { get; set; }
}
}
20 changes: 20 additions & 0 deletions src/Stripe/Entities/StripeTermsOfServiceAcceptance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;

namespace Stripe
{
public class StripeTermsOfServiceAcceptance
{
[JsonProperty("date")]
[JsonConverter(typeof(StripeDateTimeConverter))]
public DateTime Date { get; set; }

[JsonProperty("ip")]
public string Ip { get; set; }

[JsonProperty("user_agent")]
public string UserAgent { get; set; }
}
}
20 changes: 20 additions & 0 deletions src/Stripe/Entities/StripeTransferSchedule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Stripe
{
public class StripeTransferSchedule
{
[JsonProperty("delay_days")]
public int DelayDays { get; set; }

[JsonProperty("interval")]
public string Interval { get; set; }

[JsonProperty("monthly_anchor")]
public int MonthlyAnchor { get; set; }

[JsonProperty("weekly_anchor")]
public string WeeklyAnchor { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/Stripe/Stripe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Entities\StripeBirthDay.cs" />
<Compile Include="Entities\StripeAddress.cs" />
<Compile Include="Entities\StripeDeclineChargeOn.cs" />
<Compile Include="Entities\StripeAdditionalOwners.cs" />
<Compile Include="Entities\StripeFileUpload.cs" />
<Compile Include="Entities\StripeLegalEntityVerification.cs" />
<Compile Include="Entities\StripeLegalEntity.cs" />
<Compile Include="Entities\StripeTermsOfServiceAcceptance.cs" />
<Compile Include="Entities\StripeTransferSchedule.cs" />
<Compile Include="Entities\StripeAccountVerification.cs" />
<Compile Include="Entities\StripeList.cs" />
<Compile Include="Entities\StripeRefund.cs" />
<Compile Include="Entities\StripeBankAccount.cs" />
Expand Down

0 comments on commit 3f44650

Please sign in to comment.