stripe 15.5.0.pre.beta.2 → 15.6.0.pre.alpha.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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +117 -1
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +6 -4
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +20 -18
  8. data/lib/stripe/api_version.rb +1 -1
  9. data/lib/stripe/errors.rb +26 -23
  10. data/lib/stripe/event_types.rb +83 -0
  11. data/lib/stripe/events/v2_billing_cadence_billed_event.rb +21 -0
  12. data/lib/stripe/events/v2_billing_cadence_canceled_event.rb +21 -0
  13. data/lib/stripe/events/v2_billing_cadence_created_event.rb +23 -0
  14. data/lib/stripe/events/v2_billing_cadence_errored_event.rb +21 -0
  15. data/lib/stripe/events/v2_billing_license_fee_created_event.rb +21 -0
  16. data/lib/stripe/events/v2_billing_license_fee_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_billing_license_fee_version_created_event.rb +23 -0
  18. data/lib/stripe/events/v2_billing_licensed_item_created_event.rb +21 -0
  19. data/lib/stripe/events/v2_billing_licensed_item_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_billing_metered_item_created_event.rb +21 -0
  21. data/lib/stripe/events/v2_billing_metered_item_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_billing_pricing_plan_component_created_event.rb +23 -0
  23. data/lib/stripe/events/v2_billing_pricing_plan_component_updated_event.rb +23 -0
  24. data/lib/stripe/events/v2_billing_pricing_plan_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_awaiting_customer_action_event.rb +21 -0
  26. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_current_event.rb +21 -0
  27. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_past_due_event.rb +21 -0
  28. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_paused_event.rb +21 -0
  29. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_unpaid_event.rb +21 -0
  30. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_activated_event.rb +21 -0
  31. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_canceled_event.rb +21 -0
  32. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_paused_event.rb +21 -0
  33. data/lib/stripe/events/v2_billing_pricing_plan_updated_event.rb +21 -0
  34. data/lib/stripe/events/v2_billing_pricing_plan_version_created_event.rb +23 -0
  35. data/lib/stripe/events/v2_billing_rate_card_created_event.rb +23 -0
  36. data/lib/stripe/events/v2_billing_rate_card_rate_created_event.rb +23 -0
  37. data/lib/stripe/events/v2_billing_rate_card_subscription_activated_event.rb +21 -0
  38. data/lib/stripe/events/v2_billing_rate_card_subscription_canceled_event.rb +21 -0
  39. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_awaiting_customer_action_event.rb +21 -0
  40. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_current_event.rb +21 -0
  41. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_past_due_event.rb +21 -0
  42. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_paused_event.rb +21 -0
  43. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_unpaid_event.rb +21 -0
  44. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_activated_event.rb +21 -0
  45. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_canceled_event.rb +21 -0
  46. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_paused_event.rb +21 -0
  47. data/lib/stripe/events/v2_billing_rate_card_updated_event.rb +21 -0
  48. data/lib/stripe/events/v2_billing_rate_card_version_created_event.rb +23 -0
  49. data/lib/stripe/events/v2_core_health_api_error_firing_event.rb +13 -0
  50. data/lib/stripe/events/v2_core_health_api_error_resolved_event.rb +13 -0
  51. data/lib/stripe/events/v2_core_health_api_latency_firing_event.rb +13 -0
  52. data/lib/stripe/events/v2_core_health_api_latency_resolved_event.rb +13 -0
  53. data/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb +13 -0
  54. data/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb +13 -0
  55. data/lib/stripe/events/v2_core_health_event_generation_failure_resolved_event.rb +13 -0
  56. data/lib/stripe/events/v2_core_health_fraud_rate_increased_event.rb +13 -0
  57. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_firing_event.rb +13 -0
  58. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_resolved_event.rb +13 -0
  59. data/lib/stripe/events/v2_core_health_payment_method_error_firing_event.rb +13 -0
  60. data/lib/stripe/events/v2_core_health_payment_method_error_resolved_event.rb +13 -0
  61. data/lib/stripe/events/v2_core_health_traffic_volume_drop_firing_event.rb +13 -0
  62. data/lib/stripe/events/v2_core_health_traffic_volume_drop_resolved_event.rb +13 -0
  63. data/lib/stripe/events/v2_core_health_webhook_latency_firing_event.rb +13 -0
  64. data/lib/stripe/events/v2_core_health_webhook_latency_resolved_event.rb +13 -0
  65. data/lib/stripe/events/v2_reporting_report_run_created_event.rb +21 -0
  66. data/lib/stripe/events/v2_reporting_report_run_failed_event.rb +21 -0
  67. data/lib/stripe/events/v2_reporting_report_run_succeeded_event.rb +21 -0
  68. data/lib/stripe/events/v2_reporting_report_run_updated_event.rb +21 -0
  69. data/lib/stripe/object_types.rb +27 -0
  70. data/lib/stripe/resources/account.rb +2 -2
  71. data/lib/stripe/resources/account_session.rb +94 -13
  72. data/lib/stripe/resources/balance.rb +2 -7
  73. data/lib/stripe/resources/balance_settings.rb +72 -65
  74. data/lib/stripe/resources/billing/alert.rb +128 -1
  75. data/lib/stripe/resources/billing/alert_triggered.rb +6 -0
  76. data/lib/stripe/resources/billing/credit_balance_summary.rb +50 -0
  77. data/lib/stripe/resources/billing/credit_balance_transaction.rb +50 -0
  78. data/lib/stripe/resources/billing/credit_grant.rb +61 -2
  79. data/lib/stripe/resources/billing/meter.rb +2 -2
  80. data/lib/stripe/resources/billing/meter_usage_row.rb +1 -1
  81. data/lib/stripe/resources/billing_portal/configuration.rb +12 -2
  82. data/lib/stripe/resources/charge.rb +36 -5
  83. data/lib/stripe/resources/checkout/session.rb +237 -6
  84. data/lib/stripe/resources/credit_note.rb +3 -3
  85. data/lib/stripe/resources/dispute.rb +1 -1
  86. data/lib/stripe/resources/file.rb +1 -1
  87. data/lib/stripe/resources/file_link.rb +1 -1
  88. data/lib/stripe/resources/invoice.rb +55 -1
  89. data/lib/stripe/resources/invoice_item.rb +48 -0
  90. data/lib/stripe/resources/invoice_line_item.rb +52 -0
  91. data/lib/stripe/resources/invoice_payment.rb +1 -1
  92. data/lib/stripe/resources/mandate.rb +65 -1
  93. data/lib/stripe/resources/payment_attempt_record.rb +86 -10
  94. data/lib/stripe/resources/payment_intent.rb +182 -4
  95. data/lib/stripe/resources/payment_link.rb +1 -1
  96. data/lib/stripe/resources/payment_method.rb +2 -0
  97. data/lib/stripe/resources/payment_record.rb +107 -14
  98. data/lib/stripe/resources/promotion_code.rb +5 -2
  99. data/lib/stripe/resources/quote_preview_invoice.rb +8 -1
  100. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +24 -0
  101. data/lib/stripe/resources/setup_attempt.rb +4 -1
  102. data/lib/stripe/resources/setup_intent.rb +194 -1
  103. data/lib/stripe/resources/subscription.rb +145 -9
  104. data/lib/stripe/resources/subscription_schedule.rb +124 -2
  105. data/lib/stripe/resources/terminal/configuration.rb +82 -0
  106. data/lib/stripe/resources/terminal/reader.rb +22 -0
  107. data/lib/stripe/resources/v2/billing/bill_setting.rb +62 -0
  108. data/lib/stripe/resources/v2/billing/bill_setting_version.rb +50 -0
  109. data/lib/stripe/resources/v2/billing/cadence.rb +182 -0
  110. data/lib/stripe/resources/v2/billing/collection_setting.rb +148 -0
  111. data/lib/stripe/resources/v2/billing/collection_setting_version.rb +136 -0
  112. data/lib/stripe/resources/v2/billing/custom_pricing_unit.rb +35 -0
  113. data/lib/stripe/resources/v2/billing/intent.rb +59 -0
  114. data/lib/stripe/resources/v2/billing/intent_action.rb +200 -0
  115. data/lib/stripe/resources/v2/billing/license_fee.rb +79 -0
  116. data/lib/stripe/resources/v2/billing/license_fee_subscription.rb +36 -0
  117. data/lib/stripe/resources/v2/billing/license_fee_version.rb +56 -0
  118. data/lib/stripe/resources/v2/billing/licensed_item.rb +44 -0
  119. data/lib/stripe/resources/v2/billing/metered_item.rb +58 -0
  120. data/lib/stripe/resources/v2/billing/pricing_plan.rb +43 -0
  121. data/lib/stripe/resources/v2/billing/pricing_plan_component.rb +58 -0
  122. data/lib/stripe/resources/v2/billing/pricing_plan_subscription.rb +63 -0
  123. data/lib/stripe/resources/v2/billing/pricing_plan_version.rb +30 -0
  124. data/lib/stripe/resources/v2/billing/profile.rb +38 -0
  125. data/lib/stripe/resources/v2/billing/rate_card.rb +53 -0
  126. data/lib/stripe/resources/v2/billing/rate_card_rate.rb +71 -0
  127. data/lib/stripe/resources/v2/billing/rate_card_subscription.rb +63 -0
  128. data/lib/stripe/resources/v2/billing/rate_card_version.rb +26 -0
  129. data/lib/stripe/resources/v2/billing/service_action.rb +117 -0
  130. data/lib/stripe/resources/v2/core/account.rb +8 -0
  131. data/lib/stripe/resources/v2/core/claimable_sandbox.rb +57 -0
  132. data/lib/stripe/resources/v2/event.rb +2 -0
  133. data/lib/stripe/resources/v2/money_management/financial_account.rb +4 -2
  134. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +1 -1
  135. data/lib/stripe/resources/v2/money_management/transaction.rb +2 -0
  136. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +2 -0
  137. data/lib/stripe/resources/v2/reporting/report.rb +64 -0
  138. data/lib/stripe/resources/v2/reporting/report_run.rb +89 -0
  139. data/lib/stripe/resources/v2/tax/automatic_rule.rb +31 -0
  140. data/lib/stripe/resources.rb +85 -0
  141. data/lib/stripe/services/account_session_service.rb +64 -13
  142. data/lib/stripe/services/balance_settings_service.rb +44 -41
  143. data/lib/stripe/services/billing/alert_service.rb +75 -1
  144. data/lib/stripe/services/billing/credit_balance_summary_service.rb +13 -1
  145. data/lib/stripe/services/billing/credit_grant_service.rb +29 -2
  146. data/lib/stripe/services/billing/meter_service.rb +1 -1
  147. data/lib/stripe/services/billing_portal/configuration_service.rb +10 -2
  148. data/lib/stripe/services/checkout/session_service.rb +166 -5
  149. data/lib/stripe/services/credit_note_preview_lines_service.rb +1 -1
  150. data/lib/stripe/services/credit_note_service.rb +2 -2
  151. data/lib/stripe/services/customer_service.rb +4 -4
  152. data/lib/stripe/services/file_link_service.rb +1 -1
  153. data/lib/stripe/services/file_service.rb +1 -1
  154. data/lib/stripe/services/invoice_payment_service.rb +1 -1
  155. data/lib/stripe/services/invoice_service.rb +47 -0
  156. data/lib/stripe/services/mandate_service.rb +40 -0
  157. data/lib/stripe/services/payment_attempt_record_service.rb +4 -1
  158. data/lib/stripe/services/payment_intent_service.rb +157 -3
  159. data/lib/stripe/services/payment_link_service.rb +1 -1
  160. data/lib/stripe/services/payment_record_service.rb +25 -5
  161. data/lib/stripe/services/quote_service.rb +4 -4
  162. data/lib/stripe/services/setup_intent_service.rb +153 -0
  163. data/lib/stripe/services/subscription_schedule_service.rb +100 -2
  164. data/lib/stripe/services/subscription_service.rb +134 -9
  165. data/lib/stripe/services/terminal/configuration_service.rb +64 -0
  166. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +22 -0
  167. data/lib/stripe/services/v1_services.rb +5 -5
  168. data/lib/stripe/services/v2/billing/bill_setting_service.rb +214 -0
  169. data/lib/stripe/services/v2/billing/bill_settings/version_service.rb +45 -0
  170. data/lib/stripe/services/v2/billing/cadence_service.rb +428 -0
  171. data/lib/stripe/services/v2/billing/collection_setting_service.rb +518 -0
  172. data/lib/stripe/services/v2/billing/collection_settings/version_service.rb +45 -0
  173. data/lib/stripe/services/v2/billing/custom_pricing_unit_service.rb +108 -0
  174. data/lib/stripe/services/v2/billing/intent_service.rb +465 -0
  175. data/lib/stripe/services/v2/billing/intents/action_service.rb +45 -0
  176. data/lib/stripe/services/v2/billing/license_fee_service.rb +250 -0
  177. data/lib/stripe/services/v2/billing/license_fee_subscription_service.rb +23 -0
  178. data/lib/stripe/services/v2/billing/license_fees/version_service.rb +45 -0
  179. data/lib/stripe/services/v2/billing/licensed_item_service.rb +149 -0
  180. data/lib/stripe/services/v2/billing/metered_item_service.rb +176 -0
  181. data/lib/stripe/services/v2/billing/pricing_plan_service.rb +142 -0
  182. data/lib/stripe/services/v2/billing/pricing_plan_subscription_service.rb +76 -0
  183. data/lib/stripe/services/v2/billing/pricing_plans/component_service.rb +162 -0
  184. data/lib/stripe/services/v2/billing/pricing_plans/version_service.rb +45 -0
  185. data/lib/stripe/services/v2/billing/profile_service.rb +144 -0
  186. data/lib/stripe/services/v2/billing/rate_card_service.rb +151 -0
  187. data/lib/stripe/services/v2/billing/rate_card_subscription_service.rb +144 -0
  188. data/lib/stripe/services/v2/billing/rate_cards/rate_service.rb +161 -0
  189. data/lib/stripe/services/v2/billing/rate_cards/version_service.rb +45 -0
  190. data/lib/stripe/services/v2/billing/service_action_service.rb +259 -0
  191. data/lib/stripe/services/v2/billing_service.rb +19 -2
  192. data/lib/stripe/services/v2/core/account_service.rb +16 -2
  193. data/lib/stripe/services/v2/core/claimable_sandbox_service.rb +50 -0
  194. data/lib/stripe/services/v2/core_service.rb +4 -3
  195. data/lib/stripe/services/v2/money_management/financial_account_service.rb +4 -1
  196. data/lib/stripe/services/v2/money_management_service.rb +3 -3
  197. data/lib/stripe/services/v2/reporting/report_run_service.rb +88 -0
  198. data/lib/stripe/services/v2/reporting/report_service.rb +25 -0
  199. data/lib/stripe/services/v2/reporting_service.rb +16 -0
  200. data/lib/stripe/services/v2/tax/automatic_rule_service.rb +99 -0
  201. data/lib/stripe/services/v2/tax_service.rb +15 -0
  202. data/lib/stripe/services/v2_services.rb +3 -1
  203. data/lib/stripe/services.rb +29 -0
  204. data/lib/stripe/stripe_service.rb +3 -1
  205. data/lib/stripe/version.rb +1 -1
  206. metadata +116 -3
  207. data/rbi/stripe.rbi +0 -199145
