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 support for InstantAvailable on Balance #2207

Merged
merged 1 commit into from
Sep 23, 2020
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
6 changes: 6 additions & 0 deletions src/Stripe.net/Entities/Balance/Balance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public class Balance : StripeEntity<Balance>, IHasObject
[JsonProperty("connect_reserved")]
public List<BalanceAmount> ConnectReserved { get; set; }

/// <summary>
/// Funds that can be paid out using Instant Payouts.
/// </summary>
[JsonProperty("instant_available")]
public List<BalanceInstantAvailable> InstantAvailable { get; set; }

[JsonProperty("issuing")]
public BalanceDetails Issuing { get; set; }

Expand Down
25 changes: 25 additions & 0 deletions src/Stripe.net/Entities/Balance/BalanceInstantAvailable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class BalanceInstantAvailable : StripeEntity<BalanceInstantAvailable>
{
/// <summary>
/// Balance amount.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

/// <summary>
/// Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
/// code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
/// currency</a>.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

[JsonProperty("source_types")]
public BalanceInstantAvailableSourceTypes SourceTypes { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class BalanceInstantAvailableSourceTypes : StripeEntity<BalanceInstantAvailableSourceTypes>
{
/// <summary>
/// Amount for bank account.
/// </summary>
[JsonProperty("bank_account")]
public long BankAccount { get; set; }

/// <summary>
/// Amount for card.
/// </summary>
[JsonProperty("card")]
public long Card { get; set; }

/// <summary>
/// Amount for FPX.
/// </summary>
[JsonProperty("fpx")]
public long Fpx { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class CreditNoteLineItem : StripeEntity<CreditNoteLineItem>, IHasId, IHas
public string Object { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the gross amount being credited
/// for this line item, excluding (exclusive) tax and discounts.
/// The integer amount in %s representing the gross amount being credited for this line
/// item, excluding (exclusive) tax and discounts.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }
Expand All @@ -32,8 +32,7 @@ public class CreditNoteLineItem : StripeEntity<CreditNoteLineItem>, IHasId, IHas
public string Description { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the discount being credited for
/// this line item.
/// The integer amount in %s representing the discount being credited for this line item.
/// </summary>
[JsonProperty("discount_amount")]
public long DiscountAmount { get; set; }
Expand Down
15 changes: 7 additions & 8 deletions src/Stripe.net/Entities/CreditNotes/CreditNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class CreditNote : StripeEntity<CreditNote>, IHasId, IHasMetadata, IHasOb
public string Object { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the total amount of the credit
/// note, including tax.
/// The integer amount in %s representing the total amount of the credit note, including
/// tax.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }
Expand Down Expand Up @@ -105,8 +105,7 @@ public CustomerBalanceTransaction CustomerBalanceTransaction
#endregion

/// <summary>
/// The integer amount in <strong>%s</strong> representing the total amount of discount that
/// was credited.
/// The integer amount in %s representing the total amount of discount that was credited.
/// </summary>
[JsonProperty("discount_amount")]
public long DiscountAmount { get; set; }
Expand Down Expand Up @@ -244,8 +243,8 @@ public Refund Refund
public string Status { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the amount of the credit note,
/// excluding tax and invoice level discounts.
/// The integer amount in %s representing the amount of the credit note, excluding tax and
/// invoice level discounts.
/// </summary>
[JsonProperty("subtotal")]
public long Subtotal { get; set; }
Expand All @@ -257,8 +256,8 @@ public Refund Refund
public List<CreditNoteTaxAmount> TaxAmounts { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the total amount of the credit
/// note, including tax and all discount.
/// The integer amount in %s representing the total amount of the credit note, including tax
/// and all discount.
/// </summary>
[JsonProperty("total")]
public long Total { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public Subscription Subscription
public List<TaxRate> TaxRates { get; set; }

/// <summary>
/// Unit Amount (in the <c>currency</c> specified) of the invoice item.
/// Unit amount (in the <c>currency</c> specified) of the invoice item.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }
Expand Down
30 changes: 22 additions & 8 deletions src/Stripe.net/Entities/Subscriptions/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,11 @@ public Customer Customer
/// <summary>
/// (ID of the PaymentMethod)
/// ID of the default payment method for the subscription. It must belong to the customer
/// associated with the subscription. If not set, invoices will use the default payment
/// method in the customer's invoice settings.
/// associated with the subscription. This takes precedence over <c>default_source</c>. If
/// neither are set, invoices will use the customer's <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
/// or <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
/// </summary>
[JsonIgnore]
public string DefaultPaymentMethodId
Expand All @@ -158,8 +161,11 @@ public string DefaultPaymentMethodId
/// <summary>
/// (Expanded)
/// ID of the default payment method for the subscription. It must belong to the customer
/// associated with the subscription. If not set, invoices will use the default payment
/// method in the customer's invoice settings.
/// associated with the subscription. This takes precedence over <c>default_source</c>. If
/// neither are set, invoices will use the customer's <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
/// or <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
Expand All @@ -180,8 +186,12 @@ public PaymentMethod DefaultPaymentMethod
/// <summary>
/// (ID of the IPaymentSource)
/// ID of the default payment source for the subscription. It must belong to the customer
/// associated with the subscription and be in a chargeable state. If not set, defaults to
/// the customer's default source.
/// associated with the subscription and be in a chargeable state. If
/// <c>default_payment_method</c> is also set, <c>default_payment_method</c> will take
/// precedence. If neither are set, invoices will use the customer's <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
/// or <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
/// </summary>
[JsonIgnore]
public string DefaultSourceId
Expand All @@ -193,8 +203,12 @@ public string DefaultSourceId
/// <summary>
/// (Expanded)
/// ID of the default payment source for the subscription. It must belong to the customer
/// associated with the subscription and be in a chargeable state. If not set, defaults to
/// the customer's default source.
/// associated with the subscription and be in a chargeable state. If
/// <c>default_payment_method</c> is also set, <c>default_payment_method</c> will take
/// precedence. If neither are set, invoices will use the customer's <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method">invoice_settings.default_payment_method</a>
/// or <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-default_source">default_source</a>.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ public class SessionLineItemPriceDataOptions : INestedOptions
public SessionLineItemPriceDataRecurringOptions Recurring { get; set; }

/// <summary>
/// A positive integer in %s representing how much to charge. One of <c>unit_amount</c> or
/// <c>unit_amount_decimal</c> is required.
/// A non-negative integer in %s representing how much to charge. One of <c>unit_amount</c>
/// or <c>unit_amount_decimal</c> is required.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set, but at least
/// one is required.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
14 changes: 6 additions & 8 deletions src/Stripe.net/Services/CreditNotes/CreditNoteCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ namespace Stripe
public class CreditNoteCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// The integer amount in <strong>%s</strong> representing the total amount of the credit
/// note.
/// The integer amount in %s representing the total amount of the credit note.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the amount to credit the
/// customer's balance, which will be automatically applied to their next invoice.
/// The integer amount in %s representing the amount to credit the customer's balance, which
/// will be automatically applied to their next invoice.
/// </summary>
[JsonProperty("credit_amount")]
public long? CreditAmount { get; set; }
Expand Down Expand Up @@ -48,8 +47,7 @@ public class CreditNoteCreateOptions : BaseOptions, IHasMetadata
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the amount that is credited
/// outside of Stripe.
/// The integer amount in %s representing the amount that is credited outside of Stripe.
/// </summary>
[JsonProperty("out_of_band_amount")]
public long? OutOfBandAmount { get; set; }
Expand All @@ -70,8 +68,8 @@ public class CreditNoteCreateOptions : BaseOptions, IHasMetadata
public string Refund { get; set; }

/// <summary>
/// The integer amount in <strong>%s</strong> representing the amount to refund. If set, a
/// refund will be created for the charge associated with the invoice.
/// The integer amount in %s representing the amount to refund. If set, a refund will be
/// created for the charge associated with the invoice.
/// </summary>
[JsonProperty("refund_amount")]
public long? RefundAmount { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/CreditNotes/CreditNoteLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ public class CreditNoteLineOptions : INestedOptions
public string Type { get; set; }

/// <summary>
/// The integer unit amount in <strong>%s</strong> of the credit note line item. This
/// <c>unit_amount</c> will be multiplied by the quantity to get the full amount to credit
/// for this line item. Only valid when <c>type</c> is <c>custom_line_item</c>.
/// The integer unit amount in %s of the credit note line item. This <c>unit_amount</c> will
/// be multiplied by the quantity to get the full amount to credit for this line item. Only
/// valid when <c>type</c> is <c>custom_line_item</c>.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
16 changes: 7 additions & 9 deletions src/Stripe.net/Services/InvoiceItems/InvoiceItemCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ namespace Stripe
public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// The integer amount in <strong>%s</strong> of the charge to be applied to the upcoming
/// invoice. Passing in a negative <c>amount</c> will reduce the <c>amount_due</c> on the
/// invoice.
/// The integer amount in %s of the charge to be applied to the upcoming invoice. Passing in
/// a negative <c>amount</c> will reduce the <c>amount_due</c> on the invoice.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down Expand Up @@ -109,17 +108,16 @@ public class InvoiceItemCreateOptions : BaseOptions, IHasMetadata
public List<string> TaxRates { get; set; }

/// <summary>
/// The integer unit amount in <strong>%s</strong> of the charge to be applied to the
/// upcoming invoice. This <c>unit_amount</c> will be multiplied by the quantity to get the
/// full amount. Passing in a negative <c>unit_amount</c> will reduce the <c>amount_due</c>
/// on the invoice.
/// The integer unit amount in %s of the charge to be applied to the upcoming invoice. This
/// <c>unit_amount</c> will be multiplied by the quantity to get the full amount. Passing in
/// a negative <c>unit_amount</c> will reduce the <c>amount_due</c> on the invoice.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
16 changes: 7 additions & 9 deletions src/Stripe.net/Services/InvoiceItems/InvoiceItemUpdateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ namespace Stripe
public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata
{
/// <summary>
/// The integer amount in <strong>%s</strong> of the charge to be applied to the upcoming
/// invoice. If you want to apply a credit to the customer's account, pass a negative
/// amount.
/// The integer amount in %s of the charge to be applied to the upcoming invoice. If you
/// want to apply a credit to the customer's account, pass a negative amount.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }
Expand Down Expand Up @@ -80,17 +79,16 @@ public class InvoiceItemUpdateOptions : BaseOptions, IHasMetadata
public List<string> TaxRates { get; set; }

/// <summary>
/// The integer unit amount in <strong>%s</strong> of the charge to be applied to the
/// upcoming invoice. This unit_amount will be multiplied by the quantity to get the full
/// amount. If you want to apply a credit to the customer's account, pass a negative
/// unit_amount.
/// The integer unit amount in %s of the charge to be applied to the upcoming invoice. This
/// unit_amount will be multiplied by the quantity to get the full amount. If you want to
/// apply a credit to the customer's account, pass a negative unit_amount.
/// </summary>
[JsonProperty("unit_amount")]
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ public class InvoiceSubscriptionItemPriceDataOptions : INestedOptions
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set, but at least
/// one is required.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Stripe.net/Services/Plans/PlanTierOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class PlanTierOptions : INestedOptions
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Stripe.net/Services/Prices/PriceCreateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public class PriceCreateOptions : BaseOptions, IHasMetadata
public long? UnitAmount { get; set; }

/// <summary>
/// Same as <c>unit_amount</c>, but accepts a decimal value with at most 12 decimal places.
/// Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// Same as <c>unit_amount</c>, but accepts a decimal value in %s with at most 12 decimal
/// places. Only one of <c>unit_amount</c> and <c>unit_amount_decimal</c> can be set.
/// </summary>
[JsonProperty("unit_amount_decimal")]
public decimal? UnitAmountDecimal { get; set; }
Expand Down
Loading