stripe 15.4.0 → 15.5.0.pre.beta.2

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 (597) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1639 -662
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +32 -0
  7. data/lib/stripe/api_version.rb +1 -2
  8. data/lib/stripe/errors.rb +60 -0
  9. data/lib/stripe/event_types.rb +102 -0
  10. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  11. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  17. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
  19. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  23. data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
  24. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  25. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  26. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  27. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  30. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  53. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  58. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  59. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  60. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  61. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  62. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
  65. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  66. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  67. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  68. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  69. data/lib/stripe/object_types.rb +53 -0
  70. data/lib/stripe/resources/account.rb +653 -1
  71. data/lib/stripe/resources/account_notice.rb +123 -0
  72. data/lib/stripe/resources/account_session.rb +256 -1
  73. data/lib/stripe/resources/balance_settings.rb +105 -0
  74. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  75. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  76. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  77. data/lib/stripe/resources/billing/meter_usage.rb +23 -0
  78. data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
  79. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  80. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  81. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  82. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  83. data/lib/stripe/resources/card.rb +2 -0
  84. data/lib/stripe/resources/cash_balance.rb +2 -0
  85. data/lib/stripe/resources/charge.rb +1538 -0
  86. data/lib/stripe/resources/checkout/session.rb +399 -3
  87. data/lib/stripe/resources/confirmation_token.rb +170 -0
  88. data/lib/stripe/resources/coupon.rb +30 -1
  89. data/lib/stripe/resources/credit_note.rb +6 -0
  90. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  91. data/lib/stripe/resources/customer.rb +2 -0
  92. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  93. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  94. data/lib/stripe/resources/customer_session.rb +6 -1
  95. data/lib/stripe/resources/discount.rb +2 -0
  96. data/lib/stripe/resources/dispute.rb +11 -0
  97. data/lib/stripe/resources/event.rb +31 -0
  98. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  99. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  100. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  101. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  102. data/lib/stripe/resources/fx_quote.rb +186 -0
  103. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  104. data/lib/stripe/resources/invoice.rb +1140 -16
  105. data/lib/stripe/resources/invoice_item.rb +78 -2
  106. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  107. data/lib/stripe/resources/invoice_payment.rb +6 -1
  108. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  109. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  110. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  111. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  112. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  113. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  114. data/lib/stripe/resources/line_item.rb +37 -0
  115. data/lib/stripe/resources/mandate.rb +24 -0
  116. data/lib/stripe/resources/margin.rb +115 -0
  117. data/lib/stripe/resources/order.rb +2958 -0
  118. data/lib/stripe/resources/payment_attempt_record.rb +1101 -0
  119. data/lib/stripe/resources/payment_intent.rb +9469 -3712
  120. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  121. data/lib/stripe/resources/payment_method.rb +192 -1
  122. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  123. data/lib/stripe/resources/payment_record.rb +1630 -0
  124. data/lib/stripe/resources/payout.rb +6 -0
  125. data/lib/stripe/resources/price.rb +30 -0
  126. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  127. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  128. data/lib/stripe/resources/promotion_code.rb +10 -0
  129. data/lib/stripe/resources/quote.rb +2038 -7
  130. data/lib/stripe/resources/quote_line.rb +274 -0
  131. data/lib/stripe/resources/quote_preview_invoice.rb +680 -0
  132. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +371 -0
  133. data/lib/stripe/resources/refund.rb +9 -0
  134. data/lib/stripe/resources/setup_attempt.rb +21 -0
  135. data/lib/stripe/resources/setup_intent.rb +578 -9
  136. data/lib/stripe/resources/source.rb +29 -0
  137. data/lib/stripe/resources/subscription.rb +365 -9
  138. data/lib/stripe/resources/subscription_item.rb +84 -3
  139. data/lib/stripe/resources/subscription_schedule.rb +1007 -10
  140. data/lib/stripe/resources/tax/association.rb +66 -0
  141. data/lib/stripe/resources/tax/form.rb +211 -0
  142. data/lib/stripe/resources/tax_id.rb +12 -2
  143. data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
  144. data/lib/stripe/resources/terminal/reader.rb +8 -0
  145. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  146. data/lib/stripe/resources/transfer.rb +6 -0
  147. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  148. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  149. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  150. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  151. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  152. data/lib/stripe/resources/v2/core/account.rb +1930 -0
  153. data/lib/stripe/resources/v2/core/account_link.rb +72 -0
  154. data/lib/stripe/resources/v2/core/person.rb +276 -0
  155. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  156. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  157. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  158. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  159. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  160. data/lib/stripe/resources/v2/money_management/financial_account.rb +77 -0
  161. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  162. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  163. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  164. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  165. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  166. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  167. data/lib/stripe/resources/v2/money_management/payout_method.rb +77 -0
  168. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  169. data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
  170. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  171. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  172. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  173. data/lib/stripe/resources/v2/payments/off_session_payment.rb +89 -0
  174. data/lib/stripe/resources.rb +109 -0
  175. data/lib/stripe/services/account_notice_service.rb +101 -0
  176. data/lib/stripe/services/account_service.rb +562 -1
  177. data/lib/stripe/services/account_session_service.rb +226 -1
  178. data/lib/stripe/services/balance_settings_service.rb +96 -0
  179. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  180. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  181. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  182. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  183. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  184. data/lib/stripe/services/billing_service.rb +2 -1
  185. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  186. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  187. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  188. data/lib/stripe/services/capital_service.rb +15 -0
  189. data/lib/stripe/services/charge_service.rb +1418 -0
  190. data/lib/stripe/services/checkout/session_service.rb +316 -3
  191. data/lib/stripe/services/coupon_service.rb +17 -1
  192. data/lib/stripe/services/credit_note_service.rb +4 -0
  193. data/lib/stripe/services/customer_session_service.rb +4 -1
  194. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  195. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  196. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  197. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  198. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  199. data/lib/stripe/services/financial_connections_service.rb +2 -1
  200. data/lib/stripe/services/fx_quote_service.rb +123 -0
  201. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  202. data/lib/stripe/services/invoice_item_service.rb +74 -2
  203. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  204. data/lib/stripe/services/invoice_payment_service.rb +4 -1
  205. data/lib/stripe/services/invoice_service.rb +1074 -16
  206. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  207. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  208. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  209. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  210. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  211. data/lib/stripe/services/issuing_service.rb +5 -1
  212. data/lib/stripe/services/margin_service.rb +119 -0
  213. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  214. data/lib/stripe/services/order_service.rb +2388 -0
  215. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  216. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  217. data/lib/stripe/services/payment_intent_service.rb +5724 -435
  218. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  219. data/lib/stripe/services/payment_method_service.rb +120 -1
  220. data/lib/stripe/services/payment_record_service.rb +542 -0
  221. data/lib/stripe/services/payout_service.rb +4 -0
  222. data/lib/stripe/services/price_service.rb +19 -0
  223. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  224. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  225. data/lib/stripe/services/privacy_service.rb +13 -0
  226. data/lib/stripe/services/promotion_code_service.rb +8 -0
  227. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  228. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  229. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  230. data/lib/stripe/services/quote_service.rb +1723 -8
  231. data/lib/stripe/services/setup_intent_service.rb +538 -9
  232. data/lib/stripe/services/subscription_item_service.rb +75 -3
  233. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  234. data/lib/stripe/services/subscription_service.rb +309 -9
  235. data/lib/stripe/services/tax/association_service.rb +31 -0
  236. data/lib/stripe/services/tax/form_service.rb +100 -0
  237. data/lib/stripe/services/tax_id_service.rb +8 -2
  238. data/lib/stripe/services/tax_service.rb +3 -1
  239. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  240. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  241. data/lib/stripe/services/terminal_service.rb +3 -1
  242. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  243. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  244. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  245. data/lib/stripe/services/transfer_service.rb +4 -0
  246. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  247. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  248. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  249. data/lib/stripe/services/v1_services.rb +11 -1
  250. data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
  251. data/lib/stripe/services/v2/core/account_service.rb +4522 -0
  252. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  253. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  254. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  255. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  256. data/lib/stripe/services/v2/core_service.rb +4 -1
  257. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  258. data/lib/stripe/services/v2/money_management/financial_account_service.rb +116 -0
  259. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  260. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  261. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  262. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  263. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  264. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  265. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  266. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  267. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  268. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  269. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  270. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  271. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  272. data/lib/stripe/services/v2/payment_service.rb +15 -0
  273. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
  274. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  275. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
  276. data/lib/stripe/services/v2_services.rb +4 -1
  277. data/lib/stripe/services.rb +55 -0
  278. data/lib/stripe/stripe_configuration.rb +3 -1
  279. data/lib/stripe/stripe_object.rb +1 -1
  280. data/lib/stripe/util.rb +7 -1
  281. data/lib/stripe/version.rb +1 -1
  282. data/lib/stripe.rb +53 -0
  283. data/rbi/stripe.rbi +199145 -0
  284. data/stripe.gemspec +4 -1
  285. metadata +169 -324
  286. data/rbi/stripe/resources/account.rbi +0 -4995
  287. data/rbi/stripe/resources/account_link.rbi +0 -76
  288. data/rbi/stripe/resources/account_session.rbi +0 -1074
  289. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  290. data/rbi/stripe/resources/application.rbi +0 -20
  291. data/rbi/stripe/resources/application_fee.rbi +0 -118
  292. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  293. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  294. data/rbi/stripe/resources/balance.rbi +0 -235
  295. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  296. data/rbi/stripe/resources/bank_account.rbi +0 -127
  297. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  298. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  299. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  300. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  301. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  302. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  303. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  304. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  305. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  306. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -703
  307. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  308. data/rbi/stripe/resources/capability.rbi +0 -125
  309. data/rbi/stripe/resources/card.rbi +0 -125
  310. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  311. data/rbi/stripe/resources/charge.rbi +0 -2089
  312. data/rbi/stripe/resources/checkout/session.rbi +0 -4095
  313. data/rbi/stripe/resources/climate/order.rbi +0 -245
  314. data/rbi/stripe/resources/climate/product.rbi +0 -75
  315. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  316. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  317. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  318. data/rbi/stripe/resources/country_spec.rbi +0 -85
  319. data/rbi/stripe/resources/coupon.rbi +0 -250
  320. data/rbi/stripe/resources/credit_note.rbi +0 -752
  321. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  322. data/rbi/stripe/resources/customer.rbi +0 -1005
  323. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  324. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  325. data/rbi/stripe/resources/customer_session.rbi +0 -200
  326. data/rbi/stripe/resources/discount.rbi +0 -53
  327. data/rbi/stripe/resources/dispute.rbi +0 -761
  328. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  329. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  330. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  331. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  332. data/rbi/stripe/resources/event.rbi +0 -137
  333. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  334. data/rbi/stripe/resources/file.rbi +0 -143
  335. data/rbi/stripe/resources/file_link.rbi +0 -141
  336. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  337. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  338. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  339. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  340. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  341. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  342. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  343. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  344. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  345. data/rbi/stripe/resources/invoice.rbi +0 -3858
  346. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  347. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  348. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  349. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  350. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  351. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  352. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  353. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  354. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  355. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  356. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  357. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  358. data/rbi/stripe/resources/line_item.rbi +0 -72
  359. data/rbi/stripe/resources/login_link.rbi +0 -19
  360. data/rbi/stripe/resources/mandate.rbi +0 -191
  361. data/rbi/stripe/resources/payment_intent.rbi +0 -9997
  362. data/rbi/stripe/resources/payment_link.rbi +0 -1893
  363. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  364. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  365. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  366. data/rbi/stripe/resources/payout.rbi +0 -300
  367. data/rbi/stripe/resources/person.rbi +0 -401
  368. data/rbi/stripe/resources/plan.rbi +0 -371
  369. data/rbi/stripe/resources/price.rbi +0 -694
  370. data/rbi/stripe/resources/product.rbi +0 -555
  371. data/rbi/stripe/resources/product_feature.rbi +0 -26
  372. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  373. data/rbi/stripe/resources/quote.rbi +0 -1145
  374. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  375. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  376. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  377. data/rbi/stripe/resources/refund.rbi +0 -523
  378. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  379. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  380. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  381. data/rbi/stripe/resources/reversal.rbi +0 -51
  382. data/rbi/stripe/resources/review.rbi +0 -154
  383. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  384. data/rbi/stripe/resources/setup_intent.rbi +0 -3978
  385. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  386. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  387. data/rbi/stripe/resources/source.rbi +0 -1496
  388. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  389. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  390. data/rbi/stripe/resources/subscription.rbi +0 -2080
  391. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  392. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1673
  393. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  394. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  395. data/rbi/stripe/resources/tax/registration.rbi +0 -3216
  396. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  397. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  398. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  399. data/rbi/stripe/resources/tax_code.rbi +0 -44
  400. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  401. data/rbi/stripe/resources/tax_id.rbi +0 -165
  402. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  403. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1595
  404. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  405. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  406. data/rbi/stripe/resources/terminal/reader.rbi +0 -994
  407. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  408. data/rbi/stripe/resources/token.rbi +0 -1283
  409. data/rbi/stripe/resources/topup.rbi +0 -222
  410. data/rbi/stripe/resources/transfer.rbi +0 -199
  411. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  412. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  413. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  414. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  415. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  416. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  417. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  418. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  419. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  420. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  421. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  422. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  423. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  424. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  425. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  426. data/rbi/stripe/resources/v2/event.rbi +0 -48
  427. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  428. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  429. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  430. data/rbi/stripe/services/account_link_service.rbi +0 -60
  431. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  432. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  433. data/rbi/stripe/services/account_service.rbi +0 -4281
  434. data/rbi/stripe/services/account_session_service.rbi +0 -685
  435. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  436. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  437. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  438. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  439. data/rbi/stripe/services/apps_service.rbi +0 -9
  440. data/rbi/stripe/services/balance_service.rbi +0 -21
  441. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  442. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  443. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  444. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  445. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  446. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  447. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  448. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  449. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  450. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -555
  451. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  452. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  453. data/rbi/stripe/services/billing_service.rbi +0 -15
  454. data/rbi/stripe/services/charge_service.rbi +0 -448
  455. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  456. data/rbi/stripe/services/checkout/session_service.rbi +0 -2690
  457. data/rbi/stripe/services/checkout_service.rbi +0 -9
  458. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  459. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  460. data/rbi/stripe/services/climate_service.rbi +0 -11
  461. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  462. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  463. data/rbi/stripe/services/coupon_service.rbi +0 -194
  464. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  465. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  466. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  467. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  468. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  469. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  470. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  471. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  472. data/rbi/stripe/services/customer_service.rbi +0 -647
  473. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  474. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  475. data/rbi/stripe/services/dispute_service.rbi +0 -424
  476. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  477. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  478. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  479. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  480. data/rbi/stripe/services/event_service.rbi +0 -83
  481. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  482. data/rbi/stripe/services/file_link_service.rbi +0 -124
  483. data/rbi/stripe/services/file_service.rbi +0 -116
  484. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  485. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  486. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  487. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  488. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  489. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  490. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  491. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  492. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  493. data/rbi/stripe/services/identity_service.rbi +0 -10
  494. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  495. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  496. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  497. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  498. data/rbi/stripe/services/invoice_service.rbi +0 -3027
  499. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  500. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  501. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  502. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  503. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  504. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  505. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  506. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  507. data/rbi/stripe/services/issuing_service.rbi +0 -16
  508. data/rbi/stripe/services/mandate_service.rbi +0 -20
  509. data/rbi/stripe/services/payment_intent_service.rbi +0 -7994
  510. data/rbi/stripe/services/payment_link_service.rbi +0 -1441
  511. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  512. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  513. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  514. data/rbi/stripe/services/payout_service.rbi +0 -205
  515. data/rbi/stripe/services/plan_service.rbi +0 -282
  516. data/rbi/stripe/services/price_service.rbi +0 -546
  517. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  518. data/rbi/stripe/services/product_service.rbi +0 -477
  519. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  520. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  521. data/rbi/stripe/services/quote_service.rbi +0 -699
  522. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  523. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  524. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  525. data/rbi/stripe/services/radar_service.rbi +0 -11
  526. data/rbi/stripe/services/refund_service.rbi +0 -185
  527. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  528. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  529. data/rbi/stripe/services/reporting_service.rbi +0 -10
  530. data/rbi/stripe/services/review_service.rbi +0 -84
  531. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  532. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  533. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  534. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  535. data/rbi/stripe/services/sigma_service.rbi +0 -9
  536. data/rbi/stripe/services/source_service.rbi +0 -663
  537. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  538. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1333
  539. data/rbi/stripe/services/subscription_service.rbi +0 -1684
  540. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  541. data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
  542. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  543. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  544. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  545. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  546. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  547. data/rbi/stripe/services/tax_service.rbi +0 -12
  548. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1286
  549. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  550. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  551. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  552. data/rbi/stripe/services/terminal_service.rbi +0 -12
  553. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  554. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  555. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  556. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  557. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  558. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  559. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  560. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  561. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  562. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  563. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  564. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  565. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  566. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  567. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  568. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  569. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  570. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  571. data/rbi/stripe/services/token_service.rbi +0 -1257
  572. data/rbi/stripe/services/topup_service.rbi +0 -176
  573. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  574. data/rbi/stripe/services/transfer_service.rbi +0 -152
  575. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  576. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  577. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  578. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  579. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  580. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  581. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  582. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  583. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  584. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  585. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  586. data/rbi/stripe/services/treasury_service.rbi +0 -18
  587. data/rbi/stripe/services/v1_services.rbi +0 -77
  588. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  589. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  590. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  591. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  592. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  593. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  594. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  595. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  596. data/rbi/stripe/services/v2_services.rbi +0 -10
  597. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -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
