stripe 15.1.0 → 15.2.0.pre.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1561 -695
  3. data/VERSION +1 -1
  4. data/lib/stripe/api_requestor.rb +28 -0
  5. data/lib/stripe/api_version.rb +1 -1
  6. data/lib/stripe/errors.rb +54 -0
  7. data/lib/stripe/event_types.rb +89 -0
  8. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  9. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  10. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  11. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_core_account_link_completed_event.rb +13 -0
  20. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  21. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  22. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  23. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  24. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  26. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  27. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  30. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  48. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  53. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  58. data/lib/stripe/object_types.rb +52 -0
  59. data/lib/stripe/resources/account.rb +653 -1
  60. data/lib/stripe/resources/account_notice.rb +123 -0
  61. data/lib/stripe/resources/account_session.rb +299 -1
  62. data/lib/stripe/resources/balance_settings.rb +105 -0
  63. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  64. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  65. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  66. data/lib/stripe/resources/billing/meter_error_report.rb +59 -0
  67. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  68. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  69. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  70. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  71. data/lib/stripe/resources/card.rb +2 -0
  72. data/lib/stripe/resources/cash_balance.rb +2 -0
  73. data/lib/stripe/resources/charge.rb +1470 -0
  74. data/lib/stripe/resources/checkout/session.rb +331 -3
  75. data/lib/stripe/resources/confirmation_token.rb +176 -0
  76. data/lib/stripe/resources/coupon.rb +30 -1
  77. data/lib/stripe/resources/credit_note.rb +10 -0
  78. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  79. data/lib/stripe/resources/customer.rb +2 -0
  80. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  81. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  82. data/lib/stripe/resources/customer_session.rb +6 -1
  83. data/lib/stripe/resources/discount.rb +2 -0
  84. data/lib/stripe/resources/event.rb +31 -0
  85. data/lib/stripe/resources/financial_connections/account.rb +20 -1
  86. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  87. data/lib/stripe/resources/financial_connections/institution.rb +90 -0
  88. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  89. data/lib/stripe/resources/fx_quote.rb +184 -0
  90. data/lib/stripe/resources/gift_cards/card.rb +208 -0
  91. data/lib/stripe/resources/gift_cards/transaction.rb +272 -0
  92. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  93. data/lib/stripe/resources/invoice.rb +1129 -15
  94. data/lib/stripe/resources/invoice_item.rb +78 -2
  95. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  96. data/lib/stripe/resources/invoice_payment.rb +2 -53
  97. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  98. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  99. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  100. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  101. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  102. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  103. data/lib/stripe/resources/line_item.rb +37 -0
  104. data/lib/stripe/resources/mandate.rb +24 -0
  105. data/lib/stripe/resources/margin.rb +115 -0
  106. data/lib/stripe/resources/order.rb +2859 -0
  107. data/lib/stripe/resources/payment_attempt_record.rb +1078 -0
  108. data/lib/stripe/resources/payment_intent.rb +6036 -1214
  109. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +65 -0
  110. data/lib/stripe/resources/payment_method.rb +198 -1
  111. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  112. data/lib/stripe/resources/payment_record.rb +1607 -0
  113. data/lib/stripe/resources/payout.rb +6 -0
  114. data/lib/stripe/resources/price.rb +30 -0
  115. data/lib/stripe/resources/privacy/redaction_job.rb +275 -0
  116. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +25 -0
  117. data/lib/stripe/resources/product.rb +59 -0
  118. data/lib/stripe/resources/promotion_code.rb +10 -0
  119. data/lib/stripe/resources/quote.rb +2046 -6
  120. data/lib/stripe/resources/quote_line.rb +274 -0
  121. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  122. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +339 -0
  123. data/lib/stripe/resources/refund.rb +9 -0
  124. data/lib/stripe/resources/setup_attempt.rb +21 -0
  125. data/lib/stripe/resources/setup_intent.rb +596 -9
  126. data/lib/stripe/resources/source.rb +29 -0
  127. data/lib/stripe/resources/subscription.rb +298 -9
  128. data/lib/stripe/resources/subscription_item.rb +84 -3
  129. data/lib/stripe/resources/subscription_schedule.rb +1013 -10
  130. data/lib/stripe/resources/tax/association.rb +89 -0
  131. data/lib/stripe/resources/tax/form.rb +211 -0
  132. data/lib/stripe/resources/tax_id.rb +12 -2
  133. data/lib/stripe/resources/terminal/reader.rb +406 -0
  134. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  135. data/lib/stripe/resources/transfer.rb +6 -0
  136. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  137. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  138. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  139. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  140. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  141. data/lib/stripe/resources/v2/core/account.rb +1746 -0
  142. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  143. data/lib/stripe/resources/v2/core/person.rb +276 -0
  144. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  145. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  146. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  147. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  148. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  149. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  150. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  151. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  152. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  153. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  154. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  155. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  156. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  157. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  158. data/lib/stripe/resources/v2/money_management/received_credit.rb +136 -0
  159. data/lib/stripe/resources/v2/money_management/received_debit.rb +108 -0
  160. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  161. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  162. data/lib/stripe/resources.rb +99 -0
  163. data/lib/stripe/services/account_notice_service.rb +101 -0
  164. data/lib/stripe/services/account_service.rb +562 -1
  165. data/lib/stripe/services/account_session_service.rb +269 -1
  166. data/lib/stripe/services/balance_settings_service.rb +96 -0
  167. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  168. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  169. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  170. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  171. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  172. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  173. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  174. data/lib/stripe/services/capital_service.rb +15 -0
  175. data/lib/stripe/services/charge_service.rb +1350 -0
  176. data/lib/stripe/services/checkout/session_service.rb +247 -2
  177. data/lib/stripe/services/coupon_service.rb +17 -1
  178. data/lib/stripe/services/credit_note_service.rb +4 -0
  179. data/lib/stripe/services/customer_session_service.rb +4 -1
  180. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -123
  181. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  182. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  183. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  184. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  185. data/lib/stripe/services/financial_connections_service.rb +2 -1
  186. data/lib/stripe/services/fx_quote_service.rb +123 -0
  187. data/lib/stripe/services/gift_cards/card_service.rb +170 -0
  188. data/lib/stripe/services/gift_cards/transaction_service.rb +209 -0
  189. data/lib/stripe/services/gift_cards_service.rb +14 -0
  190. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  191. data/lib/stripe/services/invoice_item_service.rb +74 -2
  192. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  193. data/lib/stripe/services/invoice_service.rb +1059 -15
  194. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  195. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  196. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  197. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  198. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +119 -0
  201. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  202. data/lib/stripe/services/order_service.rb +2268 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  204. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  205. data/lib/stripe/services/payment_intent_service.rb +4631 -258
  206. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  207. data/lib/stripe/services/payment_method_service.rb +126 -1
  208. data/lib/stripe/services/payment_record_service.rb +542 -0
  209. data/lib/stripe/services/payout_service.rb +4 -0
  210. data/lib/stripe/services/price_service.rb +19 -0
  211. data/lib/stripe/services/privacy/redaction_job_service.rb +231 -0
  212. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  213. data/lib/stripe/services/privacy_service.rb +13 -0
  214. data/lib/stripe/services/product_service.rb +38 -0
  215. data/lib/stripe/services/promotion_code_service.rb +8 -0
  216. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  217. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  218. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  219. data/lib/stripe/services/quote_service.rb +1730 -7
  220. data/lib/stripe/services/setup_intent_service.rb +556 -9
  221. data/lib/stripe/services/subscription_item_service.rb +75 -3
  222. data/lib/stripe/services/subscription_schedule_service.rb +915 -10
  223. data/lib/stripe/services/subscription_service.rb +257 -9
  224. data/lib/stripe/services/tax/association_service.rb +31 -0
  225. data/lib/stripe/services/tax/form_service.rb +100 -0
  226. data/lib/stripe/services/tax_id_service.rb +8 -2
  227. data/lib/stripe/services/tax_service.rb +3 -1
  228. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  229. data/lib/stripe/services/terminal/reader_service.rb +180 -0
  230. data/lib/stripe/services/terminal_service.rb +2 -1
  231. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +103 -0
  232. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  233. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  234. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  235. data/lib/stripe/services/transfer_service.rb +4 -0
  236. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  237. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  238. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  239. data/lib/stripe/services/v1_services.rb +12 -2
  240. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  241. data/lib/stripe/services/v2/core/account_service.rb +4138 -0
  242. data/lib/stripe/services/v2/core/accounts/person_service.rb +1048 -0
  243. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +135 -0
  244. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +109 -0
  245. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  246. data/lib/stripe/services/v2/core_service.rb +4 -1
  247. data/lib/stripe/services/v2/money_management/adjustment_service.rb +75 -0
  248. data/lib/stripe/services/v2/money_management/financial_account_service.rb +44 -0
  249. data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -0
  250. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +126 -0
  251. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +96 -0
  252. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +202 -0
  253. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +237 -0
  254. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +174 -0
  255. data/lib/stripe/services/v2/money_management/payout_method_service.rb +95 -0
  256. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  257. data/lib/stripe/services/v2/money_management/received_credit_service.rb +71 -0
  258. data/lib/stripe/services/v2/money_management/received_debit_service.rb +44 -0
  259. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +70 -0
  260. data/lib/stripe/services/v2/money_management/transaction_service.rb +74 -0
  261. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  262. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  263. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +50 -0
  264. data/lib/stripe/services/v2_services.rb +4 -2
  265. data/lib/stripe/services.rb +54 -1
  266. data/lib/stripe/stripe_configuration.rb +3 -1
  267. data/lib/stripe/stripe_object.rb +1 -1
  268. data/lib/stripe/util.rb +7 -1
  269. data/lib/stripe/version.rb +1 -1
  270. data/lib/stripe.rb +53 -0
  271. data/rbi/stripe.rbi +191867 -0
  272. data/stripe.gemspec +4 -1
  273. metadata +157 -324
  274. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  275. data/rbi/stripe/resources/account.rbi +0 -4903
  276. data/rbi/stripe/resources/account_link.rbi +0 -74
  277. data/rbi/stripe/resources/account_session.rbi +0 -894
  278. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -90
  279. data/rbi/stripe/resources/application.rbi +0 -20
  280. data/rbi/stripe/resources/application_fee.rbi +0 -118
  281. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  282. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  283. data/rbi/stripe/resources/balance.rbi +0 -180
  284. data/rbi/stripe/resources/balance_transaction.rbi +0 -144
  285. data/rbi/stripe/resources/bank_account.rbi +0 -127
  286. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  287. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  288. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  289. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  290. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  291. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  292. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  293. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  294. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  295. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  296. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  297. data/rbi/stripe/resources/capability.rbi +0 -125
  298. data/rbi/stripe/resources/card.rbi +0 -125
  299. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  300. data/rbi/stripe/resources/charge.rbi +0 -2057
  301. data/rbi/stripe/resources/checkout/session.rbi +0 -3988
  302. data/rbi/stripe/resources/climate/order.rbi +0 -245
  303. data/rbi/stripe/resources/climate/product.rbi +0 -75
  304. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  305. data/rbi/stripe/resources/confirmation_token.rbi +0 -1873
  306. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  307. data/rbi/stripe/resources/country_spec.rbi +0 -85
  308. data/rbi/stripe/resources/coupon.rbi +0 -252
  309. data/rbi/stripe/resources/credit_note.rbi +0 -747
  310. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  311. data/rbi/stripe/resources/customer.rbi +0 -1009
  312. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  313. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  314. data/rbi/stripe/resources/customer_session.rbi +0 -200
  315. data/rbi/stripe/resources/discount.rbi +0 -53
  316. data/rbi/stripe/resources/dispute.rbi +0 -761
  317. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  318. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  319. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  320. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  321. data/rbi/stripe/resources/event.rbi +0 -149
  322. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  323. data/rbi/stripe/resources/file.rbi +0 -143
  324. data/rbi/stripe/resources/file_link.rbi +0 -141
  325. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  326. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  327. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  328. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  329. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  330. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  331. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  332. data/rbi/stripe/resources/identity/verification_report.rbi +0 -351
  333. data/rbi/stripe/resources/identity/verification_session.rbi +0 -517
  334. data/rbi/stripe/resources/invoice.rbi +0 -3736
  335. data/rbi/stripe/resources/invoice_item.rbi +0 -475
  336. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  337. data/rbi/stripe/resources/invoice_payment.rbi +0 -114
  338. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  339. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  340. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  341. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  342. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  343. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  344. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  345. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  346. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  347. data/rbi/stripe/resources/line_item.rbi +0 -72
  348. data/rbi/stripe/resources/login_link.rbi +0 -19
  349. data/rbi/stripe/resources/mandate.rbi +0 -187
  350. data/rbi/stripe/resources/payment_intent.rbi +0 -9795
  351. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  352. data/rbi/stripe/resources/payment_method.rbi +0 -1831
  353. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3220
  354. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  355. data/rbi/stripe/resources/payout.rbi +0 -300
  356. data/rbi/stripe/resources/person.rbi +0 -401
  357. data/rbi/stripe/resources/plan.rbi +0 -373
  358. data/rbi/stripe/resources/price.rbi +0 -694
  359. data/rbi/stripe/resources/product.rbi +0 -557
  360. data/rbi/stripe/resources/product_feature.rbi +0 -26
  361. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  362. data/rbi/stripe/resources/quote.rbi +0 -1126
  363. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  364. data/rbi/stripe/resources/radar/value_list.rbi +0 -170
  365. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -131
  366. data/rbi/stripe/resources/refund.rbi +0 -519
  367. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  368. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  369. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  370. data/rbi/stripe/resources/reversal.rbi +0 -51
  371. data/rbi/stripe/resources/review.rbi +0 -154
  372. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  373. data/rbi/stripe/resources/setup_intent.rbi +0 -3869
  374. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  375. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  376. data/rbi/stripe/resources/source.rbi +0 -1496
  377. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  378. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  379. data/rbi/stripe/resources/subscription.rbi +0 -1964
  380. data/rbi/stripe/resources/subscription_item.rbi +0 -370
  381. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1495
  382. data/rbi/stripe/resources/tax/calculation.rbi +0 -474
  383. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -88
  384. data/rbi/stripe/resources/tax/registration.rbi +0 -2713
  385. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  386. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  387. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  388. data/rbi/stripe/resources/tax_code.rbi +0 -44
  389. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  390. data/rbi/stripe/resources/tax_id.rbi +0 -167
  391. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  392. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1388
  393. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  394. data/rbi/stripe/resources/terminal/location.rbi +0 -224
  395. data/rbi/stripe/resources/terminal/reader.rbi +0 -587
  396. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -134
  397. data/rbi/stripe/resources/token.rbi +0 -1283
  398. data/rbi/stripe/resources/topup.rbi +0 -222
  399. data/rbi/stripe/resources/transfer.rbi +0 -199
  400. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  401. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  402. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -865
  403. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  404. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  405. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  406. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  407. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  408. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  409. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  410. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  411. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  412. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  413. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  414. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  415. data/rbi/stripe/resources/v2/event.rbi +0 -48
  416. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  417. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -170
  418. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  419. data/rbi/stripe/services/account_link_service.rbi +0 -58
  420. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  421. data/rbi/stripe/services/account_person_service.rbi +0 -1013
  422. data/rbi/stripe/services/account_service.rbi +0 -4189
  423. data/rbi/stripe/services/account_session_service.rbi +0 -572
  424. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -78
  425. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  426. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  427. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  428. data/rbi/stripe/services/apps_service.rbi +0 -9
  429. data/rbi/stripe/services/balance_service.rbi +0 -21
  430. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  431. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  432. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  433. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  434. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  435. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  436. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  437. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  438. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  439. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  440. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  441. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  442. data/rbi/stripe/services/billing_service.rbi +0 -15
  443. data/rbi/stripe/services/charge_service.rbi +0 -448
  444. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  445. data/rbi/stripe/services/checkout/session_service.rbi +0 -2607
  446. data/rbi/stripe/services/checkout_service.rbi +0 -9
  447. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  448. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  449. data/rbi/stripe/services/climate_service.rbi +0 -11
  450. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  451. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  452. data/rbi/stripe/services/coupon_service.rbi +0 -196
  453. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  454. data/rbi/stripe/services/credit_note_service.rbi +0 -416
  455. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  456. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  457. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  458. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  459. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  460. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  461. data/rbi/stripe/services/customer_service.rbi +0 -651
  462. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  463. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -72
  464. data/rbi/stripe/services/dispute_service.rbi +0 -424
  465. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  466. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  467. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  468. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  469. data/rbi/stripe/services/event_service.rbi +0 -83
  470. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  471. data/rbi/stripe/services/file_link_service.rbi +0 -124
  472. data/rbi/stripe/services/file_service.rbi +0 -116
  473. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  474. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  475. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  476. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  477. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  478. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  479. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  480. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  481. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -323
  482. data/rbi/stripe/services/identity_service.rbi +0 -10
  483. data/rbi/stripe/services/invoice_item_service.rbi +0 -368
  484. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  485. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  486. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  487. data/rbi/stripe/services/invoice_service.rbi +0 -2920
  488. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  489. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  490. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  491. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  492. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  493. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  494. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  495. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  496. data/rbi/stripe/services/issuing_service.rbi +0 -16
  497. data/rbi/stripe/services/mandate_service.rbi +0 -20
  498. data/rbi/stripe/services/payment_intent_service.rbi +0 -7819
  499. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  500. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2255
  501. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  502. data/rbi/stripe/services/payment_method_service.rbi +0 -846
  503. data/rbi/stripe/services/payout_service.rbi +0 -205
  504. data/rbi/stripe/services/plan_service.rbi +0 -284
  505. data/rbi/stripe/services/price_service.rbi +0 -546
  506. data/rbi/stripe/services/product_feature_service.rbi +0 -69
  507. data/rbi/stripe/services/product_service.rbi +0 -479
  508. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  509. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  510. data/rbi/stripe/services/quote_service.rbi +0 -686
  511. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  512. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -111
  513. data/rbi/stripe/services/radar/value_list_service.rbi +0 -143
  514. data/rbi/stripe/services/radar_service.rbi +0 -11
  515. data/rbi/stripe/services/refund_service.rbi +0 -185
  516. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  517. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  518. data/rbi/stripe/services/reporting_service.rbi +0 -10
  519. data/rbi/stripe/services/review_service.rbi +0 -84
  520. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  521. data/rbi/stripe/services/setup_intent_service.rbi +0 -3605
  522. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  523. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  524. data/rbi/stripe/services/sigma_service.rbi +0 -9
  525. data/rbi/stripe/services/source_service.rbi +0 -663
  526. data/rbi/stripe/services/subscription_item_service.rbi +0 -324
  527. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1192
  528. data/rbi/stripe/services/subscription_service.rbi +0 -1596
  529. data/rbi/stripe/services/tax/calculation_service.rbi +0 -230
  530. data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
  531. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  532. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  533. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  534. data/rbi/stripe/services/tax_id_service.rbi +0 -112
  535. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  536. data/rbi/stripe/services/tax_service.rbi +0 -12
  537. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1120
  538. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  539. data/rbi/stripe/services/terminal/location_service.rbi +0 -184
  540. data/rbi/stripe/services/terminal/reader_service.rbi +0 -344
  541. data/rbi/stripe/services/terminal_service.rbi +0 -12
  542. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -805
  543. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  544. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  545. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  546. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  547. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  548. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  549. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  550. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -62
  551. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  552. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -92
  553. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  554. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  555. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  556. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  557. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  558. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  559. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  560. data/rbi/stripe/services/token_service.rbi +0 -1257
  561. data/rbi/stripe/services/topup_service.rbi +0 -176
  562. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  563. data/rbi/stripe/services/transfer_service.rbi +0 -152
  564. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  565. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  566. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  567. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -562
  568. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  569. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  570. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  571. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  572. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  573. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  574. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  575. data/rbi/stripe/services/treasury_service.rbi +0 -18
  576. data/rbi/stripe/services/v1_services.rbi +0 -77
  577. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  578. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  579. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -20
  580. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  581. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  582. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -200
  583. data/rbi/stripe/services/v2/core/event_service.rbi +0 -38
  584. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  585. data/rbi/stripe/services/v2_services.rbi +0 -10
  586. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -131
