stripe 15.1.0 → 15.2.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 (243) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -6
  3. data/CONTRIBUTING.md +25 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +10 -7
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/resources/account.rb +47 -20
  9. data/lib/stripe/resources/account_session.rb +111 -7
  10. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  11. data/lib/stripe/resources/balance.rb +42 -0
  12. data/lib/stripe/resources/balance_transaction.rb +2 -0
  13. data/lib/stripe/resources/bank_account.rb +2 -2
  14. data/lib/stripe/resources/billing_portal/session.rb +1 -1
  15. data/lib/stripe/resources/capability.rb +1 -1
  16. data/lib/stripe/resources/charge.rb +13 -5
  17. data/lib/stripe/resources/checkout/session.rb +20 -4
  18. data/lib/stripe/resources/confirmation_token.rb +33 -87
  19. data/lib/stripe/resources/country_spec.rb +1 -1
  20. data/lib/stripe/resources/coupon.rb +1 -2
  21. data/lib/stripe/resources/credit_note.rb +12 -9
  22. data/lib/stripe/resources/customer.rb +2 -4
  23. data/lib/stripe/resources/customer_session.rb +3 -3
  24. data/lib/stripe/resources/dispute.rb +2 -2
  25. data/lib/stripe/resources/event.rb +1 -1
  26. data/lib/stripe/resources/file.rb +1 -1
  27. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  28. data/lib/stripe/resources/identity/verification_session.rb +17 -11
  29. data/lib/stripe/resources/invoice.rb +114 -27
  30. data/lib/stripe/resources/invoice_item.rb +2 -3
  31. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  32. data/lib/stripe/resources/invoice_payment.rb +9 -2
  33. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  34. data/lib/stripe/resources/issuing/card.rb +1 -1
  35. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  36. data/lib/stripe/resources/payment_intent.rb +196 -302
  37. data/lib/stripe/resources/payment_method.rb +46 -103
  38. data/lib/stripe/resources/payment_method_configuration.rb +297 -2
  39. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  40. data/lib/stripe/resources/payout.rb +4 -4
  41. data/lib/stripe/resources/person.rb +2 -2
  42. data/lib/stripe/resources/plan.rb +2 -3
  43. data/lib/stripe/resources/price.rb +1 -1
  44. data/lib/stripe/resources/product.rb +1 -2
  45. data/lib/stripe/resources/radar/value_list.rb +1 -2
  46. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  47. data/lib/stripe/resources/refund.rb +6 -1
  48. data/lib/stripe/resources/reversal.rb +1 -1
  49. data/lib/stripe/resources/review.rb +1 -1
  50. data/lib/stripe/resources/setup_intent.rb +111 -281
  51. data/lib/stripe/resources/source.rb +1 -1
  52. data/lib/stripe/resources/subscription.rb +89 -29
  53. data/lib/stripe/resources/subscription_item.rb +33 -0
  54. data/lib/stripe/resources/subscription_schedule.rb +119 -4
  55. data/lib/stripe/resources/tax/calculation.rb +4 -0
  56. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  57. data/lib/stripe/resources/tax/registration.rb +1 -1
  58. data/lib/stripe/resources/tax_id.rb +1 -2
  59. data/lib/stripe/resources/tax_rate.rb +2 -2
  60. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  61. data/lib/stripe/resources/terminal/location.rb +2 -3
  62. data/lib/stripe/resources/terminal/reader.rb +275 -3
  63. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  64. data/lib/stripe/resources/token.rb +2 -2
  65. data/lib/stripe/resources/transfer.rb +1 -1
  66. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  67. data/lib/stripe/services/account_external_account_service.rb +2 -3
  68. data/lib/stripe/services/account_login_link_service.rb +1 -1
  69. data/lib/stripe/services/account_person_service.rb +1 -2
  70. data/lib/stripe/services/account_service.rb +38 -13
  71. data/lib/stripe/services/account_session_service.rb +75 -7
  72. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  73. data/lib/stripe/services/balance_service.rb +1 -1
  74. data/lib/stripe/services/charge_service.rb +4 -4
  75. data/lib/stripe/services/checkout/session_service.rb +11 -3
  76. data/lib/stripe/services/coupon_service.rb +1 -2
  77. data/lib/stripe/services/credit_note_service.rb +7 -8
  78. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  79. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  80. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  81. data/lib/stripe/services/customer_service.rb +3 -5
  82. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  83. data/lib/stripe/services/dispute_service.rb +1 -1
  84. data/lib/stripe/services/file_service.rb +1 -1
  85. data/lib/stripe/services/identity/verification_session_service.rb +5 -5
  86. data/lib/stripe/services/invoice_item_service.rb +1 -2
  87. data/lib/stripe/services/invoice_service.rb +92 -23
  88. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  89. data/lib/stripe/services/issuing/card_service.rb +1 -1
  90. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  91. data/lib/stripe/services/payment_intent_service.rb +176 -292
  92. data/lib/stripe/services/payment_method_configuration_service.rb +212 -2
  93. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  94. data/lib/stripe/services/payment_method_service.rb +43 -100
  95. data/lib/stripe/services/payout_service.rb +2 -2
  96. data/lib/stripe/services/plan_service.rb +2 -3
  97. data/lib/stripe/services/price_service.rb +2 -2
  98. data/lib/stripe/services/product_feature_service.rb +1 -2
  99. data/lib/stripe/services/product_service.rb +2 -3
  100. data/lib/stripe/services/promotion_code_service.rb +1 -1
  101. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  102. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  103. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  104. data/lib/stripe/services/setup_intent_service.rb +110 -280
  105. data/lib/stripe/services/source_service.rb +1 -1
  106. data/lib/stripe/services/subscription_item_service.rb +26 -0
  107. data/lib/stripe/services/subscription_schedule_service.rb +93 -3
  108. data/lib/stripe/services/subscription_service.rb +77 -26
  109. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  110. data/lib/stripe/services/tax/registration_service.rb +1 -1
  111. data/lib/stripe/services/tax_id_service.rb +1 -2
  112. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  113. data/lib/stripe/services/terminal/location_service.rb +2 -3
  114. data/lib/stripe/services/terminal/reader_service.rb +106 -2
  115. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +33 -87
  116. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  117. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  118. data/lib/stripe/services/token_service.rb +1 -1
  119. data/lib/stripe/services/transfer_service.rb +1 -1
  120. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  121. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  122. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  123. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  124. data/lib/stripe/version.rb +1 -1
  125. data/rbi/stripe/resources/account.rbi +46 -23
  126. data/rbi/stripe/resources/account_session.rbi +131 -12
  127. data/rbi/stripe/resources/apple_pay_domain.rbi +1 -3
  128. data/rbi/stripe/resources/balance.rbi +55 -0
  129. data/rbi/stripe/resources/balance_transaction.rbi +3 -0
  130. data/rbi/stripe/resources/bank_account.rbi +2 -2
  131. data/rbi/stripe/resources/billing/alert.rbi +2 -2
  132. data/rbi/stripe/resources/billing_portal/session.rbi +1 -1
  133. data/rbi/stripe/resources/capability.rbi +1 -1
  134. data/rbi/stripe/resources/charge.rbi +17 -5
  135. data/rbi/stripe/resources/checkout/session.rbi +22 -6
  136. data/rbi/stripe/resources/confirmation_token.rbi +33 -99
  137. data/rbi/stripe/resources/country_spec.rbi +1 -1
  138. data/rbi/stripe/resources/coupon.rbi +1 -3
  139. data/rbi/stripe/resources/credit_note.rbi +14 -9
  140. data/rbi/stripe/resources/customer.rbi +2 -6
  141. data/rbi/stripe/resources/customer_session.rbi +3 -3
  142. data/rbi/stripe/resources/dispute.rbi +2 -2
  143. data/rbi/stripe/resources/event.rbi +1 -1
  144. data/rbi/stripe/resources/file.rbi +1 -1
  145. data/rbi/stripe/resources/identity/verification_report.rbi +9 -0
  146. data/rbi/stripe/resources/identity/verification_session.rbi +20 -11
  147. data/rbi/stripe/resources/invoice.rbi +109 -33
  148. data/rbi/stripe/resources/invoice_item.rbi +2 -4
  149. data/rbi/stripe/resources/invoice_line_item.rbi +1 -1
  150. data/rbi/stripe/resources/invoice_payment.rbi +9 -2
  151. data/rbi/stripe/resources/issuing/authorization.rbi +8 -8
  152. data/rbi/stripe/resources/issuing/card.rbi +1 -1
  153. data/rbi/stripe/resources/issuing/dispute.rbi +3 -3
  154. data/rbi/stripe/resources/payment_intent.rbi +201 -349
  155. data/rbi/stripe/resources/payment_method.rbi +46 -116
  156. data/rbi/stripe/resources/payment_method_configuration.rbi +334 -4
  157. data/rbi/stripe/resources/payment_method_domain.rbi +2 -2
  158. data/rbi/stripe/resources/payout.rbi +4 -4
  159. data/rbi/stripe/resources/person.rbi +2 -2
  160. data/rbi/stripe/resources/plan.rbi +2 -4
  161. data/rbi/stripe/resources/price.rbi +1 -1
  162. data/rbi/stripe/resources/product.rbi +1 -3
  163. data/rbi/stripe/resources/radar/value_list.rbi +1 -3
  164. data/rbi/stripe/resources/radar/value_list_item.rbi +1 -3
  165. data/rbi/stripe/resources/refund.rbi +5 -1
  166. data/rbi/stripe/resources/reversal.rbi +1 -1
  167. data/rbi/stripe/resources/review.rbi +1 -1
  168. data/rbi/stripe/resources/setup_intent.rbi +111 -325
  169. data/rbi/stripe/resources/source.rbi +1 -1
  170. data/rbi/stripe/resources/subscription.rbi +99 -36
  171. data/rbi/stripe/resources/subscription_item.rbi +36 -2
  172. data/rbi/stripe/resources/subscription_schedule.rbi +138 -10
  173. data/rbi/stripe/resources/tax/calculation.rbi +5 -1
  174. data/rbi/stripe/resources/tax/calculation_line_item.rbi +3 -0
  175. data/rbi/stripe/resources/tax/registration.rbi +1 -1
  176. data/rbi/stripe/resources/tax_id.rbi +1 -3
  177. data/rbi/stripe/resources/tax_rate.rbi +2 -2
  178. data/rbi/stripe/resources/terminal/configuration.rbi +1 -3
  179. data/rbi/stripe/resources/terminal/location.rbi +2 -4
  180. data/rbi/stripe/resources/terminal/reader.rbi +265 -5
  181. data/rbi/stripe/resources/test_helpers/test_clock.rbi +1 -3
  182. data/rbi/stripe/resources/token.rbi +2 -2
  183. data/rbi/stripe/resources/transfer.rbi +1 -1
  184. data/rbi/stripe/resources/webhook_endpoint.rbi +1 -3
  185. data/rbi/stripe/services/account_external_account_service.rbi +2 -4
  186. data/rbi/stripe/services/account_login_link_service.rbi +1 -1
  187. data/rbi/stripe/services/account_person_service.rbi +1 -3
  188. data/rbi/stripe/services/account_service.rbi +40 -16
  189. data/rbi/stripe/services/account_session_service.rbi +86 -12
  190. data/rbi/stripe/services/apple_pay_domain_service.rbi +1 -3
  191. data/rbi/stripe/services/balance_service.rbi +1 -1
  192. data/rbi/stripe/services/billing/alert_service.rbi +2 -2
  193. data/rbi/stripe/services/charge_service.rbi +4 -4
  194. data/rbi/stripe/services/checkout/session_service.rbi +12 -5
  195. data/rbi/stripe/services/coupon_service.rbi +1 -3
  196. data/rbi/stripe/services/credit_note_service.rbi +7 -8
  197. data/rbi/stripe/services/customer_balance_transaction_service.rbi +3 -3
  198. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +2 -2
  199. data/rbi/stripe/services/customer_payment_source_service.rbi +1 -1
  200. data/rbi/stripe/services/customer_service.rbi +3 -7
  201. data/rbi/stripe/services/customer_tax_id_service.rbi +1 -3
  202. data/rbi/stripe/services/dispute_service.rbi +1 -1
  203. data/rbi/stripe/services/file_service.rbi +1 -1
  204. data/rbi/stripe/services/identity/verification_session_service.rbi +5 -5
  205. data/rbi/stripe/services/invoice_item_service.rbi +1 -3
  206. data/rbi/stripe/services/invoice_service.rbi +90 -29
  207. data/rbi/stripe/services/issuing/authorization_service.rbi +4 -4
  208. data/rbi/stripe/services/issuing/card_service.rbi +1 -1
  209. data/rbi/stripe/services/issuing/dispute_service.rbi +2 -2
  210. data/rbi/stripe/services/payment_intent_service.rbi +179 -339
  211. data/rbi/stripe/services/payment_method_configuration_service.rbi +236 -4
  212. data/rbi/stripe/services/payment_method_domain_service.rbi +1 -1
  213. data/rbi/stripe/services/payment_method_service.rbi +43 -113
  214. data/rbi/stripe/services/payout_service.rbi +2 -2
  215. data/rbi/stripe/services/plan_service.rbi +2 -4
  216. data/rbi/stripe/services/price_service.rbi +2 -2
  217. data/rbi/stripe/services/product_feature_service.rbi +1 -3
  218. data/rbi/stripe/services/product_service.rbi +2 -4
  219. data/rbi/stripe/services/promotion_code_service.rbi +1 -1
  220. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +1 -1
  221. data/rbi/stripe/services/radar/value_list_item_service.rbi +1 -3
  222. data/rbi/stripe/services/radar/value_list_service.rbi +1 -3
  223. data/rbi/stripe/services/setup_intent_service.rbi +110 -324
  224. data/rbi/stripe/services/source_service.rbi +1 -1
  225. data/rbi/stripe/services/subscription_item_service.rbi +28 -2
  226. data/rbi/stripe/services/subscription_schedule_service.rbi +107 -9
  227. data/rbi/stripe/services/subscription_service.rbi +85 -33
  228. data/rbi/stripe/services/tax/calculation_service.rbi +5 -1
  229. data/rbi/stripe/services/tax/registration_service.rbi +1 -1
  230. data/rbi/stripe/services/tax_id_service.rbi +1 -3
  231. data/rbi/stripe/services/terminal/configuration_service.rbi +1 -3
  232. data/rbi/stripe/services/terminal/location_service.rbi +2 -4
  233. data/rbi/stripe/services/terminal/reader_service.rbi +115 -4
  234. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +33 -99
  235. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +31 -0
  236. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +1 -3
  237. data/rbi/stripe/services/token_service.rbi +1 -1
  238. data/rbi/stripe/services/transfer_service.rbi +1 -1
  239. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +1 -3
  240. data/rbi/stripe/services/v2/core/event_destination_service.rbi +4 -12
  241. data/rbi/stripe/services/v2/core/event_service.rbi +1 -3
  242. data/rbi/stripe/services/webhook_endpoint_service.rbi +1 -3
  243. metadata +3 -2