@@ -253,16 +257,44 @@ module Stripe
253
257
  class Phase < Stripe::RequestParams
254
258
  class AddInvoiceItem < Stripe::RequestParams
255
259
  class Discount < Stripe::RequestParams
260
+ class DiscountEnd < Stripe::RequestParams
261
+ class Duration < Stripe::RequestParams
262
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
263
+ attr_accessor :interval
264
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
265
+ attr_accessor :interval_count
266
+
267
+ def initialize(interval: nil, interval_count: nil)
268
+ @interval = interval
269
+ @interval_count = interval_count
270
+ end
271
+ end
272
+ # Time span for the redeemed discount.
273
+ attr_accessor :duration
274
+ # A precise Unix timestamp for the discount to end. Must be in the future.
275
+ attr_accessor :timestamp
276
+ # The type of calculation made to determine when the discount ends.
277
+ attr_accessor :type
278
+
279
+ def initialize(duration: nil, timestamp: nil, type: nil)
280
+ @duration = duration
281
+ @timestamp = timestamp
282
+ @type = type
283
+ end
284
+ end
256
285
  # ID of the coupon to create a new discount for.
257
286
  attr_accessor :coupon
258
287
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
259
288
  attr_accessor :discount
289
+ # Details to determine how long the discount should be applied for.
290
+ attr_accessor :discount_end
260
291
  # ID of the promotion code to create a new discount for.
