stripe 15.1.0 → 15.2.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 (586) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1561 -695
  3. data/VERSION +1 -1
  4. data/lib/stripe/api_requestor.rb +28 -0
  5. data/lib/stripe/api_version.rb +1 -1
  6. data/lib/stripe/errors.rb +54 -0
  7. data/lib/stripe/event_types.rb +89 -0
  8. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  9. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  10. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  11. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_core_account_link_completed_event.rb +13 -0
  20. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  21. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  22. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  23. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  24. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  26. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  27. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  30. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  48. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  53. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  58. data/lib/stripe/object_types.rb +52 -0
  59. data/lib/stripe/resources/account.rb +653 -1
  60. data/lib/stripe/resources/account_notice.rb +123 -0
  61. data/lib/stripe/resources/account_session.rb +299 -1
  62. data/lib/stripe/resources/balance_settings.rb +105 -0
  63. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  64. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  65. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  66. data/lib/stripe/resources/billing/meter_error_report.rb +59 -0
  67. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  68. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  69. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  70. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  71. data/lib/stripe/resources/card.rb +2 -0
  72. data/lib/stripe/resources/cash_balance.rb +2 -0
  73. data/lib/stripe/resources/charge.rb +1470 -0
  74. data/lib/stripe/resources/checkout/session.rb +331 -3
  75. data/lib/stripe/resources/confirmation_token.rb +176 -0
  76. data/lib/stripe/resources/coupon.rb +30 -1
  77. data/lib/stripe/resources/credit_note.rb +10 -0
  78. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  79. data/lib/stripe/resources/customer.rb +2 -0
  80. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  81. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  82. data/lib/stripe/resources/customer_session.rb +6 -1
  83. data/lib/stripe/resources/discount.rb +2 -0
  84. data/lib/stripe/resources/event.rb +31 -0
  85. data/lib/stripe/resources/financial_connections/account.rb +20 -1
  86. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  87. data/lib/stripe/resources/financial_connections/institution.rb +90 -0
  88. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  89. data/lib/stripe/resources/fx_quote.rb +184 -0
  90. data/lib/stripe/resources/gift_cards/card.rb +208 -0
  91. data/lib/stripe/resources/gift_cards/transaction.rb +272 -0
  92. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  93. data/lib/stripe/resources/invoice.rb +1129 -15
  94. data/lib/stripe/resources/invoice_item.rb +78 -2
  95. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  96. data/lib/stripe/resources/invoice_payment.rb +2 -53
  97. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  98. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  99. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  100. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  101. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  102. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  103. data/lib/stripe/resources/line_item.rb +37 -0
  104. data/lib/stripe/resources/mandate.rb +24 -0
  105. data/lib/stripe/resources/margin.rb +115 -0
  106. data/lib/stripe/resources/order.rb +2859 -0
  107. data/lib/stripe/resources/payment_attempt_record.rb +1078 -0
  108. data/lib/stripe/resources/payment_intent.rb +6036 -1214
  109. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +65 -0
  110. data/lib/stripe/resources/payment_method.rb +198 -1
  111. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  112. data/lib/stripe/resources/payment_record.rb +1607 -0
  113. data/lib/stripe/resources/payout.rb +6 -0
  114. data/lib/stripe/resources/price.rb +30 -0
  115. data/lib/stripe/resources/privacy/redaction_job.rb +275 -0
  116. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +25 -0
  117. data/lib/stripe/resources/product.rb +59 -0
  118. data/lib/stripe/resources/promotion_code.rb +10 -0
  119. data/lib/stripe/resources/quote.rb +2046 -6
  120. data/lib/stripe/resources/quote_line.rb +274 -0
  121. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  122. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +339 -0
  123. data/lib/stripe/resources/refund.rb +9 -0
  124. data/lib/stripe/resources/setup_attempt.rb +21 -0
  125. data/lib/stripe/resources/setup_intent.rb +596 -9
  126. data/lib/stripe/resources/source.rb +29 -0
  127. data/lib/stripe/resources/subscription.rb +298 -9
  128. data/lib/stripe/resources/subscription_item.rb +84 -3
  129. data/lib/stripe/resources/subscription_schedule.rb +1013 -10
  130. data/lib/stripe/resources/tax/association.rb +89 -0
  131. data/lib/stripe/resources/tax/form.rb +211 -0
  132. data/lib/stripe/resources/tax_id.rb +12 -2
  133. data/lib/stripe/resources/terminal/reader.rb +406 -0
  134. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  135. data/lib/stripe/resources/transfer.rb +6 -0
  136. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  137. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  138. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  139. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  140. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  141. data/lib/stripe/resources/v2/core/account.rb +1746 -0
  142. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  143. data/lib/stripe/resources/v2/core/person.rb +276 -0
  144. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  145. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  146. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  147. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  148. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  149. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  150. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  151. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  152. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  153. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  154. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  155. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  156. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  157. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  158. data/lib/stripe/resources/v2/money_management/received_credit.rb +136 -0
  159. data/lib/stripe/resources/v2/money_management/received_debit.rb +108 -0
  160. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  161. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  162. data/lib/stripe/resources.rb +99 -0
  163. data/lib/stripe/services/account_notice_service.rb +101 -0
  164. data/lib/stripe/services/account_service.rb +562 -1
  165. data/lib/stripe/services/account_session_service.rb +269 -1
  166. data/lib/stripe/services/balance_settings_service.rb +96 -0
  167. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  168. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  169. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  170. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  171. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  172. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  173. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  174. data/lib/stripe/services/capital_service.rb +15 -0
  175. data/lib/stripe/services/charge_service.rb +1350 -0
  176. data/lib/stripe/services/checkout/session_service.rb +247 -2
  177. data/lib/stripe/services/coupon_service.rb +17 -1
  178. data/lib/stripe/services/credit_note_service.rb +4 -0
  179. data/lib/stripe/services/customer_session_service.rb +4 -1
  180. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -123
  181. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  182. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  183. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  184. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  185. data/lib/stripe/services/financial_connections_service.rb +2 -1
  186. data/lib/stripe/services/fx_quote_service.rb +123 -0
  187. data/lib/stripe/services/gift_cards/card_service.rb +170 -0
  188. data/lib/stripe/services/gift_cards/transaction_service.rb +209 -0
  189. data/lib/stripe/services/gift_cards_service.rb +14 -0
  190. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  191. data/lib/stripe/services/invoice_item_service.rb +74 -2
  192. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  193. data/lib/stripe/services/invoice_service.rb +1059 -15
  194. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  195. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  196. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  197. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  198. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +119 -0
  201. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  202. data/lib/stripe/services/order_service.rb +2268 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  204. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  205. data/lib/stripe/services/payment_intent_service.rb +4631 -258
  206. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  207. data/lib/stripe/services/payment_method_service.rb +126 -1
  208. data/lib/stripe/services/payment_record_service.rb +542 -0
  209. data/lib/stripe/services/payout_service.rb +4 -0
  210. data/lib/stripe/services/price_service.rb +19 -0
  211. data/lib/stripe/services/privacy/redaction_job_service.rb +231 -0
  212. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  213. data/lib/stripe/services/privacy_service.rb +13 -0
  214. data/lib/stripe/services/product_service.rb +38 -0
  215. data/lib/stripe/services/promotion_code_service.rb +8 -0
  216. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  217. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  218. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  219. data/lib/stripe/services/quote_service.rb +1730 -7
  220. data/lib/stripe/services/setup_intent_service.rb +556 -9
  221. data/lib/stripe/services/subscription_item_service.rb +75 -3
  222. data/lib/stripe/services/subscription_schedule_service.rb +915 -10
  223. data/lib/stripe/services/subscription_service.rb +257 -9
  224. data/lib/stripe/services/tax/association_service.rb +31 -0
  225. data/lib/stripe/services/tax/form_service.rb +100 -0
  226. data/lib/stripe/services/tax_id_service.rb +8 -2
  227. data/lib/stripe/services/tax_service.rb +3 -1
  228. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  229. data/lib/stripe/services/terminal/reader_service.rb +180 -0
  230. data/lib/stripe/services/terminal_service.rb +2 -1
  231. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +103 -0
  232. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  233. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  234. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  235. data/lib/stripe/services/transfer_service.rb +4 -0
  236. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  237. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  238. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  239. data/lib/stripe/services/v1_services.rb +12 -2
  240. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  241. data/lib/stripe/services/v2/core/account_service.rb +4138 -0
  242. data/lib/stripe/services/v2/core/accounts/person_service.rb +1048 -0
  243. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +135 -0
  244. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +109 -0
  245. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  246. data/lib/stripe/services/v2/core_service.rb +4 -1
  247. data/lib/stripe/services/v2/money_management/adjustment_service.rb +75 -0
  248. data/lib/stripe/services/v2/money_management/financial_account_service.rb +44 -0
  249. data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -0
  250. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +126 -0
  251. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +96 -0
  252. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +202 -0
  253. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +237 -0
  254. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +174 -0
  255. data/lib/stripe/services/v2/money_management/payout_method_service.rb +95 -0
  256. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  257. data/lib/stripe/services/v2/money_management/received_credit_service.rb +71 -0
  258. data/lib/stripe/services/v2/money_management/received_debit_service.rb +44 -0
  259. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +70 -0
  260. data/lib/stripe/services/v2/money_management/transaction_service.rb +74 -0
  261. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  262. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  263. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +50 -0
  264. data/lib/stripe/services/v2_services.rb +4 -2
  265. data/lib/stripe/services.rb +54 -1
  266. data/lib/stripe/stripe_configuration.rb +3 -1
  267. data/lib/stripe/stripe_object.rb +1 -1
  268. data/lib/stripe/util.rb +7 -1
  269. data/lib/stripe/version.rb +1 -1
  270. data/lib/stripe.rb +53 -0
  271. data/rbi/stripe.rbi +191867 -0
  272. data/stripe.gemspec +4 -1
  273. metadata +157 -324
  274. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  275. data/rbi/stripe/resources/account.rbi +0 -4903
  276. data/rbi/stripe/resources/account_link.rbi +0 -74
  277. data/rbi/stripe/resources/account_session.rbi +0 -894
  278. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -90
  279. data/rbi/stripe/resources/application.rbi +0 -20
  280. data/rbi/stripe/resources/application_fee.rbi +0 -118
  281. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  282. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  283. data/rbi/stripe/resources/balance.rbi +0 -180
  284. data/rbi/stripe/resources/balance_transaction.rbi +0 -144
  285. data/rbi/stripe/resources/bank_account.rbi +0 -127
  286. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  287. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  288. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  289. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  290. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  291. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  292. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  293. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  294. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  295. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  296. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  297. data/rbi/stripe/resources/capability.rbi +0 -125
  298. data/rbi/stripe/resources/card.rbi +0 -125
  299. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  300. data/rbi/stripe/resources/charge.rbi +0 -2057
  301. data/rbi/stripe/resources/checkout/session.rbi +0 -3988
  302. data/rbi/stripe/resources/climate/order.rbi +0 -245
  303. data/rbi/stripe/resources/climate/product.rbi +0 -75
  304. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  305. data/rbi/stripe/resources/confirmation_token.rbi +0 -1873
  306. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  307. data/rbi/stripe/resources/country_spec.rbi +0 -85
  308. data/rbi/stripe/resources/coupon.rbi +0 -252
  309. data/rbi/stripe/resources/credit_note.rbi +0 -747
  310. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  311. data/rbi/stripe/resources/customer.rbi +0 -1009
  312. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  313. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  314. data/rbi/stripe/resources/customer_session.rbi +0 -200
  315. data/rbi/stripe/resources/discount.rbi +0 -53
  316. data/rbi/stripe/resources/dispute.rbi +0 -761
  317. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  318. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  319. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  320. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  321. data/rbi/stripe/resources/event.rbi +0 -149
  322. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  323. data/rbi/stripe/resources/file.rbi +0 -143
  324. data/rbi/stripe/resources/file_link.rbi +0 -141
  325. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  326. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  327. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  328. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  329. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  330. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  331. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  332. data/rbi/stripe/resources/identity/verification_report.rbi +0 -351
  333. data/rbi/stripe/resources/identity/verification_session.rbi +0 -517
  334. data/rbi/stripe/resources/invoice.rbi +0 -3736
  335. data/rbi/stripe/resources/invoice_item.rbi +0 -475
  336. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  337. data/rbi/stripe/resources/invoice_payment.rbi +0 -114
  338. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  339. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  340. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  341. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  342. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  343. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  344. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  345. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  346. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  347. data/rbi/stripe/resources/line_item.rbi +0 -72
  348. data/rbi/stripe/resources/login_link.rbi +0 -19
  349. data/rbi/stripe/resources/mandate.rbi +0 -187
  350. data/rbi/stripe/resources/payment_intent.rbi +0 -9795
  351. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  352. data/rbi/stripe/resources/payment_method.rbi +0 -1831
  353. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3220
  354. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  355. data/rbi/stripe/resources/payout.rbi +0 -300
  356. data/rbi/stripe/resources/person.rbi +0 -401
  357. data/rbi/stripe/resources/plan.rbi +0 -373
  358. data/rbi/stripe/resources/price.rbi +0 -694
  359. data/rbi/stripe/resources/product.rbi +0 -557
  360. data/rbi/stripe/resources/product_feature.rbi +0 -26
  361. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  362. data/rbi/stripe/resources/quote.rbi +0 -1126
  363. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  364. data/rbi/stripe/resources/radar/value_list.rbi +0 -170
  365. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -131
  366. data/rbi/stripe/resources/refund.rbi +0 -519
  367. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  368. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  369. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  370. data/rbi/stripe/resources/reversal.rbi +0 -51
  371. data/rbi/stripe/resources/review.rbi +0 -154
  372. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  373. data/rbi/stripe/resources/setup_intent.rbi +0 -3869
  374. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  375. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  376. data/rbi/stripe/resources/source.rbi +0 -1496
  377. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  378. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  379. data/rbi/stripe/resources/subscription.rbi +0 -1964
  380. data/rbi/stripe/resources/subscription_item.rbi +0 -370
  381. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1495
  382. data/rbi/stripe/resources/tax/calculation.rbi +0 -474
  383. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -88
  384. data/rbi/stripe/resources/tax/registration.rbi +0 -2713
  385. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  386. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  387. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  388. data/rbi/stripe/resources/tax_code.rbi +0 -44
  389. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  390. data/rbi/stripe/resources/tax_id.rbi +0 -167
  391. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  392. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1388
  393. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  394. data/rbi/stripe/resources/terminal/location.rbi +0 -224
  395. data/rbi/stripe/resources/terminal/reader.rbi +0 -587
  396. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -134
  397. data/rbi/stripe/resources/token.rbi +0 -1283
  398. data/rbi/stripe/resources/topup.rbi +0 -222
  399. data/rbi/stripe/resources/transfer.rbi +0 -199
  400. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  401. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  402. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -865
  403. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  404. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  405. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  406. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  407. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  408. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  409. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  410. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  411. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  412. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  413. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  414. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  415. data/rbi/stripe/resources/v2/event.rbi +0 -48
  416. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  417. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -170
  418. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  419. data/rbi/stripe/services/account_link_service.rbi +0 -58
  420. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  421. data/rbi/stripe/services/account_person_service.rbi +0 -1013
  422. data/rbi/stripe/services/account_service.rbi +0 -4189
  423. data/rbi/stripe/services/account_session_service.rbi +0 -572
  424. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -78
  425. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  426. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  427. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  428. data/rbi/stripe/services/apps_service.rbi +0 -9
  429. data/rbi/stripe/services/balance_service.rbi +0 -21
  430. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  431. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  432. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  433. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  434. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  435. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  436. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  437. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  438. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  439. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  440. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  441. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  442. data/rbi/stripe/services/billing_service.rbi +0 -15
  443. data/rbi/stripe/services/charge_service.rbi +0 -448
  444. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  445. data/rbi/stripe/services/checkout/session_service.rbi +0 -2607
  446. data/rbi/stripe/services/checkout_service.rbi +0 -9
  447. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  448. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  449. data/rbi/stripe/services/climate_service.rbi +0 -11
  450. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  451. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  452. data/rbi/stripe/services/coupon_service.rbi +0 -196
  453. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  454. data/rbi/stripe/services/credit_note_service.rbi +0 -416
  455. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  456. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  457. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  458. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  459. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  460. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  461. data/rbi/stripe/services/customer_service.rbi +0 -651
  462. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  463. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -72
  464. data/rbi/stripe/services/dispute_service.rbi +0 -424
  465. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  466. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  467. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  468. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  469. data/rbi/stripe/services/event_service.rbi +0 -83
  470. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  471. data/rbi/stripe/services/file_link_service.rbi +0 -124
  472. data/rbi/stripe/services/file_service.rbi +0 -116
  473. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  474. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  475. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  476. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  477. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  478. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  479. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  480. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  481. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -323
  482. data/rbi/stripe/services/identity_service.rbi +0 -10
  483. data/rbi/stripe/services/invoice_item_service.rbi +0 -368
  484. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  485. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  486. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  487. data/rbi/stripe/services/invoice_service.rbi +0 -2920
  488. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  489. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  490. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  491. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  492. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  493. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  494. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  495. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  496. data/rbi/stripe/services/issuing_service.rbi +0 -16
  497. data/rbi/stripe/services/mandate_service.rbi +0 -20
  498. data/rbi/stripe/services/payment_intent_service.rbi +0 -7819
  499. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  500. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2255
  501. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  502. data/rbi/stripe/services/payment_method_service.rbi +0 -846
  503. data/rbi/stripe/services/payout_service.rbi +0 -205
  504. data/rbi/stripe/services/plan_service.rbi +0 -284
  505. data/rbi/stripe/services/price_service.rbi +0 -546
  506. data/rbi/stripe/services/product_feature_service.rbi +0 -69
  507. data/rbi/stripe/services/product_service.rbi +0 -479
  508. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  509. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  510. data/rbi/stripe/services/quote_service.rbi +0 -686
  511. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  512. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -111
  513. data/rbi/stripe/services/radar/value_list_service.rbi +0 -143
  514. data/rbi/stripe/services/radar_service.rbi +0 -11
  515. data/rbi/stripe/services/refund_service.rbi +0 -185
  516. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  517. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  518. data/rbi/stripe/services/reporting_service.rbi +0 -10
  519. data/rbi/stripe/services/review_service.rbi +0 -84
  520. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  521. data/rbi/stripe/services/setup_intent_service.rbi +0 -3605
  522. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  523. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  524. data/rbi/stripe/services/sigma_service.rbi +0 -9
  525. data/rbi/stripe/services/source_service.rbi +0 -663
  526. data/rbi/stripe/services/subscription_item_service.rbi +0 -324
  527. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1192
  528. data/rbi/stripe/services/subscription_service.rbi +0 -1596
  529. data/rbi/stripe/services/tax/calculation_service.rbi +0 -230
  530. data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
  531. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  532. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  533. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  534. data/rbi/stripe/services/tax_id_service.rbi +0 -112
  535. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  536. data/rbi/stripe/services/tax_service.rbi +0 -12
  537. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1120
  538. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  539. data/rbi/stripe/services/terminal/location_service.rbi +0 -184
  540. data/rbi/stripe/services/terminal/reader_service.rbi +0 -344
  541. data/rbi/stripe/services/terminal_service.rbi +0 -12
  542. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -805
  543. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  544. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  545. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  546. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  547. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  548. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  549. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  550. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -62
  551. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  552. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -92
  553. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  554. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  555. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  556. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  557. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  558. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  559. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  560. data/rbi/stripe/services/token_service.rbi +0 -1257
  561. data/rbi/stripe/services/topup_service.rbi +0 -176
  562. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  563. data/rbi/stripe/services/transfer_service.rbi +0 -152
  564. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  565. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  566. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  567. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -562
  568. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  569. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  570. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  571. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  572. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  573. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  574. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  575. data/rbi/stripe/services/treasury_service.rbi +0 -18
  576. data/rbi/stripe/services/v1_services.rbi +0 -77
  577. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  578. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  579. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -20
  580. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  581. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  582. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -200
  583. data/rbi/stripe/services/v2/core/event_service.rbi +0 -38
  584. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  585. data/rbi/stripe/services/v2_services.rbi +0 -10
  586. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -131
