diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 312540b61f..4e1cbb2de0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,3 +9,15 @@ List out the key changes made in this PR, e.g. ### See Also + +## Changelog + diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf37f496d..d3a5017e9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 52.0.0 - 2026-06-05 + +This release **doesn't** change the pinned API version; it still uses `2026-05-27.dahlia`. + +We're doing an out-of-band-major to update a field type that changed. If you're not using `tax_details`, this is a no-op release when compared with the last one. If you _are_ using `tax_details` its type has changed slightly and you'll have to update your code when upgrading. + +* [#3396](https://github.com/stripe/stripe-dotnet/pull/3396) ⚠️ Make `tax_rate.tax_details` expandable +* [#3394](https://github.com/stripe/stripe-dotnet/pull/3394) Add "source" field to user-agent header + ## 51.3.0-alpha.2 - 2026-06-03 * [#3389](https://github.com/stripe/stripe-dotnet/pull/3389) Update generated code for private-preview * Add support for new resources `DelegatedCheckout.OrderEvent`, `DelegatedCheckout.Order`, `V2.Billing.ContractLicensePricingQuantityChange`, `V2.Billing.Contract`, and `V2.Signals.AccountSignal` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 759dc3b52e..c3b520d074 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -656489921ee220b536bc00fc1c8ee7ed528f24e2 \ No newline at end of file +aa10ab9548143dbe396ae1e91e443c64473cbdc2 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bd44999eba..733547a80f 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2290 \ No newline at end of file +v2294 \ No newline at end of file diff --git a/README.md b/README.md index c094ea5ab4..c322b72f2b 100644 --- a/README.md +++ b/README.md @@ -363,7 +363,7 @@ StripeConfiguration.AddBetaVersion("feature_beta", "v3"); > This feature is only available from version 46 of this SDK. -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`. +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`. 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`. Note that access to specific private preview API features may require separate approval. ### Custom requests diff --git a/src/Stripe.net/Constants/ApiVersion.cs b/src/Stripe.net/Constants/ApiVersion.cs index 07c2450002..51c65a3e5f 100644 --- a/src/Stripe.net/Constants/ApiVersion.cs +++ b/src/Stripe.net/Constants/ApiVersion.cs @@ -3,6 +3,6 @@ namespace Stripe { internal class ApiVersion { - public const string Current = "2026-06-03.preview"; + public const string Current = "2026-06-10.preview"; } } \ No newline at end of file diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefits.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefits.cs index 20f7cf6e1e..b2bdaffbe3 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefits.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefits.cs @@ -8,6 +8,10 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeEntityConverter))] public class ChargePaymentMethodDetailsCardBenefits : StripeEntity { + [JsonProperty("fr_meal_voucher")] + [STJS.JsonPropertyName("fr_meal_voucher")] + public ChargePaymentMethodDetailsCardBenefitsFrMealVoucher FrMealVoucher { get; set; } + /// /// Issuer of the benefit card utilized on this payment. /// diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefitsFrMealVoucher.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefitsFrMealVoucher.cs new file mode 100644 index 0000000000..2aa08b827e --- /dev/null +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardBenefitsFrMealVoucher.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ChargePaymentMethodDetailsCardBenefitsFrMealVoucher : StripeEntity + { + /// + /// The 14-digit SIRET of the meal voucher acceptor used for this charge. + /// + [JsonProperty("siret")] + [STJS.JsonPropertyName("siret")] + public string Siret { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresent.cs index 4a60766ff0..01b40e0712 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresent.cs @@ -163,6 +163,10 @@ public class ChargePaymentMethodDetailsCardPresent : StripeEntity /// Identifies which network this charge was processed on. Can be amex, /// cartes_bancaires, diners, discover, eftpos_au, diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetailsReauthorization.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresentMulticapture.cs similarity index 69% rename from src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetailsReauthorization.cs rename to src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresentMulticapture.cs index d4df2a3be4..0061b20f4f 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetailsReauthorization.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresentMulticapture.cs @@ -6,10 +6,10 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeEntityConverter))] - public class PaymentIntentAdvancedFeatureDetailsReauthorization : StripeEntity + public class ChargePaymentMethodDetailsCardPresentMulticapture : StripeEntity { /// - /// Indicates whether the feature is supported. + /// Indicates whether or not multiple captures are supported. /// One of: available, or unavailable. /// [JsonProperty("status")] diff --git a/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetails.cs b/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetails.cs index 86080cffa8..b4d97f71d6 100644 --- a/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetails.cs +++ b/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetails.cs @@ -37,6 +37,10 @@ public class SessionCurrentAttemptPaymentMethodDetails : StripeEntityaccel, amex, carnet, cartes_bancaires, /// conecs, diners, discover, eftpos_au, elo, - /// girocard, interac, jcb, link, maestro, + /// girocard, interac, jaywan, jcb, link, maestro, /// mastercard, nyce, pulse, rupay, star, /// unionpay, unknown, or visa. /// diff --git a/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetailsPix.cs b/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetailsPix.cs new file mode 100644 index 0000000000..0d177fb7a8 --- /dev/null +++ b/src/Stripe.net/Entities/Checkout/Sessions/SessionCurrentAttemptPaymentMethodDetailsPix.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe.Checkout +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class SessionCurrentAttemptPaymentMethodDetailsPix : StripeEntity + { + /// + /// Uniquely identifies this particular Pix account. You can use this attribute to check + /// whether two Pix accounts are the same. + /// + [JsonProperty("fingerprint")] + [STJS.JsonPropertyName("fingerprint")] + public string Fingerprint { get; set; } + } +} diff --git a/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresent.cs index 0c122e4f52..4e2d03713e 100644 --- a/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresent.cs @@ -163,6 +163,10 @@ public class ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethod [STJS.JsonPropertyName("location")] public string Location { get; set; } + [JsonProperty("multicapture")] + [STJS.JsonPropertyName("multicapture")] + public ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture Multicapture { get; set; } + /// /// Identifies which network this charge was processed on. Can be amex, /// cartes_bancaires, diners, discover, eftpos_au, diff --git a/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs b/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs new file mode 100644 index 0000000000..de1338b55a --- /dev/null +++ b/src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture : StripeEntity + { + /// + /// Indicates whether or not multiple captures are supported. + /// One of: available, or unavailable. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperation.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperation.cs new file mode 100644 index 0000000000..becce638db --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperation.cs @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// A GiftCardOperation represents an operation performed on a third-party gift card, such + /// as activation, deactivation, reload, cashout, balance check, or void. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperation : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// Details about a gift card activation operation. + /// + [JsonProperty("activation")] + [STJS.JsonPropertyName("activation")] + public GiftCardOperationActivation Activation { get; set; } + + /// + /// Details about a gift card activation void operation. + /// + [JsonProperty("activation_void")] + [STJS.JsonPropertyName("activation_void")] + public GiftCardOperationActivationVoid ActivationVoid { get; set; } + + /// + /// Details about a gift card balance check operation. + /// + [JsonProperty("balance_check")] + [STJS.JsonPropertyName("balance_check")] + public GiftCardOperationBalanceCheck BalanceCheck { get; set; } + + /// + /// Details about a gift card cashout operation. + /// + [JsonProperty("cashout")] + [STJS.JsonPropertyName("cashout")] + public GiftCardOperationCashout Cashout { get; set; } + + /// + /// Details about a gift card cashout void operation. + /// + [JsonProperty("cashout_void")] + [STJS.JsonPropertyName("cashout_void")] + public GiftCardOperationCashoutVoid CashoutVoid { get; set; } + + /// + /// The timestamp of when this operation was completed. + /// + [JsonProperty("completed_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("completed_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime CompletedAt { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// + [JsonProperty("created")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("created")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Details about a gift card deactivation operation. + /// + [JsonProperty("deactivation")] + [STJS.JsonPropertyName("deactivation")] + public GiftCardOperationDeactivation Deactivation { get; set; } + + /// + /// The failure code of the operation. Only present if the status is failed. + /// One of: action_not_supported, card_already_activated, card_expired, + /// card_not_activated, do_not_honor, generic_failure, + /// insufficient_balance, invalid_amount, invalid_currency, + /// invalid_number, invalid_pin, invalid_track_data, lost_card, + /// lost_or_stolen_card, pin_required, pin_tries_exceeded, + /// processing_error, provider_unavailable, stolen_card, + /// suspected_fraud, or timeout. + /// + [JsonProperty("failure_code")] + [STJS.JsonPropertyName("failure_code")] + public string FailureCode { get; set; } + + #region Expandable GiftCard + + /// + /// (ID of the GiftCard) + /// The gift card this operation was performed on. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public string GiftCardId + { + get => this.InternalGiftCard?.Id; + set => this.InternalGiftCard = SetExpandableFieldId(value, this.InternalGiftCard); + } + + /// + /// (Expanded) + /// The gift card this operation was performed on. + /// + /// For more information, see the expand documentation. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public GiftCard GiftCard + { + get => this.InternalGiftCard?.ExpandedObject; + set => this.InternalGiftCard = SetExpandableFieldObject(value, this.InternalGiftCard); + } + + [JsonProperty("gift_card")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("gift_card")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalGiftCard { get; set; } + #endregion + + /// + /// If the object exists in live mode, the value is true. If the object exists in + /// test mode, the value is false. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// The connected account whose credentials were used to perform this operation. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + + /// + /// Details about a gift card reload operation. + /// + [JsonProperty("reload")] + [STJS.JsonPropertyName("reload")] + public GiftCardOperationReload Reload { get; set; } + + /// + /// Details about a gift card reload void operation. + /// + [JsonProperty("reload_void")] + [STJS.JsonPropertyName("reload_void")] + public GiftCardOperationReloadVoid ReloadVoid { get; set; } + + /// + /// The status of the operation. + /// One of: failed, or succeeded. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + + /// + /// The type of operation performed. + /// One of: activation, activation_void, balance_check, cashout, + /// cashout_void, deactivation, reload, or reload_void. + /// + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivation.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivation.cs new file mode 100644 index 0000000000..8531fb1db0 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivation.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationActivation : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationActivationBalance Balance { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationBalance.cs new file mode 100644 index 0000000000..ca562c2af3 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationActivationBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationVoid.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationVoid.cs new file mode 100644 index 0000000000..062abad9b8 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationActivationVoid.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationActivationVoid : StripeEntity + { + /// + /// The operation that was voided. + /// + [JsonProperty("voided_operation")] + [STJS.JsonPropertyName("voided_operation")] + public string VoidedOperation { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheck.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheck.cs new file mode 100644 index 0000000000..6656526749 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheck.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationBalanceCheck : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationBalanceCheckBalance Balance { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheckBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheckBalance.cs new file mode 100644 index 0000000000..e5f1aec77e --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationBalanceCheckBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationBalanceCheckBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashout.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashout.cs new file mode 100644 index 0000000000..a18e3d8451 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashout.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationCashout : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationCashoutBalance Balance { get; set; } + + /// + /// The balance before the operation. + /// + [JsonProperty("previous_balance")] + [STJS.JsonPropertyName("previous_balance")] + public GiftCardOperationCashoutPreviousBalance PreviousBalance { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutBalance.cs new file mode 100644 index 0000000000..195834d54a --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationCashoutBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutPreviousBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutPreviousBalance.cs new file mode 100644 index 0000000000..9373b2ea55 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutPreviousBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationCashoutPreviousBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoid.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoid.cs new file mode 100644 index 0000000000..0773185dce --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoid.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationCashoutVoid : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationCashoutVoidBalance Balance { get; set; } + + /// + /// The operation that was voided. + /// + [JsonProperty("voided_operation")] + [STJS.JsonPropertyName("voided_operation")] + public string VoidedOperation { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoidBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoidBalance.cs new file mode 100644 index 0000000000..4ac26aeaf6 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationCashoutVoidBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationCashoutVoidBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationDeactivation.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationDeactivation.cs new file mode 100644 index 0000000000..d212968d6b --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationDeactivation.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationDeactivation : StripeEntity + { + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReload.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReload.cs new file mode 100644 index 0000000000..b2920a5851 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReload.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationReload : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationReloadBalance Balance { get; set; } + + /// + /// The balance before the operation. + /// + [JsonProperty("previous_balance")] + [STJS.JsonPropertyName("previous_balance")] + public GiftCardOperationReloadPreviousBalance PreviousBalance { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadBalance.cs new file mode 100644 index 0000000000..94b8bd00de --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationReloadBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadPreviousBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadPreviousBalance.cs new file mode 100644 index 0000000000..08fe92cc0b --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadPreviousBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationReloadPreviousBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoid.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoid.cs new file mode 100644 index 0000000000..958b47d833 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoid.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationReloadVoid : StripeEntity + { + /// + /// The balance amount of a gift card, including currency and amount. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardOperationReloadVoidBalance Balance { get; set; } + + /// + /// The operation that was voided. + /// + [JsonProperty("voided_operation")] + [STJS.JsonPropertyName("voided_operation")] + public string VoidedOperation { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoidBalance.cs b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoidBalance.cs new file mode 100644 index 0000000000..dad9c48c61 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCardOperations/GiftCardOperationReloadVoidBalance.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCardOperationReloadVoidBalance : StripeEntity + { + /// + /// The balance amount. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// The currency of the balance. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/GiftCards/GiftCard.cs b/src/Stripe.net/Entities/GiftCards/GiftCard.cs new file mode 100644 index 0000000000..4d2d6c2785 --- /dev/null +++ b/src/Stripe.net/Entities/GiftCards/GiftCard.cs @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// Represents third-party gift cards that can be used as a payment method through Stripe. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class GiftCard : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// The brand of the gift card. + /// One of: fiserv_valuelink, givex, or svs. + /// + [JsonProperty("brand")] + [STJS.JsonPropertyName("brand")] + public string Brand { get; set; } + + /// + /// The expiration month of the gift card. + /// + [JsonProperty("exp_month")] + [STJS.JsonPropertyName("exp_month")] + public long? ExpMonth { get; set; } + + /// + /// The expiration year of the gift card. + /// + [JsonProperty("exp_year")] + [STJS.JsonPropertyName("exp_year")] + public long? ExpYear { get; set; } + + #region Expandable LastOperation + + /// + /// (ID of the GiftCardOperation) + /// The last operation performed on this gift card. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public string LastOperationId + { + get => this.InternalLastOperation?.Id; + set => this.InternalLastOperation = SetExpandableFieldId(value, this.InternalLastOperation); + } + + /// + /// (Expanded) + /// The last operation performed on this gift card. + /// + /// For more information, see the expand documentation. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public GiftCardOperation LastOperation + { + get => this.InternalLastOperation?.ExpandedObject; + set => this.InternalLastOperation = SetExpandableFieldObject(value, this.InternalLastOperation); + } + + [JsonProperty("last_operation")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("last_operation")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalLastOperation { get; set; } + #endregion + + /// + /// The last four digits of the gift card number. + /// + [JsonProperty("last4")] + [STJS.JsonPropertyName("last4")] + public string Last4 { get; set; } + + /// + /// If the object exists in live mode, the value is true. If the object exists in + /// test mode, the value is false. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs index 3dc44ca9c6..0c1f20e3f6 100644 --- a/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs +++ b/src/Stripe.net/Entities/Issuing/Authorizations/AuthorizationTokenDetailsNetworkDataVisa.cs @@ -16,8 +16,7 @@ public class AuthorizationTokenDetailsNetworkDataVisa : StripeEntity - /// Stripe's recommendation to the network for this token activation request, derived from - /// the same risk signals used for the activation decision. + /// The network's recommendation to Stripe for this token activation request. /// One of: approve, decline, or recommend_id_and_v. /// [JsonProperty("token_decision_recommendation")] diff --git a/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs b/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs index 49df38aa74..36a8e9310a 100644 --- a/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs +++ b/src/Stripe.net/Entities/Issuing/Disputes/Dispute.cs @@ -123,6 +123,13 @@ public class Dispute : StripeEntity, IHasId, IHasMetadata, IHasObject, [STJS.JsonPropertyName("network_lifecycle")] public DisputeNetworkLifecycle NetworkLifecycle { get; set; } + /// + /// Provisional credit details for this dispute. + /// + [JsonProperty("provisional_credit")] + [STJS.JsonPropertyName("provisional_credit")] + public DisputeProvisionalCredit ProvisionalCredit { get; set; } + /// /// Current status of the dispute. /// One of: expired, lost, submitted, unsubmitted, or diff --git a/src/Stripe.net/Entities/Issuing/Disputes/DisputeProvisionalCredit.cs b/src/Stripe.net/Entities/Issuing/Disputes/DisputeProvisionalCredit.cs new file mode 100644 index 0000000000..873c02e9d4 --- /dev/null +++ b/src/Stripe.net/Entities/Issuing/Disputes/DisputeProvisionalCredit.cs @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec +namespace Stripe.Issuing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class DisputeProvisionalCredit : StripeEntity + { + /// + /// The time by which the platform must grant a provisional credit to the consumer. + /// + [JsonProperty("grant_deadline")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("grant_deadline")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? GrantDeadline { get; set; } + + /// + /// The time at which the platform reported granting the provisional credit. + /// + [JsonProperty("granted_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("granted_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? GrantedAt { get; set; } + + /// + /// The earliest time after which the platform can revoke the provisional credit. + /// + [JsonProperty("revocable_after")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("revocable_after")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? RevocableAfter { get; set; } + + /// + /// The time at which the platform reported revoking the provisional credit. + /// + [JsonProperty("revoked_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("revoked_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? RevokedAt { get; set; } + + /// + /// The status of the provisional credit obligation. + /// One of: delinquent, granted, not_required, permanent, + /// required, revocable, revocation_notice_period, or revoked. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs index 743cf711f6..6813986752 100644 --- a/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs +++ b/src/Stripe.net/Entities/Issuing/Tokens/TokenNetworkDataVisa.cs @@ -16,8 +16,7 @@ public class TokenNetworkDataVisa : StripeEntity public string CardReferenceId { get; set; } /// - /// Stripe's recommendation to the network for this token activation request, derived from - /// the same risk signals used for the activation decision. + /// The network's recommendation to Stripe for this token activation request. /// One of: approve, decline, or recommend_id_and_v. /// [JsonProperty("token_decision_recommendation")] diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresent.cs index 9dd8a657ee..656c6f53a5 100644 --- a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresent.cs @@ -163,6 +163,10 @@ public class PaymentAttemptRecordPaymentMethodDetailsCardPresent : StripeEntity< [STJS.JsonPropertyName("location")] public string Location { get; set; } + [JsonProperty("multicapture")] + [STJS.JsonPropertyName("multicapture")] + public PaymentAttemptRecordPaymentMethodDetailsCardPresentMulticapture Multicapture { get; set; } + /// /// Identifies which network this charge was processed on. Can be amex, /// cartes_bancaires, diners, discover, eftpos_au, diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresentMulticapture.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresentMulticapture.cs new file mode 100644 index 0000000000..fd2527105d --- /dev/null +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresentMulticapture.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentAttemptRecordPaymentMethodDetailsCardPresentMulticapture : StripeEntity + { + /// + /// Indicates whether or not multiple captures are supported. + /// One of: available, or unavailable. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetails.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetails.cs index 7d64dadefd..647198635a 100644 --- a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetails.cs +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetails.cs @@ -17,8 +17,30 @@ public class PaymentAttemptRecordProcessorDetails : StripeEntity + /// Represents the Fiserv ValueLink gift card processor. + /// + [JsonProperty("fiserv_valuelink")] + [STJS.JsonPropertyName("fiserv_valuelink")] + public PaymentAttemptRecordProcessorDetailsFiservValuelink FiservValuelink { get; set; } + + /// + /// Represents the Givex gift card processor. + /// + [JsonProperty("givex")] + [STJS.JsonPropertyName("givex")] + public PaymentAttemptRecordProcessorDetailsGivex Givex { get; set; } + + /// + /// Represents the SVS gift card processor. + /// + [JsonProperty("svs")] + [STJS.JsonPropertyName("svs")] + public PaymentAttemptRecordProcessorDetailsSvs Svs { get; set; } + /// /// The processor used for this payment attempt. + /// One of: custom, fiserv_valuelink, givex, or svs. /// [JsonProperty("type")] [STJS.JsonPropertyName("type")] diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsFiservValuelink.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsFiservValuelink.cs new file mode 100644 index 0000000000..6254f766a1 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsFiservValuelink.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentAttemptRecordProcessorDetailsFiservValuelink : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsGivex.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsGivex.cs new file mode 100644 index 0000000000..046f1b7fcb --- /dev/null +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsGivex.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentAttemptRecordProcessorDetailsGivex : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsSvs.cs b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsSvs.cs new file mode 100644 index 0000000000..65c6828916 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordProcessorDetailsSvs.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentAttemptRecordProcessorDetailsSvs : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs index 22a4e61656..79161e07f4 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntent.cs @@ -392,6 +392,15 @@ public Charge LatestCharge internal ExpandableField InternalLatestCharge { get; set; } #endregion + /// + /// ID of the latest Payment + /// Attempt Record object created by this PaymentIntent. This property is null + /// until PaymentIntent confirmation is attempted. + /// + [JsonProperty("latest_payment_attempt_record")] + [STJS.JsonPropertyName("latest_payment_attempt_record")] + public string LatestPaymentAttemptRecord { get; set; } + /// /// If the object exists in live mode, the value is true. If the object exists in /// test mode, the value is false. @@ -531,6 +540,43 @@ public PaymentMethod PaymentMethod [STJS.JsonPropertyName("payment_method_types")] public List PaymentMethodTypes { get; set; } + #region Expandable PaymentRecord + + /// + /// (ID of the PaymentRecord) + /// ID of the Payment Record object + /// created by this PaymentIntent. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public string PaymentRecordId + { + get => this.InternalPaymentRecord?.Id; + set => this.InternalPaymentRecord = SetExpandableFieldId(value, this.InternalPaymentRecord); + } + + /// + /// (Expanded) + /// ID of the Payment Record object + /// created by this PaymentIntent. + /// + /// For more information, see the expand documentation. + /// + [JsonIgnore] + [STJS.JsonIgnore] + public PaymentRecord PaymentRecord + { + get => this.InternalPaymentRecord?.ExpandedObject; + set => this.InternalPaymentRecord = SetExpandableFieldObject(value, this.InternalPaymentRecord); + } + + [JsonProperty("payment_record")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("payment_record")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalPaymentRecord { get; set; } + #endregion + /// /// When you enable this parameter, this PaymentIntent will route your payment to processors /// that you configure in the dashboard. diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetails.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetails.cs index 8dbef5119a..fba05df4b2 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetails.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentAdvancedFeatureDetails.cs @@ -33,18 +33,5 @@ public class PaymentIntentAdvancedFeatureDetails : StripeEntity - /// Timestamp at which the reauthorization window closes. - /// - [JsonProperty("reauthorize_before")] - [JsonConverter(typeof(UnixDateTimeConverter))] - [STJS.JsonPropertyName("reauthorize_before")] - [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] - public DateTime? ReauthorizeBefore { get; set; } } } diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs index c44dcbd886..f5fc72c3cd 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs @@ -16,6 +16,13 @@ public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase : S [STJS.JsonPropertyName("address")] public string Address { get; set; } + /// + /// The wallet address that should receive refunds for deposits on this network. + /// + [JsonProperty("refund_address")] + [STJS.JsonPropertyName("refund_address")] + public string RefundAddress { get; set; } + /// /// The token currencies supported on this network. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs index 5dbbcce646..0a53762a58 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs @@ -16,6 +16,13 @@ public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana : [STJS.JsonPropertyName("address")] public string Address { get; set; } + /// + /// The wallet address that should receive refunds for deposits on this network. + /// + [JsonProperty("refund_address")] + [STJS.JsonPropertyName("refund_address")] + public string RefundAddress { get; set; } + /// /// The token currencies supported on this network. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs index f56cabd3f2..3f532a7cfb 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs @@ -16,6 +16,13 @@ public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo : [STJS.JsonPropertyName("address")] public string Address { get; set; } + /// + /// The wallet address that should receive refunds for deposits on this network. + /// + [JsonProperty("refund_address")] + [STJS.JsonPropertyName("refund_address")] + public string RefundAddress { get; set; } + /// /// The token currencies supported on this network. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetails.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetails.cs index 0be94cf59d..be667cfb33 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetails.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentDetails.cs @@ -46,6 +46,13 @@ public class PaymentIntentPaymentDetails : StripeEntity FlightData { get; set; } + /// + /// The Payment Location associated with this PaymentIntent. + /// + [JsonProperty("location")] + [STJS.JsonPropertyName("location")] + public string Location { get; set; } + [JsonProperty("lodging_data")] [STJS.JsonPropertyName("lodging_data")] public List LodgingData { get; set; } diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCard.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCard.cs index 4e62e6ec85..dabe4809aa 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCard.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCard.cs @@ -8,6 +8,21 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeEntityConverter))] public class PaymentIntentPaymentMethodOptionsCard : StripeEntity { + /// + /// Controls when funds are captured from the customer's account when capture_method + /// is automatic_delayed. + /// + /// If omitted, funds are captured before the authorization expires. + /// One of: auth_expiry, end_of_day, or target_delay. + /// + [JsonProperty("capture_by")] + [STJS.JsonPropertyName("capture_by")] + public string CaptureBy { get; set; } + + [JsonProperty("capture_delay")] + [STJS.JsonPropertyName("capture_delay")] + public PaymentIntentPaymentMethodOptionsCardCaptureDelay CaptureDelay { get; set; } + /// /// Controls when the funds will be captured from the customer's account. /// diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelay.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelay.cs new file mode 100644 index 0000000000..d00a6723b8 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelay.cs @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentIntentPaymentMethodOptionsCardCaptureDelay : StripeEntity + { + /// + /// The number of days to delay the capture of the funds. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("days")] + [STJS.JsonPropertyName("days")] + public long Days { get; set; } + + /// + /// The number of hours to delay the capture of the funds. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("hours")] + [STJS.JsonPropertyName("hours")] + public long Hours { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresent.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresent.cs index decaff4019..91524369d2 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresent.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresent.cs @@ -8,6 +8,21 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeEntityConverter))] public class PaymentIntentPaymentMethodOptionsCardPresent : StripeEntity { + /// + /// Controls when funds are captured from the customer's account when capture_method + /// is automatic_delayed. + /// + /// If omitted, funds are captured before the authorization expires. + /// One of: auth_expiry, end_of_day, or target_delay. + /// + [JsonProperty("capture_by")] + [STJS.JsonPropertyName("capture_by")] + public string CaptureBy { get; set; } + + [JsonProperty("capture_delay")] + [STJS.JsonPropertyName("capture_delay")] + public PaymentIntentPaymentMethodOptionsCardPresentCaptureDelay CaptureDelay { get; set; } + /// /// Controls when the funds will be captured from the customer's account. /// One of: manual, or manual_preferred. @@ -37,6 +52,15 @@ public class PaymentIntentPaymentMethodOptionsCardPresent : StripeEntity + /// Request ability to make multiple + /// captures for this PaymentIntent. + /// One of: if_available, or never. + /// + [JsonProperty("request_multicapture")] + [STJS.JsonPropertyName("request_multicapture")] + public string RequestMulticapture { get; set; } + /// /// Request ability to reauthorize for this diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelay.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelay.cs new file mode 100644 index 0000000000..fa77df8b2b --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelay.cs @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentIntentPaymentMethodOptionsCardPresentCaptureDelay : StripeEntity + { + /// + /// The number of days to delay the capture of the funds. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("days")] + [STJS.JsonPropertyName("days")] + public long Days { get; set; } + + /// + /// The number of hours to delay the capture of the funds. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("hours")] + [STJS.JsonPropertyName("hours")] + public long Hours { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs index ef9d73acf7..2c875d47d0 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs @@ -14,7 +14,7 @@ public class PaymentIntentPaymentMethodOptionsCrypto : StripeEntity /// The mode of the crypto payment. - /// One of: default, or deposit. + /// One of: default, deposit, or transaction_verification. /// [JsonProperty("mode")] [STJS.JsonPropertyName("mode")] diff --git a/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent.cs index beda143329..f61c545de8 100644 --- a/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent.cs @@ -163,6 +163,10 @@ public class PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent : Str [STJS.JsonPropertyName("location")] public string Location { get; set; } + [JsonProperty("multicapture")] + [STJS.JsonPropertyName("multicapture")] + public PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture Multicapture { get; set; } + /// /// Identifies which network this charge was processed on. Can be amex, /// cartes_bancaires, diners, discover, eftpos_au, diff --git a/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs b/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs new file mode 100644 index 0000000000..05e2126642 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresentMulticapture : StripeEntity + { + /// + /// Indicates whether or not multiple captures are supported. + /// One of: available, or unavailable. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresent.cs index bf1552257f..a533f53763 100644 --- a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresent.cs @@ -163,6 +163,10 @@ public class PaymentRecordPaymentMethodDetailsCardPresent : StripeEntity /// Identifies which network this charge was processed on. Can be amex, /// cartes_bancaires, diners, discover, eftpos_au, diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresentMulticapture.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresentMulticapture.cs new file mode 100644 index 0000000000..19bdef31ae --- /dev/null +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresentMulticapture.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentRecordPaymentMethodDetailsCardPresentMulticapture : StripeEntity + { + /// + /// Indicates whether or not multiple captures are supported. + /// One of: available, or unavailable. + /// + [JsonProperty("status")] + [STJS.JsonPropertyName("status")] + public string Status { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetails.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetails.cs index f1df2ec159..12c2b27180 100644 --- a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetails.cs +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetails.cs @@ -17,8 +17,30 @@ public class PaymentRecordProcessorDetails : StripeEntity + /// Represents the Fiserv ValueLink gift card processor. + /// + [JsonProperty("fiserv_valuelink")] + [STJS.JsonPropertyName("fiserv_valuelink")] + public PaymentRecordProcessorDetailsFiservValuelink FiservValuelink { get; set; } + + /// + /// Represents the Givex gift card processor. + /// + [JsonProperty("givex")] + [STJS.JsonPropertyName("givex")] + public PaymentRecordProcessorDetailsGivex Givex { get; set; } + + /// + /// Represents the SVS gift card processor. + /// + [JsonProperty("svs")] + [STJS.JsonPropertyName("svs")] + public PaymentRecordProcessorDetailsSvs Svs { get; set; } + /// /// The processor used for this payment attempt. + /// One of: custom, fiserv_valuelink, givex, or svs. /// [JsonProperty("type")] [STJS.JsonPropertyName("type")] diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsFiservValuelink.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsFiservValuelink.cs new file mode 100644 index 0000000000..3724b9fab3 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsFiservValuelink.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentRecordProcessorDetailsFiservValuelink : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsGivex.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsGivex.cs new file mode 100644 index 0000000000..721795ff6f --- /dev/null +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsGivex.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentRecordProcessorDetailsGivex : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsSvs.cs b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsSvs.cs new file mode 100644 index 0000000000..f97a950cec --- /dev/null +++ b/src/Stripe.net/Entities/PaymentRecords/PaymentRecordProcessorDetailsSvs.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class PaymentRecordProcessorDetailsSvs : StripeEntity + { + /// + /// An opaque string for manual reconciliation of this payment, for example a check number + /// or a payment processor ID. + /// + [JsonProperty("payment_reference")] + [STJS.JsonPropertyName("payment_reference")] + public string PaymentReference { get; set; } + } +} diff --git a/src/Stripe.net/Entities/SetupIntents/SetupIntentSetupDetails.cs b/src/Stripe.net/Entities/SetupIntents/SetupIntentSetupDetails.cs index f38326b427..f22eeaa425 100644 --- a/src/Stripe.net/Entities/SetupIntents/SetupIntentSetupDetails.cs +++ b/src/Stripe.net/Entities/SetupIntents/SetupIntentSetupDetails.cs @@ -11,5 +11,12 @@ public class SetupIntentSetupDetails : StripeEntity [JsonProperty("benefit")] [STJS.JsonPropertyName("benefit")] public SetupIntentSetupDetailsBenefit Benefit { get; set; } + + /// + /// The Payment Location associated with this SetupIntent. + /// + [JsonProperty("location")] + [STJS.JsonPropertyName("location")] + public string Location { get; set; } } } diff --git a/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItem.cs b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItem.cs index c80d042de4..0ef80304a1 100644 --- a/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItem.cs +++ b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItem.cs @@ -68,6 +68,18 @@ public class CalculationLineItem : StripeEntity, IHasId, IH [STJS.JsonPropertyName("performance_location")] public string PerformanceLocation { get; set; } + /// + /// The address of the location where this line item's event or service takes place. + /// Depending on the tax code, providing a + /// performance location is required, optional, or not supported. Use this to provide the + /// address inline without pre-creating a TaxLocation object. Can't be used with + /// performance_location. + /// + [JsonProperty("performance_location_details")] + [STJS.JsonPropertyName("performance_location_details")] + public CalculationLineItemPerformanceLocationDetails PerformanceLocationDetails { get; set; } + /// /// The ID of an existing Product. /// diff --git a/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetails.cs b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetails.cs new file mode 100644 index 0000000000..61b094323a --- /dev/null +++ b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetails.cs @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec +namespace Stripe.Tax +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class CalculationLineItemPerformanceLocationDetails : StripeEntity + { + [JsonProperty("address")] + [STJS.JsonPropertyName("address")] + public CalculationLineItemPerformanceLocationDetailsAddress Address { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetailsAddress.cs b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetailsAddress.cs new file mode 100644 index 0000000000..a4913b6622 --- /dev/null +++ b/src/Stripe.net/Entities/Tax/CalculationLineItems/CalculationLineItemPerformanceLocationDetailsAddress.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.Tax +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class CalculationLineItemPerformanceLocationDetailsAddress : StripeEntity + { + /// + /// City, district, suburb, town, or village. + /// + [JsonProperty("city")] + [STJS.JsonPropertyName("city")] + public string City { get; set; } + + /// + /// Two-letter country code (ISO + /// 3166-1 alpha-2). + /// + [JsonProperty("country")] + [STJS.JsonPropertyName("country")] + public string Country { get; set; } + + /// + /// Address line 1, such as the street, PO Box, or company name. + /// + [JsonProperty("line1")] + [STJS.JsonPropertyName("line1")] + public string Line1 { get; set; } + + /// + /// Address line 2, such as the apartment, suite, unit, or building. + /// + [JsonProperty("line2")] + [STJS.JsonPropertyName("line2")] + public string Line2 { get; set; } + + /// + /// ZIP or postal code. + /// + [JsonProperty("postal_code")] + [STJS.JsonPropertyName("postal_code")] + public string PostalCode { get; set; } + + /// + /// State/province as an ISO 3166-2 + /// subdivision code, without country prefix, such as "NY" or "TX". + /// + [JsonProperty("state")] + [STJS.JsonPropertyName("state")] + public string State { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItem.cs b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItem.cs index 25127f6836..95ca7cc784 100644 --- a/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItem.cs +++ b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItem.cs @@ -58,6 +58,18 @@ public class TransactionLineItem : StripeEntity, IHasId, IH [STJS.JsonPropertyName("metadata")] public Dictionary Metadata { get; set; } + /// + /// The address of the location where this line item's event or service takes place. + /// Depending on the tax code, providing a + /// performance location is required, optional, or not supported. Use this to provide the + /// address inline without pre-creating a TaxLocation object. Can't be used with + /// performance_location. + /// + [JsonProperty("performance_location_details")] + [STJS.JsonPropertyName("performance_location_details")] + public TransactionLineItemPerformanceLocationDetails PerformanceLocationDetails { get; set; } + /// /// The ID of an existing Product. /// diff --git a/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetails.cs b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetails.cs new file mode 100644 index 0000000000..081725b977 --- /dev/null +++ b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetails.cs @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec +namespace Stripe.Tax +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TransactionLineItemPerformanceLocationDetails : StripeEntity + { + [JsonProperty("address")] + [STJS.JsonPropertyName("address")] + public TransactionLineItemPerformanceLocationDetailsAddress Address { get; set; } + } +} diff --git a/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetailsAddress.cs b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetailsAddress.cs new file mode 100644 index 0000000000..2bb0826d37 --- /dev/null +++ b/src/Stripe.net/Entities/Tax/TransactionLineItems/TransactionLineItemPerformanceLocationDetailsAddress.cs @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec +namespace Stripe.Tax +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TransactionLineItemPerformanceLocationDetailsAddress : StripeEntity + { + /// + /// City, district, suburb, town, or village. + /// + [JsonProperty("city")] + [STJS.JsonPropertyName("city")] + public string City { get; set; } + + /// + /// Two-letter country code (ISO + /// 3166-1 alpha-2). + /// + [JsonProperty("country")] + [STJS.JsonPropertyName("country")] + public string Country { get; set; } + + /// + /// Address line 1, such as the street, PO Box, or company name. + /// + [JsonProperty("line1")] + [STJS.JsonPropertyName("line1")] + public string Line1 { get; set; } + + /// + /// Address line 2, such as the apartment, suite, unit, or building. + /// + [JsonProperty("line2")] + [STJS.JsonPropertyName("line2")] + public string Line2 { get; set; } + + /// + /// ZIP or postal code. + /// + [JsonProperty("postal_code")] + [STJS.JsonPropertyName("postal_code")] + public string PostalCode { get; set; } + + /// + /// State/province as an ISO 3166-2 + /// subdivision code, without country prefix, such as "NY" or "TX". + /// + [JsonProperty("state")] + [STJS.JsonPropertyName("state")] + public string State { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFund.cs b/src/Stripe.net/Entities/TaxFunds/TaxFund.cs new file mode 100644 index 0000000000..9de1365ca2 --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFund.cs @@ -0,0 +1,92 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + /// + /// A TaxFund object represents a single tax float sweep event — funds moved between a + /// merchant's payments balance and their tax fund financial account for Stripe Tax + /// obligations. + /// + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFund : StripeEntity, IHasId, IHasObject + { + /// + /// Unique identifier for the object. + /// + [JsonProperty("id")] + [STJS.JsonPropertyName("id")] + public string Id { get; set; } + + /// + /// String representing the object's type. Objects of the same type share the same value. + /// + [JsonProperty("object")] + [STJS.JsonPropertyName("object")] + public string Object { get; set; } + + /// + /// Amount swept, in the smallest currency unit. Always positive. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long Amount { get; set; } + + /// + /// Associated billing or tax documents for this sweep. + /// + [JsonProperty("context")] + [STJS.JsonPropertyName("context")] + public TaxFundContext Context { get; set; } + + /// + /// Time at which the object was created. Measured in seconds since the Unix epoch. + /// + [JsonProperty("created")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("created")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime Created { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch; + + /// + /// Three-letter ISO currency + /// code, in lowercase. Must be a supported + /// currency. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// Where funds moved to. + /// + [JsonProperty("destination")] + [STJS.JsonPropertyName("destination")] + public TaxFundDestination Destination { get; set; } + + /// + /// If the object exists in live mode, the value is true. If the object exists in + /// test mode, the value is false. + /// + [JsonProperty("livemode")] + [STJS.JsonPropertyName("livemode")] + public bool Livemode { get; set; } + + /// + /// Where funds moved from. + /// + [JsonProperty("source")] + [STJS.JsonPropertyName("source")] + public TaxFundSource Source { get; set; } + + /// + /// What caused the sweep. + /// + [JsonProperty("trigger")] + [STJS.JsonPropertyName("trigger")] + public TaxFundTrigger Trigger { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundContext.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundContext.cs new file mode 100644 index 0000000000..5cf2c9e8ff --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundContext.cs @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundContext : StripeEntity + { + [JsonProperty("checkout_session")] + [STJS.JsonPropertyName("checkout_session")] + public string CheckoutSession { get; set; } + + [JsonProperty("credit_note")] + [STJS.JsonPropertyName("credit_note")] + public string CreditNote { get; set; } + + [JsonProperty("invoice")] + [STJS.JsonPropertyName("invoice")] + public string Invoice { get; set; } + + [JsonProperty("payment_intent")] + [STJS.JsonPropertyName("payment_intent")] + public string PaymentIntent { get; set; } + + [JsonProperty("refund")] + [STJS.JsonPropertyName("refund")] + public string Refund { get; set; } + + [JsonProperty("tax_transaction")] + [STJS.JsonPropertyName("tax_transaction")] + public string TaxTransaction { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundDestination.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundDestination.cs new file mode 100644 index 0000000000..b5aa3e8127 --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundDestination.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundDestination : StripeEntity + { + /// + /// Details about the payments balance side of the sweep. + /// + [JsonProperty("payments_balance")] + [STJS.JsonPropertyName("payments_balance")] + public TaxFundDestinationPaymentsBalance PaymentsBalance { get; set; } + + /// + /// Details about the tax fund financial account side of the sweep. + /// + [JsonProperty("tax_fund_account")] + [STJS.JsonPropertyName("tax_fund_account")] + public TaxFundDestinationTaxFundAccount TaxFundAccount { get; set; } + + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationPaymentsBalance.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationPaymentsBalance.cs new file mode 100644 index 0000000000..8326aee640 --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationPaymentsBalance.cs @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundDestinationPaymentsBalance : StripeEntity + { + #region Expandable BalanceTransaction + + [JsonIgnore] + [STJS.JsonIgnore] + public string BalanceTransactionId + { + get => this.InternalBalanceTransaction?.Id; + set => this.InternalBalanceTransaction = SetExpandableFieldId(value, this.InternalBalanceTransaction); + } + + [JsonIgnore] + [STJS.JsonIgnore] + public BalanceTransaction BalanceTransaction + { + get => this.InternalBalanceTransaction?.ExpandedObject; + set => this.InternalBalanceTransaction = SetExpandableFieldObject(value, this.InternalBalanceTransaction); + } + + [JsonProperty("balance_transaction")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("balance_transaction")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalBalanceTransaction { get; set; } + #endregion + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationTaxFundAccount.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationTaxFundAccount.cs new file mode 100644 index 0000000000..95693427ed --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundDestinationTaxFundAccount.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundDestinationTaxFundAccount : StripeEntity + { + [JsonProperty("financial_account")] + [STJS.JsonPropertyName("financial_account")] + public string FinancialAccount { get; set; } + + [JsonProperty("transaction")] + [STJS.JsonPropertyName("transaction")] + public string Transaction { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundSource.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundSource.cs new file mode 100644 index 0000000000..4044900dce --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundSource.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundSource : StripeEntity + { + /// + /// Details about the payments balance side of the sweep. + /// + [JsonProperty("payments_balance")] + [STJS.JsonPropertyName("payments_balance")] + public TaxFundSourcePaymentsBalance PaymentsBalance { get; set; } + + /// + /// Details about the tax fund financial account side of the sweep. + /// + [JsonProperty("tax_fund_account")] + [STJS.JsonPropertyName("tax_fund_account")] + public TaxFundSourceTaxFundAccount TaxFundAccount { get; set; } + + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundSourcePaymentsBalance.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundSourcePaymentsBalance.cs new file mode 100644 index 0000000000..bc31791c9e --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundSourcePaymentsBalance.cs @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundSourcePaymentsBalance : StripeEntity + { + #region Expandable BalanceTransaction + + [JsonIgnore] + [STJS.JsonIgnore] + public string BalanceTransactionId + { + get => this.InternalBalanceTransaction?.Id; + set => this.InternalBalanceTransaction = SetExpandableFieldId(value, this.InternalBalanceTransaction); + } + + [JsonIgnore] + [STJS.JsonIgnore] + public BalanceTransaction BalanceTransaction + { + get => this.InternalBalanceTransaction?.ExpandedObject; + set => this.InternalBalanceTransaction = SetExpandableFieldObject(value, this.InternalBalanceTransaction); + } + + [JsonProperty("balance_transaction")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("balance_transaction")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalBalanceTransaction { get; set; } + #endregion + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundSourceTaxFundAccount.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundSourceTaxFundAccount.cs new file mode 100644 index 0000000000..86a8fe37c8 --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundSourceTaxFundAccount.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundSourceTaxFundAccount : StripeEntity + { + [JsonProperty("financial_account")] + [STJS.JsonPropertyName("financial_account")] + public string FinancialAccount { get; set; } + + [JsonProperty("transaction")] + [STJS.JsonPropertyName("transaction")] + public string Transaction { get; set; } + } +} diff --git a/src/Stripe.net/Entities/TaxFunds/TaxFundTrigger.cs b/src/Stripe.net/Entities/TaxFunds/TaxFundTrigger.cs new file mode 100644 index 0000000000..b213fec9b3 --- /dev/null +++ b/src/Stripe.net/Entities/TaxFunds/TaxFundTrigger.cs @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class TaxFundTrigger : StripeEntity + { + #region Expandable BalanceTransaction + + [JsonIgnore] + [STJS.JsonIgnore] + public string BalanceTransactionId + { + get => this.InternalBalanceTransaction?.Id; + set => this.InternalBalanceTransaction = SetExpandableFieldId(value, this.InternalBalanceTransaction); + } + + [JsonIgnore] + [STJS.JsonIgnore] + public BalanceTransaction BalanceTransaction + { + get => this.InternalBalanceTransaction?.ExpandedObject; + set => this.InternalBalanceTransaction = SetExpandableFieldObject(value, this.InternalBalanceTransaction); + } + + [JsonProperty("balance_transaction")] + [JsonConverter(typeof(ExpandableFieldConverter))] + [STJS.JsonPropertyName("balance_transaction")] + [STJS.JsonConverter(typeof(STJExpandableFieldConverter))] + internal ExpandableField InternalBalanceTransaction { get; set; } + #endregion + + [JsonProperty("type")] + [STJS.JsonPropertyName("type")] + public string Type { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Commerce/ProductCatalogImports/ProductCatalogImport.cs b/src/Stripe.net/Entities/V2/Commerce/ProductCatalogImports/ProductCatalogImport.cs index aece3c8896..ce5b05fd72 100644 --- a/src/Stripe.net/Entities/V2/Commerce/ProductCatalogImports/ProductCatalogImport.cs +++ b/src/Stripe.net/Entities/V2/Commerce/ProductCatalogImports/ProductCatalogImport.cs @@ -38,7 +38,7 @@ public class ProductCatalogImport : StripeEntity, IHasId, /// /// The type of feed data being imported into the product catalog. - /// One of: inventory, pricing, or product. + /// One of: inventory, pricing, product, or promotion. /// [JsonProperty("feed_type")] [STJS.JsonPropertyName("feed_type")] diff --git a/src/Stripe.net/Entities/V2/Core/Accounts/AccountDefaultsResponsibilities.cs b/src/Stripe.net/Entities/V2/Core/Accounts/AccountDefaultsResponsibilities.cs index 7b726a1dd4..ab05b799b9 100644 --- a/src/Stripe.net/Entities/V2/Core/Accounts/AccountDefaultsResponsibilities.cs +++ b/src/Stripe.net/Entities/V2/Core/Accounts/AccountDefaultsResponsibilities.cs @@ -19,7 +19,7 @@ public class AccountDefaultsResponsibilities : StripeEntity - /// A value indicating responsibility for collecting requirements on this account. + /// A value indicating the responsibility for losses on this account. /// One of: application, or stripe. /// [JsonProperty("losses_collector")] diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatch.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatch.cs index ac732dcd4b..43fef982e0 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatch.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatch.cs @@ -41,7 +41,7 @@ public class FeeBatch : StripeEntity, IHasId, IHasObject /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeBatchAmount Amount { get; set; } /// /// The entity that collected this batch. diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustments.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustments.cs index 76fdbd42bc..15925e385a 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustments.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustments.cs @@ -13,6 +13,6 @@ public class FeeBatchAdjustments : StripeEntity /// [JsonProperty("tax_adjustment")] [STJS.JsonPropertyName("tax_adjustment")] - public V2.Amount TaxAdjustment { get; set; } + public FeeBatchAdjustmentsTaxAdjustment TaxAdjustment { get; set; } } } diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustmentsTaxAdjustment.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustmentsTaxAdjustment.cs new file mode 100644 index 0000000000..cea1d7e106 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAdjustmentsTaxAdjustment.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeBatchAdjustmentsTaxAdjustment : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAmount.cs new file mode 100644 index 0000000000..ee09cc3f13 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeBatchAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecord.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecord.cs index 1eb17c532b..8d800ff351 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecord.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecord.cs @@ -13,7 +13,7 @@ public class FeeBatchCollectionRecord : StripeEntity /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeBatchCollectionRecordAmount Amount { get; set; } /// /// The ID of the associated v1 balance transaction. diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordAmount.cs new file mode 100644 index 0000000000..0a3e7ad790 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeBatchCollectionRecordAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTax.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTax.cs index d1f3a54fac..2e564ca57d 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTax.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTax.cs @@ -13,6 +13,6 @@ public class FeeBatchCollectionRecordTax : StripeEntity [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeBatchCollectionRecordTaxAmount Amount { get; set; } } } diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTaxAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTaxAmount.cs new file mode 100644 index 0000000000..3ce0aea22e --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchCollectionRecordTaxAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeBatchCollectionRecordTaxAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTax.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTax.cs index 708a9b03c2..592298a32e 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTax.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTax.cs @@ -13,6 +13,6 @@ public class FeeBatchTax : StripeEntity /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeBatchTaxAmount Amount { get; set; } } } diff --git a/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTaxAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTaxAmount.cs new file mode 100644 index 0000000000..50625706ba --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeBatches/FeeBatchTaxAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeBatchTaxAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntry.cs b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntry.cs index 71f20b8350..76fa713cb1 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntry.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntry.cs @@ -32,7 +32,7 @@ public class FeeEntry : StripeEntity, IHasId, IHasObject /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeEntryAmount Amount { get; set; } /// /// The entity that assessed this fee. diff --git a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryAmount.cs new file mode 100644 index 0000000000..4d39c6a618 --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeEntryAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTax.cs b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTax.cs index 264bf4d5d3..7bf6310427 100644 --- a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTax.cs +++ b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTax.cs @@ -13,6 +13,6 @@ public class FeeEntryTax : StripeEntity /// [JsonProperty("amount")] [STJS.JsonPropertyName("amount")] - public V2.Amount Amount { get; set; } + public FeeEntryTaxAmount Amount { get; set; } } } diff --git a/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTaxAmount.cs b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTaxAmount.cs new file mode 100644 index 0000000000..d5c86019fb --- /dev/null +++ b/src/Stripe.net/Entities/V2/Core/FeeEntries/FeeEntryTaxAmount.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2.Core +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeEntityConverter))] + public class FeeEntryTaxAmount : StripeEntity + { + /// + /// A lowercase alpha3 currency code like "usd" For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// In major units like "1.23" for 1.23 USD For the taxonomy label choice, see + /// SECURE_FRAMEWORKS-2849. + /// + [JsonProperty("value")] + [STJS.JsonPropertyName("value")] + public string Value { get; set; } + } +} diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/InboundTransfers/InboundTransfer.cs b/src/Stripe.net/Entities/V2/MoneyManagement/InboundTransfers/InboundTransfer.cs index 7486ad5b49..bb8c1eefc9 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/InboundTransfers/InboundTransfer.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/InboundTransfers/InboundTransfer.cs @@ -68,7 +68,7 @@ public class InboundTransfer : StripeEntity, IHasId, IHasObject /// /// A hosted transaction receipt URL that is provided when money movement is considered - /// regulated under Stripe’s money transmission licenses. + /// regulated under Stripe's money transmission licenses. /// [JsonProperty("receipt_url")] [STJS.JsonPropertyName("receipt_url")] diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetails.cs b/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetails.cs index e8bbd62e68..b0f2b53887 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetails.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetails.cs @@ -30,7 +30,8 @@ public class TransactionEntryTransactionDetails : StripeEntityreceived_debit_reversal, refund, refund_failure, /// risk_reserved_funds, stripe_balance_payment_debit, /// stripe_balance_payment_debit_reversal, stripe_fee, stripe_fee_tax, - /// tax_withholding, transfer_reversal, or unreconciled_customer_funds. + /// tax_fund, tax_withholding, transfer_reversal, or + /// unreconciled_customer_funds. /// [JsonProperty("category")] [STJS.JsonPropertyName("category")] diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetailsFlow.cs b/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetailsFlow.cs index 6f28952045..3e482f75a3 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetailsFlow.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/TransactionEntries/TransactionEntryTransactionDetailsFlow.cs @@ -128,6 +128,13 @@ public class TransactionEntryTransactionDetailsFlow : StripeEntity + /// If applicable, the ID of the TaxFund that created this Transaction. + /// + [JsonProperty("tax_fund")] + [STJS.JsonPropertyName("tax_fund")] + public string TaxFund { get; set; } + /// /// If applicable, the ID of the Topup that created this Transaction. /// @@ -213,12 +220,13 @@ public class TransactionEntryTransactionDetailsFlow : StripeEntitycharge, currency_conversion, debit_dispute, dispute, /// fee_transaction, inbound_transfer, outbound_payment, /// outbound_transfer, payout, received_credit, received_debit, - /// refund, reserve_hold, reserve_release, topup, - /// transfer, transfer_reversal, treasury_credit_reversal, - /// treasury_debit_reversal, treasury_inbound_transfer, - /// treasury_issuing_authorization, treasury_other, - /// treasury_outbound_payment, treasury_outbound_transfer, - /// treasury_received_credit, or treasury_received_debit. + /// refund, reserve_hold, reserve_release, tax_fund, + /// topup, transfer, transfer_reversal, + /// treasury_credit_reversal, treasury_debit_reversal, + /// treasury_inbound_transfer, treasury_issuing_authorization, + /// treasury_other, treasury_outbound_payment, + /// treasury_outbound_transfer, treasury_received_credit, or + /// treasury_received_debit. /// [JsonProperty("type")] [STJS.JsonPropertyName("type")] diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/Transaction.cs b/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/Transaction.cs index dd024f40cc..46cc4778a7 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/Transaction.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/Transaction.cs @@ -67,7 +67,8 @@ public class Transaction : StripeEntity, IHasId, IHasObject /// received_debit_reversal, refund, refund_failure, /// risk_reserved_funds, stripe_balance_payment_debit, /// stripe_balance_payment_debit_reversal, stripe_fee, stripe_fee_tax, - /// tax_withholding, transfer_reversal, or unreconciled_customer_funds. + /// tax_fund, tax_withholding, transfer_reversal, or + /// unreconciled_customer_funds. /// [JsonProperty("category")] [STJS.JsonPropertyName("category")] diff --git a/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/TransactionFlow.cs b/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/TransactionFlow.cs index 28d3765e80..ccb86680c6 100644 --- a/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/TransactionFlow.cs +++ b/src/Stripe.net/Entities/V2/MoneyManagement/Transactions/TransactionFlow.cs @@ -128,6 +128,13 @@ public class TransactionFlow : StripeEntity [STJS.JsonPropertyName("reserve_release")] public string ReserveRelease { get; set; } + /// + /// If applicable, the ID of the TaxFund that created this Transaction. + /// + [JsonProperty("tax_fund")] + [STJS.JsonPropertyName("tax_fund")] + public string TaxFund { get; set; } + /// /// If applicable, the ID of the Topup that created this Transaction. /// @@ -213,12 +220,13 @@ public class TransactionFlow : StripeEntity /// charge, currency_conversion, debit_dispute, dispute, /// fee_transaction, inbound_transfer, outbound_payment, /// outbound_transfer, payout, received_credit, received_debit, - /// refund, reserve_hold, reserve_release, topup, - /// transfer, transfer_reversal, treasury_credit_reversal, - /// treasury_debit_reversal, treasury_inbound_transfer, - /// treasury_issuing_authorization, treasury_other, - /// treasury_outbound_payment, treasury_outbound_transfer, - /// treasury_received_credit, or treasury_received_debit. + /// refund, reserve_hold, reserve_release, tax_fund, + /// topup, transfer, transfer_reversal, + /// treasury_credit_reversal, treasury_debit_reversal, + /// treasury_inbound_transfer, treasury_issuing_authorization, + /// treasury_other, treasury_outbound_payment, + /// treasury_outbound_transfer, treasury_received_credit, or + /// treasury_received_debit. /// [JsonProperty("type")] [STJS.JsonPropertyName("type")] diff --git a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs index dea5f8f0a6..d7f73e84dc 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs @@ -116,6 +116,8 @@ public static class StripeTypeRegistry { "fr_meal_vouchers_onboarding", typeof(FrMealVouchersOnboarding) }, { "funding_instructions", typeof(FundingInstructions) }, { "fx_quote", typeof(FxQuote) }, + { "gift_card", typeof(GiftCard) }, + { "gift_card_operation", typeof(GiftCardOperation) }, { "identity.blocklist_entry", typeof(Identity.BlocklistEntry) }, { "identity.verification_report", typeof(Identity.VerificationReport) }, { "identity.verification_session", typeof(Identity.VerificationSession) }, @@ -223,6 +225,7 @@ public static class StripeTypeRegistry { "tax.transaction_line_item", typeof(Tax.TransactionLineItem) }, { "tax_code", typeof(TaxCode) }, { "tax_deducted_at_source", typeof(TaxDeductedAtSource) }, + { "tax_fund", typeof(TaxFund) }, { "tax_id", typeof(TaxId) }, { "tax_rate", typeof(TaxRate) }, { "terminal.configuration", typeof(Terminal.Configuration) }, diff --git a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs index 2685f39e56..da626de8dd 100644 --- a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs +++ b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs @@ -8,6 +8,8 @@ namespace Stripe using System.Net; using System.Net.Http; using System.Net.Http.Headers; + using System.Security.Cryptography; + using System.Text; using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; @@ -133,6 +135,9 @@ public SystemNetHttpClient( /// public static TimeSpan MinNetworkRetriesDelay => TimeSpan.FromMilliseconds(500); + /// Gets or sets the cached source hash. + internal static string SourceHash { get; set; } = ComputeSourceHash(); + /// /// Gets whether telemetry was enabled for this client. /// @@ -222,6 +227,35 @@ internal static string DetectAIAgent(Func getEnv) return string.Empty; } + internal static string ComputeSourceHash() + { + try + { + var parts = new System.Collections.Generic.List + { + System.Runtime.InteropServices.RuntimeInformation.OSDescription, + }; + try + { + parts.Add(Environment.MachineName); + } + catch + { + } + + var inputBytes = Encoding.UTF8.GetBytes(string.Join(" ", parts)); + using (var md5 = MD5.Create()) + { + var hashBytes = md5.ComputeHash(inputBytes); + return BitConverter.ToString(hashBytes).Replace("-", string.Empty).ToLowerInvariant(); + } + } + catch + { + return string.Empty; + } + } + private async Task<(HttpResponseMessage responseMessage, int retries)> SendHttpRequest( StripeRequest request, CancellationToken cancellationToken) @@ -297,6 +331,10 @@ private string BuildStripeClientUserAgentString() { "lang", ".net" }, { "stripe_net_target_framework", StripeNetTargetFramework }, }; + if (!string.IsNullOrEmpty(SourceHash)) + { + values["source"] = SourceHash; + } // The following values are in try/catch blocks on the off chance that the // RuntimeInformation methods fail in an unexpected way. This should ~never happen, but diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsDateOfBirthOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsDateOfBirthOptions.cs deleted file mode 100644 index 0e93961c18..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsDateOfBirthOptions.cs +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsDateOfBirthOptions : INestedOptions - { - /// - /// Day of birth, between 1 and 31. - /// - [JsonProperty("day")] - [STJS.JsonPropertyName("day")] - public long? Day { get; set; } - - /// - /// Month of birth, between 1 and 12. - /// - [JsonProperty("month")] - [STJS.JsonPropertyName("month")] - public long? Month { get; set; } - - /// - /// Four-digit year of birth. - /// - [JsonProperty("year")] - [STJS.JsonPropertyName("year")] - public long? Year { get; set; } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions.cs deleted file mode 100644 index bfbbf39994..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions.cs +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions : INestedOptions - { - /// - /// Address. - /// - [JsonProperty("address")] - [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } - - /// - /// Date of birth. - /// - [JsonProperty("date_of_birth")] - [STJS.JsonPropertyName("date_of_birth")] - public ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsDateOfBirthOptions DateOfBirth { get; set; } - - /// - /// Email address. - /// - [JsonProperty("email")] - [STJS.JsonPropertyName("email")] - public string Email { get; set; } - - /// - /// Full name. - /// - [JsonProperty("name")] - [STJS.JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Phone number. - /// - [JsonProperty("phone")] - [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingOptions.cs deleted file mode 100644 index 760ad210e3..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingOptions.cs +++ /dev/null @@ -1,69 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesAccountFundingOptions : INestedOptions, IHasSetTracking - { - private ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions beneficiaryDetails; - private ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions senderDetails; - - [JsonIgnore] - [STJS.JsonIgnore] - internal SetTracker SetTracker { get; } = new SetTracker(); - - /// - /// ID of the Account representing the beneficiary in this account funding transaction. - /// - [JsonProperty("beneficiary_account")] - [STJS.JsonPropertyName("beneficiary_account")] - public string BeneficiaryAccount { get; set; } - - /// - /// Inline identity details for the beneficiary of this account funding transaction. - /// - [JsonProperty("beneficiary_details", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("beneficiary_details")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public ChargePaymentDetailsMoneyServicesAccountFundingBeneficiaryDetailsOptions BeneficiaryDetails - { - get => this.beneficiaryDetails; - set - { - this.beneficiaryDetails = value; - this.SetTracker.Track(); - } - } - - /// - /// ID of the Account representing the sender in this account funding transaction. - /// - [JsonProperty("sender_account")] - [STJS.JsonPropertyName("sender_account")] - public string SenderAccount { get; set; } - - /// - /// Inline identity details for the sender of this account funding transaction. - /// - [JsonProperty("sender_details", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("sender_details")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions SenderDetails - { - get => this.senderDetails; - set - { - this.senderDetails = value; - this.SetTracker.Track(); - } - } - - bool IHasSetTracking.IsPropertySet(string propertyName) - { - return this.SetTracker.IsSet(propertyName); - } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsDateOfBirthOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsDateOfBirthOptions.cs deleted file mode 100644 index 3bc88aa7de..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsDateOfBirthOptions.cs +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsDateOfBirthOptions : INestedOptions - { - /// - /// Day of birth, between 1 and 31. - /// - [JsonProperty("day")] - [STJS.JsonPropertyName("day")] - public long? Day { get; set; } - - /// - /// Month of birth, between 1 and 12. - /// - [JsonProperty("month")] - [STJS.JsonPropertyName("month")] - public long? Month { get; set; } - - /// - /// Four-digit year of birth. - /// - [JsonProperty("year")] - [STJS.JsonPropertyName("year")] - public long? Year { get; set; } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions.cs deleted file mode 100644 index d554e161a4..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions.cs +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsOptions : INestedOptions - { - /// - /// Address. - /// - [JsonProperty("address")] - [STJS.JsonPropertyName("address")] - public AddressOptions Address { get; set; } - - /// - /// Date of birth. - /// - [JsonProperty("date_of_birth")] - [STJS.JsonPropertyName("date_of_birth")] - public ChargePaymentDetailsMoneyServicesAccountFundingSenderDetailsDateOfBirthOptions DateOfBirth { get; set; } - - /// - /// Email address. - /// - [JsonProperty("email")] - [STJS.JsonPropertyName("email")] - public string Email { get; set; } - - /// - /// Full name. - /// - [JsonProperty("name")] - [STJS.JsonPropertyName("name")] - public string Name { get; set; } - - /// - /// Phone number. - /// - [JsonProperty("phone")] - [STJS.JsonPropertyName("phone")] - public string Phone { get; set; } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs deleted file mode 100644 index 43dcbd40f8..0000000000 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsMoneyServicesOptions.cs +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class ChargePaymentDetailsMoneyServicesOptions : INestedOptions, IHasSetTracking - { - private ChargePaymentDetailsMoneyServicesAccountFundingOptions accountFunding; - private string transactionType; - - [JsonIgnore] - [STJS.JsonIgnore] - internal SetTracker SetTracker { get; } = new SetTracker(); - - /// - /// Account funding transaction details including sender and beneficiary information. - /// - [JsonProperty("account_funding", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("account_funding")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public ChargePaymentDetailsMoneyServicesAccountFundingOptions AccountFunding - { - get => this.accountFunding; - set - { - this.accountFunding = value; - this.SetTracker.Track(); - } - } - - /// - /// The type of money services transaction. - /// One of: account_funding, or debt_repayment. - /// - [JsonProperty("transaction_type", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("transaction_type")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public string TransactionType - { - get => this.transactionType; - set - { - this.transactionType = value; - this.SetTracker.Track(); - } - } - - bool IHasSetTracking.IsPropertySet(string propertyName) - { - return this.SetTracker.IsSet(propertyName); - } - } -} diff --git a/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs b/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs index a7edc5cf32..2faa869e69 100644 --- a/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargePaymentDetailsOptions.cs @@ -14,7 +14,6 @@ public class ChargePaymentDetailsOptions : INestedOptions, IHasSetTracking private List fleetData; private List flightData; private List lodgingData; - private ChargePaymentDetailsMoneyServicesOptions moneyServices; private string orderReference; [JsonIgnore] @@ -132,22 +131,6 @@ public List LodgingData } } - /// - /// Money services details for this PaymentIntent. - /// - [JsonProperty("money_services", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("money_services")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public ChargePaymentDetailsMoneyServicesOptions MoneyServices - { - get => this.moneyServices; - set - { - this.moneyServices = value; - this.SetTracker.Track(); - } - } - /// /// A unique value assigned by the business to identify the transaction. Required for L2 and /// L3 rates. diff --git a/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationGetOptions.cs b/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationGetOptions.cs new file mode 100644 index 0000000000..107004f3f5 --- /dev/null +++ b/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationGetOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardOperationGetOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationService.cs b/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationService.cs new file mode 100644 index 0000000000..3cfc57697b --- /dev/null +++ b/src/Stripe.net/Services/GiftCardOperations/GiftCardOperationService.cs @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class GiftCardOperationService : Service, + IRetrievable + { + public GiftCardOperationService() + { + } + + internal GiftCardOperationService(ApiRequestor requestor) + : base(requestor) + { + } + + public GiftCardOperationService(IStripeClient client) + : base(client) + { + } + + /// + ///