@@ -139,6 +139,18 @@ module Stripe
139
139
  }
140
140
  def initialize(enabled: nil, liability: nil); end
141
141
  end
142
+ class BillingThresholds < Stripe::RequestParams
143
+ # Monetary threshold that triggers the subscription to advance to a new billing period
144
+ sig { returns(T.nilable(Integer)) }
145
+ attr_accessor :amount_gte
146
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
147
+ sig { returns(T.nilable(T::Boolean)) }
148
+ attr_accessor :reset_billing_cycle_anchor
149
+ sig {
150
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
151
+ }
152
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
153
+ end
142
154
  class CancellationDetails < Stripe::RequestParams
143
155
  # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
144
156
  sig { returns(T.nilable(T.nilable(String))) }
@@ -191,6 +203,13 @@ module Stripe
191
203
  def initialize(account_tax_ids: nil, issuer: nil); end
192
204
  end
193
205
  class Item < Stripe::RequestParams
206
+ class BillingThresholds < Stripe::RequestParams
207
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
208
+ sig { returns(Integer) }
209
+ attr_accessor :usage_gte
210
+ sig { params(usage_gte: Integer).void }
211
+ def initialize(usage_gte: nil); end
212
+ end
194
213
  class Discount < Stripe::RequestParams
195
214
  # ID of the coupon to create a new discount for.