@@ -79,13 +79,36 @@ module Stripe
79
79
  attr_reader :transfer_data
80
80
  end
81
81
 
82
+ class LastPriceMigrationError < Stripe::StripeObject
83
+ class FailedTransition < Stripe::StripeObject
84
+ # The original price to be migrated.
85
+ attr_reader :source_price
86
+ # The intended resulting price of the migration.
87
+ attr_reader :target_price
88
+ end
89
+ # The time at which the price migration encountered an error.
90
+ attr_reader :errored_at
91
+ # The involved price pairs in each failed transition.
92
+ attr_reader :failed_transitions
93
+ # The type of error encountered by the price migration.
94
+ attr_reader :type
95
+ end
96
+
82
97
  class Phase < Stripe::StripeObject
83
98
  class AddInvoiceItem < Stripe::StripeObject
84
99
  class Discount < Stripe::StripeObject
100
+ class DiscountEnd < Stripe::StripeObject
101
+ # The discount end timestamp.
102
+ attr_reader :timestamp
103
+ # The discount end type.
104
+ attr_reader :type
105
+ end
85
106
  # ID of the coupon to create a new discount for.
86
107
  attr_reader :coupon
87
108
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
88
109
  attr_reader :discount
110
+ # Details to determine how long the discount should be applied for.
111
+ attr_reader :discount_end
89
112
  # ID of the promotion code to create a new discount for.
