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 various API changes #1814

Merged
merged 1 commit into from
Oct 18, 2019
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
3 changes: 3 additions & 0 deletions src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class ChargePaymentMethodDetails : StripeEntity<ChargePaymentMethodDetail
[JsonProperty("alipay")]
public ChargePaymentMethodDetailsAlipay Alipay { get; set; }

[JsonProperty("au_becs_debit")]
public ChargePaymentMethodDetailsAuBecsDebit AuBecsDebit { get; set; }

[JsonProperty("bancontact")]
public ChargePaymentMethodDetailsBancontact Bancontact { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class ChargePaymentMethodDetailsAuBecsDebit : StripeEntity<ChargePaymentMethodDetailsAuBecsDebit>
{
/// <summary>
/// Bank-State-Branch number of the bank account.
/// </summary>
[JsonProperty("bsb_number")]
public string BsbNumber { get; set; }

/// <summary>
/// Uniquely identifies this particular bank account. You can use this attribute to check
/// whether two bank accounts are the same.
/// </summary>
[JsonProperty("fingerprint")]
public string Fingerprint { get; set; }

/// <summary>
/// Last four digits of the bank account number.
/// </summary>
[JsonProperty("last4")]
public string Last4 { get; set; }

/// <summary>
/// ID of the mandate used to make this payment.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }
}
}
56 changes: 55 additions & 1 deletion src/Stripe.net/Entities/Issuing/Cardholders/Cardholder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,91 @@ namespace Stripe.Issuing

public class Cardholder : StripeEntity<Cardholder>, IHasId, IHasMetadata, IHasObject
{
/// <summary>
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <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>
/// The cardholder’s billing address.
/// </summary>
[JsonProperty("billing")]
public Billing Billing { 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 cardholder’s email address.
/// </summary>
[JsonProperty("email")]
public string Email { get; set; }

/// <summary>
/// Whether or not this cardholder is the default cardholder.
/// </summary>
[JsonProperty("is_default")]
public bool IsDefault { get; set; }

/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value
/// <c>false</c> if the object exists in test mode.
/// </summary>
[JsonProperty("livemode")]
public bool Livemode { get; set; }

/// <summary>
/// A set of key/value pairs that you can attach to a subscription object.
/// </summary>
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// The cardholder’s name. This will be printed on cards issued to them.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }

[Obsolete("Use PhoneNumber instead")]
[JsonIgnore]
public string PhonNumber
{
get => this.PhoneNumber;
set => this.PhoneNumber = value;
}

/// <summary>
/// The cardholder’s phone number.
/// </summary>
[JsonProperty("phone_number")]
public string PhonNumber { get; set; }
public string PhoneNumber { get; set; }

/// <summary>
/// Information about verification requirements for the cardholder, including what information needs to be collected.
/// </summary>
[JsonProperty("requirements")]
public CardholderRequirements Requirements { get; set; }

/// <summary>
/// One of <c>active</c>, <c>inactive</c>, or <c>blocked</c>.
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }

/// <summary>
/// One of <c>individual</c> or <c>business_entity</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class CardholderRequirements : StripeEntity<CardholderRequirements>
{
/// <summary>
/// If the cardholder is disabled, this string describes why. Can be one of <c>listed</c>,
/// <c>rejected.listed</c>, or <c>under_review</c>.
/// </summary>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }

/// <summary>
/// If not empty, this field contains the list of fields that need to be collected in order
/// to verify and re-enable the cardholder.
/// </summary>
[JsonProperty("past_due")]
public List<string> PastDue { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public class SessionSubscriptionDataOptions : INestedOptions, IHasMetadata
[JsonConverter(typeof(DateTimeConverter))]
public DateTime? TrialEnd { get; set; }

/// <summary>
/// Indicates if a plan’s <see cref="Plan.TrialPeriodDays"/> should be applied to the
/// subscription. Setting <c>TrialEnd</c> on <c>DubscriptionData</c> is preferred. Defaults
/// to <c>false</c>.
/// </summary>
[JsonProperty("trial_from_plan")]
public bool? TrialFromPlan { get; set; }

/// <summary>
/// Integer representing the number of trial period days before the customer is charged for the first time.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ public abstract class SubscriptionItemSharedOptions : BaseOptions
[JsonProperty("billing_thresholds")]
public SubscriptionItemBillingThresholdsOptions BillingThresholds { get; set; }

/// <summary>
/// Use <c>error_if_incomplete</c> if you want Stripe to return an HTTP 402 status code if
/// the invoice caused by the item creation cannot be paid. Otherwise use
/// <c>allow_incomplete</c>.
/// </summary>
[JsonProperty("payment_behavior")]
public string PaymentBehavior { get; set; }

/// <summary>
/// REQUIRED: The identifier of the plan to add to the subscription.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,5 @@ public class SubscriptionItemUpdateOptions : SubscriptionItemSharedOptions, IHas
/// </summary>
[JsonProperty("off_session")]
public bool? OffSession { get; set; }

/// <summary>
/// Use <c>error_if_incomplete</c> if you want Stripe to return an HTTP 402 status code if
/// the invoice caused by the update cannot be paid. Otherwise use <c>allow_incomplete</c>.
/// </summary>
[JsonProperty("payment_behavior")]
public string PaymentBehavior { get; set; }
}
}