196
215
  sig { returns(T.nilable(String)) }
@@ -247,6 +266,11 @@ module Stripe
247
266
  unit_amount_decimal: nil
248
267
  ); end
249
268
  end
269
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
270
+ sig {
271
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds))))
272
+ }
273
+ attr_accessor :billing_thresholds
250
274
  # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
251
275
  sig { returns(T.nilable(T::Boolean)) }
252
276
  attr_accessor :clear_usage
@@ -280,9 +304,10 @@ module Stripe
280
304
  sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
281
305
  attr_accessor :tax_rates
282
306
  sig {
283
- params(clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Item::Discount]))), id: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::UpdateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
307
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds))), clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Item::Discount]))), id: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::UpdateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
284
308
  }
285
309
  def initialize(
310
+ billing_thresholds: nil,
286
311
  clear_usage: nil,
287
312
  deleted: nil,
288
313
  discounts: nil,
@@ -402,12 +427,8 @@ module Stripe
402
427
  }
403
428
  def initialize(bank_transfer: nil, funding_type: nil); end
404
429
  end
405
- class Konbini < Stripe::RequestParams
406
-
407
- end
408
- class SepaDebit < Stripe::RequestParams
409
-
410
- end
430
+ class Konbini < Stripe::RequestParams; end
431
+ class SepaDebit < Stripe::RequestParams; end
411
432
  class UsBankAccount < Stripe::RequestParams
