stripe 15.3.0 → 15.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +21 -1
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_version.rb +1 -1
  7. data/lib/stripe/resources/account.rb +5 -5
  8. data/lib/stripe/resources/account_link.rb +3 -1
  9. data/lib/stripe/resources/account_session.rb +51 -0
  10. data/lib/stripe/resources/billing/credit_grant.rb +1 -1
  11. data/lib/stripe/resources/billing_portal/configuration.rb +46 -2
  12. data/lib/stripe/resources/charge.rb +7 -5
  13. data/lib/stripe/resources/checkout/session.rb +32 -4
  14. data/lib/stripe/resources/confirmation_token.rb +3 -3
  15. data/lib/stripe/resources/customer.rb +1 -1
  16. data/lib/stripe/resources/dispute.rb +1 -1
  17. data/lib/stripe/resources/event.rb +14 -26
  18. data/lib/stripe/resources/invoice.rb +24 -8
  19. data/lib/stripe/resources/invoice_item.rb +1 -1
  20. data/lib/stripe/resources/payment_intent.rb +14 -4
  21. data/lib/stripe/resources/payment_link.rb +83 -5
  22. data/lib/stripe/resources/payment_method.rb +4 -4
  23. data/lib/stripe/resources/quote.rb +1 -1
  24. data/lib/stripe/resources/radar/value_list.rb +2 -2
  25. data/lib/stripe/resources/refund.rb +1 -1
  26. data/lib/stripe/resources/review.rb +2 -2
  27. data/lib/stripe/resources/setup_attempt.rb +1 -1
  28. data/lib/stripe/resources/subscription.rb +2 -2
  29. data/lib/stripe/resources/subscription_item.rb +2 -2
  30. data/lib/stripe/resources/subscription_schedule.rb +35 -3
  31. data/lib/stripe/resources/tax/registration.rb +408 -30
  32. data/lib/stripe/resources/terminal/configuration.rb +196 -0
  33. data/lib/stripe/services/account_link_service.rb +3 -1
  34. data/lib/stripe/services/account_service.rb +3 -3
  35. data/lib/stripe/services/account_session_service.rb +34 -0
  36. data/lib/stripe/services/billing/credit_grant_service.rb +1 -1
  37. data/lib/stripe/services/billing_portal/configuration_service.rb +36 -2
  38. data/lib/stripe/services/checkout/session_service.rb +19 -3
  39. data/lib/stripe/services/invoice_item_service.rb +1 -1
  40. data/lib/stripe/services/invoice_service.rb +24 -8
  41. data/lib/stripe/services/payment_intent_service.rb +8 -3
  42. data/lib/stripe/services/payment_link_service.rb +81 -5
  43. data/lib/stripe/services/payment_method_service.rb +1 -1
  44. data/lib/stripe/services/quote_service.rb +1 -1
  45. data/lib/stripe/services/radar/value_list_service.rb +1 -1
  46. data/lib/stripe/services/subscription_item_service.rb +2 -2
  47. data/lib/stripe/services/subscription_schedule_service.rb +35 -3
  48. data/lib/stripe/services/subscription_service.rb +2 -2
  49. data/lib/stripe/services/tax/registration_service.rb +360 -30
  50. data/lib/stripe/services/terminal/configuration_service.rb +152 -0
  51. data/lib/stripe/version.rb +1 -1
  52. data/rbi/stripe/resources/account.rbi +5 -5
  53. data/rbi/stripe/resources/account_link.rbi +3 -1
  54. data/rbi/stripe/resources/account_session.rbi +62 -1
  55. data/rbi/stripe/resources/billing/credit_grant.rbi +1 -1
  56. data/rbi/stripe/resources/billing_portal/configuration.rbi +62 -4
  57. data/rbi/stripe/resources/charge.rbi +8 -5
  58. data/rbi/stripe/resources/checkout/session.rbi +42 -7
  59. data/rbi/stripe/resources/confirmation_token.rbi +3 -3
  60. data/rbi/stripe/resources/customer.rbi +1 -1
  61. data/rbi/stripe/resources/dispute.rbi +1 -1
  62. data/rbi/stripe/resources/event.rbi +14 -26
  63. data/rbi/stripe/resources/invoice.rbi +27 -11
  64. data/rbi/stripe/resources/invoice_item.rbi +1 -1
  65. data/rbi/stripe/resources/payment_intent.rbi +14 -4
  66. data/rbi/stripe/resources/payment_link.rbi +101 -9
  67. data/rbi/stripe/resources/payment_method.rbi +4 -4
  68. data/rbi/stripe/resources/quote.rbi +1 -1
  69. data/rbi/stripe/resources/radar/value_list.rbi +2 -2
  70. data/rbi/stripe/resources/refund.rbi +1 -1
  71. data/rbi/stripe/resources/review.rbi +2 -2
  72. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  73. data/rbi/stripe/resources/subscription.rbi +6 -6
  74. data/rbi/stripe/resources/subscription_item.rbi +2 -2
  75. data/rbi/stripe/resources/subscription_schedule.rbi +33 -5
  76. data/rbi/stripe/resources/tax/registration.rbi +544 -60
  77. data/rbi/stripe/resources/terminal/configuration.rbi +210 -2
  78. data/rbi/stripe/services/account_link_service.rbi +3 -1
  79. data/rbi/stripe/services/account_service.rbi +3 -3
  80. data/rbi/stripe/services/account_session_service.rbi +40 -1
  81. data/rbi/stripe/services/billing/credit_grant_service.rbi +1 -1
  82. data/rbi/stripe/services/billing_portal/configuration_service.rbi +48 -4
  83. data/rbi/stripe/services/checkout/session_service.rbi +26 -6
  84. data/rbi/stripe/services/invoice_item_service.rbi +1 -1
  85. data/rbi/stripe/services/invoice_service.rbi +27 -11
  86. data/rbi/stripe/services/payment_intent_service.rbi +8 -3
  87. data/rbi/stripe/services/payment_link_service.rbi +98 -9
  88. data/rbi/stripe/services/payment_method_service.rbi +1 -1
  89. data/rbi/stripe/services/quote_service.rbi +1 -1
  90. data/rbi/stripe/services/radar/value_list_service.rbi +1 -1
  91. data/rbi/stripe/services/subscription_item_service.rbi +2 -2
  92. data/rbi/stripe/services/subscription_schedule_service.rbi +37 -5
  93. data/rbi/stripe/services/subscription_service.rbi +6 -6
  94. data/rbi/stripe/services/tax/registration_service.rbi +480 -60
  95. data/rbi/stripe/services/terminal/configuration_service.rbi +170 -2
  96. metadata +2 -2
