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
@@ -1096,6 +1096,53 @@ module Stripe
1096
1096
  end
1097
1097
  end
1098
1098
 
1099
+ class Pix < Stripe::RequestParams
1100
+ class MandateOptions < Stripe::RequestParams
1101
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
1102
+ attr_accessor :amount
1103
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
1104
+ attr_accessor :amount_includes_iof
1105
+ # Type of amount. Defaults to `maximum`.
1106
+ attr_accessor :amount_type
1107
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
1108
+ attr_accessor :currency
1109
+ # 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.
1110
+ attr_accessor :end_date
1111
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
1112
+ attr_accessor :payment_schedule
1113
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
1114
+ attr_accessor :reference
1115
+ # 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.
1116
+ attr_accessor :start_date
1117
+
1118
+ def initialize(
1119
+ amount: nil,
1120
+ amount_includes_iof: nil,
1121
+ amount_type: nil,
1122
+ currency: nil,
1123
+ end_date: nil,
1124
+ payment_schedule: nil,
1125
+ reference: nil,
1126
+ start_date: nil
1127
+ )
1128
+ @amount = amount
1129
+ @amount_includes_iof = amount_includes_iof
1130
+ @amount_type = amount_type
1131
+ @currency = currency
1132
+ @end_date = end_date
1133
+ @payment_schedule = payment_schedule
1134
+ @reference = reference
1135
+ @start_date = start_date
1136
+ end
1137
+ end
1138
+ # Additional fields for mandate creation.
1139
+ attr_accessor :mandate_options
1140
+
1141
+ def initialize(mandate_options: nil)
1142
+ @mandate_options = mandate_options
1143
+ end
1144
+ end
1145
+
1099
1146
  class SepaDebit < Stripe::RequestParams
1100
1147
  class MandateOptions < Stripe::RequestParams
1101
1148
  # 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'.
@@ -1217,6 +1264,8 @@ module Stripe
1217
1264
  attr_accessor :paypal
1218
1265
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
1219
1266
  attr_accessor :payto
1267
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
1268
+ attr_accessor :pix
1220
1269
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
1221
1270
  attr_accessor :sepa_debit
1222
1271
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -1232,6 +1281,7 @@ module Stripe
1232
1281
  link: nil,
1233
1282
  paypal: nil,
1234
1283
  payto: nil,
1284
+ pix: nil,
1235
1285
  sepa_debit: nil,
1236
1286
  us_bank_account: nil
1237
1287
  )
@@ -1244,6 +1294,7 @@ module Stripe
1244
1294
  @link = link
1245
1295
  @paypal = paypal
1246
1296
  @payto = payto
1297
+ @pix = pix
1247
1298
  @sepa_debit = sepa_debit
1248
1299
  @us_bank_account = us_bank_account
1249
1300
  end
@@ -2353,6 +2404,53 @@ module Stripe
2353
2404
  end
2354
2405
  end
2355
2406
 
2407
+ class Pix < Stripe::RequestParams
2408
+ class MandateOptions < Stripe::RequestParams
2409
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
2410
+ attr_accessor :amount
2411
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
2412
+ attr_accessor :amount_includes_iof
2413
+ # Type of amount. Defaults to `maximum`.
2414
+ attr_accessor :amount_type
2415
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
2416
+ attr_accessor :currency
2417
+ # 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.
2418
+ attr_accessor :end_date
2419
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
2420
+ attr_accessor :payment_schedule
2421
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
2422
+ attr_accessor :reference
2423
+ # 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.
2424
+ attr_accessor :start_date
2425
+
2426
+ def initialize(
2427
+ amount: nil,
2428
+ amount_includes_iof: nil,
2429
+ amount_type: nil,
2430
+ currency: nil,
2431
+ end_date: nil,
2432
+ payment_schedule: nil,
2433
+ reference: nil,
2434
+ start_date: nil
2435
+ )
2436
+ @amount = amount
2437
+ @amount_includes_iof = amount_includes_iof
2438
+ @amount_type = amount_type
2439
+ @currency = currency
2440
+ @end_date = end_date
2441
+ @payment_schedule = payment_schedule
2442
+ @reference = reference
2443
+ @start_date = start_date
2444
+ end
2445
+ end
2446
+ # Additional fields for mandate creation.
2447
+ attr_accessor :mandate_options
2448
+
2449
+ def initialize(mandate_options: nil)
2450
+ @mandate_options = mandate_options
2451
+ end
2452
+ end
2453
+
2356
2454
  class SepaDebit < Stripe::RequestParams