90
113
  attr_reader :promotion_code
91
114
  end
@@ -115,10 +138,18 @@ module Stripe
115
138
  end
116
139
 
117
140
  class Discount < Stripe::StripeObject
141
+ class DiscountEnd < Stripe::StripeObject
142
+ # The discount end timestamp.
143
+ attr_reader :timestamp
144
+ # The discount end type.
145
+ attr_reader :type
146
+ end
118
147
  # ID of the coupon to create a new discount for.
119
148
  attr_reader :coupon
120
149
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
121
150
  attr_reader :discount
151
+ # Details to determine how long the discount should be applied for.
152
+ attr_reader :discount_end
122
153
  # ID of the promotion code to create a new discount for.
123
154
  attr_reader :promotion_code
124
155
  end
@@ -140,13 +171,28 @@ module Stripe
140
171
 
141
172
  class Item < Stripe::StripeObject
142
173
  class Discount < Stripe::StripeObject
174
+ class DiscountEnd < Stripe::StripeObject
175
+ # The discount end timestamp.
176
+ attr_reader :timestamp
177
+ # The discount end type.
178
+ attr_reader :type
179
+ end
143
180
  # ID of the coupon to create a new discount for.
144
181
  attr_reader :coupon
145
182
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
146
183
  attr_reader :discount
184
+ # Details to determine how long the discount should be applied for.
185
+ attr_reader :discount_end
147
186
  # ID of the promotion code to create a new discount for.
148
187
  attr_reader :promotion_code
149
188
  end
189
+
190
+ class Trial < Stripe::StripeObject
191
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
192
+ attr_reader :converts_to
193
+ # Determines the type of trial for this item.
194
+ attr_reader :type
195
+ end
150
196
  # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
151
197
  attr_reader :discounts
152
198
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered.
@@ -159,6 +205,13 @@ module Stripe
159
205
  attr_reader :quantity
160
206
  # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`.
161
207
  attr_reader :tax_rates
208
+ # Options that configure the trial on the subscription item.
209
+ attr_reader :trial
210
+ end
211
+
212
+ class PauseCollection < Stripe::StripeObject
213
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
214
+ attr_reader :behavior
162
215
  end
163
216
 
164
217
  class TransferData < Stripe::StripeObject
@@ -167,6 +220,15 @@ module Stripe
167
220
  # The account where funds from the payment will be transferred to upon payment success.
168
221
  attr_reader :destination
169
222
  end
223
+
224
+ class TrialSettings < Stripe::StripeObject
225
+ class EndBehavior < Stripe::StripeObject
226
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
227
+ attr_reader :prorate_up_front
228
+ end
229
+ # Defines how the subscription should behave when a trial ends.
230
+ attr_reader :end_behavior
231
+ end
170
232
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
171
233
  attr_reader :add_invoice_items
172
234
  # 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 during this phase of the schedule.
@@ -197,14 +259,31 @@ module Stripe
197
259
  attr_reader :metadata
198
260
  # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
199
261
  attr_reader :on_behalf_of
262
+ # 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).
263
+ attr_reader :pause_collection
200
264
  # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
201
265
  attr_reader :proration_behavior
202
266
  # The start of this phase of the subscription schedule.
203
267
  attr_reader :start_date
204
268
  # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
205
269
  attr_reader :transfer_data
270
+ # Specify behavior of the trial when crossing schedule phase boundaries
271
+ attr_reader :trial_continuation
206
272
  # When the trial ends within the phase.
207
273
  attr_reader :trial_end
274
+ # Settings related to any trials on the subscription during this phase.
275
+ attr_reader :trial_settings
276
+ end
277
+
278
+ class Prebilling < Stripe::StripeObject
279
+ # ID of the prebilling invoice.
280
+ attr_reader :invoice
281
+ # The end of the last period for which the invoice pre-bills.
282
+ attr_reader :period_end
283
+ # The start of the first period for which the invoice pre-bills.
284
+ attr_reader :period_start
285
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
286
+ attr_reader :update_behavior
208
287
  end
209
288
 
210
289
  class ListParams < Stripe::RequestParams
@@ -287,6 +366,8 @@ module Stripe
287
366
  attr_accessor :created
288
367
  # Only return subscription schedules for the given customer.
289
368
  attr_accessor :customer
369
+ # Only return subscription schedules for the given account.
370
+ attr_accessor :customer_account
290
371
  # 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.
291
372
  attr_accessor :ending_before
292
373
  # Specifies which fields in the response should be expanded.
@@ -305,6 +386,7 @@ module Stripe
305
386
  completed_at: nil,
306
387
  created: nil,
307
388
  customer: nil,
389
+ customer_account: nil,
308
390
  ending_before: nil,
309
391
  expand: nil,
310
392
  limit: nil,
@@ -316,6 +398,7 @@ module Stripe
316
398
  @completed_at = completed_at
