stripe 15.2.0 → 15.3.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 (587) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1600 -670
  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 +98 -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/events/v2_off_session_payment_requires_capture_event.rb +21 -0
  59. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  60. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +21 -0
  61. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  62. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  65. data/lib/stripe/object_types.rb +50 -0
  66. data/lib/stripe/resources/account.rb +653 -1
  67. data/lib/stripe/resources/account_notice.rb +123 -0
  68. data/lib/stripe/resources/account_session.rb +256 -1
  69. data/lib/stripe/resources/balance_settings.rb +105 -0
  70. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  71. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  72. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  73. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  74. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  75. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  76. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  77. data/lib/stripe/resources/card.rb +2 -0
  78. data/lib/stripe/resources/cash_balance.rb +2 -0
  79. data/lib/stripe/resources/charge.rb +1538 -0
  80. data/lib/stripe/resources/checkout/session.rb +330 -2
  81. data/lib/stripe/resources/confirmation_token.rb +170 -0
  82. data/lib/stripe/resources/coupon.rb +30 -1
  83. data/lib/stripe/resources/credit_note.rb +6 -0
  84. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  85. data/lib/stripe/resources/customer.rb +2 -0
  86. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  87. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  88. data/lib/stripe/resources/customer_session.rb +6 -1
  89. data/lib/stripe/resources/discount.rb +2 -0
  90. data/lib/stripe/resources/event.rb +31 -0
  91. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  92. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  93. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  94. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  95. data/lib/stripe/resources/fx_quote.rb +184 -0
  96. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  97. data/lib/stripe/resources/invoice.rb +1070 -16
  98. data/lib/stripe/resources/invoice_item.rb +78 -2
  99. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  100. data/lib/stripe/resources/invoice_payment.rb +2 -53
  101. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  102. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  103. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  104. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  105. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  106. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  107. data/lib/stripe/resources/line_item.rb +37 -0
  108. data/lib/stripe/resources/mandate.rb +24 -0
  109. data/lib/stripe/resources/margin.rb +115 -0
  110. data/lib/stripe/resources/order.rb +2806 -0
  111. data/lib/stripe/resources/payment_attempt_record.rb +1086 -0
  112. data/lib/stripe/resources/payment_intent.rb +7694 -2738
  113. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  114. data/lib/stripe/resources/payment_method.rb +192 -1
  115. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  116. data/lib/stripe/resources/payment_record.rb +1615 -0
  117. data/lib/stripe/resources/payout.rb +6 -0
  118. data/lib/stripe/resources/price.rb +30 -0
  119. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  120. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  121. data/lib/stripe/resources/promotion_code.rb +10 -0
  122. data/lib/stripe/resources/quote.rb +2046 -6
  123. data/lib/stripe/resources/quote_line.rb +274 -0
  124. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  125. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +364 -0
  126. data/lib/stripe/resources/refund.rb +9 -0
  127. data/lib/stripe/resources/setup_attempt.rb +21 -0
  128. data/lib/stripe/resources/setup_intent.rb +578 -9
  129. data/lib/stripe/resources/source.rb +29 -0
  130. data/lib/stripe/resources/subscription.rb +333 -9
  131. data/lib/stripe/resources/subscription_item.rb +84 -3
  132. data/lib/stripe/resources/subscription_schedule.rb +1013 -10
  133. data/lib/stripe/resources/tax/association.rb +66 -0
  134. data/lib/stripe/resources/tax/form.rb +211 -0
  135. data/lib/stripe/resources/tax_id.rb +12 -2
  136. data/lib/stripe/resources/terminal/reader.rb +156 -0
  137. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  138. data/lib/stripe/resources/transfer.rb +6 -0
  139. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  140. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  141. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  142. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  143. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  144. data/lib/stripe/resources/v2/core/account.rb +1746 -0
  145. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  146. data/lib/stripe/resources/v2/core/person.rb +276 -0
  147. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  148. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  149. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  150. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  151. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  152. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  153. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  154. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  155. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  156. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  157. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  158. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  159. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  160. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  161. data/lib/stripe/resources/v2/money_management/received_credit.rb +116 -0
  162. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  163. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  164. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  165. data/lib/stripe/resources/v2/payments/off_session_payment.rb +74 -0
  166. data/lib/stripe/resources.rb +104 -0
  167. data/lib/stripe/services/account_notice_service.rb +101 -0
  168. data/lib/stripe/services/account_service.rb +562 -1
  169. data/lib/stripe/services/account_session_service.rb +226 -1
  170. data/lib/stripe/services/balance_settings_service.rb +96 -0
  171. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  172. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  173. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  174. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  175. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  176. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  177. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  178. data/lib/stripe/services/capital_service.rb +15 -0
  179. data/lib/stripe/services/charge_service.rb +1418 -0
  180. data/lib/stripe/services/checkout/session_service.rb +247 -2
  181. data/lib/stripe/services/coupon_service.rb +17 -1
  182. data/lib/stripe/services/credit_note_service.rb +4 -0
  183. data/lib/stripe/services/customer_session_service.rb +4 -1
  184. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  185. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  186. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  187. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  188. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  189. data/lib/stripe/services/financial_connections_service.rb +2 -1
  190. data/lib/stripe/services/fx_quote_service.rb +123 -0
  191. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  192. data/lib/stripe/services/invoice_item_service.rb +74 -2
  193. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  194. data/lib/stripe/services/invoice_service.rb +1021 -16
  195. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  196. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  197. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  198. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  199. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  200. data/lib/stripe/services/issuing_service.rb +5 -1
  201. data/lib/stripe/services/margin_service.rb +119 -0
  202. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  203. data/lib/stripe/services/order_service.rb +2236 -0
  204. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  205. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  206. data/lib/stripe/services/payment_intent_service.rb +4733 -245
  207. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  208. data/lib/stripe/services/payment_method_service.rb +120 -1
  209. data/lib/stripe/services/payment_record_service.rb +542 -0
  210. data/lib/stripe/services/payout_service.rb +4 -0
  211. data/lib/stripe/services/price_service.rb +19 -0
  212. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  213. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  214. data/lib/stripe/services/privacy_service.rb +13 -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 +538 -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 +276 -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 +90 -0
  230. data/lib/stripe/services/terminal_service.rb +2 -1
  231. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  232. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  233. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  234. data/lib/stripe/services/transfer_service.rb +4 -0
  235. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  236. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  237. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  238. data/lib/stripe/services/v1_services.rb +11 -2
  239. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  240. data/lib/stripe/services/v2/core/account_service.rb +4138 -0
  241. data/lib/stripe/services/v2/core/accounts/person_service.rb +1046 -0
  242. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +131 -0
  243. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  244. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  245. data/lib/stripe/services/v2/core_service.rb +4 -1
  246. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  247. data/lib/stripe/services/v2/money_management/financial_account_service.rb +43 -0
  248. data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -0
  249. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  250. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  251. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +200 -0
  252. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  253. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  254. data/lib/stripe/services/v2/money_management/payout_method_service.rb +91 -0
  255. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  256. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  257. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  258. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  259. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  260. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  261. data/lib/stripe/services/v2/payment_service.rb +15 -0
  262. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +138 -0
  263. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  264. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +49 -0
  265. data/lib/stripe/services/v2_services.rb +5 -2
  266. data/lib/stripe/services.rb +53 -1
  267. data/lib/stripe/stripe_configuration.rb +3 -1
  268. data/lib/stripe/stripe_object.rb +1 -1
  269. data/lib/stripe/util.rb +7 -1
  270. data/lib/stripe/version.rb +1 -1
  271. data/lib/stripe.rb +53 -0
  272. data/rbi/stripe.rbi +191639 -0
  273. data/stripe.gemspec +4 -1
  274. metadata +161 -324
  275. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  276. data/rbi/stripe/resources/account.rbi +0 -4926
  277. data/rbi/stripe/resources/account_link.rbi +0 -74
  278. data/rbi/stripe/resources/account_session.rbi +0 -1013
  279. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  280. data/rbi/stripe/resources/application.rbi +0 -20
  281. data/rbi/stripe/resources/application_fee.rbi +0 -118
  282. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  283. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  284. data/rbi/stripe/resources/balance.rbi +0 -235
  285. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  286. data/rbi/stripe/resources/bank_account.rbi +0 -127
  287. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  288. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  289. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  290. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  291. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  292. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  293. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  294. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  295. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  296. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  297. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  298. data/rbi/stripe/resources/capability.rbi +0 -125
  299. data/rbi/stripe/resources/card.rbi +0 -125
  300. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  301. data/rbi/stripe/resources/charge.rbi +0 -2069
  302. data/rbi/stripe/resources/checkout/session.rbi +0 -4004
  303. data/rbi/stripe/resources/climate/order.rbi +0 -245
  304. data/rbi/stripe/resources/climate/product.rbi +0 -75
  305. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  306. data/rbi/stripe/resources/confirmation_token.rbi +0 -1807
  307. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  308. data/rbi/stripe/resources/country_spec.rbi +0 -85
  309. data/rbi/stripe/resources/coupon.rbi +0 -250
  310. data/rbi/stripe/resources/credit_note.rbi +0 -752
  311. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  312. data/rbi/stripe/resources/customer.rbi +0 -1005
  313. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  314. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  315. data/rbi/stripe/resources/customer_session.rbi +0 -200
  316. data/rbi/stripe/resources/discount.rbi +0 -53
  317. data/rbi/stripe/resources/dispute.rbi +0 -761
  318. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  319. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  320. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  321. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  322. data/rbi/stripe/resources/event.rbi +0 -149
  323. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  324. data/rbi/stripe/resources/file.rbi +0 -143
  325. data/rbi/stripe/resources/file_link.rbi +0 -141
  326. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  327. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  328. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  329. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  330. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  331. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  332. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  333. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  334. data/rbi/stripe/resources/identity/verification_session.rbi +0 -526
  335. data/rbi/stripe/resources/invoice.rbi +0 -3812
  336. data/rbi/stripe/resources/invoice_item.rbi +0 -473
  337. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  338. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  339. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  340. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  341. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  342. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  343. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  344. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  345. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  346. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  347. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  348. data/rbi/stripe/resources/line_item.rbi +0 -72
  349. data/rbi/stripe/resources/login_link.rbi +0 -19
  350. data/rbi/stripe/resources/mandate.rbi +0 -187
  351. data/rbi/stripe/resources/payment_intent.rbi +0 -9647
  352. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  353. data/rbi/stripe/resources/payment_method.rbi +0 -1761
  354. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  355. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  356. data/rbi/stripe/resources/payout.rbi +0 -300
  357. data/rbi/stripe/resources/person.rbi +0 -401
  358. data/rbi/stripe/resources/plan.rbi +0 -371
  359. data/rbi/stripe/resources/price.rbi +0 -694
  360. data/rbi/stripe/resources/product.rbi +0 -555
  361. data/rbi/stripe/resources/product_feature.rbi +0 -26
  362. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  363. data/rbi/stripe/resources/quote.rbi +0 -1126
  364. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  365. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  366. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  367. data/rbi/stripe/resources/refund.rbi +0 -523
  368. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  369. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  370. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  371. data/rbi/stripe/resources/reversal.rbi +0 -51
  372. data/rbi/stripe/resources/review.rbi +0 -154
  373. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  374. data/rbi/stripe/resources/setup_intent.rbi +0 -3655
  375. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  376. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  377. data/rbi/stripe/resources/source.rbi +0 -1496
  378. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  379. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  380. data/rbi/stripe/resources/subscription.rbi +0 -2027
  381. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  382. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1623
  383. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  384. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  385. data/rbi/stripe/resources/tax/registration.rbi +0 -2713
  386. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  387. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  388. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  389. data/rbi/stripe/resources/tax_code.rbi +0 -44
  390. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  391. data/rbi/stripe/resources/tax_id.rbi +0 -165
  392. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  393. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1386
  394. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  395. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  396. data/rbi/stripe/resources/terminal/reader.rbi +0 -847
  397. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  398. data/rbi/stripe/resources/token.rbi +0 -1283
  399. data/rbi/stripe/resources/topup.rbi +0 -222
  400. data/rbi/stripe/resources/transfer.rbi +0 -199
  401. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  402. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  403. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -865
  404. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  405. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  406. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  407. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  408. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  409. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  410. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  411. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  412. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  413. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  414. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  415. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  416. data/rbi/stripe/resources/v2/event.rbi +0 -48
  417. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  418. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  419. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  420. data/rbi/stripe/services/account_link_service.rbi +0 -58
  421. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  422. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  423. data/rbi/stripe/services/account_service.rbi +0 -4213
  424. data/rbi/stripe/services/account_session_service.rbi +0 -646
  425. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  426. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  427. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  428. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  429. data/rbi/stripe/services/apps_service.rbi +0 -9
  430. data/rbi/stripe/services/balance_service.rbi +0 -21
  431. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  432. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  433. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  434. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  435. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  436. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  437. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  438. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  439. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  440. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  441. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  442. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  443. data/rbi/stripe/services/billing_service.rbi +0 -15
  444. data/rbi/stripe/services/charge_service.rbi +0 -448
  445. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  446. data/rbi/stripe/services/checkout/session_service.rbi +0 -2614
  447. data/rbi/stripe/services/checkout_service.rbi +0 -9
  448. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  449. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  450. data/rbi/stripe/services/climate_service.rbi +0 -11
  451. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  452. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  453. data/rbi/stripe/services/coupon_service.rbi +0 -194
  454. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  455. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  456. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  457. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  458. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  459. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  460. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  461. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  462. data/rbi/stripe/services/customer_service.rbi +0 -647
  463. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  464. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  465. data/rbi/stripe/services/dispute_service.rbi +0 -424
  466. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  467. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  468. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  469. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  470. data/rbi/stripe/services/event_service.rbi +0 -83
  471. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  472. data/rbi/stripe/services/file_link_service.rbi +0 -124
  473. data/rbi/stripe/services/file_service.rbi +0 -116
  474. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  475. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  476. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  477. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  478. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  479. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  480. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  481. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  482. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -323
  483. data/rbi/stripe/services/identity_service.rbi +0 -10
  484. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  485. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  486. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  487. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  488. data/rbi/stripe/services/invoice_service.rbi +0 -2981
  489. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  490. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  491. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  492. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  493. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  494. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  495. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  496. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  497. data/rbi/stripe/services/issuing_service.rbi +0 -16
  498. data/rbi/stripe/services/mandate_service.rbi +0 -20
  499. data/rbi/stripe/services/payment_intent_service.rbi +0 -7659
  500. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  501. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  502. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  503. data/rbi/stripe/services/payment_method_service.rbi +0 -776
  504. data/rbi/stripe/services/payout_service.rbi +0 -205
  505. data/rbi/stripe/services/plan_service.rbi +0 -282
  506. data/rbi/stripe/services/price_service.rbi +0 -546
  507. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  508. data/rbi/stripe/services/product_service.rbi +0 -477
  509. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  510. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  511. data/rbi/stripe/services/quote_service.rbi +0 -686
  512. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  513. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  514. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  515. data/rbi/stripe/services/radar_service.rbi +0 -11
  516. data/rbi/stripe/services/refund_service.rbi +0 -185
  517. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  518. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  519. data/rbi/stripe/services/reporting_service.rbi +0 -10
  520. data/rbi/stripe/services/review_service.rbi +0 -84
  521. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  522. data/rbi/stripe/services/setup_intent_service.rbi +0 -3391
  523. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  524. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  525. data/rbi/stripe/services/sigma_service.rbi +0 -9
  526. data/rbi/stripe/services/source_service.rbi +0 -663
  527. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  528. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1290
  529. data/rbi/stripe/services/subscription_service.rbi +0 -1648
  530. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  531. data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
  532. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  533. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  534. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  535. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  536. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  537. data/rbi/stripe/services/tax_service.rbi +0 -12
  538. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1118
  539. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  540. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  541. data/rbi/stripe/services/terminal/reader_service.rbi +0 -455
  542. data/rbi/stripe/services/terminal_service.rbi +0 -12
  543. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -739
  544. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  545. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  546. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  547. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  548. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  549. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  550. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  551. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  552. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  553. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  554. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  555. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  556. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  557. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  558. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  559. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  560. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  561. data/rbi/stripe/services/token_service.rbi +0 -1257
  562. data/rbi/stripe/services/topup_service.rbi +0 -176
  563. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  564. data/rbi/stripe/services/transfer_service.rbi +0 -152
  565. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  566. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  567. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  568. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -562
  569. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  570. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  571. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  572. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  573. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  574. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  575. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  576. data/rbi/stripe/services/treasury_service.rbi +0 -18
  577. data/rbi/stripe/services/v1_services.rbi +0 -77
  578. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  579. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  580. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  581. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  582. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  583. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  584. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  585. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  586. data/rbi/stripe/services/v2_services.rbi +0 -10
  587. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -88,13 +88,36 @@ module Stripe