2357
2455
  class MandateOptions < Stripe::RequestParams
2358
2456
  # 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'.
@@ -2474,6 +2572,8 @@ module Stripe
2474
2572
  attr_accessor :paypal
2475
2573
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
2476
2574
  attr_accessor :payto
2575
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
2576
+ attr_accessor :pix
2477
2577
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
2478
2578
  attr_accessor :sepa_debit
2479
2579
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -2489,6 +2589,7 @@ module Stripe
2489
2589
  link: nil,
2490
2590
  paypal: nil,
2491
2591
  payto: nil,
2592
+ pix: nil,
2492
2593
  sepa_debit: nil,
2493
2594
  us_bank_account: nil
2494
2595
  )
@@ -2501,6 +2602,7 @@ module Stripe
2501
2602
  @link = link
2502
2603
  @paypal = paypal
2503
2604
  @payto = payto
2605
+ @pix = pix
2504
2606
  @sepa_debit = sepa_debit
2505
2607
  @us_bank_account = us_bank_account
2506
2608
  end
@@ -3597,6 +3699,53 @@ module Stripe
3597
3699
  end
3598
3700
  end
3599
3701
 
3702
+ class Pix < Stripe::RequestParams
3703
+ class MandateOptions < Stripe::RequestParams
3704
+ # Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000.
3705
+ attr_accessor :amount
3706
+ # Determines if the amount includes the IOF tax. Defaults to `never`.
3707
+ attr_accessor :amount_includes_iof
3708
+ # Type of amount. Defaults to `maximum`.
3709
+ attr_accessor :amount_type
3710
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Only `brl` is supported currently.
3711
+ attr_accessor :currency
3712
+ # 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.
3713
+ attr_accessor :end_date
3714
+ # Schedule at which the future payments will be charged. Defaults to `weekly`.
3715
+ attr_accessor :payment_schedule
3716
+ # Subscription name displayed to buyers in their bank app. Defaults to the displayable business name.
3717
+ attr_accessor :reference
3718
+ # 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.
3719
+ attr_accessor :start_date
3720
+
3721
+ def initialize(
3722
+ amount: nil,
3723
+ amount_includes_iof: nil,
3724
+ amount_type: nil,
3725
+ currency: nil,
3726
+ end_date: nil,
3727
+ payment_schedule: nil,
3728
+ reference: nil,
3729
+ start_date: nil
3730
+ )
3731
+ @amount = amount
3732
+ @amount_includes_iof = amount_includes_iof
3733
+ @amount_type = amount_type
3734
+ @currency = currency
3735
+ @end_date = end_date
3736
+ @payment_schedule = payment_schedule
3737
+ @reference = reference
3738
+ @start_date = start_date
3739
+ end
3740
+ end
3741
+ # Additional fields for mandate creation.
3742
+ attr_accessor :mandate_options
3743
+
3744
+ def initialize(mandate_options: nil)
3745
+ @mandate_options = mandate_options
3746
+ end
3747
+ end
3748
+
3600
3749
  class SepaDebit < Stripe::RequestParams
3601
3750
  class MandateOptions < Stripe::RequestParams
3602
3751
  # 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'.
@@ -3718,6 +3867,8 @@ module Stripe
3718
3867
  attr_accessor :paypal
3719
3868
  # If this is a `payto` SetupIntent, this sub-hash contains details about the PayTo payment method options.
3720
3869
  attr_accessor :payto
3870
+ # If this is a `pix` SetupIntent, this sub-hash contains details about the Pix payment method options.
3871
+ attr_accessor :pix
3721
3872
  # If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.
3722
3873
  attr_accessor :sepa_debit
3723
3874
  # If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.
@@ -3733,6 +3884,7 @@ module Stripe
3733
3884
  link: nil,
3734
3885
  paypal: nil,
3735
3886
  payto: nil,
3887
+ pix: nil,
3736
3888
  sepa_debit: nil,
3737
3889
  us_bank_account: nil
3738
3890
  )
@@ -3745,6 +3897,7 @@ module Stripe
3745
3897
  @link = link
3746
3898
  @paypal = paypal
3747
3899
  @payto = payto
3900
+ @pix = pix
3748
3901
  @sepa_debit = sepa_debit
3749
3902
  @us_bank_account = us_bank_account
3750
3903
  end
@@ -299,6 +299,41 @@ module Stripe
299
299
  end
300
300
  end
301
301
 