261
292
  attr_accessor :promotion_code
262
293
 
263
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
294
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
264
295
  @coupon = coupon
265
296
  @discount = discount
297
+ @discount_end = discount_end
266
298
  @promotion_code = promotion_code
267
299
  end
268
300
  end
@@ -349,16 +381,44 @@ module Stripe
349
381
  end
350
382
 
351
383
  class Discount < Stripe::RequestParams
384
+ class DiscountEnd < Stripe::RequestParams
385
+ class Duration < Stripe::RequestParams
386
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
387
+ attr_accessor :interval
388
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
389
+ attr_accessor :interval_count
390
+
391
+ def initialize(interval: nil, interval_count: nil)
392
+ @interval = interval
393
+ @interval_count = interval_count
394
+ end
395
+ end
396
+ # Time span for the redeemed discount.
397
+ attr_accessor :duration
398
+ # A precise Unix timestamp for the discount to end. Must be in the future.
399
+ attr_accessor :timestamp
400
+ # The type of calculation made to determine when the discount ends.
401
+ attr_accessor :type
402
+
403
+ def initialize(duration: nil, timestamp: nil, type: nil)
404
+ @duration = duration
405
+ @timestamp = timestamp
406
+ @type = type
407
+ end
408
+ end
352
409
  # ID of the coupon to create a new discount for.
353
410
  attr_accessor :coupon
354
411
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
355
412
  attr_accessor :discount
413
+ # Details to determine how long the discount should be applied for.
414
+ attr_accessor :discount_end
356
415
  # ID of the promotion code to create a new discount for.
357
416
  attr_accessor :promotion_code
358
417
 
359
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
418
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
360
419
  @coupon = coupon
361
420
  @discount = discount
421
+ @discount_end = discount_end
362
422
  @promotion_code = promotion_code
363
423
  end
364
424
  end
@@ -412,16 +472,44 @@ module Stripe
412
472
  end
413
473
 
414
474
  class Discount < Stripe::RequestParams
475
+ class DiscountEnd < Stripe::RequestParams
476
+ class Duration < Stripe::RequestParams
477
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
478
+ attr_accessor :interval
479
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
480
+ attr_accessor :interval_count
481
+
482
+ def initialize(interval: nil, interval_count: nil)
483
+ @interval = interval
484
+ @interval_count = interval_count
485
+ end
486
+ end
487
+ # Time span for the redeemed discount.
488
+ attr_accessor :duration
489
+ # A precise Unix timestamp for the discount to end. Must be in the future.
490
+ attr_accessor :timestamp
491
+ # The type of calculation made to determine when the discount ends.
492
+ attr_accessor :type
493
+
494
+ def initialize(duration: nil, timestamp: nil, type: nil)
495
+ @duration = duration
496
+ @timestamp = timestamp
497
+ @type = type
498
+ end
499
+ end
415
500
  # ID of the coupon to create a new discount for.
416
501
  attr_accessor :coupon
417
502
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
418
503
  attr_accessor :discount
504
+ # Details to determine how long the discount should be applied for.
505
+ attr_accessor :discount_end
419
506
  # ID of the promotion code to create a new discount for.
420
507
  attr_accessor :promotion_code
421
508
 
422
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
509
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
423
510
  @coupon = coupon
424
511
  @discount = discount
512
+ @discount_end = discount_end
425
513
  @promotion_code = promotion_code
426
514
  end