88
88
  attr_reader :transfer_data
89
89
  end
90
90
 
91
+ class LastPriceMigrationError < Stripe::StripeObject
92
+ class FailedTransition < Stripe::StripeObject
93
+ # The original price to be migrated.
94
+ attr_reader :source_price
95
+ # The intended resulting price of the migration.
96
+ attr_reader :target_price
97
+ end
98
+ # The time at which the price migration encountered an error.
99
+ attr_reader :errored_at
100
+ # The involved price pairs in each failed transition.
101
+ attr_reader :failed_transitions
102
+ # The type of error encountered by the price migration.
103
+ attr_reader :type
104
+ end
105
+
91
106
  class Phase < Stripe::StripeObject
92
107
  class AddInvoiceItem < Stripe::StripeObject
93
108
  class Discount < Stripe::StripeObject
109
+ class DiscountEnd < Stripe::StripeObject
110
+ # The discount end timestamp.
111
+ attr_reader :timestamp
112
+ # The discount end type.
113
+ attr_reader :type
114
+ end
94
115
  # ID of the coupon to create a new discount for.
95
116
  attr_reader :coupon
96
117
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
97
118
  attr_reader :discount
119
+ # Details to determine how long the discount should be applied for.
120
+ attr_reader :discount_end
98
121
  # ID of the promotion code to create a new discount for.