@@ -189,6 +189,9 @@ module Stripe
189
189
  # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
190
190
  sig { returns(T.nilable(String)) }
191
191
  attr_reader :amount_tax_display
192
+ # ID of the invoice rendering template to be used for the generated invoice.
193
+ sig { returns(T.nilable(String)) }
194
+ attr_reader :template
192
195
  end
193
196
  # The account tax IDs associated with the invoice.
194
197
  sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) }
@@ -752,8 +755,13 @@ module Stripe
752
755
  # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
753
756
  sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
754
757
  attr_accessor :amount_tax_display
755
- sig { params(amount_tax_display: T.nilable(T.nilable(T.any(String, String)))).void }
756
- def initialize(amount_tax_display: nil); end
758
+ # ID of the invoice rendering template to use for this invoice.
759
+ sig { returns(T.nilable(String)) }
760
+ attr_accessor :template
761
+ sig {
762
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), template: T.nilable(String)).void
763
+ }
764
+ def initialize(amount_tax_display: nil, template: nil); end
757
765
  end
758
766
  # The account tax IDs associated with the invoice.
759
767
  sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
@@ -813,7 +821,7 @@ module Stripe
813
821
  # Set to true if the quantity can be adjusted to any non-negative Integer.
814
822
  sig { returns(T::Boolean) }