427
515
  end
@@ -467,6 +555,18 @@ module Stripe
467
555
  @unit_amount_decimal = unit_amount_decimal
468
556
  end
469
557
  end
558
+
559
+ class Trial < Stripe::RequestParams
560
+ # 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.
561
+ attr_accessor :converts_to
562
+ # Determines the type of trial for this item.
563
+ attr_accessor :type
564
+
565
+ def initialize(converts_to: nil, type: nil)
566
+ @converts_to = converts_to
567
+ @type = type
568
+ end
569
+ end
470
570
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
471
571
  attr_accessor :billing_thresholds
472
572
  # The coupons to redeem into discounts for the subscription item.
@@ -483,6 +583,8 @@ module Stripe
483
583
  attr_accessor :quantity
484
584
  # 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.
485
585
  attr_accessor :tax_rates
586
+ # Options that configure the trial on the subscription item.
587
+ attr_accessor :trial
486
588
 
487
589
  def initialize(
488
590
  billing_thresholds: nil,
@@ -492,7 +594,8 @@ module Stripe
492
594
  price: nil,
493
595
  price_data: nil,
494
596
  quantity: nil,
495
- tax_rates: nil
597
+ tax_rates: nil,
598
+ trial: nil
496
599
  )
497
600
  @billing_thresholds = billing_thresholds
498
601
  @discounts = discounts
@@ -502,6 +605,16 @@ module Stripe
502
605
  @price_data = price_data
503
606
  @quantity = quantity
504
607
  @tax_rates = tax_rates
608
+ @trial = trial
609
+ end
610
+ end
611
+
612
+ class PauseCollection < Stripe::RequestParams
613
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
614
+ attr_accessor :behavior
615
+
616
+ def initialize(behavior: nil)
617
+ @behavior = behavior
505
618
  end
506
619
  end
507
620
 
@@ -516,6 +629,23 @@ module Stripe
516
629
  @destination = destination
517
630
  end
518
631
  end
632
+
633
+ class TrialSettings < Stripe::RequestParams
634
+ class EndBehavior < Stripe::RequestParams
635
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
636
+ attr_accessor :prorate_up_front
637
+
638
+ def initialize(prorate_up_front: nil)
639
+ @prorate_up_front = prorate_up_front
640
+ end
641
+ end
642
+ # Defines how the subscription should behave when a trial ends.
643
+ attr_accessor :end_behavior
644
+
645
+ def initialize(end_behavior: nil)
646
+ @end_behavior = end_behavior
647
+ end
648
+ end
519
649
  # 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.
520
650
  attr_accessor :add_invoice_items
521
651
  # 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).
@@ -552,14 +682,20 @@ module Stripe
552
682
  attr_accessor :metadata
553
683
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
554
684
  attr_accessor :on_behalf_of
685
+ # 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).
686
+ attr_accessor :pause_collection
555
687
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
556
688
  attr_accessor :proration_behavior
557
689
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
558
690
  attr_accessor :transfer_data
559
691
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
560
692
  attr_accessor :trial
693
+ # Specify trial behavior when crossing phase boundaries
694
+ attr_accessor :trial_continuation
561
695
  # 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`
562
696
  attr_accessor :trial_end
697
+ # Settings related to subscription trials.
698
+ attr_accessor :trial_settings
563
699
 
564
700
  def initialize(
565
701
  add_invoice_items: nil,
@@ -580,10 +716,13 @@ module Stripe
580
716
  iterations: nil,
581
717
  metadata: nil,
582
718
  on_behalf_of: nil,
719
+ pause_collection: nil,
583
720
  proration_behavior: nil,
584
721
  transfer_data: nil,
585
722
  trial: nil,
586
- trial_end: nil
723
+ trial_continuation: nil,
724
+ trial_end: nil,
725
+ trial_settings: nil
587
726
  )
588
727
  @add_invoice_items = add_invoice_items
589
728
  @application_fee_percent = application_fee_percent
@@ -603,16 +742,35 @@ module Stripe
603
742
  @iterations = iterations
604
743
  @metadata = metadata
605
744
  @on_behalf_of = on_behalf_of
745
+ @pause_collection = pause_collection
606
746
  @proration_behavior = proration_behavior
607
747
  @transfer_data = transfer_data
608
748
  @trial = trial
749
+ @trial_continuation = trial_continuation
609
750
  @trial_end = trial_end
751
+ @trial_settings = trial_settings
752
+ end
753
+ end
754
+
755
+ class Prebilling < Stripe::RequestParams
756
+ # This is used to determine the number of billing cycles to prebill.
757
+ attr_accessor :iterations
758
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
759
+ attr_accessor :update_behavior
760
+
761
+ def initialize(iterations: nil, update_behavior: nil)
762
+ @iterations = iterations
763
+ @update_behavior = update_behavior
610
764
  end
611
765
  end
766
+ # 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.
767
+ attr_accessor :billing_behavior
612
768
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
613
769
  attr_accessor :billing_mode
614
770
  # The identifier of the customer to create the subscription schedule for.
615
771
  attr_accessor :customer
772
+ # The identifier of the account to create the subscription schedule for.
773
+ attr_accessor :customer_account
616
774
  # Object representing the subscription schedule's default settings.
617
775
  attr_accessor :default_settings
618
776
  # 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.
@@ -625,28 +783,36 @@ module Stripe
625
783
  attr_accessor :metadata
626
784
  # 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.
627
785
  attr_accessor :phases
786
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
787
+ attr_accessor :prebilling
628
788
  # 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.
629
789
  attr_accessor :start_date
630
790
 
631
791
  def initialize(
792
+ billing_behavior: nil,
632
793
  billing_mode: nil,
633
794
  customer: nil,
795
+ customer_account: nil,
634
796
  default_settings: nil,
635
797
  end_behavior: nil,
636
798
  expand: nil,
637
799
  from_subscription: nil,
638
800
  metadata: nil,
639
801
  phases: nil,
802
+ prebilling: nil,
640
803
  start_date: nil
641
804
  )
805
+ @billing_behavior = billing_behavior
642
806
  @billing_mode = billing_mode
643
807
  @customer = customer
808
+ @customer_account = customer_account
644
809
  @default_settings = default_settings
645
810
  @end_behavior = end_behavior
646
811
  @expand = expand
647
812
  @from_subscription = from_subscription
648
813
  @metadata = metadata
649
814
  @phases = phases
815
+ @prebilling = prebilling
650
816
  @start_date = start_date
651
817
  end
652
818
  end
@@ -783,16 +949,44 @@ module Stripe
783
949
  class Phase < Stripe::RequestParams
784
950
  class AddInvoiceItem < Stripe::RequestParams
785
951
  class Discount < Stripe::RequestParams
952
+ class DiscountEnd < Stripe::RequestParams
953
+ class Duration < Stripe::RequestParams
954
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
955
+ attr_accessor :interval
956
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
957
+ attr_accessor :interval_count
958
+
959
+ def initialize(interval: nil, interval_count: nil)
960
+ @interval = interval
961
+ @interval_count = interval_count
962
+ end
963
+ end
964
+ # Time span for the redeemed discount.
965
+ attr_accessor :duration
966
+ # A precise Unix timestamp for the discount to end. Must be in the future.
967
+ attr_accessor :timestamp
968
+ # The type of calculation made to determine when the discount ends.
969
+ attr_accessor :type
970
+
971
+ def initialize(duration: nil, timestamp: nil, type: nil)
972
+ @duration = duration
973
+ @timestamp = timestamp
974
+ @type = type
975
+ end
976
+ end
786
977
  # ID of the coupon to create a new discount for.