@@ -83,6 +83,8 @@ module Stripe
83
83
  attr_accessor :created
84
84
  # Only return subscription schedules for the given customer.
85
85
  attr_accessor :customer
86
+ # Only return subscription schedules for the given account.
87
+ attr_accessor :customer_account
86
88
  # A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
87
89
  attr_accessor :ending_before
88
90
  # Specifies which fields in the response should be expanded.
@@ -101,6 +103,7 @@ module Stripe
101
103
  completed_at: nil,
102
104
  created: nil,
103
105
  customer: nil,
106
+ customer_account: nil,
104
107
  ending_before: nil,
105
108
  expand: nil,
106
109
  limit: nil,
@@ -112,6 +115,7 @@ module Stripe
112
115
  @completed_at = completed_at
113
116
  @created = created
114
117
  @customer = customer
118
+ @customer_account = customer_account
115
119
  @ending_before = ending_before
116
120
  @expand = expand
117
121
  @limit = limit
@@ -228,16 +232,44 @@ module Stripe
228
232
  class Phase < Stripe::RequestParams
229
233
  class AddInvoiceItem < Stripe::RequestParams
230
234
  class Discount < Stripe::RequestParams
235
+ class DiscountEnd < Stripe::RequestParams
236
+ class Duration < Stripe::RequestParams
237
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
238
+ attr_accessor :interval
239
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
240
+ attr_accessor :interval_count
241
+
242
+ def initialize(interval: nil, interval_count: nil)
243
+ @interval = interval
244
+ @interval_count = interval_count
245
+ end
246
+ end
247
+ # Time span for the redeemed discount.
248
+ attr_accessor :duration
249
+ # A precise Unix timestamp for the discount to end. Must be in the future.
250
+ attr_accessor :timestamp
251
+ # The type of calculation made to determine when the discount ends.
252
+ attr_accessor :type
253
+
254
+ def initialize(duration: nil, timestamp: nil, type: nil)
255
+ @duration = duration
256
+ @timestamp = timestamp
257
+ @type = type
258
+ end
259
+ end
231
260
  # ID of the coupon to create a new discount for.
