stripe 15.2.0.pre.beta.1 → 15.3.0.pre.beta.1

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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +92 -0
  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/event_types.rb +9 -0
  9. data/lib/stripe/events/v2_core_account_link_completed_event.rb +1 -1
  10. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +1 -1
  11. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +1 -1
  12. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +1 -1
  13. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +1 -1
  14. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +1 -1
  15. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +1 -1
  16. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +1 -1
  17. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +1 -1
  18. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +1 -1
  19. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +1 -1
  20. data/lib/stripe/events/v2_off_session_payment_requires_capture_event.rb +21 -0
  21. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  22. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +21 -0
  23. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  24. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  26. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  27. data/lib/stripe/object_types.rb +1 -3
  28. data/lib/stripe/resources/account.rb +47 -20
  29. data/lib/stripe/resources/account_session.rb +85 -24
  30. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  31. data/lib/stripe/resources/balance.rb +42 -0
  32. data/lib/stripe/resources/balance_transaction.rb +2 -0
  33. data/lib/stripe/resources/bank_account.rb +2 -2
  34. data/lib/stripe/resources/billing_portal/session.rb +1 -1
  35. data/lib/stripe/resources/capability.rb +1 -1
  36. data/lib/stripe/resources/charge.rb +85 -9
  37. data/lib/stripe/resources/checkout/session.rb +22 -6
  38. data/lib/stripe/resources/confirmation_token.rb +37 -97
  39. data/lib/stripe/resources/country_spec.rb +1 -1
  40. data/lib/stripe/resources/coupon.rb +1 -2
  41. data/lib/stripe/resources/credit_note.rb +10 -11
  42. data/lib/stripe/resources/customer.rb +2 -4
  43. data/lib/stripe/resources/customer_session.rb +3 -3
  44. data/lib/stripe/resources/dispute.rb +2 -2
  45. data/lib/stripe/resources/event.rb +1 -1
  46. data/lib/stripe/resources/file.rb +1 -1
  47. data/lib/stripe/resources/financial_connections/account.rb +2 -0
  48. data/lib/stripe/resources/financial_connections/institution.rb +2 -0
  49. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  50. data/lib/stripe/resources/identity/verification_session.rb +17 -11
  51. data/lib/stripe/resources/invoice.rb +70 -43
  52. data/lib/stripe/resources/invoice_item.rb +2 -3
  53. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  54. data/lib/stripe/resources/invoice_payment.rb +9 -2
  55. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  56. data/lib/stripe/resources/issuing/card.rb +1 -1
  57. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  58. data/lib/stripe/resources/order.rb +2 -55
  59. data/lib/stripe/resources/payment_attempt_record.rb +8 -0
  60. data/lib/stripe/resources/payment_intent.rb +439 -411
  61. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +7 -0
  62. data/lib/stripe/resources/payment_method.rb +50 -113
  63. data/lib/stripe/resources/payment_method_configuration.rb +297 -2
  64. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  65. data/lib/stripe/resources/payment_record.rb +8 -0
  66. data/lib/stripe/resources/payout.rb +4 -4
  67. data/lib/stripe/resources/person.rb +2 -2
  68. data/lib/stripe/resources/plan.rb +2 -3
  69. data/lib/stripe/resources/price.rb +1 -1
  70. data/lib/stripe/resources/privacy/redaction_job.rb +52 -29
  71. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +12 -4
  72. data/lib/stripe/resources/product.rb +1 -61
  73. data/lib/stripe/resources/quote.rb +1 -1
  74. data/lib/stripe/resources/quote_preview_invoice.rb +2 -2
  75. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +26 -1
  76. data/lib/stripe/resources/radar/value_list.rb +1 -2
  77. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  78. data/lib/stripe/resources/refund.rb +6 -1
  79. data/lib/stripe/resources/reversal.rb +1 -1
  80. data/lib/stripe/resources/review.rb +1 -1
  81. data/lib/stripe/resources/setup_intent.rb +123 -311
  82. data/lib/stripe/resources/source.rb +1 -1
  83. data/lib/stripe/resources/subscription.rb +132 -37
  84. data/lib/stripe/resources/subscription_item.rb +33 -0
  85. data/lib/stripe/resources/subscription_schedule.rb +120 -5
  86. data/lib/stripe/resources/tax/association.rb +8 -31
  87. data/lib/stripe/resources/tax/calculation.rb +4 -0
  88. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  89. data/lib/stripe/resources/tax/registration.rb +1 -1
  90. data/lib/stripe/resources/tax_id.rb +1 -2
  91. data/lib/stripe/resources/tax_rate.rb +2 -2
  92. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  93. data/lib/stripe/resources/terminal/location.rb +2 -3
  94. data/lib/stripe/resources/terminal/reader.rb +26 -4
  95. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  96. data/lib/stripe/resources/token.rb +2 -2
  97. data/lib/stripe/resources/transfer.rb +1 -1
  98. data/lib/stripe/resources/v2/core/account.rb +5 -5
  99. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -20
  100. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -24
  101. data/lib/stripe/resources/v2/payments/off_session_payment.rb +74 -0
  102. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  103. data/lib/stripe/resources.rb +8 -3
  104. data/lib/stripe/services/account_external_account_service.rb +2 -3
  105. data/lib/stripe/services/account_login_link_service.rb +1 -1
  106. data/lib/stripe/services/account_person_service.rb +1 -2
  107. data/lib/stripe/services/account_service.rb +38 -13
  108. data/lib/stripe/services/account_session_service.rb +49 -24
  109. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  110. data/lib/stripe/services/balance_service.rb +1 -1
  111. data/lib/stripe/services/balance_settings_service.rb +2 -2
  112. data/lib/stripe/services/charge_service.rb +76 -8
  113. data/lib/stripe/services/checkout/session_service.rb +14 -6
  114. data/lib/stripe/services/coupon_service.rb +1 -2
  115. data/lib/stripe/services/credit_note_service.rb +7 -8
  116. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  117. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  118. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  119. data/lib/stripe/services/customer_service.rb +3 -5
  120. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  121. data/lib/stripe/services/dispute_service.rb +1 -1
  122. data/lib/stripe/services/external_account_service.rb +2 -3
  123. data/lib/stripe/services/file_service.rb +1 -1
  124. data/lib/stripe/services/identity/verification_session_service.rb +5 -5
  125. data/lib/stripe/services/invoice_item_service.rb +1 -2
  126. data/lib/stripe/services/invoice_service.rb +65 -35
  127. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  128. data/lib/stripe/services/issuing/card_service.rb +1 -1
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/order_service.rb +1 -33
  131. data/lib/stripe/services/payment_intent_service.rb +385 -386
  132. data/lib/stripe/services/payment_method_configuration_service.rb +212 -2
  133. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  134. data/lib/stripe/services/payment_method_service.rb +47 -110
  135. data/lib/stripe/services/payout_service.rb +2 -2
  136. data/lib/stripe/services/plan_service.rb +2 -3
  137. data/lib/stripe/services/price_service.rb +2 -2
  138. data/lib/stripe/services/privacy/redaction_job_service.rb +22 -13
  139. data/lib/stripe/services/privacy/redaction_job_validation_error_service.rb +1 -1
  140. data/lib/stripe/services/product_feature_service.rb +1 -2
  141. data/lib/stripe/services/product_service.rb +2 -41
  142. data/lib/stripe/services/promotion_code_service.rb +1 -1
  143. data/lib/stripe/services/quote_service.rb +1 -1
  144. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  145. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  146. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  147. data/lib/stripe/services/setup_intent_service.rb +122 -310
  148. data/lib/stripe/services/source_service.rb +1 -1
  149. data/lib/stripe/services/subscription_item_service.rb +26 -0
  150. data/lib/stripe/services/subscription_schedule_service.rb +94 -4
  151. data/lib/stripe/services/subscription_service.rb +103 -33
  152. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  153. data/lib/stripe/services/tax/registration_service.rb +1 -1
  154. data/lib/stripe/services/tax_id_service.rb +1 -2
  155. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  156. data/lib/stripe/services/terminal/location_service.rb +2 -3
  157. data/lib/stripe/services/terminal/reader_service.rb +17 -3
  158. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +37 -97
  159. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  160. data/lib/stripe/services/token_service.rb +1 -1
  161. data/lib/stripe/services/transfer_service.rb +1 -1
  162. data/lib/stripe/services/v1_services.rb +1 -2
  163. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  164. data/lib/stripe/services/v2/core/accounts/person_service.rb +2 -4
  165. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  166. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  167. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +3 -7
  168. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +2 -4
  169. data/lib/stripe/services/v2/money_management/adjustment_service.rb +1 -2
  170. data/lib/stripe/services/v2/money_management/financial_account_service.rb +1 -2
  171. data/lib/stripe/services/v2/money_management/financial_address_service.rb +1 -1
  172. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +1 -2
  173. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +1 -2
  174. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +2 -4
  175. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +2 -4
  176. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +2 -4
  177. data/lib/stripe/services/v2/money_management/payout_method_service.rb +3 -7
  178. data/lib/stripe/services/v2/money_management/received_credit_service.rb +1 -2
  179. data/lib/stripe/services/v2/money_management/received_debit_service.rb +1 -2
  180. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +1 -2
  181. data/lib/stripe/services/v2/money_management/transaction_service.rb +1 -2
  182. data/lib/stripe/services/v2/payment_service.rb +15 -0
  183. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +138 -0
  184. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +1 -2
  185. data/lib/stripe/services/v2_services.rb +2 -1
  186. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  187. data/lib/stripe/services.rb +2 -3
  188. data/lib/stripe/version.rb +1 -1
  189. data/rbi/stripe.rbi +3903 -4131
  190. metadata +13 -8
  191. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  192. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  193. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  194. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  195. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  196. data/lib/stripe/services/gift_cards_service.rb +0 -14
