diff --git a/src/Stripe/Entities/StripeAccount.cs b/src/Stripe/Entities/StripeAccount.cs index 51d8c2bee1..c442f26cff 100644 --- a/src/Stripe/Entities/StripeAccount.cs +++ b/src/Stripe/Entities/StripeAccount.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using System.Collections.Generic; +using Newtonsoft.Json; namespace Stripe { @@ -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; } @@ -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 StripeExternalAccounts { get; set; } + + [JsonProperty("legal_entity")] + public StripeLegalEntity StripeLegalEntity { get; set; } + + [JsonProperty("managed")] + public bool Managed { get; set; } + + [JsonProperty("metadata")] + public Dictionary 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; } + } } diff --git a/src/Stripe/Entities/StripeAccountVerification.cs b/src/Stripe/Entities/StripeAccountVerification.cs new file mode 100644 index 0000000000..3fac2fe6f9 --- /dev/null +++ b/src/Stripe/Entities/StripeAccountVerification.cs @@ -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; } + } +} diff --git a/src/Stripe/Entities/StripeAdditionalOwners.cs b/src/Stripe/Entities/StripeAdditionalOwners.cs new file mode 100644 index 0000000000..80f2272e07 --- /dev/null +++ b/src/Stripe/Entities/StripeAdditionalOwners.cs @@ -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; } + } +} \ No newline at end of file diff --git a/src/Stripe/Entities/StripeAddress.cs b/src/Stripe/Entities/StripeAddress.cs new file mode 100644 index 0000000000..d3354d0139 --- /dev/null +++ b/src/Stripe/Entities/StripeAddress.cs @@ -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; } + } +} diff --git a/src/Stripe/Entities/StripeBirthDay.cs b/src/Stripe/Entities/StripeBirthDay.cs new file mode 100644 index 0000000000..08f23aa2e1 --- /dev/null +++ b/src/Stripe/Entities/StripeBirthDay.cs @@ -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; } + } +} diff --git a/src/Stripe/Entities/StripeDeclineChargeOn.cs b/src/Stripe/Entities/StripeDeclineChargeOn.cs new file mode 100644 index 0000000000..d037ea019d --- /dev/null +++ b/src/Stripe/Entities/StripeDeclineChargeOn.cs @@ -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; } + } +} \ No newline at end of file diff --git a/src/Stripe/Entities/StripeFileUpload.cs b/src/Stripe/Entities/StripeFileUpload.cs new file mode 100644 index 0000000000..5eec446713 --- /dev/null +++ b/src/Stripe/Entities/StripeFileUpload.cs @@ -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; } + } +} \ No newline at end of file diff --git a/src/Stripe/Entities/StripeLegalEntity.cs b/src/Stripe/Entities/StripeLegalEntity.cs new file mode 100644 index 0000000000..3056387268 --- /dev/null +++ b/src/Stripe/Entities/StripeLegalEntity.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Stripe +{ + public class StripeLegalEntity + { + [JsonProperty("additional_owners")] + public StripeList 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; } + } +} diff --git a/src/Stripe/Entities/StripeLegalEntityVerification.cs b/src/Stripe/Entities/StripeLegalEntityVerification.cs new file mode 100644 index 0000000000..b74810482d --- /dev/null +++ b/src/Stripe/Entities/StripeLegalEntityVerification.cs @@ -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.Map(value, s => DocumentId = s, o => Document = o); + } + } + #endregion + + [JsonProperty("status")] + public string Status { get; set; } + } +} \ No newline at end of file diff --git a/src/Stripe/Entities/StripeList.cs b/src/Stripe/Entities/StripeList.cs index 25c849489a..86e738cd15 100644 --- a/src/Stripe/Entities/StripeList.cs +++ b/src/Stripe/Entities/StripeList.cs @@ -14,10 +14,10 @@ public class StripeList [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; } } } \ No newline at end of file diff --git a/src/Stripe/Entities/StripeTermsOfServiceAcceptance.cs b/src/Stripe/Entities/StripeTermsOfServiceAcceptance.cs new file mode 100644 index 0000000000..3fd7f721c4 --- /dev/null +++ b/src/Stripe/Entities/StripeTermsOfServiceAcceptance.cs @@ -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; } + } +} diff --git a/src/Stripe/Entities/StripeTransferSchedule.cs b/src/Stripe/Entities/StripeTransferSchedule.cs new file mode 100644 index 0000000000..be8eb787a7 --- /dev/null +++ b/src/Stripe/Entities/StripeTransferSchedule.cs @@ -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; } + } +} diff --git a/src/Stripe/Stripe.csproj b/src/Stripe/Stripe.csproj index ba2810699b..a59df31274 100644 --- a/src/Stripe/Stripe.csproj +++ b/src/Stripe/Stripe.csproj @@ -54,6 +54,16 @@ Properties\SharedAssemblyInfo.cs + + + + + + + + + +