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