99
122
  attr_reader :promotion_code
100
123
  end
@@ -131,10 +154,18 @@ module Stripe
131
154
  end
132
155
 
133
156
  class Discount < Stripe::StripeObject
157
+ class DiscountEnd < Stripe::StripeObject
158
+ # The discount end timestamp.
159
+ attr_reader :timestamp
160
+ # The discount end type.
161
+ attr_reader :type
162
+ end
134
163
  # ID of the coupon to create a new discount for.
135
164
  attr_reader :coupon
136
165
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
137
166
  attr_reader :discount
167
+ # Details to determine how long the discount should be applied for.
168
+ attr_reader :discount_end
138
169
  # ID of the promotion code to create a new discount for.
139
170
  attr_reader :promotion_code
140
171
  end
@@ -161,13 +192,28 @@ module Stripe
161
192
  end
162
193
 
163
194
  class Discount < Stripe::StripeObject
195
+ class DiscountEnd < Stripe::StripeObject
196
+ # The discount end timestamp.
197
+ attr_reader :timestamp
198
+ # The discount end type.
199
+ attr_reader :type
200
+ end
164
201
  # ID of the coupon to create a new discount for.
165
202
  attr_reader :coupon
166
203
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
167
204
  attr_reader :discount
205
+ # Details to determine how long the discount should be applied for.
206
+ attr_reader :discount_end
168
207
  # ID of the promotion code to create a new discount for.
169
208
  attr_reader :promotion_code
170
209
  end
210
+
211
+ class Trial < Stripe::StripeObject
212
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial.
213
+ attr_reader :converts_to
214
+ # Determines the type of trial for this item.
215
+ attr_reader :type
216
+ end
171
217
  # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
172
218
  attr_reader :billing_thresholds
173
219
  # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
@@ -182,6 +228,13 @@ module Stripe
182
228
  attr_reader :quantity
183
229
  # 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`.
184
230
  attr_reader :tax_rates
231
+ # Options that configure the trial on the subscription item.
232
+ attr_reader :trial
233
+ end
234
+
235
+ class PauseCollection < Stripe::StripeObject
236
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
237
+ attr_reader :behavior
185
238
  end
186
239
 
187
240
  class TransferData < Stripe::StripeObject
@@ -190,6 +243,15 @@ module Stripe
190
243
  # The account where funds from the payment will be transferred to upon payment success.
191
244
  attr_reader :destination
192
245
  end
246
+
247
+ class TrialSettings < Stripe::StripeObject
248
+ class EndBehavior < Stripe::StripeObject
249
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
250
+ attr_reader :prorate_up_front
251
+ end
252
+ # Defines how the subscription should behave when a trial ends.
253
+ attr_reader :end_behavior
254
+ end
193
255
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase.
194
256
  attr_reader :add_invoice_items
195
257
  # 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.
@@ -222,14 +284,31 @@ module Stripe
222
284
  attr_reader :metadata
223
285
  # 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.
224
286
  attr_reader :on_behalf_of
287
+ # 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).
288
+ attr_reader :pause_collection
225
289
  # When transitioning phases, controls how prorations are handled (if any). Possible values are `create_prorations`, `none`, and `always_invoice`.
226
290
  attr_reader :proration_behavior
227
291
  # The start of this phase of the subscription schedule.
228
292
  attr_reader :start_date
229
293
  # 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.
230
294
  attr_reader :transfer_data
295
+ # Specify behavior of the trial when crossing schedule phase boundaries
296
+ attr_reader :trial_continuation
231
297
  # When the trial ends within the phase.
232
298
  attr_reader :trial_end
299
+ # Settings related to any trials on the subscription during this phase.
300
+ attr_reader :trial_settings
301
+ end
302
+
303
+ class Prebilling < Stripe::StripeObject
304
+ # ID of the prebilling invoice.
305
+ attr_reader :invoice
306
+ # The end of the last period for which the invoice pre-bills.
307
+ attr_reader :period_end
308
+ # The start of the first period for which the invoice pre-bills.
309
+ attr_reader :period_start
310
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period.
311
+ attr_reader :update_behavior
233
312
  end
234
313
 
235
314
  class ListParams < Stripe::RequestParams
@@ -312,6 +391,8 @@ module Stripe
312
391
  attr_accessor :created
313
392
  # Only return subscription schedules for the given customer.
314
393
  attr_accessor :customer
394
+ # Only return subscription schedules for the given account.
395
+ attr_accessor :customer_account
315
396
  # 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.
316
397
  attr_accessor :ending_before
317
398
  # Specifies which fields in the response should be expanded.
@@ -330,6 +411,7 @@ module Stripe
330
411
  completed_at: nil,
331
412
  created: nil,
332
413
  customer: nil,
414
+ customer_account: nil,
333
415
  ending_before: nil,
334
416
  expand: nil,
335
417
  limit: nil,
@@ -341,6 +423,7 @@ module Stripe
341
423
  @completed_at = completed_at
342
424
  @created = created
343
425
  @customer = customer
426
+ @customer_account = customer_account
344
427
  @ending_before = ending_before
345
428
  @expand = expand
346
429
  @limit = limit
@@ -473,16 +556,44 @@ module Stripe
473
556
  class Phase < Stripe::RequestParams
474
557
  class AddInvoiceItem < Stripe::RequestParams
475
558
  class Discount < Stripe::RequestParams
559
+ class DiscountEnd < Stripe::RequestParams
560
+ class Duration < Stripe::RequestParams
561
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
562
+ attr_accessor :interval
563
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
564
+ attr_accessor :interval_count
565
+
566
+ def initialize(interval: nil, interval_count: nil)
567
+ @interval = interval
568
+ @interval_count = interval_count
569
+ end
570
+ end
571
+ # Time span for the redeemed discount.
572
+ attr_accessor :duration
573
+ # A precise Unix timestamp for the discount to end. Must be in the future.
574
+ attr_accessor :timestamp
575
+ # The type of calculation made to determine when the discount ends.
576
+ attr_accessor :type
577
+
578
+ def initialize(duration: nil, timestamp: nil, type: nil)
579
+ @duration = duration
580
+ @timestamp = timestamp
581
+ @type = type
582
+ end
583
+ end
476
584
  # ID of the coupon to create a new discount for.
477
585
  attr_accessor :coupon
478
586
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
479
587
  attr_accessor :discount
588
+ # Details to determine how long the discount should be applied for.
589
+ attr_accessor :discount_end
480
590
  # ID of the promotion code to create a new discount for.
481
591
  attr_accessor :promotion_code
482
592
 
483
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
593
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
484
594
  @coupon = coupon
485
595
  @discount = discount
596
+ @discount_end = discount_end
486
597
  @promotion_code = promotion_code
487
598
  end
488
599
  end
@@ -569,16 +680,44 @@ module Stripe
569
680
  end
570
681
 
571
682
  class Discount < Stripe::RequestParams
