From 1e629ea14ff108255606c38e896d70ca1400daab Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 00:29:20 -0700 Subject: [PATCH 01/11] Update generated code (#3159) * Update generated code for v1882 and 2025-07-30.basil * Update generated code for v1929 and 2025-08-27.basil * Update generated code for v1930 and 2025-08-27.basil * Update generated code for v1931 and 2025-08-27.basil * Update generated code for v1932 and 2025-08-27.basil --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- API_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/Stripe.net/Constants/ApiVersion.cs | 2 +- src/Stripe.net/Constants/FilePurpose.cs | 2 + .../AccountSessionComponents.cs | 18 +++ .../AccountSessionComponentsBalanceReport.cs | 26 +++++ ...tSessionComponentsBalanceReportFeatures.cs | 7 ++ .../AccountSessionComponentsPayoutDetails.cs | 26 +++++ ...tSessionComponentsPayoutDetailsFeatures.cs | 7 ++ ...ionComponentsPayoutReconciliationReport.cs | 26 +++++ ...nentsPayoutReconciliationReportFeatures.cs | 7 ++ .../AccountCompanyVerificationDocument.cs | 12 +- src/Stripe.net/Entities/Balances/Balance.cs | 13 +-- .../Entities/Billing/Meters/Meter.cs | 2 +- .../Configurations/Configuration.cs | 9 ++ .../Entities/Charges/ChargeOutcome.cs | 9 +- .../Charges/ChargePaymentMethodDetailsAlma.cs | 19 ++++ ...rgePaymentMethodDetailsAlmaInstallments.cs | 20 ++++ .../ChargePaymentMethodDetailsAmazonPay.cs | 9 ++ .../ChargePaymentMethodDetailsBillie.cs | 13 +++ .../ChargePaymentMethodDetailsKakaoPay.cs | 9 ++ .../ChargePaymentMethodDetailsKrCard.cs | 9 ++ .../ChargePaymentMethodDetailsNaverPay.cs | 9 ++ .../ChargePaymentMethodDetailsPayco.cs | 9 ++ .../ChargePaymentMethodDetailsPaynow.cs | 20 ++++ .../ChargePaymentMethodDetailsRevolutPay.cs | 9 ++ .../ChargePaymentMethodDetailsSamsungPay.cs | 9 ++ .../ChargePaymentMethodDetailsSatispay.cs | 13 +++ .../Sessions/SessionAdaptivePricing.cs | 4 +- .../SessionPaymentMethodOptionsPix.cs | 10 ++ src/Stripe.net/Entities/Disputes/Dispute.cs | 4 +- .../DisputePaymentMethodDetailsCard.cs | 3 +- src/Stripe.net/Entities/Files/File.cs | 3 +- .../Entities/PaymentIntents/PaymentIntent.cs | 19 ++++ .../PaymentIntentPaymentMethodOptionsPix.cs | 10 ++ src/Stripe.net/Entities/Payouts/Payout.cs | 9 ++ .../Entities/PromotionCodes/PromotionCode.cs | 10 +- ...SubscriptionSchedulePhaseAddInvoiceItem.cs | 19 +++- ...iptionSchedulePhaseAddInvoiceItemPeriod.cs | 23 ++++ ...ionSchedulePhaseAddInvoiceItemPeriodEnd.cs | 35 ++++++ ...nSchedulePhaseAddInvoiceItemPeriodStart.cs | 35 ++++++ .../Configurations/ConfigurationTipping.cs | 6 + .../Configurations/ConfigurationTippingMxn.cs | 40 +++++++ ...nComponentsBalanceReportFeaturesOptions.cs | 7 ++ ...ntSessionComponentsBalanceReportOptions.cs | 29 +++++ ...ccountSessionComponentsDocumentsOptions.cs | 2 +- .../AccountSessionComponentsOptions.cs | 33 ++++++ ...nComponentsPayoutDetailsFeaturesOptions.cs | 7 ++ ...ntSessionComponentsPayoutDetailsOptions.cs | 29 +++++ ...youtReconciliationReportFeaturesOptions.cs | 7 ++ ...onentsPayoutReconciliationReportOptions.cs | 29 +++++ ...ountSessionComponentsPayoutsListOptions.cs | 2 +- ...essionComponentsTaxRegistrationsOptions.cs | 2 +- ...ountSessionComponentsTaxSettingsOptions.cs | 2 +- .../Billing/Meters/MeterCreateOptions.cs | 2 +- .../ConfigurationCreateOptions.cs | 9 ++ .../ConfigurationUpdateOptions.cs | 9 ++ .../Sessions/SessionAdaptivePricingOptions.cs | 6 +- .../Checkout/Sessions/SessionCreateOptions.cs | 4 +- .../SessionPaymentMethodOptionsPixOptions.cs | 10 ++ .../CreditNotePreviewLinesRefundOptions.cs | 3 +- .../CreditNotes/CreditNoteRefundOptions.cs | 3 +- .../Services/Customers/CustomerService.cs | 18 +-- .../FileLinks/FileLinkCreateOptions.cs | 3 +- .../Services/Files/FileCreateOptions.cs | 2 +- .../Services/Files/FileFileLinkDataOptions.cs | 3 +- .../Services/Files/FileListOptions.cs | 3 +- ...heduleDetailsPhaseAddInvoiceItemOptions.cs | 24 +++- ...ailsPhaseAddInvoiceItemPeriodEndOptions.cs | 35 ++++++ ...DetailsPhaseAddInvoiceItemPeriodOptions.cs | 29 +++++ ...lsPhaseAddInvoiceItemPeriodStartOptions.cs | 35 ++++++ .../Issuing/Cards/CardCreateOptions.cs | 22 ++++ .../PaymentIntentCreateOptions.cs | 19 ++++ ...entIntentPaymentMethodOptionsPixOptions.cs | 10 ++ .../PaymentLinkLineItemOptions.cs | 3 +- .../Services/Payouts/PayoutCreateOptions.cs | 9 ++ .../Services/Quotes/QuoteService.cs | 6 +- ...ptionSchedulePhaseAddInvoiceItemOptions.cs | 24 +++- ...dulePhaseAddInvoiceItemPeriodEndOptions.cs | 35 ++++++ ...chedulePhaseAddInvoiceItemPeriodOptions.cs | 29 +++++ ...lePhaseAddInvoiceItemPeriodStartOptions.cs | 35 ++++++ .../SubscriptionAddInvoiceItemOptions.cs | 24 +++- ...scriptionAddInvoiceItemPeriodEndOptions.cs | 35 ++++++ ...SubscriptionAddInvoiceItemPeriodOptions.cs | 29 +++++ ...riptionAddInvoiceItemPeriodStartOptions.cs | 35 ++++++ ...criptionBillingCycleAnchorConfigOptions.cs | 10 +- .../Subscriptions/SubscriptionListOptions.cs | 7 +- .../ConfigurationTippingMxnOptions.cs | 40 +++++++ .../ConfigurationTippingOptions.cs | 9 ++ .../Terminal/Readers/ReaderCardOptions.cs | 47 ++++++++ .../ReaderPresentPaymentMethodOptions.cs | 11 +- src/Stripe.net/Services/V1Services.cs | 24 ++-- src/Stripe.net/Services/V2/BillingService.cs | 8 +- src/Stripe.net/Services/V2/CoreService.cs | 6 +- .../WebhookEndpointCreateOptions.cs | 2 +- .../Services/GeneratedExamplesTest.cs | 104 +++++++++--------- 96 files changed, 1336 insertions(+), 142 deletions(-) create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReport.cs create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReportFeatures.cs create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetails.cs create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetailsFeatures.cs create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReport.cs create mode 100644 src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeatures.cs create mode 100644 src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlmaInstallments.cs create mode 100644 src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriod.cs create mode 100644 src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd.cs create mode 100644 src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStart.cs create mode 100644 src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTippingMxn.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportFeaturesOptions.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportOptions.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsFeaturesOptions.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsOptions.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeaturesOptions.cs create mode 100644 src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportOptions.cs create mode 100644 src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions.cs create mode 100644 src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions.cs create mode 100644 src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions.cs create mode 100644 src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions.cs create mode 100644 src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions.cs create mode 100644 src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions.cs create mode 100644 src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodEndOptions.cs create mode 100644 src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodOptions.cs create mode 100644 src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodStartOptions.cs create mode 100644 src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingMxnOptions.cs create mode 100644 src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderCardOptions.cs diff --git a/API_VERSION b/API_VERSION index 40f35337b3..0336d6a3a5 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2025-07-30.basil \ No newline at end of file +2025-08-27.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7b0334ddc0..6598803dc3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1868 \ No newline at end of file +v1932 \ No newline at end of file diff --git a/src/Stripe.net/Constants/ApiVersion.cs b/src/Stripe.net/Constants/ApiVersion.cs index d899fe44b3..49478b1b3e 100644 --- a/src/Stripe.net/Constants/ApiVersion.cs +++ b/src/Stripe.net/Constants/ApiVersion.cs @@ -3,7 +3,7 @@ namespace Stripe { internal class ApiVersion { - public const string Current = "2025-07-30.basil"; + public const string Current = "2025-08-27.basil"; public const string CurrentMajor = "basil"; } } \ No newline at end of file diff --git a/src/Stripe.net/Constants/FilePurpose.cs b/src/Stripe.net/Constants/FilePurpose.cs index df31d44b43..b1d8112359 100644 --- a/src/Stripe.net/Constants/FilePurpose.cs +++ b/src/Stripe.net/Constants/FilePurpose.cs @@ -35,6 +35,8 @@ public static class FilePurpose public const string TaxDocumentUserUpload = "tax_document_user_upload"; + public const string TerminalAndroidApk = "terminal_android_apk"; + public const string TerminalReaderSplashscreen = "terminal_reader_splashscreen"; } } \ No newline at end of file diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponents.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponents.cs index b1f4b91166..b5f2d31060 100644 --- a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponents.cs +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponents.cs @@ -20,6 +20,12 @@ public class AccountSessionComponents : StripeEntity #endif public AccountSessionComponentsAccountOnboarding AccountOnboarding { get; set; } + [JsonProperty("balance_report")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("balance_report")] +#endif + public AccountSessionComponentsBalanceReport BalanceReport { get; set; } + [JsonProperty("balances")] #if NET6_0_OR_GREATER [STJS.JsonPropertyName("balances")] @@ -92,6 +98,18 @@ public class AccountSessionComponents : StripeEntity #endif public AccountSessionComponentsPayments Payments { get; set; } + [JsonProperty("payout_details")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_details")] +#endif + public AccountSessionComponentsPayoutDetails PayoutDetails { get; set; } + + [JsonProperty("payout_reconciliation_report")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_reconciliation_report")] +#endif + public AccountSessionComponentsPayoutReconciliationReport PayoutReconciliationReport { get; set; } + [JsonProperty("payouts")] #if NET6_0_OR_GREATER [STJS.JsonPropertyName("payouts")] diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReport.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReport.cs new file mode 100644 index 0000000000..dfd3cefb3a --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReport.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsBalanceReport : StripeEntity + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool Enabled { get; set; } + + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsBalanceReportFeatures Features { get; set; } + } +} diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReportFeatures.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReportFeatures.cs new file mode 100644 index 0000000000..1ace6d88aa --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsBalanceReportFeatures.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsBalanceReportFeatures : StripeEntity + { + } +} diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetails.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetails.cs new file mode 100644 index 0000000000..e93874bd34 --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetails.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsPayoutDetails : StripeEntity + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool Enabled { get; set; } + + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsPayoutDetailsFeatures Features { get; set; } + } +} diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetailsFeatures.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetailsFeatures.cs new file mode 100644 index 0000000000..3ae434044e --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutDetailsFeatures.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsPayoutDetailsFeatures : StripeEntity + { + } +} diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReport.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReport.cs new file mode 100644 index 0000000000..260ba59a52 --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReport.cs @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsPayoutReconciliationReport : StripeEntity + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool Enabled { get; set; } + + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsPayoutReconciliationReportFeatures Features { get; set; } + } +} diff --git a/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeatures.cs b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeatures.cs new file mode 100644 index 0000000000..d179a39aac --- /dev/null +++ b/src/Stripe.net/Entities/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeatures.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsPayoutReconciliationReportFeatures : StripeEntity + { + } +} diff --git a/src/Stripe.net/Entities/Accounts/AccountCompanyVerificationDocument.cs b/src/Stripe.net/Entities/Accounts/AccountCompanyVerificationDocument.cs index a86823f0e1..bb9248b75e 100644 --- a/src/Stripe.net/Entities/Accounts/AccountCompanyVerificationDocument.cs +++ b/src/Stripe.net/Entities/Accounts/AccountCompanyVerificationDocument.cs @@ -18,7 +18,8 @@ public class AccountCompanyVerificationDocument : StripeEntityfile upload with a purpose - /// value of additional_verification. + /// value of additional_verification. Note that additional_verification files + /// are not downloadable. /// [JsonIgnore] #if NET6_0_OR_GREATER @@ -34,7 +35,8 @@ public string BackId /// (Expanded) /// The back of a document returned by a file upload with a purpose - /// value of additional_verification. + /// value of additional_verification. Note that additional_verification files + /// are not downloadable. /// /// For more information, see the expand documentation. /// @@ -87,7 +89,8 @@ public File Back /// (ID of the File) /// The front of a document returned by a file upload with a purpose - /// value of additional_verification. + /// value of additional_verification. Note that additional_verification files + /// are not downloadable. /// [JsonIgnore] #if NET6_0_OR_GREATER @@ -103,7 +106,8 @@ public string FrontId /// (Expanded) /// The front of a document returned by a file upload with a purpose - /// value of additional_verification. + /// value of additional_verification. Note that additional_verification files + /// are not downloadable. /// /// For more information, see the expand documentation. /// diff --git a/src/Stripe.net/Entities/Balances/Balance.cs b/src/Stripe.net/Entities/Balances/Balance.cs index cf8d837827..d1d17d87f8 100644 --- a/src/Stripe.net/Entities/Balances/Balance.cs +++ b/src/Stripe.net/Entities/Balances/Balance.cs @@ -11,15 +11,12 @@ namespace Stripe /// This is an object representing your Stripe balance. You can retrieve it to see the /// balance currently on your Stripe account. /// - /// You can also retrieve the balance history, which contains a list of transactions that - /// contributed to the balance (charges, payouts, and so forth). + /// The top-level available and pending comprise your "payments balance.". /// - /// The available and pending amounts for each currency are broken down further by payment - /// source types. - /// - /// Related guide: Understanding - /// Connect account balances. + /// Related guide: Balances and + /// settlement time, Understanding Connect account + /// balances. /// public class Balance : StripeEntity, IHasObject { diff --git a/src/Stripe.net/Entities/Billing/Meters/Meter.cs b/src/Stripe.net/Entities/Billing/Meters/Meter.cs index 8d640b5319..8d2eb2755f 100644 --- a/src/Stripe.net/Entities/Billing/Meters/Meter.cs +++ b/src/Stripe.net/Entities/Billing/Meters/Meter.cs @@ -79,7 +79,7 @@ public class Meter : StripeEntity, IHasId, IHasObject public string EventName { get; set; } /// - /// The time window to pre-aggregate meter events for, if any. + /// The time window which meter events have been pre-aggregated for, if any. /// One of: day, or hour. /// [JsonProperty("event_time_window")] diff --git a/src/Stripe.net/Entities/BillingPortal/Configurations/Configuration.cs b/src/Stripe.net/Entities/BillingPortal/Configurations/Configuration.cs index 11a75ce89e..cf7986ff93 100644 --- a/src/Stripe.net/Entities/BillingPortal/Configurations/Configuration.cs +++ b/src/Stripe.net/Entities/BillingPortal/Configurations/Configuration.cs @@ -158,6 +158,15 @@ public Application Application #endif public Dictionary Metadata { get; set; } + /// + /// The name of the configuration. + /// + [JsonProperty("name")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("name")] +#endif + public string Name { get; set; } + /// /// Time at which the object was last updated. Measured in seconds since the Unix epoch. /// diff --git a/src/Stripe.net/Entities/Charges/ChargeOutcome.cs b/src/Stripe.net/Entities/Charges/ChargeOutcome.cs index d0b3451eb0..1f7ed3184e 100644 --- a/src/Stripe.net/Entities/Charges/ChargeOutcome.cs +++ b/src/Stripe.net/Entities/Charges/ChargeOutcome.cs @@ -35,8 +35,8 @@ public class ChargeOutcome : StripeEntity public string NetworkAdviceCode { get; set; } /// - /// For charges declined by the network, a brand specific 2, 3, or 4 digit code which - /// indicates the reason the authorization failed. + /// For charges declined by the network, an alphanumeric code which indicates the reason the + /// charge failed. /// [JsonProperty("network_decline_code")] #if NET6_0_OR_GREATER @@ -61,8 +61,9 @@ public class ChargeOutcome : StripeEntity /// An enumerated value providing a more detailed explanation of the outcome's type. /// Charges blocked by Radar's default block rule have the value highest_risk_level. /// Charges placed in review by Radar's default review rule have the value - /// elevated_risk_level. Charges authorized, blocked, or placed in review by custom - /// rules have the value rule. See elevated_risk_level. Charges blocked because the payment is unlikely to be + /// authorized have the value low_probability_of_authorization. Charges authorized, + /// blocked, or placed in review by custom rules have the value rule. See understanding declines for more details. /// [JsonProperty("reason")] diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlma.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlma.cs index d7e257bbc7..38dbfe3fb1 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlma.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlma.cs @@ -1,7 +1,26 @@ // File generated from our OpenAPI spec namespace Stripe { + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + public class ChargePaymentMethodDetailsAlma : StripeEntity { + [JsonProperty("installments")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("installments")] +#endif + public ChargePaymentMethodDetailsAlmaInstallments Installments { get; set; } + + /// + /// The Alma transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlmaInstallments.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlmaInstallments.cs new file mode 100644 index 0000000000..496d195b34 --- /dev/null +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAlmaInstallments.cs @@ -0,0 +1,20 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class ChargePaymentMethodDetailsAlmaInstallments : StripeEntity + { + /// + /// The number of installments. + /// + [JsonProperty("count")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("count")] +#endif + public long Count { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAmazonPay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAmazonPay.cs index faab6a0dcb..6f8f56a447 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAmazonPay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsAmazonPay.cs @@ -13,5 +13,14 @@ public class ChargePaymentMethodDetailsAmazonPay : StripeEntity + /// The Amazon Pay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsBillie.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsBillie.cs index 94bcfb8171..9f76cbbc7e 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsBillie.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsBillie.cs @@ -1,7 +1,20 @@ // File generated from our OpenAPI spec namespace Stripe { + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + public class ChargePaymentMethodDetailsBillie : StripeEntity { + /// + /// The Billie transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKakaoPay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKakaoPay.cs index fde5ed76b8..e2cbde5067 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKakaoPay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKakaoPay.cs @@ -16,5 +16,14 @@ public class ChargePaymentMethodDetailsKakaoPay : StripeEntity + /// The Kakao Pay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKrCard.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKrCard.cs index 2f2fcb044a..7e5cc37126 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKrCard.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsKrCard.cs @@ -39,5 +39,14 @@ public class ChargePaymentMethodDetailsKrCard : StripeEntity + /// The Korean Card transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsNaverPay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsNaverPay.cs index 83b7f8372a..0cb28e2725 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsNaverPay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsNaverPay.cs @@ -16,5 +16,14 @@ public class ChargePaymentMethodDetailsNaverPay : StripeEntity + /// The Naver Pay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPayco.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPayco.cs index e76f1c75e9..9d0f02218d 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPayco.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPayco.cs @@ -16,5 +16,14 @@ public class ChargePaymentMethodDetailsPayco : StripeEntity + /// The Payco transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPaynow.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPaynow.cs index 74030d104f..554c105c36 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPaynow.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsPaynow.cs @@ -8,6 +8,26 @@ namespace Stripe public class ChargePaymentMethodDetailsPaynow : StripeEntity { + /// + /// ID of the location that + /// this transaction's reader is assigned to. + /// + [JsonProperty("location")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("location")] +#endif + public string Location { get; set; } + + /// + /// ID of the reader this + /// transaction was made on. + /// + [JsonProperty("reader")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("reader")] +#endif + public string Reader { get; set; } + /// /// Reference number associated with this PayNow payment. /// diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsRevolutPay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsRevolutPay.cs index 5a8958f33f..1fef46858e 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsRevolutPay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsRevolutPay.cs @@ -13,5 +13,14 @@ public class ChargePaymentMethodDetailsRevolutPay : StripeEntity + /// The Revolut Pay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSamsungPay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSamsungPay.cs index 772423c996..b70518aa73 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSamsungPay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSamsungPay.cs @@ -16,5 +16,14 @@ public class ChargePaymentMethodDetailsSamsungPay : StripeEntity + /// The Samsung Pay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSatispay.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSatispay.cs index c183fea85b..f8e052fa9d 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSatispay.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsSatispay.cs @@ -1,7 +1,20 @@ // File generated from our OpenAPI spec namespace Stripe { + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + public class ChargePaymentMethodDetailsSatispay : StripeEntity { + /// + /// The Satispay transaction ID associated with this payment. + /// + [JsonProperty("transaction_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_id")] +#endif + public string TransactionId { get; set; } } } diff --git a/src/Stripe.net/Entities/Checkout/Sessions/SessionAdaptivePricing.cs b/src/Stripe.net/Entities/Checkout/Sessions/SessionAdaptivePricing.cs index 99897344a0..99f23e2db4 100644 --- a/src/Stripe.net/Entities/Checkout/Sessions/SessionAdaptivePricing.cs +++ b/src/Stripe.net/Entities/Checkout/Sessions/SessionAdaptivePricing.cs @@ -9,7 +9,9 @@ namespace Stripe.Checkout public class SessionAdaptivePricing : StripeEntity { /// - /// Whether Adaptive Pricing is enabled. + /// If enabled, Adaptive Pricing is available on eligible + /// sessions. /// [JsonProperty("enabled")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/Checkout/Sessions/SessionPaymentMethodOptionsPix.cs b/src/Stripe.net/Entities/Checkout/Sessions/SessionPaymentMethodOptionsPix.cs index 2e3c8610bc..2c23c48051 100644 --- a/src/Stripe.net/Entities/Checkout/Sessions/SessionPaymentMethodOptionsPix.cs +++ b/src/Stripe.net/Entities/Checkout/Sessions/SessionPaymentMethodOptionsPix.cs @@ -8,6 +8,16 @@ namespace Stripe.Checkout public class SessionPaymentMethodOptionsPix : StripeEntity { + /// + /// Determines if the amount includes the IOF tax. + /// One of: always, or never. + /// + [JsonProperty("amount_includes_iof")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("amount_includes_iof")] +#endif + public string AmountIncludesIof { get; set; } + /// /// The number of seconds after which Pix payment will expire. /// diff --git a/src/Stripe.net/Entities/Disputes/Dispute.cs b/src/Stripe.net/Entities/Disputes/Dispute.cs index e5cc784335..9cf6a18fa4 100644 --- a/src/Stripe.net/Entities/Disputes/Dispute.cs +++ b/src/Stripe.net/Entities/Disputes/Dispute.cs @@ -248,9 +248,9 @@ public PaymentIntent PaymentIntent public string Reason { get; set; } /// - /// Current status of dispute. Possible values are warning_needs_response, + /// The current status of a dispute. Possible values include:warning_needs_response, /// warning_under_review, warning_closed, needs_response, - /// under_review, won, or lost. + /// under_review, won, lost, or prevented. /// One of: lost, needs_response, under_review, warning_closed, /// warning_needs_response, warning_under_review, or won. /// diff --git a/src/Stripe.net/Entities/Disputes/DisputePaymentMethodDetailsCard.cs b/src/Stripe.net/Entities/Disputes/DisputePaymentMethodDetailsCard.cs index 819aaffacf..5f233b62ef 100644 --- a/src/Stripe.net/Entities/Disputes/DisputePaymentMethodDetailsCard.cs +++ b/src/Stripe.net/Entities/Disputes/DisputePaymentMethodDetailsCard.cs @@ -22,7 +22,8 @@ public class DisputePaymentMethodDetailsCard : StripeEntity /// The type of dispute opened. Different case types may have varying fees and financial /// impact. - /// One of: chargeback, compliance, or inquiry. + /// One of: block, chargeback, compliance, inquiry, or + /// resolution. /// [JsonProperty("case_type")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/Files/File.cs b/src/Stripe.net/Entities/Files/File.cs index 55f81c6ff7..2e4d276c08 100644 --- a/src/Stripe.net/Entities/Files/File.cs +++ b/src/Stripe.net/Entities/Files/File.cs @@ -87,7 +87,8 @@ public class File : StripeEntity, IHasId, IHasObject /// finance_report_run, financial_account_statement, identity_document, /// identity_document_downloadable, issuing_regulatory_reporting, /// pci_document, selfie, sigma_scheduled_query, - /// tax_document_user_upload, or terminal_reader_splashscreen. + /// tax_document_user_upload, terminal_android_apk, or + /// terminal_reader_splashscreen. /// [JsonProperty("purpose")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs index 215c16a04f..8a84c45382 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs @@ -311,6 +311,25 @@ public Customer Customer #endif public string Description { get; set; } + /// + /// The list of payment method types to exclude from use with this payment. + /// One of: acss_debit, affirm, afterpay_clearpay, alipay, + /// alma, amazon_pay, au_becs_debit, bacs_debit, + /// bancontact, billie, blik, boleto, card, + /// cashapp, crypto, customer_balance, eps, fpx, + /// giropay, grabpay, ideal, kakao_pay, klarna, + /// konbini, kr_card, mobilepay, multibanco, naver_pay, + /// nz_bank_account, oxxo, p24, pay_by_bank, payco, + /// paynow, paypal, pix, promptpay, revolut_pay, + /// samsung_pay, satispay, sepa_debit, sofort, swish, + /// twint, us_bank_account, wechat_pay, or zip. + /// + [JsonProperty("excluded_payment_method_types")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("excluded_payment_method_types")] +#endif + public List ExcludedPaymentMethodTypes { get; set; } + /// /// The payment error encountered in the previous PaymentIntent confirmation. It will be /// cleared if the PaymentIntent is later updated for any reason. diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsPix.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsPix.cs index 5f5d66e9e4..e4db6ca7d4 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsPix.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsPix.cs @@ -10,6 +10,16 @@ namespace Stripe public class PaymentIntentPaymentMethodOptionsPix : StripeEntity { + /// + /// Determines if the amount includes the IOF tax. + /// One of: always, or never. + /// + [JsonProperty("amount_includes_iof")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("amount_includes_iof")] +#endif + public string AmountIncludesIof { get; set; } + /// /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. /// diff --git a/src/Stripe.net/Entities/Payouts/Payout.cs b/src/Stripe.net/Entities/Payouts/Payout.cs index 62620f3a5e..a8c59bec2f 100644 --- a/src/Stripe.net/Entities/Payouts/Payout.cs +++ b/src/Stripe.net/Entities/Payouts/Payout.cs @@ -386,6 +386,15 @@ public Payout OriginalPayout internal ExpandableField InternalOriginalPayout { get; set; } #endregion + /// + /// ID of the v2 FinancialAccount the funds are sent to. + /// + [JsonProperty("payout_method")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_method")] +#endif + public string PayoutMethod { get; set; } + /// /// If completed, you can use the Balance diff --git a/src/Stripe.net/Entities/PromotionCodes/PromotionCode.cs b/src/Stripe.net/Entities/PromotionCodes/PromotionCode.cs index 193fa0de69..f94deb077a 100644 --- a/src/Stripe.net/Entities/PromotionCodes/PromotionCode.cs +++ b/src/Stripe.net/Entities/PromotionCodes/PromotionCode.cs @@ -11,8 +11,14 @@ namespace Stripe /// /// A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create multiple - /// codes for a single coupon. + /// href="https://stripe.com/docs/api#coupons">coupon. You can create multiple codes for + /// a single coupon. + /// + /// If you enable promotion codes in your customer portal + /// configuration, then customers can redeem a code themselves when updating a + /// subscription in the portal. Customers can also view the currently active promotion codes + /// and coupons on each of their subscriptions in the portal. /// #if NET6_0_OR_GREATER [STJS.JsonConverter(typeof(STJMemberSerializationOptIn))] diff --git a/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItem.cs b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItem.cs index c8c9a7d2b9..16ec2b348e 100644 --- a/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItem.cs +++ b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItem.cs @@ -11,7 +11,7 @@ namespace Stripe #if NET6_0_OR_GREATER [STJS.JsonConverter(typeof(STJMemberSerializationOptIn))] #endif - public class SubscriptionSchedulePhaseAddInvoiceItem : StripeEntity + public class SubscriptionSchedulePhaseAddInvoiceItem : StripeEntity, IHasMetadata { /// /// The stackable discounts that will be applied to the item. @@ -22,6 +22,23 @@ public class SubscriptionSchedulePhaseAddInvoiceItem : StripeEntity Discounts { get; set; } + /// + /// Set of key-value pairs that you can + /// attach to an object. This can be useful for storing additional information about the + /// object in a structured format. + /// + [JsonProperty("metadata")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("metadata")] +#endif + public Dictionary Metadata { get; set; } + + [JsonProperty("period")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("period")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriod Period { get; set; } + #region Expandable Price /// diff --git a/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriod.cs b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriod.cs new file mode 100644 index 0000000000..3c82de505c --- /dev/null +++ b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriod.cs @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriod : StripeEntity + { + [JsonProperty("end")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("end")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd End { get; set; } + + [JsonProperty("start")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("start")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriodStart Start { get; set; } + } +} diff --git a/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd.cs b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd.cs new file mode 100644 index 0000000000..286b0a01d9 --- /dev/null +++ b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriodEnd : StripeEntity + { + /// + /// A precise Unix timestamp for the end of the invoice item period. Must be greater than or + /// equal to period.start. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Select how to calculate the end of the invoice item period. + /// One of: min_item_period_end, phase_end, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStart.cs b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStart.cs new file mode 100644 index 0000000000..e8a87285cd --- /dev/null +++ b/src/Stripe.net/Entities/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStart.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriodStart : StripeEntity + { + /// + /// A precise Unix timestamp for the start of the invoice item period. Must be less than or + /// equal to period.end. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime Timestamp { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Select how to calculate the start of the invoice item period. + /// One of: max_item_period_start, phase_start, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTipping.cs b/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTipping.cs index 9384a1509e..f4a9596b30 100644 --- a/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTipping.cs +++ b/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTipping.cs @@ -80,6 +80,12 @@ public class ConfigurationTipping : StripeEntity #endif public ConfigurationTippingJpy Jpy { get; set; } + [JsonProperty("mxn")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("mxn")] +#endif + public ConfigurationTippingMxn Mxn { get; set; } + [JsonProperty("myr")] #if NET6_0_OR_GREATER [STJS.JsonPropertyName("myr")] diff --git a/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTippingMxn.cs b/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTippingMxn.cs new file mode 100644 index 0000000000..f04bfc403b --- /dev/null +++ b/src/Stripe.net/Entities/Terminal/Configurations/ConfigurationTippingMxn.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.Terminal +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class ConfigurationTippingMxn : StripeEntity + { + /// + /// Fixed amounts displayed when collecting a tip. + /// + [JsonProperty("fixed_amounts")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("fixed_amounts")] +#endif + public List FixedAmounts { get; set; } + + /// + /// Percentages displayed when collecting a tip. + /// + [JsonProperty("percentages")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("percentages")] +#endif + public List Percentages { get; set; } + + /// + /// Below this amount, fixed amounts will be displayed; above it, percentages will be + /// displayed. + /// + [JsonProperty("smart_tip_threshold")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("smart_tip_threshold")] +#endif + public long SmartTipThreshold { get; set; } + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportFeaturesOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportFeaturesOptions.cs new file mode 100644 index 0000000000..50d38a5e87 --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportFeaturesOptions.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsBalanceReportFeaturesOptions : INestedOptions + { + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportOptions.cs new file mode 100644 index 0000000000..d7478a52ed --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsBalanceReportOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsBalanceReportOptions : INestedOptions + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool? Enabled { get; set; } + + /// + /// An empty list, because this embedded component has no features. + /// + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsBalanceReportFeaturesOptions Features { get; set; } + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsDocumentsOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsDocumentsOptions.cs index af0e67ede5..e282e9bc36 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsDocumentsOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsDocumentsOptions.cs @@ -18,7 +18,7 @@ public class AccountSessionComponentsDocumentsOptions : INestedOptions public bool? Enabled { get; set; } /// - /// The list of features enabled in the embedded component. + /// An empty list, because this embedded component has no features. /// [JsonProperty("features")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsOptions.cs index e3e24b6a0f..4ca19356aa 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsOptions.cs @@ -30,6 +30,17 @@ public class AccountSessionComponentsOptions : INestedOptions #endif public AccountSessionComponentsAccountOnboardingOptions AccountOnboarding { get; set; } + /// + /// Configuration for the balance + /// report embedded component. + /// + [JsonProperty("balance_report")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("balance_report")] +#endif + public AccountSessionComponentsBalanceReportOptions BalanceReport { get; set; } + /// /// Configuration for the balances @@ -162,6 +173,28 @@ public class AccountSessionComponentsOptions : INestedOptions #endif public AccountSessionComponentsPaymentsOptions Payments { get; set; } + /// + /// Configuration for the payout + /// details embedded component. + /// + [JsonProperty("payout_details")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_details")] +#endif + public AccountSessionComponentsPayoutDetailsOptions PayoutDetails { get; set; } + + /// + /// Configuration for the payout + /// reconciliation report embedded component. + /// + [JsonProperty("payout_reconciliation_report")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_reconciliation_report")] +#endif + public AccountSessionComponentsPayoutReconciliationReportOptions PayoutReconciliationReport { get; set; } + /// /// Configuration for the payouts diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsFeaturesOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsFeaturesOptions.cs new file mode 100644 index 0000000000..3b4c8b331d --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsFeaturesOptions.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsPayoutDetailsFeaturesOptions : INestedOptions + { + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsOptions.cs new file mode 100644 index 0000000000..d3d1a34142 --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutDetailsOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsPayoutDetailsOptions : INestedOptions + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool? Enabled { get; set; } + + /// + /// An empty list, because this embedded component has no features. + /// + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsPayoutDetailsFeaturesOptions Features { get; set; } + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeaturesOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeaturesOptions.cs new file mode 100644 index 0000000000..fd0344837f --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportFeaturesOptions.cs @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + public class AccountSessionComponentsPayoutReconciliationReportFeaturesOptions : INestedOptions + { + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportOptions.cs new file mode 100644 index 0000000000..98afcc79eb --- /dev/null +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutReconciliationReportOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class AccountSessionComponentsPayoutReconciliationReportOptions : INestedOptions + { + /// + /// Whether the embedded component is enabled. + /// + [JsonProperty("enabled")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("enabled")] +#endif + public bool? Enabled { get; set; } + + /// + /// An empty list, because this embedded component has no features. + /// + [JsonProperty("features")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("features")] +#endif + public AccountSessionComponentsPayoutReconciliationReportFeaturesOptions Features { get; set; } + } +} diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutsListOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutsListOptions.cs index 73501338ba..e028dae59b 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutsListOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsPayoutsListOptions.cs @@ -18,7 +18,7 @@ public class AccountSessionComponentsPayoutsListOptions : INestedOptions public bool? Enabled { get; set; } /// - /// The list of features enabled in the embedded component. + /// An empty list, because this embedded component has no features. /// [JsonProperty("features")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxRegistrationsOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxRegistrationsOptions.cs index 53dd3eebb4..23af0c8471 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxRegistrationsOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxRegistrationsOptions.cs @@ -18,7 +18,7 @@ public class AccountSessionComponentsTaxRegistrationsOptions : INestedOptions public bool? Enabled { get; set; } /// - /// The list of features enabled in the embedded component. + /// An empty list, because this embedded component has no features. /// [JsonProperty("features")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxSettingsOptions.cs b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxSettingsOptions.cs index 8727d9acb7..2bbe2a021c 100644 --- a/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxSettingsOptions.cs +++ b/src/Stripe.net/Services/AccountSessions/AccountSessionComponentsTaxSettingsOptions.cs @@ -18,7 +18,7 @@ public class AccountSessionComponentsTaxSettingsOptions : INestedOptions public bool? Enabled { get; set; } /// - /// The list of features enabled in the embedded component. + /// An empty list, because this embedded component has no features. /// [JsonProperty("features")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Billing/Meters/MeterCreateOptions.cs b/src/Stripe.net/Services/Billing/Meters/MeterCreateOptions.cs index 3dfe332d7e..c534e9f579 100644 --- a/src/Stripe.net/Services/Billing/Meters/MeterCreateOptions.cs +++ b/src/Stripe.net/Services/Billing/Meters/MeterCreateOptions.cs @@ -46,7 +46,7 @@ public class MeterCreateOptions : BaseOptions public string EventName { get; set; } /// - /// The time window to pre-aggregate meter events for, if any. + /// The time window which meter events have been pre-aggregated for, if any. /// One of: day, or hour. /// [JsonProperty("event_time_window")] diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs index fdfaafd2bf..51fd093d3b 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationCreateOptions.cs @@ -62,5 +62,14 @@ public class ConfigurationCreateOptions : BaseOptions, IHasMetadata [STJS.JsonPropertyName("metadata")] #endif public Dictionary Metadata { get; set; } + + /// + /// The name of the configuration. + /// + [JsonProperty("name")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("name")] +#endif + public string Name { get; set; } } } diff --git a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs index 052f396b30..edb3f09f69 100644 --- a/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs +++ b/src/Stripe.net/Services/BillingPortal/Configurations/ConfigurationUpdateOptions.cs @@ -71,5 +71,14 @@ public class ConfigurationUpdateOptions : BaseOptions, IHasMetadata [STJS.JsonPropertyName("metadata")] #endif public Dictionary Metadata { get; set; } + + /// + /// The name of the configuration. + /// + [JsonProperty("name")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("name")] +#endif + public string Name { get; set; } } } diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionAdaptivePricingOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionAdaptivePricingOptions.cs index bc5c78999b..65ea3f7ce3 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionAdaptivePricingOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionAdaptivePricingOptions.cs @@ -9,9 +9,9 @@ namespace Stripe.Checkout public class SessionAdaptivePricingOptions : INestedOptions { /// - /// Set to true to enable Adaptive Pricing. - /// Defaults to your true, Adaptive Pricing is available on eligible + /// sessions. Defaults to your dashboard setting. /// [JsonProperty("enabled")] diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionCreateOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionCreateOptions.cs index 5c1daec53f..ed0d8f4e77 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionCreateOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionCreateOptions.cs @@ -308,9 +308,7 @@ public class SessionCreateOptions : BaseOptions, IHasMetadata /// /// Where the user is coming from. This informs the optimizations that are applied to the - /// session. For example, a session originating from a mobile app may behave more like a - /// native app, depending on the platform. This parameter is currently not allowed if - /// ui_mode is custom. + /// session. /// One of: mobile_app, or web. /// [JsonProperty("origin_context")] diff --git a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPixOptions.cs b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPixOptions.cs index 57463a126b..923663deb8 100644 --- a/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPixOptions.cs +++ b/src/Stripe.net/Services/Checkout/Sessions/SessionPaymentMethodOptionsPixOptions.cs @@ -8,6 +8,16 @@ namespace Stripe.Checkout public class SessionPaymentMethodOptionsPixOptions : INestedOptions { + /// + /// Determines if the amount includes the IOF tax. Defaults to never. + /// One of: always, or never. + /// + [JsonProperty("amount_includes_iof")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("amount_includes_iof")] +#endif + public string AmountIncludesIof { get; set; } + /// /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. /// Defaults to 86400 seconds. diff --git a/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesRefundOptions.cs b/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesRefundOptions.cs index 8bc0b83449..3af21a62bf 100644 --- a/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesRefundOptions.cs +++ b/src/Stripe.net/Services/CreditNotePreviewLines/CreditNotePreviewLinesRefundOptions.cs @@ -19,7 +19,8 @@ public class CreditNotePreviewLinesRefundOptions : INestedOptions public long? AmountRefunded { get; set; } /// - /// ID of an existing refund to link this credit note to. + /// ID of an existing refund to link this credit note to. Required when type is + /// refund. /// [JsonProperty("refund")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/CreditNotes/CreditNoteRefundOptions.cs b/src/Stripe.net/Services/CreditNotes/CreditNoteRefundOptions.cs index b7ea072cc9..afc64717c3 100644 --- a/src/Stripe.net/Services/CreditNotes/CreditNoteRefundOptions.cs +++ b/src/Stripe.net/Services/CreditNotes/CreditNoteRefundOptions.cs @@ -19,7 +19,8 @@ public class CreditNoteRefundOptions : INestedOptions public long? AmountRefunded { get; set; } /// - /// ID of an existing refund to link this credit note to. + /// ID of an existing refund to link this credit note to. Required when type is + /// refund. /// [JsonProperty("refund")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Customers/CustomerService.cs b/src/Stripe.net/Services/Customers/CustomerService.cs index 51e8d9350d..33262527e7 100644 --- a/src/Stripe.net/Services/Customers/CustomerService.cs +++ b/src/Stripe.net/Services/Customers/CustomerService.cs @@ -16,13 +16,13 @@ public partial class CustomerService : Service, ISearchable, IUpdatable { - private CustomerCashBalanceService cashBalance; private CustomerBalanceTransactionService balanceTransactions; + private CustomerCashBalanceService cashBalance; private CustomerCashBalanceTransactionService cashBalanceTransactions; + private CustomerFundingInstructionsService fundingInstructions; + private CustomerPaymentMethodService paymentMethods; private CustomerPaymentSourceService paymentSources; private CustomerTaxIdService taxIds; - private CustomerPaymentMethodService paymentMethods; - private CustomerFundingInstructionsService fundingInstructions; public CustomerService() { @@ -38,25 +38,25 @@ public CustomerService(IStripeClient client) { } - public virtual CustomerCashBalanceService CashBalance => this.cashBalance ??= new CustomerCashBalanceService( + public virtual CustomerBalanceTransactionService BalanceTransactions => this.balanceTransactions ??= new CustomerBalanceTransactionService( this.Requestor); - public virtual CustomerBalanceTransactionService BalanceTransactions => this.balanceTransactions ??= new CustomerBalanceTransactionService( + public virtual CustomerCashBalanceService CashBalance => this.cashBalance ??= new CustomerCashBalanceService( this.Requestor); public virtual CustomerCashBalanceTransactionService CashBalanceTransactions => this.cashBalanceTransactions ??= new CustomerCashBalanceTransactionService( this.Requestor); - public virtual CustomerPaymentSourceService PaymentSources => this.paymentSources ??= new CustomerPaymentSourceService( + public virtual CustomerFundingInstructionsService FundingInstructions => this.fundingInstructions ??= new CustomerFundingInstructionsService( this.Requestor); - public virtual CustomerTaxIdService TaxIds => this.taxIds ??= new CustomerTaxIdService( + public virtual CustomerPaymentMethodService PaymentMethods => this.paymentMethods ??= new CustomerPaymentMethodService( this.Requestor); - public virtual CustomerPaymentMethodService PaymentMethods => this.paymentMethods ??= new CustomerPaymentMethodService( + public virtual CustomerPaymentSourceService PaymentSources => this.paymentSources ??= new CustomerPaymentSourceService( this.Requestor); - public virtual CustomerFundingInstructionsService FundingInstructions => this.fundingInstructions ??= new CustomerFundingInstructionsService( + public virtual CustomerTaxIdService TaxIds => this.taxIds ??= new CustomerTaxIdService( this.Requestor); /// diff --git a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs index ba83b471ef..7b5790dbbf 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkCreateOptions.cs @@ -28,7 +28,8 @@ public class FileLinkCreateOptions : BaseOptions, IHasMetadata /// dispute_evidence, finance_report_run, financial_account_statement, /// identity_document_downloadable, issuing_regulatory_reporting, /// pci_document, selfie, sigma_scheduled_query, - /// tax_document_user_upload, or terminal_reader_splashscreen. + /// tax_document_user_upload, terminal_android_apk, or + /// terminal_reader_splashscreen. /// [JsonProperty("file")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Files/FileCreateOptions.cs b/src/Stripe.net/Services/Files/FileCreateOptions.cs index 10444aba4b..a252e950b2 100644 --- a/src/Stripe.net/Services/Files/FileCreateOptions.cs +++ b/src/Stripe.net/Services/Files/FileCreateOptions.cs @@ -35,7 +35,7 @@ public class FileCreateOptions : BaseOptions /// One of: account_requirement, additional_verification, /// business_icon, business_logo, customer_signature, /// dispute_evidence, identity_document, issuing_regulatory_reporting, - /// pci_document, tax_document_user_upload, or + /// pci_document, tax_document_user_upload, terminal_android_apk, or /// terminal_reader_splashscreen. /// [JsonProperty("purpose")] diff --git a/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs b/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs index 154425007e..1a57e8f694 100644 --- a/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs +++ b/src/Stripe.net/Services/Files/FileFileLinkDataOptions.cs @@ -16,7 +16,8 @@ public class FileFileLinkDataOptions : INestedOptions, IHasMetadata /// link is only possible when the file's purpose is one of the following: /// business_icon, business_logo, customer_signature, /// dispute_evidence, issuing_regulatory_reporting, pci_document, - /// tax_document_user_upload, or terminal_reader_splashscreen. + /// tax_document_user_upload, terminal_android_apk, or + /// terminal_reader_splashscreen. /// [JsonProperty("create")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Files/FileListOptions.cs b/src/Stripe.net/Services/Files/FileListOptions.cs index cd2b8c0712..a49253fbf2 100644 --- a/src/Stripe.net/Services/Files/FileListOptions.cs +++ b/src/Stripe.net/Services/Files/FileListOptions.cs @@ -30,7 +30,8 @@ public class FileListOptions : ListOptions /// finance_report_run, financial_account_statement, identity_document, /// identity_document_downloadable, issuing_regulatory_reporting, /// pci_document, selfie, sigma_scheduled_query, - /// tax_document_user_upload, or terminal_reader_splashscreen. + /// tax_document_user_upload, terminal_android_apk, or + /// terminal_reader_splashscreen. /// [JsonProperty("purpose")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs index bc121d1008..2887df1fb0 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemOptions.cs @@ -7,7 +7,7 @@ namespace Stripe using STJS = System.Text.Json.Serialization; #endif - public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions + public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata { /// /// The coupons to redeem into discounts for the item. @@ -18,6 +18,28 @@ public class InvoiceScheduleDetailsPhaseAddInvoiceItemOptions : INestedOptions #endif public List Discounts { get; set; } + /// + /// Set of key-value pairs that you can + /// attach to an object. This can be useful for storing additional information about the + /// object in a structured format. Individual keys can be unset by posting an empty value to + /// them. All keys can be unset by posting an empty value to metadata. + /// + [JsonProperty("metadata")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("metadata")] +#endif + public Dictionary Metadata { get; set; } + + /// + /// The period associated with this invoice item. Defaults to the period of the underlying + /// subscription that surrounds the start of the phase. + /// + [JsonProperty("period")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("period")] +#endif + public InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions Period { get; set; } + /// /// The ID of the price object. One of price or price_data is required. /// diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions.cs new file mode 100644 index 0000000000..cfa9b9bc81 --- /dev/null +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the end of the invoice item period. Must be greater than or + /// equal to period.start. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the end of the invoice item period. + /// One of: min_item_period_end, phase_end, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions.cs new file mode 100644 index 0000000000..84f21600da --- /dev/null +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodOptions : INestedOptions + { + /// + /// End of the invoice item period. + /// + [JsonProperty("end")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("end")] +#endif + public InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodEndOptions End { get; set; } + + /// + /// Start of the invoice item period. + /// + [JsonProperty("start")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("start")] +#endif + public InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions Start { get; set; } + } +} diff --git a/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions.cs new file mode 100644 index 0000000000..707b5c5969 --- /dev/null +++ b/src/Stripe.net/Services/Invoices/InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class InvoiceScheduleDetailsPhaseAddInvoiceItemPeriodStartOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the start of the invoice item period. Must be less than or + /// equal to period.end. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the start of the invoice item period. + /// One of: max_item_period_start, phase_start, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs index a8b974942b..159d5db7f0 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardCreateOptions.cs @@ -28,6 +28,28 @@ public class CardCreateOptions : BaseOptions, IHasMetadata #endif public string Currency { get; set; } + /// + /// The desired expiration month (1-12) for this card if specifying + /// a custom expiration date. + /// + [JsonProperty("exp_month")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("exp_month")] +#endif + public long? ExpMonth { get; set; } + + /// + /// The desired 4-digit expiration year for this card if specifying + /// a custom expiration date. + /// + [JsonProperty("exp_year")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("exp_year")] +#endif + public long? ExpYear { get; set; } + /// /// The new financial account ID the card will be associated with. This field allows a card /// to be reassigned to a different financial account. diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs index 212c7dd1d4..367a6bb897 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs @@ -152,6 +152,25 @@ public class PaymentIntentCreateOptions : BaseOptions, IHasMetadata #endif public bool? ErrorOnRequiresAction { get; set; } + /// + /// The list of payment method types to exclude from use with this payment. + /// One of: acss_debit, affirm, afterpay_clearpay, alipay, + /// alma, amazon_pay, au_becs_debit, bacs_debit, + /// bancontact, billie, blik, boleto, card, + /// cashapp, crypto, customer_balance, eps, fpx, + /// giropay, grabpay, ideal, kakao_pay, klarna, + /// konbini, kr_card, mobilepay, multibanco, naver_pay, + /// nz_bank_account, oxxo, p24, pay_by_bank, payco, + /// paynow, paypal, pix, promptpay, revolut_pay, + /// samsung_pay, satispay, sepa_debit, sofort, swish, + /// twint, us_bank_account, wechat_pay, or zip. + /// + [JsonProperty("excluded_payment_method_types")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("excluded_payment_method_types")] +#endif + public List ExcludedPaymentMethodTypes { get; set; } + /// /// ID of the mandate that's used for this payment. This parameter can only be used with confirm=true. diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPixOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPixOptions.cs index 8a56462c5a..7f5556c7c9 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPixOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsPixOptions.cs @@ -10,6 +10,16 @@ namespace Stripe public class PaymentIntentPaymentMethodOptionsPixOptions : INestedOptions { + /// + /// Determines if the amount includes the IOF tax. Defaults to never. + /// One of: always, or never. + /// + [JsonProperty("amount_includes_iof")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("amount_includes_iof")] +#endif + public string AmountIncludesIof { get; set; } + /// /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. /// Defaults to 86400 seconds. diff --git a/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemOptions.cs b/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemOptions.cs index 36418788d0..9d3e22c23a 100644 --- a/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemOptions.cs +++ b/src/Stripe.net/Services/PaymentLinks/PaymentLinkLineItemOptions.cs @@ -29,7 +29,8 @@ public class PaymentLinkLineItemOptions : INestedOptions, IHasId /// /// The ID of the Price or Plan object. + /// href="https://stripe.com/docs/api/plans">Plan object. One of price or + /// price_data is required. /// [JsonProperty("price")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs b/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs index 69b7541130..c67f635aa7 100644 --- a/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs +++ b/src/Stripe.net/Services/Payouts/PayoutCreateOptions.cs @@ -74,6 +74,15 @@ public class PayoutCreateOptions : BaseOptions, IHasMetadata #endif public string Method { get; set; } + /// + /// The ID of a v2 FinancialAccount to send funds to. + /// + [JsonProperty("payout_method")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("payout_method")] +#endif + public string PayoutMethod { get; set; } + /// /// The balance type of your Stripe balance to draw this payout from. Balances for different /// payment sources are kept separately. You can find the amounts with the Balances API. One diff --git a/src/Stripe.net/Services/Quotes/QuoteService.cs b/src/Stripe.net/Services/Quotes/QuoteService.cs index 9511c08ce5..b83269d28a 100644 --- a/src/Stripe.net/Services/Quotes/QuoteService.cs +++ b/src/Stripe.net/Services/Quotes/QuoteService.cs @@ -15,8 +15,8 @@ public partial class QuoteService : Service, IRetrievable, IUpdatable { - private QuoteLineItemService lineItems; private QuoteComputedUpfrontLineItemsService computedUpfrontLineItems; + private QuoteLineItemService lineItems; public QuoteService() { @@ -32,10 +32,10 @@ public QuoteService(IStripeClient client) { } - public virtual QuoteLineItemService LineItems => this.lineItems ??= new QuoteLineItemService( + public virtual QuoteComputedUpfrontLineItemsService ComputedUpfrontLineItems => this.computedUpfrontLineItems ??= new QuoteComputedUpfrontLineItemsService( this.Requestor); - public virtual QuoteComputedUpfrontLineItemsService ComputedUpfrontLineItems => this.computedUpfrontLineItems ??= new QuoteComputedUpfrontLineItemsService( + public virtual QuoteLineItemService LineItems => this.lineItems ??= new QuoteLineItemService( this.Requestor); /// diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs index b782d922e2..97c60340af 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemOptions.cs @@ -7,7 +7,7 @@ namespace Stripe using STJS = System.Text.Json.Serialization; #endif - public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions + public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions, IHasMetadata { /// /// The coupons to redeem into discounts for the item. @@ -18,6 +18,28 @@ public class SubscriptionSchedulePhaseAddInvoiceItemOptions : INestedOptions #endif public List Discounts { get; set; } + /// + /// Set of key-value pairs that you can + /// attach to an object. This can be useful for storing additional information about the + /// object in a structured format. Individual keys can be unset by posting an empty value to + /// them. All keys can be unset by posting an empty value to metadata. + /// + [JsonProperty("metadata")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("metadata")] +#endif + public Dictionary Metadata { get; set; } + + /// + /// The period associated with this invoice item. Defaults to the period of the underlying + /// subscription that surrounds the start of the phase. + /// + [JsonProperty("period")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("period")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions Period { get; set; } + /// /// The ID of the price object. One of price or price_data is required. /// diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions.cs new file mode 100644 index 0000000000..523b19b805 --- /dev/null +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the end of the invoice item period. Must be greater than or + /// equal to period.start. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the end of the invoice item period. + /// One of: min_item_period_end, phase_end, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions.cs new file mode 100644 index 0000000000..a1d1d56911 --- /dev/null +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriodOptions : INestedOptions + { + /// + /// End of the invoice item period. + /// + [JsonProperty("end")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("end")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriodEndOptions End { get; set; } + + /// + /// Start of the invoice item period. + /// + [JsonProperty("start")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("start")] +#endif + public SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions Start { get; set; } + } +} diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions.cs new file mode 100644 index 0000000000..18c471ba1a --- /dev/null +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionSchedulePhaseAddInvoiceItemPeriodStartOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the start of the invoice item period. Must be less than or + /// equal to period.end. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the start of the invoice item period. + /// One of: max_item_period_start, phase_start, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs index ce52a2e42a..d0c595b0ff 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemOptions.cs @@ -7,7 +7,7 @@ namespace Stripe using STJS = System.Text.Json.Serialization; #endif - public class SubscriptionAddInvoiceItemOptions : INestedOptions + public class SubscriptionAddInvoiceItemOptions : INestedOptions, IHasMetadata { /// /// The coupons to redeem into discounts for the item. @@ -18,6 +18,28 @@ public class SubscriptionAddInvoiceItemOptions : INestedOptions #endif public List Discounts { get; set; } + /// + /// Set of key-value pairs that you can + /// attach to an object. This can be useful for storing additional information about the + /// object in a structured format. Individual keys can be unset by posting an empty value to + /// them. All keys can be unset by posting an empty value to metadata. + /// + [JsonProperty("metadata")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("metadata")] +#endif + public Dictionary Metadata { get; set; } + + /// + /// The period associated with this invoice item. Defaults to the current period of the + /// subscription. + /// + [JsonProperty("period")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("period")] +#endif + public SubscriptionAddInvoiceItemPeriodOptions Period { get; set; } + /// /// The ID of the price object. One of price or price_data is required. /// diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodEndOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodEndOptions.cs new file mode 100644 index 0000000000..2051c1496c --- /dev/null +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodEndOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionAddInvoiceItemPeriodEndOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the end of the invoice item period. Must be greater than or + /// equal to period.start. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the end of the invoice item period. + /// One of: min_item_period_end, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodOptions.cs new file mode 100644 index 0000000000..6b2b29325a --- /dev/null +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodOptions.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionAddInvoiceItemPeriodOptions : INestedOptions + { + /// + /// End of the invoice item period. + /// + [JsonProperty("end")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("end")] +#endif + public SubscriptionAddInvoiceItemPeriodEndOptions End { get; set; } + + /// + /// Start of the invoice item period. + /// + [JsonProperty("start")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("start")] +#endif + public SubscriptionAddInvoiceItemPeriodStartOptions Start { get; set; } + } +} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodStartOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodStartOptions.cs new file mode 100644 index 0000000000..adb499584f --- /dev/null +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionAddInvoiceItemPeriodStartOptions.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class SubscriptionAddInvoiceItemPeriodStartOptions : INestedOptions + { + /// + /// A precise Unix timestamp for the start of the invoice item period. Must be less than or + /// equal to period.end. + /// + [JsonProperty("timestamp")] + [JsonConverter(typeof(UnixDateTimeConverter))] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("timestamp")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] +#endif + public DateTime? Timestamp { get; set; } + + /// + /// Select how to calculate the start of the invoice item period. + /// One of: max_item_period_start, now, or timestamp. + /// + [JsonProperty("type")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("type")] +#endif + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchorConfigOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchorConfigOptions.cs index bb08fe9f30..af7ab4f86c 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchorConfigOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionBillingCycleAnchorConfigOptions.cs @@ -9,7 +9,7 @@ namespace Stripe public class SubscriptionBillingCycleAnchorConfigOptions : INestedOptions { /// - /// The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. + /// The day of the month the anchor should be. Ranges from 1 to 31. /// [JsonProperty("day_of_month")] #if NET6_0_OR_GREATER @@ -18,7 +18,7 @@ public class SubscriptionBillingCycleAnchorConfigOptions : INestedOptions public long? DayOfMonth { get; set; } /// - /// The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. + /// The hour of the day the anchor should be. Ranges from 0 to 23. /// [JsonProperty("hour")] #if NET6_0_OR_GREATER @@ -27,7 +27,7 @@ public class SubscriptionBillingCycleAnchorConfigOptions : INestedOptions public long? Hour { get; set; } /// - /// The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. + /// The minute of the hour the anchor should be. Ranges from 0 to 59. /// [JsonProperty("minute")] #if NET6_0_OR_GREATER @@ -36,7 +36,7 @@ public class SubscriptionBillingCycleAnchorConfigOptions : INestedOptions public long? Minute { get; set; } /// - /// The month to start full cycle billing periods. Ranges from 1 to 12. + /// The month to start full cycle periods. Ranges from 1 to 12. /// [JsonProperty("month")] #if NET6_0_OR_GREATER @@ -45,7 +45,7 @@ public class SubscriptionBillingCycleAnchorConfigOptions : INestedOptions public long? Month { get; set; } /// - /// The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. + /// The second of the minute the anchor should be. Ranges from 0 to 59. /// [JsonProperty("second")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionListOptions.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionListOptions.cs index 899c61af75..39d1d8bef6 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionListOptions.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionListOptions.cs @@ -42,7 +42,8 @@ public class SubscriptionListOptions : ListOptions public AnyOf Created { get; set; } /// - /// Only return subscriptions whose current_period_end falls within the given date interval. + /// Only return subscriptions whose minimum item current_period_end falls within the given + /// date interval. /// [JsonProperty("current_period_end")] [JsonConverter(typeof(AnyOfConverter))] @@ -53,8 +54,8 @@ public class SubscriptionListOptions : ListOptions public AnyOf CurrentPeriodEnd { get; set; } /// - /// Only return subscriptions whose current_period_start falls within the given date - /// interval. + /// Only return subscriptions whose maximum item current_period_start falls within the given + /// date interval. /// [JsonProperty("current_period_start")] [JsonConverter(typeof(AnyOfConverter))] diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingMxnOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingMxnOptions.cs new file mode 100644 index 0000000000..96275f7b2a --- /dev/null +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingMxnOptions.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe.Terminal +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class ConfigurationTippingMxnOptions : INestedOptions + { + /// + /// Fixed amounts displayed when collecting a tip. + /// + [JsonProperty("fixed_amounts")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("fixed_amounts")] +#endif + public List FixedAmounts { get; set; } + + /// + /// Percentages displayed when collecting a tip. + /// + [JsonProperty("percentages")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("percentages")] +#endif + public List Percentages { get; set; } + + /// + /// Below this amount, fixed amounts will be displayed; above it, percentages will be + /// displayed. + /// + [JsonProperty("smart_tip_threshold")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("smart_tip_threshold")] +#endif + public long? SmartTipThreshold { get; set; } + } +} diff --git a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingOptions.cs b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingOptions.cs index 8e54042aa9..53cb82efed 100644 --- a/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingOptions.cs +++ b/src/Stripe.net/Services/Terminal/Configurations/ConfigurationTippingOptions.cs @@ -116,6 +116,15 @@ public class ConfigurationTippingOptions : INestedOptions #endif public ConfigurationTippingJpyOptions Jpy { get; set; } + /// + /// Tipping configuration for MXN. + /// + [JsonProperty("mxn")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("mxn")] +#endif + public ConfigurationTippingMxnOptions Mxn { get; set; } + /// /// Tipping configuration for MYR. /// diff --git a/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderCardOptions.cs b/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderCardOptions.cs new file mode 100644 index 0000000000..7ac9779964 --- /dev/null +++ b/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderCardOptions.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe.TestHelpers.Terminal +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class ReaderCardOptions : INestedOptions + { + /// + /// Card security code. + /// + [JsonProperty("cvc")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("cvc")] +#endif + public string Cvc { get; set; } + + /// + /// Two-digit number representing the card's expiration month. + /// + [JsonProperty("exp_month")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("exp_month")] +#endif + public long? ExpMonth { get; set; } + + /// + /// Two- or four-digit number representing the card's expiration year. + /// + [JsonProperty("exp_year")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("exp_year")] +#endif + public long? ExpYear { get; set; } + + /// + /// The card number, as a string without any separators. + /// + [JsonProperty("number")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("number")] +#endif + public string Number { get; set; } + } +} diff --git a/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderPresentPaymentMethodOptions.cs b/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderPresentPaymentMethodOptions.cs index 94f1640586..407f79f455 100644 --- a/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderPresentPaymentMethodOptions.cs +++ b/src/Stripe.net/Services/TestHelpers/Terminal/Readers/ReaderPresentPaymentMethodOptions.cs @@ -17,6 +17,15 @@ public class ReaderPresentPaymentMethodOptions : BaseOptions #endif public long? AmountTip { get; set; } + /// + /// Simulated data for the card payment method. + /// + [JsonProperty("card")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("card")] +#endif + public ReaderCardOptions Card { get; set; } + /// /// Simulated data for the card_present payment method. /// @@ -37,7 +46,7 @@ public class ReaderPresentPaymentMethodOptions : BaseOptions /// /// Simulated payment type. - /// One of: card_present, or interac_present. + /// One of: card, card_present, or interac_present. /// [JsonProperty("type")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Services/V1Services.cs b/src/Stripe.net/Services/V1Services.cs index 4adf55b75d..0627826b97 100644 --- a/src/Stripe.net/Services/V1Services.cs +++ b/src/Stripe.net/Services/V1Services.cs @@ -23,7 +23,6 @@ public class V1Services : Service private CheckoutService checkout; private ClimateService climate; private ConfirmationTokenService confirmationTokens; - private TestHelpersService testHelpers; private CountrySpecService countrySpecs; private CouponService coupons; private CreditNoteService creditNotes; @@ -39,9 +38,9 @@ public class V1Services : Service private ForwardingService forwarding; private IdentityService identity; private InvoiceService invoices; + private InvoiceItemService invoiceItems; private InvoicePaymentService invoicePayments; private InvoiceRenderingTemplateService invoiceRenderingTemplates; - private InvoiceItemService invoiceItems; private IssuingService issuing; private MandateService mandates; private PaymentIntentService paymentIntents; @@ -59,10 +58,10 @@ public class V1Services : Service private RefundService refunds; private ReportingService reporting; private ReviewService reviews; - private SigmaService sigma; private SetupAttemptService setupAttempts; private SetupIntentService setupIntents; private ShippingRateService shippingRates; + private SigmaService sigma; private SourceService sources; private SubscriptionService subscriptions; private SubscriptionItemService subscriptionItems; @@ -72,6 +71,7 @@ public class V1Services : Service private TaxIdService taxIds; private TaxRateService taxRates; private TerminalService terminal; + private TestHelpersService testHelpers; private TokenService tokens; private TopupService topups; private TransferService transfers; @@ -136,9 +136,6 @@ internal V1Services(IStripeClient client) public virtual ConfirmationTokenService ConfirmationTokens => this.confirmationTokens ??= new ConfirmationTokenService( this.Requestor); - public virtual TestHelpersService TestHelpers => this.testHelpers ??= new TestHelpersService( - this.Requestor); - public virtual CountrySpecService CountrySpecs => this.countrySpecs ??= new CountrySpecService( this.Requestor); @@ -184,13 +181,13 @@ internal V1Services(IStripeClient client) public virtual InvoiceService Invoices => this.invoices ??= new InvoiceService( this.Requestor); - public virtual InvoicePaymentService InvoicePayments => this.invoicePayments ??= new InvoicePaymentService( + public virtual InvoiceItemService InvoiceItems => this.invoiceItems ??= new InvoiceItemService( this.Requestor); - public virtual InvoiceRenderingTemplateService InvoiceRenderingTemplates => this.invoiceRenderingTemplates ??= new InvoiceRenderingTemplateService( + public virtual InvoicePaymentService InvoicePayments => this.invoicePayments ??= new InvoicePaymentService( this.Requestor); - public virtual InvoiceItemService InvoiceItems => this.invoiceItems ??= new InvoiceItemService( + public virtual InvoiceRenderingTemplateService InvoiceRenderingTemplates => this.invoiceRenderingTemplates ??= new InvoiceRenderingTemplateService( this.Requestor); public virtual IssuingService Issuing => this.issuing ??= new IssuingService( @@ -244,9 +241,6 @@ internal V1Services(IStripeClient client) public virtual ReviewService Reviews => this.reviews ??= new ReviewService( this.Requestor); - public virtual SigmaService Sigma => this.sigma ??= new SigmaService( - this.Requestor); - public virtual SetupAttemptService SetupAttempts => this.setupAttempts ??= new SetupAttemptService( this.Requestor); @@ -256,6 +250,9 @@ internal V1Services(IStripeClient client) public virtual ShippingRateService ShippingRates => this.shippingRates ??= new ShippingRateService( this.Requestor); + public virtual SigmaService Sigma => this.sigma ??= new SigmaService( + this.Requestor); + public virtual SourceService Sources => this.sources ??= new SourceService( this.Requestor); @@ -283,6 +280,9 @@ internal V1Services(IStripeClient client) public virtual TerminalService Terminal => this.terminal ??= new TerminalService( this.Requestor); + public virtual TestHelpersService TestHelpers => this.testHelpers ??= new TestHelpersService( + this.Requestor); + public virtual TokenService Tokens => this.tokens ??= new TokenService( this.Requestor); diff --git a/src/Stripe.net/Services/V2/BillingService.cs b/src/Stripe.net/Services/V2/BillingService.cs index d83cd1385c..37413b6845 100644 --- a/src/Stripe.net/Services/V2/BillingService.cs +++ b/src/Stripe.net/Services/V2/BillingService.cs @@ -7,10 +7,10 @@ namespace Stripe.V2 public class BillingService : Service { + private V2.Billing.MeterEventService meterEvents; private V2.Billing.MeterEventAdjustmentService meterEventAdjustments; private V2.Billing.MeterEventSessionService meterEventSession; private V2.Billing.MeterEventStreamService meterEventStream; - private V2.Billing.MeterEventService meterEvents; internal BillingService(ApiRequestor requestor) : base(requestor) @@ -22,6 +22,9 @@ internal BillingService(IStripeClient client) { } + public virtual V2.Billing.MeterEventService MeterEvents => this.meterEvents ??= new V2.Billing.MeterEventService( + this.Requestor); + public virtual V2.Billing.MeterEventAdjustmentService MeterEventAdjustments => this.meterEventAdjustments ??= new V2.Billing.MeterEventAdjustmentService( this.Requestor); @@ -30,8 +33,5 @@ internal BillingService(IStripeClient client) public virtual V2.Billing.MeterEventStreamService MeterEventStream => this.meterEventStream ??= new V2.Billing.MeterEventStreamService( this.Requestor); - - public virtual V2.Billing.MeterEventService MeterEvents => this.meterEvents ??= new V2.Billing.MeterEventService( - this.Requestor); } } diff --git a/src/Stripe.net/Services/V2/CoreService.cs b/src/Stripe.net/Services/V2/CoreService.cs index 3ff5f60ffc..19fd1c43ca 100644 --- a/src/Stripe.net/Services/V2/CoreService.cs +++ b/src/Stripe.net/Services/V2/CoreService.cs @@ -7,8 +7,8 @@ namespace Stripe.V2 public class CoreService : Service { - private V2.Core.EventDestinationService eventDestinations; private V2.Core.EventService events; + private V2.Core.EventDestinationService eventDestinations; internal CoreService(ApiRequestor requestor) : base(requestor) @@ -20,10 +20,10 @@ internal CoreService(IStripeClient client) { } - public virtual V2.Core.EventDestinationService EventDestinations => this.eventDestinations ??= new V2.Core.EventDestinationService( + public virtual V2.Core.EventService Events => this.events ??= new V2.Core.EventService( this.Requestor); - public virtual V2.Core.EventService Events => this.events ??= new V2.Core.EventService( + public virtual V2.Core.EventDestinationService EventDestinations => this.eventDestinations ??= new V2.Core.EventDestinationService( this.Requestor); } } diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs index 9010aa2f2c..7abcdab97e 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointCreateOptions.cs @@ -41,7 +41,7 @@ public class WebhookEndpointCreateOptions : BaseOptions, IHasMetadata /// 2024-10-28.acacia, 2024-11-20.acacia, 2024-12-18.acacia, /// 2025-01-27.acacia, 2025-02-24.acacia, 2025-03-01.dashboard, /// 2025-03-31.basil, 2025-04-30.basil, 2025-05-28.basil, - /// 2025-06-30.basil, or 2025-07-30.basil. + /// 2025-06-30.basil, 2025-07-30.basil, or 2025-08-27.basil. /// [JsonProperty("api_version")] #if NET6_0_OR_GREATER diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index ac3c572bcc..bf420b335c 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -6149,6 +6149,28 @@ public void TestWebhookEndpointsPost2() "/v1/webhook_endpoints/we_xxxxxxxxxxxxx"); } + [Fact] + public void TestV2BillingMeterEventPost() + { + this.StubRequest( + HttpMethod.Post, + "/v2/billing/meter_events", + (HttpStatusCode)200, + "{\"object\":\"v2.billing.meter_event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"event_name\":\"event_name\",\"identifier\":\"identifier\",\"livemode\":true,\"payload\":{\"key\":\"payload\"},\"timestamp\":\"1970-01-01T15:18:46.294Z\"}"); + var options = new Stripe.V2.Billing.MeterEventCreateOptions + { + EventName = "event_name", + Payload = new Dictionary + { + { "key", "payload" }, + }, + }; + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.MeterEvents; + Stripe.V2.Billing.MeterEvent meterEvent = service.Create(options); + this.AssertRequest(HttpMethod.Post, "/v2/billing/meter_events"); + } + [Fact] public void TestV2BillingMeterEventAdjustmentPost() { @@ -6211,7 +6233,7 @@ public void TestV2BillingMeterEventStreamPost() Identifier = "identifier", Payload = new Dictionary { - { "undefined", "payload" }, + { "key", "payload" }, }, Timestamp = DateTimeOffset.Parse( "1970-01-01T15:18:46.294Z") @@ -6228,25 +6250,40 @@ public void TestV2BillingMeterEventStreamPost() } [Fact] - public void TestV2BillingMeterEventPost() + public void TestV2CoreEventGet() { this.StubRequest( - HttpMethod.Post, - "/v2/billing/meter_events", + HttpMethod.Get, + "/v2/core/events", (HttpStatusCode)200, - "{\"object\":\"v2.billing.meter_event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"event_name\":\"event_name\",\"identifier\":\"identifier\",\"livemode\":true,\"payload\":{\"undefined\":\"payload\"},\"timestamp\":\"1970-01-01T15:18:46.294Z\"}"); - var options = new Stripe.V2.Billing.MeterEventCreateOptions + "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}", + "object_id=object_id"); + var options = new Stripe.V2.Core.EventListOptions { - EventName = "event_name", - Payload = new Dictionary - { - { "undefined", "payload" }, - }, + ObjectId = "object_id", }; var client = new StripeClient(this.Requestor); - var service = client.V2.Billing.MeterEvents; - Stripe.V2.Billing.MeterEvent meterEvent = service.Create(options); - this.AssertRequest(HttpMethod.Post, "/v2/billing/meter_events"); + var service = client.V2.Core.Events; + Stripe.V2.StripeList events = service.List( + options); + this.AssertRequest( + HttpMethod.Get, + "/v2/core/events", + "object_id=object_id"); + } + + [Fact] + public void TestV2CoreEventGet2() + { + this.StubRequest( + HttpMethod.Get, + "/v2/core/events/id_123", + (HttpStatusCode)200, + "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}"); + var client = new StripeClient(this.Requestor); + var service = client.V2.Core.Events; + Stripe.V2.Event result = service.Get("id_123"); + this.AssertRequest(HttpMethod.Get, "/v2/core/events/id_123"); } [Fact] @@ -6387,43 +6424,6 @@ public void TestV2CoreEventDestinationPost5() "/v2/core/event_destinations/id_123/ping"); } - [Fact] - public void TestV2CoreEventGet() - { - this.StubRequest( - HttpMethod.Get, - "/v2/core/events", - (HttpStatusCode)200, - "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}", - "object_id=object_id"); - var options = new Stripe.V2.Core.EventListOptions - { - ObjectId = "object_id", - }; - var client = new StripeClient(this.Requestor); - var service = client.V2.Core.Events; - Stripe.V2.StripeList events = service.List( - options); - this.AssertRequest( - HttpMethod.Get, - "/v2/core/events", - "object_id=object_id"); - } - - [Fact] - public void TestV2CoreEventGet2() - { - this.StubRequest( - HttpMethod.Get, - "/v2/core/events/id_123", - (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}"); - var client = new StripeClient(this.Requestor); - var service = client.V2.Core.Events; - Stripe.V2.Event result = service.Get("id_123"); - this.AssertRequest(HttpMethod.Get, "/v2/core/events/id_123"); - } - [Fact] public void TestTemporarySessionExpiredError() { @@ -6444,7 +6444,7 @@ public void TestTemporarySessionExpiredError() EventName = "event_name", Payload = new Dictionary { - { "undefined", "payload" }, + { "key", "payload" }, }, }, }, From 17390bd82d5c88b4297b6739c5693bca07e49163 Mon Sep 17 00:00:00 2001 From: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:21:02 -0700 Subject: [PATCH 02/11] Add section on private preview SDKs in readme (#3164) --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0781232443..da01bae1ee 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ how to use the library. ### Using StripeClient -In version 46 of the Stripe .NET SDK, we have enhanced the `StripeClient` class to be the entry point to access all services that had to be previously independently instantiated with global configuration. This improves discoverability during IDE auto-completion and creates a more intuitive developer experience for you. +In version 46 of the Stripe .NET SDK, we have enhanced the `StripeClient` class to be the entry point to access all services that had to be previously independently instantiated with global configuration. This improves discoverability during IDE auto-completion and creates a more intuitive developer experience for you. Each client instantiation can have its own configuration so you can access Stripe API with different API keys or different configuration (like number of retries) on a per client basis and without changing a global configuration. @@ -285,7 +285,7 @@ StripeConfiguration.EnableTelemetry = false; Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `45.1.0-beta.2`. We would love for you to try these as we incrementally release new features and improve them based on your feedback. -To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-dotnet/releases/) and then use it in the version parameter with `dotnet add package` command: +To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-dotnet/releases/) and then use it in the version parameter with `dotnet add package` command: ``` dotnet add package Stripe.net --version @@ -299,6 +299,9 @@ Some preview features require a name and version to be set in the `Stripe-Versio ```csharp StripeConfiguration.AddBetaVersion("feature_beta", "v3"); ``` +### Private Preview SDKs + +Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `45.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-dotnet?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`. ### Custom requests From 9902b800cd191b616b930b0c1cbb723a4e08b9d0 Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Wed, 27 Aug 2025 12:30:54 -0700 Subject: [PATCH 03/11] Bump version to 48.5.0 --- CHANGELOG.md | 16 ++++++++++++++++ VERSION | 2 +- src/Stripe.net/Constants/Version.cs | 2 +- src/Stripe.net/Stripe.net.csproj | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc8cfd0f1e..f7a782cf4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 48.5.0 - 2025-08-27 +* [#3164](https://github.com/stripe/stripe-dotnet/pull/3164) Add section on private preview SDKs in readme +* [#3159](https://github.com/stripe/stripe-dotnet/pull/3159) Update generated code. This release changes the pinned API version to `2025-08-27.basil`. + * Add support for `BalanceReport`, `PayoutDetails`, and `PayoutReconciliationReport` on `AccountSession.Components` and `AccountSessionComponentsOptions` + * Add support for `Name` on `BillingPortal.ConfigurationCreateOptions`, `BillingPortal.ConfigurationUpdateOptions`, and `BillingPortal.Configuration` + * Add support for `Installments` on `Charge.PaymentMethodDetails.Alma` + * Add support for `TransactionId` on `Charge.PaymentMethodDetails.Alma`, `Charge.PaymentMethodDetails.AmazonPay`, `Charge.PaymentMethodDetails.Billie`, `Charge.PaymentMethodDetails.KakaoPay`, `Charge.PaymentMethodDetails.KrCard`, `Charge.PaymentMethodDetails.NaverPay`, `Charge.PaymentMethodDetails.Payco`, `Charge.PaymentMethodDetails.RevolutPay`, `Charge.PaymentMethodDetails.SamsungPay`, and `Charge.PaymentMethodDetails.Satispay` + * Add support for `Location` and `Reader` on `Charge.PaymentMethodDetails.Paynow` + * Add support for `AmountIncludesIof` on `Checkout.Session.PaymentMethodOptions.Pix`, `CheckoutSessionPaymentMethodOptionsPixOptions`, `PaymentIntent.PaymentMethodOptions.Pix`, and `PaymentIntentPaymentMethodOptionsPixOptions` + * Add support for `Metadata` and `Period` on `InvoiceScheduleDetailsPhaseAddInvoiceItemOptions`, `SubscriptionAddInvoiceItemOptions`, `SubscriptionSchedule.Phase.AddInvoiceItem`, and `SubscriptionSchedulePhaseAddInvoiceItemOptions` + * Add support for `ExpMonth` and `ExpYear` on `Issuing.CardCreateOptions` + * Add support for `ExcludedPaymentMethodTypes` on `PaymentIntentCreateOptions` and `PaymentIntent` + * Add support for `PayoutMethod` on `PayoutCreateOptions` and `Payout` + * Add support for `Mxn` on `Terminal.Configuration.Tipping` and `TerminalConfigurationTippingOptions` + * Add support for `Card` on `Terminal.TestHelpersReaderPresentPaymentMethodOptions` + ## 48.4.0 - 2025-07-30 This release changes the pinned API version to `2025-07-30.basil`. diff --git a/VERSION b/VERSION index e538123812..ba3b2d3984 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -48.4.0 +48.5.0 diff --git a/src/Stripe.net/Constants/Version.cs b/src/Stripe.net/Constants/Version.cs index 56245f7e26..b304c0bfd3 100644 --- a/src/Stripe.net/Constants/Version.cs +++ b/src/Stripe.net/Constants/Version.cs @@ -2,6 +2,6 @@ namespace Stripe { internal class Version { - public const string Current = "48.4.0"; + public const string Current = "48.5.0"; } } \ No newline at end of file diff --git a/src/Stripe.net/Stripe.net.csproj b/src/Stripe.net/Stripe.net.csproj index 92166c1d01..6177a581d3 100644 --- a/src/Stripe.net/Stripe.net.csproj +++ b/src/Stripe.net/Stripe.net.csproj @@ -2,7 +2,7 @@ Stripe.net is a sync/async client and portable class library for the Stripe API, supporting .NET Standard 2.0+, .NET Core 3.1+, and .NET Framework 4.6.1+. (Official Library) - 48.4.0 + 48.5.0 8 Stripe, Jayme Davis net5.0;net6.0;net7.0;net8.0;netcoreapp3.1;netstandard2.0;net461 From ffe133d95e095c2dad9c3e463535248a4a6ab8a5 Mon Sep 17 00:00:00 2001 From: Michael Broshi Date: Wed, 27 Aug 2025 17:10:46 -0400 Subject: [PATCH 04/11] Add private-preview branch to CI workflow triggers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c57d66e452..519bca2d17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ on: branches: - master - beta + - private-preview - sdk-release/** - feature/** From 8ae00439e65a847a5ab48297e887f708ac562d4d Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:04:21 -0700 Subject: [PATCH 05/11] =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20Build=20SDK=20w/=20V?= =?UTF-8?q?2=20OpenAPI=20spec=20(#3167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * generate w/ v2 openapi spec * move deleted object path --- .../V2/DeletedObject/DeletedObject.cs | 30 +++++++++++++++++++ .../EventDestinationService.cs | 8 ++--- .../Services/GeneratedExamplesTest.cs | 22 +++++++------- 3 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 src/Stripe.net/Entities/V2/DeletedObject/DeletedObject.cs diff --git a/src/Stripe.net/Entities/V2/DeletedObject/DeletedObject.cs b/src/Stripe.net/Entities/V2/DeletedObject/DeletedObject.cs new file mode 100644 index 0000000000..3fca381bbc --- /dev/null +++ b/src/Stripe.net/Entities/V2/DeletedObject/DeletedObject.cs @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2 +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class DeletedObject : StripeEntity, IHasId, IHasObject + { + /// + /// The ID of the object that's being deleted. + /// + [JsonProperty("id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("id")] +#endif + public string Id { get; set; } + + /// + /// String representing the type of the object that has been deleted. Objects of the same + /// type share the same value of the object field. + /// + [JsonProperty("object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("object")] +#endif + public string Object { get; set; } + } +} diff --git a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs index 560d7f1793..299fe81932 100644 --- a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs +++ b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs @@ -39,17 +39,17 @@ public virtual V2.EventDestination Create(EventDestinationCreateOptions options, /// /// Delete an event destination. /// - public virtual V2.EventDestination Delete(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null) + public virtual V2.DeletedObject Delete(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.Request(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions); + return this.Request(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions); } /// /// Delete an event destination. /// - public virtual Task DeleteAsync(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + public virtual Task DeleteAsync(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { - return this.RequestAsync(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + return this.RequestAsync(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); } /// diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index bf420b335c..a0a41f9759 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -6256,7 +6256,7 @@ public void TestV2CoreEventGet() HttpMethod.Get, "/v2/core/events", (HttpStatusCode)200, - "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}", + "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}", "object_id=object_id"); var options = new Stripe.V2.Core.EventListOptions { @@ -6279,7 +6279,7 @@ public void TestV2CoreEventGet2() HttpMethod.Get, "/v2/core/events/id_123", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.Events; Stripe.V2.Event result = service.Get("id_123"); @@ -6293,7 +6293,7 @@ public void TestV2CoreEventDestinationGet() HttpMethod.Get, "/v2/core/event_destinations", (HttpStatusCode)200, - "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}],\"next_page_url\":null,\"previous_page_url\":null}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; Stripe.V2.StripeList eventDestinations = service @@ -6308,7 +6308,7 @@ public void TestV2CoreEventDestinationPost() HttpMethod.Post, "/v2/core/event_destinations", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}"); var options = new Stripe.V2.Core.EventDestinationCreateOptions { EnabledEvents = new List { "enabled_events" }, @@ -6330,10 +6330,10 @@ public void TestV2CoreEventDestinationDelete() HttpMethod.Delete, "/v2/core/event_destinations/id_123", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"abc_123\",\"object\":\"some.object.tag\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; - Stripe.V2.EventDestination deleted = service.Delete("id_123"); + Stripe.V2.DeletedObject deleted = service.Delete("id_123"); this.AssertRequest( HttpMethod.Delete, "/v2/core/event_destinations/id_123"); @@ -6346,7 +6346,7 @@ public void TestV2CoreEventDestinationGet2() HttpMethod.Get, "/v2/core/event_destinations/id_123", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; Stripe.V2.EventDestination eventDestination = service.Get("id_123"); @@ -6362,7 +6362,7 @@ public void TestV2CoreEventDestinationPost2() HttpMethod.Post, "/v2/core/event_destinations/id_123", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}"); var options = new Stripe.V2.Core.EventDestinationUpdateOptions(); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; @@ -6381,7 +6381,7 @@ public void TestV2CoreEventDestinationPost3() HttpMethod.Post, "/v2/core/event_destinations/id_123/disable", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; Stripe.V2.EventDestination eventDestination = service.Disable( @@ -6398,7 +6398,7 @@ public void TestV2CoreEventDestinationPost4() HttpMethod.Post, "/v2/core/event_destinations/id_123/enable", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; Stripe.V2.EventDestination eventDestination = service.Enable( @@ -6415,7 +6415,7 @@ public void TestV2CoreEventDestinationPost5() HttpMethod.Post, "/v2/core/event_destinations/id_123/ping", (HttpStatusCode)200, - "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}"); + "{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.EventDestinations; Stripe.V2.Event result = service.Ping("id_123"); From e84e43c335109a1a618718100d75b29e4b2ca764 Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Thu, 11 Sep 2025 08:48:46 -0700 Subject: [PATCH 06/11] Adds public BaseUrl to RawRequestOptions (#3170) renames internal BaseUrl in RequestOptions to InternalBaseUrl adds public BaseUrl to RawRequestOptions - it delegates to InternalBaseUrl for safety --- .../Public/ApiRequestorAdapter.cs | 2 +- .../Infrastructure/Public/LiveApiRequestor.cs | 2 +- .../Services/_common/RawRequestOptions.cs | 7 ++++ .../Services/_common/RequestOptions.cs | 4 +-- .../Infrastructure/Public/StripeClientTest.cs | 36 +++++++++++++++++++ 5 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/Stripe.net/Infrastructure/Public/ApiRequestorAdapter.cs b/src/Stripe.net/Infrastructure/Public/ApiRequestorAdapter.cs index c2a366da5d..95751ea666 100644 --- a/src/Stripe.net/Infrastructure/Public/ApiRequestorAdapter.cs +++ b/src/Stripe.net/Infrastructure/Public/ApiRequestorAdapter.cs @@ -54,7 +54,7 @@ public override Task RequestAsync( if (baseAddress != BaseAddress.Api) { requestOptions ??= new RequestOptions(); - requestOptions.BaseUrl = this.GetBaseUrl(baseAddress); + requestOptions.InternalBaseUrl = this.GetBaseUrl(baseAddress); } return this.client.RequestAsync(method, path, options, requestOptions, cancellationToken); diff --git a/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs b/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs index 652b563171..e478935b8b 100644 --- a/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs +++ b/src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs @@ -231,7 +231,7 @@ private StripeRequest MakeStripeRequest( } var uri = StripeRequest.BuildUri( - requestOptions?.BaseUrl ?? this.GetBaseUrl(baseAddress), + requestOptions?.InternalBaseUrl ?? this.GetBaseUrl(baseAddress), method, path, options, diff --git a/src/Stripe.net/Services/_common/RawRequestOptions.cs b/src/Stripe.net/Services/_common/RawRequestOptions.cs index 56d62af257..e10e88377b 100644 --- a/src/Stripe.net/Services/_common/RawRequestOptions.cs +++ b/src/Stripe.net/Services/_common/RawRequestOptions.cs @@ -4,6 +4,13 @@ namespace Stripe public class RawRequestOptions : RequestOptions { + /// Gets or sets the base URL for the raw request. + /// + /// Use this to send API calls to e.g. files.stripe.com or + /// a proxy address. + /// + public string BaseUrl { get => this.InternalBaseUrl; set => this.InternalBaseUrl = value; } + /// Gets or sets additional headers for the request. public Dictionary AdditionalHeaders { get; set; } = new Dictionary(); diff --git a/src/Stripe.net/Services/_common/RequestOptions.cs b/src/Stripe.net/Services/_common/RequestOptions.cs index dd8409cf54..6dbeb3f34e 100644 --- a/src/Stripe.net/Services/_common/RequestOptions.cs +++ b/src/Stripe.net/Services/_common/RequestOptions.cs @@ -27,13 +27,13 @@ public class RequestOptions /// Gets or sets the value or Stripe-Context request header. public string StripeContext { get; set; } - /// Gets or sets the base URL for the request. + /// Gets the base URL for the request. /// /// This is an internal property. It is set by services or individual request methods when /// they need to send a request to a non-standard destination, e.g. files.stripe.com /// for file creation requests or connect.stripe.com for OAuth requests. /// - internal string BaseUrl { get; set; } + internal string InternalBaseUrl { get; set; } /// Gets or sets the API version for the request. /// diff --git a/src/StripeTests/Infrastructure/Public/StripeClientTest.cs b/src/StripeTests/Infrastructure/Public/StripeClientTest.cs index a02d3c64e4..dd167d6462 100644 --- a/src/StripeTests/Infrastructure/Public/StripeClientTest.cs +++ b/src/StripeTests/Infrastructure/Public/StripeClientTest.cs @@ -164,6 +164,42 @@ public async Task RawRequestAsync_Json() Assert.Equal("mes_123", obj.Id); } + [Fact] + public async Task RawRequest_BaseUrl() + { + // Stub a request as stripe-mock does not support v2 + this.MockHttpClientFixture.StubRequest( + HttpMethod.Post, + "/v2/billing/meter_event_session", + System.Net.HttpStatusCode.OK, + "{\"id\": \"mes_123\",\"object\":\"v2.billing.meter_event_session\"}"); + + var expectedBaseUrl = "https://test.stripetest.com"; + var rawResponse = await this.stripeClient.RawRequestAsync( + HttpMethod.Post, + "/v2/billing/meter_event_session", + "{}", + new RawRequestOptions + { + BaseUrl = expectedBaseUrl, + AdditionalHeaders = + { + { "foo", "bar" }, + }, + }); + + this.MockHttpClientFixture.MockHandler.Protected() + .Verify( + "SendAsync", + Times.Once(), + ItExpr.Is(m => + new Uri(expectedBaseUrl).Host == (string)m.Properties["OriginalHost"]), + ItExpr.IsAny()); + + var obj = this.stripeClient.Deserialize(rawResponse.Content); + Assert.Equal("mes_123", obj.Id); + } + [Fact] public async Task RawRequestAsyncIncludesCorrectUsage() { From 7f48eeccd1eeb8a7b78015fb695d92e0b3dd9adc Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 12:19:31 -0700 Subject: [PATCH 07/11] Update generated code (#3172) * Update generated code for v1955 and 2025-09-30.clover * Update generated code for v1968 and 2025-09-30.clover --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- API_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../Entities/PaymentIntents/PaymentIntentNextAction.cs | 3 ++- .../PaymentIntents/PaymentIntentNextActionUseStripeSdk.cs | 7 ------- .../Entities/SetupIntents/SetupIntentNextAction.cs | 3 ++- .../SetupIntents/SetupIntentNextActionUseStripeSdk.cs | 7 ------- src/StripeTests/Services/GeneratedExamplesTest.cs | 1 - 7 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionUseStripeSdk.cs delete mode 100644 src/Stripe.net/Entities/SetupIntents/SetupIntentNextActionUseStripeSdk.cs diff --git a/API_VERSION b/API_VERSION index 0336d6a3a5..fb72506858 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2025-08-27.basil \ No newline at end of file +2025-09-30.clover \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6598803dc3..580d3b4079 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1932 \ No newline at end of file +v1968 \ No newline at end of file diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs index a645089ed7..5478c4dd6c 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; #if NET6_0_OR_GREATER using STJS = System.Text.Json.Serialization; @@ -107,7 +108,7 @@ public class PaymentIntentNextAction : StripeEntity #if NET6_0_OR_GREATER [STJS.JsonPropertyName("use_stripe_sdk")] #endif - public PaymentIntentNextActionUseStripeSdk UseStripeSdk { get; set; } + public Dictionary UseStripeSdk { get; set; } [JsonProperty("verify_with_microdeposits")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionUseStripeSdk.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionUseStripeSdk.cs deleted file mode 100644 index cdf002d2ad..0000000000 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionUseStripeSdk.cs +++ /dev/null @@ -1,7 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - public class PaymentIntentNextActionUseStripeSdk : StripeEntity - { - } -} diff --git a/src/Stripe.net/Entities/SetupIntents/SetupIntentNextAction.cs b/src/Stripe.net/Entities/SetupIntents/SetupIntentNextAction.cs index 400b1efd26..b0e7d7a522 100644 --- a/src/Stripe.net/Entities/SetupIntents/SetupIntentNextAction.cs +++ b/src/Stripe.net/Entities/SetupIntents/SetupIntentNextAction.cs @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec namespace Stripe { + using System.Collections.Generic; using Newtonsoft.Json; #if NET6_0_OR_GREATER using STJS = System.Text.Json.Serialization; @@ -41,7 +42,7 @@ public class SetupIntentNextAction : StripeEntity #if NET6_0_OR_GREATER [STJS.JsonPropertyName("use_stripe_sdk")] #endif - public SetupIntentNextActionUseStripeSdk UseStripeSdk { get; set; } + public Dictionary UseStripeSdk { get; set; } [JsonProperty("verify_with_microdeposits")] #if NET6_0_OR_GREATER diff --git a/src/Stripe.net/Entities/SetupIntents/SetupIntentNextActionUseStripeSdk.cs b/src/Stripe.net/Entities/SetupIntents/SetupIntentNextActionUseStripeSdk.cs deleted file mode 100644 index 71794eb783..0000000000 --- a/src/Stripe.net/Entities/SetupIntents/SetupIntentNextActionUseStripeSdk.cs +++ /dev/null @@ -1,7 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - public class SetupIntentNextActionUseStripeSdk : StripeEntity - { - } -} diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index a0a41f9759..125a83e341 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -3911,7 +3911,6 @@ public void TestSubscriptionSchedulesPost() Quantity = 1, }, }, - Iterations = 12, }, }, }; From 6fb0d458c1e92465a7c41c49da7ad93102bbafbb Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Fri, 19 Sep 2025 13:30:53 -0700 Subject: [PATCH 08/11] `just format` formats entire solution (#3174) --- OPENAPI_VERSION | 2 +- justfile | 2 +- src/Examples/Program.cs | 2 +- src/Examples/V2/ThinEventWebhookHandler.cs | 12 +- .../Entities/DeserializationTest.cs | 406 +++++++++--------- .../Services/GeneratedExamplesTest.cs | 14 +- 6 files changed, 219 insertions(+), 219 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 580d3b4079..62a6e0b6e4 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1968 \ No newline at end of file +v1968 diff --git a/justfile b/justfile index 871aa51e5a..b891bed6de 100644 --- a/justfile +++ b/justfile @@ -20,7 +20,7 @@ ci-test: (_test "--no-build" "" "Release") # ⭐ format all files format *args: # This sets TargetFramework because of a race condition in dotnet format when it tries to format to multiple targets at a time, which could lead to code with compiler errors after it completes - TargetFramework=net5.0 dotnet format src/Stripe.net/Stripe.net.csproj --severity warn {{args}} + TargetFramework=net5.0 dotnet format src/Stripe.net.sln --severity warn {{args}} # verify, but don't modify, the project's formatting format-check: (format "--verify-no-changes") diff --git a/src/Examples/Program.cs b/src/Examples/Program.cs index 4d0ac5f52d..74514af254 100644 --- a/src/Examples/Program.cs +++ b/src/Examples/Program.cs @@ -27,7 +27,7 @@ public Program() /// are set before running the example. /// /// - /// command line args + /// command line args. /// public static async Task Main(string[] args) { diff --git a/src/Examples/V2/ThinEventWebhookHandler.cs b/src/Examples/V2/ThinEventWebhookHandler.cs index dd4e53f889..dbec0d14dc 100644 --- a/src/Examples/V2/ThinEventWebhookHandler.cs +++ b/src/Examples/V2/ThinEventWebhookHandler.cs @@ -22,15 +22,15 @@ namespace Examples.V2 [ApiController] public class ThinEventWebhookHandler : ControllerBase { - private readonly StripeClient _client; - private readonly string _webhookSecret; + private readonly StripeClient client; + private readonly string webhookSecret; public ThinEventWebhookHandler() { var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY"); - _client = new StripeClient(apiKey); + client = new StripeClient(apiKey); - _webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET"); + webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET"); } [HttpPost] @@ -39,10 +39,10 @@ public async Task Index() var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync(); try { - var thinEvent = _client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], _webhookSecret); + var thinEvent = client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], webhookSecret); // Fetch the event data to understand the failure - var baseEvent = await _client.V2.Core.Events.GetAsync(thinEvent.Id); + var baseEvent = await client.V2.Core.Events.GetAsync(thinEvent.Id); if (baseEvent is V1BillingMeterErrorReportTriggeredEvent fullEvent) { var meter = await fullEvent.FetchRelatedObjectAsync(); diff --git a/src/StripeTests/Entities/DeserializationTest.cs b/src/StripeTests/Entities/DeserializationTest.cs index 5a6f715a47..62d4dc381b 100644 --- a/src/StripeTests/Entities/DeserializationTest.cs +++ b/src/StripeTests/Entities/DeserializationTest.cs @@ -1,211 +1,211 @@ namespace StripeTests { - using System; - using System.Collections.Generic; - using System.Linq; - using Newtonsoft.Json; - using Stripe; - using Stripe.Infrastructure; - using Xunit; - - public class DeserializationTest : BaseStripeTest - { - [Fact] - public void TestStubWithIdDirect() + using System; + using System.Collections.Generic; + using System.Linq; + using Newtonsoft.Json; + using Stripe; + using Stripe.Infrastructure; + using Xunit; + + public class DeserializationTest : BaseStripeTest { - string json = "{\"some_ref\":{\"id\":\"xyz\"}}"; - var entity = StripeEntity.FromJson(json); - Assert.NotNull(entity); - Assert.IsType(entity); - var id = entity.SomeRef.Id; - Assert.Equal("xyz", id); - } - - [Fact] - public void TestStubWithIdExpanded() - { - string json = "{\"some_expandable\":{\"id\":\"xyz\"}}"; - var entity = StripeEntity.FromJson(json); - Assert.NotNull(entity); - Assert.IsType(entity); - var id = entity.SomeExpandable.Id; - Assert.Equal("xyz", id); - } - - [Fact] - public void TestStubWithIdArrayExpanded() - { - string json = "{\"some_expanded_array\":[{\"id\":\"xyz\"}]}"; - var entity = StripeEntity.FromJson(json); - Assert.NotNull(entity); - Assert.IsType(entity); - var id = entity.SomeExpandedArray[0].Id; - Assert.Equal("xyz", id); - } - - [Fact] - public void TestStubWithIdInArray() - { - string json = "{\"some_ref_array\":[{\"id\":\"xyz\"}]}"; - var entity = StripeEntity.FromJson(json); - Assert.NotNull(entity); - Assert.IsType(entity); - var id = entity.SomeRefArray[0].Id; - Assert.Equal("xyz", id); - } - - [Fact] - public void TestStubWithIdInListObject() - { - string json = "{\"some_list_object\":{\"data\":[{\"id\":\"xyz\"}]}}"; - var entity = StripeEntity.FromJson(json); - Assert.NotNull(entity); - Assert.IsType(entity); - var enumerator = entity.SomeListObject.GetEnumerator(); - enumerator.MoveNext(); - var id = enumerator.Current.Id; - Assert.Equal("xyz", id); - } - - [Fact] - public void TestEmptyObjectDirect() - { - string json = "{\"some_ref\":{}}"; - var entity = JsonConvert.DeserializeObject(json); - var id = entity.SomeRef.Id; - Assert.Null(id); - } - - [Fact] - public void TestEmptyObjectArray() - { - string json = "{\"some_ref_array\":[{}]}"; - var entity = JsonConvert.DeserializeObject(json); - var id = entity.SomeRefArray[0].Id; - Assert.Null(id); - } - - [Fact] - public void TestEmptyObjectExpanded() - { - string json = "{\"some_expandable\":{}}"; - var entity = JsonConvert.DeserializeObject(json); - var id = entity.SomeExpandable.Id; - Assert.Null(id); - } - - [Fact] - public void TestEmptyObjectArrayExpanded() - { - string json = "{\"some_expanded_array\":[{}]}"; - var entity = JsonConvert.DeserializeObject(json); - var id = entity.SomeExpandedArray[0].Id; - Assert.Null(id); - } - - public class MyEntity : StripeEntity, IHasId - { - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("some_integer")] - public long SomeInteger { get; set; } - - [JsonProperty("some_longinteger")] - public long SomeLonginteger { get; set; } - - [JsonProperty("some_boolean")] - public bool SomeBoolean { get; set; } - - [JsonProperty("some_number")] - public decimal SomeNumber { get; set; } - - [JsonProperty("some_decimal_string")] - public decimal SomeDecimalString { get; set; } - - [JsonProperty("some_string")] - public string SomeString { get; set; } - - [JsonProperty("some_datetime")] - [JsonConverter(typeof(UnixDateTimeConverter))] - public DateTime SomeDatetime { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; - - [JsonProperty("some_ref")] - public MyEntity SomeRef { get; set; } - - [JsonProperty("some_literal")] - public string SomeLiteral { get; set; } - - [JsonProperty("some_nullable")] - public string SomeNullable { get; set; } - - [JsonProperty("some_string_array")] - public List SomeStringArray { get; set; } - - [JsonProperty("some_ref_array")] - public List SomeRefArray { get; set; } + [Fact] + public void TestStubWithIdDirect() + { + string json = "{\"some_ref\":{\"id\":\"xyz\"}}"; + var entity = StripeEntity.FromJson(json); + Assert.NotNull(entity); + Assert.IsType(entity); + var id = entity.SomeRef.Id; + Assert.Equal("xyz", id); + } + + [Fact] + public void TestStubWithIdExpanded() + { + string json = "{\"some_expandable\":{\"id\":\"xyz\"}}"; + var entity = StripeEntity.FromJson(json); + Assert.NotNull(entity); + Assert.IsType(entity); + var id = entity.SomeExpandable.Id; + Assert.Equal("xyz", id); + } + + [Fact] + public void TestStubWithIdArrayExpanded() + { + string json = "{\"some_expanded_array\":[{\"id\":\"xyz\"}]}"; + var entity = StripeEntity.FromJson(json); + Assert.NotNull(entity); + Assert.IsType(entity); + var id = entity.SomeExpandedArray[0].Id; + Assert.Equal("xyz", id); + } + + [Fact] + public void TestStubWithIdInArray() + { + string json = "{\"some_ref_array\":[{\"id\":\"xyz\"}]}"; + var entity = StripeEntity.FromJson(json); + Assert.NotNull(entity); + Assert.IsType(entity); + var id = entity.SomeRefArray[0].Id; + Assert.Equal("xyz", id); + } + + [Fact] + public void TestStubWithIdInListObject() + { + string json = "{\"some_list_object\":{\"data\":[{\"id\":\"xyz\"}]}}"; + var entity = StripeEntity.FromJson(json); + Assert.NotNull(entity); + Assert.IsType(entity); + var enumerator = entity.SomeListObject.GetEnumerator(); + enumerator.MoveNext(); + var id = enumerator.Current.Id; + Assert.Equal("xyz", id); + } + + [Fact] + public void TestEmptyObjectDirect() + { + string json = "{\"some_ref\":{}}"; + var entity = JsonConvert.DeserializeObject(json); + var id = entity.SomeRef.Id; + Assert.Null(id); + } + + [Fact] + public void TestEmptyObjectArray() + { + string json = "{\"some_ref_array\":[{}]}"; + var entity = JsonConvert.DeserializeObject(json); + var id = entity.SomeRefArray[0].Id; + Assert.Null(id); + } + + [Fact] + public void TestEmptyObjectExpanded() + { + string json = "{\"some_expandable\":{}}"; + var entity = JsonConvert.DeserializeObject(json); + var id = entity.SomeExpandable.Id; + Assert.Null(id); + } + + [Fact] + public void TestEmptyObjectArrayExpanded() + { + string json = "{\"some_expanded_array\":[{}]}"; + var entity = JsonConvert.DeserializeObject(json); + var id = entity.SomeExpandedArray[0].Id; + Assert.Null(id); + } + + public class MyEntity : StripeEntity, IHasId + { + [JsonProperty("id")] + public string Id { get; set; } + + [JsonProperty("some_integer")] + public long SomeInteger { get; set; } + + [JsonProperty("some_longinteger")] + public long SomeLonginteger { get; set; } + + [JsonProperty("some_boolean")] + public bool SomeBoolean { get; set; } + + [JsonProperty("some_number")] + public decimal SomeNumber { get; set; } + + [JsonProperty("some_decimal_string")] + public decimal SomeDecimalString { get; set; } + + [JsonProperty("some_string")] + public string SomeString { get; set; } + + [JsonProperty("some_datetime")] + [JsonConverter(typeof(UnixDateTimeConverter))] + public DateTime SomeDatetime { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + [JsonProperty("some_ref")] + public MyEntity SomeRef { get; set; } + + [JsonProperty("some_literal")] + public string SomeLiteral { get; set; } + + [JsonProperty("some_nullable")] + public string SomeNullable { get; set; } + + [JsonProperty("some_string_array")] + public List SomeStringArray { get; set; } + + [JsonProperty("some_ref_array")] + public List SomeRefArray { get; set; } + + #region Expandable SomeExpandedArray + + [JsonIgnore] + public List SomeExpandedArrayIds + { + get => this.InternalSomeExpandedArray?.Select((x) => x.Id).ToList(); + set => this.InternalSomeExpandedArray = SetExpandableArrayIds(value); + } + + [JsonIgnore] + public List SomeExpandedArray + { + get => this.InternalSomeExpandedArray?.Select((x) => x.ExpandedObject).ToList(); + set => this.InternalSomeExpandedArray = SetExpandableArrayObjects(value); + } + + [JsonProperty("some_expanded_array", ItemConverterType = typeof(ExpandableFieldConverter))] + internal List> InternalSomeExpandedArray { get; set; } + #endregion + + [JsonProperty("some_enum")] + public string SomeEnum { get; set; } + + [JsonProperty("some_map")] + public Dictionary SomeMap { get; set; } + + [JsonProperty("some_object")] + public MyEntitySomeObject SomeObject { get; set; } + + [JsonProperty("some_list_object")] + public StripeList SomeListObject { get; set; } + + #region Expandable SomeExpandable + + [JsonIgnore] + public string SomeExpandableId + { + get => this.InternalSomeExpandable?.Id; + set => this.InternalSomeExpandable = SetExpandableFieldId(value, this.InternalSomeExpandable); + } + + [JsonIgnore] + public MyEntity SomeExpandable + { + get => this.InternalSomeExpandable?.ExpandedObject; + set => this.InternalSomeExpandable = SetExpandableFieldObject(value, this.InternalSomeExpandable); + } - #region Expandable SomeExpandedArray + [JsonProperty("some_expandable")] + [JsonConverter(typeof(ExpandableFieldConverter))] + internal ExpandableField InternalSomeExpandable { get; set; } + #endregion - [JsonIgnore] - public List SomeExpandedArrayIds - { - get => this.InternalSomeExpandedArray?.Select((x) => x.Id).ToList(); - set => this.InternalSomeExpandedArray = SetExpandableArrayIds(value); - } + [JsonProperty("some_polymorphic_group")] + public MyEntity SomePolymorphicGroup { get; set; } + } - [JsonIgnore] - public List SomeExpandedArray - { - get => this.InternalSomeExpandedArray?.Select((x) => x.ExpandedObject).ToList(); - set => this.InternalSomeExpandedArray = SetExpandableArrayObjects(value); - } - - [JsonProperty("some_expanded_array", ItemConverterType = typeof(ExpandableFieldConverter))] - internal List> InternalSomeExpandedArray { get; set; } - #endregion - - [JsonProperty("some_enum")] - public string SomeEnum { get; set; } - - [JsonProperty("some_map")] - public Dictionary SomeMap { get; set; } - - [JsonProperty("some_object")] - public MyEntitySomeObject SomeObject { get; set; } - - [JsonProperty("some_list_object")] - public StripeList SomeListObject { get; set; } - - #region Expandable SomeExpandable - - [JsonIgnore] - public string SomeExpandableId - { - get => this.InternalSomeExpandable?.Id; - set => this.InternalSomeExpandable = SetExpandableFieldId(value, this.InternalSomeExpandable); - } - - [JsonIgnore] - public MyEntity SomeExpandable - { - get => this.InternalSomeExpandable?.ExpandedObject; - set => this.InternalSomeExpandable = SetExpandableFieldObject(value, this.InternalSomeExpandable); - } - - [JsonProperty("some_expandable")] - [JsonConverter(typeof(ExpandableFieldConverter))] - internal ExpandableField InternalSomeExpandable { get; set; } - #endregion - - [JsonProperty("some_polymorphic_group")] - public MyEntity SomePolymorphicGroup { get; set; } - } - - public class MyEntitySomeObject : StripeEntity - { - [JsonProperty("some_string")] - public string SomeString { get; set; } + public class MyEntitySomeObject : StripeEntity + { + [JsonProperty("some_string")] + public string SomeString { get; set; } + } } - } } diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index 125a83e341..a91e363ab4 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -6434,9 +6434,9 @@ public void TestTemporarySessionExpiredError() var exception = Assert.Throws( () => { - var options = new Stripe.V2.Billing.MeterEventStreamCreateOptions - { - Events = new List + var options = new Stripe.V2.Billing.MeterEventStreamCreateOptions + { + Events = new List { new Stripe.V2.Billing.MeterEventStreamCreateEventOptions { @@ -6447,10 +6447,10 @@ public void TestTemporarySessionExpiredError() }, }, }, - }; - var client = new StripeClient(this.Requestor); - var service = client.V2.Billing.MeterEventStream; - service.Create(options); + }; + var client = new StripeClient(this.Requestor); + var service = client.V2.Billing.MeterEventStream; + service.Create(options); }); this.AssertRequest( HttpMethod.Post, From ccf0c39d79167b1930e3561280656eadf9cc056b Mon Sep 17 00:00:00 2001 From: jar-stripe Date: Fri, 19 Sep 2025 14:25:31 -0700 Subject: [PATCH 09/11] Adds ability to specify file name and type when calling FileService.Create (#3171) --- .../FormEncoding/ContentEncoder.cs | 4 + .../FormEncoding/FormEncoder.cs | 4 + .../FormEncoding/MultipartFormDataContent.cs | 25 +++- .../Services/Files/FileCreateOptions.cs | 3 +- .../Services/_common/MultipartFileContent.cs | 31 +++++ .../MultipartFormDataContentTest.cs | 127 ++++++++++++++++++ .../Services/Files/FileServiceTest.cs | 11 +- .../Services/GeneratedExamplesTest.cs | 7 +- 8 files changed, 199 insertions(+), 13 deletions(-) create mode 100644 src/Stripe.net/Services/_common/MultipartFileContent.cs diff --git a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs index aeb2453cc8..32733e638c 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs @@ -145,6 +145,10 @@ private static List> FlattenParamsValue(object valu flatParams = SingleParam(keyPrefix, s); break; + case MultipartFileContent f: + flatParams = SingleParam(keyPrefix, f); + break; + case Stream s: flatParams = SingleParam(keyPrefix, s); break; diff --git a/src/Stripe.net/Infrastructure/FormEncoding/FormEncoder.cs b/src/Stripe.net/Infrastructure/FormEncoding/FormEncoder.cs index 53b2441bae..2c9bca954d 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/FormEncoder.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/FormEncoder.cs @@ -116,6 +116,10 @@ private static List> FlattenParamsValue(object valu flatParams = SingleParam(keyPrefix, s); break; + case MultipartFileContent f: + flatParams = SingleParam(keyPrefix, f); + break; + case Stream s: flatParams = SingleParam(keyPrefix, s); break; diff --git a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs index d7ff9b3427..4c2c46d290 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs @@ -41,26 +41,29 @@ public MultipartFormDataContent( private static StringContent CreateStringContent(string value) => new StringContent(value, System.Text.Encoding.UTF8); - private static StreamContent CreateStreamContent(Stream value, string name) + private static StreamContent CreateStreamContent(MultipartFileContent value, string name) { - var fileName = "blob"; - var extension = string.Empty; + var fileName = value.Name ?? "blob"; + var extension = Path.GetExtension(fileName); + var stream = value.Data; - FileStream fileStream = value as FileStream; + FileStream fileStream = stream as FileStream; if ((fileStream != null) && (!string.IsNullOrEmpty(fileStream.Name))) { fileName = fileStream.Name; extension = Path.GetExtension(fileName); } - var content = new StreamContent(value); + var type = value.Type ?? MimeTypes.GetMimeType(extension); + + var content = new StreamContent(stream); content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = name, FileName = fileName, FileNameStar = fileName, }; - content.Headers.ContentType = new MediaTypeHeaderValue(MimeTypes.GetMimeType(extension)); + content.Headers.ContentType = new MediaTypeHeaderValue(type); return content; } @@ -79,8 +82,16 @@ private void ProcessParameters(IEnumerable> nameVal this.Add(CreateStringContent(s), QuoteString(kvp.Key)); break; + case MultipartFileContent f: + this.Add(CreateStreamContent(f, QuoteString(kvp.Key))); + break; + case Stream s: - this.Add(CreateStreamContent(s, QuoteString(kvp.Key))); + var fileData = new MultipartFileContent + { + Data = s, + }; + this.Add(CreateStreamContent(fileData, QuoteString(kvp.Key))); break; default: diff --git a/src/Stripe.net/Services/Files/FileCreateOptions.cs b/src/Stripe.net/Services/Files/FileCreateOptions.cs index a252e950b2..093dcefc53 100644 --- a/src/Stripe.net/Services/Files/FileCreateOptions.cs +++ b/src/Stripe.net/Services/Files/FileCreateOptions.cs @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec namespace Stripe { - using System.IO; using Newtonsoft.Json; #if NET6_0_OR_GREATER using STJS = System.Text.Json.Serialization; @@ -17,7 +16,7 @@ public class FileCreateOptions : BaseOptions #if NET6_0_OR_GREATER [STJS.JsonPropertyName("file")] #endif - public Stream File { get; set; } + public MultipartFileContent File { get; set; } /// /// Optional parameters that automatically create a + /// Represents Data and optional Name and Type that will be encoded as multipart form + /// data. Used in e.g. FileService.Create. + /// + /// + public class MultipartFileContent + { + /// + /// The file data to send. If this is a FileStream, the SDK will infer + /// the name and type from the file name and extension. If this is not + /// a FileStream set Name and Type to configure the file upload. + /// + public Stream Data { get; set; } + + /// + /// The optional name to send with this file data. Uses the file name if omitted + /// and Data is a FileStream. + /// + public string Name { get; set; } + + /// + /// The optional mime type to use when sending file data. Uses the type that + /// matches the file extension from Name (or the file name from Data) if omitted. + /// + public string Type { get; set; } + } +} diff --git a/src/StripeTests/Infrastructure/FormEncoding/MultipartFormDataContentTest.cs b/src/StripeTests/Infrastructure/FormEncoding/MultipartFormDataContentTest.cs index 30f2bf6c40..fcaa77faad 100644 --- a/src/StripeTests/Infrastructure/FormEncoding/MultipartFormDataContentTest.cs +++ b/src/StripeTests/Infrastructure/FormEncoding/MultipartFormDataContentTest.cs @@ -5,6 +5,7 @@ namespace StripeTests using System.IO; using System.Text; using System.Threading.Tasks; + using Stripe; using Stripe.Infrastructure.FormEncoding; using Xunit; @@ -71,6 +72,132 @@ public async Task Ctor_OneStreamEntry_Success() result); } + [Fact] + public async Task Ctor_OneMultipartFileContentEntry_Success() + { + var source = new Dictionary + { + { "key", new MultipartFileContent { Data = new MemoryStream(Encoding.UTF8.GetBytes("Hello World!")) } }, + }; + var content = new MultipartFormDataContent(source, "test-boundary"); + + var stream = await content.ReadAsStreamAsync(); + Assert.Equal(174, stream.Length); + var result = new StreamReader(stream).ReadToEnd(); + Assert.Equal( + "--test-boundary\r\n" + + "Content-Disposition: form-data; name=\"key\"; filename=blob; filename*=utf-8''blob\r\n" + + "Content-Type: application/octet-stream\r\n\r\nHello World!\r\n" + + "--test-boundary--\r\n", + result); + } + + [Fact] + public async Task Ctor_OneMultipartFileContentWithNameEntry_Success() + { + var source = new Dictionary + { + { + "key", new MultipartFileContent + { + Data = new MemoryStream(Encoding.UTF8.GetBytes("Hello World!")), + Name = "file", + } + }, + }; + var content = new MultipartFormDataContent(source, "test-boundary"); + + var stream = await content.ReadAsStreamAsync(); + Assert.Equal(174, stream.Length); + var result = new StreamReader(stream).ReadToEnd(); + Assert.Equal( + "--test-boundary\r\n" + + "Content-Disposition: form-data; name=\"key\"; filename=file; filename*=utf-8''file\r\n" + + "Content-Type: application/octet-stream\r\n\r\nHello World!\r\n" + + "--test-boundary--\r\n", + result); + } + + [Fact] + public async Task Ctor_OneMultipartFileContentWithNameAndExtEntry_Success() + { + var source = new Dictionary + { + { + "key", new MultipartFileContent + { + Data = new MemoryStream(Encoding.UTF8.GetBytes("Hello World!")), + Name = "file.csv", + } + }, + }; + var content = new MultipartFormDataContent(source, "test-boundary"); + + var stream = await content.ReadAsStreamAsync(); + Assert.Equal(166, stream.Length); + var result = new StreamReader(stream).ReadToEnd(); + Assert.Equal( + "--test-boundary\r\n" + + "Content-Disposition: form-data; name=\"key\"; filename=file.csv; filename*=utf-8''file.csv\r\n" + + "Content-Type: text/csv\r\n\r\nHello World!\r\n" + + "--test-boundary--\r\n", + result); + } + + [Fact] + public async Task Ctor_OneMultipartFileContentWithNameAndTypeEntry_Success() + { + var source = new Dictionary + { + { + "key", new MultipartFileContent + { + Data = new MemoryStream(Encoding.UTF8.GetBytes("Hello World!")), + Name = "file", + Type = "application/json", + } + }, + }; + var content = new MultipartFormDataContent(source, "test-boundary"); + + var stream = await content.ReadAsStreamAsync(); + Assert.Equal(166, stream.Length); + var result = new StreamReader(stream).ReadToEnd(); + Assert.Equal( + "--test-boundary\r\n" + + "Content-Disposition: form-data; name=\"key\"; filename=file; filename*=utf-8''file\r\n" + + "Content-Type: application/json\r\n\r\nHello World!\r\n" + + "--test-boundary--\r\n", + result); + } + + [Fact] + public async Task Ctor_OneMultipartFileContentWithNameAndExtAndTypeEntry_Success() + { + var source = new Dictionary + { + { + "key", new MultipartFileContent + { + Data = new MemoryStream(Encoding.UTF8.GetBytes("Hello World!")), + Name = "file.json", + Type = "application/octet-stream", + } + }, + }; + var content = new MultipartFormDataContent(source, "test-boundary"); + + var stream = await content.ReadAsStreamAsync(); + Assert.Equal(184, stream.Length); + var result = new StreamReader(stream).ReadToEnd(); + Assert.Equal( + "--test-boundary\r\n" + + "Content-Disposition: form-data; name=\"key\"; filename=file.json; filename*=utf-8''file.json\r\n" + + "Content-Type: application/octet-stream\r\n\r\nHello World!\r\n" + + "--test-boundary--\r\n", + result); + } + [Fact] public async Task Ctor_TwoEntries_Success() { diff --git a/src/StripeTests/Services/Files/FileServiceTest.cs b/src/StripeTests/Services/Files/FileServiceTest.cs index 9a0bd84032..bdf88084cd 100644 --- a/src/StripeTests/Services/Files/FileServiceTest.cs +++ b/src/StripeTests/Services/Files/FileServiceTest.cs @@ -28,9 +28,13 @@ public FileServiceTest( { this.service = new FileService(this.StripeClient); + var resourceStream = typeof(FileServiceTest).GetTypeInfo().Assembly.GetManifestResourceStream(FileName); this.createOptions = new FileCreateOptions { - File = typeof(FileServiceTest).GetTypeInfo().Assembly.GetManifestResourceStream(FileName), + File = new MultipartFileContent + { + Data = resourceStream, + }, FileLinkData = new FileFileLinkDataOptions { Create = true, @@ -44,7 +48,10 @@ public FileServiceTest( this.base64Options = new FileCreateOptions { - File = new MemoryStream(Convert.FromBase64String("c3RyaXBlLWRvdG5ldA==")), + File = new MultipartFileContent + { + Data = new MemoryStream(Convert.FromBase64String("c3RyaXBlLWRvdG5ldA==")), + }, Purpose = FilePurpose.BusinessLogo, }; diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index a91e363ab4..ee1712c6c8 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -1330,8 +1330,11 @@ public void TestFilesPost() var options = new FileCreateOptions { Purpose = "account_requirement", - File = new System.IO.MemoryStream( - System.Text.Encoding.UTF8.GetBytes("File contents")), + File = new Stripe.MultipartFileContent + { + Data = new System.IO.MemoryStream( + System.Text.Encoding.UTF8.GetBytes("File contents")), + }, }; var service = new FileService(this.StripeClient); File file = service.Create(options); From d1d78defb27baecbd8baec0e21b16c80361d141d Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 23 Sep 2025 12:57:21 -0700 Subject: [PATCH 10/11] Fix merge issues --- src/Stripe.net/Services/V2/CoreService.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Stripe.net/Services/V2/CoreService.cs b/src/Stripe.net/Services/V2/CoreService.cs index 8e4639b768..0814ad9bf7 100644 --- a/src/Stripe.net/Services/V2/CoreService.cs +++ b/src/Stripe.net/Services/V2/CoreService.cs @@ -32,9 +32,6 @@ internal CoreService(IStripeClient client) public virtual V2.Core.EventDestinationService EventDestinations => this.eventDestinations ??= new V2.Core.EventDestinationService( this.Requestor); - public virtual V2.Core.EventDestinationService EventDestinations => this.eventDestinations ??= new V2.Core.EventDestinationService( - this.Requestor); - public virtual V2.Core.VaultService Vault => this.vault ??= new V2.Core.VaultService( this.Requestor); } From b56889a9e8f9f41cb6904dd52b4831d0e37a9a5a Mon Sep 17 00:00:00 2001 From: Ramya Rao Date: Tue, 23 Sep 2025 13:02:01 -0700 Subject: [PATCH 11/11] Remove unused events --- src/Stripe.net/Services/V2/CoreService.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Stripe.net/Services/V2/CoreService.cs b/src/Stripe.net/Services/V2/CoreService.cs index 0814ad9bf7..0cc4c756e1 100644 --- a/src/Stripe.net/Services/V2/CoreService.cs +++ b/src/Stripe.net/Services/V2/CoreService.cs @@ -9,7 +9,6 @@ public class CoreService : Service { private V2.Core.AccountService accounts; private V2.Core.AccountLinkService accountLinks; - private V2.Core.EventService events; private V2.Core.EventDestinationService eventDestinations; private V2.Core.VaultService vault;