@@ -169,6 +169,7 @@ module Stripe
169
169
  class NzBankAccount < Stripe::StripeObject; end
170
170
  class Paypal < Stripe::StripeObject; end
171
171
  class Payto < Stripe::StripeObject; end
172
+ class Pix < Stripe::StripeObject; end
172
173
  class RevolutPay < Stripe::StripeObject; end
173
174
  class SepaDebit < Stripe::StripeObject; end
174
175
 
@@ -233,6 +234,8 @@ module Stripe
233
234
  attr_reader :paypal
234
235
  # Attribute for field payto
235
236
  attr_reader :payto
237
+ # Attribute for field pix
238
+ attr_reader :pix
236
239
  # Attribute for field revolut_pay
237
240
  attr_reader :revolut_pay
238
241
  # Attribute for field sepa_debit
@@ -262,7 +265,7 @@ module Stripe
262
265
  attr_reader :message
263
266
  # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
264
267
  attr_reader :network_advice_code
265
- # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
268
+ # For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
266
269
  attr_reader :network_decline_code
267
270
  # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
268
271
  attr_reader :param
@@ -57,7 +57,7 @@ module Stripe
57
57
  attr_reader :message
58
58
  # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
59
59
  attr_reader :network_advice_code
60
- # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed.
60
+ # For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
61
61
  attr_reader :network_decline_code