683
+ class DiscountEnd < Stripe::RequestParams
684
+ class Duration < Stripe::RequestParams
685
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
686
+ attr_accessor :interval
687
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
688
+ attr_accessor :interval_count
689
+
690
+ def initialize(interval: nil, interval_count: nil)
691
+ @interval = interval
692
+ @interval_count = interval_count
693
+ end
694
+ end
695
+ # Time span for the redeemed discount.
696
+ attr_accessor :duration
697
+ # A precise Unix timestamp for the discount to end. Must be in the future.
698
+ attr_accessor :timestamp
699
+ # The type of calculation made to determine when the discount ends.
700
+ attr_accessor :type
701
+
702
+ def initialize(duration: nil, timestamp: nil, type: nil)
703
+ @duration = duration
704
+ @timestamp = timestamp
705
+ @type = type
706
+ end
707
+ end
572
708
  # ID of the coupon to create a new discount for.
573
709
  attr_accessor :coupon
574
710
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
575
711
  attr_accessor :discount
712
+ # Details to determine how long the discount should be applied for.
713
+ attr_accessor :discount_end
576
714
  # ID of the promotion code to create a new discount for.
577
715
  attr_accessor :promotion_code
578
716
 
579
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
717
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
580
718
  @coupon = coupon
581
719
  @discount = discount
720
+ @discount_end = discount_end
582
721
  @promotion_code = promotion_code
583
722
  end
584
723
  end
@@ -620,16 +759,44 @@ module Stripe
620
759
  end
621
760
 
622
761
  class Discount < Stripe::RequestParams
762
+ class DiscountEnd < Stripe::RequestParams
763
+ class Duration < Stripe::RequestParams
764
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
765
+ attr_accessor :interval
766
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
767
+ attr_accessor :interval_count
768
+
769
+ def initialize(interval: nil, interval_count: nil)
770
+ @interval = interval
771
+ @interval_count = interval_count
772
+ end
773
+ end
774
+ # Time span for the redeemed discount.
775
+ attr_accessor :duration
776
+ # A precise Unix timestamp for the discount to end. Must be in the future.
777
+ attr_accessor :timestamp
778
+ # The type of calculation made to determine when the discount ends.
779
+ attr_accessor :type
780
+
781
+ def initialize(duration: nil, timestamp: nil, type: nil)
782
+ @duration = duration
783
+ @timestamp = timestamp
784
+ @type = type
785
+ end
786
+ end
623
787
  # ID of the coupon to create a new discount for.
624
788
  attr_accessor :coupon
625
789
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
626
790
  attr_accessor :discount
791
+ # Details to determine how long the discount should be applied for.
792
+ attr_accessor :discount_end
627
793
  # ID of the promotion code to create a new discount for.
628
794
  attr_accessor :promotion_code
629
795
 
630
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
796
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
631
797
  @coupon = coupon
632
798
  @discount = discount
799
+ @discount_end = discount_end
633
800
  @promotion_code = promotion_code
634
801
  end
635
802
  end
@@ -675,6 +842,18 @@ module Stripe
675
842
  @unit_amount_decimal = unit_amount_decimal
676
843
  end
677
844
  end
845
+
846
+ class Trial < Stripe::RequestParams
847
+ # 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.
848
+ attr_accessor :converts_to
849
+ # Determines the type of trial for this item.
850
+ attr_accessor :type
851
+
852
+ def initialize(converts_to: nil, type: nil)
853
+ @converts_to = converts_to
854
+ @type = type
855
+ end
856
+ end
678
857
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
679
858
  attr_accessor :billing_thresholds
680
859
  # The coupons to redeem into discounts for the subscription item.
@@ -691,6 +870,8 @@ module Stripe
691
870
  attr_accessor :quantity
692
871
  # 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.
693
872
  attr_accessor :tax_rates
873
+ # Options that configure the trial on the subscription item.
874
+ attr_accessor :trial
694
875
 
695
876
  def initialize(
696
877
  billing_thresholds: nil,
@@ -700,7 +881,8 @@ module Stripe
700
881
  price: nil,
701
882
  price_data: nil,
702
883
  quantity: nil,
703
- tax_rates: nil
884
+ tax_rates: nil,
885
+ trial: nil
704
886
  )
705
887
  @billing_thresholds = billing_thresholds
706
888
  @discounts = discounts
@@ -710,6 +892,16 @@ module Stripe
710
892
  @price_data = price_data
711
893
  @quantity = quantity
712
894
  @tax_rates = tax_rates
895
+ @trial = trial
896
+ end
897
+ end
898
+
899
+ class PauseCollection < Stripe::RequestParams
900
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
901
+ attr_accessor :behavior
902
+
903
+ def initialize(behavior: nil)
904
+ @behavior = behavior
713
905
  end
714
906
  end
715
907
 
@@ -724,6 +916,23 @@ module Stripe
724
916
  @destination = destination
725
917
  end
726
918
  end
919
+
920
+ class TrialSettings < Stripe::RequestParams
921
+ class EndBehavior < Stripe::RequestParams
922
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
923
+ attr_accessor :prorate_up_front
924
+
925
+ def initialize(prorate_up_front: nil)
926
+ @prorate_up_front = prorate_up_front
927
+ end
928
+ end
929
+ # Defines how the subscription should behave when a trial ends.
930
+ attr_accessor :end_behavior
931
+
932
+ def initialize(end_behavior: nil)
933
+ @end_behavior = end_behavior
934
+ end
935
+ end
727
936
  # 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.
728
937
  attr_accessor :add_invoice_items
729
938
  # 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).
@@ -758,14 +967,20 @@ module Stripe
758
967
  attr_accessor :metadata
759
968
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
760
969
  attr_accessor :on_behalf_of
970
+ # 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).
971
+ attr_accessor :pause_collection
761
972
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
762
973
  attr_accessor :proration_behavior
763
974
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
764
975
  attr_accessor :transfer_data
765
976
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
766
977
  attr_accessor :trial
978
+ # Specify trial behavior when crossing phase boundaries
979
+ attr_accessor :trial_continuation
767
980
  # 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`
768
981
  attr_accessor :trial_end
982
+ # Settings related to subscription trials.
983
+ attr_accessor :trial_settings
769
984
 
770
985
  def initialize(
771
986
  add_invoice_items: nil,
@@ -785,10 +1000,13 @@ module Stripe
785
1000
  iterations: nil,
786
1001
  metadata: nil,
787
1002
  on_behalf_of: nil,
1003
+ pause_collection: nil,
788
1004
  proration_behavior: nil,
789
1005
  transfer_data: nil,
790
1006
  trial: nil,
791
- trial_end: nil
1007
+ trial_continuation: nil,
1008
+ trial_end: nil,
1009
+ trial_settings: nil
792
1010
  )
793
1011
  @add_invoice_items = add_invoice_items
794
1012
  @application_fee_percent = application_fee_percent
@@ -807,14 +1025,35 @@ module Stripe
807
1025
  @iterations = iterations
808
1026
  @metadata = metadata
809
1027
  @on_behalf_of = on_behalf_of
1028
+ @pause_collection = pause_collection
810
1029
  @proration_behavior = proration_behavior
811
1030
  @transfer_data = transfer_data
812
1031
  @trial = trial
1032
+ @trial_continuation = trial_continuation
813
1033
  @trial_end = trial_end
1034
+ @trial_settings = trial_settings
1035
+ end
1036
+ end
1037
+
1038
+ class Prebilling < Stripe::RequestParams
1039
+ # This is used to determine the number of billing cycles to prebill.
1040
+ attr_accessor :iterations
1041
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1042
+ attr_accessor :update_behavior
1043
+
1044
+ def initialize(iterations: nil, update_behavior: nil)
1045
+ @iterations = iterations
1046
+ @update_behavior = update_behavior
814
1047
  end
815
1048
  end
1049
+ # 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.
1050
+ attr_accessor :billing_behavior
1051
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
1052
+ attr_accessor :billing_mode
816
1053
  # The identifier of the customer to create the subscription schedule for.
817
1054
  attr_accessor :customer
1055
+ # The identifier of the account to create the subscription schedule for.
1056
+ attr_accessor :customer_account
818
1057
  # Object representing the subscription schedule's default settings.
819
1058
  attr_accessor :default_settings
820
1059
  # 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.
@@ -827,26 +1066,36 @@ module Stripe
827
1066
  attr_accessor :metadata
828
1067
  # 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.
829
1068
  attr_accessor :phases
1069
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1070
+ attr_accessor :prebilling
830
1071
  # 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.
831
1072
  attr_accessor :start_date
832
1073
 