815
823
  attr_accessor :enabled
816
- # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
824
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999999.
817
825
  sig { returns(T.nilable(Integer)) }
818
826
  attr_accessor :maximum
819
827
  # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
@@ -824,21 +832,100 @@ module Stripe
824
832
  }
825
833
  def initialize(enabled: nil, maximum: nil, minimum: nil); end
826
834
  end
835
+ class PriceData < Stripe::RequestParams
836
+ class ProductData < Stripe::RequestParams
837
+ # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
838
+ sig { returns(T.nilable(String)) }
839
+ attr_accessor :description
840
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
841
+ sig { returns(T.nilable(T::Array[String])) }
842
+ attr_accessor :images
843
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
844
+ sig { returns(T.nilable(T::Hash[String, String])) }
845
+ attr_accessor :metadata
846
+ # The product's name, meant to be displayable to the customer.
847
+ sig { returns(String) }
848
+ attr_accessor :name
849
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
850
+ sig { returns(T.nilable(String)) }
851
+ attr_accessor :tax_code
852
+ sig {
853
+ params(description: T.nilable(String), images: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), name: String, tax_code: T.nilable(String)).void
854
+ }
855
+ def initialize(
856
+ description: nil,
857
+ images: nil,
858
+ metadata: nil,
859
+ name: nil,
860
+ tax_code: nil
861
+ ); end
862
+ end
863
+ class Recurring < Stripe::RequestParams
864
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
865
+ sig { returns(String) }
866
+ attr_accessor :interval
867
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
868
+ sig { returns(T.nilable(Integer)) }
869
+ attr_accessor :interval_count
870
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
871
+ def initialize(interval: nil, interval_count: nil); end
872
+ end
873
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
874
+ sig { returns(String) }
875
+ attr_accessor :currency
876
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
877
+ sig { returns(T.nilable(String)) }
878
+ attr_accessor :product
879
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
880
+ sig {
881
+ returns(T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData::ProductData))
882
+ }
883
+ attr_accessor :product_data
884
+ # The recurring components of a price such as `interval` and `interval_count`.
885
+ sig {
886
+ returns(T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData::Recurring))
887
+ }
888
+ attr_accessor :recurring
889
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
890
+ sig { returns(T.nilable(String)) }
891
+ attr_accessor :tax_behavior
892
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
893
+ sig { returns(T.nilable(Integer)) }
894
+ attr_accessor :unit_amount
895
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
896
+ sig { returns(T.nilable(String)) }
897
+ attr_accessor :unit_amount_decimal
898
+ sig {
899
+ params(currency: String, product: T.nilable(String), product_data: T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData::ProductData), recurring: T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData::Recurring), tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
900
+ }
901
+ def initialize(
902
+ currency: nil,
903
+ product: nil,
904
+ product_data: nil,
905
+ recurring: nil,
906
+ tax_behavior: nil,
907
+ unit_amount: nil,
908
+ unit_amount_decimal: nil
909
+ ); end
910
+ end
827
911
  # When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
828
912
  sig {
829
913
  returns(T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::AdjustableQuantity))
830
914
  }
831
915
  attr_accessor :adjustable_quantity
832
916
  # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
833
- sig { returns(String) }
917
+ sig { returns(T.nilable(String)) }
834
918
  attr_accessor :price
919
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
920
+ sig { returns(T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData)) }
921
+ attr_accessor :price_data
835
922
  # The quantity of the line item being purchased.
836
923
  sig { returns(Integer) }
837
924
  attr_accessor :quantity
838
925
  sig {
839
- params(adjustable_quantity: T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::AdjustableQuantity), price: String, quantity: Integer).void
926
+ params(adjustable_quantity: T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::AdjustableQuantity), price: T.nilable(String), price_data: T.nilable(::Stripe::PaymentLink::CreateParams::LineItem::PriceData), quantity: Integer).void
840
927
  }
841
- def initialize(adjustable_quantity: nil, price: nil, quantity: nil); end
928
+ def initialize(adjustable_quantity: nil, price: nil, price_data: nil, quantity: nil); end
842
929
  end
