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

API Updates #2397

Merged
merged 3 commits into from
Nov 17, 2021
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
COVERALLS_REPO_TOKEN:
secure: T0PmP8uyzCseacBCDRBlti2y9Tz5DL6fknea0MKWvbPYrzADmLY2/5kOTfYIsPUk
# If you bump this, don't forget to bump `MinimumMockVersion` in `StripeMockFixture.cs` as well.
STRIPE_MOCK_VERSION: 0.115.0
STRIPE_MOCK_VERSION: 0.116.0

deploy:
- provider: NuGet
Expand Down
8 changes: 5 additions & 3 deletions src/Stripe.net/Entities/Accounts/AccountRequirements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public class AccountRequirements : StripeEntity<AccountRequirements>
/// <summary>
/// If the account is disabled, this string describes why. Can be
/// <c>requirements.past_due</c>, <c>requirements.pending_verification</c>, <c>listed</c>,
/// <c>platform_paused</c>, <c>rejected.fraud</c>, <c>rejected.listed</c>,
/// <c>rejected.terms_of_service</c>, <c>rejected.other</c>, <c>under_review</c>, or
/// <c>other</c>.
/// <c>platform_paused</c>, <c>rejected.listed</c>, <c>rejected.terms_of_service</c>,
/// <c>rejected.card_casher</c>, <c>rejected.auto_fraud_shutdown</c>, <c>rejected.fraud</c>,
/// <c>rejected.dishonest_merchant</c>, <c>rejected.identity_fraud</c>,
/// <c>rejected.platform_fraud</c>, <c>rejected.platform_terms_of_service</c>,
/// <c>rejected.other</c>, <c>under_review</c>, or <c>other</c>.
/// </summary>
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }
Expand Down
2 changes: 0 additions & 2 deletions src/Stripe.net/Entities/BillingPortal/Sessions/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ namespace Stripe.BillingPortal
/// manage their subscriptions and billing details.
///
/// Learn more in the <a
/// href="https://stripe.com/docs/billing/subscriptions/customer-portal">product
/// overview</a> and <a
/// href="https://stripe.com/docs/billing/subscriptions/integrating-customer-portal">integration
/// guide</a>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ public class CapabilityRequirements : StripeEntity<CapabilityRequirements>
/// <summary>
/// If the capability is disabled, this string describes why. Can be
/// <c>requirements.past_due</c>, <c>requirements.pending_verification</c>, <c>listed</c>,
/// <c>platform_paused</c>, <c>rejected.fraud</c>, <c>rejected.listed</c>,
/// <c>rejected.terms_of_service</c>, <c>rejected.other</c>, <c>under_review</c>, or
/// <c>other</c>.
/// <c>platform_paused</c>, <c>rejected.listed</c>, <c>rejected.terms_of_service</c>,
/// <c>rejected.card_casher</c>, <c>rejected.auto_fraud_shutdown</c>, <c>rejected.fraud</c>,
/// <c>rejected.dishonest_merchant</c>, <c>rejected.identity_fraud</c>,
/// <c>rejected.platform_fraud</c>, <c>rejected.platform_terms_of_service</c>,
/// <c>rejected.other</c>, <c>under_review</c>, or <c>other</c>.
///
/// <c>rejected.unsupported_business</c> means that the account's business is not supported
/// by the capability. For example, payment methods may restrict the businesses they support
Expand Down
7 changes: 7 additions & 0 deletions src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public Application Application
[JsonProperty("application_fee_amount")]
public long? ApplicationFeeAmount { get; set; }

/// <summary>
/// Settings to configure compatible payment methods from the <a
/// href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard</a>.
/// </summary>
[JsonProperty("automatic_payment_methods")]
public PaymentIntentAutomaticPaymentMethods AutomaticPaymentMethods { get; set; }