Retrieves a third-party gift card operation object.

. + ///
+ public virtual GiftCardOperation Get(string id, GiftCardOperationGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v1/gift_card_operations/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + ///

Retrieves a third-party gift card operation object.

. + ///
+ public virtual Task GetAsync(string id, GiftCardOperationGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v1/gift_card_operations/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardActivateOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardActivateOptions.cs new file mode 100644 index 0000000000..b1548b6dc2 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardActivateOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardActivateOptions : BaseOptions + { + /// + /// The initial balance to set on the gift card. + /// + [JsonProperty("balance")] + [STJS.JsonPropertyName("balance")] + public GiftCardBalanceOptions Balance { get; set; } + + /// + /// The Stripe account ID to process the gift card operation on behalf of. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardBalanceOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardBalanceOptions.cs new file mode 100644 index 0000000000..996d2e64ff --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardBalanceOptions.cs @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardBalanceOptions : INestedOptions + { + /// + /// The initial balance amount to be loaded when activating the gift card, in the smallest + /// currency unit. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long? Amount { get; set; } + + /// + /// Three-letter ISO currency + /// code, in lowercase. Must be a supported + /// currency. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardCashoutOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardCashoutOptions.cs new file mode 100644 index 0000000000..1abdb4cb2d --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardCashoutOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardCashoutOptions : BaseOptions + { + /// + /// The Stripe account ID to process the gift card operation on behalf of. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardCheckBalanceOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardCheckBalanceOptions.cs new file mode 100644 index 0000000000..0042359012 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardCheckBalanceOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardCheckBalanceOptions : BaseOptions + { + /// + /// The Stripe account ID to process the gift card operation on behalf of. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardCreateOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardCreateOptions.cs new file mode 100644 index 0000000000..e8c2a646b9 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardCreateOptions.cs @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardCreateOptions : BaseOptions + { + /// + /// The brand of the gift card. + /// One of: fiserv_valuelink, givex, or svs. + /// + [JsonProperty("brand")] + [STJS.JsonPropertyName("brand")] + public string Brand { get; set; } + + /// + /// Two-digit number representing the gift card's expiration month. + /// + [JsonProperty("exp_month")] + [STJS.JsonPropertyName("exp_month")] + public long? ExpMonth { get; set; } + + /// + /// Four-digit number representing the gift card's expiration year. + /// + [JsonProperty("exp_year")] + [STJS.JsonPropertyName("exp_year")] + public long? ExpYear { get; set; } + + /// + /// The gift card number. + /// + [JsonProperty("number")] + [STJS.JsonPropertyName("number")] + public string Number { get; set; } + + /// + /// The gift card PIN. + /// + [JsonProperty("pin")] + [STJS.JsonPropertyName("pin")] + public string Pin { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardGetOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardGetOptions.cs new file mode 100644 index 0000000000..3f9355377b --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardGetOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardGetOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardReloadOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardReloadOptions.cs new file mode 100644 index 0000000000..de3bab6f47 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardReloadOptions.cs @@ -0,0 +1,34 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardReloadOptions : BaseOptions + { + /// + /// The amount to add to the gift card balance, in the smallest currency unit. + /// + [JsonProperty("amount")] + [STJS.JsonPropertyName("amount")] + public long? Amount { get; set; } + + /// + /// Three-letter ISO currency + /// code, in lowercase. Must be a supported + /// currency. + /// + [JsonProperty("currency")] + [STJS.JsonPropertyName("currency")] + public string Currency { get; set; } + + /// + /// The Stripe account ID to process the gift card operation on behalf of. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardService.cs b/src/Stripe.net/Services/GiftCards/GiftCardService.cs new file mode 100644 index 0000000000..61f61a28e2 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardService.cs @@ -0,0 +1,140 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class GiftCardService : Service, + ICreatable, + IRetrievable + { + public GiftCardService() + { + } + + internal GiftCardService(ApiRequestor requestor) + : base(requestor) + { + } + + public GiftCardService(IStripeClient client) + : base(client) + { + } + + /// + ///

Activates a third-party gift card and optionally sets its balance.

. + ///
+ public virtual GiftCardOperation Activate(string id, GiftCardActivateOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/activate", options, requestOptions); + } + + /// + ///

Activates a third-party gift card and optionally sets its balance.

. + ///
+ public virtual Task ActivateAsync(string id, GiftCardActivateOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/activate", options, requestOptions, cancellationToken); + } + + /// + ///

Cashout a third-party gift card by zeroing its balance.

. + ///
+ public virtual GiftCardOperation Cashout(string id, GiftCardCashoutOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/cashout", options, requestOptions); + } + + /// + ///

Cashout a third-party gift card by zeroing its balance.

. + ///
+ public virtual Task CashoutAsync(string id, GiftCardCashoutOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/cashout", options, requestOptions, cancellationToken); + } + + /// + ///

Checks the balance of a third-party gift card.

. + ///
+ public virtual GiftCardOperation CheckBalance(string id, GiftCardCheckBalanceOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/check_balance", options, requestOptions); + } + + /// + ///

Checks the balance of a third-party gift card.

. + ///
+ public virtual Task CheckBalanceAsync(string id, GiftCardCheckBalanceOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/check_balance", options, requestOptions, cancellationToken); + } + + /// + ///

Creates a gift card object.

. + ///
+ public virtual GiftCard Create(GiftCardCreateOptions options, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards", options, requestOptions); + } + + /// + ///

Creates a gift card object.

. + ///
+ public virtual Task CreateAsync(GiftCardCreateOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards", options, requestOptions, cancellationToken); + } + + /// + ///

Retrieves a third-party gift card object.

. + ///
+ public virtual GiftCard Get(string id, GiftCardGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + ///

Retrieves a third-party gift card object.

. + ///
+ public virtual Task GetAsync(string id, GiftCardGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + + /// + ///

Reloads a third-party gift card by adding the specified amount to its balance.

. + ///
+ public virtual GiftCardOperation Reload(string id, GiftCardReloadOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/reload", options, requestOptions); + } + + /// + ///

Reloads a third-party gift card by adding the specified amount to its balance.

. + ///
+ public virtual Task ReloadAsync(string id, GiftCardReloadOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/reload", options, requestOptions, cancellationToken); + } + + /// + ///

Voids a previously performed gift card operation.

. + ///
+ public virtual GiftCardOperation VoidOperation(string id, GiftCardVoidOperationOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/void_operation", options, requestOptions); + } + + /// + ///

Voids a previously performed gift card operation.

. + ///
+ public virtual Task VoidOperationAsync(string id, GiftCardVoidOperationOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/gift_cards/{WebUtility.UrlEncode(id)}/void_operation", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/GiftCards/GiftCardVoidOperationOptions.cs b/src/Stripe.net/Services/GiftCards/GiftCardVoidOperationOptions.cs new file mode 100644 index 0000000000..f26317c4d6 --- /dev/null +++ b/src/Stripe.net/Services/GiftCards/GiftCardVoidOperationOptions.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class GiftCardVoidOperationOptions : BaseOptions + { + /// + /// The Stripe account ID to process the gift card operation on behalf of. + /// + [JsonProperty("on_behalf_of")] + [STJS.JsonPropertyName("on_behalf_of")] + public string OnBehalfOf { get; set; } + + /// + /// The ID of the gift card operation to void. + /// + [JsonProperty("operation")] + [STJS.JsonPropertyName("operation")] + public string Operation { get; set; } + } +} diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeProvisionalCreditOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeProvisionalCreditOptions.cs new file mode 100644 index 0000000000..ed558d781f --- /dev/null +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeProvisionalCreditOptions.cs @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec +namespace Stripe.Issuing +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class DisputeProvisionalCreditOptions : INestedOptions + { + /// + /// The time at which the platform granted the provisional credit to their user. + /// + [JsonProperty("granted_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("granted_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? GrantedAt { get; set; } + + /// + /// The time at which the platform revoked the provisional credit from their user. + /// + [JsonProperty("revoked_at")] + [JsonConverter(typeof(UnixDateTimeConverter))] + [STJS.JsonPropertyName("revoked_at")] + [STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] + public DateTime? RevokedAt { get; set; } + } +} diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs index 7fa91f1490..7e059600d5 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeUpdateOptions.cs @@ -44,5 +44,12 @@ public Dictionary Metadata this.SetTracker.Track(); } } + + /// + /// Provisional credit information for this dispute. + /// + [JsonProperty("provisional_credit")] + [STJS.JsonPropertyName("provisional_credit")] + public DisputeProvisionalCreditOptions ProvisionalCredit { get; set; } } } diff --git a/src/Stripe.net/Services/PaymentAttemptRecords/PaymentAttemptRecordReportCanceledOptions.cs b/src/Stripe.net/Services/PaymentAttemptRecords/PaymentAttemptRecordReportCanceledOptions.cs index be853d2544..927d174338 100644 --- a/src/Stripe.net/Services/PaymentAttemptRecords/PaymentAttemptRecordReportCanceledOptions.cs +++ b/src/Stripe.net/Services/PaymentAttemptRecords/PaymentAttemptRecordReportCanceledOptions.cs @@ -46,5 +46,12 @@ public Dictionary Metadata [JsonProperty("payment_evaluations")] [STJS.JsonPropertyName("payment_evaluations")] public List PaymentEvaluations { get; set; } + + /// + /// The reason the payment attempt was canceled. + /// + [JsonProperty("reason")] + [STJS.JsonPropertyName("reason")] + public string Reason { get; set; } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelayOptions.cs new file mode 100644 index 0000000000..e6ca47b99b --- /dev/null +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardCaptureDelayOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class PaymentIntentPaymentMethodOptionsCardCaptureDelayOptions : INestedOptions + { + [JsonProperty("days")] + [STJS.JsonPropertyName("days")] + public long? Days { get; set; } + + [JsonProperty("hours")] + [STJS.JsonPropertyName("hours")] + public long? Hours { get; set; } + } +} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs index 4eb9dd46ed..c51d11adf1 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardOptions.cs @@ -18,6 +18,28 @@ public class PaymentIntentPaymentMethodOptionsCardOptions : INestedOptions, IHas [STJS.JsonIgnore] internal SetTracker SetTracker { get; } = new SetTracker(); + /// + /// Controls when funds are captured from the customer's account when capture_method + /// is automatic_delayed. + /// + /// If omitted, funds are captured before the authorization expires. + /// One of: auth_expiry, end_of_day, or target_delay. + /// + [JsonProperty("capture_by")] + [STJS.JsonPropertyName("capture_by")] + public string CaptureBy { get; set; } + + /// + /// The number of days or hours to delay the capture of the funds. You can set both days and + /// hours as long as the total delay does not exceed 30 days. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("capture_delay")] + [STJS.JsonPropertyName("capture_delay")] + public PaymentIntentPaymentMethodOptionsCardCaptureDelayOptions CaptureDelay { get; set; } + /// /// Controls when the funds are captured from the customer's account. /// diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs deleted file mode 100644 index 3a24b7babf..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions : INestedOptions - { - /// - /// The cryptocurrency currency code (e.g. BTC, ETH). - /// - [JsonProperty("currency_code")] - [STJS.JsonPropertyName("currency_code")] - public string CurrencyCode { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs deleted file mode 100644 index 551ec41b44..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions : INestedOptions - { - /// - /// Details for a cryptocurrency liquid asset funding transaction. - /// - [JsonProperty("crypto")] - [STJS.JsonPropertyName("crypto")] - public PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions Crypto { get; set; } - - /// - /// Details for a security liquid asset funding transaction. - /// - [JsonProperty("security")] - [STJS.JsonPropertyName("security")] - public PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions Security { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs deleted file mode 100644 index 9ec5ec557c..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions : INestedOptions - { - /// - /// The security's ticker symbol (e.g. AAPL). - /// - [JsonProperty("ticker_symbol")] - [STJS.JsonPropertyName("ticker_symbol")] - public string TickerSymbol { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs index 8cb58e7cdf..ef2f496346 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions.cs @@ -6,14 +6,8 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions : INestedOptions, IHasSetTracking + public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingOptions : INestedOptions { - private PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions liquidAsset; - - [JsonIgnore] - [STJS.JsonIgnore] - internal SetTracker SetTracker { get; } = new SetTracker(); - /// /// The category of digital asset being acquired through this account funding transaction. /// One of: blockchain_native, nft, other_non_fiat, or @@ -23,32 +17,11 @@ public class PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAcc [STJS.JsonPropertyName("digital_asset_category")] public string DigitalAssetCategory { get; set; } - /// - /// Details for a liquid asset (crypto or security) funding transaction. - /// - [JsonProperty("liquid_asset", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("liquid_asset")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions LiquidAsset - { - get => this.liquidAsset; - set - { - this.liquidAsset = value; - this.SetTracker.Track(); - } - } - /// /// Details for a wallet funding transaction. /// [JsonProperty("wallet")] [STJS.JsonPropertyName("wallet")] public PaymentIntentPaymentMethodOptionsCardPaymentDetailsMoneyServicesAccountFundingWalletOptions Wallet { get; set; } - - bool IHasSetTracking.IsPropertySet(string propertyName) - { - return this.SetTracker.IsSet(propertyName); - } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelayOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelayOptions.cs new file mode 100644 index 0000000000..e49f00dd70 --- /dev/null +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentCaptureDelayOptions.cs @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class PaymentIntentPaymentMethodOptionsCardPresentCaptureDelayOptions : INestedOptions + { + [JsonProperty("days")] + [STJS.JsonPropertyName("days")] + public long? Days { get; set; } + + [JsonProperty("hours")] + [STJS.JsonPropertyName("hours")] + public long? Hours { get; set; } + } +} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentOptions.cs index 0819607696..0a45583139 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentOptions.cs @@ -8,6 +8,28 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentPaymentMethodOptionsCardPresentOptions : INestedOptions { + /// + /// Controls when funds are captured from the customer's account when capture_method + /// is automatic_delayed. + /// + /// If omitted, funds are captured before the authorization expires. + /// One of: auth_expiry, end_of_day, or target_delay. + /// + [JsonProperty("capture_by")] + [STJS.JsonPropertyName("capture_by")] + public string CaptureBy { get; set; } + + /// + /// The number of days or hours to delay the capture of the funds. You can set both days and + /// hours as long as the total delay does not exceed 30 days. + /// + /// You can only set this if capture_method is automatic_delayed and + /// capture_by is target_delay. + /// + [JsonProperty("capture_delay")] + [STJS.JsonPropertyName("capture_delay")] + public PaymentIntentPaymentMethodOptionsCardPresentCaptureDelayOptions CaptureDelay { get; set; } + /// /// Controls when the funds are captured from the customer's account. /// @@ -51,6 +73,15 @@ public class PaymentIntentPaymentMethodOptionsCardPresentOptions : INestedOption [STJS.JsonPropertyName("request_incremental_authorization_support")] public bool? RequestIncrementalAuthorizationSupport { get; set; } + /// + /// Request ability to make multiple + /// captures for this PaymentIntent. + /// One of: if_available, or never. + /// + [JsonProperty("request_multicapture")] + [STJS.JsonPropertyName("request_multicapture")] + public string RequestMulticapture { get; set; } + /// /// Request ability to reauthorize for this diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs deleted file mode 100644 index 49055de65a..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions : INestedOptions - { - /// - /// The cryptocurrency currency code (e.g. BTC, ETH). - /// - [JsonProperty("currency_code")] - [STJS.JsonPropertyName("currency_code")] - public string CurrencyCode { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs deleted file mode 100644 index d3aadfa848..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions : INestedOptions - { - /// - /// Details for a cryptocurrency liquid asset funding transaction. - /// - [JsonProperty("crypto")] - [STJS.JsonPropertyName("crypto")] - public PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetCryptoOptions Crypto { get; set; } - - /// - /// Details for a security liquid asset funding transaction. - /// - [JsonProperty("security")] - [STJS.JsonPropertyName("security")] - public PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions Security { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs deleted file mode 100644 index 535909e714..0000000000 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// File generated from our OpenAPI spec -namespace Stripe -{ - using Newtonsoft.Json; - using Stripe.Infrastructure; - using STJS = System.Text.Json.Serialization; - - [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetSecurityOptions : INestedOptions - { - /// - /// The security's ticker symbol (e.g. AAPL). - /// - [JsonProperty("ticker_symbol")] - [STJS.JsonPropertyName("ticker_symbol")] - public string TickerSymbol { get; set; } - } -} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs index e440f5f74a..26a414e89e 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions.cs @@ -6,14 +6,8 @@ namespace Stripe using STJS = System.Text.Json.Serialization; [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] - public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions : INestedOptions, IHasSetTracking + public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingOptions : INestedOptions { - private PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions liquidAsset; - - [JsonIgnore] - [STJS.JsonIgnore] - internal SetTracker SetTracker { get; } = new SetTracker(); - /// /// The category of digital asset being acquired through this account funding transaction. /// One of: blockchain_native, nft, other_non_fiat, or @@ -23,32 +17,11 @@ public class PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServ [STJS.JsonPropertyName("digital_asset_category")] public string DigitalAssetCategory { get; set; } - /// - /// Details for a liquid asset (crypto or security) funding transaction. - /// - [JsonProperty("liquid_asset", NullValueHandling = NullValueHandling.Ignore)] - [STJS.JsonPropertyName("liquid_asset")] - [STJS.JsonIgnore(Condition = STJS.JsonIgnoreCondition.WhenWritingNull)] - public PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingLiquidAssetOptions LiquidAsset - { - get => this.liquidAsset; - set - { - this.liquidAsset = value; - this.SetTracker.Track(); - } - } - /// /// Details for a wallet funding transaction. /// [JsonProperty("wallet")] [STJS.JsonPropertyName("wallet")] public PaymentIntentPaymentMethodOptionsCardPresentPaymentDetailsMoneyServicesAccountFundingWalletOptions Wallet { get; set; } - - bool IHasSetTracking.IsPropertySet(string propertyName) - { - return this.SetTracker.IsSet(propertyName); - } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs index c4e3a6bb59..7402fb0a8e 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs @@ -17,7 +17,7 @@ public class PaymentIntentPaymentMethodOptionsCryptoOptions : INestedOptions /// /// The mode of the crypto payment. - /// One of: default, or deposit. + /// One of: default, deposit, or transaction_verification. /// [JsonProperty("mode")] [STJS.JsonPropertyName("mode")] diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsGiftCardOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsGiftCardOptions.cs index 6efffeb364..9babd27f63 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsGiftCardOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsGiftCardOptions.cs @@ -8,5 +8,28 @@ namespace Stripe [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] public class PaymentIntentPaymentMethodOptionsGiftCardOptions : INestedOptions { + /// + /// Set to yes to ignore the application fee on the PaymentIntent when redeeming this + /// gift card. + /// + [JsonProperty("ignore_application_fee")] + [STJS.JsonPropertyName("ignore_application_fee")] + public string IgnoreApplicationFee { get; set; } + + /// + /// Set to yes to ignore transfer data on the PaymentIntent when redeeming this gift + /// card. + /// + [JsonProperty("ignore_transfer_data")] + [STJS.JsonPropertyName("ignore_transfer_data")] + public string IgnoreTransferData { get; set; } + + /// + /// Request partial authorization on this PaymentIntent. + /// One of: if_available, or never. + /// + [JsonProperty("request_partial_authorization")] + [STJS.JsonPropertyName("request_partial_authorization")] + public string RequestPartialAuthorization { get; set; } } } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs index ebd12c6d05..69b77d38ef 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs @@ -548,6 +548,24 @@ public virtual Task UpdateAsync(string id, PaymentIntentUpdateOpt return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/payment_intents/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); } + /// + ///

Updates the refund address for a static crypto deposit PaymentIntent on the specified + /// network.

. + ///
+ public virtual PaymentIntent UpdateCryptoRefundAddress(string id, PaymentIntentUpdateCryptoRefundAddressOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/payment_intents/{WebUtility.UrlEncode(id)}/update_crypto_refund_address", options, requestOptions); + } + + /// + ///

Updates the refund address for a static crypto deposit PaymentIntent on the specified + /// network.

. + ///
+ public virtual Task UpdateCryptoRefundAddressAsync(string id, PaymentIntentUpdateCryptoRefundAddressOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/payment_intents/{WebUtility.UrlEncode(id)}/update_crypto_refund_address", options, requestOptions, cancellationToken); + } + /// ///

Verifies microdeposits on a PaymentIntent object.

. ///
diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateCryptoRefundAddressOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateCryptoRefundAddressOptions.cs new file mode 100644 index 0000000000..9cb6f14c9f --- /dev/null +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentUpdateCryptoRefundAddressOptions.cs @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class PaymentIntentUpdateCryptoRefundAddressOptions : BaseOptions + { + /// + /// The blockchain network for the refund address. + /// One of: base, ethereum, polygon, solana, sui, or + /// tempo. + /// + [JsonProperty("network")] + [STJS.JsonPropertyName("network")] + public string Network { get; set; } + + /// + /// The wallet address that should receive refunds for deposits on the specified network. + /// + [JsonProperty("refund_address")] + [STJS.JsonPropertyName("refund_address")] + public string RefundAddress { get; set; } + } +} diff --git a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs index 51be5554fa..52b2f7acce 100644 --- a/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs +++ b/src/Stripe.net/Services/PaymentRecords/PaymentRecordReportPaymentAttemptCanceledOptions.cs @@ -46,5 +46,12 @@ public Dictionary Metadata [JsonProperty("payment_evaluations")] [STJS.JsonPropertyName("payment_evaluations")] public List PaymentEvaluations { get; set; } + + /// + /// The reason the payment attempt was canceled. + /// + [JsonProperty("reason")] + [STJS.JsonPropertyName("reason")] + public string Reason { get; set; } } } diff --git a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsDataOptions.cs b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsDataOptions.cs new file mode 100644 index 0000000000..19cb037510 --- /dev/null +++ b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsDataOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.Radar +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsDataOptions : INestedOptions + { + /// + /// The end user's IP address. Used for proxy detection and IP-clustering signals. + /// + [JsonProperty("ip")] + [STJS.JsonPropertyName("ip")] + public string Ip { get; set; } + + /// + /// The referring URL of the login or registration page. + /// + [JsonProperty("referrer")] + [STJS.JsonPropertyName("referrer")] + public string Referrer { get; set; } + + /// + /// The User-Agent HTTP header. + /// + [JsonProperty("user_agent")] + [STJS.JsonPropertyName("user_agent")] + public string UserAgent { get; set; } + } +} diff --git a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsOptions.cs b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsOptions.cs index 65c32c7a90..8290a05c51 100644 --- a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsOptions.cs +++ b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsOptions.cs @@ -9,7 +9,15 @@ namespace Stripe.Radar public class AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsOptions : INestedOptions { /// - /// ID for the Radar Session associated with the account evaluation. + /// Raw client metadata fallback when Stripe.js is blocked. Required unless radar_session is + /// provided. + /// + [JsonProperty("data")] + [STJS.JsonPropertyName("data")] + public AccountEvaluationLoginInitiatedClientDeviceMetadataDetailsDataOptions Data { get; set; } + + /// + /// ID for the Radar Session. Required unless data is provided. /// [JsonProperty("radar_session")] [STJS.JsonPropertyName("radar_session")] diff --git a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsDataOptions.cs b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsDataOptions.cs new file mode 100644 index 0000000000..2cfc43a4ab --- /dev/null +++ b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsDataOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.Radar +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsDataOptions : INestedOptions + { + /// + /// The end user's IP address. Used for proxy detection and IP-clustering signals. + /// + [JsonProperty("ip")] + [STJS.JsonPropertyName("ip")] + public string Ip { get; set; } + + /// + /// The referring URL of the login or registration page. + /// + [JsonProperty("referrer")] + [STJS.JsonPropertyName("referrer")] + public string Referrer { get; set; } + + /// + /// The User-Agent HTTP header. + /// + [JsonProperty("user_agent")] + [STJS.JsonPropertyName("user_agent")] + public string UserAgent { get; set; } + } +} diff --git a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsOptions.cs b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsOptions.cs index 9d8f6f14c8..ef930d20e2 100644 --- a/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsOptions.cs +++ b/src/Stripe.net/Services/Radar/AccountEvaluations/AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsOptions.cs @@ -9,7 +9,15 @@ namespace Stripe.Radar public class AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsOptions : INestedOptions { /// - /// ID for the Radar Session associated with the account evaluation. + /// Raw client metadata fallback when Stripe.js is blocked. Required unless radar_session is + /// provided. + /// + [JsonProperty("data")] + [STJS.JsonPropertyName("data")] + public AccountEvaluationRegistrationInitiatedClientDeviceMetadataDetailsDataOptions Data { get; set; } + + /// + /// ID for the Radar Session. Required unless data is provided. /// [JsonProperty("radar_session")] [STJS.JsonPropertyName("radar_session")] diff --git a/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsDataOptions.cs b/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsDataOptions.cs new file mode 100644 index 0000000000..3c2faba2f9 --- /dev/null +++ b/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsDataOptions.cs @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec +namespace Stripe.Radar +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class CustomerEvaluationEvaluationContextClientDetailsDataOptions : INestedOptions + { + /// + /// The end user's IP address. Used for proxy detection and IP-clustering signals. + /// + [JsonProperty("ip")] + [STJS.JsonPropertyName("ip")] + public string Ip { get; set; } + + /// + /// The referring URL of the login or registration page. + /// + [JsonProperty("referrer")] + [STJS.JsonPropertyName("referrer")] + public string Referrer { get; set; } + + /// + /// The User-Agent HTTP header. + /// + [JsonProperty("user_agent")] + [STJS.JsonPropertyName("user_agent")] + public string UserAgent { get; set; } + } +} diff --git a/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsOptions.cs b/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsOptions.cs index f53001c3aa..c3322bddf8 100644 --- a/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsOptions.cs +++ b/src/Stripe.net/Services/Radar/CustomerEvaluations/CustomerEvaluationEvaluationContextClientDetailsOptions.cs @@ -9,7 +9,14 @@ namespace Stripe.Radar public class CustomerEvaluationEvaluationContextClientDetailsOptions : INestedOptions { /// - /// ID for the Radar Session associated with the customer evaluation. + /// Raw client metadata fallback in case a Radar Session is unavailable. + /// + [JsonProperty("data")] + [STJS.JsonPropertyName("data")] + public CustomerEvaluationEvaluationContextClientDetailsDataOptions Data { get; set; } + + /// + /// ID for the Radar Session. Required unless data is provided. /// [JsonProperty("radar_session")] [STJS.JsonPropertyName("radar_session")] diff --git a/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemOptions.cs b/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemOptions.cs index b8f337f53a..c2e7198c53 100644 --- a/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemOptions.cs +++ b/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemOptions.cs @@ -37,6 +37,14 @@ public class CalculationLineItemOptions : INestedOptions, IHasMetadata [STJS.JsonPropertyName("performance_location")] public string PerformanceLocation { get; set; } + /// + /// Details of the performance location for this line item. Use this to specify an address + /// directly instead of a tax location ID. + /// + [JsonProperty("performance_location_details")] + [STJS.JsonPropertyName("performance_location_details")] + public CalculationLineItemPerformanceLocationDetailsOptions PerformanceLocationDetails { get; set; } + /// /// If provided, the product's tax_code will be used as the line item's /// tax_code. diff --git a/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemPerformanceLocationDetailsOptions.cs b/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemPerformanceLocationDetailsOptions.cs new file mode 100644 index 0000000000..0594b70ad0 --- /dev/null +++ b/src/Stripe.net/Services/Tax/Calculations/CalculationLineItemPerformanceLocationDetailsOptions.cs @@ -0,0 +1,18 @@ +// File generated from our OpenAPI spec +namespace Stripe.Tax +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class CalculationLineItemPerformanceLocationDetailsOptions : INestedOptions + { + /// + /// The address of the performance venue. + /// + [JsonProperty("address")] + [STJS.JsonPropertyName("address")] + public AddressOptions Address { get; set; } + } +} diff --git a/src/Stripe.net/Services/TaxFunds/TaxFundGetOptions.cs b/src/Stripe.net/Services/TaxFunds/TaxFundGetOptions.cs new file mode 100644 index 0000000000..e99aa3c93a --- /dev/null +++ b/src/Stripe.net/Services/TaxFunds/TaxFundGetOptions.cs @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class TaxFundGetOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/TaxFunds/TaxFundListOptions.cs b/src/Stripe.net/Services/TaxFunds/TaxFundListOptions.cs new file mode 100644 index 0000000000..6e09fb3e36 --- /dev/null +++ b/src/Stripe.net/Services/TaxFunds/TaxFundListOptions.cs @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + using STJS = System.Text.Json.Serialization; + + [STJS.JsonConverter(typeof(STJStripeOptionsConverter))] + public class TaxFundListOptions : ListOptions + { + /// + /// A filter on the list, based on the object created field. The value can be a + /// string with an integer Unix timestamp, or it can be a dictionary with a number of + /// different query options. + /// + [JsonProperty("created")] + [JsonConverter(typeof(AnyOfConverter))] + [STJS.JsonPropertyName("created")] + [STJS.JsonConverter(typeof(STJAnyOfConverter))] + public AnyOf Created { get; set; } + } +} diff --git a/src/Stripe.net/Services/TaxFunds/TaxFundService.cs b/src/Stripe.net/Services/TaxFunds/TaxFundService.cs new file mode 100644 index 0000000000..25b58f0875 --- /dev/null +++ b/src/Stripe.net/Services/TaxFunds/TaxFundService.cs @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class TaxFundService : Service, + IListable, + IRetrievable + { + public TaxFundService() + { + } + + internal TaxFundService(ApiRequestor requestor) + : base(requestor) + { + } + + public TaxFundService(IStripeClient client) + : base(client) + { + } + + /// + ///

Retrieves a tax fund object by its ID.

. + ///
+ public virtual TaxFund Get(string id, TaxFundGetOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Get, $"/v1/tax_funds/{WebUtility.UrlEncode(id)}", options, requestOptions); + } + + /// + ///

Retrieves a tax fund object by its ID.

. + ///
+ public virtual Task GetAsync(string id, TaxFundGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Get, $"/v1/tax_funds/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken); + } + + /// + ///

Returns a list of tax funds in reverse chronological order.

. + ///
+ public virtual StripeList List(TaxFundListOptions options = null, RequestOptions requestOptions = null) + { + return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v1/tax_funds", options, requestOptions); + } + + /// + ///

Returns a list of tax funds in reverse chronological order.

. + ///
+ public virtual Task> ListAsync(TaxFundListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v1/tax_funds", options, requestOptions, cancellationToken); + } + + /// + ///

Returns a list of tax funds in reverse chronological order.

. + ///
+ public virtual IEnumerable ListAutoPaging(TaxFundListOptions options = null, RequestOptions requestOptions = null) + { + return this.ListRequestAutoPaging($"/v1/tax_funds", options, requestOptions); + } + + /// + ///

Returns a list of tax funds in reverse chronological order.

. + ///
+ public virtual IAsyncEnumerable ListAutoPagingAsync(TaxFundListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.ListRequestAutoPagingAsync($"/v1/tax_funds", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/V1Services.cs b/src/Stripe.net/Services/V1Services.cs index 8bce7e6c01..f66fac135d 100644 --- a/src/Stripe.net/Services/V1Services.cs +++ b/src/Stripe.net/Services/V1Services.cs @@ -44,6 +44,8 @@ public class V1Services : Service private ForwardingService forwarding; private FrMealVouchersOnboardingService frMealVouchersOnboardings; private FxQuoteService fxQuotes; + private GiftCardService giftCards; + private GiftCardOperationService giftCardOperations; private IdentityService identity; private InvoiceService invoices; private InvoiceItemService invoiceItems; @@ -87,6 +89,7 @@ public class V1Services : Service private SubscriptionScheduleService subscriptionSchedules; private TaxService tax; private TaxCodeService taxCodes; + private TaxFundService taxFunds; private TaxIdService taxIds; private TaxRateService taxRates; private TerminalService terminal; @@ -218,6 +221,12 @@ internal V1Services(IStripeClient client) public virtual FxQuoteService FxQuotes => this.fxQuotes ??= new FxQuoteService( this.Requestor); + public virtual GiftCardService GiftCards => this.giftCards ??= new GiftCardService( + this.Requestor); + + public virtual GiftCardOperationService GiftCardOperations => this.giftCardOperations ??= new GiftCardOperationService( + this.Requestor); + public virtual IdentityService Identity => this.identity ??= new IdentityService( this.Requestor); @@ -347,6 +356,9 @@ internal V1Services(IStripeClient client) public virtual TaxCodeService TaxCodes => this.taxCodes ??= new TaxCodeService( this.Requestor); + public virtual TaxFundService TaxFunds => this.taxFunds ??= new TaxFundService( + this.Requestor); + public virtual TaxIdService TaxIds => this.taxIds ??= new TaxIdService( this.Requestor); diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs index 270104038d..c3a6fffddb 100644 --- a/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractCreatePricingOverrideOptions.cs @@ -38,7 +38,8 @@ public class ContractCreatePricingOverrideOptions : INestedOptions public ContractCreatePricingOverrideOverwritePriceOptions OverwritePrice { get; set; } /// - /// The priority of this override relative to others. Lower number = higher priority. + /// The priority of this override relative to others. The highest priority is 0 and the + /// lowest is 100. /// [JsonProperty("priority")] [STJS.JsonPropertyName("priority")] diff --git a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs index 4e1040c818..cc6d9a2fed 100644 --- a/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs +++ b/src/Stripe.net/Services/V2/Billing/Contracts/ContractUpdatePricingOverrideActionAddOptions.cs @@ -37,7 +37,7 @@ public class ContractUpdatePricingOverrideActionAddOptions : INestedOptions public ContractUpdatePricingOverrideActionAddOverwritePriceOptions OverwritePrice { get; set; } /// - /// The priority for the pricing override. + /// The priority for the pricing override. The highest priority is 0 and the lowest is 100. /// [JsonProperty("priority")] [STJS.JsonPropertyName("priority")] diff --git a/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportCreateOptions.cs b/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportCreateOptions.cs index bfafdaba7b..7ef3fb5c7c 100644 --- a/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportCreateOptions.cs +++ b/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportCreateOptions.cs @@ -11,7 +11,7 @@ public class ImportCreateOptions : BaseOptions, IHasMetadata { /// /// The type of catalog data to import. - /// One of: inventory, pricing, or product. + /// One of: inventory, pricing, product, or promotion. /// [JsonProperty("feed_type")] [STJS.JsonPropertyName("feed_type")] diff --git a/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportListOptions.cs b/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportListOptions.cs index 26fe8b5688..2d3093baea 100644 --- a/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportListOptions.cs +++ b/src/Stripe.net/Services/V2/Commerce/ProductCatalog/Imports/ImportListOptions.cs @@ -51,7 +51,7 @@ public class ImportListOptions : V2.ListOptions /// /// Filter by the type of feed data being imported. - /// One of: inventory, pricing, or product. + /// One of: inventory, pricing, product, or promotion. /// [JsonProperty("feed_type")] [STJS.JsonPropertyName("feed_type")] diff --git a/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs b/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs index 014554113e..d9084241cf 100644 --- a/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs +++ b/src/StripeTests/Infrastructure/Public/SystemNetHttpClientTest.cs @@ -134,6 +134,96 @@ public void CanInspectEnableTelemetry() Assert.True(client.EnableTelemetry); } + [Fact] + public void SourceHashIsHexString() + { + var hash = SystemNetHttpClient.ComputeSourceHash(); + + // MD5 produces 16 bytes → 32 hex characters + Assert.NotNull(hash); + Assert.Equal(32, hash.Length); + Assert.Matches("^[0-9a-f]{32}$", hash); + } + + [Fact] + public void SourceHashIsDeterministic() + { + var hash1 = SystemNetHttpClient.ComputeSourceHash(); + var hash2 = SystemNetHttpClient.ComputeSourceHash(); + + Assert.Equal(hash1, hash2); + } + + [Fact] + public async Task SourceHashIncludedInUserAgentHeader() + { + var responseMessage = new HttpResponseMessage(HttpStatusCode.OK); + responseMessage.Content = new StringContent("Hello world!"); + this.MockHttpClientFixture.MockHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(responseMessage)); + + var client = new SystemNetHttpClient( + httpClient: new HttpClient(this.MockHttpClientFixture.MockHandler.Object)); + var request = new StripeRequest( + this.StripeClient, + HttpMethod.Post, + "/foo", + null, + null); + await client.MakeRequestAsync(request); + + this.MockHttpClientFixture.MockHandler.Protected() + .Verify( + "SendAsync", + Times.Once(), + ItExpr.Is(m => this.VerifySourceHeader(m.Headers)), + ItExpr.IsAny()); + } + + [Fact] + public async Task SourceHashAbsentFromUserAgentWhenEmpty() + { + var savedHash = SystemNetHttpClient.SourceHash; + try + { + SystemNetHttpClient.SourceHash = string.Empty; + + var responseMessage = new HttpResponseMessage(HttpStatusCode.OK); + responseMessage.Content = new StringContent("Hello world!"); + this.MockHttpClientFixture.MockHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(responseMessage)); + + var client = new SystemNetHttpClient( + httpClient: new HttpClient(this.MockHttpClientFixture.MockHandler.Object)); + var request = new StripeRequest( + this.StripeClient, + HttpMethod.Post, + "/foo", + null, + null); + await client.MakeRequestAsync(request); + + this.MockHttpClientFixture.MockHandler.Protected() + .Verify( + "SendAsync", + Times.Once(), + ItExpr.Is(m => this.VerifyNoSourceHeader(m.Headers)), + ItExpr.IsAny()); + } + finally + { + SystemNetHttpClient.SourceHash = savedHash; + } + } + [Fact] public void TestDetectAIAgent() { @@ -272,5 +362,25 @@ private bool VerifyAIAgentHeaders(HttpRequestHeaders headers) return true; } + + private bool VerifySourceHeader(HttpRequestHeaders headers) + { + var userAgentJson = JObject.Parse(headers.GetValues("X-Stripe-Client-User-Agent").First()); + var source = userAgentJson.Value("source"); + + Assert.NotNull(source); + Assert.Matches("^[0-9a-f]{32}$", source); + + return true; + } + + private bool VerifyNoSourceHeader(HttpRequestHeaders headers) + { + var userAgentJson = JObject.Parse(headers.GetValues("X-Stripe-Client-User-Agent").First()); + + Assert.Null(userAgentJson["source"]); + + return true; + } } } diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index 1de3a8407a..8cf8e820f4 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -9374,7 +9374,7 @@ public void TestV2CoreFeeBatchGet() HttpMethod.Get, "/v2/core/fee_batches", (HttpStatusCode)200, - "{\"data\":[{\"object\":\"v2.core.fee_batch\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"collected_by\":{\"type\":\"application\"},\"collection_records\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"money_management_transaction\"}],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"billed\",\"status_transitions\":{}}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"object\":\"v2.core.fee_batch\",\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"collected_by\":{\"type\":\"application\"},\"collection_records\":[{\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"type\":\"money_management_transaction\"}],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"billed\",\"status_transitions\":{}}],\"next_page_url\":null,\"previous_page_url\":null}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.FeeBatches; Stripe.V2.StripeList feeBatches = service @@ -9389,7 +9389,7 @@ public void TestV2CoreFeeBatchGet2() HttpMethod.Get, "/v2/core/fee_batches/id_123", (HttpStatusCode)200, - "{\"object\":\"v2.core.fee_batch\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"collected_by\":{\"type\":\"application\"},\"collection_records\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"money_management_transaction\"}],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"billed\",\"status_transitions\":{}}"); + "{\"object\":\"v2.core.fee_batch\",\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"collected_by\":{\"type\":\"application\"},\"collection_records\":[{\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"type\":\"money_management_transaction\"}],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"billed\",\"status_transitions\":{}}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.FeeBatches; Stripe.V2.Core.FeeBatch feeBatch = service.Get("id_123"); @@ -9403,7 +9403,7 @@ public void TestV2CoreFeeEntryGet() HttpMethod.Get, "/v2/core/fee_entries", (HttpStatusCode)200, - "{\"data\":[{\"object\":\"v2.core.fee_entry\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"charged_by\":{\"type\":\"application\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"incurred_by\":{\"id\":\"obj_123\",\"type\":\"type\"},\"livemode\":true,\"reason\":\"reprice\",\"type\":\"application_fee\"}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"object\":\"v2.core.fee_entry\",\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"charged_by\":{\"type\":\"application\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"incurred_by\":{\"id\":\"obj_123\",\"type\":\"type\"},\"livemode\":true,\"reason\":\"reprice\",\"type\":\"application_fee\"}],\"next_page_url\":null,\"previous_page_url\":null}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.FeeEntries; Stripe.V2.StripeList feeEntries = service @@ -9418,7 +9418,7 @@ public void TestV2CoreFeeEntryGet2() HttpMethod.Get, "/v2/core/fee_entries/id_123", (HttpStatusCode)200, - "{\"object\":\"v2.core.fee_entry\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"charged_by\":{\"type\":\"application\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"incurred_by\":{\"id\":\"obj_123\",\"type\":\"type\"},\"livemode\":true,\"reason\":\"reprice\",\"type\":\"application_fee\"}"); + "{\"object\":\"v2.core.fee_entry\",\"amount\":{\"currency\":\"usd\",\"value\":\"value\"},\"charged_by\":{\"type\":\"application\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"incurred_by\":{\"id\":\"obj_123\",\"type\":\"type\"},\"livemode\":true,\"reason\":\"reprice\",\"type\":\"application_fee\"}"); var client = new StripeClient(this.Requestor); var service = client.V2.Core.FeeEntries; Stripe.V2.Core.FeeEntry feeEntry = service.Get("id_123"); @@ -10878,7 +10878,7 @@ public void TestV2MoneyManagementTransactionGet() HttpMethod.Get, "/v2/money_management/transactions", (HttpStatusCode)200, - "{\"data\":[{\"object\":\"v2.money_management.transaction\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"pending\",\"status_transitions\":{}}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"object\":\"v2.money_management.transaction\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"inbound_transfer_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"pending\",\"status_transitions\":{}}],\"next_page_url\":null,\"previous_page_url\":null}"); var client = new StripeClient(this.Requestor); var service = client.V2.MoneyManagement.Transactions; Stripe.V2.StripeList transactions = service @@ -10895,7 +10895,7 @@ public void TestV2MoneyManagementTransactionGet2() HttpMethod.Get, "/v2/money_management/transactions/id_123", (HttpStatusCode)200, - "{\"object\":\"v2.money_management.transaction\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"pending\",\"status_transitions\":{}}"); + "{\"object\":\"v2.money_management.transaction\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"inbound_transfer_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"livemode\":true,\"status\":\"pending\",\"status_transitions\":{}}"); var client = new StripeClient(this.Requestor); var service = client.V2.MoneyManagement.Transactions; Stripe.V2.MoneyManagement.Transaction transaction = service.Get( @@ -10912,7 +10912,7 @@ public void TestV2MoneyManagementTransactionEntryGet() HttpMethod.Get, "/v2/money_management/transaction_entries", (HttpStatusCode)200, - "{\"data\":[{\"object\":\"v2.money_management.transaction_entry\",\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"livemode\":true,\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"}}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"object\":\"v2.money_management.transaction_entry\",\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"livemode\":true,\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"inbound_transfer_reversal\",\"financial_account\":\"financial_account\"}}],\"next_page_url\":null,\"previous_page_url\":null}"); var client = new StripeClient(this.Requestor); var service = client.V2.MoneyManagement.TransactionEntries; Stripe.V2.StripeList transactionEntries = service @@ -10929,7 +10929,7 @@ public void TestV2MoneyManagementTransactionEntryGet2() HttpMethod.Get, "/v2/money_management/transaction_entries/id_123", (HttpStatusCode)200, - "{\"object\":\"v2.money_management.transaction_entry\",\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"livemode\":true,\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit\",\"financial_account\":\"financial_account\"}}"); + "{\"object\":\"v2.money_management.transaction_entry\",\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"livemode\":true,\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"inbound_transfer_reversal\",\"financial_account\":\"financial_account\"}}"); var client = new StripeClient(this.Requestor); var service = client.V2.MoneyManagement.TransactionEntries; Stripe.V2.MoneyManagement.TransactionEntry transactionEntry = service @@ -11736,39 +11736,20 @@ public void TestCannotProceedError() { this.StubRequest( HttpMethod.Post, - "/v2/extend/workflows/id_123/invoke", + "/v2/core/vault/us_bank_accounts/id_123/archive", (HttpStatusCode)400, "{\"error\":{\"type\":\"cannot_proceed\",\"code\":\"default_payout_method_cannot_be_archived\"}}"); var exception = Assert.Throws( () => { - var options = new Stripe.V2.Extend.WorkflowInvokeOptions - { - InputParameters = new Dictionary - { - { "int_key", 123 }, - { "string_key", "value" }, - { "boolean_key", true }, - { - "object_key", new Dictionary - { - { "object_int_key", 123 }, - { "object_string_key", "value" }, - { "object_boolean_key", true }, - } - }, - { "array_key", new List { 1, 2, 3 } }, - }, - }; var client = new StripeClient(this.Requestor); - var service = client.V2.Extend.Workflows; - Stripe.V2.Extend.WorkflowRun workflowRun = service.Invoke( - "id_123", - options); + var service = client.V2.Core.Vault.UsBankAccounts; + Stripe.V2.Core.Vault.UsBankAccount usBankAccount = service.Archive( + "id_123"); }); this.AssertRequest( HttpMethod.Post, - "/v2/extend/workflows/id_123/invoke"); + "/v2/core/vault/us_bank_accounts/id_123/archive"); } [Fact]