62
62
  # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
63
63
  attr_reader :param
@@ -129,6 +129,19 @@ module Stripe
129
129
  attr_reader :qr_code
130
130
  end
131
131
 
132
+ class PixDisplayQrCode < Stripe::StripeObject
133
+ # The raw data string used to generate QR code, it should be used together with QR code library.
134
+ attr_reader :data
135
+ # The date (unix timestamp) when the PIX expires.
136
+ attr_reader :expires_at
137
+ # The URL to the hosted pix instructions page, which allows customers to view the pix QR code.
138
+ attr_reader :hosted_instructions_url
139
+ # The image_url_png string used to render png QR code
140
+ attr_reader :image_url_png
141
+ # The image_url_svg string used to render svg QR code
142
+ attr_reader :image_url_svg
143
+ end
144
+
132
145
  class RedirectToUrl < Stripe::StripeObject
133
146
  # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.
134
147
  attr_reader :return_url
@@ -146,6 +159,8 @@ module Stripe
146
159
  end
147
160
  # Attribute for field cashapp_handle_redirect_or_display_qr_code
148
161
  attr_reader :cashapp_handle_redirect_or_display_qr_code
162
+ # Attribute for field pix_display_qr_code
163
+ attr_reader :pix_display_qr_code
149
164
  # Attribute for field redirect_to_url