843
930
  class OptionalItem < Stripe::RequestParams
844
931
  class AdjustableQuantity < Stripe::RequestParams
@@ -1420,8 +1507,13 @@ module Stripe
1420
1507
  # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
1421
1508
  sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
1422
1509
  attr_accessor :amount_tax_display
1423
- sig { params(amount_tax_display: T.nilable(T.nilable(T.any(String, String)))).void }
1424
- def initialize(amount_tax_display: nil); end
1510
+ # ID of the invoice rendering template to use for this invoice.
1511
+ sig { returns(T.nilable(String)) }
1512
+ attr_accessor :template
1513
+ sig {
1514
+ params(amount_tax_display: T.nilable(T.nilable(T.any(String, String))), template: T.nilable(String)).void
1515
+ }
1516
+ def initialize(amount_tax_display: nil, template: nil); end
1425
1517
  end
1426
1518
  # The account tax IDs associated with the invoice.
1427
1519
  sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
@@ -1481,7 +1573,7 @@ module Stripe
1481
1573
  # Set to true if the quantity can be adjusted to any non-negative Integer.
1482
1574
  sig { returns(T::Boolean) }
1483
1575
  attr_accessor :enabled
1484
- # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
1576
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999999.
1485
1577
  sig { returns(T.nilable(Integer)) }
1486
1578
  attr_accessor :maximum
1487
1579
  # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
@@ -158,7 +158,7 @@ module Stripe
158
158
  # The authorized amount
159
159
  sig { returns(T.nilable(Integer)) }
160
160
  attr_reader :amount_authorized
161
- # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
161
+ # Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`.
162
162
  sig { returns(T.nilable(String)) }
163
163
  attr_reader :brand
164
164
  # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card.
@@ -405,7 +405,7 @@ module Stripe
405
405
  sig { returns(VisaCheckout) }
406
406
  attr_reader :visa_checkout
407
407
  end
408
- # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
408
+ # Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`.
409
409
  sig { returns(String) }
410
410
  attr_reader :brand
411
411
  # Checks on Card address and CVC if provided.
@@ -481,7 +481,7 @@ module Stripe
481
481
  sig { returns(String) }
482
482
  attr_reader :type
483
483
  end
484
- # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
484
+ # Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`.
485
485
  sig { returns(T.nilable(String)) }
486
486
  attr_reader :brand
487
487
  # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card.
@@ -1761,7 +1761,7 @@ module Stripe
1761
1761
  }
1762
1762
  def self.list(params = {}, opts = {}); end
1763
1763
 