232
261
  attr_accessor :coupon
233
262
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
234
263
  attr_accessor :discount
264
+ # Details to determine how long the discount should be applied for.
265
+ attr_accessor :discount_end
235
266
  # ID of the promotion code to create a new discount for.
236
267
  attr_accessor :promotion_code
237
268
 
238
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
269
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
239
270
  @coupon = coupon
240
271
  @discount = discount
272
+ @discount_end = discount_end
241
273
  @promotion_code = promotion_code
242
274
  end
243
275
  end
@@ -312,16 +344,44 @@ module Stripe
312
344
  end
313
345
 
314
346
  class Discount < Stripe::RequestParams
347
+ class DiscountEnd < Stripe::RequestParams
348
+ class Duration < Stripe::RequestParams
349
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
350
+ attr_accessor :interval
351
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
352
+ attr_accessor :interval_count
353
+
354
+ def initialize(interval: nil, interval_count: nil)
355
+ @interval = interval
356
+ @interval_count = interval_count
357
+ end
358
+ end
359
+ # Time span for the redeemed discount.
360
+ attr_accessor :duration
361
+ # A precise Unix timestamp for the discount to end. Must be in the future.
362
+ attr_accessor :timestamp
363
+ # The type of calculation made to determine when the discount ends.
364
+ attr_accessor :type
365
+
366
+ def initialize(duration: nil, timestamp: nil, type: nil)
367
+ @duration = duration
368
+ @timestamp = timestamp
369
+ @type = type
370
+ end
371
+ end
315
372
  # ID of the coupon to create a new discount for.