150
165
  attr_reader :redirect_to_url
151
166
  # Type of the next action to perform. Refer to the other child attributes under `next_action` for available values. Examples include: `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
@@ -271,6 +286,29 @@ module Stripe
271
286
  attr_reader :mandate_options
272
287
  end
273
288
 
289
+ class Pix < Stripe::StripeObject
290
+ class MandateOptions < Stripe::StripeObject
291
+ # Amount to be charged for future payments.
292
+ attr_reader :amount
293
+ # Determines if the amount includes the IOF tax.
294
+ attr_reader :amount_includes_iof
295
+ # Type of amount.
296
+ attr_reader :amount_type
297
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
298
+ attr_reader :currency
299
+ # Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`.
300
+ attr_reader :end_date
301
+ # Schedule at which the future payments will be charged.
302
+ attr_reader :payment_schedule
303
+ # Subscription name displayed to buyers in their bank app.
304
+ attr_reader :reference
305
+ # Start date of the mandate, in `YYYY-MM-DD`.
306
+ attr_reader :start_date
307
+ end
308
+ # Attribute for field mandate_options
309
+ attr_reader :mandate_options
310
+ end
311
+
274
312
  class SepaDebit < Stripe::StripeObject
275
313
  class MandateOptions < Stripe::StripeObject
276
314
  # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'.
@@ -334,6 +372,8 @@ module Stripe
334
372
  attr_reader :paypal
335
373
  # Attribute for field payto
336
374
  attr_reader :payto
375
+ # Attribute for field pix
376
+ attr_reader :pix
337
377
  # Attribute for field sepa_debit