302
+ class Period < Stripe::RequestParams
303
+ class End < Stripe::RequestParams
304
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
305
+ attr_accessor :timestamp
306
+ # Select how to calculate the end of the invoice item period.
307
+ attr_accessor :type
308
+
309
+ def initialize(timestamp: nil, type: nil)
310
+ @timestamp = timestamp
311
+ @type = type
312
+ end
313
+ end
314
+
315
+ class Start < Stripe::RequestParams
316
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
317
+ attr_accessor :timestamp
318
+ # Select how to calculate the start of the invoice item period.
319
+ attr_accessor :type
320
+
321
+ def initialize(timestamp: nil, type: nil)
322
+ @timestamp = timestamp
323
+ @type = type
324
+ end
325
+ end
326
+ # End of the invoice item period.
327
+ attr_accessor :end
328
+ # Start of the invoice item period.
329
+ attr_accessor :start
330
+
331
+ def initialize(end_: nil, start: nil)
332
+ @end = end_
333
+ @start = start
334
+ end
335
+ end
336
+
302
337
  class PriceData < Stripe::RequestParams
303
338
  # 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).
304
339
  attr_accessor :currency
@@ -327,6 +362,10 @@ module Stripe
327
362
  end
328
363
  # The coupons to redeem into discounts for the item.
329
364
  attr_accessor :discounts
365
+ # 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`.
366
+ attr_accessor :metadata
367
+ # The period associated with this invoice item. Defaults to the period of the underlying subscription that surrounds the start of the phase.
368
+ attr_accessor :period
330
369
  # The ID of the price object. One of `price` or `price_data` is required.
331
370
  attr_accessor :price
332
371
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -336,8 +375,18 @@ module Stripe
336
375
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
337
376
  attr_accessor :tax_rates
338
377
 
339
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
378
+ def initialize(
379
+ discounts: nil,
380
+ metadata: nil,
381
+ period: nil,
382
+ price: nil,
383
+ price_data: nil,
384
+ quantity: nil,
385
+ tax_rates: nil
386
+ )
340
387
  @discounts = discounts
388
+ @metadata = metadata
389
+ @period = period
341
390
  @price = price
342
391
  @price_data = price_data
343
392
  @quantity = quantity
@@ -991,6 +1040,41 @@ module Stripe
991
1040
  end
992
1041
  end
993
1042
 
1043
+ class Period < Stripe::RequestParams
1044
+ class End < Stripe::RequestParams
1045
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
1046
+ attr_accessor :timestamp
1047
+ # Select how to calculate the end of the invoice item period.
1048
+ attr_accessor :type
1049
+
1050
+ def initialize(timestamp: nil, type: nil)
1051
+ @timestamp = timestamp
1052
+ @type = type
1053
+ end
1054
+ end
1055
+
1056
+ class Start < Stripe::RequestParams
1057
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
1058
+ attr_accessor :timestamp
1059
+ # Select how to calculate the start of the invoice item period.
1060
+ attr_accessor :type
1061
+
1062
+ def initialize(timestamp: nil, type: nil)
1063
+ @timestamp = timestamp
1064
+ @type = type
1065
+ end
1066
+ end
1067
+ # End of the invoice item period.
1068
+ attr_accessor :end
1069
+ # Start of the invoice item period.
1070
+ attr_accessor :start
1071
+
1072
+ def initialize(end_: nil, start: nil)
1073
+ @end = end_
1074
+ @start = start
1075
+ end
1076
+ end
1077
+
994
1078
  class PriceData < Stripe::RequestParams
995
1079
  # 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).
996
1080
  attr_accessor :currency
@@ -1019,6 +1103,10 @@ module Stripe
1019
1103
  end
1020
1104
  # The coupons to redeem into discounts for the item.
1021
1105
  attr_accessor :discounts
1106
+ # 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`.
1107
+ attr_accessor :metadata
1108
+ # The period associated with this invoice item. Defaults to the period of the underlying subscription that surrounds the start of the phase.
1109
+ attr_accessor :period
1022
1110
  # The ID of the price object. One of `price` or `price_data` is required.
1023
1111
  attr_accessor :price
1024
1112
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -1028,8 +1116,18 @@ module Stripe
1028
1116
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1029
1117
  attr_accessor :tax_rates
1030
1118
 
1031
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
1119
+ def initialize(
1120
+ discounts: nil,
1121
+ metadata: nil,
1122
+ period: nil,
1123
+ price: nil,
1124
+ price_data: nil,
1125
+ quantity: nil,
1126
+ tax_rates: nil
1127
+ )
1032
1128
  @discounts = discounts
1129
+ @metadata = metadata
1130
+ @period = period
1033
1131
  @price = price
1034
1132
  @price_data = price_data