@@ -10,8 +10,7 @@ module Stripe
10
10
  @line_items = Stripe::InvoiceLineItemService.new(@requestor)
11
11
  end
12
12
 
13
- class DeleteParams < Stripe::RequestParams
14
- end
13
+ class DeleteParams < Stripe::RequestParams; end
15
14
 
16
15
  class RetrieveParams < Stripe::RequestParams
17
16
  # Specifies which fields in the response should be expanded.
@@ -234,14 +233,9 @@ module Stripe
234
233
  end
235
234
  end
236
235
 
237
- class IdBankTransfer < Stripe::RequestParams
238
- end
239
-
240
- class Konbini < Stripe::RequestParams
241
- end
242
-
243
- class SepaDebit < Stripe::RequestParams
244
- end
236
+ class IdBankTransfer < Stripe::RequestParams; end
237
+ class Konbini < Stripe::RequestParams; end
238
+ class SepaDebit < Stripe::RequestParams; end
245
239
 
246
240
  class UsBankAccount < Stripe::RequestParams
247
241
  class FinancialConnections < Stripe::RequestParams
@@ -952,14 +946,9 @@ module Stripe
952
946
  end
953
947
  end
954
948
 
955
- class IdBankTransfer < Stripe::RequestParams
956
- end
957
-
958
- class Konbini < Stripe::RequestParams
959
- end
960
-
961
- class SepaDebit < Stripe::RequestParams
962
- end
949
+ class IdBankTransfer < Stripe::RequestParams; end
950
+ class Konbini < Stripe::RequestParams; end
951
+ class SepaDebit < Stripe::RequestParams; end
963
952
 