338
378
  attr_reader :sepa_debit
339
379
  # Attribute for field us_bank_account
@@ -1433,6 +1473,53 @@ module Stripe
1433
1473
  end
1434
1474
  end
1435
1475
 
1476
+ class Pix < Stripe::RequestParams
1477
+ class MandateOptions < Stripe::RequestParams
1478
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
1479
+ attr_accessor :amount
1480
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
1481
+ attr_accessor :amount_includes_iof
1482
+ # Type of amount. Defaults to `maximum`.
1483
+ attr_accessor :amount_type
1484
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
1485
+ attr_accessor :currency
1486
+ # Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1487
+ attr_accessor :end_date
1488
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
1489
+ attr_accessor :payment_schedule
1490
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
1491
+ attr_accessor :reference
1492
+ # Start date of the mandate, in `YYYY-MM-DD`. Start date should be at least 3 days in the future. Defaults to 3 days after the current date.
1493
+ attr_accessor :start_date
1494
+
1495
+ def initialize(
1496
+ amount: nil,
1497
+ amount_includes_iof: nil,
1498
+ amount_type: nil,
1499
+ currency: nil,
1500
+ end_date: nil,
1501
+ payment_schedule: nil,
1502
+ reference: nil,
1503
+ start_date: nil
1504
+ )
1505
+ @amount = amount
1506
+ @amount_includes_iof = amount_includes_iof
1507
+ @amount_type = amount_type
1508
+ @currency = currency
1509
+ @end_date = end_date
1510
+ @payment_schedule = payment_schedule
1511
+ @reference = reference
1512
+ @start_date = start_date
1513
+ end
1514
+ end
1515
+ # Additional fields for mandate creation.
1516
+ attr_accessor :mandate_options
1517
+
1518
+ def initialize(mandate_options: nil)
1519
+ @mandate_options = mandate_options
1520
+ end
1521
+ end
1522
+
1436
1523
  class SepaDebit < Stripe::RequestParams
1437
1524
  class MandateOptions < Stripe::RequestParams
1438
1525
  # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'.
@@ -1554,6 +1641,8 @@ module Stripe
1554
1641
  attr_accessor :paypal
1555
1642
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
1556
1643
  attr_accessor :payto
1644
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
1645
+ attr_accessor :pix
1557
1646
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
1558
1647
  attr_accessor :sepa_debit
1559
1648
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -1569,6 +1658,7 @@ module Stripe
1569
1658
  link: nil,
1570
1659
  paypal: nil,
1571
1660
  payto: nil,
1661
+ pix: nil,
1572
1662
  sepa_debit: nil,
1573
1663
  us_bank_account: nil
1574
1664
  )
@@ -1581,6 +1671,7 @@ module Stripe
1581
1671
  @link = link
1582
1672
  @paypal = paypal
1583
1673
  @payto = payto
1674
+ @pix = pix
1584
1675
  @sepa_debit = sepa_debit
1585
1676
  @us_bank_account = us_bank_account
1586
1677
  end
@@ -2678,6 +2769,53 @@ module Stripe
2678
2769
  end
2679
2770
  end
2680
2771
 
2772
+ class Pix < Stripe::RequestParams
2773
+ class MandateOptions < Stripe::RequestParams
2774
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
2775
+ attr_accessor :amount
2776
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
2777
+ attr_accessor :amount_includes_iof
2778
+ # Type of amount. Defaults to `maximum`.
2779
+ attr_accessor :amount_type
2780
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
2781
+ attr_accessor :currency
2782
+ # Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
2783
+ attr_accessor :end_date
2784
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
2785
+ attr_accessor :payment_schedule
2786
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
2787
+ attr_accessor :reference
2788
+ # Start date of the mandate, in `YYYY-MM-DD`. Start date should be at least 3 days in the future. Defaults to 3 days after the current date.
2789
+ attr_accessor :start_date
2790
+
2791
+ def initialize(
2792
+ amount: nil,
2793
+ amount_includes_iof: nil,
2794
+ amount_type: nil,
2795
+ currency: nil,
2796
+ end_date: nil,
2797
+ payment_schedule: nil,
2798
+ reference: nil,
2799
+ start_date: nil
2800
+ )
2801
+ @amount = amount
2802
+ @amount_includes_iof = amount_includes_iof
2803
+ @amount_type = amount_type
2804
+ @currency = currency
2805
+ @end_date = end_date
2806
+ @payment_schedule = payment_schedule
2807
+ @reference = reference
2808
+ @start_date = start_date
2809
+ end
2810
+ end
2811
+ # Additional fields for mandate creation.
2812
+ attr_accessor :mandate_options
2813
+
2814
+ def initialize(mandate_options: nil)
2815
+ @mandate_options = mandate_options
2816
+ end
2817
+ end
2818
+
2681
2819
  class SepaDebit < Stripe::RequestParams
2682
2820
  class MandateOptions < Stripe::RequestParams
2683
2821
  # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'.