412
433
  class FinancialConnections < Stripe::RequestParams
413
434
  class Filters < Stripe::RequestParams
@@ -564,10 +585,15 @@ module Stripe
564
585
  # Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
565
586
  sig { returns(T.nilable(String)) }
566
587
  attr_accessor :billing_cycle_anchor
588
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
589
+ sig {
590
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::BillingThresholds))))
591
+ }
592
+ attr_accessor :billing_thresholds
567
593
  # 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.
568
594
  sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
569
595
  attr_accessor :cancel_at
570
- # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
596
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
571
597
  sig { returns(T.nilable(T::Boolean)) }
572
598
  attr_accessor :cancel_at_period_end
573
599
  # Details about why this subscription was cancelled
@@ -639,7 +665,7 @@ module Stripe
639
665
  # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
640
666
  sig { returns(T.nilable(String)) }
641
667
  attr_accessor :proration_behavior
642
- # If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
668
+ # If set, prorations will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. `proration_date` can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
643
669
  sig { returns(T.nilable(Integer)) }
644
670
  attr_accessor :proration_date
645
671
  # If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value.
@@ -647,7 +673,7 @@ module Stripe
647
673
  returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData))))
648
674
  }
649
675
  attr_accessor :transfer_data
650
- # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
676
+ # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, `trial_end` will override the default trial period of the plan the customer is being subscribed to. The `billing_cycle_anchor` will be updated to the `trial_end` value. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
651
677
  sig { returns(T.nilable(T.any(String, Integer))) }
652
678
  attr_accessor :trial_end
653
679
  # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
@@ -657,13 +683,14 @@ module Stripe
657
683
  sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)) }
658
684
  attr_accessor :trial_settings