964
953
  class UsBankAccount < Stripe::RequestParams
965
954
  class FinancialConnections < Stripe::RequestParams
@@ -2990,6 +2979,18 @@ module Stripe
2990
2979
  end
2991
2980
  end
2992
2981
 
2982
+ class BillingThresholds < Stripe::RequestParams
2983
+ # Monetary threshold that triggers the subscription to advance to a new billing period
2984
+ attr_accessor :amount_gte
2985
+ # 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.
2986
+ attr_accessor :reset_billing_cycle_anchor
2987
+
2988
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
2989
+ @amount_gte = amount_gte
2990
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
2991
+ end
2992
+ end
2993
+
2993
2994
  class Discount < Stripe::RequestParams
2994
2995
  class DiscountEnd < Stripe::RequestParams
2995
2996
  class Duration < Stripe::RequestParams
@@ -3060,6 +3061,15 @@ module Stripe
3060
3061
  end
3061
3062
 
3062
3063
  class Item < Stripe::RequestParams
3064
+ class BillingThresholds < Stripe::RequestParams
3065
+ # 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))
3066
+ attr_accessor :usage_gte
3067
+
3068
+ def initialize(usage_gte: nil)
3069
+ @usage_gte = usage_gte
3070
+ end
3071
+ end
3072
+
3063
3073
  class Discount < Stripe::RequestParams
3064
3074
  class DiscountEnd < Stripe::RequestParams
3065
3075
  class Duration < Stripe::RequestParams
@@ -3156,6 +3166,8 @@ module Stripe
3156
3166
  @type = type
3157
3167
  end
3158
3168
  end
3169
+ # 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.
3170
+ attr_accessor :billing_thresholds
3159
3171
  # The coupons to redeem into discounts for the subscription item.
3160
3172
  attr_accessor :discounts