787
978
  attr_accessor :coupon
788
979
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
789
980
  attr_accessor :discount
981
+ # Details to determine how long the discount should be applied for.
982
+ attr_accessor :discount_end
790
983
  # ID of the promotion code to create a new discount for.
791
984
  attr_accessor :promotion_code
792
985
 
793
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
986
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
794
987
  @coupon = coupon
795
988
  @discount = discount
989
+ @discount_end = discount_end
796
990
  @promotion_code = promotion_code
797
991
  end
798
992
  end
@@ -879,16 +1073,44 @@ module Stripe
879
1073
  end
880
1074
 
881
1075
  class Discount < Stripe::RequestParams
1076
+ class DiscountEnd < Stripe::RequestParams
1077
+ class Duration < Stripe::RequestParams
1078
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1079
+ attr_accessor :interval
1080
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1081
+ attr_accessor :interval_count
1082
+
1083
+ def initialize(interval: nil, interval_count: nil)
1084
+ @interval = interval
1085
+ @interval_count = interval_count
1086
+ end
1087
+ end
1088
+ # Time span for the redeemed discount.
1089
+ attr_accessor :duration
1090
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1091
+ attr_accessor :timestamp
1092
+ # The type of calculation made to determine when the discount ends.
1093
+ attr_accessor :type
1094
+
1095
+ def initialize(duration: nil, timestamp: nil, type: nil)
1096
+ @duration = duration
1097
+ @timestamp = timestamp
1098
+ @type = type
1099
+ end
1100
+ end
882
1101
  # ID of the coupon to create a new discount for.
883
1102
  attr_accessor :coupon
884
1103
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
885
1104
  attr_accessor :discount
1105
+ # Details to determine how long the discount should be applied for.
1106
+ attr_accessor :discount_end
886
1107
  # ID of the promotion code to create a new discount for.
887
1108
  attr_accessor :promotion_code
888
1109
 
889
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1110
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
890
1111
  @coupon = coupon
891
1112
  @discount = discount
1113
+ @discount_end = discount_end
892
1114
  @promotion_code = promotion_code
893
1115
  end
894
1116
  end
@@ -942,16 +1164,44 @@ module Stripe
942
1164
  end
943
1165
 
944
1166
  class Discount < Stripe::RequestParams
1167
+ class DiscountEnd < Stripe::RequestParams
1168
+ class Duration < Stripe::RequestParams
1169
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1170
+ attr_accessor :interval
1171
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1172
+ attr_accessor :interval_count
1173
+
1174
+ def initialize(interval: nil, interval_count: nil)
1175
+ @interval = interval
1176
+ @interval_count = interval_count
1177
+ end
1178
+ end
1179
+ # Time span for the redeemed discount.
1180
+ attr_accessor :duration
1181
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1182
+ attr_accessor :timestamp
1183
+ # The type of calculation made to determine when the discount ends.
1184
+ attr_accessor :type
1185
+
1186
+ def initialize(duration: nil, timestamp: nil, type: nil)
1187
+ @duration = duration
1188
+ @timestamp = timestamp
1189
+ @type = type
1190
+ end
1191
+ end
945
1192
  # ID of the coupon to create a new discount for.
946
1193
  attr_accessor :coupon
947
1194
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
948
1195
  attr_accessor :discount
1196
+ # Details to determine how long the discount should be applied for.
1197
+ attr_accessor :discount_end
949
1198
  # ID of the promotion code to create a new discount for.
950
1199
  attr_accessor :promotion_code
951
1200
 
952
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1201
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
953
1202
  @coupon = coupon
954
1203
  @discount = discount
1204
+ @discount_end = discount_end
955
1205
  @promotion_code = promotion_code
956
1206
  end
957
1207
  end
@@ -997,6 +1247,18 @@ module Stripe
997
1247
  @unit_amount_decimal = unit_amount_decimal
998
1248
  end
999
1249
  end
1250
+
1251
+ class Trial < Stripe::RequestParams
1252
+ # 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.
1253
+ attr_accessor :converts_to
1254
+ # Determines the type of trial for this item.
1255
+ attr_accessor :type
1256
+
1257
+ def initialize(converts_to: nil, type: nil)
1258
+ @converts_to = converts_to
1259
+ @type = type
1260
+ end
1261
+ end
1000
1262
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1001
1263
  attr_accessor :billing_thresholds
1002
1264
  # The coupons to redeem into discounts for the subscription item.
@@ -1013,6 +1275,8 @@ module Stripe
1013
1275
  attr_accessor :quantity
1014
1276
  # 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.
1015
1277
  attr_accessor :tax_rates
1278
+ # Options that configure the trial on the subscription item.
1279
+ attr_accessor :trial
1016
1280
 
1017
1281
  def initialize(
1018
1282
  billing_thresholds: nil,
@@ -1022,7 +1286,8 @@ module Stripe
1022
1286
  price: nil,
1023
1287
  price_data: nil,
1024
1288
  quantity: nil,
1025
- tax_rates: nil
1289
+ tax_rates: nil,
1290
+ trial: nil
1026
1291
  )
1027
1292
  @billing_thresholds = billing_thresholds
1028
1293
  @discounts = discounts
@@ -1032,6 +1297,16 @@ module Stripe
1032
1297
  @price_data = price_data
1033
1298
  @quantity = quantity
1034
1299
  @tax_rates = tax_rates
1300
+ @trial = trial
1301
+ end
1302
+ end
1303
+
1304
+ class PauseCollection < Stripe::RequestParams
1305
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1306
+ attr_accessor :behavior
1307
+
1308
+ def initialize(behavior: nil)
1309
+ @behavior = behavior
1035
1310
  end
1036
1311
  end
1037
1312
 
@@ -1046,6 +1321,23 @@ module Stripe
1046
1321
  @destination = destination
1047
1322
  end
1048
1323
  end
1324
+
1325
+ class TrialSettings < Stripe::RequestParams
1326
+ class EndBehavior < Stripe::RequestParams
1327
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1328
+ attr_accessor :prorate_up_front
1329
+
1330
+ def initialize(prorate_up_front: nil)
1331
+ @prorate_up_front = prorate_up_front
1332
+ end
1333
+ end
1334
+ # Defines how the subscription should behave when a trial ends.
1335
+ attr_accessor :end_behavior
1336
+
1337
+ def initialize(end_behavior: nil)
1338
+ @end_behavior = end_behavior
1339
+ end
1340
+ end
1049
1341
  # 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.
1050
1342
  attr_accessor :add_invoice_items
1051
1343
  # 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).
@@ -1082,6 +1374,8 @@ module Stripe
1082
1374
  attr_accessor :metadata
1083
1375
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1084
1376
  attr_accessor :on_behalf_of
1377
+ # 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).
1378
+ attr_accessor :pause_collection
1085
1379
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
1086
1380
  attr_accessor :proration_behavior
1087
1381
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -1090,8 +1384,12 @@ module Stripe
1090
1384
  attr_accessor :transfer_data
1091
1385
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1092
1386
  attr_accessor :trial
1387
+ # Specify trial behavior when crossing phase boundaries
1388
+ attr_accessor :trial_continuation
1093
1389
  # 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`
1094
1390
  attr_accessor :trial_end
1391
+ # Settings related to subscription trials.
1392
+ attr_accessor :trial_settings
1095
1393
 