833
1074
  def initialize(
1075
+ billing_behavior: nil,
1076
+ billing_mode: nil,
834
1077
  customer: nil,
1078
+ customer_account: nil,
835
1079
  default_settings: nil,
836
1080
  end_behavior: nil,
837
1081
  expand: nil,
838
1082
  from_subscription: nil,
839
1083
  metadata: nil,
840
1084
  phases: nil,
1085
+ prebilling: nil,
841
1086
  start_date: nil
842
1087
  )
1088
+ @billing_behavior = billing_behavior
1089
+ @billing_mode = billing_mode
843
1090
  @customer = customer
1091
+ @customer_account = customer_account
844
1092
  @default_settings = default_settings
845
1093
  @end_behavior = end_behavior
846
1094
  @expand = expand
847
1095
  @from_subscription = from_subscription
848
1096
  @metadata = metadata
849
1097
  @phases = phases
1098
+ @prebilling = prebilling
850
1099
  @start_date = start_date
851
1100
  end
852
1101
  end
@@ -974,16 +1223,44 @@ module Stripe
974
1223
  class Phase < Stripe::RequestParams
975
1224
  class AddInvoiceItem < Stripe::RequestParams
976
1225
  class Discount < Stripe::RequestParams
1226
+ class DiscountEnd < Stripe::RequestParams
1227
+ class Duration < Stripe::RequestParams
1228
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1229
+ attr_accessor :interval
1230
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1231
+ attr_accessor :interval_count
1232
+
1233
+ def initialize(interval: nil, interval_count: nil)
1234
+ @interval = interval
1235
+ @interval_count = interval_count
1236
+ end
1237
+ end
1238
+ # Time span for the redeemed discount.
1239
+ attr_accessor :duration
1240
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1241
+ attr_accessor :timestamp
1242
+ # The type of calculation made to determine when the discount ends.
1243
+ attr_accessor :type
1244
+
1245
+ def initialize(duration: nil, timestamp: nil, type: nil)
1246
+ @duration = duration
1247
+ @timestamp = timestamp
1248
+ @type = type
1249
+ end
1250
+ end
977
1251
  # ID of the coupon to create a new discount for.
978
1252
  attr_accessor :coupon
979
1253
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
980
1254
  attr_accessor :discount
1255
+ # Details to determine how long the discount should be applied for.
1256
+ attr_accessor :discount_end
981
1257
  # ID of the promotion code to create a new discount for.
982
1258
  attr_accessor :promotion_code
983
1259
 
984
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1260
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
985
1261
  @coupon = coupon
986
1262
  @discount = discount
1263
+ @discount_end = discount_end
987
1264
  @promotion_code = promotion_code
988
1265
  end
989
1266
  end
@@ -1070,16 +1347,44 @@ module Stripe
1070
1347
  end
1071
1348
 
1072
1349
  class Discount < Stripe::RequestParams
1350
+ class DiscountEnd < Stripe::RequestParams
1351
+ class Duration < Stripe::RequestParams
1352
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1353
+ attr_accessor :interval
1354
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1355
+ attr_accessor :interval_count
1356
+
1357
+ def initialize(interval: nil, interval_count: nil)
1358
+ @interval = interval
1359
+ @interval_count = interval_count
1360
+ end
1361
+ end
1362
+ # Time span for the redeemed discount.
1363
+ attr_accessor :duration
1364
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1365
+ attr_accessor :timestamp
1366
+ # The type of calculation made to determine when the discount ends.
1367
+ attr_accessor :type
1368
+
1369
+ def initialize(duration: nil, timestamp: nil, type: nil)
1370
+ @duration = duration
1371
+ @timestamp = timestamp
1372
+ @type = type
1373
+ end
1374
+ end
1073
1375
  # ID of the coupon to create a new discount for.
1074
1376
  attr_accessor :coupon
1075
1377
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1076
1378
  attr_accessor :discount
1379
+ # Details to determine how long the discount should be applied for.
1380
+ attr_accessor :discount_end
1077
1381
  # ID of the promotion code to create a new discount for.
1078
1382
  attr_accessor :promotion_code
1079
1383
 
1080
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1384
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1081
1385
  @coupon = coupon
1082
1386
  @discount = discount
1387
+ @discount_end = discount_end
1083
1388
  @promotion_code = promotion_code
1084
1389
  end
1085
1390
  end
@@ -1121,16 +1426,44 @@ module Stripe
1121
1426
  end
1122
1427
 
1123
1428
  class Discount < Stripe::RequestParams
1429
+ class DiscountEnd < Stripe::RequestParams
1430
+ class Duration < Stripe::RequestParams
1431
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1432
+ attr_accessor :interval
1433
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1434
+ attr_accessor :interval_count
1435
+
1436
+ def initialize(interval: nil, interval_count: nil)
1437
+ @interval = interval
1438
+ @interval_count = interval_count
1439
+ end
1440
+ end
1441
+ # Time span for the redeemed discount.
1442
+ attr_accessor :duration
1443
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1444
+ attr_accessor :timestamp
1445
+ # The type of calculation made to determine when the discount ends.
1446
+ attr_accessor :type
1447
+
1448
+ def initialize(duration: nil, timestamp: nil, type: nil)
1449
+ @duration = duration
1450
+ @timestamp = timestamp
1451
+ @type = type
1452
+ end
1453
+ end
1124
1454
  # ID of the coupon to create a new discount for.
1125
1455
  attr_accessor :coupon
1126
1456
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1127
1457
  attr_accessor :discount
1458
+ # Details to determine how long the discount should be applied for.
1459
+ attr_accessor :discount_end
1128
1460
  # ID of the promotion code to create a new discount for.
1129
1461
  attr_accessor :promotion_code
1130
1462
 
1131
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1463
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1132
1464
  @coupon = coupon
1133
1465
  @discount = discount
1466
+ @discount_end = discount_end
1134
1467
  @promotion_code = promotion_code
1135
1468
  end
1136
1469
  end
@@ -1176,6 +1509,18 @@ module Stripe
1176
1509
  @unit_amount_decimal = unit_amount_decimal
1177
1510
  end
1178
1511
  end
1512
+
1513
+ class Trial < Stripe::RequestParams
1514
+ # 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.
1515
+ attr_accessor :converts_to
1516
+ # Determines the type of trial for this item.
1517
+ attr_accessor :type
1518
+
1519
+ def initialize(converts_to: nil, type: nil)
1520
+ @converts_to = converts_to
1521
+ @type = type
1522
+ end
1523
+ end
1179
1524
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1180
1525
  attr_accessor :billing_thresholds
1181
1526
  # The coupons to redeem into discounts for the subscription item.
@@ -1192,6 +1537,8 @@ module Stripe
1192
1537
  attr_accessor :quantity
1193
1538
  # 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.
1194
1539
  attr_accessor :tax_rates
1540
+ # Options that configure the trial on the subscription item.
1541
+ attr_accessor :trial
1195
1542
 
1196
1543
  def initialize(
1197
1544
  billing_thresholds: nil,
@@ -1201,7 +1548,8 @@ module Stripe
1201
1548
  price: nil,
1202
1549
  price_data: nil,
1203
1550
  quantity: nil,
1204
- tax_rates: nil
1551
+ tax_rates: nil,
1552
+ trial: nil
1205
1553
  )
1206
1554
  @billing_thresholds = billing_thresholds
1207
1555
  @discounts = discounts
@@ -1211,6 +1559,16 @@ module Stripe
1211
1559
  @price_data = price_data
1212
1560
  @quantity = quantity
1213
1561
  @tax_rates = tax_rates
1562
+ @trial = trial
1563
+ end
1564
+ end
1565
+
1566
+ class PauseCollection < Stripe::RequestParams
1567
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1568
+ attr_accessor :behavior
1569
+
1570
+ def initialize(behavior: nil)
1571
+ @behavior = behavior
1214
1572
  end
1215
1573
  end
1216
1574
 
@@ -1225,6 +1583,23 @@ module Stripe
1225
1583
  @destination = destination
1226
1584
  end
1227
1585
  end
1586
+
1587
+ class TrialSettings < Stripe::RequestParams
1588
+ class EndBehavior < Stripe::RequestParams
1589
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1590
+ attr_accessor :prorate_up_front
1591
+
1592
+ def initialize(prorate_up_front: nil)
1593
+ @prorate_up_front = prorate_up_front
1594
+ end
1595
+ end
1596
+ # Defines how the subscription should behave when a trial ends.
1597
+ attr_accessor :end_behavior
1598
+
1599
+ def initialize(end_behavior: nil)
1600
+ @end_behavior = end_behavior
1601
+ end
1602
+ end
1228
1603
  # 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.
1229
1604
  attr_accessor :add_invoice_items