3161
3173
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -3174,6 +3186,7 @@ module Stripe
3174
3186
  attr_accessor :trial
3175
3187
 
3176
3188
  def initialize(
3189
+ billing_thresholds: nil,
3177
3190
  discounts: nil,
3178
3191
  metadata: nil,
3179
3192
  plan: nil,
@@ -3183,6 +3196,7 @@ module Stripe
3183
3196
  tax_rates: nil,
3184
3197
  trial: nil
3185
3198
  )
3199
+ @billing_thresholds = billing_thresholds
3186
3200
  @discounts = discounts
3187
3201
  @metadata = metadata
3188
3202
  @plan = plan
@@ -3239,6 +3253,8 @@ module Stripe
3239
3253
  attr_accessor :automatic_tax
3240
3254
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
3241
3255
  attr_accessor :billing_cycle_anchor
3256
+ # 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.
3257
+ attr_accessor :billing_thresholds
3242
3258
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing 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` on creation.
3243
3259
  attr_accessor :collection_method
3244
3260
  # 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).
@@ -3265,7 +3281,7 @@ module Stripe
3265
3281
  attr_accessor :on_behalf_of
3266
3282
  # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
3267
3283
  attr_accessor :pause_collection
3268
- # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
3284
+ # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
3269
3285
  attr_accessor :proration_behavior
3270
3286
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
3271
3287
  attr_accessor :start_date
@@ -3285,6 +3301,7 @@ module Stripe
3285
3301
  application_fee_percent: nil,
3286
3302
  automatic_tax: nil,
3287
3303
  billing_cycle_anchor: nil,
3304
+ billing_thresholds: nil,
3288
3305
  collection_method: nil,
3289
3306
  currency: nil,
3290
3307
  default_payment_method: nil,
@@ -3310,6 +3327,7 @@ module Stripe
3310
3327
  @application_fee_percent = application_fee_percent
3311
3328
  @automatic_tax = automatic_tax
3312
3329
  @billing_cycle_anchor = billing_cycle_anchor
3330
+ @billing_thresholds = billing_thresholds
3313
3331
  @collection_method = collection_method
3314
3332
  @currency = currency
3315
3333
  @default_payment_method = default_payment_method
@@ -3385,7 +3403,7 @@ module Stripe
3385
3403
  attr_accessor :amendments
3386
3404
  # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
3387
3405
  attr_accessor :billing_behavior
3388
- # Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
3406
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3389
3407
  attr_accessor :billing_mode
3390
3408
  # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
3391
3409
  attr_accessor :end_behavior
@@ -3417,6 +3435,15 @@ module Stripe
3417
3435
 
3418
3436
  class SubscriptionDetails < Stripe::RequestParams
3419
3437
  class Item < Stripe::RequestParams
3438
+ class BillingThresholds < Stripe::RequestParams
3439
+ # 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))
3440
+ attr_accessor :usage_gte
3441
+
3442
+ def initialize(usage_gte: nil)
3443
+ @usage_gte = usage_gte
3444
+ end
3445
+ end
3446
+
3420
3447
  class Discount < Stripe::RequestParams
3421
3448
  class DiscountEnd < Stripe::RequestParams
3422
3449
  class Duration < Stripe::RequestParams
@@ -3501,6 +3528,8 @@ module Stripe
3501
3528
  @unit_amount_decimal = unit_amount_decimal
3502
3529
  end
3503
3530
  end
3531
+ # 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.
3532
+ attr_accessor :billing_thresholds
3504
3533
  # 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.
3505
3534
  attr_accessor :clear_usage
3506
3535
  # A flag that, if set to `true`, will delete the specified item.
@@ -3523,6 +3552,7 @@ module Stripe
3523
3552
  attr_accessor :tax_rates
3524
3553
 
3525
3554
  def initialize(
3555
+ billing_thresholds: nil,
3526
3556
  clear_usage: nil,
3527
3557
  deleted: nil,
3528
3558
  discounts: nil,
@@ -3534,6 +3564,7 @@ module Stripe
3534
3564
  quantity: nil,
3535
3565
  tax_rates: nil
3536
3566
  )
3567
+ @billing_thresholds = billing_thresholds
3537
3568
  @clear_usage = clear_usage
3538
3569
  @deleted = deleted
3539
3570
  @discounts = discounts
@@ -3557,11 +3588,11 @@ module Stripe
3557
3588
  end
3558
3589
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
3559
3590
  attr_accessor :billing_cycle_anchor
3560
- # Configure billing_mode in each subscription to opt in improved credit proration behavior.
3591
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3561
3592
  attr_accessor :billing_mode
3562
3593
  # 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.
3563
3594
  attr_accessor :cancel_at
3564
- # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
3595
+ # 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.
3565
3596
  attr_accessor :cancel_at_period_end
3566
3597
  # This simulates the subscription being canceled or expired immediately.
3567
3598
  attr_accessor :cancel_now
@@ -3691,9 +3722,6 @@ module Stripe
3691
3722
 
3692
3723
  # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
3693
3724
  #
3694
- # For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
3695
- # of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
3696
- #
3697
3725
  # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
3698
3726
  # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3699
3727
  # invoice's status becomes paid.
@@ -3701,7 +3729,7 @@ module Stripe
3701
3729
  # If the PaymentIntent's status is already succeeded when it's attached, it's
3702
3730
  # credited to the invoice immediately.
3703
3731
  #
3704
- # See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
3732
+ # See: [Partial payments](https://docs.stripe.com/docs/invoicing/partial-payments) to learn more.
3705
3733
  def attach_payment(invoice, params = {}, opts = {})
3706
3734
  request(
3707
3735
  method: :post,
@@ -3712,16 +3740,18 @@ module Stripe
3712
3740
  )
3713
3741
  end
3714
3742
 
3715
- # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
3743
+ # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://docs.stripe.com/api#finalize_invoice) the invoice to your customers.
3716
3744
  def create(params = {}, opts = {})
3717
3745
  request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
3718
3746
  end
3719
3747
 
3720
3748
  # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
3721
3749
  #
3722
- # Note that when you are viewing an upcoming invoice, you are simply viewing a preview the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
3750
+ # You can also preview the effects of creating or updating a subscription or subscription schedule, including a preview of any prorations that will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update.
3751
+ #
3752
+ # The recommended way to get only the prorations being previewed on the invoice is to consider line items where parent.subscription_item_details.proration is true.
3723
3753
  #
3724
- # You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request.
3754
+ # Note that when you are viewing an upcoming invoice, you are simply viewing a preview the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
3725
3755
  #
3726
3756
  # Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions)
3727
3757
  def create_preview(params = {}, opts = {})
@@ -3734,7 +3764,7 @@ module Stripe
3734
3764
  )
3735
3765
  end
3736
3766
 
3737
- # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
3767
+ # Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice).
3738
3768
  def delete(invoice, params = {}, opts = {})
3739
3769
  request(
3740
3770
  method: :delete,
@@ -3805,7 +3835,7 @@ module Stripe
3805
3835
  )
3806
3836
  end
3807
3837
 
3808
- # Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
3838
+ # Search for invoices you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
3809
3839
  # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
3810
3840
  # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
3811
3841
  # to an hour behind during outages. Search functionality is not available to merchants in India.
@@ -3832,11 +3862,11 @@ module Stripe
3832
3862
  )
3833
3863
  end
3834
3864
 
3835
- # Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),
3865
+ # Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized),
3836
3866
  # monetary values, as well as collection_method, become uneditable.
3837
3867
  #
3838
3868
  # If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
3839
- # sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass
3869
+ # sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass
3840
3870
  # auto_advance=false.
3841
3871
  def update(invoice, params = {}, opts = {})
3842
3872
  request(
@@ -3859,9 +3889,9 @@ module Stripe
3859
3889
  )
3860
3890
  end
3861
3891
 
3862
- # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
3892
+ # Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
3863
3893
  #
3864
- # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
3894
+ # Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.
3865
3895
  def void_invoice(invoice, params = {}, opts = {})
3866
3896
  request(
3867
3897
  method: :post,
@@ -108,8 +108,8 @@ module Stripe
108
108
  end
109
109
  end
110
110
 
111
- # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
112
- # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
111
+ # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
112
+ # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
113
113
  def approve(authorization, params = {}, opts = {})
114
114
  request(
115
115
  method: :post,
@@ -120,8 +120,8 @@ module Stripe
120
120
  )
121
121
  end
122
122
 
123
- # [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
124
- # This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
123
+ # [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
124
+ # This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
125
125
  def decline(authorization, params = {}, opts = {})
126
126
  request(
127
127
  method: :post,
@@ -219,7 +219,7 @@ module Stripe
219
219
  attr_accessor :currency
220
220
  # Specifies which fields in the response should be expanded.
221
221
  attr_accessor :expand
222
- # Attribute for param field financial_account
222
+ # The new financial account ID the card will be associated with. This field allows a card to be reassigned to a different financial account.
223
223
  attr_accessor :financial_account
224
224
  # 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`.