659
685
  sig {
660
- params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancellation_details: T.nilable(::Stripe::SubscriptionService::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::SubscriptionService::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::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::SubscriptionService::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)).void
686
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::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::SubscriptionService::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::SubscriptionService::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::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::SubscriptionService::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)).void
661
687
  }
662
688
  def initialize(
663
689
  add_invoice_items: nil,
664
690
  application_fee_percent: nil,
665
691
  automatic_tax: nil,
666
692
  billing_cycle_anchor: nil,
693
+ billing_thresholds: nil,
667
694
  cancel_at: nil,
668
695
  cancel_at_period_end: nil,
669
696
  cancellation_details: nil,
@@ -692,9 +719,7 @@ module Stripe
692
719
  trial_settings: nil
693
720
  ); end
694
721
  end
695
- class DeleteDiscountParams < Stripe::RequestParams
696
-
697
- end
722
+ class DeleteDiscountParams < Stripe::RequestParams; end
698
723
  class ListParams < Stripe::RequestParams
699
724
  class AutomaticTax < Stripe::RequestParams
700
725
  # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
@@ -942,6 +967,18 @@ module Stripe
942
967
  }
943
968
  def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil); end
944
969
  end
970
+ class BillingThresholds < Stripe::RequestParams
971
+ # Monetary threshold that triggers the subscription to advance to a new billing period
972
+ sig { returns(T.nilable(Integer)) }
973
+ attr_accessor :amount_gte
974
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
975
+ sig { returns(T.nilable(T::Boolean)) }
976
+ attr_accessor :reset_billing_cycle_anchor
977
+ sig {
978
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
979
+ }
980
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
981
+ end
945
982
  class Discount < Stripe::RequestParams
946
983
  # ID of the coupon to create a new discount for.
947
984
  sig { returns(T.nilable(String)) }
@@ -982,6 +1019,13 @@ module Stripe
982
1019
  def initialize(account_tax_ids: nil, issuer: nil); end
983
1020
  end
984
1021
  class Item < Stripe::RequestParams
1022
+ class BillingThresholds < Stripe::RequestParams
1023
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1024
+ sig { returns(Integer) }
1025
+ attr_accessor :usage_gte
1026
+ sig { params(usage_gte: Integer).void }
1027
+ def initialize(usage_gte: nil); end
1028
+ end
985
1029
  class Discount < Stripe::RequestParams
986
1030
  # ID of the coupon to create a new discount for.
987
1031
  sig { returns(T.nilable(String)) }
@@ -1038,6 +1082,11 @@ module Stripe
1038
1082
  unit_amount_decimal: nil
1039
1083
  ); end
1040
1084
  end
1085
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1086
+ sig {
1087
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds))))
1088
+ }
1089
+ attr_accessor :billing_thresholds
1041
1090
  # The coupons to redeem into discounts for the subscription item.
1042
1091
  sig {
1043
1092
  returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount]))))
@@ -1062,9 +1111,10 @@ module Stripe
1062
1111
  sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1063
1112
  attr_accessor :tax_rates
1064
1113
  sig {
1065
- params(discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1114
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1066
1115
  }
1067
1116
  def initialize(
1117
+ billing_thresholds: nil,
1068
1118
  discounts: nil,
1069
1119
  metadata: nil,
1070
1120
  plan: nil,
@@ -1171,12 +1221,8 @@ module Stripe
1171
1221
  }
1172
1222
  def initialize(bank_transfer: nil, funding_type: nil); end
1173
1223
  end
1174
- class Konbini < Stripe::RequestParams
1175
-
1176
- end
1177
- class SepaDebit < Stripe::RequestParams
1178
-
1179
- end
1224
+ class Konbini < Stripe::RequestParams; end
1225
+ class SepaDebit < Stripe::RequestParams; end
1180
1226
  class UsBankAccount < Stripe::RequestParams
1181
1227
  class FinancialConnections < Stripe::RequestParams
1182
1228
  class Filters < Stripe::RequestParams
@@ -1341,10 +1387,15 @@ module Stripe
1341
1387
  returns(T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig))
1342
1388
  }
1343
1389
  attr_accessor :billing_cycle_anchor_config
1390
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1391
+ sig {
1392
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::BillingThresholds))))
1393
+ }
1394
+ attr_accessor :billing_thresholds
1344
1395
  # 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.
1345
1396
  sig { returns(T.nilable(Integer)) }
1346
1397
  attr_accessor :cancel_at
1347
- # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
1398
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
1348
1399
  sig { returns(T.nilable(T::Boolean)) }
1349
1400
  attr_accessor :cancel_at_period_end
1350
1401
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
@@ -1434,7 +1485,7 @@ module Stripe
1434
1485
  sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::TrialSettings)) }
1435
1486
  attr_accessor :trial_settings
1436
1487
  sig {
1437
- params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig), 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::SubscriptionService::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::TrialSettings)).void
1488
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::TrialSettings)).void
1438
1489
  }