1764
- # Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
1764
+ # Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated.
1765
1765
  sig {
1766
1766
  params(payment_method: String, params: T.any(::Stripe::PaymentMethod::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::PaymentMethod)
1767
1767
  }
@@ -579,7 +579,7 @@ module Stripe
579
579
  end
580
580
  class SubscriptionData < Stripe::RequestParams
581
581
  class BillingMode < Stripe::RequestParams
582
- # Attribute for param field type
582
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
583
583
  sig { returns(String) }
584
584
  attr_accessor :type
585
585
  sig { params(type: String).void }
@@ -20,7 +20,7 @@ module Stripe
20
20
  # Unique identifier for the object.
21
21
  sig { returns(String) }
22
22
  attr_reader :id
23
- # The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`.
23
+ # The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`.
24
24
  sig { returns(String) }
25
25
  attr_reader :item_type
26
26
  # List of items contained within this value list.
@@ -120,7 +120,7 @@ module Stripe
120
120
  # Specifies which fields in the response should be expanded.
121
121
  sig { returns(T.nilable(T::Array[String])) }
122
122
  attr_accessor :expand
123
- # Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed.
123
+ # Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. Use `string` if the item type is unknown or mixed.
124
124
  sig { returns(T.nilable(String)) }
125
125
  attr_accessor :item_type
126
126
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
@@ -267,7 +267,7 @@ module Stripe
267
267
  attr_reader :type
268
268
  end
269
269
  class PresentmentDetails < Stripe::StripeObject
270
- # Amount intended to be collected by this payment, denominated in presentment_currency.
270
+ # Amount intended to be collected by this payment, denominated in `presentment_currency`.
271
271
  sig { returns(Integer) }
272
272
  attr_reader :presentment_amount
273
273
  # Currency presented to the customer during payment.
@@ -45,7 +45,7 @@ module Stripe
45
45
  # The charge associated with this review.
46
46
  sig { returns(T.nilable(T.any(String, Stripe::Charge))) }
47
47
  attr_reader :charge
48
- # The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, or `canceled`.
48
+ # The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, `canceled`, `payment_never_settled`, or `acknowledged`.
49
49
  sig { returns(T.nilable(String)) }
50
50
  attr_reader :closed_reason
51
51
  # Time at which the object was created. Measured in seconds since the Unix epoch.
@@ -75,7 +75,7 @@ module Stripe
75
75
  # The PaymentIntent ID associated with this review, if one exists.
76
76
  sig { returns(T.any(String, Stripe::PaymentIntent)) }
77
77
  attr_reader :payment_intent
78
- # The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, or `canceled`.
78
+ # The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, `redacted`, `canceled`, `payment_never_settled`, or `acknowledged`.
79
79
  sig { returns(String) }
80
80
  attr_reader :reason
81
81
  # Information related to the browsing session of the user who initiated the payment.
@@ -91,7 +91,7 @@ module Stripe
91
91
  sig { returns(String) }
92
92
  attr_reader :type
93
93
  end
94
- # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`.
94
+ # Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`.
95
95
  sig { returns(T.nilable(String)) }
96
96
  attr_reader :brand
97
97
  # Check results by Card networks on Card address and CVC at the time of authorization
@@ -974,7 +974,7 @@ module Stripe
974
974
  }
975
975
  attr_accessor :billing_thresholds
976
976
  # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
977
- sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
977
+ sig { returns(T.nilable(T.nilable(T.any(String, T.any(Integer, String))))) }
978
978
  attr_accessor :cancel_at
979
979
  # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
980
980
  sig { returns(T.nilable(T::Boolean)) }
@@ -1034,7 +1034,7 @@ module Stripe
1034
1034
  #
1035
1035
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
1036
1036
  #
1037
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
1037
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
1038
1038
  sig { returns(T.nilable(String)) }
1039
1039
  attr_accessor :payment_behavior
1040
1040
  # Payment settings to pass to invoices created by the subscription.
@@ -1066,7 +1066,7 @@ module Stripe
1066
1066
  sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::TrialSettings)) }
1067
1067
  attr_accessor :trial_settings
1068
1068
  sig {
1069
- params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::BillingThresholds))), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancellation_details: T.nilable(::Stripe::Subscription::UpdateParams::CancellationDetails), collection_method: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(T.nilable(String)), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), pause_collection: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::Subscription::UpdateParams::TrialSettings)).void
1069
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::BillingThresholds))), cancel_at: T.nilable(T.nilable(T.any(String, T.any(Integer, String)))), cancel_at_period_end: T.nilable(T::Boolean), cancellation_details: T.nilable(::Stripe::Subscription::UpdateParams::CancellationDetails), collection_method: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(T.nilable(String)), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), pause_collection: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::Subscription::UpdateParams::TrialSettings)).void
1070
1070
  }
1071
1071
  def initialize(
1072
1072
  add_invoice_items: nil,
@@ -1347,7 +1347,7 @@ module Stripe
1347
1347
  def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil); end
1348
1348
  end
1349
1349
  class BillingMode < Stripe::RequestParams
1350
- # Attribute for param field type
1350
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
1351
1351
  sig { returns(String) }
1352
1352
  attr_accessor :type
1353
1353
  sig { params(type: String).void }
@@ -1776,7 +1776,7 @@ module Stripe
1776
1776
  }
1777
1777
  attr_accessor :billing_thresholds
1778
1778
  # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