@@ -2799,6 +2937,8 @@ module Stripe
2799
2937
  attr_accessor :paypal
2800
2938
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
2801
2939
  attr_accessor :payto
2940
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
2941
+ attr_accessor :pix
2802
2942
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
2803
2943
  attr_accessor :sepa_debit
2804
2944
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -2814,6 +2954,7 @@ module Stripe
2814
2954
  link: nil,
2815
2955
  paypal: nil,
2816
2956
  payto: nil,
2957
+ pix: nil,
2817
2958
  sepa_debit: nil,
2818
2959
  us_bank_account: nil
2819
2960
  )
@@ -2826,6 +2967,7 @@ module Stripe
2826
2967
  @link = link
2827
2968
  @paypal = paypal
2828
2969
  @payto = payto
2970
+ @pix = pix
2829
2971
  @sepa_debit = sepa_debit
2830
2972
  @us_bank_account = us_bank_account
2831
2973
  end
@@ -3922,6 +4064,53 @@ module Stripe
3922
4064
  end
3923
4065
  end
3924
4066
 
4067
+ class Pix < Stripe::RequestParams
4068
+ class MandateOptions < Stripe::RequestParams
4069
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
4070
+ attr_accessor :amount
4071
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
4072
+ attr_accessor :amount_includes_iof
4073
+ # Type of amount. Defaults to `maximum`.
4074
+ attr_accessor :amount_type
4075
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
4076
+ attr_accessor :currency
4077
+ # Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
4078
+ attr_accessor :end_date
4079
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
4080
+ attr_accessor :payment_schedule
4081
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
4082
+ attr_accessor :reference
4083
+ # Start date of the mandate, in `YYYY-MM-DD`. Start date should be at least 3 days in the future. Defaults to 3 days after the current date.
4084
+ attr_accessor :start_date
4085
+
4086
+ def initialize(
4087
+ amount: nil,
4088
+ amount_includes_iof: nil,
4089
+ amount_type: nil,
4090
+ currency: nil,
4091
+ end_date: nil,
4092
+ payment_schedule: nil,
4093
+ reference: nil,
4094
+ start_date: nil
4095
+ )
4096
+ @amount = amount
4097
+ @amount_includes_iof = amount_includes_iof
4098
+ @amount_type = amount_type
4099
+ @currency = currency
4100
+ @end_date = end_date
4101
+ @payment_schedule = payment_schedule
4102
+ @reference = reference
4103
+ @start_date = start_date
4104
+ end
4105
+ end
4106
+ # Additional fields for mandate creation.
4107
+ attr_accessor :mandate_options
4108
+
4109
+ def initialize(mandate_options: nil)
4110
+ @mandate_options = mandate_options
4111
+ end
4112
+ end
4113
+
3925
4114
  class SepaDebit < Stripe::RequestParams
3926
4115
  class MandateOptions < Stripe::RequestParams
3927
4116
  # Prefix used to generate the Mandate reference. Must be at most 12 characters long. Must consist of only uppercase letters, numbers, spaces, or the following special characters: '/', '_', '-', '&', '.'. Cannot begin with 'STRIPE'.
@@ -4043,6 +4232,8 @@ module Stripe
4043
4232
  attr_accessor :paypal
4044
4233
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
4045
4234
  attr_accessor :payto
4235
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
4236
+ attr_accessor :pix
4046
4237
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
4047
4238
  attr_accessor :sepa_debit
4048
4239
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -4058,6 +4249,7 @@ module Stripe
4058
4249
  link: nil,
4059
4250
  paypal: nil,
4060
4251
  payto: nil,
4252
+ pix: nil,
4061
4253
  sepa_debit: nil,
4062
4254
  us_bank_account: nil
4063
4255
  )
@@ -4070,6 +4262,7 @@ module Stripe
4070
4262
  @link = link
4071
4263
  @paypal = paypal
4072
4264
  @payto = payto
4265
+ @pix = pix
4073
4266
  @sepa_debit = sepa_debit
4074
4267
  @us_bank_account = us_bank_account
4075
4268
  end
@@ -343,6 +343,41 @@ module Stripe
343
343
  end
344
344
  end
345
345
 
346
+ class Period < Stripe::RequestParams
347
+ class End < Stripe::RequestParams
348
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
349
+ attr_accessor :timestamp
350
+ # Select how to calculate the end of the invoice item period.
351
+ attr_accessor :type
352
+
353
+ def initialize(timestamp: nil, type: nil)
354
+ @timestamp = timestamp
355
+ @type = type
356
+ end
357
+ end
358
+
359
+ class Start < Stripe::RequestParams
360
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
361
+ attr_accessor :timestamp
362
+ # Select how to calculate the start of the invoice item period.
363
+ attr_accessor :type
364
+
365
+ def initialize(timestamp: nil, type: nil)
366
+ @timestamp = timestamp
367
+ @type = type
368
+ end
369
+ end
370
+ # End of the invoice item period.
371
+ attr_accessor :end
372
+ # Start of the invoice item period.
373
+ attr_accessor :start
374
+
375
+ def initialize(end_: nil, start: nil)
376
+ @end = end_
377
+ @start = start
378
+ end
379
+ end
380
+
346
381
  class PriceData < Stripe::RequestParams