1439
1490
  def initialize(
1440
1491
  add_invoice_items: nil,
@@ -1443,6 +1494,7 @@ module Stripe
1443
1494
  backdate_start_date: nil,
1444
1495
  billing_cycle_anchor: nil,
1445
1496
  billing_cycle_anchor_config: nil,
1497
+ billing_thresholds: nil,
1446
1498
  cancel_at: nil,
1447
1499
  cancel_at_period_end: nil,
1448
1500
  collection_method: nil,
@@ -1496,10 +1548,10 @@ module Stripe
1496
1548
  # Specifies which fields in the response should be expanded.
1497
1549
  sig { returns(T.nilable(T::Array[String])) }
1498
1550
  attr_accessor :expand
1499
- # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
1551
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor` being `unchanged`. When the `billing_cycle_anchor` is set to `now` (default value), no prorations are generated. If no value is passed, the default is `create_prorations`.
1500
1552
  sig { returns(T.nilable(String)) }
1501
1553
  attr_accessor :proration_behavior
1502
- # If set, the proration will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint.
1554
+ # If set, prorations will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
1503
1555
  sig { returns(T.nilable(Integer)) }
1504
1556
  attr_accessor :proration_date
1505
1557
  sig {
@@ -1512,9 +1564,9 @@ module Stripe
1512
1564
  proration_date: nil
1513
1565
  ); end
1514
1566
  end
1515
- # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://stripe.com/metadata).
1567
+ # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).
1516
1568
  #
1517
- # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
1569
+ # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
1518
1570
  #
1519
1571
  # By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
1520
1572
  sig {
@@ -1527,7 +1579,7 @@ module Stripe
1527
1579
  # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
1528
1580
  # The payment_behavior parameter determines the exact behavior of the initial payment.
1529
1581
  #
1530
- # To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
1582
+ # To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://docs.stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
1531
1583
  # Schedules provide the flexibility to model more complex billing configurations that change over time.
1532
1584
  sig {
1533
1585
  params(params: T.any(::Stripe::SubscriptionService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
@@ -1558,7 +1610,7 @@ module Stripe
1558
1610
  }
1559
1611
  def retrieve(subscription_exposed_id, params = {}, opts = {}); end
1560
1612
 
1561
- # Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
1613
+ # Search for subscriptions you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
1562
1614
  # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
1563
1615
  # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
1564
1616
  # to an hour behind during outages. Search functionality is not available to merchants in India.
@@ -1569,7 +1621,7 @@ module Stripe
1569
1621
 
1570
1622
  # Updates an existing subscription to match the specified parameters.
1571
1623
  # When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
1572
- # To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
1624
+ # To preview how the proration is calculated, use the [create preview](https://docs.stripe.com/docs/api/invoices/create_preview) endpoint.
1573
1625
  #
1574
1626
  # By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
1575
1627
  #
@@ -1581,13 +1633,13 @@ module Stripe
1581
1633
  # A trial starts or ends.
1582
1634
  #
1583
1635
  #
1584
- # In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment).
1636
+ # In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://docs.stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment).
1585
1637
  #
1586
- # If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).
1638
+ # If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://docs.stripe.com/docs/api/invoices/create).
1587
1639
  #
1588
1640
  # If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription.
1589
1641
  #
1590
- # Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://stripe.com/docs/rate-limits) instead.
1642
+ # Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://docs.stripe.com/docs/rate-limits) instead.
1591
1643
  sig {
1592
1644
  params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1593
1645
  }
@@ -91,6 +91,9 @@ module Stripe
91
91
  # If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
92
92
  sig { returns(Integer) }
93
93
  attr_accessor :amount
94
+ # 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.
95
+ sig { returns(T.nilable(T::Hash[String, String])) }
96
+ attr_accessor :metadata
94
97
  # If provided, the product's `tax_code` will be used as the line item's `tax_code`.
95
98
  sig { returns(T.nilable(String)) }
96
99
  attr_accessor :product
@@ -107,10 +110,11 @@ module Stripe
107
110
  sig { returns(T.nilable(String)) }
108
111
  attr_accessor :tax_code
109
112
  sig {
110
- params(amount: Integer, product: T.nilable(String), quantity: T.nilable(Integer), reference: T.nilable(String), tax_behavior: T.nilable(String), tax_code: T.nilable(String)).void
113
+ params(amount: Integer, metadata: T.nilable(T::Hash[String, String]), product: T.nilable(String), quantity: T.nilable(Integer), reference: T.nilable(String), tax_behavior: T.nilable(String), tax_code: T.nilable(String)).void
111
114
  }
112
115
  def initialize(
113
116
  amount: nil,
117
+ metadata: nil,
114
118
  product: nil,
115
119
  quantity: nil,
116
120
  reference: nil,
@@ -1065,7 +1065,7 @@ module Stripe
1065
1065
  end
1066
1066
  class Us < Stripe::RequestParams
1067
1067
  class LocalAmusementTax < Stripe::RequestParams
1068
- # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), `45421` (Lynwood), `64343` (River Grove), and `68081` (Schiller Park).
1068
+ # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), `45421` (Lynwood), `48892` (Midlothian), `64343` (River Grove), and `68081` (Schiller Park).
1069
1069
  sig { returns(String) }
1070
1070
  attr_accessor :jurisdiction
1071
1071
  sig { params(jurisdiction: String).void }
@@ -4,9 +4,7 @@
4
4
  # typed: true
5
5
  module Stripe
6
6
  class TaxIdService < StripeService
7
- class DeleteParams < Stripe::RequestParams
8
-
9
- end
7
+ class DeleteParams < Stripe::RequestParams; end
10
8
  class RetrieveParams < Stripe::RequestParams
11
9
  # Specifies which fields in the response should be expanded.
12
10
  sig { returns(T.nilable(T::Array[String])) }
@@ -5,9 +5,7 @@
5
5
  module Stripe
6
6
  module Terminal
7
7
  class ConfigurationService < StripeService
8
- class DeleteParams < Stripe::RequestParams
9
-
10
- end
8
+ class DeleteParams < Stripe::RequestParams; end
11
9
  class RetrieveParams < Stripe::RequestParams
12
10
  # Specifies which fields in the response should be expanded.
13
11
  sig { returns(T.nilable(T::Array[String])) }
@@ -5,9 +5,7 @@
5
5
  module Stripe
6
6
  module Terminal
7
7
  class LocationService < StripeService
8
- class DeleteParams < Stripe::RequestParams
9
-
10
- end
8
+ class DeleteParams < Stripe::RequestParams; end
11
9
  class RetrieveParams < Stripe::RequestParams
12
10
  # Specifies which fields in the response should be expanded.
13
11
  sig { returns(T.nilable(T::Array[String])) }
@@ -150,7 +148,7 @@ module Stripe
150
148
  ); end
151
149
  end
152
150
  # Creates a new Location object.
153
- # For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide.
151
+ # For further details, including which address fields are required in each country, see the [Manage locations](https://docs.stripe.com/docs/terminal/fleet/locations) guide.
154
152
  sig {
155
153
  params(params: T.any(::Stripe::Terminal::LocationService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Terminal::Location)
156
154
  }
@@ -5,9 +5,7 @@
5
5
  module Stripe
6
6
  module Terminal
7
7
  class ReaderService < StripeService
8
- class DeleteParams < Stripe::RequestParams
9
-
10
- end
8
+ class DeleteParams < Stripe::RequestParams; end
11
9
  class RetrieveParams < Stripe::RequestParams
12
10
  # Specifies which fields in the response should be expanded.
13
11
  sig { returns(T.nilable(T::Array[String])) }
@@ -103,6 +101,109 @@ module Stripe
103
101
  sig { params(expand: T.nilable(T::Array[String])).void }
104
102
  def initialize(expand: nil); end
105
103
  end
104
+ class CollectInputsParams < Stripe::RequestParams
105
+ class Input < Stripe::RequestParams
106
+ class CustomText < Stripe::RequestParams
107
+ # The description which will be displayed when collecting this input
108
+ sig { returns(T.nilable(String)) }
109
+ attr_accessor :description
110
+ # The skip button text
111
+ sig { returns(T.nilable(String)) }
112
+ attr_accessor :skip_button
113
+ # The submit button text
114
+ sig { returns(T.nilable(String)) }
115
+ attr_accessor :submit_button
116
+ # The title which will be displayed when collecting this input
117
+ sig { returns(String) }
118
+ attr_accessor :title
119
+ sig {
120
+ params(description: T.nilable(String), skip_button: T.nilable(String), submit_button: T.nilable(String), title: String).void
121
+ }
122
+ def initialize(description: nil, skip_button: nil, submit_button: nil, title: nil); end
123
+ end
124
+ class Selection < Stripe::RequestParams
125
+ class Choice < Stripe::RequestParams
126
+ # The unique identifier for this choice
127
+ sig { returns(String) }
128
+ attr_accessor :id
129
+ # The style of the button which will be shown for this choice
130
+ sig { returns(T.nilable(String)) }
131
+ attr_accessor :style
132
+ # The text which will be shown on the button for this choice
133
+ sig { returns(String) }
134
+ attr_accessor :text
135
+ sig { params(id: String, style: T.nilable(String), text: String).void }
136
+ def initialize(id: nil, style: nil, text: nil); end
137
+ end
138
+ # List of choices for the `selection` input
139
+ sig {
140
+ returns(T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Selection::Choice])
141
+ }
142
+ attr_accessor :choices
143
+ sig {
144
+ params(choices: T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Selection::Choice]).void
145
+ }
146
+ def initialize(choices: nil); end
147
+ end
148
+ class Toggle < Stripe::RequestParams
149
+ # The default value of the toggle
150
+ sig { returns(T.nilable(String)) }
151
+ attr_accessor :default_value
152
+ # The description which will be displayed for the toggle
153
+ sig { returns(T.nilable(String)) }
154
+ attr_accessor :description
155
+ # The title which will be displayed for the toggle
156
+ sig { returns(T.nilable(String)) }
157
+ attr_accessor :title
158
+ sig {
159
+ params(default_value: T.nilable(String), description: T.nilable(String), title: T.nilable(String)).void
160
+ }
161
+ def initialize(default_value: nil, description: nil, title: nil); end
162
+ end
163
+ # Customize the text which will be displayed while collecting this input
164
+ sig { returns(::Stripe::Terminal::ReaderService::CollectInputsParams::Input::CustomText) }
165
+ attr_accessor :custom_text
166
+ # Indicate that this input is required, disabling the skip button
167
+ sig { returns(T.nilable(T::Boolean)) }
168
+ attr_accessor :required
169
+ # Options for the `selection` input
170
+ sig {
171
+ returns(T.nilable(::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Selection))
172
+ }
173
+ attr_accessor :selection
174
+ # List of toggles to be displayed and customization for the toggles
175
+ sig {
176
+ returns(T.nilable(T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Toggle]))
177
+ }
178
+ attr_accessor :toggles
179
+ # The type of input to collect
180
+ sig { returns(String) }
181
+ attr_accessor :type
182
+ sig {
183
+ params(custom_text: ::Stripe::Terminal::ReaderService::CollectInputsParams::Input::CustomText, required: T.nilable(T::Boolean), selection: T.nilable(::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Selection), toggles: T.nilable(T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input::Toggle]), type: String).void
184
+ }
185
+ def initialize(
186
+ custom_text: nil,
187
+ required: nil,
188
+ selection: nil,
189
+ toggles: nil,
190
+ type: nil
191
+ ); end
192
+ end
193
+ # Specifies which fields in the response should be expanded.
194
+ sig { returns(T.nilable(T::Array[String])) }
195
+ attr_accessor :expand
196
+ # List of inputs to be collected using the Reader
197
+ sig { returns(T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input]) }
198
+ attr_accessor :inputs
199
+ # 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`.
200
+ sig { returns(T.nilable(T::Hash[String, String])) }
201
+ attr_accessor :metadata
202
+ sig {
203
+ params(expand: T.nilable(T::Array[String]), inputs: T::Array[::Stripe::Terminal::ReaderService::CollectInputsParams::Input], metadata: T.nilable(T::Hash[String, String])).void
204
+ }
205
+ def initialize(expand: nil, inputs: nil, metadata: nil); end
206
+ end
106
207
  class ProcessPaymentIntentParams < Stripe::RequestParams
107
208
  class ProcessConfig < Stripe::RequestParams
108
209
  class Tipping < Stripe::RequestParams
@@ -118,6 +219,9 @@ module Stripe
118
219
  # Enables cancel button on transaction screens.
119
220
  sig { returns(T.nilable(T::Boolean)) }
120
221
  attr_accessor :enable_customer_cancellation
222
+ # The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
223
+ sig { returns(T.nilable(String)) }
224
+ attr_accessor :return_url
121
225
  # Override showing a tipping selection screen on this transaction.
122
226
  sig { returns(T.nilable(T::Boolean)) }
123
227
  attr_accessor :skip_tipping
@@ -127,11 +231,12 @@ module Stripe
127
231
  }