225
225
  attr_accessor :metadata
@@ -637,7 +637,7 @@ module Stripe
637
637
  end
638
638
  end
639
639
 
640
- # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
640
+ # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
641
641
  def create(params = {}, opts = {})
642
642
  request(
643
643
  method: :post,
@@ -670,7 +670,7 @@ module Stripe
670
670
  )
671
671
  end
672
672
 
673
- # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
673
+ # Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
674
674
  def submit(dispute, params = {}, opts = {})
675
675
  request(
676
676
  method: :post,
@@ -95,18 +95,6 @@ module Stripe
95
95
  end
96
96
  end
97
97
 
98
- class Credit < Stripe::RequestParams
99
- # The gift card to apply to the order.
100
- attr_accessor :gift_card
101
- # The type of credit to apply to the order, only `gift_card` currently supported.
102
- attr_accessor :type
103
-
104
- def initialize(gift_card: nil, type: nil)
105
- @gift_card = gift_card
106
- @type = type
107
- end
108
- end
109
-
110
98
  class Discount < Stripe::RequestParams
111
99
  # ID of the coupon to create a new discount for.
112
100
  attr_accessor :coupon
@@ -1035,8 +1023,6 @@ module Stripe
1035
1023
  attr_accessor :automatic_tax
1036
1024
  # Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided.
1037
1025
  attr_accessor :billing_details
1038
- # The credits to apply to the order, only `gift_card` currently supported.
1039
- attr_accessor :credits
1040
1026
  # 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).
1041
1027
  attr_accessor :currency
1042
1028
  # The customer associated with this order.
@@ -1065,7 +1051,6 @@ module Stripe
1065
1051
  def initialize(
1066
1052
  automatic_tax: nil,
1067
1053
  billing_details: nil,
1068
- credits: nil,
1069
1054
  currency: nil,
1070
1055
  customer: nil,
1071
1056
  description: nil,
@@ -1081,7 +1066,6 @@ module Stripe
1081
1066
  )
1082
1067
  @automatic_tax = automatic_tax
1083
1068
  @billing_details = billing_details
1084
- @credits = credits
1085
1069
  @currency = currency
1086
1070
  @customer = customer
1087
1071
  @description = description
@@ -1164,18 +1148,6 @@ module Stripe
1164
1148
  end
1165
1149
  end
1166
1150
 
1167
- class Credit < Stripe::RequestParams
1168
- # The gift card to apply to the order.
1169
- attr_accessor :gift_card
1170
- # The type of credit to apply to the order, only `gift_card` currently supported.
1171
- attr_accessor :type
1172
-
1173
- def initialize(gift_card: nil, type: nil)
1174
- @gift_card = gift_card
1175
- @type = type
1176
- end
1177
- end
1178
-
1179
1151
  class Discount < Stripe::RequestParams
1180
1152
  # ID of the coupon to create a new discount for.
1181
1153
  attr_accessor :coupon
@@ -2108,8 +2080,6 @@ module Stripe
2108
2080
  attr_accessor :automatic_tax
2109
2081
  # Billing details for the customer. If a customer is provided, this will be automatically populated with values from that customer if override values are not provided.
2110
2082
  attr_accessor :billing_details
2111
- # The credits to apply to the order, only `gift_card` currently supported. Pass the empty string `""` to unset this field.
2112
- attr_accessor :credits
2113
2083
  # 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).
2114
2084
  attr_accessor :currency
2115
2085
  # The customer associated with this order.
@@ -2138,7 +2108,6 @@ module Stripe
2138
2108
  def initialize(
2139
2109
  automatic_tax: nil,
2140
2110
  billing_details: nil,
2141
- credits: nil,
2142
2111
  currency: nil,
2143
2112
  customer: nil,
2144
2113
  description: nil,
@@ -2154,7 +2123,6 @@ module Stripe
2154
2123
  )
2155
2124
  @automatic_tax = automatic_tax
2156
2125
  @billing_details = billing_details
2157
- @credits = credits
2158
2126
  @currency = currency
2159
2127
  @customer = customer
2160
2128
  @description = description
@@ -2243,7 +2211,7 @@ module Stripe
2243
2211
  )
2244
2212
  end
2245
2213
 
2246
- # Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called.
2214
+ # Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called.
2247
2215
  def submit(id, params = {}, opts = {})
2248
2216
  request(
2249
2217
  method: :post,