1230
1605
  # 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).
@@ -1259,6 +1634,8 @@ module Stripe
1259
1634
  attr_accessor :metadata
1260
1635
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1261
1636
  attr_accessor :on_behalf_of
1637
+ # 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).
1638
+ attr_accessor :pause_collection
1262
1639
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
1263
1640
  attr_accessor :proration_behavior
1264
1641
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -1267,8 +1644,12 @@ module Stripe
1267
1644
  attr_accessor :transfer_data
1268
1645
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1269
1646
  attr_accessor :trial
1647
+ # Specify trial behavior when crossing phase boundaries
1648
+ attr_accessor :trial_continuation
1270
1649
  # 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`
1271
1650
  attr_accessor :trial_end
1651
+ # Settings related to subscription trials.
1652
+ attr_accessor :trial_settings
1272
1653
 
1273
1654
  def initialize(
1274
1655
  add_invoice_items: nil,
@@ -1288,11 +1669,14 @@ module Stripe
1288
1669
  iterations: nil,
1289
1670
  metadata: nil,
1290
1671
  on_behalf_of: nil,
1672
+ pause_collection: nil,
1291
1673
  proration_behavior: nil,
1292
1674
  start_date: nil,
1293
1675
  transfer_data: nil,
1294
1676
  trial: nil,
1295
- trial_end: nil
1677
+ trial_continuation: nil,
1678
+ trial_end: nil,
1679
+ trial_settings: nil
1296
1680
  )
1297
1681
  @add_invoice_items = add_invoice_items
1298
1682
  @application_fee_percent = application_fee_percent
@@ -1311,13 +1695,30 @@ module Stripe
1311
1695
  @iterations = iterations
1312
1696
  @metadata = metadata
1313
1697
  @on_behalf_of = on_behalf_of
1698
+ @pause_collection = pause_collection
1314
1699
  @proration_behavior = proration_behavior
1315
1700
  @start_date = start_date
1316
1701
  @transfer_data = transfer_data
1317
1702
  @trial = trial
1703
+ @trial_continuation = trial_continuation
1318
1704
  @trial_end = trial_end
1705
+ @trial_settings = trial_settings
1706
+ end
1707
+ end
1708
+
1709
+ class Prebilling < Stripe::RequestParams
1710
+ # This is used to determine the number of billing cycles to prebill.
1711
+ attr_accessor :iterations
1712
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1713
+ attr_accessor :update_behavior
1714
+
1715
+ def initialize(iterations: nil, update_behavior: nil)
1716
+ @iterations = iterations
1717
+ @update_behavior = update_behavior
1319
1718
  end
1320
1719
  end
1720
+ # 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.
1721
+ attr_accessor :billing_behavior
1321
1722
  # Object representing the subscription schedule's default settings.
1322
1723
  attr_accessor :default_settings
1323
1724
  # 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.
@@ -1328,23 +1729,595 @@ module Stripe
1328
1729
  attr_accessor :metadata
1329
1730
  # 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.
1330
1731
  attr_accessor :phases
1732
+ # If specified, the invoicing for the given billing cycle iterations will be processed now.
1733
+ attr_accessor :prebilling
1331
1734
  # If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
1332
1735
  attr_accessor :proration_behavior
1333
1736
 
1334
1737
  def initialize(
1738
+ billing_behavior: nil,
1335
1739
  default_settings: nil,
1336
1740
  end_behavior: nil,
1337
1741
  expand: nil,
1338
1742
  metadata: nil,
1339
1743
  phases: nil,
1744
+ prebilling: nil,
1340
1745
  proration_behavior: nil
1341
1746
  )
1747
+ @billing_behavior = billing_behavior
1342
1748
  @default_settings = default_settings
1343
1749
  @end_behavior = end_behavior
1344
1750
  @expand = expand
1345
1751
  @metadata = metadata
1346
1752
  @phases = phases