128
232
  attr_accessor :tipping
129
233
  sig {
130
- params(allow_redisplay: T.nilable(String), enable_customer_cancellation: T.nilable(T::Boolean), skip_tipping: T.nilable(T::Boolean), tipping: T.nilable(::Stripe::Terminal::ReaderService::ProcessPaymentIntentParams::ProcessConfig::Tipping)).void
234
+ params(allow_redisplay: T.nilable(String), enable_customer_cancellation: T.nilable(T::Boolean), return_url: T.nilable(String), skip_tipping: T.nilable(T::Boolean), tipping: T.nilable(::Stripe::Terminal::ReaderService::ProcessPaymentIntentParams::ProcessConfig::Tipping)).void
131
235
  }
132
236
  def initialize(
133
237
  allow_redisplay: nil,
134
238
  enable_customer_cancellation: nil,
239
+ return_url: nil,
135
240
  skip_tipping: nil,
136
241
  tipping: nil
137
242
  ); end
@@ -286,6 +391,12 @@ module Stripe
286
391
  }
287
392
  def cancel_action(reader, params = {}, opts = {}); end
288
393
 
394
+ # Initiates an input collection flow on a Reader.
395
+ sig {
396
+ params(reader: String, params: T.any(::Stripe::Terminal::ReaderService::CollectInputsParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Terminal::Reader)
397
+ }
398
+ def collect_inputs(reader, params = {}, opts = {}); end
399
+
289
400
  # Creates a new Reader object.
290
401
  sig {
291
402
  params(params: T.any(::Stripe::Terminal::ReaderService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Terminal::Reader)