317
399
  @created = created
318
400
  @customer = customer
401
+ @customer_account = customer_account
319
402
  @ending_before = ending_before
320
403
  @expand = expand
321
404
  @limit = limit
@@ -432,16 +515,44 @@ module Stripe
432
515
  class Phase < Stripe::RequestParams
433
516
  class AddInvoiceItem < Stripe::RequestParams
434
517
  class Discount < Stripe::RequestParams
518
+ class DiscountEnd < Stripe::RequestParams
519
+ class Duration < Stripe::RequestParams
520
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
521
+ attr_accessor :interval
522
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
523
+ attr_accessor :interval_count
524
+
525
+ def initialize(interval: nil, interval_count: nil)
526
+ @interval = interval
527
+ @interval_count = interval_count
528
+ end
529
+ end
530
+ # Time span for the redeemed discount.
531
+ attr_accessor :duration
532
+ # A precise Unix timestamp for the discount to end. Must be in the future.
533
+ attr_accessor :timestamp
534
+ # The type of calculation made to determine when the discount ends.
535
+ attr_accessor :type
536
+
537
+ def initialize(duration: nil, timestamp: nil, type: nil)
538
+ @duration = duration
539
+ @timestamp = timestamp
540
+ @type = type
541
+ end
542
+ end
435
543
  # ID of the coupon to create a new discount for.
436
544
  attr_accessor :coupon
437
545
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
438
546
  attr_accessor :discount
547
+ # Details to determine how long the discount should be applied for.
548
+ attr_accessor :discount_end
439
549
  # ID of the promotion code to create a new discount for.
440
550
  attr_accessor :promotion_code
441
551
 
442
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
552
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
443
553
  @coupon = coupon
444
554
  @discount = discount
555
+ @discount_end = discount_end
445
556
  @promotion_code = promotion_code
446
557
  end
447
558
  end
@@ -516,16 +627,44 @@ module Stripe
516
627
  end
517
628
 
518
629
  class Discount < Stripe::RequestParams
630
+ class DiscountEnd < Stripe::RequestParams
631
+ class Duration < Stripe::RequestParams
632
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
633
+ attr_accessor :interval
634
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
635
+ attr_accessor :interval_count
636
+
637
+ def initialize(interval: nil, interval_count: nil)
638
+ @interval = interval
639
+ @interval_count = interval_count
640
+ end
641
+ end
642
+ # Time span for the redeemed discount.
643
+ attr_accessor :duration
644
+ # A precise Unix timestamp for the discount to end. Must be in the future.
645
+ attr_accessor :timestamp
646
+ # The type of calculation made to determine when the discount ends.
647
+ attr_accessor :type
648
+
649
+ def initialize(duration: nil, timestamp: nil, type: nil)
650
+ @duration = duration
651
+ @timestamp = timestamp
652
+ @type = type
653
+ end
654
+ end
519
655
  # ID of the coupon to create a new discount for.
520
656
  attr_accessor :coupon
521
657
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
522
658
  attr_accessor :discount
659
+ # Details to determine how long the discount should be applied for.
660
+ attr_accessor :discount_end
523
661
  # ID of the promotion code to create a new discount for.
524
662
  attr_accessor :promotion_code
525
663
 
526
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
664
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
527
665
  @coupon = coupon
528
666
  @discount = discount
667
+ @discount_end = discount_end
529
668
  @promotion_code = promotion_code
530
669
  end
531
670
  end
@@ -558,16 +697,44 @@ module Stripe
558
697
 
559
698
  class Item < Stripe::RequestParams
560
699
  class Discount < Stripe::RequestParams
700
+ class DiscountEnd < Stripe::RequestParams
701
+ class Duration < Stripe::RequestParams
702
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
703
+ attr_accessor :interval
704
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
705
+ attr_accessor :interval_count
706
+
707
+ def initialize(interval: nil, interval_count: nil)
708
+ @interval = interval
709
+ @interval_count = interval_count
710
+ end
711
+ end
712
+ # Time span for the redeemed discount.
713
+ attr_accessor :duration
714
+ # A precise Unix timestamp for the discount to end. Must be in the future.
715
+ attr_accessor :timestamp
716
+ # The type of calculation made to determine when the discount ends.
717
+ attr_accessor :type
718
+
719
+ def initialize(duration: nil, timestamp: nil, type: nil)
720
+ @duration = duration
721
+ @timestamp = timestamp
722
+ @type = type
723
+ end
724
+ end
561
725
  # ID of the coupon to create a new discount for.
562
726
  attr_accessor :coupon
563
727
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
564
728
  attr_accessor :discount
729
+ # Details to determine how long the discount should be applied for.
730
+ attr_accessor :discount_end
565
731
  # ID of the promotion code to create a new discount for.
566
732
  attr_accessor :promotion_code
567
733
 
568
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
734
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
569
735
  @coupon = coupon
570
736
  @discount = discount
737
+ @discount_end = discount_end
571
738
  @promotion_code = promotion_code
572
739
  end
573
740
  end
@@ -613,6 +780,18 @@ module Stripe
613
780
  @unit_amount_decimal = unit_amount_decimal
614
781
  end
615
782
  end
783
+
784
+ class Trial < Stripe::RequestParams
785
+ # 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.
786
+ attr_accessor :converts_to
787
+ # Determines the type of trial for this item.
788
+ attr_accessor :type
789
+
790
+ def initialize(converts_to: nil, type: nil)
791
+ @converts_to = converts_to
792
+ @type = type
793
+ end
794
+ end
616
795
  # The coupons to redeem into discounts for the subscription item.
617
796
  attr_accessor :discounts
618
797
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -627,6 +806,8 @@ module Stripe
627
806
  attr_accessor :quantity
628
807
  # 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.
629
808
  attr_accessor :tax_rates
809
+ # Options that configure the trial on the subscription item.
810
+ attr_accessor :trial
630
811
 
631
812
  def initialize(
632
813
  discounts: nil,
@@ -635,7 +816,8 @@ module Stripe
635
816
  price: nil,
636
817
  price_data: nil,
637
818
  quantity: nil,
638
- tax_rates: nil
819
+ tax_rates: nil,
820
+ trial: nil
639
821
  )
640
822
  @discounts = discounts
641
823
  @metadata = metadata
@@ -644,6 +826,16 @@ module Stripe
644
826
  @price_data = price_data
645
827
  @quantity = quantity
646
828
  @tax_rates = tax_rates
829
+ @trial = trial
830
+ end
831
+ end
832
+
833
+ class PauseCollection < Stripe::RequestParams
834
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
835
+ attr_accessor :behavior
836
+
837
+ def initialize(behavior: nil)
838
+ @behavior = behavior
647
839
  end
648
840
  end
649
841
 
@@ -658,6 +850,23 @@ module Stripe
658
850
  @destination = destination
659
851
  end
660
852
  end
853
+
854
+ class TrialSettings < Stripe::RequestParams
855
+ class EndBehavior < Stripe::RequestParams
856
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
857
+ attr_accessor :prorate_up_front
858
+
859
+ def initialize(prorate_up_front: nil)
860
+ @prorate_up_front = prorate_up_front
861
+ end
862
+ end
863
+ # Defines how the subscription should behave when a trial ends.
864
+ attr_accessor :end_behavior
865
+
866
+ def initialize(end_behavior: nil)
867
+ @end_behavior = end_behavior
868
+ end
869
+ end
661
870
  # 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.
662
871
  attr_accessor :add_invoice_items
663
872
  # 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).
@@ -690,14 +899,20 @@ module Stripe
690
899
  attr_accessor :metadata
691
900
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
692
901
  attr_accessor :on_behalf_of
902
+ # 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).
903
+ attr_accessor :pause_collection
693
904
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
694
905
  attr_accessor :proration_behavior
695
906
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
696
907
  attr_accessor :transfer_data
697
908
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
698
909
  attr_accessor :trial
910
+ # Specify trial behavior when crossing phase boundaries
911
+ attr_accessor :trial_continuation
699
912
  # 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`
700
913
  attr_accessor :trial_end
914
+ # Settings related to subscription trials.
915
+ attr_accessor :trial_settings
701
916
 
702
917
  def initialize(
703
918
  add_invoice_items: nil,
@@ -716,10 +931,13 @@ module Stripe
716
931
  iterations: nil,
717
932
  metadata: nil,
718
933
  on_behalf_of: nil,
934
+ pause_collection: nil,
719
935
  proration_behavior: nil,
720
936
  transfer_data: nil,
721
937
  trial: nil,
722
- trial_end: nil
938
+ trial_continuation: nil,
939
+ trial_end: nil,
940
+ trial_settings: nil
723
941
  )
724
942
  @add_invoice_items = add_invoice_items
725
943
  @application_fee_percent = application_fee_percent
@@ -737,14 +955,35 @@ module Stripe
737
955
  @iterations = iterations
738
956
  @metadata = metadata