1779
- sig { returns(T.nilable(Integer)) }
1779
+ sig { returns(T.nilable(T.any(Integer, String))) }
1780
1780
  attr_accessor :cancel_at
1781
1781
  # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
1782
1782
  sig { returns(T.nilable(T::Boolean)) }
@@ -1868,7 +1868,7 @@ module Stripe
1868
1868
  sig { returns(T.nilable(::Stripe::Subscription::CreateParams::TrialSettings)) }
1869
1869
  attr_accessor :trial_settings
1870
1870
  sig {
1871
- params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::Subscription::CreateParams::BillingCycleAnchorConfig), billing_mode: T.nilable(::Stripe::Subscription::CreateParams::BillingMode), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::BillingThresholds))), cancel_at: T.nilable(Integer), cancel_at_period_end: T.nilable(T::Boolean), collection_method: T.nilable(String), currency: T.nilable(String), customer: String, days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::Subscription::CreateParams::TransferData), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_period_days: T.nilable(Integer), trial_settings: T.nilable(::Stripe::Subscription::CreateParams::TrialSettings)).void
1871
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::Subscription::CreateParams::BillingCycleAnchorConfig), billing_mode: T.nilable(::Stripe::Subscription::CreateParams::BillingMode), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::BillingThresholds))), cancel_at: T.nilable(T.any(Integer, String)), cancel_at_period_end: T.nilable(T::Boolean), collection_method: T.nilable(String), currency: T.nilable(String), customer: String, days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::Subscription::CreateParams::TransferData), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_period_days: T.nilable(Integer), trial_settings: T.nilable(::Stripe::Subscription::CreateParams::TrialSettings)).void
1872
1872
  }
1873
1873
  def initialize(
1874
1874
  add_invoice_items: nil,
@@ -169,7 +169,7 @@ module Stripe
169
169
  #
170
170
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
171
171
  #
172
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
172
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
173
173
  sig { returns(T.nilable(String)) }
174
174
  attr_accessor :payment_behavior
175
175
  # The identifier of the new plan for this subscription item.
@@ -325,7 +325,7 @@ module Stripe
325
325
  #
326
326
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
327
327
  #
328
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
328
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
329
329
  sig { returns(T.nilable(String)) }
330
330
  attr_accessor :payment_behavior
331
331
  # The identifier of the plan to add to the subscription.
@@ -486,7 +486,7 @@ module Stripe
486
486
  end
487
487
  class CreateParams < Stripe::RequestParams
488
488
  class BillingMode < Stripe::RequestParams
489
- # Attribute for param field type
489
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
490
490
  sig { returns(String) }
491
491
  attr_accessor :type
492
492
  sig { params(type: String).void }
@@ -745,6 +745,16 @@ module Stripe
745
745
  }
746
746
  def initialize(coupon: nil, discount: nil, promotion_code: nil); end
747
747
  end
748
+ class Duration < Stripe::RequestParams
749
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
750
+ sig { returns(String) }
751
+ attr_accessor :interval
752
+ # The multiplier applied to the interval.
753
+ sig { returns(T.nilable(Integer)) }
754
+ attr_accessor :interval_count
755
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
756
+ def initialize(interval: nil, interval_count: nil); end
757
+ end
748
758
  class InvoiceSettings < Stripe::RequestParams
749
759
  class Issuer < Stripe::RequestParams
750
760
  # The connected account being referenced when `type` is `account`.
@@ -933,6 +943,9 @@ module Stripe
933
943
  returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]))))
934
944
  }
935
945
  attr_accessor :discounts
946
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
947
+ sig { returns(T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Duration)) }
948
+ attr_accessor :duration
936
949
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
937
950
  sig { returns(T.nilable(Integer)) }
938
951
  attr_accessor :end_date
@@ -944,7 +957,7 @@ module Stripe
944
957
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
945
958
  sig { returns(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item]) }
946
959
  attr_accessor :items
947
- # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
960
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. This parameter is deprecated and will be removed in a future version. Use `duration` instead.
948
961
  sig { returns(T.nilable(Integer)) }