316
373
  attr_accessor :coupon
317
374
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
318
375
  attr_accessor :discount
376
+ # Details to determine how long the discount should be applied for.
377
+ attr_accessor :discount_end
319
378
  # ID of the promotion code to create a new discount for.
320
379
  attr_accessor :promotion_code
321
380
 
322
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
381
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
323
382
  @coupon = coupon
324
383
  @discount = discount
384
+ @discount_end = discount_end
325
385
  @promotion_code = promotion_code
326
386
  end
327
387
  end
@@ -354,16 +414,44 @@ module Stripe
354
414
 
355
415
  class Item < Stripe::RequestParams
356
416
  class Discount < Stripe::RequestParams
417
+ class DiscountEnd < Stripe::RequestParams
418
+ class Duration < Stripe::RequestParams
419
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
420
+ attr_accessor :interval
421
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
422
+ attr_accessor :interval_count
423
+
424
+ def initialize(interval: nil, interval_count: nil)
425
+ @interval = interval
426
+ @interval_count = interval_count
427
+ end
428
+ end
429
+ # Time span for the redeemed discount.
430
+ attr_accessor :duration
431
+ # A precise Unix timestamp for the discount to end. Must be in the future.
432
+ attr_accessor :timestamp
433
+ # The type of calculation made to determine when the discount ends.
434
+ attr_accessor :type
435
+
436
+ def initialize(duration: nil, timestamp: nil, type: nil)
437
+ @duration = duration
438
+ @timestamp = timestamp
439
+ @type = type
440
+ end
441
+ end
357
442
  # ID of the coupon to create a new discount for.
358
443
  attr_accessor :coupon
359
444
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
360
445
  attr_accessor :discount
446
+ # Details to determine how long the discount should be applied for.
447
+ attr_accessor :discount_end
361
448
  # ID of the promotion code to create a new discount for.
362
449
  attr_accessor :promotion_code
363
450
 
364
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
451
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
365
452
  @coupon = coupon
366
453
  @discount = discount
454
+ @discount_end = discount_end
367
455
  @promotion_code = promotion_code
368
456
  end
369
457
  end
@@ -409,6 +497,18 @@ module Stripe
409
497
  @unit_amount_decimal = unit_amount_decimal
410
498
  end
411
499
  end
500
+
501
+ class Trial < Stripe::RequestParams
502
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
503
+ attr_accessor :converts_to
504
+ # Determines the type of trial for this item.
505
+ attr_accessor :type
506
+
507
+ def initialize(converts_to: nil, type: nil)
508
+ @converts_to = converts_to
509
+ @type = type
510
+ end
511
+ end
412
512
  # The coupons to redeem into discounts for the subscription item.
413
513
  attr_accessor :discounts
414
514
  # 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`.
@@ -423,6 +523,8 @@ module Stripe
423
523
  attr_accessor :quantity
424
524
  # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
425
525
  attr_accessor :tax_rates
526
+ # Options that configure the trial on the subscription item.
527
+ attr_accessor :trial
426
528
 
427
529
  def initialize(
428
530
  discounts: nil,
@@ -431,7 +533,8 @@ module Stripe
431
533
  price: nil,
432
534
  price_data: nil,
433
535
  quantity: nil,
434
- tax_rates: nil
536
+ tax_rates: nil,
537
+ trial: nil
435
538
  )
436
539
  @discounts = discounts
437
540
  @metadata = metadata
@@ -440,6 +543,16 @@ module Stripe
440
543
  @price_data = price_data
441
544
  @quantity = quantity
442
545
  @tax_rates = tax_rates
546
+ @trial = trial
547
+ end
548
+ end
549
+
550
+ class PauseCollection < Stripe::RequestParams
551
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
552
+ attr_accessor :behavior
553
+
554
+ def initialize(behavior: nil)
555
+ @behavior = behavior
443
556
  end
444
557
  end
445
558
 
@@ -454,6 +567,23 @@ module Stripe
454
567
  @destination = destination
455
568
  end
456
569
  end
570
+
571
+ class TrialSettings < Stripe::RequestParams
572
+ class EndBehavior < Stripe::RequestParams
573
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
574
+ attr_accessor :prorate_up_front
575
+
576
+ def initialize(prorate_up_front: nil)
577
+ @prorate_up_front = prorate_up_front
578
+ end
579
+ end
580
+ # Defines how the subscription should behave when a trial ends.
581
+ attr_accessor :end_behavior
582
+
583
+ def initialize(end_behavior: nil)
584
+ @end_behavior = end_behavior
585
+ end
586
+ end
457
587
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
458
588
  attr_accessor :add_invoice_items
459
589
  # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -486,14 +616,20 @@ module Stripe
486
616
  attr_accessor :metadata
487
617
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
488
618
  attr_accessor :on_behalf_of
619
+ # 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).
620
+ attr_accessor :pause_collection
489
621
  # 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.
490
622
  attr_accessor :proration_behavior
491
623
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
492
624
  attr_accessor :transfer_data
493
625
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
494
626
  attr_accessor :trial
627
+ # Specify trial behavior when crossing phase boundaries
628
+ attr_accessor :trial_continuation
495
629
  # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
496
630
  attr_accessor :trial_end
631
+ # Settings related to subscription trials.
632
+ attr_accessor :trial_settings
497
633
 
498
634
  def initialize(
499
635
  add_invoice_items: nil,
@@ -512,10 +648,13 @@ module Stripe
512
648
  iterations: nil,
513
649
  metadata: nil,
514
650
  on_behalf_of: nil,
651
+ pause_collection: nil,
515
652
  proration_behavior: nil,
516
653
  transfer_data: nil,
517
654
  trial: nil,
518
- trial_end: nil
655
+ trial_continuation: nil,
656
+ trial_end: nil,
657
+ trial_settings: nil
519
658
  )
520
659
  @add_invoice_items = add_invoice_items
521
660
  @application_fee_percent = application_fee_percent
@@ -533,14 +672,35 @@ module Stripe
533
672
  @iterations = iterations
534
673
  @metadata = metadata
535
674
  @on_behalf_of = on_behalf_of
675
+ @pause_collection = pause_collection
536
676
  @proration_behavior = proration_behavior
537
677
  @transfer_data = transfer_data
538
678
  @trial = trial
679
+ @trial_continuation = trial_continuation
539
680
  @trial_end = trial_end
681
+ @trial_settings = trial_settings
682
+ end
683
+ end
684
+
685
+ class Prebilling < Stripe::RequestParams
686
+ # This is used to determine the number of billing cycles to prebill.
687
+ attr_accessor :iterations
688
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
689
+ attr_accessor :update_behavior
690
+
691
+ def initialize(iterations: nil, update_behavior: nil)
692
+ @iterations = iterations
693
+ @update_behavior = update_behavior
540
694
  end
541
695
  end
696
+ # 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.
697
+ attr_accessor :billing_behavior
698
+ # 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`.
699
+ attr_accessor :billing_mode
542
700
  # The identifier of the customer to create the subscription schedule for.
543
701
  attr_accessor :customer
702
+ # The identifier of the account to create the subscription schedule for.
703
+ attr_accessor :customer_account
544
704
  # Object representing the subscription schedule's default settings.
545
705
  attr_accessor :default_settings
546
706
  # 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.
@@ -553,26 +713,36 @@ module Stripe
553
713
  attr_accessor :metadata
554
714
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
555
715
  attr_accessor :phases
716
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
717
+ attr_accessor :prebilling
556
718
  # When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
557
719
  attr_accessor :start_date
558
720
 