739
957
  @on_behalf_of = on_behalf_of
958
+ @pause_collection = pause_collection
740
959
  @proration_behavior = proration_behavior
741
960
  @transfer_data = transfer_data
742
961
  @trial = trial
962
+ @trial_continuation = trial_continuation
743
963
  @trial_end = trial_end
964
+ @trial_settings = trial_settings
965
+ end
966
+ end
967
+
968
+ class Prebilling < Stripe::RequestParams
969
+ # This is used to determine the number of billing cycles to prebill.
970
+ attr_accessor :iterations
971
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
972
+ attr_accessor :update_behavior
973
+
974
+ def initialize(iterations: nil, update_behavior: nil)
975
+ @iterations = iterations
976
+ @update_behavior = update_behavior
744
977
  end
745
978
  end
979
+ # 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.
980
+ attr_accessor :billing_behavior
981
+ # Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
982
+ attr_accessor :billing_mode
746
983
  # The identifier of the customer to create the subscription schedule for.
747
984
  attr_accessor :customer
985
+ # The identifier of the account to create the subscription schedule for.
986
+ attr_accessor :customer_account
748
987
  # Object representing the subscription schedule's default settings.
749
988
  attr_accessor :default_settings
750
989
  # 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.
@@ -757,26 +996,36 @@ module Stripe
757
996
  attr_accessor :metadata
758
997
  # 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.
759
998
  attr_accessor :phases
999
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1000
+ attr_accessor :prebilling
760
1001
  # 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.
761
1002
  attr_accessor :start_date
762
1003
 
763
1004
  def initialize(
1005
+ billing_behavior: nil,
1006
+ billing_mode: nil,
764
1007
  customer: nil,
1008
+ customer_account: nil,
765
1009
  default_settings: nil,
766
1010
  end_behavior: nil,
767
1011
  expand: nil,
768
1012
  from_subscription: nil,
769
1013
  metadata: nil,
770
1014
  phases: nil,
1015
+ prebilling: nil,
771
1016
  start_date: nil
772
1017
  )
1018
+ @billing_behavior = billing_behavior
1019
+ @billing_mode = billing_mode
773
1020
  @customer = customer
1021
+ @customer_account = customer_account
774
1022
  @default_settings = default_settings
775
1023
  @end_behavior = end_behavior
776
1024
  @expand = expand
777
1025
  @from_subscription = from_subscription
778
1026
  @metadata = metadata
779
1027
  @phases = phases
1028
+ @prebilling = prebilling
780
1029
  @start_date = start_date
781
1030
  end
782
1031
  end
@@ -888,16 +1137,44 @@ module Stripe
888
1137
  class Phase < Stripe::RequestParams
889
1138
  class AddInvoiceItem < Stripe::RequestParams
890
1139
  class Discount < Stripe::RequestParams
1140
+ class DiscountEnd < Stripe::RequestParams
1141
+ class Duration < Stripe::RequestParams
1142
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1143
+ attr_accessor :interval
1144
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1145
+ attr_accessor :interval_count
1146
+
1147
+ def initialize(interval: nil, interval_count: nil)
1148
+ @interval = interval
1149
+ @interval_count = interval_count
1150
+ end
1151
+ end
1152
+ # Time span for the redeemed discount.
1153
+ attr_accessor :duration
1154
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1155
+ attr_accessor :timestamp
1156
+ # The type of calculation made to determine when the discount ends.
1157
+ attr_accessor :type
1158
+
1159
+ def initialize(duration: nil, timestamp: nil, type: nil)
1160
+ @duration = duration
1161
+ @timestamp = timestamp
1162
+ @type = type
1163
+ end
1164
+ end
891
1165
  # ID of the coupon to create a new discount for.
892
1166
  attr_accessor :coupon
893
1167
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
894
1168
  attr_accessor :discount
1169
+ # Details to determine how long the discount should be applied for.
1170
+ attr_accessor :discount_end
895
1171
  # ID of the promotion code to create a new discount for.
896
1172
  attr_accessor :promotion_code
897
1173
 
898
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1174
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
899
1175
  @coupon = coupon
900
1176
  @discount = discount
1177
+ @discount_end = discount_end
901
1178
  @promotion_code = promotion_code
902
1179
  end
903
1180
  end
@@ -972,16 +1249,44 @@ module Stripe
972
1249
  end
973
1250
 
974
1251
  class Discount < Stripe::RequestParams
1252
+ class DiscountEnd < Stripe::RequestParams
1253
+ class Duration < Stripe::RequestParams
1254
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1255
+ attr_accessor :interval
1256
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1257
+ attr_accessor :interval_count
1258
+
1259
+ def initialize(interval: nil, interval_count: nil)
1260
+ @interval = interval
1261
+ @interval_count = interval_count
1262
+ end
1263
+ end
1264
+ # Time span for the redeemed discount.
1265
+ attr_accessor :duration
1266
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1267
+ attr_accessor :timestamp
1268
+ # The type of calculation made to determine when the discount ends.
1269
+ attr_accessor :type
1270
+
1271
+ def initialize(duration: nil, timestamp: nil, type: nil)
1272
+ @duration = duration
1273
+ @timestamp = timestamp
1274
+ @type = type
1275
+ end
1276
+ end
975
1277
  # ID of the coupon to create a new discount for.
976
1278
  attr_accessor :coupon
977
1279
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
978
1280
  attr_accessor :discount
1281
+ # Details to determine how long the discount should be applied for.
1282
+ attr_accessor :discount_end
979
1283
  # ID of the promotion code to create a new discount for.
980
1284
  attr_accessor :promotion_code
981
1285
 
982
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1286
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
983
1287
  @coupon = coupon
984
1288
  @discount = discount
1289
+ @discount_end = discount_end
985
1290
  @promotion_code = promotion_code
986
1291
  end
987
1292
  end
@@ -1014,16 +1319,44 @@ module Stripe
1014
1319
 
1015
1320
  class Item < Stripe::RequestParams
1016
1321
  class Discount < Stripe::RequestParams
1322
+ class DiscountEnd < Stripe::RequestParams
1323
+ class Duration < Stripe::RequestParams
1324
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1325
+ attr_accessor :interval
1326
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1327
+ attr_accessor :interval_count
1328
+
1329
+ def initialize(interval: nil, interval_count: nil)
1330
+ @interval = interval
1331
+ @interval_count = interval_count
1332
+ end
1333
+ end
1334
+ # Time span for the redeemed discount.
1335
+ attr_accessor :duration
1336
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1337
+ attr_accessor :timestamp
1338
+ # The type of calculation made to determine when the discount ends.
1339
+ attr_accessor :type
1340
+
1341
+ def initialize(duration: nil, timestamp: nil, type: nil)
1342
+ @duration = duration
1343
+ @timestamp = timestamp
1344
+ @type = type
1345
+ end
1346
+ end
1017
1347
  # ID of the coupon to create a new discount for.
1018
1348
  attr_accessor :coupon
1019
1349
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1020
1350
  attr_accessor :discount
1351
+ # Details to determine how long the discount should be applied for.
1352
+ attr_accessor :discount_end
1021
1353
  # ID of the promotion code to create a new discount for.
1022
1354
  attr_accessor :promotion_code
1023
1355
 
1024
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1356
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1025
1357
  @coupon = coupon
1026
1358
  @discount = discount
1359
+ @discount_end = discount_end
1027
1360
  @promotion_code = promotion_code
1028
1361
  end
1029
1362
  end
@@ -1069,6 +1402,18 @@ module Stripe
1069
1402
  @unit_amount_decimal = unit_amount_decimal
1070
1403
  end
1071
1404
  end
1405
+
1406
+ class Trial < Stripe::RequestParams
1407
+ # 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.
1408
+ attr_accessor :converts_to
1409
+ # Determines the type of trial for this item.
1410
+ attr_accessor :type
1411
+
1412
+ def initialize(converts_to: nil, type: nil)
1413
+ @converts_to = converts_to
1414
+ @type = type
1415
+ end
1416
+ end
1072
1417
  # The coupons to redeem into discounts for the subscription item.
1073
1418
  attr_accessor :discounts
1074
1419
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -1083,6 +1428,8 @@ module Stripe
1083
1428
  attr_accessor :quantity
1084
1429
  # 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.
1085
1430
  attr_accessor :tax_rates
1431
+ # Options that configure the trial on the subscription item.
1432
+ attr_accessor :trial
1086
1433
 
1087
1434
  def initialize(
1088
1435
  discounts: nil,
@@ -1091,7 +1438,8 @@ module Stripe
1091
1438
  price: nil,
1092
1439
  price_data: nil,
1093
1440
  quantity: nil,
1094
- tax_rates: nil
1441
+ tax_rates: nil,
1442
+ trial: nil
1095
1443
  )
1096
1444
  @discounts = discounts
1097
1445
  @metadata = metadata
@@ -1100,6 +1448,16 @@ module Stripe
1100
1448
  @price_data = price_data