1753
+ @prebilling = prebilling
1754
+ @proration_behavior = proration_behavior
1755
+ end
1756
+ end
1757
+
1758
+ class AmendParams < Stripe::RequestParams
1759
+ class Amendment < Stripe::RequestParams
1760
+ class AmendmentEnd < Stripe::RequestParams
1761
+ class DiscountEnd < Stripe::RequestParams
1762
+ # The ID of a specific discount.
1763
+ attr_accessor :discount
1764
+
1765
+ def initialize(discount: nil)
1766
+ @discount = discount
1767
+ end
1768
+ end
1769
+
1770
+ class Duration < Stripe::RequestParams
1771
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1772
+ attr_accessor :interval
1773
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1774
+ attr_accessor :interval_count
1775
+
1776
+ def initialize(interval: nil, interval_count: nil)
1777
+ @interval = interval
1778
+ @interval_count = interval_count
1779
+ end
1780
+ end
1781
+ # Use the `end` time of a given discount.
1782
+ attr_accessor :discount_end
1783
+ # Time span for the amendment starting from the `amendment_start`.
1784
+ attr_accessor :duration
1785
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1786
+ attr_accessor :timestamp
1787
+ # Select one of three ways to pass the `amendment_end`.
1788
+ attr_accessor :type
1789
+
1790
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1791
+ @discount_end = discount_end
1792
+ @duration = duration
1793
+ @timestamp = timestamp
1794
+ @type = type
1795
+ end
1796
+ end
1797
+
1798
+ class AmendmentStart < Stripe::RequestParams
1799
+ class AmendmentEnd < Stripe::RequestParams
1800
+ # 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.
1801
+ attr_accessor :index
1802
+
1803
+ def initialize(index: nil)
1804
+ @index = index
1805
+ end
1806
+ end
1807
+
1808
+ class DiscountEnd < Stripe::RequestParams
1809
+ # The ID of a specific discount.
1810
+ attr_accessor :discount
1811
+
1812
+ def initialize(discount: nil)
1813
+ @discount = discount
1814
+ end
1815
+ end
1816
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
1817
+ attr_accessor :amendment_end
1818
+ # Use the `end` time of a given discount.
1819
+ attr_accessor :discount_end
1820
+ # A precise Unix timestamp for the amendment to start.
1821
+ attr_accessor :timestamp
1822
+ # Select one of three ways to pass the `amendment_start`.
1823
+ attr_accessor :type
1824
+
1825
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
1826
+ @amendment_end = amendment_end
1827
+ @discount_end = discount_end
1828
+ @timestamp = timestamp
1829
+ @type = type
1830
+ end
1831
+ end
1832
+
1833
+ class DiscountAction < Stripe::RequestParams
1834
+ class Add < Stripe::RequestParams
1835
+ class DiscountEnd < Stripe::RequestParams
1836
+ # The type of calculation made to determine when the discount ends.
1837
+ attr_accessor :type
1838
+
1839
+ def initialize(type: nil)
1840
+ @type = type
1841
+ end
1842
+ end
1843
+ # The coupon code to redeem.
1844
+ attr_accessor :coupon
1845
+ # An ID of an existing discount for a coupon that was already redeemed.
1846
+ attr_accessor :discount
1847
+ # Details to determine how long the discount should be applied for.
1848
+ attr_accessor :discount_end
1849
+ # 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.
1850
+ attr_accessor :index
1851
+ # The promotion code to redeem.
1852
+ attr_accessor :promotion_code
1853
+
1854
+ def initialize(
1855
+ coupon: nil,
1856
+ discount: nil,
1857
+ discount_end: nil,
1858
+ index: nil,
1859
+ promotion_code: nil
1860
+ )
1861
+ @coupon = coupon
1862
+ @discount = discount
1863
+ @discount_end = discount_end
1864
+ @index = index
1865
+ @promotion_code = promotion_code
1866
+ end
1867
+ end
1868
+
1869
+ class Remove < Stripe::RequestParams
1870
+ # The coupon code to remove from the `discounts` array.
1871
+ attr_accessor :coupon
1872
+ # The ID of a discount to remove from the `discounts` array.
1873
+ attr_accessor :discount
1874
+ # The ID of a promotion code to remove from the `discounts` array.
1875
+ attr_accessor :promotion_code
1876
+
1877
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1878
+ @coupon = coupon
1879
+ @discount = discount
1880
+ @promotion_code = promotion_code
1881
+ end
1882
+ end
1883
+
1884
+ class Set < Stripe::RequestParams
1885
+ # The coupon code to replace the `discounts` array with.
1886
+ attr_accessor :coupon
1887
+ # An ID of an existing discount to replace the `discounts` array with.
1888
+ attr_accessor :discount
1889
+ # An ID of an existing promotion code to replace the `discounts` array with.
1890
+ attr_accessor :promotion_code
1891
+
1892
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1893
+ @coupon = coupon
1894
+ @discount = discount
1895
+ @promotion_code = promotion_code
1896
+ end
1897
+ end
1898
+ # Details of the discount to add.
1899
+ attr_accessor :add
1900
+ # Details of the discount to remove.
1901
+ attr_accessor :remove
1902
+ # Details of the discount to replace the existing discounts with.
1903
+ attr_accessor :set
1904
+ # Determines the type of discount action.
1905
+ attr_accessor :type
1906
+
1907
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
1908
+ @add = add
1909
+ @remove = remove
1910
+ @set = set
1911
+ @type = type
1912
+ end
1913
+ end
1914
+
1915
+ class ItemAction < Stripe::RequestParams
1916
+ class Add < Stripe::RequestParams
1917
+ class Discount < Stripe::RequestParams
1918
+ class DiscountEnd < Stripe::RequestParams
1919
+ class Duration < Stripe::RequestParams
1920
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1921
+ attr_accessor :interval
1922
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1923
+ attr_accessor :interval_count
1924
+
1925
+ def initialize(interval: nil, interval_count: nil)
1926
+ @interval = interval
1927
+ @interval_count = interval_count
1928
+ end
1929
+ end
1930
+ # Time span for the redeemed discount.
1931
+ attr_accessor :duration
1932
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1933
+ attr_accessor :timestamp
1934
+ # The type of calculation made to determine when the discount ends.
1935
+ attr_accessor :type
1936
+
1937
+ def initialize(duration: nil, timestamp: nil, type: nil)
1938
+ @duration = duration
1939
+ @timestamp = timestamp
1940
+ @type = type
1941
+ end
1942
+ end
1943
+ # ID of the coupon to create a new discount for.
1944
+ attr_accessor :coupon
1945
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1946
+ attr_accessor :discount
1947
+ # Details to determine how long the discount should be applied for.
1948
+ attr_accessor :discount_end
1949
+ # ID of the promotion code to create a new discount for.
1950
+ attr_accessor :promotion_code
1951
+
1952
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1953
+ @coupon = coupon
1954
+ @discount = discount
1955
+ @discount_end = discount_end
1956
+ @promotion_code = promotion_code
1957
+ end
1958
+ end
1959
+
1960
+ class Trial < Stripe::RequestParams
1961
+ # 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.
1962
+ attr_accessor :converts_to
1963
+ # Determines the type of trial for this item.
1964
+ attr_accessor :type
1965
+
1966
+ def initialize(converts_to: nil, type: nil)
1967
+ @converts_to = converts_to
1968
+ @type = type
1969
+ end
1970
+ end
1971
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1972
+ attr_accessor :discounts
1973
+ # 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`.
1974
+ attr_accessor :metadata
1975
+ # The ID of the price object.
1976
+ attr_accessor :price
1977
+ # Quantity for this item.
1978
+ attr_accessor :quantity
1979
+ # 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`.
1980
+ attr_accessor :tax_rates
1981
+ # Options that configure the trial on the subscription item.
1982
+ attr_accessor :trial
1983
+
1984
+ def initialize(
1985
+ discounts: nil,
1986
+ metadata: nil,
1987
+ price: nil,
1988
+ quantity: nil,
1989
+ tax_rates: nil,
1990
+ trial: nil
1991
+ )
1992
+ @discounts = discounts
1993
+ @metadata = metadata
1994
+ @price = price
1995
+ @quantity = quantity
1996
+ @tax_rates = tax_rates
1997
+ @trial = trial
1998
+ end
1999
+ end
2000
+
2001
+ class Remove < Stripe::RequestParams
2002
+ # ID of a price to remove.
2003
+ attr_accessor :price
2004
+
2005
+ def initialize(price: nil)
2006
+ @price = price
2007
+ end
2008
+ end
2009
+
2010
+ class Set < Stripe::RequestParams
2011
+ class Discount < Stripe::RequestParams
2012
+ class DiscountEnd < Stripe::RequestParams
2013
+ class Duration < Stripe::RequestParams
2014
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2015
+ attr_accessor :interval
2016
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2017
+ attr_accessor :interval_count
2018
+
2019
+ def initialize(interval: nil, interval_count: nil)
2020
+ @interval = interval
2021
+ @interval_count = interval_count
2022
+ end
2023
+ end
2024
+ # Time span for the redeemed discount.
2025
+ attr_accessor :duration
2026
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2027
+ attr_accessor :timestamp
2028
+ # The type of calculation made to determine when the discount ends.
2029
+ attr_accessor :type
2030
+
2031
+ def initialize(duration: nil, timestamp: nil, type: nil)
2032
+ @duration = duration
2033
+ @timestamp = timestamp
2034
+ @type = type
2035
+ end
2036
+ end
2037
+ # ID of the coupon to create a new discount for.
2038
+ attr_accessor :coupon
2039
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2040
+ attr_accessor :discount
2041
+ # Details to determine how long the discount should be applied for.
2042
+ attr_accessor :discount_end
2043
+ # ID of the promotion code to create a new discount for.
2044
+ attr_accessor :promotion_code
2045
+
2046
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2047
+ @coupon = coupon
2048
+ @discount = discount
2049
+ @discount_end = discount_end
2050
+ @promotion_code = promotion_code
2051
+ end
2052
+ end
2053
+
2054
+ class Trial < Stripe::RequestParams
2055
+ # 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.
2056
+ attr_accessor :converts_to
2057
+ # Determines the type of trial for this item.
2058
+ attr_accessor :type
2059
+
2060
+ def initialize(converts_to: nil, type: nil)
2061
+ @converts_to = converts_to
2062
+ @type = type
2063
+ end
2064
+ end
2065
+ # 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`.
2066
+ attr_accessor :discounts
2067
+ # 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`.
2068
+ attr_accessor :metadata
2069
+ # The ID of the price object.
2070
+ attr_accessor :price
2071
+ # 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`.
2072
+ attr_accessor :quantity
2073
+ # 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`.
2074
+ attr_accessor :tax_rates
2075
+ # 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`.
2076
+ attr_accessor :trial
2077
+
2078
+ def initialize(
2079
+ discounts: nil,
2080
+ metadata: nil,
2081
+ price: nil,
2082
+ quantity: nil,
2083
+ tax_rates: nil,
2084
+ trial: nil
2085
+ )
2086
+ @discounts = discounts
2087
+ @metadata = metadata
2088
+ @price = price
2089
+ @quantity = quantity
2090
+ @tax_rates = tax_rates
2091
+ @trial = trial
2092
+ end
2093
+ end
2094
+ # 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.
2095
+ attr_accessor :add
2096
+ # Details of the subscription item to remove.
2097
+ attr_accessor :remove
2098
+ # 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.
2099
+ attr_accessor :set
2100
+ # Determines the type of item action.
2101
+ attr_accessor :type
2102
+
2103
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2104
+ @add = add
2105
+ @remove = remove
2106
+ @set = set
2107
+ @type = type
2108
+ end
2109
+ end
2110
+
2111
+ class MetadataAction < Stripe::RequestParams
2112
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2113
+ attr_accessor :add
2114
+ # Keys to remove from schedule phase metadata.
2115
+ attr_accessor :remove
2116
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2117
+ attr_accessor :set
2118
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
2119
+ attr_accessor :type
2120
+
2121
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2122
+ @add = add
2123
+ @remove = remove
2124
+ @set = set
2125
+ @type = type
2126
+ end
2127
+ end
2128
+
2129
+ class SetPauseCollection < Stripe::RequestParams
2130
+ class Set < Stripe::RequestParams
2131
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2132
+ attr_accessor :behavior
2133
+
2134
+ def initialize(behavior: nil)
2135
+ @behavior = behavior
2136
+ end
2137
+ end
2138
+ # Details of the pause_collection behavior to apply to the amendment.
2139
+ attr_accessor :set
2140
+ # Determines the type of the pause_collection amendment.
2141
+ attr_accessor :type
2142
+
2143
+ def initialize(set: nil, type: nil)
2144
+ @set = set
2145
+ @type = type
2146
+ end
2147
+ end
2148
+
2149
+ class TrialSettings < Stripe::RequestParams
2150
+ class EndBehavior < Stripe::RequestParams
2151
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2152
+ attr_accessor :prorate_up_front
2153
+
2154
+ def initialize(prorate_up_front: nil)
2155
+ @prorate_up_front = prorate_up_front
2156
+ end
2157
+ end
2158
+ # Defines how the subscription should behave when a trial ends.
2159
+ attr_accessor :end_behavior
2160
+
2161
+ def initialize(end_behavior: nil)
2162
+ @end_behavior = end_behavior
2163
+ end
2164
+ end
2165
+ # 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.
2166
+ attr_accessor :amendment_end
2167
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2168
+ attr_accessor :amendment_start
2169
+ # 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.
2170
+ attr_accessor :billing_cycle_anchor
2171
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2172
+ attr_accessor :discount_actions
2173
+ # Changes to the subscription items during the amendment time span.
2174
+ attr_accessor :item_actions
2175
+ # Instructions for how to modify phase metadata
2176
+ attr_accessor :metadata_actions
2177
+ # 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`.
2178
+ attr_accessor :proration_behavior
2179
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2180
+ attr_accessor :set_pause_collection
2181
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2182
+ attr_accessor :set_schedule_end
2183
+ # Settings related to subscription trials.
2184
+ attr_accessor :trial_settings
2185
+
2186
+ def initialize(
2187
+ amendment_end: nil,
2188
+ amendment_start: nil,
2189
+ billing_cycle_anchor: nil,
2190
+ discount_actions: nil,
2191
+ item_actions: nil,
2192
+ metadata_actions: nil,
2193
+ proration_behavior: nil,
2194
+ set_pause_collection: nil,
2195
+ set_schedule_end: nil,
2196
+ trial_settings: nil
2197
+ )
2198
+ @amendment_end = amendment_end
2199
+ @amendment_start = amendment_start
2200
+ @billing_cycle_anchor = billing_cycle_anchor
2201
+ @discount_actions = discount_actions
2202
+ @item_actions = item_actions
2203
+ @metadata_actions = metadata_actions
2204
+ @proration_behavior = proration_behavior
2205
+ @set_pause_collection = set_pause_collection
2206
+ @set_schedule_end = set_schedule_end
2207
+ @trial_settings = trial_settings
2208
+ end
2209
+ end
2210
+
2211
+ class Prebilling < Stripe::RequestParams
2212
+ class BillFrom < Stripe::RequestParams
2213
+ class AmendmentStart < Stripe::RequestParams
2214
+ # 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.
2215
+ attr_accessor :index
2216
+
2217
+ def initialize(index: nil)
2218
+ @index = index
2219
+ end
2220
+ end
2221
+ # Start the prebilled period when a specified amendment begins.
2222
+ attr_accessor :amendment_start
2223
+ # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2224
+ attr_accessor :timestamp
2225
+ # Select one of several ways to pass the `bill_from` value.
2226
+ attr_accessor :type
2227
+
2228
+ def initialize(amendment_start: nil, timestamp: nil, type: nil)
2229
+ @amendment_start = amendment_start
2230
+ @timestamp = timestamp
2231
+ @type = type
2232
+ end
2233
+ end
2234
+
2235
+ class BillUntil < Stripe::RequestParams
2236
+ class AmendmentEnd < Stripe::RequestParams
2237
+ # 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.
2238
+ attr_accessor :index
2239
+
2240
+ def initialize(index: nil)
2241
+ @index = index
2242
+ end
2243
+ end
2244
+
2245
+ class Duration < Stripe::RequestParams
2246
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2247
+ attr_accessor :interval
2248
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2249
+ attr_accessor :interval_count
2250
+
2251
+ def initialize(interval: nil, interval_count: nil)
2252
+ @interval = interval
2253
+ @interval_count = interval_count
2254
+ end
2255
+ end
2256
+ # End the prebilled period when a specified amendment ends.
2257
+ attr_accessor :amendment_end
2258
+ # Time span for prebilling, starting from `bill_from`.
2259
+ attr_accessor :duration
2260
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
2261
+ attr_accessor :timestamp
2262
+ # Select one of several ways to pass the `bill_until` value.
2263
+ attr_accessor :type
2264
+
2265
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
2266
+ @amendment_end = amendment_end
2267
+ @duration = duration
2268
+ @timestamp = timestamp
2269
+ @type = type
2270
+ end
2271
+ end
2272
+ # The beginning of the prebilled time period. The default value is `now`.
2273
+ attr_accessor :bill_from
2274
+ # The end of the prebilled time period.
2275
+ attr_accessor :bill_until
2276
+ # When the prebilling invoice should be created. The default value is `now`.
2277
+ attr_accessor :invoice_at
2278
+ # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
2279
+ attr_accessor :update_behavior
2280
+
2281
+ def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
2282
+ @bill_from = bill_from
2283
+ @bill_until = bill_until
2284
+ @invoice_at = invoice_at
2285
+ @update_behavior = update_behavior
2286
+ end
2287
+ end
2288
+
2289
+ class ScheduleSettings < Stripe::RequestParams
2290
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2291
+ attr_accessor :end_behavior
2292
+
2293
+ def initialize(end_behavior: nil)
2294
+ @end_behavior = end_behavior
2295
+ end
2296
+ end
2297
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
2298
+ attr_accessor :amendments
2299
+ # Specifies which fields in the response should be expanded.
2300
+ attr_accessor :expand
2301
+ # Provide any time periods to bill in advance.
2302
+ attr_accessor :prebilling
2303
+ # In cases where the amendment changes the currently active phase,
2304
+ # specifies if and how to prorate at the time of the request.
2305
+ attr_accessor :proration_behavior
2306
+ # Changes to apply to the subscription schedule.
2307
+ attr_accessor :schedule_settings
2308
+
2309
+ def initialize(
2310
+ amendments: nil,
2311
+ expand: nil,
2312
+ prebilling: nil,
2313
+ proration_behavior: nil,
2314
+ schedule_settings: nil
2315
+ )
2316
+ @amendments = amendments
2317
+ @expand = expand
2318
+ @prebilling = prebilling
1347
2319
  @proration_behavior = proration_behavior