347
382
  # 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).
348
383
  attr_accessor :currency
@@ -371,6 +406,10 @@ module Stripe
371
406
  end
372
407
  # The coupons to redeem into discounts for the item.
373
408
  attr_accessor :discounts
409
+ # 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`.
410
+ attr_accessor :metadata
411
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
412
+ attr_accessor :period
374
413
  # The ID of the price object. One of `price` or `price_data` is required.
375
414
  attr_accessor :price
376
415
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -380,8 +419,18 @@ module Stripe
380
419
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
381
420
  attr_accessor :tax_rates
382
421
 
383
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
422
+ def initialize(
423
+ discounts: nil,
424
+ metadata: nil,
425
+ period: nil,
426
+ price: nil,
427
+ price_data: nil,
428
+ quantity: nil,
429
+ tax_rates: nil
430
+ )
384
431
  @discounts = discounts
432
+ @metadata = metadata
433
+ @period = period
385
434
  @price = price
386
435
  @price_data = price_data
387
436
  @quantity = quantity
@@ -1137,9 +1186,9 @@ module Stripe
1137
1186
  attr_accessor :collection_method
1138
1187
  # Only return subscriptions that were created during the given date interval.
1139
1188
  attr_accessor :created
1140
- # Only return subscriptions whose current_period_end falls within the given date interval.
1189
+ # Only return subscriptions whose minimum item current_period_end falls within the given date interval.
1141
1190
  attr_accessor :current_period_end
1142
- # Only return subscriptions whose current_period_start falls within the given date interval.
1191
+ # Only return subscriptions whose maximum item current_period_start falls within the given date interval.
1143
1192
  attr_accessor :current_period_start
1144
1193
  # The ID of the customer whose subscriptions will be retrieved.
1145
1194
  attr_accessor :customer
@@ -1242,6 +1291,41 @@ module Stripe
1242
1291
  end
1243
1292
  end
1244
1293
 
1294
+ class Period < Stripe::RequestParams
1295
+ class End < Stripe::RequestParams
1296
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
1297
+ attr_accessor :timestamp
1298
+ # Select how to calculate the end of the invoice item period.
1299
+ attr_accessor :type
1300
+
1301
+ def initialize(timestamp: nil, type: nil)
1302
+ @timestamp = timestamp
1303
+ @type = type
1304
+ end
1305
+ end
1306
+
1307
+ class Start < Stripe::RequestParams
1308
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
1309
+ attr_accessor :timestamp
1310
+ # Select how to calculate the start of the invoice item period.
1311
+ attr_accessor :type
1312
+
1313
+ def initialize(timestamp: nil, type: nil)
1314
+ @timestamp = timestamp
1315
+ @type = type
1316
+ end
1317
+ end
1318
+ # End of the invoice item period.
1319
+ attr_accessor :end
1320
+ # Start of the invoice item period.
1321
+ attr_accessor :start
1322
+
1323
+ def initialize(end_: nil, start: nil)
1324
+ @end = end_
1325
+ @start = start
1326
+ end
1327
+ end
1328
+
1245
1329
  class PriceData < Stripe::RequestParams
1246
1330
  # 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).
1247
1331
  attr_accessor :currency
@@ -1270,6 +1354,10 @@ module Stripe
1270
1354
  end
1271
1355
  # The coupons to redeem into discounts for the item.
1272
1356
  attr_accessor :discounts
1357
+ # 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`.
1358
+ attr_accessor :metadata
1359
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
1360
+ attr_accessor :period
1273
1361
  # The ID of the price object. One of `price` or `price_data` is required.
1274
1362
  attr_accessor :price
1275
1363
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -1279,8 +1367,18 @@ module Stripe
1279
1367
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1280
1368
  attr_accessor :tax_rates
1281
1369
 
1282
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
1370
+ def initialize(
1371
+ discounts: nil,
1372
+ metadata: nil,
1373
+ period: nil,
1374
+ price: nil,
1375
+ price_data: nil,
1376
+ quantity: nil,
1377
+ tax_rates: nil
1378
+ )
1283
1379
  @discounts = discounts
1380
+ @metadata = metadata
1381
+ @period = period
1284
1382
  @price = price
1285
1383
  @price_data = price_data
1286
1384
  @quantity = quantity
@@ -1312,15 +1410,15 @@ module Stripe
1312
1410
  end
1313
1411
 
1314
1412
  class BillingCycleAnchorConfig < Stripe::RequestParams
1315
- # The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31.
1413
+ # The day of the month the anchor should be. Ranges from 1 to 31.
1316
1414
  attr_accessor :day_of_month
1317
- # The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23.
1415
+ # The hour of the day the anchor should be. Ranges from 0 to 23.
1318
1416
  attr_accessor :hour