1101
1449
  @quantity = quantity
1102
1450
  @tax_rates = tax_rates
1451
+ @trial = trial
1452
+ end
1453
+ end
1454
+
1455
+ class PauseCollection < Stripe::RequestParams
1456
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1457
+ attr_accessor :behavior
1458
+
1459
+ def initialize(behavior: nil)
1460
+ @behavior = behavior
1103
1461
  end
1104
1462
  end
1105
1463
 
@@ -1114,6 +1472,23 @@ module Stripe
1114
1472
  @destination = destination
1115
1473
  end
1116
1474
  end
1475
+
1476
+ class TrialSettings < Stripe::RequestParams
1477
+ class EndBehavior < Stripe::RequestParams
1478
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1479
+ attr_accessor :prorate_up_front
1480
+
1481
+ def initialize(prorate_up_front: nil)
1482
+ @prorate_up_front = prorate_up_front
1483
+ end
1484
+ end
1485
+ # Defines how the subscription should behave when a trial ends.
1486
+ attr_accessor :end_behavior
1487
+
1488
+ def initialize(end_behavior: nil)
1489
+ @end_behavior = end_behavior
1490
+ end
1491
+ end
1117
1492
  # 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.
1118
1493
  attr_accessor :add_invoice_items
1119
1494
  # 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).
@@ -1146,6 +1521,8 @@ module Stripe
1146
1521
  attr_accessor :metadata
1147
1522
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1148
1523
  attr_accessor :on_behalf_of
1524
+ # 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).
1525
+ attr_accessor :pause_collection
1149
1526
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
1150
1527
  attr_accessor :proration_behavior
1151
1528
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -1154,8 +1531,12 @@ module Stripe
1154
1531
  attr_accessor :transfer_data
1155
1532
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1156
1533
  attr_accessor :trial
1534
+ # Specify trial behavior when crossing phase boundaries
1535
+ attr_accessor :trial_continuation
1157
1536
  # 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`
1158
1537
  attr_accessor :trial_end
1538
+ # Settings related to subscription trials.
1539
+ attr_accessor :trial_settings
1159
1540
 
1160
1541
  def initialize(
1161
1542
  add_invoice_items: nil,
@@ -1174,11 +1555,14 @@ module Stripe
1174
1555
  iterations: nil,
1175
1556
  metadata: nil,
1176
1557
  on_behalf_of: nil,
1558
+ pause_collection: nil,
1177
1559
  proration_behavior: nil,
1178
1560
  start_date: nil,
1179
1561
  transfer_data: nil,
1180
1562
  trial: nil,
1181
- trial_end: nil
1563
+ trial_continuation: nil,
1564
+ trial_end: nil,
1565
+ trial_settings: nil
1182
1566
  )
1183
1567
  @add_invoice_items = add_invoice_items
1184
1568
  @application_fee_percent = application_fee_percent
@@ -1196,13 +1580,30 @@ module Stripe
1196
1580
  @iterations = iterations
1197
1581
  @metadata = metadata
1198
1582
  @on_behalf_of = on_behalf_of
1583
+ @pause_collection = pause_collection
1199
1584
  @proration_behavior = proration_behavior
1200
1585
  @start_date = start_date
1201
1586
  @transfer_data = transfer_data
1202
1587
  @trial = trial
1588
+ @trial_continuation = trial_continuation
1203
1589
  @trial_end = trial_end
1590
+ @trial_settings = trial_settings
1591
+ end
1592
+ end
1593
+
1594
+ class Prebilling < Stripe::RequestParams
1595
+ # This is used to determine the number of billing cycles to prebill.
1596
+ attr_accessor :iterations
1597
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1598
+ attr_accessor :update_behavior
1599
+
1600
+ def initialize(iterations: nil, update_behavior: nil)
1601
+ @iterations = iterations
1602
+ @update_behavior = update_behavior
1204
1603
  end
1205
1604
  end
1605
+ # 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.
1606
+ attr_accessor :billing_behavior
1206
1607
  # Object representing the subscription schedule's default settings.
1207
1608
  attr_accessor :default_settings
1208
1609
  # 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.
@@ -1213,23 +1614,595 @@ module Stripe
1213
1614
  attr_accessor :metadata
1214
1615
  # 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.
1215
1616
  attr_accessor :phases
1617
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1618
+ attr_accessor :prebilling
1216
1619
  # If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1217
1620
  attr_accessor :proration_behavior
1218
1621
 
1219
1622
  def initialize(
1623
+ billing_behavior: nil,
1220
1624
  default_settings: nil,
1221
1625
  end_behavior: nil,
1222
1626
  expand: nil,
1223
1627
  metadata: nil,
1224
1628
  phases: nil,
1629
+ prebilling: nil,
1225
1630
  proration_behavior: nil
1226
1631
  )
1632
+ @billing_behavior = billing_behavior
1227
1633
  @default_settings = default_settings
1228
1634
  @end_behavior = end_behavior
1229
1635
  @expand = expand
1230
1636
  @metadata = metadata
1231
1637
  @phases = phases