559
721
  def initialize(
722
+ billing_behavior: nil,
723
+ billing_mode: nil,
560
724
  customer: nil,
725
+ customer_account: nil,
561
726
  default_settings: nil,
562
727
  end_behavior: nil,
563
728
  expand: nil,
564
729
  from_subscription: nil,
565
730
  metadata: nil,
566
731
  phases: nil,
732
+ prebilling: nil,
567
733
  start_date: nil
568
734
  )
735
+ @billing_behavior = billing_behavior
736
+ @billing_mode = billing_mode
569
737
  @customer = customer
738
+ @customer_account = customer_account
570
739
  @default_settings = default_settings
571
740
  @end_behavior = end_behavior
572
741
  @expand = expand
573
742
  @from_subscription = from_subscription
574
743
  @metadata = metadata
575
744
  @phases = phases
745
+ @prebilling = prebilling
576
746
  @start_date = start_date
577
747
  end
578
748
  end
@@ -693,16 +863,44 @@ module Stripe
693
863
  class Phase < Stripe::RequestParams
694
864
  class AddInvoiceItem < Stripe::RequestParams
695
865
  class Discount < Stripe::RequestParams
866
+ class DiscountEnd < Stripe::RequestParams
867
+ class Duration < Stripe::RequestParams
868
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
869
+ attr_accessor :interval
870
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
871
+ attr_accessor :interval_count
872
+
873
+ def initialize(interval: nil, interval_count: nil)
874
+ @interval = interval
875
+ @interval_count = interval_count
876
+ end
877
+ end
878
+ # Time span for the redeemed discount.
879
+ attr_accessor :duration
880
+ # A precise Unix timestamp for the discount to end. Must be in the future.
881
+ attr_accessor :timestamp
882
+ # The type of calculation made to determine when the discount ends.
883
+ attr_accessor :type
884
+
885
+ def initialize(duration: nil, timestamp: nil, type: nil)
886
+ @duration = duration
887
+ @timestamp = timestamp
888
+ @type = type
889
+ end
890
+ end
696
891
  # ID of the coupon to create a new discount for.
697
892
  attr_accessor :coupon
698
893
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
699
894
  attr_accessor :discount
895
+ # Details to determine how long the discount should be applied for.
896
+ attr_accessor :discount_end
700
897
  # ID of the promotion code to create a new discount for.
701
898
  attr_accessor :promotion_code
702
899
 
703
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
900
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
704
901
  @coupon = coupon
705
902
  @discount = discount
903
+ @discount_end = discount_end
706
904
  @promotion_code = promotion_code
707
905
  end
708
906
  end
@@ -777,16 +975,44 @@ module Stripe
777
975
  end
778
976
 
779
977
  class Discount < Stripe::RequestParams
978
+ class DiscountEnd < Stripe::RequestParams
979
+ class Duration < Stripe::RequestParams
980
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
981
+ attr_accessor :interval
982
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
983
+ attr_accessor :interval_count
984
+
985
+ def initialize(interval: nil, interval_count: nil)
986
+ @interval = interval
987
+ @interval_count = interval_count
988
+ end
989
+ end
990
+ # Time span for the redeemed discount.
991
+ attr_accessor :duration
992
+ # A precise Unix timestamp for the discount to end. Must be in the future.
993
+ attr_accessor :timestamp
994
+ # The type of calculation made to determine when the discount ends.
995
+ attr_accessor :type
996
+
997
+ def initialize(duration: nil, timestamp: nil, type: nil)
998
+ @duration = duration
999
+ @timestamp = timestamp
1000
+ @type = type
1001
+ end
1002
+ end
780
1003
  # ID of the coupon to create a new discount for.
781
1004
  attr_accessor :coupon
782
1005
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
783
1006
  attr_accessor :discount
1007
+ # Details to determine how long the discount should be applied for.
1008
+ attr_accessor :discount_end
784
1009
  # ID of the promotion code to create a new discount for.
785
1010
  attr_accessor :promotion_code
786
1011
 
787
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1012
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
788
1013
  @coupon = coupon
789
1014
  @discount = discount
1015
+ @discount_end = discount_end
790
1016
  @promotion_code = promotion_code
791
1017
  end
792
1018
  end
@@ -819,16 +1045,44 @@ module Stripe
819
1045
 
820
1046
  class Item < Stripe::RequestParams
821
1047
  class Discount < Stripe::RequestParams
1048
+ class DiscountEnd < Stripe::RequestParams
1049
+ class Duration < Stripe::RequestParams
1050
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1051
+ attr_accessor :interval
1052
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1053
+ attr_accessor :interval_count
1054
+
1055
+ def initialize(interval: nil, interval_count: nil)
1056
+ @interval = interval
1057
+ @interval_count = interval_count
1058
+ end
1059
+ end
1060
+ # Time span for the redeemed discount.
1061
+ attr_accessor :duration
1062
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1063
+ attr_accessor :timestamp
1064
+ # The type of calculation made to determine when the discount ends.
1065
+ attr_accessor :type
1066
+
1067
+ def initialize(duration: nil, timestamp: nil, type: nil)
1068
+ @duration = duration
1069
+ @timestamp = timestamp
1070
+ @type = type
1071
+ end
1072
+ end
822
1073
  # ID of the coupon to create a new discount for.
823
1074
  attr_accessor :coupon
824
1075
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
825
1076
  attr_accessor :discount
1077
+ # Details to determine how long the discount should be applied for.
1078
+ attr_accessor :discount_end
826
1079
  # ID of the promotion code to create a new discount for.
827
1080
  attr_accessor :promotion_code
828
1081
 
829
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1082
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
830
1083
  @coupon = coupon
831
1084
  @discount = discount
1085
+ @discount_end = discount_end
832
1086
  @promotion_code = promotion_code
833
1087
  end
834
1088
  end
@@ -874,6 +1128,18 @@ module Stripe
874
1128
  @unit_amount_decimal = unit_amount_decimal
875
1129
  end
876
1130
  end
1131
+
1132
+ class Trial < Stripe::RequestParams
1133
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1134
+ attr_accessor :converts_to
1135
+ # Determines the type of trial for this item.
1136
+ attr_accessor :type
1137
+
1138
+ def initialize(converts_to: nil, type: nil)
1139
+ @converts_to = converts_to
1140
+ @type = type
1141
+ end
1142
+ end
877
1143
  # The coupons to redeem into discounts for the subscription item.
878
1144
  attr_accessor :discounts
879
1145
  # 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`.
@@ -888,6 +1154,8 @@ module Stripe
888
1154
  attr_accessor :quantity
889
1155
  # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
890
1156
  attr_accessor :tax_rates
1157
+ # Options that configure the trial on the subscription item.
1158
+ attr_accessor :trial
891
1159
 
892
1160
  def initialize(
893
1161
  discounts: nil,
@@ -896,7 +1164,8 @@ module Stripe
896
1164
  price: nil,
897
1165
  price_data: nil,
898
1166
  quantity: nil,
899
- tax_rates: nil
1167
+ tax_rates: nil,
1168
+ trial: nil
900
1169
  )
901
1170
  @discounts = discounts
902
1171
  @metadata = metadata
@@ -905,6 +1174,16 @@ module Stripe
905
1174
  @price_data = price_data
906
1175
  @quantity = quantity
907
1176
  @tax_rates = tax_rates
1177
+ @trial = trial
1178
+ end
1179
+ end
1180
+
1181
+ class PauseCollection < Stripe::RequestParams
1182
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1183
+ attr_accessor :behavior
1184
+
1185
+ def initialize(behavior: nil)
1186
+ @behavior = behavior
908
1187
  end
909
1188
  end
910
1189
 
@@ -919,6 +1198,23 @@ module Stripe
919
1198
  @destination = destination
920
1199
  end
921
1200
  end