1319
- # The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59.
1417
+ # The minute of the hour the anchor should be. Ranges from 0 to 59.
1320
1418
  attr_accessor :minute
1321
- # The month to start full cycle billing periods. Ranges from 1 to 12.
1419
+ # The month to start full cycle periods. Ranges from 1 to 12.
1322
1420
  attr_accessor :month
1323
- # The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59.
1421
+ # The second of the minute the anchor should be. Ranges from 0 to 59.
1324
1422
  attr_accessor :second
1325
1423
 
1326
1424
  def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil)
@@ -1843,6 +1941,8 @@ module Stripe
1843
1941
  attr_accessor :automatic_tax
1844
1942
  # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
1845
1943
  attr_accessor :backdate_start_date
1944
+ # The Billing Cadence which controls the timing of recurring invoice generation for this subscription. If unset, the subscription will bill according to its own configured schedule and create its own invoices. If set, this subscription will be billed by the cadence instead, potentially sharing invoices with the other subscriptions linked to that Cadence.
1945
+ attr_accessor :billing_cadence
1846
1946
  # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
1847
1947
  attr_accessor :billing_cycle_anchor
1848
1948
  # Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC.
@@ -1923,6 +2023,7 @@ module Stripe
1923
2023
  application_fee_percent: nil,
1924
2024
  automatic_tax: nil,
1925
2025
  backdate_start_date: nil,
2026
+ billing_cadence: nil,
1926
2027
  billing_cycle_anchor: nil,
1927
2028
  billing_cycle_anchor_config: nil,
1928
2029
  billing_mode: nil,
@@ -1960,6 +2061,7 @@ module Stripe
1960
2061
  @application_fee_percent = application_fee_percent
1961
2062
  @automatic_tax = automatic_tax
1962
2063
  @backdate_start_date = backdate_start_date
2064
+ @billing_cadence = billing_cadence
1963
2065
  @billing_cycle_anchor = billing_cycle_anchor
1964
2066
  @billing_cycle_anchor_config = billing_cycle_anchor_config
1965
2067
  @billing_mode = billing_mode
@@ -2013,6 +2115,18 @@ module Stripe
2013
2115
  end
2014
2116
  end
2015
2117
 
2118
+ class AttachCadenceParams < Stripe::RequestParams
2119
+ # The Billing Cadence which controls the timing of recurring invoice generation for this subscription. If unset, the subscription will bill according to its own configured schedule and create its own invoices. If set, this subscription will be billed by the cadence instead, potentially sharing invoices with the other subscriptions linked to that Cadence.
2120
+ attr_accessor :billing_cadence
2121
+ # Specifies which fields in the response should be expanded.
2122
+ attr_accessor :expand
2123
+
2124
+ def initialize(billing_cadence: nil, expand: nil)
2125
+ @billing_cadence = billing_cadence
2126
+ @expand = expand
2127
+ end
2128
+ end
2129
+
2016
2130
  class MigrateParams < Stripe::RequestParams
2017
2131
  class BillingMode < Stripe::RequestParams
2018
2132
  # Attribute for param field type
@@ -2061,6 +2175,8 @@ module Stripe
2061
2175
  attr_reader :application_fee_percent
2062
2176
  # Attribute for field automatic_tax
2063
2177
  attr_reader :automatic_tax
2178
+ # The Billing Cadence which controls the timing of recurring invoice generation for this subscription.If unset, the subscription will bill according to its own configured schedule and create its own invoices.If set, this subscription will be billed by the cadence instead, potentially sharing invoices with the other subscriptions linked to that Cadence.
2179
+ attr_reader :billing_cadence
2064
2180
  # The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format.
2065
2181
  attr_reader :billing_cycle_anchor
2066
2182
  # The fixed values used to calculate the `billing_cycle_anchor`.
@@ -2160,6 +2276,26 @@ module Stripe
2160
2276
  # If the subscription has a trial, the beginning of that trial.
2161
2277
  attr_reader :trial_start
2162
2278
 
2279
+ # Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the Billing Cadence.
2280
+ def attach_cadence(params = {}, opts = {})
2281
+ request_stripe_object(
2282
+ method: :post,
2283
+ path: format("/v1/subscriptions/%<subscription>s/attach_cadence", { subscription: CGI.escape(self["id"]) }),
2284
+ params: params,
2285
+ opts: opts
2286
+ )
2287
+ end
2288
+
2289
+ # Attach a Billing Cadence to an existing subscription. When attached, the subscription is billed by the Billing Cadence, potentially sharing invoices with the other subscriptions linked to the Billing Cadence.
2290
+ def self.attach_cadence(subscription, params = {}, opts = {})
2291
+ request_stripe_object(
2292
+ method: :post,
2293
+ path: format("/v1/subscriptions/%<subscription>s/attach_cadence", { subscription: CGI.escape(subscription) }),
2294
+ params: params,
2295
+ opts: opts
2296
+ )
2297
+ end
2298
+
2163
2299
  # 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).
2164
2300
  #
2165
2301
  # 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.