1035
1133
  @quantity = quantity
@@ -86,6 +86,41 @@ module Stripe
86
86
  end
87
87
  end
88
88
 
89
+ class Period < Stripe::RequestParams
90
+ class End < Stripe::RequestParams
91
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
92
+ attr_accessor :timestamp
93
+ # Select how to calculate the end of the invoice item period.
94
+ attr_accessor :type
95
+
96
+ def initialize(timestamp: nil, type: nil)
97
+ @timestamp = timestamp
98
+ @type = type
99
+ end
100
+ end
101
+
102
+ class Start < Stripe::RequestParams
103
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
104
+ attr_accessor :timestamp
105
+ # Select how to calculate the start of the invoice item period.
106
+ attr_accessor :type
107
+
108
+ def initialize(timestamp: nil, type: nil)
109
+ @timestamp = timestamp
110
+ @type = type
111
+ end
112
+ end
113
+ # End of the invoice item period.
114
+ attr_accessor :end
115
+ # Start of the invoice item period.
116
+ attr_accessor :start
117
+
118
+ def initialize(end_: nil, start: nil)
119
+ @end = end_
120
+ @start = start
121
+ end
122
+ end
123
+
89
124
  class PriceData < Stripe::RequestParams
90
125
  # 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).
91
126
  attr_accessor :currency
@@ -114,6 +149,10 @@ module Stripe
114
149
  end
115
150
  # The coupons to redeem into discounts for the item.
116
151
  attr_accessor :discounts
152
+ # 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`.
153
+ attr_accessor :metadata
154
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
155
+ attr_accessor :period
117
156
  # The ID of the price object. One of `price` or `price_data` is required.
118
157
  attr_accessor :price
119
158
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -123,8 +162,18 @@ module Stripe
123
162
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
124
163
  attr_accessor :tax_rates
125
164
 
126
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
165
+ def initialize(
166
+ discounts: nil,
167
+ metadata: nil,
168
+ period: nil,
169
+ price: nil,
170
+ price_data: nil,
171
+ quantity: nil,
172
+ tax_rates: nil
173
+ )
127
174
  @discounts = discounts
175
+ @metadata = metadata
176
+ @period = period
128
177
  @price = price
129
178
  @price_data = price_data
130
179
  @quantity = quantity
@@ -880,9 +929,9 @@ module Stripe
880
929
  attr_accessor :collection_method
881
930
  # Only return subscriptions that were created during the given date interval.
882
931
  attr_accessor :created
883
- # Only return subscriptions whose current_period_end falls within the given date interval.
932
+ # Only return subscriptions whose minimum item current_period_end falls within the given date interval.
884
933
  attr_accessor :current_period_end
885
- # Only return subscriptions whose current_period_start falls within the given date interval.
934
+ # Only return subscriptions whose maximum item current_period_start falls within the given date interval.
886
935
  attr_accessor :current_period_start
887
936
  # The ID of the customer whose subscriptions will be retrieved.
888
937
  attr_accessor :customer
@@ -985,6 +1034,41 @@ module Stripe
985
1034
  end
986
1035
  end
987
1036
 
1037
+ class Period < Stripe::RequestParams
1038
+ class End < Stripe::RequestParams
1039
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
1040
+ attr_accessor :timestamp
1041
+ # Select how to calculate the end of the invoice item period.
1042
+ attr_accessor :type
1043
+
1044
+ def initialize(timestamp: nil, type: nil)
1045
+ @timestamp = timestamp
1046
+ @type = type
1047
+ end
1048
+ end
1049
+
1050
+ class Start < Stripe::RequestParams
1051
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
1052
+ attr_accessor :timestamp
1053
+ # Select how to calculate the start of the invoice item period.
1054
+ attr_accessor :type
1055
+
1056
+ def initialize(timestamp: nil, type: nil)
1057
+ @timestamp = timestamp
1058
+ @type = type
1059
+ end
1060
+ end
1061
+ # End of the invoice item period.
1062
+ attr_accessor :end
1063
+ # Start of the invoice item period.
1064
+ attr_accessor :start
1065
+
1066
+ def initialize(end_: nil, start: nil)
1067
+ @end = end_
1068
+ @start = start
1069
+ end
1070
+ end
1071
+
988
1072
  class PriceData < Stripe::RequestParams
989
1073
  # 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).
990
1074
  attr_accessor :currency
@@ -1013,6 +1097,10 @@ module Stripe
1013
1097
  end
1014
1098
  # The coupons to redeem into discounts for the item.
1015
1099
  attr_accessor :discounts