1201
+
1202
+ class TrialSettings < Stripe::RequestParams
1203
+ class EndBehavior < Stripe::RequestParams
1204
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1205
+ attr_accessor :prorate_up_front
1206
+
1207
+ def initialize(prorate_up_front: nil)
1208
+ @prorate_up_front = prorate_up_front
1209
+ end
1210
+ end
1211
+ # Defines how the subscription should behave when a trial ends.
1212
+ attr_accessor :end_behavior
1213
+
1214
+ def initialize(end_behavior: nil)
1215
+ @end_behavior = end_behavior
1216
+ end
1217
+ end
922
1218
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
923
1219
  attr_accessor :add_invoice_items
924
1220
  # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -951,6 +1247,8 @@ module Stripe
951
1247
  attr_accessor :metadata
952
1248
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
953
1249
  attr_accessor :on_behalf_of
1250
+ # 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).
1251
+ attr_accessor :pause_collection
954
1252
  # 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.
955
1253
  attr_accessor :proration_behavior
956
1254
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -959,8 +1257,12 @@ module Stripe
959
1257
  attr_accessor :transfer_data
960
1258
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
961
1259
  attr_accessor :trial
1260
+ # Specify trial behavior when crossing phase boundaries
1261
+ attr_accessor :trial_continuation
962
1262
  # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
963
1263
  attr_accessor :trial_end
1264
+ # Settings related to subscription trials.
1265
+ attr_accessor :trial_settings
964
1266
 
965
1267
  def initialize(
966
1268
  add_invoice_items: nil,
@@ -979,11 +1281,14 @@ module Stripe
979
1281
  iterations: nil,
980
1282
  metadata: nil,
981
1283
  on_behalf_of: nil,
1284
+ pause_collection: nil,
982
1285
  proration_behavior: nil,
983
1286
  start_date: nil,
984
1287
  transfer_data: nil,
985
1288
  trial: nil,
986
- trial_end: nil
1289
+ trial_continuation: nil,
1290
+ trial_end: nil,
1291
+ trial_settings: nil
987
1292
  )
988
1293
  @add_invoice_items = add_invoice_items
989
1294
  @application_fee_percent = application_fee_percent
@@ -1001,13 +1306,30 @@ module Stripe
1001
1306
  @iterations = iterations
1002
1307
  @metadata = metadata
1003
1308
  @on_behalf_of = on_behalf_of
1309
+ @pause_collection = pause_collection
1004
1310
  @proration_behavior = proration_behavior
1005
1311
  @start_date = start_date
1006
1312
  @transfer_data = transfer_data
1007
1313
  @trial = trial
1314
+ @trial_continuation = trial_continuation
1008
1315
  @trial_end = trial_end
1316
+ @trial_settings = trial_settings
1317
+ end
1318
+ end
1319
+
1320
+ class Prebilling < Stripe::RequestParams
1321
+ # This is used to determine the number of billing cycles to prebill.
1322
+ attr_accessor :iterations
1323
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1324
+ attr_accessor :update_behavior
1325
+
1326
+ def initialize(iterations: nil, update_behavior: nil)
1327
+ @iterations = iterations
1328
+ @update_behavior = update_behavior
1009
1329
  end
1010
1330
  end
1331
+ # 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.
1332
+ attr_accessor :billing_behavior
1011
1333
  # Object representing the subscription schedule's default settings.
1012
1334
  attr_accessor :default_settings
1013
1335
  # 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.
@@ -1018,26 +1340,598 @@ module Stripe
1018
1340
  attr_accessor :metadata
1019
1341
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted.
1020
1342
  attr_accessor :phases
1343
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1344
+ attr_accessor :prebilling
1021
1345
  # If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1022
1346
  attr_accessor :proration_behavior
1023
1347
 
1024
1348
  def initialize(
1349
+ billing_behavior: nil,
1025
1350
  default_settings: nil,
1026
1351
  end_behavior: nil,
1027
1352
  expand: nil,
1028
1353
  metadata: nil,
1029
1354
  phases: nil,
1355
+ prebilling: nil,
1030
1356
  proration_behavior: nil
1031
1357
  )
1358
+ @billing_behavior = billing_behavior
1032
1359
  @default_settings = default_settings
1033
1360
  @end_behavior = end_behavior
1034
1361
  @expand = expand
1035
1362
  @metadata = metadata
1036
1363
  @phases = phases
1364
+ @prebilling = prebilling
1037
1365
  @proration_behavior = proration_behavior
1038
1366
  end
1039
1367
  end
1040
1368
 