1096
1394
  def initialize(
1097
1395
  add_invoice_items: nil,
@@ -1112,11 +1410,14 @@ module Stripe
1112
1410
  iterations: nil,
1113
1411
  metadata: nil,
1114
1412
  on_behalf_of: nil,
1413
+ pause_collection: nil,
1115
1414
  proration_behavior: nil,
1116
1415
  start_date: nil,
1117
1416
  transfer_data: nil,
1118
1417
  trial: nil,
1119
- trial_end: nil
1418
+ trial_continuation: nil,
1419
+ trial_end: nil,
1420
+ trial_settings: nil
1120
1421
  )
1121
1422
  @add_invoice_items = add_invoice_items
1122
1423
  @application_fee_percent = application_fee_percent
@@ -1136,13 +1437,30 @@ module Stripe
1136
1437
  @iterations = iterations
1137
1438
  @metadata = metadata
1138
1439
  @on_behalf_of = on_behalf_of
1440
+ @pause_collection = pause_collection
1139
1441
  @proration_behavior = proration_behavior
1140
1442
  @start_date = start_date
1141
1443
  @transfer_data = transfer_data
1142
1444
  @trial = trial
1445
+ @trial_continuation = trial_continuation
1143
1446
  @trial_end = trial_end
1447
+ @trial_settings = trial_settings
1448
+ end
1449
+ end
1450
+
1451
+ class Prebilling < Stripe::RequestParams
1452
+ # This is used to determine the number of billing cycles to prebill.
1453
+ attr_accessor :iterations
1454
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1455
+ attr_accessor :update_behavior
1456
+
1457
+ def initialize(iterations: nil, update_behavior: nil)
1458
+ @iterations = iterations
1459
+ @update_behavior = update_behavior
1144
1460
  end
1145
1461
  end
1462
+ # 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.
1463
+ attr_accessor :billing_behavior
1146
1464
  # Object representing the subscription schedule's default settings.
1147
1465
  attr_accessor :default_settings
1148
1466
  # 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.
@@ -1153,26 +1471,598 @@ module Stripe
1153
1471
  attr_accessor :metadata
1154
1472
  # 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.
1155
1473
  attr_accessor :phases
1474
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1475
+ attr_accessor :prebilling
1156
1476
  # If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
1157
1477
  attr_accessor :proration_behavior
1158
1478
 
1159
1479
  def initialize(
1480
+ billing_behavior: nil,
1160
1481
  default_settings: nil,
1161
1482
  end_behavior: nil,
1162
1483
  expand: nil,
1163
1484
  metadata: nil,
1164
1485
  phases: nil,
1486
+ prebilling: nil,
1165
1487
  proration_behavior: nil
1166
1488
  )
1489
+ @billing_behavior = billing_behavior
1167
1490
  @default_settings = default_settings
1168
1491
  @end_behavior = end_behavior
1169
1492
  @expand = expand
1170
1493
  @metadata = metadata
1171
1494
  @phases = phases
1495
+ @prebilling = prebilling
1172
1496
  @proration_behavior = proration_behavior
1173
1497
  end
1174
1498
  end
1175
1499
 