1638
+ @prebilling = prebilling
1639
+ @proration_behavior = proration_behavior
1640
+ end
1641
+ end
1642
+
1643
+ class AmendParams < Stripe::RequestParams
1644
+ class Amendment < Stripe::RequestParams
1645
+ class AmendmentEnd < Stripe::RequestParams
1646
+ class DiscountEnd < Stripe::RequestParams
1647
+ # The ID of a specific discount.
1648
+ attr_accessor :discount
1649
+
1650
+ def initialize(discount: nil)
1651
+ @discount = discount
1652
+ end
1653
+ end
1654
+
1655
+ class Duration < Stripe::RequestParams
1656
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1657
+ attr_accessor :interval
1658
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1659
+ attr_accessor :interval_count
1660
+
1661
+ def initialize(interval: nil, interval_count: nil)
1662
+ @interval = interval
1663
+ @interval_count = interval_count
1664
+ end
1665
+ end
1666
+ # Use the `end` time of a given discount.
1667
+ attr_accessor :discount_end
1668
+ # Time span for the amendment starting from the `amendment_start`.
1669
+ attr_accessor :duration
1670
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1671
+ attr_accessor :timestamp
1672
+ # Select one of three ways to pass the `amendment_end`.
1673
+ attr_accessor :type
1674
+
1675
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1676
+ @discount_end = discount_end
1677
+ @duration = duration
1678
+ @timestamp = timestamp
1679
+ @type = type
1680
+ end
1681
+ end
1682
+
1683
+ class AmendmentStart < Stripe::RequestParams
1684
+ class AmendmentEnd < Stripe::RequestParams
1685
+ # 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.
1686
+ attr_accessor :index
1687
+
1688
+ def initialize(index: nil)
1689
+ @index = index
1690
+ end
1691
+ end
1692
+
1693
+ class DiscountEnd < Stripe::RequestParams
1694
+ # The ID of a specific discount.
1695
+ attr_accessor :discount
1696
+
1697
+ def initialize(discount: nil)
1698
+ @discount = discount
1699
+ end
1700
+ end
1701
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
1702
+ attr_accessor :amendment_end
1703
+ # Use the `end` time of a given discount.
1704
+ attr_accessor :discount_end
1705
+ # A precise Unix timestamp for the amendment to start.
1706
+ attr_accessor :timestamp
1707
+ # Select one of three ways to pass the `amendment_start`.
1708
+ attr_accessor :type
1709
+
1710
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
1711
+ @amendment_end = amendment_end
1712
+ @discount_end = discount_end
1713
+ @timestamp = timestamp
1714
+ @type = type
1715
+ end
1716
+ end
1717
+
1718
+ class DiscountAction < Stripe::RequestParams
1719
+ class Add < Stripe::RequestParams
1720
+ class DiscountEnd < Stripe::RequestParams
1721
+ # The type of calculation made to determine when the discount ends.
1722
+ attr_accessor :type
1723
+
1724
+ def initialize(type: nil)
1725
+ @type = type
1726
+ end
1727
+ end
1728
+ # The coupon code to redeem.
1729
+ attr_accessor :coupon
1730
+ # An ID of an existing discount for a coupon that was already redeemed.
1731
+ attr_accessor :discount
1732
+ # Details to determine how long the discount should be applied for.
1733
+ attr_accessor :discount_end
1734
+ # 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.
1735
+ attr_accessor :index
1736
+ # The promotion code to redeem.
1737
+ attr_accessor :promotion_code
1738
+
1739
+ def initialize(
1740
+ coupon: nil,
1741
+ discount: nil,
1742
+ discount_end: nil,
1743
+ index: nil,
1744
+ promotion_code: nil
1745
+ )
1746
+ @coupon = coupon
1747
+ @discount = discount
1748
+ @discount_end = discount_end
1749
+ @index = index
1750
+ @promotion_code = promotion_code
1751
+ end
1752
+ end
1753
+
1754
+ class Remove < Stripe::RequestParams
1755
+ # The coupon code to remove from the `discounts` array.
1756
+ attr_accessor :coupon
1757
+ # The ID of a discount to remove from the `discounts` array.
1758
+ attr_accessor :discount
1759
+ # The ID of a promotion code to remove from the `discounts` array.
1760
+ attr_accessor :promotion_code
1761
+
1762
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1763
+ @coupon = coupon
1764
+ @discount = discount
1765
+ @promotion_code = promotion_code
1766
+ end
1767
+ end
1768
+
1769
+ class Set < Stripe::RequestParams
1770
+ # The coupon code to replace the `discounts` array with.
1771
+ attr_accessor :coupon
1772
+ # An ID of an existing discount to replace the `discounts` array with.
1773
+ attr_accessor :discount
1774
+ # An ID of an existing promotion code to replace the `discounts` array with.
1775
+ attr_accessor :promotion_code
1776
+
1777
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1778
+ @coupon = coupon
1779
+ @discount = discount
1780
+ @promotion_code = promotion_code
1781
+ end
1782
+ end
1783
+ # Details of the discount to add.
1784
+ attr_accessor :add
1785
+ # Details of the discount to remove.
1786
+ attr_accessor :remove
1787
+ # Details of the discount to replace the existing discounts with.
1788
+ attr_accessor :set
1789
+ # Determines the type of discount action.
1790
+ attr_accessor :type
1791
+
1792
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1793
+ @add = add
1794
+ @remove = remove
1795
+ @set = set
1796
+ @type = type
1797
+ end
1798
+ end
1799
+
1800
+ class ItemAction < Stripe::RequestParams
1801
+ class Add < Stripe::RequestParams
1802
+ class Discount < Stripe::RequestParams
1803
+ class DiscountEnd < Stripe::RequestParams
1804
+ class Duration < Stripe::RequestParams
1805
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1806
+ attr_accessor :interval
1807
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1808
+ attr_accessor :interval_count
1809
+
1810
+ def initialize(interval: nil, interval_count: nil)
1811
+ @interval = interval
1812
+ @interval_count = interval_count
1813
+ end
1814
+ end
1815
+ # Time span for the redeemed discount.
1816
+ attr_accessor :duration
1817
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1818
+ attr_accessor :timestamp
1819
+ # The type of calculation made to determine when the discount ends.
1820
+ attr_accessor :type
1821
+
1822
+ def initialize(duration: nil, timestamp: nil, type: nil)
1823
+ @duration = duration
1824
+ @timestamp = timestamp
1825
+ @type = type
1826
+ end
1827
+ end
1828
+ # ID of the coupon to create a new discount for.
1829
+ attr_accessor :coupon
1830
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1831
+ attr_accessor :discount
1832
+ # Details to determine how long the discount should be applied for.
1833
+ attr_accessor :discount_end
1834
+ # ID of the promotion code to create a new discount for.
1835
+ attr_accessor :promotion_code
1836
+
1837
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1838
+ @coupon = coupon
1839
+ @discount = discount
1840
+ @discount_end = discount_end
1841
+ @promotion_code = promotion_code
1842
+ end
1843
+ end
1844
+
1845
+ class Trial < Stripe::RequestParams
1846
+ # 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.
1847
+ attr_accessor :converts_to
1848
+ # Determines the type of trial for this item.
1849
+ attr_accessor :type
1850
+
1851
+ def initialize(converts_to: nil, type: nil)
1852
+ @converts_to = converts_to
1853
+ @type = type
1854
+ end
1855
+ end
1856
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1857
+ attr_accessor :discounts
1858
+ # 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`.
1859
+ attr_accessor :metadata
1860
+ # The ID of the price object.
1861
+ attr_accessor :price
1862
+ # Quantity for this item.
1863
+ attr_accessor :quantity
1864
+ # 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`.
1865
+ attr_accessor :tax_rates
1866
+ # Options that configure the trial on the subscription item.
1867
+ attr_accessor :trial
1868
+
1869
+ def initialize(
1870
+ discounts: nil,
1871
+ metadata: nil,
1872
+ price: nil,
1873
+ quantity: nil,
1874
+ tax_rates: nil,
1875
+ trial: nil
1876
+ )
1877
+ @discounts = discounts
1878
+ @metadata = metadata
1879
+ @price = price
1880
+ @quantity = quantity
1881
+ @tax_rates = tax_rates
1882
+ @trial = trial
1883
+ end
1884
+ end
1885
+
1886
+ class Remove < Stripe::RequestParams
1887
+ # ID of a price to remove.
1888
+ attr_accessor :price
1889
+
1890
+ def initialize(price: nil)
1891
+ @price = price
1892
+ end
1893
+ end
1894
+
1895
+ class Set < Stripe::RequestParams
1896
+ class Discount < Stripe::RequestParams
1897
+ class DiscountEnd < Stripe::RequestParams
1898
+ class Duration < Stripe::RequestParams
1899
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1900
+ attr_accessor :interval
1901
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1902
+ attr_accessor :interval_count
1903
+
1904
+ def initialize(interval: nil, interval_count: nil)
1905
+ @interval = interval
1906
+ @interval_count = interval_count
1907
+ end
1908
+ end
1909
+ # Time span for the redeemed discount.
1910
+ attr_accessor :duration
1911
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1912
+ attr_accessor :timestamp
1913
+ # The type of calculation made to determine when the discount ends.
1914
+ attr_accessor :type
1915
+
1916
+ def initialize(duration: nil, timestamp: nil, type: nil)
1917
+ @duration = duration
1918
+ @timestamp = timestamp
1919
+ @type = type
1920
+ end
1921
+ end
1922
+ # ID of the coupon to create a new discount for.
1923
+ attr_accessor :coupon
1924
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1925
+ attr_accessor :discount
1926
+ # Details to determine how long the discount should be applied for.
1927
+ attr_accessor :discount_end
1928
+ # ID of the promotion code to create a new discount for.
1929
+ attr_accessor :promotion_code
1930
+
1931
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1932
+ @coupon = coupon
1933
+ @discount = discount
1934
+ @discount_end = discount_end
1935
+ @promotion_code = promotion_code
1936
+ end
1937
+ end
1938
+
1939
+ class Trial < Stripe::RequestParams
1940
+ # 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.
1941
+ attr_accessor :converts_to
1942
+ # Determines the type of trial for this item.
1943
+ attr_accessor :type
1944
+
1945
+ def initialize(converts_to: nil, type: nil)
1946
+ @converts_to = converts_to
1947
+ @type = type
1948
+ end
1949
+ end
1950
+ # 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`.
1951
+ attr_accessor :discounts
1952
+ # 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`.
1953
+ attr_accessor :metadata
1954
+ # The ID of the price object.
1955
+ attr_accessor :price
1956
+ # 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`.
1957
+ attr_accessor :quantity
1958
+ # 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`.
1959
+ attr_accessor :tax_rates
1960
+ # 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`.
1961
+ attr_accessor :trial
1962
+
1963
+ def initialize(
1964
+ discounts: nil,
1965
+ metadata: nil,
1966
+ price: nil,
1967
+ quantity: nil,
1968
+ tax_rates: nil,
1969
+ trial: nil
1970
+ )
1971
+ @discounts = discounts
1972
+ @metadata = metadata
1973
+ @price = price
1974
+ @quantity = quantity
1975
+ @tax_rates = tax_rates
1976
+ @trial = trial
1977
+ end
1978
+ end
1979
+ # 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.
1980
+ attr_accessor :add
1981
+ # Details of the subscription item to remove.
1982
+ attr_accessor :remove
1983
+ # 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.
1984
+ attr_accessor :set
1985
+ # Determines the type of item action.
1986
+ attr_accessor :type
1987
+
1988
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1989
+ @add = add
1990
+ @remove = remove
1991
+ @set = set
1992
+ @type = type
1993
+ end
1994
+ end
1995
+
1996
+ class MetadataAction < Stripe::RequestParams
1997
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
1998
+ attr_accessor :add
1999
+ # Keys to remove from schedule phase metadata.
2000
+ attr_accessor :remove
2001
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2002
+ attr_accessor :set
2003
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
2004
+ attr_accessor :type
2005
+
2006
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2007
+ @add = add
2008
+ @remove = remove
2009
+ @set = set
2010
+ @type = type
2011
+ end
2012
+ end
2013
+
2014
+ class SetPauseCollection < Stripe::RequestParams
2015
+ class Set < Stripe::RequestParams
2016
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2017
+ attr_accessor :behavior
2018
+
2019
+ def initialize(behavior: nil)
2020
+ @behavior = behavior
2021
+ end
2022
+ end
2023
+ # Details of the pause_collection behavior to apply to the amendment.
2024
+ attr_accessor :set
2025
+ # Determines the type of the pause_collection amendment.
2026
+ attr_accessor :type
2027
+
2028
+ def initialize(set: nil, type: nil)
2029
+ @set = set
2030
+ @type = type
2031
+ end
2032
+ end
2033
+
2034
+ class TrialSettings < Stripe::RequestParams
2035
+ class EndBehavior < Stripe::RequestParams
2036
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2037
+ attr_accessor :prorate_up_front
2038
+
2039
+ def initialize(prorate_up_front: nil)
2040
+ @prorate_up_front = prorate_up_front
2041
+ end
2042
+ end
2043
+ # Defines how the subscription should behave when a trial ends.
2044
+ attr_accessor :end_behavior
2045
+
2046
+ def initialize(end_behavior: nil)
2047
+ @end_behavior = end_behavior
2048
+ end
2049
+ end
2050
+ # 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.
2051
+ attr_accessor :amendment_end
2052
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2053
+ attr_accessor :amendment_start
2054
+ # 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.
2055
+ attr_accessor :billing_cycle_anchor
2056
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2057
+ attr_accessor :discount_actions
2058
+ # Changes to the subscription items during the amendment time span.
2059
+ attr_accessor :item_actions
2060
+ # Instructions for how to modify phase metadata
2061
+ attr_accessor :metadata_actions
2062
+ # 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`.
2063
+ attr_accessor :proration_behavior
2064
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2065
+ attr_accessor :set_pause_collection
2066
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2067
+ attr_accessor :set_schedule_end
2068
+ # Settings related to subscription trials.
2069
+ attr_accessor :trial_settings
2070
+
2071
+ def initialize(
2072
+ amendment_end: nil,
2073
+ amendment_start: nil,
2074
+ billing_cycle_anchor: nil,
2075
+ discount_actions: nil,
2076
+ item_actions: nil,
2077
+ metadata_actions: nil,
2078
+ proration_behavior: nil,
2079
+ set_pause_collection: nil,
2080
+ set_schedule_end: nil,
2081
+ trial_settings: nil
2082
+ )
2083
+ @amendment_end = amendment_end
2084
+ @amendment_start = amendment_start
2085
+ @billing_cycle_anchor = billing_cycle_anchor
2086
+ @discount_actions = discount_actions
2087
+ @item_actions = item_actions
2088
+ @metadata_actions = metadata_actions
2089
+ @proration_behavior = proration_behavior
2090
+ @set_pause_collection = set_pause_collection
2091
+ @set_schedule_end = set_schedule_end
2092
+ @trial_settings = trial_settings
2093
+ end
2094
+ end
2095
+
2096
+ class Prebilling < Stripe::RequestParams
2097
+ class BillFrom < Stripe::RequestParams
2098
+ class AmendmentStart < Stripe::RequestParams
2099
+ # 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.
2100
+ attr_accessor :index
2101
+
2102
+ def initialize(index: nil)
2103
+ @index = index
2104
+ end
2105
+ end
2106
+ # Start the prebilled period when a specified amendment begins.
2107
+ attr_accessor :amendment_start
2108
+ # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2109
+ attr_accessor :timestamp
2110
+ # Select one of several ways to pass the `bill_from` value.
2111
+ attr_accessor :type
2112
+
2113
+ def initialize(amendment_start: nil, timestamp: nil, type: nil)
2114
+ @amendment_start = amendment_start
2115
+ @timestamp = timestamp
2116
+ @type = type
2117
+ end
2118
+ end
2119
+
2120
+ class BillUntil < Stripe::RequestParams
2121
+ class AmendmentEnd < Stripe::RequestParams
2122
+ # 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.
2123
+ attr_accessor :index
2124
+
2125
+ def initialize(index: nil)
2126
+ @index = index
2127
+ end
2128
+ end
2129
+
2130
+ class Duration < Stripe::RequestParams
2131
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2132
+ attr_accessor :interval
2133
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2134
+ attr_accessor :interval_count
2135
+
2136
+ def initialize(interval: nil, interval_count: nil)
2137
+ @interval = interval
2138
+ @interval_count = interval_count
2139
+ end
2140
+ end
2141
+ # End the prebilled period when a specified amendment ends.
2142
+ attr_accessor :amendment_end
2143
+ # Time span for prebilling, starting from `bill_from`.
2144
+ attr_accessor :duration
2145
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2146
+ attr_accessor :timestamp
2147
+ # Select one of several ways to pass the `bill_until` value.
2148
+ attr_accessor :type
2149
+
2150
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
2151
+ @amendment_end = amendment_end
2152
+ @duration = duration
2153
+ @timestamp = timestamp
2154
+ @type = type
2155
+ end
2156
+ end
2157
+ # The beginning of the prebilled time period. The default value is `now`.
2158
+ attr_accessor :bill_from
2159
+ # The end of the prebilled time period.
2160
+ attr_accessor :bill_until
2161
+ # When the prebilling invoice should be created. The default value is `now`.
2162
+ attr_accessor :invoice_at
2163
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2164
+ attr_accessor :update_behavior
2165
+
2166
+ def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
2167
+ @bill_from = bill_from
2168
+ @bill_until = bill_until
2169
+ @invoice_at = invoice_at
2170
+ @update_behavior = update_behavior
2171
+ end
2172
+ end
2173
+
2174
+ class ScheduleSettings < Stripe::RequestParams
2175
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2176
+ attr_accessor :end_behavior
2177
+
2178
+ def initialize(end_behavior: nil)
2179
+ @end_behavior = end_behavior
2180
+ end
2181
+ end
2182
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
2183
+ attr_accessor :amendments
2184
+ # Specifies which fields in the response should be expanded.
2185
+ attr_accessor :expand
2186
+ # Provide any time periods to bill in advance.
2187
+ attr_accessor :prebilling
2188
+ # In cases where the amendment changes the currently active phase,
2189
+ # specifies if and how to prorate at the time of the request.
2190
+ attr_accessor :proration_behavior
2191
+ # Changes to apply to the subscription schedule.
2192
+ attr_accessor :schedule_settings
2193
+
2194
+ def initialize(
2195
+ amendments: nil,
2196
+ expand: nil,
2197
+ prebilling: nil,
2198
+ proration_behavior: nil,
2199
+ schedule_settings: nil
2200
+ )
2201
+ @amendments = amendments
2202
+ @expand = expand
2203
+ @prebilling = prebilling
1232
2204
  @proration_behavior = proration_behavior