1369
+ class AmendParams < Stripe::RequestParams
1370
+ class Amendment < Stripe::RequestParams
1371
+ class AmendmentEnd < Stripe::RequestParams
1372
+ class DiscountEnd < Stripe::RequestParams
1373
+ # The ID of a specific discount.
1374
+ attr_accessor :discount
1375
+
1376
+ def initialize(discount: nil)
1377
+ @discount = discount
1378
+ end
1379
+ end
1380
+
1381
+ class Duration < Stripe::RequestParams
1382
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1383
+ attr_accessor :interval
1384
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1385
+ attr_accessor :interval_count
1386
+
1387
+ def initialize(interval: nil, interval_count: nil)
1388
+ @interval = interval
1389
+ @interval_count = interval_count
1390
+ end
1391
+ end
1392
+ # Use the `end` time of a given discount.
1393
+ attr_accessor :discount_end
1394
+ # Time span for the amendment starting from the `amendment_start`.
1395
+ attr_accessor :duration
1396
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1397
+ attr_accessor :timestamp
1398
+ # Select one of three ways to pass the `amendment_end`.
1399
+ attr_accessor :type
1400
+
1401
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1402
+ @discount_end = discount_end
1403
+ @duration = duration
1404
+ @timestamp = timestamp
1405
+ @type = type
1406
+ end
1407
+ end
1408
+
1409
+ class AmendmentStart < Stripe::RequestParams
1410
+ class AmendmentEnd < Stripe::RequestParams
1411
+ # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
1412
+ attr_accessor :index
1413
+
1414
+ def initialize(index: nil)
1415
+ @index = index
1416
+ end
1417
+ end
1418
+
1419
+ class DiscountEnd < Stripe::RequestParams
1420
+ # The ID of a specific discount.
1421
+ attr_accessor :discount
1422
+
1423
+ def initialize(discount: nil)
1424
+ @discount = discount
1425
+ end
1426
+ end
1427
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
1428
+ attr_accessor :amendment_end
1429
+ # Use the `end` time of a given discount.
1430
+ attr_accessor :discount_end
1431
+ # A precise Unix timestamp for the amendment to start.
1432
+ attr_accessor :timestamp
1433
+ # Select one of three ways to pass the `amendment_start`.
1434
+ attr_accessor :type
1435
+
1436
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
1437
+ @amendment_end = amendment_end
1438
+ @discount_end = discount_end
1439
+ @timestamp = timestamp
1440
+ @type = type
1441
+ end
1442
+ end
1443
+
1444
+ class DiscountAction < Stripe::RequestParams
1445
+ class Add < Stripe::RequestParams
1446
+ class DiscountEnd < Stripe::RequestParams
1447
+ # The type of calculation made to determine when the discount ends.
1448
+ attr_accessor :type
1449
+
1450
+ def initialize(type: nil)
1451
+ @type = type
1452
+ end
1453
+ end
1454
+ # The coupon code to redeem.
1455
+ attr_accessor :coupon
1456
+ # An ID of an existing discount for a coupon that was already redeemed.
1457
+ attr_accessor :discount
1458
+ # Details to determine how long the discount should be applied for.
1459
+ attr_accessor :discount_end
1460
+ # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
1461
+ attr_accessor :index
1462
+ # The promotion code to redeem.
1463
+ attr_accessor :promotion_code
1464
+
1465
+ def initialize(
1466
+ coupon: nil,
1467
+ discount: nil,
1468
+ discount_end: nil,
1469
+ index: nil,
1470
+ promotion_code: nil
1471
+ )
1472
+ @coupon = coupon
1473
+ @discount = discount
1474
+ @discount_end = discount_end
1475
+ @index = index
1476
+ @promotion_code = promotion_code
1477
+ end
1478
+ end
1479
+
1480
+ class Remove < Stripe::RequestParams
1481
+ # The coupon code to remove from the `discounts` array.
1482
+ attr_accessor :coupon
1483
+ # The ID of a discount to remove from the `discounts` array.
1484
+ attr_accessor :discount
1485
+ # The ID of a promotion code to remove from the `discounts` array.
1486
+ attr_accessor :promotion_code
1487
+
1488
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1489
+ @coupon = coupon
1490
+ @discount = discount
1491
+ @promotion_code = promotion_code
1492
+ end
1493
+ end
1494
+
1495
+ class Set < Stripe::RequestParams
1496
+ # The coupon code to replace the `discounts` array with.
1497
+ attr_accessor :coupon
1498
+ # An ID of an existing discount to replace the `discounts` array with.
1499
+ attr_accessor :discount
1500
+ # An ID of an existing promotion code to replace the `discounts` array with.
1501
+ attr_accessor :promotion_code
1502
+
1503
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1504
+ @coupon = coupon
1505
+ @discount = discount
1506
+ @promotion_code = promotion_code
1507
+ end
1508
+ end
1509
+ # Details of the discount to add.
1510
+ attr_accessor :add
1511
+ # Details of the discount to remove.
1512
+ attr_accessor :remove
1513
+ # Details of the discount to replace the existing discounts with.
1514
+ attr_accessor :set
1515
+ # Determines the type of discount action.
1516
+ attr_accessor :type
1517
+
1518
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1519
+ @add = add
1520
+ @remove = remove
1521
+ @set = set
1522
+ @type = type
1523
+ end
1524
+ end
1525
+
1526
+ class ItemAction < Stripe::RequestParams
1527
+ class Add < Stripe::RequestParams
1528
+ class Discount < Stripe::RequestParams
1529
+ class DiscountEnd < Stripe::RequestParams
1530
+ class Duration < Stripe::RequestParams
1531
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1532
+ attr_accessor :interval
1533
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1534
+ attr_accessor :interval_count
1535
+
1536
+ def initialize(interval: nil, interval_count: nil)
1537
+ @interval = interval
1538
+ @interval_count = interval_count
1539
+ end
1540
+ end
1541
+ # Time span for the redeemed discount.
1542
+ attr_accessor :duration
1543
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1544
+ attr_accessor :timestamp
1545
+ # The type of calculation made to determine when the discount ends.
1546
+ attr_accessor :type
1547
+
1548
+ def initialize(duration: nil, timestamp: nil, type: nil)
1549
+ @duration = duration
1550
+ @timestamp = timestamp
1551
+ @type = type
1552
+ end
1553
+ end
1554
+ # ID of the coupon to create a new discount for.
1555
+ attr_accessor :coupon
1556
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1557
+ attr_accessor :discount
1558
+ # Details to determine how long the discount should be applied for.
1559
+ attr_accessor :discount_end
1560
+ # ID of the promotion code to create a new discount for.
1561
+ attr_accessor :promotion_code
1562
+
1563
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1564
+ @coupon = coupon
1565
+ @discount = discount
1566
+ @discount_end = discount_end
1567
+ @promotion_code = promotion_code
1568
+ end
1569
+ end
1570
+
1571
+ class Trial < Stripe::RequestParams
1572
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1573
+ attr_accessor :converts_to
1574
+ # Determines the type of trial for this item.
1575
+ attr_accessor :type
1576
+
1577
+ def initialize(converts_to: nil, type: nil)
1578
+ @converts_to = converts_to
1579
+ @type = type
1580
+ end
1581
+ end
1582
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1583
+ attr_accessor :discounts
1584
+ # 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`.
1585
+ attr_accessor :metadata
1586
+ # The ID of the price object.
1587
+ attr_accessor :price
1588
+ # Quantity for this item.
1589
+ attr_accessor :quantity
1590
+ # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
1591
+ attr_accessor :tax_rates
1592
+ # Options that configure the trial on the subscription item.
1593
+ attr_accessor :trial
1594
+
1595
+ def initialize(
1596
+ discounts: nil,
1597
+ metadata: nil,
1598
+ price: nil,
1599
+ quantity: nil,
1600
+ tax_rates: nil,
1601
+ trial: nil
1602
+ )
1603
+ @discounts = discounts
1604
+ @metadata = metadata
1605
+ @price = price
1606
+ @quantity = quantity
1607
+ @tax_rates = tax_rates
1608
+ @trial = trial
1609
+ end
1610
+ end
1611
+
1612
+ class Remove < Stripe::RequestParams
1613
+ # ID of a price to remove.
1614
+ attr_accessor :price
1615
+
1616
+ def initialize(price: nil)
1617
+ @price = price
1618
+ end
1619
+ end
1620
+
1621
+ class Set < Stripe::RequestParams
1622
+ class Discount < Stripe::RequestParams
1623
+ class DiscountEnd < Stripe::RequestParams
1624
+ class Duration < Stripe::RequestParams
1625
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1626
+ attr_accessor :interval
1627
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1628
+ attr_accessor :interval_count
1629
+
1630
+ def initialize(interval: nil, interval_count: nil)
1631
+ @interval = interval
1632
+ @interval_count = interval_count
1633
+ end
1634
+ end
1635
+ # Time span for the redeemed discount.
1636
+ attr_accessor :duration
1637
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1638
+ attr_accessor :timestamp
1639
+ # The type of calculation made to determine when the discount ends.
1640
+ attr_accessor :type
1641
+
1642
+ def initialize(duration: nil, timestamp: nil, type: nil)
1643
+ @duration = duration
1644
+ @timestamp = timestamp
1645
+ @type = type
1646
+ end
1647
+ end
1648
+ # ID of the coupon to create a new discount for.
1649
+ attr_accessor :coupon
1650
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1651
+ attr_accessor :discount
1652
+ # Details to determine how long the discount should be applied for.
1653
+ attr_accessor :discount_end
1654
+ # ID of the promotion code to create a new discount for.
1655
+ attr_accessor :promotion_code
1656
+
1657
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1658
+ @coupon = coupon
1659
+ @discount = discount
1660
+ @discount_end = discount_end
1661
+ @promotion_code = promotion_code
1662
+ end
1663
+ end
1664
+
1665
+ class Trial < Stripe::RequestParams
1666
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1667
+ attr_accessor :converts_to
1668
+ # Determines the type of trial for this item.
1669
+ attr_accessor :type
1670
+
1671
+ def initialize(converts_to: nil, type: nil)
1672
+ @converts_to = converts_to
1673
+ @type = type
1674
+ end
1675
+ end
1676
+ # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
1677
+ attr_accessor :discounts
1678
+ # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
1679
+ attr_accessor :metadata
1680
+ # The ID of the price object.
1681
+ attr_accessor :price
1682
+ # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
1683
+ attr_accessor :quantity
1684
+ # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
1685
+ attr_accessor :tax_rates
1686
+ # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
1687
+ attr_accessor :trial
1688
+
1689
+ def initialize(
1690
+ discounts: nil,
1691
+ metadata: nil,
1692
+ price: nil,
1693
+ quantity: nil,
1694
+ tax_rates: nil,
1695
+ trial: nil
1696
+ )
1697
+ @discounts = discounts
1698
+ @metadata = metadata
1699
+ @price = price
1700
+ @quantity = quantity
1701
+ @tax_rates = tax_rates
1702
+ @trial = trial
1703
+ end
1704
+ end
1705
+ # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
1706
+ attr_accessor :add
1707
+ # Details of the subscription item to remove.
1708
+ attr_accessor :remove
1709
+ # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
1710
+ attr_accessor :set
1711
+ # Determines the type of item action.
1712
+ attr_accessor :type
1713
+
1714
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1715
+ @add = add
1716
+ @remove = remove
1717
+ @set = set
1718
+ @type = type
1719
+ end
1720
+ end
1721
+
1722
+ class MetadataAction < Stripe::RequestParams
1723
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
1724
+ attr_accessor :add
1725
+ # Keys to remove from schedule phase metadata.
1726
+ attr_accessor :remove
1727
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
1728
+ attr_accessor :set
1729
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
1730
+ attr_accessor :type
1731
+
1732
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1733
+ @add = add
1734
+ @remove = remove
1735
+ @set = set
1736
+ @type = type
1737
+ end
1738
+ end
1739
+
1740
+ class SetPauseCollection < Stripe::RequestParams
1741
+ class Set < Stripe::RequestParams
1742
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1743
+ attr_accessor :behavior
1744
+
1745
+ def initialize(behavior: nil)
1746
+ @behavior = behavior
1747
+ end
1748
+ end
1749
+ # Details of the pause_collection behavior to apply to the amendment.
1750
+ attr_accessor :set
1751
+ # Determines the type of the pause_collection amendment.
1752
+ attr_accessor :type
1753
+
1754
+ def initialize(set: nil, type: nil)
1755
+ @set = set
1756
+ @type = type
1757
+ end
1758
+ end
1759
+
1760
+ class TrialSettings < Stripe::RequestParams
1761
+ class EndBehavior < Stripe::RequestParams
1762
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1763
+ attr_accessor :prorate_up_front
1764
+
1765
+ def initialize(prorate_up_front: nil)
1766
+ @prorate_up_front = prorate_up_front
1767
+ end
1768
+ end
1769
+ # Defines how the subscription should behave when a trial ends.
1770
+ attr_accessor :end_behavior
1771
+
1772
+ def initialize(end_behavior: nil)
1773
+ @end_behavior = end_behavior
1774
+ end
1775
+ end
1776
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
1777
+ attr_accessor :amendment_end
1778
+ # Details to identify the earliest timestamp where the proposed change should take effect.
1779
+ attr_accessor :amendment_start
1780
+ # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
1781
+ attr_accessor :billing_cycle_anchor
1782
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1783
+ attr_accessor :discount_actions
1784
+ # Changes to the subscription items during the amendment time span.
1785
+ attr_accessor :item_actions
1786
+ # Instructions for how to modify phase metadata
1787
+ attr_accessor :metadata_actions
1788
+ # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
1789
+ attr_accessor :proration_behavior
1790
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1791
+ attr_accessor :set_pause_collection
1792
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1793
+ attr_accessor :set_schedule_end
1794
+ # Settings related to subscription trials.
1795
+ attr_accessor :trial_settings
1796
+
1797
+ def initialize(
1798
+ amendment_end: nil,
1799
+ amendment_start: nil,
1800
+ billing_cycle_anchor: nil,
1801
+ discount_actions: nil,
1802
+ item_actions: nil,
1803
+ metadata_actions: nil,
1804
+ proration_behavior: nil,
1805
+ set_pause_collection: nil,
1806
+ set_schedule_end: nil,
1807
+ trial_settings: nil
1808
+ )
1809
+ @amendment_end = amendment_end
1810
+ @amendment_start = amendment_start
1811
+ @billing_cycle_anchor = billing_cycle_anchor
1812
+ @discount_actions = discount_actions
1813
+ @item_actions = item_actions
1814
+ @metadata_actions = metadata_actions
1815
+ @proration_behavior = proration_behavior
1816
+ @set_pause_collection = set_pause_collection
1817
+ @set_schedule_end = set_schedule_end
1818
+ @trial_settings = trial_settings
1819
+ end
1820
+ end
1821
+
1822
+ class Prebilling < Stripe::RequestParams
1823
+ class BillFrom < Stripe::RequestParams
1824
+ class AmendmentStart < Stripe::RequestParams
1825
+ # The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
1826
+ attr_accessor :index
1827
+
1828
+ def initialize(index: nil)
1829
+ @index = index
1830
+ end
1831
+ end
1832
+ # Start the prebilled period when a specified amendment begins.
1833
+ attr_accessor :amendment_start
1834
+ # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1835
+ attr_accessor :timestamp
1836
+ # Select one of several ways to pass the `bill_from` value.
1837
+ attr_accessor :type
1838
+
1839
+ def initialize(amendment_start: nil, timestamp: nil, type: nil)
1840
+ @amendment_start = amendment_start
1841
+ @timestamp = timestamp
1842
+ @type = type
1843
+ end
1844
+ end
1845
+
1846
+ class BillUntil < Stripe::RequestParams
1847
+ class AmendmentEnd < Stripe::RequestParams
1848
+ # The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
1849
+ attr_accessor :index
1850
+
1851
+ def initialize(index: nil)
1852
+ @index = index
1853
+ end
1854
+ end
1855
+
1856
+ class Duration < Stripe::RequestParams
1857
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1858
+ attr_accessor :interval
1859
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1860
+ attr_accessor :interval_count
1861
+
1862
+ def initialize(interval: nil, interval_count: nil)
1863
+ @interval = interval
1864
+ @interval_count = interval_count
1865
+ end
1866
+ end
1867
+ # End the prebilled period when a specified amendment ends.
1868
+ attr_accessor :amendment_end
1869
+ # Time span for prebilling, starting from `bill_from`.
1870
+ attr_accessor :duration
1871
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1872
+ attr_accessor :timestamp
1873
+ # Select one of several ways to pass the `bill_until` value.
1874
+ attr_accessor :type
1875
+
1876
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
1877
+ @amendment_end = amendment_end
1878
+ @duration = duration
1879
+ @timestamp = timestamp
1880
+ @type = type
1881
+ end
1882
+ end
1883
+ # The beginning of the prebilled time period. The default value is `now`.
1884
+ attr_accessor :bill_from
1885
+ # The end of the prebilled time period.
1886
+ attr_accessor :bill_until
1887
+ # When the prebilling invoice should be created. The default value is `now`.
1888
+ attr_accessor :invoice_at
1889
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1890
+ attr_accessor :update_behavior
1891
+
1892
+ def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
1893
+ @bill_from = bill_from
1894
+ @bill_until = bill_until
1895
+ @invoice_at = invoice_at
1896
+ @update_behavior = update_behavior
1897
+ end
1898
+ end
1899
+
1900
+ class ScheduleSettings < Stripe::RequestParams
1901
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1902
+ attr_accessor :end_behavior
1903
+
1904
+ def initialize(end_behavior: nil)
1905
+ @end_behavior = end_behavior
1906
+ end
1907
+ end
1908
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
1909
+ attr_accessor :amendments
1910
+ # Specifies which fields in the response should be expanded.
1911
+ attr_accessor :expand
1912
+ # Provide any time periods to bill in advance.
1913
+ attr_accessor :prebilling
1914
+ # In cases where the amendment changes the currently active phase,
1915
+ # specifies if and how to prorate at the time of the request.
1916
+ attr_accessor :proration_behavior
1917
+ # Changes to apply to the subscription schedule.
1918
+ attr_accessor :schedule_settings
1919
+
1920
+ def initialize(
1921
+ amendments: nil,
1922
+ expand: nil,
1923
+ prebilling: nil,
1924
+ proration_behavior: nil,
1925
+ schedule_settings: nil
1926
+ )
1927
+ @amendments = amendments
1928
+ @expand = expand
1929
+ @prebilling = prebilling
1930
+ @proration_behavior = proration_behavior
1931
+ @schedule_settings = schedule_settings
1932
+ end
1933
+ end
1934
+
1041
1935
  class CancelParams < Stripe::RequestParams
1042
1936
  # Specifies which fields in the response should be expanded.
1043
1937
  attr_accessor :expand
@@ -1065,6 +1959,17 @@ module Stripe
1065
1959
  end
1066
1960
  end
1067
1961
 
1962
+ # Amends an existing subscription schedule.
1963
+ def amend(schedule, params = {}, opts = {})
1964
+ request(
1965
+ method: :post,
1966
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
1967
+ params: params,
1968
+ opts: opts,
1969
+ base_address: :api
1970
+ )
1971
+ end
1972
+
1068
1973
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
1069
1974
  def cancel(schedule, params = {}, opts = {})
1070
1975
  request(