2320
+ @schedule_settings = schedule_settings
1348
2321
  end
1349
2322
  end
1350
2323
 
@@ -1376,6 +2349,10 @@ module Stripe
1376
2349
  end
1377
2350
  # ID of the Connect Application that created the schedule.
1378
2351
  attr_reader :application
2352
+ # 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.
2353
+ attr_reader :billing_behavior
2354
+ # The [billing mode](/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule.
2355
+ attr_reader :billing_mode
1379
2356
  # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
1380
2357
  attr_reader :canceled_at
1381
2358
  # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
@@ -1386,12 +2363,16 @@ module Stripe
1386
2363
  attr_reader :current_phase
1387
2364
  # ID of the customer who owns the subscription schedule.
1388
2365
  attr_reader :customer
2366
+ # ID of the account who owns the subscription schedule.
2367
+ attr_reader :customer_account
1389
2368
  # Attribute for field default_settings
1390
2369
  attr_reader :default_settings
1391
2370
  # 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.
1392
2371
  attr_reader :end_behavior
1393
2372
  # Unique identifier for the object.
1394
2373
  attr_reader :id
2374
+ # Details of the most recent price migration that failed for the subscription schedule.
2375
+ attr_reader :last_price_migration_error
1395
2376
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
1396
2377
  attr_reader :livemode
1397
2378
  # 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.
@@ -1400,6 +2381,8 @@ module Stripe
1400
2381
  attr_reader :object
1401
2382
  # Configuration for the subscription schedule's phases.
1402
2383
  attr_reader :phases
2384
+ # Time period and invoice for a Subscription billed in advance.
2385
+ attr_reader :prebilling
1403
2386
  # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
1404
2387
  attr_reader :released_at
1405
2388
  # ID of the subscription once managed by the subscription schedule (if it is released).
@@ -1411,6 +2394,26 @@ module Stripe
1411
2394
  # ID of the test clock this subscription schedule belongs to.
1412
2395
  attr_reader :test_clock
1413
2396
 
2397
+ # Amends an existing subscription schedule.
2398
+ def amend(params = {}, opts = {})
2399
+ request_stripe_object(
2400
+ method: :post,
2401
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
2402
+ params: params,
2403
+ opts: opts
2404
+ )
2405
+ end
2406
+
2407
+ # Amends an existing subscription schedule.
2408
+ def self.amend(schedule, params = {}, opts = {})
2409
+ request_stripe_object(
2410
+ method: :post,
2411
+ path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
2412
+ params: params,
2413
+ opts: opts
2414
+ )
2415
+ end
2416
+
1414
2417
  # 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.
1415
2418
  def cancel(params = {}, opts = {})
1416
2419
  request_stripe_object(