949
962
  attr_accessor :iterations
950
963
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
@@ -968,7 +981,7 @@ module Stripe
968
981
  sig { returns(T.nilable(Integer)) }
969
982
  attr_accessor :trial_end
970
983
  sig {
971
- params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::CreateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]))), end_date: T.nilable(Integer), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(Integer)).void
984
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::CreateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Discount]))), duration: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::Duration), end_date: T.nilable(Integer), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::CreateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::CreateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(Integer)).void
972
985
  }
973
986
  def initialize(
974
987
  add_invoice_items: nil,
@@ -982,6 +995,7 @@ module Stripe
982
995
  default_tax_rates: nil,
983
996
  description: nil,
984
997
  discounts: nil,
998
+ duration: nil,
985
999
  end_date: nil,
986
1000
  invoice_settings: nil,
987
1001
  items: nil,
@@ -1290,6 +1304,16 @@ module Stripe
1290
1304
  }
1291
1305
  def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1292
1306
  end
1307
+ class Duration < Stripe::RequestParams
1308
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
1309
+ sig { returns(String) }
1310
+ attr_accessor :interval
1311
+ # The multiplier applied to the interval.
1312
+ sig { returns(T.nilable(Integer)) }
1313
+ attr_accessor :interval_count
1314
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1315
+ def initialize(interval: nil, interval_count: nil); end
1316
+ end
1293
1317
  class InvoiceSettings < Stripe::RequestParams
1294
1318
  class Issuer < Stripe::RequestParams
1295
1319
  # The connected account being referenced when `type` is `account`.
@@ -1478,6 +1502,9 @@ module Stripe
1478
1502
  returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]))))
1479
1503
  }
1480
1504
  attr_accessor :discounts
1505
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
1506
+ sig { returns(T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Duration)) }
1507
+ attr_accessor :duration
1481
1508
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1482
1509
  sig { returns(T.nilable(T.any(Integer, String))) }
1483
1510
  attr_accessor :end_date
@@ -1489,7 +1516,7 @@ module Stripe
1489
1516
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1490
1517
  sig { returns(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item]) }
1491
1518
  attr_accessor :items
1492
- # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
1519
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. This parameter is deprecated and will be removed in a future version. Use `duration` instead.
1493
1520
  sig { returns(T.nilable(Integer)) }
1494
1521
  attr_accessor :iterations
1495
1522
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
@@ -1516,7 +1543,7 @@ module Stripe
1516
1543
  sig { returns(T.nilable(T.any(Integer, String))) }
1517
1544
  attr_accessor :trial_end
1518
1545
  sig {
1519
- params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::UpdateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]))), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
1546
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::AddInvoiceItem]), application_fee_percent: T.nilable(Float), automatic_tax: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionSchedule::UpdateParams::Phase::BillingThresholds))), collection_method: T.nilable(String), currency: T.nilable(String), default_payment_method: T.nilable(String), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Discount]))), duration: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::Duration), end_date: T.nilable(T.any(Integer, String)), invoice_settings: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::InvoiceSettings), items: T::Array[::Stripe::SubscriptionSchedule::UpdateParams::Phase::Item], iterations: T.nilable(Integer), metadata: T.nilable(T::Hash[String, String]), on_behalf_of: T.nilable(String), proration_behavior: T.nilable(String), start_date: T.nilable(T.any(Integer, String)), transfer_data: T.nilable(::Stripe::SubscriptionSchedule::UpdateParams::Phase::TransferData), trial: T.nilable(T::Boolean), trial_end: T.nilable(T.any(Integer, String))).void
1520
1547
  }
1521
1548
  def initialize(
1522
1549
  add_invoice_items: nil,
@@ -1530,6 +1557,7 @@ module Stripe
1530
1557
  default_tax_rates: nil,
1531
1558
  description: nil,
1532
1559
  discounts: nil,
1560
+ duration: nil,
1533
1561
  end_date: nil,
1534
1562
  invoice_settings: nil,
1535
1563
  items: nil,