1100
+ # 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`.
1101
+ attr_accessor :metadata
1102
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
1103
+ attr_accessor :period
1016
1104
  # The ID of the price object. One of `price` or `price_data` is required.
1017
1105
  attr_accessor :price
1018
1106
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
@@ -1022,8 +1110,18 @@ module Stripe
1022
1110
  # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1023
1111
  attr_accessor :tax_rates
1024
1112
 
1025
- def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
1113
+ def initialize(
1114
+ discounts: nil,
1115
+ metadata: nil,
1116
+ period: nil,
1117
+ price: nil,
1118
+ price_data: nil,
1119
+ quantity: nil,
1120
+ tax_rates: nil
1121
+ )
1026
1122
  @discounts = discounts
1123
+ @metadata = metadata
1124
+ @period = period
1027
1125
  @price = price
1028
1126
  @price_data = price_data
1029
1127
  @quantity = quantity
@@ -1055,15 +1153,15 @@ module Stripe
1055
1153
  end
1056
1154
 
1057
1155
  class BillingCycleAnchorConfig < Stripe::RequestParams
1058
- # The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31.
1156
+ # The day of the month the anchor should be. Ranges from 1 to 31.
1059
1157
  attr_accessor :day_of_month
1060
- # The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23.
1158
+ # The hour of the day the anchor should be. Ranges from 0 to 23.
1061
1159
  attr_accessor :hour
1062
- # The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59.
1160
+ # The minute of the hour the anchor should be. Ranges from 0 to 59.
1063
1161
  attr_accessor :minute
1064
- # The month to start full cycle billing periods. Ranges from 1 to 12.
1162
+ # The month to start full cycle periods. Ranges from 1 to 12.
1065
1163
  attr_accessor :month
1066
- # The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59.
1164
+ # The second of the minute the anchor should be. Ranges from 0 to 59.
1067
1165
  attr_accessor :second
1068
1166
 
1069
1167
  def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil)
@@ -1586,6 +1684,8 @@ module Stripe
1586
1684
  attr_accessor :automatic_tax
1587
1685
  # 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.
1588
1686
  attr_accessor :backdate_start_date
1687
+ # 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.
1688
+ attr_accessor :billing_cadence
1589
1689
  # 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.
1590
1690
  attr_accessor :billing_cycle_anchor
1591
1691
  # 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.
@@ -1666,6 +1766,7 @@ module Stripe
1666
1766
  application_fee_percent: nil,
1667
1767
  automatic_tax: nil,
1668
1768
  backdate_start_date: nil,
1769
+ billing_cadence: nil,
1669
1770
  billing_cycle_anchor: nil,
1670
1771
  billing_cycle_anchor_config: nil,
1671
1772
  billing_mode: nil,
@@ -1703,6 +1804,7 @@ module Stripe
1703
1804
  @application_fee_percent = application_fee_percent
1704
1805
  @automatic_tax = automatic_tax
1705
1806
  @backdate_start_date = backdate_start_date
1807
+ @billing_cadence = billing_cadence
1706
1808
  @billing_cycle_anchor = billing_cycle_anchor
1707
1809
  @billing_cycle_anchor_config = billing_cycle_anchor_config
1708
1810
  @billing_mode = billing_mode
@@ -1756,6 +1858,18 @@ module Stripe
1756
1858
  end
1757
1859
  end
1758
1860
 
1861
+ class AttachCadenceParams < Stripe::RequestParams
1862
+ # 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.
1863
+ attr_accessor :billing_cadence
1864
+ # Specifies which fields in the response should be expanded.
1865
+ attr_accessor :expand
1866
+
1867
+ def initialize(billing_cadence: nil, expand: nil)
1868
+ @billing_cadence = billing_cadence
1869
+ @expand = expand
1870
+ end
1871
+ end
1872
+
1759
1873
  class MigrateParams < Stripe::RequestParams
1760
1874
  class BillingMode < Stripe::RequestParams
1761
1875
  # Attribute for param field type
@@ -1799,6 +1913,17 @@ module Stripe
1799
1913
  end
1800
1914
  end
1801
1915
 
1916
+ # 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.
1917
+ def attach_cadence(subscription, params = {}, opts = {})
1918
+ request(
1919
+ method: :post,
1920
+ path: format("/v1/subscriptions/%<subscription>s/attach_cadence", { subscription: CGI.escape(subscription) }),
1921
+ params: params,
1922
+ opts: opts,
1923
+ base_address: :api
1924
+ )
1925
+ end
1926
+
1802
1927
  # 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).
1803
1928
  #
1804
1929
  # 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.