/// <summary>
/// Populated when <c>status</c> is <c>canceled</c>, this is the time at which the
/// PaymentIntent was canceled. Measured in seconds since the Unix epoch.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentIntentAutomaticPaymentMethods : StripeEntity<PaymentIntentAutomaticPaymentMethods>
{
/// <summary>
/// Automatically calculates compatible payment methods.
/// </summary>
[JsonProperty("enabled")]
public bool Enabled { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class PaymentIntentNextAction : StripeEntity<PaymentIntentNextAction>

/// <summary>
/// Type of the next action to perform, one of <c>redirect_to_url</c>,
/// <c>use_stripe_sdk</c>, <c>alipay_handle_redirect</c>, or <c>oxxo_display_details</c>.
/// <c>use_stripe_sdk</c>, <c>alipay_handle_redirect</c>, <c>oxxo_display_details</c>, or
/// <c>verify_with_microdeposits</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class SetupIntentNextAction : StripeEntity<SetupIntentNextAction>

/// <summary>
/// Type of the next action to perform, one of <c>redirect_to_url</c>,
/// <c>use_stripe_sdk</c>, <c>alipay_handle_redirect</c>, or <c>oxxo_display_details</c>.
/// <c>use_stripe_sdk</c>, <c>alipay_handle_redirect</c>, <c>oxxo_display_details</c>, or
/// <c>verify_with_microdeposits</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public class SessionCreateOptions : BaseOptions, IHasMetadata
public List<SessionShippingOptionOptions> ShippingOptions { get; set; }

/// <summary>
/// [To be deprecated] The shipping rate to apply to this Session. Only up to one may be
/// [Deprecated] The shipping rate to apply to this Session. Only up to one may be
/// specified.
/// </summary>
[JsonProperty("shipping_rates")]
Expand Down
27 changes: 14 additions & 13 deletions src/Stripe.net/Services/Checkout/Sessions/SessionLineItemOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ public class SessionLineItemOptions : INestedOptions
public SessionLineItemAdjustableQuantityOptions AdjustableQuantity { get; set; }

/// <summary>
/// The amount to be collected per unit of the line item. If specified, must also pass
/// <c>currency</c> and <c>name</c>.
/// [Deprecated] The amount to be collected per unit of the line item. If specified, must
/// also pass <c>currency</c> and <c>name</c>.
/// </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>. Required if <c>amount</c> is passed.
/// [Deprecated] 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>. Required if
/// <c>amount</c> is passed.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
Expand All @@ -46,31 +47,31 @@ public class SessionLineItemOptions : INestedOptions
public List<string> DynamicTaxRates { get; set; }

/// <summary>
/// A list of image URLs representing this line item. Each image can be up to 5 MB in size.
/// If passing <c>price</c> or <c>price_data</c>, specify images on the associated product
/// instead.
/// [Deprecated] A list of image URLs representing this line item. Each image can be up to 5
/// MB in size. If passing <c>price</c> or <c>price_data</c>, specify images on the
/// associated product instead.
/// </summary>
[JsonProperty("images")]
public List<string> Images { get; set; }

/// <summary>
/// The name for the item to be displayed on the Checkout page. Required if <c>amount</c> is
/// passed.
/// [Deprecated] The name for the item to be displayed on the Checkout page. Required if
/// <c>amount</c> is passed.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }

/// <summary>
/// The ID of the <a href="https://stripe.com/docs/api/prices">Price</a> or <a
/// href="https://stripe.com/docs/api/plans">Plan</a> object. One of <c>price</c>,
/// <c>price_data</c> or <c>amount</c> is required.
/// href="https://stripe.com/docs/api/plans">Plan</a> object. One of <c>price</c> or
/// <c>price_data</c> is required.
/// </summary>
[JsonProperty("price")]
public string Price { get; set; }

/// <summary>
/// Data used to generate a new <a href="https://stripe.com/docs/api/prices">Price</a>
/// object inline. One of <c>price</c>, <c>price_data</c> or <c>amount</c> is required.
/// object inline. One of <c>price</c> or <c>price_data</c> is required.
/// </summary>
[JsonProperty("price_data")]
public SessionLineItemPriceDataOptions PriceData { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentIntentAutomaticPaymentMethodsOptions : INestedOptions
{
/// <summary>
/// Whether this feature is enabled.
/// </summary>
[JsonProperty("enabled")]
public bool? Enabled { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public class PaymentIntentCreateOptions : BaseOptions, IHasMetadata
[JsonProperty("application_fee_amount")]
public long? ApplicationFeeAmount { get; set; }

/// <summary>
/// When enabled, this PaymentIntent will accept payment methods that you have enabled in
/// the Dashboard and are compatible with this PaymentIntent's other parameters.
/// </summary>
[JsonProperty("automatic_payment_methods")]
public PaymentIntentAutomaticPaymentMethodsOptions AutomaticPaymentMethods { get; set; }

/// <summary>
/// Controls when the funds will be captured from the customer's account.
/// One of: <c>automatic</c>, or <c>manual</c>.
Expand Down
16 changes: 16 additions & 0 deletions src/StripeTests/Services/GeneratedExamplesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,22 @@ public void TestPaymentIntentServiceCreate()
service.Create(options);
}

[Fact]
public void TestPaymentIntentServiceCreate2()
{
var options = new PaymentIntentCreateOptions
{
Amount = 1099,
Currency = "eur",
AutomaticPaymentMethods = new PaymentIntentAutomaticPaymentMethodsOptions
{
Enabled = true,
},
};
var service = new PaymentIntentService(this.StripeClient);
service.Create(options);
}

[Fact]
public void TestPaymentIntentServiceList()
{
Expand Down
2 changes: 1 addition & 1 deletion src/StripeTests/StripeMockFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class StripeMockFixture : IDisposable
/// If you bump this, don't forget to bump <c>STRIPE_MOCK_VERSION</c> in <c>appveyor.yml</c>
/// as well.
/// </remarks>
private const string MockMinimumVersion = "0.115.0";
private const string MockMinimumVersion = "0.116.0";

private readonly string port;

Expand Down