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 ReportingCategory to BalanceTransaction #1893

Merged
merged 1 commit into from
Jan 6, 2020
Merged
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
54 changes: 54 additions & 0 deletions src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,87 @@ namespace Stripe

public class BalanceTransaction : StripeEntity<BalanceTransaction>, IHasId, 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>
/// Gross amount of the transaction, in cents.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

/// <summary>
/// The date the transaction’s net funds will become available in the Stripe balance.
/// </summary>
[JsonProperty("available_on")]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime AvailableOn { 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>
/// Three-letter ISO currency code, in lowercase.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// An arbitrary string attached to the object. Often useful for displaying to users.
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }

/// <summary>
/// The exchange rate associated with this transaction.
/// </summary>
[JsonProperty("exchange_rate")]
public decimal? ExchangeRate { get; set; }

/// <summary>
/// Fees (in cents) paid for this transaction.
/// </summary>
[JsonProperty("fee")]
public long Fee { get; set; }

/// <summary>
/// Detailed breakdown of fees (in cents) paid for this transaction.
/// </summary>
[JsonProperty("fee_details")]
public List<Fee> FeeDetails { get; set; }

/// <summary>
/// Net amount of the transaction, in cents.
/// </summary>
[JsonProperty("net")]
public long Net { get; set; }

/// <summary>
/// <a href="https://stripe.com/docs/reports/reporting-categories">Learn more</a>
/// about how reporting categories can help you understand
/// balance transactions from an accounting perspective.
/// </summary>
[JsonProperty("reporting_category")]
public string ReportingCategory { get; set; }

#region Expandable Source

/// <summary>
/// The ID of the Stripe object to which this transaction is related.
/// </summary>
[JsonIgnore]
public string SourceId
{
Expand All @@ -62,9 +107,18 @@ public IBalanceTransactionSource Source
internal ExpandableField<IBalanceTransactionSource> InternalSource { get; set; }
#endregion

/// <summary>
/// If the transaction’s net funds are available in the Stripe balance
/// yet. Either <c>available</c> or <c>pending</c>.
/// </summary>
[JsonProperty("status")]
public string Status { get; set; }

/// <summary>
/// Transaction type.
/// <a href="https://stripe.com/docs/reports/balance-transaction-types">Learn more</a>
/// about balance transaction types and what they represent.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
Expand Down