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 #2455

Merged
merged 4 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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.122.0
STRIPE_MOCK_VERSION: 0.123.0

deploy:
- provider: NuGet
Expand Down
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 @@ -38,6 +38,9 @@ public class ChargePaymentMethodDetails : StripeEntity<ChargePaymentMethodDetail
[JsonProperty("card_present")]
public ChargePaymentMethodDetailsCardPresent CardPresent { get; set; }

[JsonProperty("customer_balance")]
public ChargePaymentMethodDetailsCustomerBalance CustomerBalance { get; set; }

[JsonProperty("eps")]
public ChargePaymentMethodDetailsEps Eps { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ public class ChargePaymentMethodDetailsCardPresent : StripeEntity<ChargePaymentM

/// <summary>
/// Whether this <a href="https://stripe.com/docs/api/payment_intents">PaymentIntent</a> is
/// eligible for incremental authorizations. Request support using
/// [request_incremental_authorization_support]
/// /docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support.
/// eligible for incremental authorizations. Request support using <a
/// href="https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support">request_incremental_authorization_support</a>.
/// </summary>
[JsonProperty("incremental_authorization_supported")]
public bool? IncrementalAuthorizationSupported { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe
{
public class ChargePaymentMethodDetailsCustomerBalance : StripeEntity<ChargePaymentMethodDetailsCustomerBalance>
{
}
}
47 changes: 47 additions & 0 deletions src/Stripe.net/Entities/FundingInstructions/FundingInstructions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

/// <summary>
/// Each customer has a <a
/// href="https://stripe.com/docs/api/customers/object#customer_object-balance"><c>balance</c></a>
/// that is automatically applied to future invoices and payments using the
/// <c>customer_balance</c> payment method. Customers can fund this balance by initiating a
/// bank transfer to any account in the <c>financial_addresses</c> field. Related guide: <a
/// href="https://stripe.com/docs/payments/customer-balance/funding-instructions">Customer
/// Balance - Funding Instructions</a> to learn more.
/// </summary>
public class FundingInstructions : StripeEntity<FundingInstructions>, IHasObject
{
/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

[JsonProperty("bank_transfer")]
public FundingInstructionsBankTransfer BankTransfer { 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; }

/// <summary>
/// The <c>funding_type</c> of the returned instructions.
/// </summary>
[JsonProperty("funding_type")]
public string FundingType { 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; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class FundingInstructionsBankTransfer : StripeEntity<FundingInstructionsBankTransfer>
{
/// <summary>
/// The country of the bank account to fund.
/// </summary>
[JsonProperty("country")]
public string Country { get; set; }

/// <summary>
/// A list of financial addresses that can be used to fund a particular balance.
/// </summary>
[JsonProperty("financial_addresses")]
public List<FundingInstructionsBankTransferFinancialAddress> FinancialAddresses { get; set; }

/// <summary>
/// The bank_transfer type.
/// One of: <c>eu_bank_transfer</c>, or <c>jp_bank_transfer</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class FundingInstructionsBankTransferFinancialAddress : StripeEntity<FundingInstructionsBankTransferFinancialAddress>
{
/// <summary>
/// The payment networks supported by this FinancialAddress.
/// </summary>
[JsonProperty("supported_networks")]
public List<string> SupportedNetworks { get; set; }

/// <summary>
/// The type of financial address.
/// One of: <c>iban</c>, or <c>zengin</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// Zengin Records contain Japan bank account details per the Zengin format.
/// </summary>
[JsonProperty("zengin")]
public FundingInstructionsBankTransferFinancialAddressZengin Zengin { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe
{
public class FundingInstructionsBankTransferFinancialAddressZengin : StripeEntity<FundingInstructionsBankTransferFinancialAddressZengin>
{
}
}
3 changes: 3 additions & 0 deletions src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public class PaymentIntent : StripeEntity<PaymentIntent>, IHasId, IHasMetadata,
[JsonProperty("amount_capturable")]
public long AmountCapturable { get; set; }

[JsonProperty("amount_details")]
public PaymentIntentAmountDetails AmountDetails { get; set; }

/// <summary>
/// Amount that was collected by this PaymentIntent.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentIntentAmountDetails : StripeEntity<PaymentIntentAmountDetails>
{
[JsonProperty("tip")]
public PaymentIntentAmountDetailsTip Tip { get; set; }
}
}
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 PaymentIntentAmountDetailsTip : StripeEntity<PaymentIntentAmountDetailsTip>
{
/// <summary>
/// Portion of the amount that corresponds to a tip.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class PaymentIntentNextAction : StripeEntity<PaymentIntentNextAction>
[JsonProperty("card_await_notification")]
public PaymentIntentNextActionCardAwaitNotification CardAwaitNotification { get; set; }

[JsonProperty("display_bank_transfer_instructions")]
public PaymentIntentNextActionDisplayBankTransferInstructions DisplayBankTransferInstructions { get; set; }

[JsonProperty("konbini_display_details")]
public PaymentIntentNextActionKonbiniDisplayDetails KonbiniDisplayDetails { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class PaymentIntentNextActionDisplayBankTransferInstructions : StripeEntity<PaymentIntentNextActionDisplayBankTransferInstructions>
{
/// <summary>
/// The remaining amount that needs to be transferred to complete the payment.
/// </summary>
[JsonProperty("amount_remaining")]
public long? AmountRemaining { 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; }

/// <summary>
/// A list of financial addresses that can be used to fund the customer balance.
/// </summary>
[JsonProperty("financial_addresses")]
public List<PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddress> FinancialAddresses { get; set; }

/// <summary>
/// A string identifying this payment. Instruct your customer to include this code in the
/// reference or memo field of their bank transfer.
/// </summary>
[JsonProperty("reference")]
public string Reference { get; set; }

/// <summary>
/// Type of bank transfer.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddress : StripeEntity<PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddress>
{
/// <summary>
/// The payment networks supported by this FinancialAddress.
/// </summary>
[JsonProperty("supported_networks")]
public List<string> SupportedNetworks { get; set; }

/// <summary>
/// The type of financial address.
/// One of: <c>iban</c>, or <c>zengin</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }

/// <summary>
/// Zengin Records contain Japan bank account details per the Zengin format.
/// </summary>
[JsonProperty("zengin")]
public PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin Zengin { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe
{
public class PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin : StripeEntity<PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class PaymentIntentPaymentMethodOptions : StripeEntity<PaymentIntentPayme
[JsonProperty("card_present")]
public PaymentIntentPaymentMethodOptionsCardPresent CardPresent { get; set; }

[JsonProperty("customer_balance")]
public PaymentIntentPaymentMethodOptionsCustomerBalance CustomerBalance { get; set; }

[JsonProperty("eps")]
public PaymentIntentPaymentMethodOptionsEps Eps { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class PaymentIntentPaymentMethodOptionsCardPresent : StripeEntity<Payment

/// <summary>
/// Request ability to <a
/// href="docs/terminal/features/incremental-authorizations">increment</a> this
/// PaymentIntent if the combination of MCC and card brand is eligible. Check <a
/// href="https://stripe.com/docs/terminal/features/incremental-authorizations">increment</a>
/// this PaymentIntent if the combination of MCC and card brand is eligible. Check <a
/// href="https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported">incremental_authorization_supported</a>
/// in the <a href="https://stripe.com/docs/api/payment_intents/confirm">Confirm</a>
/// response to verify support.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentIntentPaymentMethodOptionsCustomerBalance : StripeEntity<PaymentIntentPaymentMethodOptionsCustomerBalance>
{
[JsonProperty("bank_transfer")]
public PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer BankTransfer { get; set; }

/// <summary>
/// The funding method type to be used when there are not enough funds in the customer
/// balance. Permitted values include: <c>bank_transfer</c>.
/// </summary>
[JsonProperty("funding_type")]
public string FundingType { get; set; }

/// <summary>
/// Indicates that you intend to make future payments with this PaymentIntent's payment
/// method.
///
/// Providing this parameter will <a
/// href="https://stripe.com/docs/payments/save-during-payment">attach the payment
/// method</a> to the PaymentIntent's Customer, if present, after the PaymentIntent is
/// confirmed and any required actions from the user are complete. If no Customer was
/// provided, the payment method can still be <a
/// href="https://stripe.com/docs/api/payment_methods/attach">attached</a> to a Customer
/// after the transaction completes.
///
/// When processing card payments, Stripe also uses <c>setup_future_usage</c> to dynamically
/// optimize your payment flow and comply with regional legislation and network rules, such
/// as <a href="https://stripe.com/docs/strong-customer-authentication">SCA</a>.
/// </summary>
[JsonProperty("setup_future_usage")]
public string SetupFutureUsage { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer : StripeEntity<PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer>
{
/// <summary>
/// List of address types that should be returned in the financial_addresses response. If
/// not specified, all valid types will be returned.
///
/// Permitted values include: <c>zengin</c>.
/// </summary>
[JsonProperty("requested_address_types")]
public List<string> RequestedAddressTypes { get; set; }

/// <summary>
/// The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted
/// values include: <c>us_bank_account</c>, <c>eu_bank_account</c>, <c>id_bank_account</c>,
/// <c>gb_bank_account</c>, <c>jp_bank_account</c>, <c>mx_bank_account</c>,
/// <c>eu_bank_transfer</c>, <c>gb_bank_transfer</c>, <c>id_bank_transfer</c>,
/// <c>jp_bank_transfer</c>, <c>mx_bank_transfer</c>, or <c>us_bank_transfer</c>.
/// One of: <c>eu_bank_account</c>, <c>eu_bank_transfer</c>, <c>gb_bank_account</c>,
/// <c>gb_bank_transfer</c>, <c>id_bank_account</c>, <c>id_bank_transfer</c>,
/// <c>jp_bank_account</c>, <c>jp_bank_transfer</c>, <c>mx_bank_account</c>,
/// <c>mx_bank_transfer</c>, <c>us_bank_account</c>, or <c>us_bank_transfer</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
11 changes: 7 additions & 4 deletions src/Stripe.net/Entities/PaymentMethods/PaymentMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public Customer Customer
internal ExpandableField<Customer> InternalCustomer { get; set; }
#endregion

[JsonProperty("customer_balance")]
public PaymentMethodCustomerBalance CustomerBalance { get; set; }

[JsonProperty("eps")]
public PaymentMethodEps Eps { get; set; }

Expand Down Expand Up @@ -160,10 +163,10 @@ public Customer Customer
/// PaymentMethod type.
/// One of: <c>acss_debit</c>, <c>afterpay_clearpay</c>, <c>alipay</c>,
/// <c>au_becs_debit</c>, <c>bacs_debit</c>, <c>bancontact</c>, <c>boleto</c>, <c>card</c>,
/// <c>card_present</c>, <c>eps</c>, <c>fpx</c>, <c>giropay</c>, <c>grabpay</c>,
/// <c>ideal</c>, <c>interac_present</c>, <c>klarna</c>, <c>konbini</c>, <c>oxxo</c>,
/// <c>p24</c>, <c>paynow</c>, <c>sepa_debit</c>, <c>sofort</c>, <c>us_bank_account</c>, or
/// <c>wechat_pay</c>.
/// <c>card_present</c>, <c>customer_balance</c>, <c>eps</c>, <c>fpx</c>, <c>giropay</c>,
/// <c>grabpay</c>, <c>ideal</c>, <c>interac_present</c>, <c>klarna</c>, <c>konbini</c>,
/// <c>oxxo</c>, <c>p24</c>, <c>paynow</c>, <c>sepa_debit</c>, <c>sofort</c>,
/// <c>us_bank_account</c>, or <c>wechat_pay</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
Expand Down
Loading