2205
+ @schedule_settings = schedule_settings
1233
2206
  end
1234
2207
  end
1235
2208
 
@@ -1261,6 +2234,10 @@ module Stripe
1261
2234
  end
1262
2235
  # ID of the Connect Application that created the schedule.
1263
2236
  attr_reader :application
2237
+ # 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.
2238
+ attr_reader :billing_behavior
2239
+ # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule.
2240
+ attr_reader :billing_mode
1264
2241
  # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
1265
2242
  attr_reader :canceled_at
1266
2243
  # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
@@ -1271,12 +2248,16 @@ module Stripe
1271
2248
  attr_reader :current_phase
1272
2249
  # ID of the customer who owns the subscription schedule.
1273
2250
  attr_reader :customer
2251
+ # ID of the account who owns the subscription schedule.
2252
+ attr_reader :customer_account
1274
2253
  # Attribute for field default_settings
1275
2254
  attr_reader :default_settings
1276
2255
  # 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.
1277
2256
  attr_reader :end_behavior
1278
2257
  # Unique identifier for the object.
1279
2258
  attr_reader :id
2259
+ # Details of the most recent price migration that failed for the subscription schedule.
2260
+ attr_reader :last_price_migration_error
1280
2261
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
1281
2262
  attr_reader :livemode
1282
2263
  # 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.
@@ -1285,6 +2266,8 @@ module Stripe
1285
2266
  attr_reader :object
1286
2267
  # Configuration for the subscription schedule's phases.
1287
2268
  attr_reader :phases
2269
+ # Time period and invoice for a Subscription billed in advance.
2270
+ attr_reader :prebilling
1288
2271
  # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
1289
2272
  attr_reader :released_at
1290
2273
  # ID of the subscription once managed by the subscription schedule (if it is released).
@@ -1296,6 +2279,26 @@ module Stripe
1296
2279
  # ID of the test clock this subscription schedule belongs to.
1297
2280
  attr_reader :test_clock
1298
2281
 
2282
+ # Amends an existing subscription schedule.
2283
+ def amend(params = {}, opts = {})
2284
+ request_stripe_object(
2285
+ method: :post,
2286
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
2287
+ params: params,
2288
+ opts: opts
2289
+ )
2290
+ end
2291
+
2292
+ # Amends an existing subscription schedule.
2293
+ def self.amend(schedule, params = {}, opts = {})
2294
+ request_stripe_object(
2295
+ method: :post,
2296
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
2297
+ params: params,
2298
+ opts: opts
2299
+ )
2300
+ end
2301
+
1299
2302
  # 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.
1300
2303
  def cancel(params = {}, opts = {})
1301
2304
  request_stripe_object(