1500
+ class AmendParams < Stripe::RequestParams
1501
+ class Amendment < Stripe::RequestParams
1502
+ class AmendmentEnd < Stripe::RequestParams
1503
+ class DiscountEnd < Stripe::RequestParams
1504
+ # The ID of a specific discount.
1505
+ attr_accessor :discount
1506
+
1507
+ def initialize(discount: nil)
1508
+ @discount = discount
1509
+ end
1510
+ end
1511
+
1512
+ class Duration < Stripe::RequestParams
1513
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1514
+ attr_accessor :interval
1515
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1516
+ attr_accessor :interval_count
1517
+
1518
+ def initialize(interval: nil, interval_count: nil)
1519
+ @interval = interval
1520
+ @interval_count = interval_count
1521
+ end
1522
+ end
1523
+ # Use the `end` time of a given discount.
1524
+ attr_accessor :discount_end
1525
+ # Time span for the amendment starting from the `amendment_start`.
1526
+ attr_accessor :duration
1527
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1528
+ attr_accessor :timestamp
1529
+ # Select one of three ways to pass the `amendment_end`.
1530
+ attr_accessor :type
1531
+
1532
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1533
+ @discount_end = discount_end
1534
+ @duration = duration
1535
+ @timestamp = timestamp
1536
+ @type = type
1537
+ end
1538
+ end
1539
+
1540
+ class AmendmentStart < Stripe::RequestParams
1541
+ class AmendmentEnd < Stripe::RequestParams
1542
+ # 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.
1543
+ attr_accessor :index
1544
+
1545
+ def initialize(index: nil)
1546
+ @index = index
1547
+ end
1548
+ end
1549
+
1550
+ class DiscountEnd < Stripe::RequestParams
1551
+ # The ID of a specific discount.
1552
+ attr_accessor :discount
1553
+
1554
+ def initialize(discount: nil)
1555
+ @discount = discount
1556
+ end
1557
+ end
1558
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
1559
+ attr_accessor :amendment_end
1560
+ # Use the `end` time of a given discount.
1561
+ attr_accessor :discount_end
1562
+ # A precise Unix timestamp for the amendment to start.
1563
+ attr_accessor :timestamp
1564
+ # Select one of three ways to pass the `amendment_start`.
1565
+ attr_accessor :type
1566
+
1567
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
1568
+ @amendment_end = amendment_end
1569
+ @discount_end = discount_end
1570
+ @timestamp = timestamp
1571
+ @type = type
1572
+ end
1573
+ end
1574
+
1575
+ class DiscountAction < Stripe::RequestParams
1576
+ class Add < Stripe::RequestParams
1577
+ class DiscountEnd < Stripe::RequestParams
1578
+ # The type of calculation made to determine when the discount ends.
1579
+ attr_accessor :type
1580
+
1581
+ def initialize(type: nil)
1582
+ @type = type
1583
+ end
1584
+ end
1585
+ # The coupon code to redeem.
1586
+ attr_accessor :coupon
1587
+ # An ID of an existing discount for a coupon that was already redeemed.
1588
+ attr_accessor :discount
1589
+ # Details to determine how long the discount should be applied for.
1590
+ attr_accessor :discount_end
1591
+ # 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.
1592
+ attr_accessor :index
1593
+ # The promotion code to redeem.
1594
+ attr_accessor :promotion_code
1595
+
1596
+ def initialize(
1597
+ coupon: nil,
1598
+ discount: nil,
1599
+ discount_end: nil,
1600
+ index: nil,
1601
+ promotion_code: nil
1602
+ )
1603
+ @coupon = coupon
1604
+ @discount = discount
1605
+ @discount_end = discount_end
1606
+ @index = index
1607
+ @promotion_code = promotion_code
1608
+ end
1609
+ end
1610
+
1611
+ class Remove < Stripe::RequestParams
1612
+ # The coupon code to remove from the `discounts` array.
1613
+ attr_accessor :coupon
1614
+ # The ID of a discount to remove from the `discounts` array.
1615
+ attr_accessor :discount
1616
+ # The ID of a promotion code to remove from the `discounts` array.
1617
+ attr_accessor :promotion_code
1618
+
1619
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1620
+ @coupon = coupon
1621
+ @discount = discount
1622
+ @promotion_code = promotion_code
1623
+ end
1624
+ end
1625
+
1626
+ class Set < Stripe::RequestParams
1627
+ # The coupon code to replace the `discounts` array with.
1628
+ attr_accessor :coupon
1629
+ # An ID of an existing discount to replace the `discounts` array with.
1630
+ attr_accessor :discount
1631
+ # An ID of an existing promotion code to replace the `discounts` array with.
1632
+ attr_accessor :promotion_code
1633
+
1634
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1635
+ @coupon = coupon
1636
+ @discount = discount
1637
+ @promotion_code = promotion_code
1638
+ end
1639
+ end
1640
+ # Details of the discount to add.
1641
+ attr_accessor :add
1642
+ # Details of the discount to remove.
1643
+ attr_accessor :remove
1644
+ # Details of the discount to replace the existing discounts with.
1645
+ attr_accessor :set
1646
+ # Determines the type of discount action.
1647
+ attr_accessor :type
1648
+
1649
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1650
+ @add = add
1651
+ @remove = remove
1652
+ @set = set
1653
+ @type = type
1654
+ end
1655
+ end
1656
+
1657
+ class ItemAction < Stripe::RequestParams
1658
+ class Add < Stripe::RequestParams
1659
+ class Discount < Stripe::RequestParams
1660
+ class DiscountEnd < Stripe::RequestParams
1661
+ class Duration < Stripe::RequestParams
1662
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1663
+ attr_accessor :interval
1664
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1665
+ attr_accessor :interval_count
1666
+
1667
+ def initialize(interval: nil, interval_count: nil)
1668
+ @interval = interval
1669
+ @interval_count = interval_count
1670
+ end
1671
+ end
1672
+ # Time span for the redeemed discount.
1673
+ attr_accessor :duration
1674
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1675
+ attr_accessor :timestamp
1676
+ # The type of calculation made to determine when the discount ends.
1677
+ attr_accessor :type
1678
+
1679
+ def initialize(duration: nil, timestamp: nil, type: nil)
1680
+ @duration = duration
1681
+ @timestamp = timestamp
1682
+ @type = type
1683
+ end
1684
+ end
1685
+ # ID of the coupon to create a new discount for.
1686
+ attr_accessor :coupon
1687
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1688
+ attr_accessor :discount
1689
+ # Details to determine how long the discount should be applied for.
1690
+ attr_accessor :discount_end
1691
+ # ID of the promotion code to create a new discount for.
1692
+ attr_accessor :promotion_code
1693
+
1694
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1695
+ @coupon = coupon
1696
+ @discount = discount
1697
+ @discount_end = discount_end
1698
+ @promotion_code = promotion_code
1699
+ end
1700
+ end
1701
+
1702
+ class Trial < Stripe::RequestParams
1703
+ # 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.
1704
+ attr_accessor :converts_to
1705
+ # Determines the type of trial for this item.
1706
+ attr_accessor :type
1707
+
1708
+ def initialize(converts_to: nil, type: nil)
1709
+ @converts_to = converts_to
1710
+ @type = type
1711
+ end
1712
+ end
1713
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1714
+ attr_accessor :discounts
1715
+ # 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`.
1716
+ attr_accessor :metadata
1717
+ # The ID of the price object.
1718
+ attr_accessor :price
1719
+ # Quantity for this item.
1720
+ attr_accessor :quantity
1721
+ # 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`.
1722
+ attr_accessor :tax_rates
1723
+ # Options that configure the trial on the subscription item.
1724
+ attr_accessor :trial
1725
+
1726
+ def initialize(
1727
+ discounts: nil,
1728
+ metadata: nil,
1729
+ price: nil,
1730
+ quantity: nil,
1731
+ tax_rates: nil,
1732
+ trial: nil
1733
+ )
1734
+ @discounts = discounts
1735
+ @metadata = metadata
1736
+ @price = price
1737
+ @quantity = quantity
1738
+ @tax_rates = tax_rates
1739
+ @trial = trial
1740
+ end
1741
+ end
1742
+
1743
+ class Remove < Stripe::RequestParams
1744
+ # ID of a price to remove.
1745
+ attr_accessor :price
1746
+
1747
+ def initialize(price: nil)
1748
+ @price = price
1749
+ end
1750
+ end
1751
+
1752
+ class Set < Stripe::RequestParams
1753
+ class Discount < Stripe::RequestParams
1754
+ class DiscountEnd < Stripe::RequestParams
1755
+ class Duration < Stripe::RequestParams
1756
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1757
+ attr_accessor :interval
1758
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1759
+ attr_accessor :interval_count
1760
+
1761
+ def initialize(interval: nil, interval_count: nil)
1762
+ @interval = interval
1763
+ @interval_count = interval_count
1764
+ end
1765
+ end
1766
+ # Time span for the redeemed discount.
1767
+ attr_accessor :duration
1768
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1769
+ attr_accessor :timestamp
1770
+ # The type of calculation made to determine when the discount ends.
1771
+ attr_accessor :type
1772
+
1773
+ def initialize(duration: nil, timestamp: nil, type: nil)
1774
+ @duration = duration
1775
+ @timestamp = timestamp
1776
+ @type = type
1777
+ end
1778
+ end
1779
+ # ID of the coupon to create a new discount for.
1780
+ attr_accessor :coupon
1781
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1782
+ attr_accessor :discount
1783
+ # Details to determine how long the discount should be applied for.
1784
+ attr_accessor :discount_end
1785
+ # ID of the promotion code to create a new discount for.
1786
+ attr_accessor :promotion_code
1787
+
1788
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1789
+ @coupon = coupon
1790
+ @discount = discount
1791
+ @discount_end = discount_end
1792
+ @promotion_code = promotion_code
1793
+ end
1794
+ end
1795
+
1796
+ class Trial < Stripe::RequestParams
1797
+ # 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.
1798
+ attr_accessor :converts_to
1799
+ # Determines the type of trial for this item.
1800
+ attr_accessor :type
1801
+
1802
+ def initialize(converts_to: nil, type: nil)
1803
+ @converts_to = converts_to
1804
+ @type = type
1805
+ end
1806
+ end
1807
+ # 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`.
1808
+ attr_accessor :discounts
1809
+ # 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`.
1810
+ attr_accessor :metadata
1811
+ # The ID of the price object.
1812
+ attr_accessor :price
1813
+ # 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`.
1814
+ attr_accessor :quantity
1815
+ # 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`.
1816
+ attr_accessor :tax_rates
1817
+ # 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`.
1818
+ attr_accessor :trial
1819
+
1820
+ def initialize(
1821
+ discounts: nil,
1822
+ metadata: nil,
1823
+ price: nil,
1824
+ quantity: nil,
1825
+ tax_rates: nil,
1826
+ trial: nil
1827
+ )
1828
+ @discounts = discounts
1829
+ @metadata = metadata
1830
+ @price = price
1831
+ @quantity = quantity
1832
+ @tax_rates = tax_rates
1833
+ @trial = trial
1834
+ end
1835
+ end
1836
+ # 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.
1837
+ attr_accessor :add
1838
+ # Details of the subscription item to remove.
1839
+ attr_accessor :remove
1840
+ # 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.
1841
+ attr_accessor :set
1842
+ # Determines the type of item action.
1843
+ attr_accessor :type
1844
+
1845
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1846
+ @add = add
1847
+ @remove = remove
1848
+ @set = set
1849
+ @type = type
1850
+ end
1851
+ end
1852
+
1853
+ class MetadataAction < Stripe::RequestParams
1854
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
1855
+ attr_accessor :add
1856
+ # Keys to remove from schedule phase metadata.
1857
+ attr_accessor :remove
1858
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
1859
+ attr_accessor :set
1860
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
1861
+ attr_accessor :type
1862
+
1863
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1864
+ @add = add
1865
+ @remove = remove
1866
+ @set = set
1867
+ @type = type
1868
+ end
1869
+ end
1870
+
1871
+ class SetPauseCollection < Stripe::RequestParams
1872
+ class Set < Stripe::RequestParams
1873
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1874
+ attr_accessor :behavior
1875
+
1876
+ def initialize(behavior: nil)
1877
+ @behavior = behavior
1878
+ end
1879
+ end
1880
+ # Details of the pause_collection behavior to apply to the amendment.
1881
+ attr_accessor :set
1882
+ # Determines the type of the pause_collection amendment.
1883
+ attr_accessor :type
1884
+
1885
+ def initialize(set: nil, type: nil)
1886
+ @set = set
1887
+ @type = type
1888
+ end
1889
+ end
1890
+
1891
+ class TrialSettings < Stripe::RequestParams
1892
+ class EndBehavior < Stripe::RequestParams
1893
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1894
+ attr_accessor :prorate_up_front
1895
+
1896
+ def initialize(prorate_up_front: nil)
1897
+ @prorate_up_front = prorate_up_front
1898
+ end
1899
+ end
1900
+ # Defines how the subscription should behave when a trial ends.
1901
+ attr_accessor :end_behavior
1902
+
1903
+ def initialize(end_behavior: nil)
1904
+ @end_behavior = end_behavior
1905
+ end
1906
+ end
1907
+ # 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.
1908
+ attr_accessor :amendment_end
1909
+ # Details to identify the earliest timestamp where the proposed change should take effect.
1910
+ attr_accessor :amendment_start
1911
+ # 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.
1912
+ attr_accessor :billing_cycle_anchor
1913
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1914
+ attr_accessor :discount_actions
1915
+ # Changes to the subscription items during the amendment time span.
1916
+ attr_accessor :item_actions
1917
+ # Instructions for how to modify phase metadata
1918
+ attr_accessor :metadata_actions
1919
+ # 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`.
1920
+ attr_accessor :proration_behavior
1921
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1922
+ attr_accessor :set_pause_collection
1923
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1924
+ attr_accessor :set_schedule_end
1925
+ # Settings related to subscription trials.
1926
+ attr_accessor :trial_settings
1927
+
1928
+ def initialize(
1929
+ amendment_end: nil,
1930
+ amendment_start: nil,
1931
+ billing_cycle_anchor: nil,
1932
+ discount_actions: nil,
1933
+ item_actions: nil,
1934
+ metadata_actions: nil,
1935
+ proration_behavior: nil,
1936
+ set_pause_collection: nil,
1937
+ set_schedule_end: nil,
1938
+ trial_settings: nil
1939
+ )
1940
+ @amendment_end = amendment_end
1941
+ @amendment_start = amendment_start
1942
+ @billing_cycle_anchor = billing_cycle_anchor
1943
+ @discount_actions = discount_actions
1944
+ @item_actions = item_actions
1945
+ @metadata_actions = metadata_actions
1946
+ @proration_behavior = proration_behavior
1947
+ @set_pause_collection = set_pause_collection
1948
+ @set_schedule_end = set_schedule_end
1949
+ @trial_settings = trial_settings
1950
+ end
1951
+ end
1952
+
1953
+ class Prebilling < Stripe::RequestParams
1954
+ class BillFrom < Stripe::RequestParams
1955
+ class AmendmentStart < Stripe::RequestParams
1956
+ # 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.
1957
+ attr_accessor :index
1958
+
1959
+ def initialize(index: nil)
1960
+ @index = index
1961
+ end
1962
+ end
1963
+ # Start the prebilled period when a specified amendment begins.
1964
+ attr_accessor :amendment_start
1965
+ # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1966
+ attr_accessor :timestamp
1967
+ # Select one of several ways to pass the `bill_from` value.
1968
+ attr_accessor :type
1969
+
1970
+ def initialize(amendment_start: nil, timestamp: nil, type: nil)
1971
+ @amendment_start = amendment_start
1972
+ @timestamp = timestamp
1973
+ @type = type
1974
+ end
1975
+ end
1976
+
1977
+ class BillUntil < Stripe::RequestParams
1978
+ class AmendmentEnd < Stripe::RequestParams
1979
+ # 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.
1980
+ attr_accessor :index
1981
+
1982
+ def initialize(index: nil)
1983
+ @index = index
1984
+ end
1985
+ end
1986
+
1987
+ class Duration < Stripe::RequestParams
1988
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1989
+ attr_accessor :interval
1990
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1991
+ attr_accessor :interval_count
1992
+
1993
+ def initialize(interval: nil, interval_count: nil)
1994
+ @interval = interval
1995
+ @interval_count = interval_count
1996
+ end
1997
+ end
1998
+ # End the prebilled period when a specified amendment ends.
1999
+ attr_accessor :amendment_end
2000
+ # Time span for prebilling, starting from `bill_from`.
2001
+ attr_accessor :duration
2002
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2003
+ attr_accessor :timestamp
2004
+ # Select one of several ways to pass the `bill_until` value.
2005
+ attr_accessor :type
2006
+
2007
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
2008
+ @amendment_end = amendment_end
2009
+ @duration = duration
2010
+ @timestamp = timestamp
2011
+ @type = type
2012
+ end
2013
+ end
2014
+ # The beginning of the prebilled time period. The default value is `now`.
2015
+ attr_accessor :bill_from
2016
+ # The end of the prebilled time period.
2017
+ attr_accessor :bill_until
2018
+ # When the prebilling invoice should be created. The default value is `now`.
2019
+ attr_accessor :invoice_at
2020
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2021
+ attr_accessor :update_behavior
2022
+
2023
+ def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
2024
+ @bill_from = bill_from
2025
+ @bill_until = bill_until
2026
+ @invoice_at = invoice_at
2027
+ @update_behavior = update_behavior
2028
+ end
2029
+ end
2030
+
2031
+ class ScheduleSettings < Stripe::RequestParams
2032
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2033
+ attr_accessor :end_behavior
2034
+
2035
+ def initialize(end_behavior: nil)
2036
+ @end_behavior = end_behavior
2037
+ end
2038
+ end
2039
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
2040
+ attr_accessor :amendments
2041
+ # Specifies which fields in the response should be expanded.
2042
+ attr_accessor :expand
2043
+ # Provide any time periods to bill in advance.
2044
+ attr_accessor :prebilling
2045
+ # In cases where the amendment changes the currently active phase,
2046
+ # specifies if and how to prorate at the time of the request.
2047
+ attr_accessor :proration_behavior
2048
+ # Changes to apply to the subscription schedule.
2049
+ attr_accessor :schedule_settings
2050
+
2051
+ def initialize(
2052
+ amendments: nil,
2053
+ expand: nil,
2054
+ prebilling: nil,
2055
+ proration_behavior: nil,
2056
+ schedule_settings: nil
2057
+ )
2058
+ @amendments = amendments
2059
+ @expand = expand
2060
+ @prebilling = prebilling
2061
+ @proration_behavior = proration_behavior
2062
+ @schedule_settings = schedule_settings
2063
+ end
2064
+ end
2065
+
1176
2066
  class CancelParams < Stripe::RequestParams
1177
2067
  # Specifies which fields in the response should be expanded.
1178
2068
  attr_accessor :expand
@@ -1200,6 +2090,17 @@ module Stripe
1200
2090
  end
1201
2091
  end
1202
2092
 
2093
+ # Amends an existing subscription schedule.
2094
+ def amend(schedule, params = {}, opts = {})
2095
+ request(
2096
+ method: :post,
2097
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
2098
+ params: params,
2099
+ opts: opts,
2100
+ base_address: :api
2101
+ )
2102
+ end
2103
+
1203
2104
  # 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.
1204
2105
  def cancel(schedule, params = {}, opts = {})
1205
2106
  request(