Skip to content

Commit

Permalink
Merge pull request #1638 from stripe/remi-add-balance
Browse files Browse the repository at this point in the history
Introduce Balance and deprecate AccountBalance on Customer
  • Loading branch information
remi-stripe authored Jun 6, 2019
2 parents 20703cc + 3b325ab commit 94f3d56
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Stripe.net/Entities/Customers/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public class Customer : StripeEntity, IHasId, IHasMetadata, IHasObject
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// Current balance, if any, being stored on the customer’s account. If negative, the customer has credit to apply to the next invoice. If positive, the customer has an amount owed that will be added to the next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account for recurring billing purposes (i.e., subscriptions, invoices, invoice items)
/// </summary>
[Obsolete("Use Balance")]
[JsonProperty("account_balance")]
public long AccountBalance { get; set; }

Expand All @@ -25,6 +23,16 @@ public class Customer : StripeEntity, IHasId, IHasMetadata, IHasObject
[JsonProperty("address")]
public Address Address { get; set; }

/// <summary>
/// Current balance, if any, being stored on the customer. If negative, the customer has
/// credit to apply to their next invoice. If positive, the customer has an amount owed that
/// will be added to their next invoice. The balance does not refer to any unpaid invoices;
/// it solely takes into account amounts that have yet to be successfully applied to any
/// invoice. This balance is only taken into account as invoices are finalized.
/// </summary>
[JsonProperty("balance")]
public long Balance { get; set; }

/// <summary>
/// Time at which the object was created. Measured in seconds since the Unix epoch.
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions src/Stripe.net/Services/Customers/CustomerCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Stripe

public class CustomerCreateOptions : BaseOptions
{
[Obsolete("Use Balance")]
[JsonProperty("account_balance")]
public long? AccountBalance { get; set; }

Expand All @@ -16,6 +17,16 @@ public class CustomerCreateOptions : BaseOptions
[JsonProperty("address")]
public AddressOptions Address { get; set; }

/// <summary>
/// Current balance, if any, being stored on the customer. If negative, the customer has
/// credit to apply to their next invoice. If positive, the customer has an amount owed that
/// will be added to their next invoice. The balance does not refer to any unpaid invoices;
/// it solely takes into account amounts that have yet to be successfully applied to any
/// invoice. This balance is only taken into account as invoices are finalized.
/// </summary>
[JsonProperty("balance")]
public long? Balance { get; set; }

[JsonProperty("coupon")]
public string CouponId { get; set; }

Expand Down
11 changes: 11 additions & 0 deletions src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Stripe

public class CustomerUpdateOptions : BaseOptions
{
[Obsolete("Use Balance")]
[JsonProperty("account_balance")]
public long? AccountBalance { get; set; }

Expand All @@ -15,6 +16,16 @@ public class CustomerUpdateOptions : BaseOptions
[JsonProperty("address")]
public AddressOptions Address { get; set; }

/// <summary>
/// Current balance, if any, being stored on the customer. If negative, the customer has
/// credit to apply to their next invoice. If positive, the customer has an amount owed that
/// will be added to their next invoice. The balance does not refer to any unpaid invoices;
/// it solely takes into account amounts that have yet to be successfully applied to any
/// invoice. This balance is only taken into account as invoices are finalized.
/// </summary>
[JsonProperty("balance")]
public long? Balance { get; set; }

[JsonProperty("coupon")]
public string Coupon { get; set; }

Expand Down

0 comments on commit 94f3d56

Please sign in to comment.