stripe 15.5.0 → 15.6.0.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (803) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1723 -642
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +34 -0
  7. data/lib/stripe/api_version.rb +1 -2
  8. data/lib/stripe/errors.rb +63 -0
  9. data/lib/stripe/event_types.rb +185 -0
  10. data/lib/stripe/events/v2_billing_cadence_billed_event.rb +21 -0
  11. data/lib/stripe/events/v2_billing_cadence_canceled_event.rb +21 -0
  12. data/lib/stripe/events/v2_billing_cadence_created_event.rb +23 -0
  13. data/lib/stripe/events/v2_billing_cadence_errored_event.rb +21 -0
  14. data/lib/stripe/events/v2_billing_license_fee_created_event.rb +21 -0
  15. data/lib/stripe/events/v2_billing_license_fee_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_billing_license_fee_version_created_event.rb +23 -0
  17. data/lib/stripe/events/v2_billing_licensed_item_created_event.rb +21 -0
  18. data/lib/stripe/events/v2_billing_licensed_item_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_billing_metered_item_created_event.rb +21 -0
  20. data/lib/stripe/events/v2_billing_metered_item_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_billing_pricing_plan_component_created_event.rb +23 -0
  22. data/lib/stripe/events/v2_billing_pricing_plan_component_updated_event.rb +23 -0
  23. data/lib/stripe/events/v2_billing_pricing_plan_created_event.rb +21 -0
  24. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_awaiting_customer_action_event.rb +21 -0
  25. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_current_event.rb +21 -0
  26. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_past_due_event.rb +21 -0
  27. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_paused_event.rb +21 -0
  28. data/lib/stripe/events/v2_billing_pricing_plan_subscription_collection_unpaid_event.rb +21 -0
  29. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_activated_event.rb +21 -0
  30. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_canceled_event.rb +21 -0
  31. data/lib/stripe/events/v2_billing_pricing_plan_subscription_servicing_paused_event.rb +21 -0
  32. data/lib/stripe/events/v2_billing_pricing_plan_updated_event.rb +21 -0
  33. data/lib/stripe/events/v2_billing_pricing_plan_version_created_event.rb +23 -0
  34. data/lib/stripe/events/v2_billing_rate_card_created_event.rb +23 -0
  35. data/lib/stripe/events/v2_billing_rate_card_rate_created_event.rb +23 -0
  36. data/lib/stripe/events/v2_billing_rate_card_subscription_activated_event.rb +21 -0
  37. data/lib/stripe/events/v2_billing_rate_card_subscription_canceled_event.rb +21 -0
  38. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_awaiting_customer_action_event.rb +21 -0
  39. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_current_event.rb +21 -0
  40. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_past_due_event.rb +21 -0
  41. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_paused_event.rb +21 -0
  42. data/lib/stripe/events/v2_billing_rate_card_subscription_collection_unpaid_event.rb +21 -0
  43. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_activated_event.rb +21 -0
  44. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_canceled_event.rb +21 -0
  45. data/lib/stripe/events/v2_billing_rate_card_subscription_servicing_paused_event.rb +21 -0
  46. data/lib/stripe/events/v2_billing_rate_card_updated_event.rb +21 -0
  47. data/lib/stripe/events/v2_billing_rate_card_version_created_event.rb +23 -0
  48. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  49. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  50. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  51. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  52. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  53. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  54. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  55. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  56. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
  57. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
  58. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  59. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  60. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  61. data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
  62. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  63. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  64. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  65. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  66. data/lib/stripe/events/v2_core_health_api_error_firing_event.rb +13 -0
  67. data/lib/stripe/events/v2_core_health_api_error_resolved_event.rb +13 -0
  68. data/lib/stripe/events/v2_core_health_api_latency_firing_event.rb +13 -0
  69. data/lib/stripe/events/v2_core_health_api_latency_resolved_event.rb +13 -0
  70. data/lib/stripe/events/v2_core_health_authorization_rate_drop_firing_event.rb +13 -0
  71. data/lib/stripe/events/v2_core_health_authorization_rate_drop_resolved_event.rb +13 -0
  72. data/lib/stripe/events/v2_core_health_event_generation_failure_resolved_event.rb +13 -0
  73. data/lib/stripe/events/v2_core_health_fraud_rate_increased_event.rb +13 -0
  74. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_firing_event.rb +13 -0
  75. data/lib/stripe/events/v2_core_health_issuing_authorization_request_timeout_resolved_event.rb +13 -0
  76. data/lib/stripe/events/v2_core_health_payment_method_error_firing_event.rb +13 -0
  77. data/lib/stripe/events/v2_core_health_payment_method_error_resolved_event.rb +13 -0
  78. data/lib/stripe/events/v2_core_health_traffic_volume_drop_firing_event.rb +13 -0
  79. data/lib/stripe/events/v2_core_health_traffic_volume_drop_resolved_event.rb +13 -0
  80. data/lib/stripe/events/v2_core_health_webhook_latency_firing_event.rb +13 -0
  81. data/lib/stripe/events/v2_core_health_webhook_latency_resolved_event.rb +13 -0
  82. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  83. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  84. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  85. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  86. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  87. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  88. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  89. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  90. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  91. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  92. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  93. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  94. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  95. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  96. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  97. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  98. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  99. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  100. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  101. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  102. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  103. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  104. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  105. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
  106. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  107. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  108. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  109. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  110. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  111. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  112. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  113. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  114. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  115. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  116. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  117. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  118. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
  119. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  120. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  121. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  122. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  123. data/lib/stripe/events/v2_reporting_report_run_created_event.rb +21 -0
  124. data/lib/stripe/events/v2_reporting_report_run_failed_event.rb +21 -0
  125. data/lib/stripe/events/v2_reporting_report_run_succeeded_event.rb +21 -0
  126. data/lib/stripe/events/v2_reporting_report_run_updated_event.rb +21 -0
  127. data/lib/stripe/object_types.rb +80 -0
  128. data/lib/stripe/resources/account.rb +1137 -42
  129. data/lib/stripe/resources/account_link.rb +8 -0
  130. data/lib/stripe/resources/account_notice.rb +147 -0
  131. data/lib/stripe/resources/account_session.rb +688 -8
  132. data/lib/stripe/resources/apple_pay_domain.rb +8 -0
  133. data/lib/stripe/resources/application.rb +8 -0
  134. data/lib/stripe/resources/application_fee.rb +16 -0
  135. data/lib/stripe/resources/application_fee_refund.rb +8 -0
  136. data/lib/stripe/resources/apps/secret.rb +16 -0
  137. data/lib/stripe/resources/balance.rb +159 -0
  138. data/lib/stripe/resources/balance_settings.rb +152 -0
  139. data/lib/stripe/resources/balance_transaction.rb +16 -0
  140. data/lib/stripe/resources/bank_account.rb +40 -0
  141. data/lib/stripe/resources/billing/alert.rb +203 -1
  142. data/lib/stripe/resources/billing/alert_triggered.rb +14 -0
  143. data/lib/stripe/resources/billing/credit_balance_summary.rb +132 -0
  144. data/lib/stripe/resources/billing/credit_balance_transaction.rb +161 -0
  145. data/lib/stripe/resources/billing/credit_grant.rb +143 -2
  146. data/lib/stripe/resources/billing/meter.rb +45 -0
  147. data/lib/stripe/resources/billing/meter_event.rb +8 -0
  148. data/lib/stripe/resources/billing/meter_event_adjustment.rb +16 -0
  149. data/lib/stripe/resources/billing/meter_event_summary.rb +8 -0
  150. data/lib/stripe/resources/billing/meter_usage.rb +31 -0
  151. data/lib/stripe/resources/billing/meter_usage_row.rb +36 -0
  152. data/lib/stripe/resources/billing_portal/configuration.rb +122 -0
  153. data/lib/stripe/resources/billing_portal/session.rb +107 -0
  154. data/lib/stripe/resources/capability.rb +56 -0
  155. data/lib/stripe/resources/capital/financing_offer.rb +203 -0
  156. data/lib/stripe/resources/capital/financing_summary.rb +79 -0
  157. data/lib/stripe/resources/capital/financing_transaction.rb +138 -0
  158. data/lib/stripe/resources/card.rb +18 -0
  159. data/lib/stripe/resources/cash_balance.rb +18 -0
  160. data/lib/stripe/resources/charge.rb +2587 -15
  161. data/lib/stripe/resources/checkout/session.rb +1583 -15
  162. data/lib/stripe/resources/climate/order.rb +32 -0
  163. data/lib/stripe/resources/climate/product.rb +16 -0
  164. data/lib/stripe/resources/climate/supplier.rb +16 -0
  165. data/lib/stripe/resources/confirmation_token.rb +1126 -34
  166. data/lib/stripe/resources/connect_collection_transfer.rb +8 -0
  167. data/lib/stripe/resources/country_spec.rb +32 -0
  168. data/lib/stripe/resources/coupon.rb +66 -1
  169. data/lib/stripe/resources/credit_note.rb +76 -0
  170. data/lib/stripe/resources/credit_note_line_item.rb +62 -0
  171. data/lib/stripe/resources/customer.rb +79 -0
  172. data/lib/stripe/resources/customer_balance_transaction.rb +10 -0
  173. data/lib/stripe/resources/customer_cash_balance_transaction.rb +110 -0
  174. data/lib/stripe/resources/customer_session.rb +58 -1
  175. data/lib/stripe/resources/discount.rb +10 -0
  176. data/lib/stripe/resources/dispute.rb +177 -0
  177. data/lib/stripe/resources/entitlements/active_entitlement.rb +8 -0
  178. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +8 -0
  179. data/lib/stripe/resources/entitlements/feature.rb +8 -0
  180. data/lib/stripe/resources/ephemeral_key.rb +8 -0
  181. data/lib/stripe/resources/event.rb +87 -0
  182. data/lib/stripe/resources/exchange_rate.rb +8 -0
  183. data/lib/stripe/resources/file.rb +8 -0
  184. data/lib/stripe/resources/file_link.rb +8 -0
  185. data/lib/stripe/resources/financial_connections/account.rb +101 -1
  186. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +35 -0
  187. data/lib/stripe/resources/financial_connections/account_owner.rb +8 -0
  188. data/lib/stripe/resources/financial_connections/account_ownership.rb +8 -0
  189. data/lib/stripe/resources/financial_connections/institution.rb +145 -0
  190. data/lib/stripe/resources/financial_connections/session.rb +124 -2
  191. data/lib/stripe/resources/financial_connections/transaction.rb +16 -0
  192. data/lib/stripe/resources/forwarding/request.rb +52 -0
  193. data/lib/stripe/resources/funding_instructions.rb +193 -0
  194. data/lib/stripe/resources/fx_quote.rb +234 -0
  195. data/lib/stripe/resources/identity/verification_report.rb +166 -1
  196. data/lib/stripe/resources/identity/verification_session.rb +136 -1
  197. data/lib/stripe/resources/invoice.rb +1591 -18
  198. data/lib/stripe/resources/invoice_item.rb +214 -2
  199. data/lib/stripe/resources/invoice_line_item.rb +293 -1
  200. data/lib/stripe/resources/invoice_payment.rb +30 -1
  201. data/lib/stripe/resources/invoice_rendering_template.rb +8 -0
  202. data/lib/stripe/resources/issuing/authorization.rb +177 -0
  203. data/lib/stripe/resources/issuing/card.rb +96 -8
  204. data/lib/stripe/resources/issuing/cardholder.rb +112 -1
  205. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +684 -0
  206. data/lib/stripe/resources/issuing/dispute.rb +97 -0
  207. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +98 -0
  208. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +94 -0
  209. data/lib/stripe/resources/issuing/personalization_design.rb +36 -0
  210. data/lib/stripe/resources/issuing/physical_bundle.rb +16 -0
  211. data/lib/stripe/resources/issuing/settlement.rb +61 -0
  212. data/lib/stripe/resources/issuing/token.rb +61 -0
  213. data/lib/stripe/resources/issuing/transaction.rb +157 -0
  214. data/lib/stripe/resources/line_item.rb +91 -0
  215. data/lib/stripe/resources/login_link.rb +8 -0
  216. data/lib/stripe/resources/mandate.rb +331 -12
  217. data/lib/stripe/resources/margin.rb +123 -0
  218. data/lib/stripe/resources/order.rb +3306 -0
  219. data/lib/stripe/resources/payment_attempt_record.rb +2056 -0
  220. data/lib/stripe/resources/payment_intent.rb +11019 -3714
  221. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +128 -0
  222. data/lib/stripe/resources/payment_link.rb +337 -0
  223. data/lib/stripe/resources/payment_method.rb +1074 -35
  224. data/lib/stripe/resources/payment_method_configuration.rb +1260 -4
  225. data/lib/stripe/resources/payment_method_domain.rb +111 -0
  226. data/lib/stripe/resources/payment_record.rb +2602 -0
  227. data/lib/stripe/resources/payout.rb +16 -0
  228. data/lib/stripe/resources/person.rb +180 -0
  229. data/lib/stripe/resources/plan.rb +24 -0
  230. data/lib/stripe/resources/price.rb +109 -0
  231. data/lib/stripe/resources/privacy/redaction_job.rb +314 -0
  232. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +49 -0
  233. data/lib/stripe/resources/product.rb +27 -0
  234. data/lib/stripe/resources/product_feature.rb +8 -0
  235. data/lib/stripe/resources/promotion_code.rb +34 -0
  236. data/lib/stripe/resources/quote.rb +2512 -49
  237. data/lib/stripe/resources/quote_line.rb +521 -0
  238. data/lib/stripe/resources/quote_preview_invoice.rb +1134 -0
  239. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +718 -0
  240. data/lib/stripe/resources/radar/early_fraud_warning.rb +8 -0
  241. data/lib/stripe/resources/radar/value_list.rb +8 -0
  242. data/lib/stripe/resources/radar/value_list_item.rb +8 -0
  243. data/lib/stripe/resources/refund.rb +389 -19
  244. data/lib/stripe/resources/reporting/report_run.rb +16 -0
  245. data/lib/stripe/resources/reporting/report_type.rb +8 -0
  246. data/lib/stripe/resources/reserve_transaction.rb +8 -0
  247. data/lib/stripe/resources/reversal.rb +8 -0
  248. data/lib/stripe/resources/review.rb +24 -0
  249. data/lib/stripe/resources/setup_attempt.rb +352 -17
  250. data/lib/stripe/resources/setup_intent.rb +1065 -12
  251. data/lib/stripe/resources/shipping_rate.rb +48 -0
  252. data/lib/stripe/resources/sigma/scheduled_query_run.rb +16 -0
  253. data/lib/stripe/resources/source.rb +303 -0
  254. data/lib/stripe/resources/source_mandate_notification.rb +32 -0
  255. data/lib/stripe/resources/source_transaction.rb +54 -0
  256. data/lib/stripe/resources/subscription.rb +720 -11
  257. data/lib/stripe/resources/subscription_item.rb +108 -3
  258. data/lib/stripe/resources/subscription_schedule.rb +1321 -10
  259. data/lib/stripe/resources/tax/association.rb +98 -0
  260. data/lib/stripe/resources/tax/calculation.rb +109 -0
  261. data/lib/stripe/resources/tax/calculation_line_item.rb +32 -0
  262. data/lib/stripe/resources/tax/form.rb +318 -0
  263. data/lib/stripe/resources/tax/registration.rb +1232 -0
  264. data/lib/stripe/resources/tax/settings.rb +61 -1
  265. data/lib/stripe/resources/tax/transaction.rb +93 -0
  266. data/lib/stripe/resources/tax/transaction_line_item.rb +16 -0
  267. data/lib/stripe/resources/tax_code.rb +8 -0
  268. data/lib/stripe/resources/tax_deducted_at_source.rb +8 -0
  269. data/lib/stripe/resources/tax_id.rb +36 -2
  270. data/lib/stripe/resources/tax_rate.rb +16 -0
  271. data/lib/stripe/resources/terminal/configuration.rb +332 -0
  272. data/lib/stripe/resources/terminal/connection_token.rb +8 -0
  273. data/lib/stripe/resources/terminal/location.rb +16 -0
  274. data/lib/stripe/resources/terminal/onboarding_link.rb +108 -0
  275. data/lib/stripe/resources/terminal/reader.rb +249 -0
  276. data/lib/stripe/resources/terminal/reader_collected_data.rb +47 -0
  277. data/lib/stripe/resources/test_helpers/test_clock.rb +24 -0
  278. data/lib/stripe/resources/token.rb +8 -0
  279. data/lib/stripe/resources/topup.rb +8 -0
  280. data/lib/stripe/resources/transfer.rb +14 -0
  281. data/lib/stripe/resources/treasury/credit_reversal.rb +16 -0
  282. data/lib/stripe/resources/treasury/debit_reversal.rb +24 -0
  283. data/lib/stripe/resources/treasury/financial_account.rb +83 -3
  284. data/lib/stripe/resources/treasury/financial_account_features.rb +194 -0
  285. data/lib/stripe/resources/treasury/inbound_transfer.rb +69 -0
  286. data/lib/stripe/resources/treasury/outbound_payment.rb +106 -0
  287. data/lib/stripe/resources/treasury/outbound_transfer.rb +151 -0
  288. data/lib/stripe/resources/treasury/received_credit.rb +135 -1
  289. data/lib/stripe/resources/treasury/received_debit.rb +129 -1
  290. data/lib/stripe/resources/treasury/transaction.rb +36 -0
  291. data/lib/stripe/resources/treasury/transaction_entry.rb +24 -0
  292. data/lib/stripe/resources/v2/billing/bill_setting.rb +102 -0
  293. data/lib/stripe/resources/v2/billing/bill_setting_version.rb +90 -0
  294. data/lib/stripe/resources/v2/billing/cadence.rb +323 -0
  295. data/lib/stripe/resources/v2/billing/collection_setting.rb +296 -0
  296. data/lib/stripe/resources/v2/billing/collection_setting_version.rb +284 -0
  297. data/lib/stripe/resources/v2/billing/custom_pricing_unit.rb +43 -0
  298. data/lib/stripe/resources/v2/billing/intent.rb +86 -0
  299. data/lib/stripe/resources/v2/billing/intent_action.rb +395 -0
  300. data/lib/stripe/resources/v2/billing/license_fee.rb +103 -0
  301. data/lib/stripe/resources/v2/billing/license_fee_subscription.rb +44 -0
  302. data/lib/stripe/resources/v2/billing/license_fee_version.rb +80 -0
  303. data/lib/stripe/resources/v2/billing/licensed_item.rb +60 -0
  304. data/lib/stripe/resources/v2/billing/meter_event.rb +8 -0
  305. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +16 -0
  306. data/lib/stripe/resources/v2/billing/meter_event_session.rb +8 -0
  307. data/lib/stripe/resources/v2/billing/metered_item.rb +85 -0
  308. data/lib/stripe/resources/v2/billing/pricing_plan.rb +51 -0
  309. data/lib/stripe/resources/v2/billing/pricing_plan_component.rb +94 -0
  310. data/lib/stripe/resources/v2/billing/pricing_plan_subscription.rb +90 -0
  311. data/lib/stripe/resources/v2/billing/pricing_plan_version.rb +38 -0
  312. data/lib/stripe/resources/v2/billing/profile.rb +46 -0
  313. data/lib/stripe/resources/v2/billing/rate_card.rb +61 -0
  314. data/lib/stripe/resources/v2/billing/rate_card_rate.rb +107 -0
  315. data/lib/stripe/resources/v2/billing/rate_card_subscription.rb +90 -0
  316. data/lib/stripe/resources/v2/billing/rate_card_version.rb +34 -0
  317. data/lib/stripe/resources/v2/billing/service_action.rb +232 -0
  318. data/lib/stripe/resources/v2/core/account.rb +3838 -0
  319. data/lib/stripe/resources/v2/core/account_link.rb +123 -0
  320. data/lib/stripe/resources/v2/core/claimable_sandbox.rb +81 -0
  321. data/lib/stripe/resources/v2/core/person.rb +477 -0
  322. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +114 -0
  323. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +47 -0
  324. data/lib/stripe/resources/v2/event.rb +26 -0
  325. data/lib/stripe/resources/v2/event_destination.rb +44 -0
  326. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +28 -0
  327. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +30 -0
  328. data/lib/stripe/resources/v2/money_management/adjustment.rb +67 -0
  329. data/lib/stripe/resources/v2/money_management/financial_account.rb +140 -0
  330. data/lib/stripe/resources/v2/money_management/financial_address.rb +100 -0
  331. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +181 -0
  332. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +217 -0
  333. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +144 -0
  334. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +69 -0
  335. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +196 -0
  336. data/lib/stripe/resources/v2/money_management/payout_method.rb +109 -0
  337. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +81 -0
  338. data/lib/stripe/resources/v2/money_management/received_credit.rb +199 -0
  339. data/lib/stripe/resources/v2/money_management/received_debit.rb +136 -0
  340. data/lib/stripe/resources/v2/money_management/transaction.rb +116 -0
  341. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +105 -0
  342. data/lib/stripe/resources/v2/payments/off_session_payment.rb +113 -0
  343. data/lib/stripe/resources/v2/reporting/report.rb +116 -0
  344. data/lib/stripe/resources/v2/reporting/report_run.rb +158 -0
  345. data/lib/stripe/resources/v2/tax/automatic_rule.rb +39 -0
  346. data/lib/stripe/resources/webhook_endpoint.rb +8 -0
  347. data/lib/stripe/resources.rb +194 -0
  348. data/lib/stripe/services/account_notice_service.rb +101 -0
  349. data/lib/stripe/services/account_service.rb +562 -1
  350. data/lib/stripe/services/account_session_service.rb +226 -1
  351. data/lib/stripe/services/balance_settings_service.rb +99 -0
  352. data/lib/stripe/services/billing/alert_service.rb +75 -1
  353. data/lib/stripe/services/billing/credit_balance_summary_service.rb +17 -2
  354. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  355. data/lib/stripe/services/billing/credit_grant_service.rb +37 -2
  356. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  357. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  358. data/lib/stripe/services/billing_service.rb +2 -1
  359. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  360. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  361. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  362. data/lib/stripe/services/capital_service.rb +15 -0
  363. data/lib/stripe/services/charge_service.rb +1418 -0
  364. data/lib/stripe/services/checkout/session_service.rb +472 -5
  365. data/lib/stripe/services/coupon_service.rb +17 -1
  366. data/lib/stripe/services/credit_note_service.rb +4 -0
  367. data/lib/stripe/services/customer_session_service.rb +4 -1
  368. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  369. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  370. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  371. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  372. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  373. data/lib/stripe/services/financial_connections_service.rb +2 -1
  374. data/lib/stripe/services/fx_quote_service.rb +123 -0
  375. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  376. data/lib/stripe/services/invoice_item_service.rb +74 -2
  377. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  378. data/lib/stripe/services/invoice_payment_service.rb +4 -1
  379. data/lib/stripe/services/invoice_service.rb +1078 -16
  380. data/lib/stripe/services/issuing/card_service.rb +0 -8
  381. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  382. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  383. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  384. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  385. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  386. data/lib/stripe/services/issuing_service.rb +5 -1
  387. data/lib/stripe/services/mandate_service.rb +40 -0
  388. data/lib/stripe/services/margin_service.rb +119 -0
  389. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  390. data/lib/stripe/services/order_service.rb +2388 -0
  391. data/lib/stripe/services/payment_attempt_record_service.rb +52 -0
  392. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  393. data/lib/stripe/services/payment_intent_service.rb +7630 -2215
  394. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  395. data/lib/stripe/services/payment_method_service.rb +120 -1
  396. data/lib/stripe/services/payment_record_service.rb +562 -0
  397. data/lib/stripe/services/price_service.rb +19 -0
  398. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  399. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  400. data/lib/stripe/services/privacy_service.rb +13 -0
  401. data/lib/stripe/services/promotion_code_service.rb +8 -0
  402. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  403. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  404. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  405. data/lib/stripe/services/quote_service.rb +1723 -8
  406. data/lib/stripe/services/setup_intent_service.rb +691 -9
  407. data/lib/stripe/services/subscription_item_service.rb +75 -3
  408. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  409. data/lib/stripe/services/subscription_service.rb +336 -9
  410. data/lib/stripe/services/tax/association_service.rb +31 -0
  411. data/lib/stripe/services/tax/form_service.rb +100 -0
  412. data/lib/stripe/services/tax_id_service.rb +8 -2
  413. data/lib/stripe/services/tax_service.rb +3 -1
  414. data/lib/stripe/services/terminal/configuration_service.rb +26 -0
  415. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  416. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  417. data/lib/stripe/services/terminal_service.rb +3 -1
  418. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  419. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  420. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  421. data/lib/stripe/services/transfer_service.rb +4 -0
  422. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  423. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  424. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  425. data/lib/stripe/services/v1_services.rb +11 -1
  426. data/lib/stripe/services/v2/billing/bill_setting_service.rb +214 -0
  427. data/lib/stripe/services/v2/billing/bill_settings/version_service.rb +45 -0
  428. data/lib/stripe/services/v2/billing/cadence_service.rb +428 -0
  429. data/lib/stripe/services/v2/billing/collection_setting_service.rb +518 -0
  430. data/lib/stripe/services/v2/billing/collection_settings/version_service.rb +45 -0
  431. data/lib/stripe/services/v2/billing/custom_pricing_unit_service.rb +108 -0
  432. data/lib/stripe/services/v2/billing/intent_service.rb +465 -0
  433. data/lib/stripe/services/v2/billing/intents/action_service.rb +45 -0
  434. data/lib/stripe/services/v2/billing/license_fee_service.rb +250 -0
  435. data/lib/stripe/services/v2/billing/license_fee_subscription_service.rb +23 -0
  436. data/lib/stripe/services/v2/billing/license_fees/version_service.rb +45 -0
  437. data/lib/stripe/services/v2/billing/licensed_item_service.rb +149 -0
  438. data/lib/stripe/services/v2/billing/metered_item_service.rb +176 -0
  439. data/lib/stripe/services/v2/billing/pricing_plan_service.rb +142 -0
  440. data/lib/stripe/services/v2/billing/pricing_plan_subscription_service.rb +76 -0
  441. data/lib/stripe/services/v2/billing/pricing_plans/component_service.rb +162 -0
  442. data/lib/stripe/services/v2/billing/pricing_plans/version_service.rb +45 -0
  443. data/lib/stripe/services/v2/billing/profile_service.rb +144 -0
  444. data/lib/stripe/services/v2/billing/rate_card_service.rb +151 -0
  445. data/lib/stripe/services/v2/billing/rate_card_subscription_service.rb +144 -0
  446. data/lib/stripe/services/v2/billing/rate_cards/rate_service.rb +161 -0
  447. data/lib/stripe/services/v2/billing/rate_cards/version_service.rb +45 -0
  448. data/lib/stripe/services/v2/billing/service_action_service.rb +259 -0
  449. data/lib/stripe/services/v2/billing_service.rb +18 -1
  450. data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
  451. data/lib/stripe/services/v2/core/account_service.rb +4536 -0
  452. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  453. data/lib/stripe/services/v2/core/claimable_sandbox_service.rb +50 -0
  454. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  455. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  456. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  457. data/lib/stripe/services/v2/core_service.rb +5 -1
  458. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  459. data/lib/stripe/services/v2/money_management/financial_account_service.rb +119 -0
  460. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  461. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  462. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  463. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  464. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  465. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  466. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  467. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  468. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  469. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  470. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  471. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  472. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  473. data/lib/stripe/services/v2/payment_service.rb +15 -0
  474. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
  475. data/lib/stripe/services/v2/reporting/report_run_service.rb +88 -0
  476. data/lib/stripe/services/v2/reporting/report_service.rb +25 -0
  477. data/lib/stripe/services/v2/reporting_service.rb +16 -0
  478. data/lib/stripe/services/v2/tax/automatic_rule_service.rb +99 -0
  479. data/lib/stripe/services/v2/tax_service.rb +15 -0
  480. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  481. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
  482. data/lib/stripe/services/v2_services.rb +6 -1
  483. data/lib/stripe/services.rb +84 -0
  484. data/lib/stripe/stripe_configuration.rb +3 -1
  485. data/lib/stripe/stripe_object.rb +26 -2
  486. data/lib/stripe/util.rb +16 -6
  487. data/lib/stripe/version.rb +1 -1
  488. data/lib/stripe.rb +53 -0
  489. data/rbi/stripe.rbi +280174 -0
  490. data/stripe.gemspec +4 -1
  491. metadata +283 -324
  492. data/rbi/stripe/resources/account.rbi +0 -4991
  493. data/rbi/stripe/resources/account_link.rbi +0 -76
  494. data/rbi/stripe/resources/account_session.rbi +0 -1173
  495. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  496. data/rbi/stripe/resources/application.rbi +0 -20
  497. data/rbi/stripe/resources/application_fee.rbi +0 -118
  498. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  499. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  500. data/rbi/stripe/resources/balance.rbi +0 -230
  501. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  502. data/rbi/stripe/resources/bank_account.rbi +0 -127
  503. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  504. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  505. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  506. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  507. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  508. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  509. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  510. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  511. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  512. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -712
  513. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  514. data/rbi/stripe/resources/capability.rbi +0 -125
  515. data/rbi/stripe/resources/card.rbi +0 -125
  516. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  517. data/rbi/stripe/resources/charge.rbi +0 -2136
  518. data/rbi/stripe/resources/checkout/session.rbi +0 -4105
  519. data/rbi/stripe/resources/climate/order.rbi +0 -245
  520. data/rbi/stripe/resources/climate/product.rbi +0 -75
  521. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  522. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  523. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  524. data/rbi/stripe/resources/country_spec.rbi +0 -85
  525. data/rbi/stripe/resources/coupon.rbi +0 -250
  526. data/rbi/stripe/resources/credit_note.rbi +0 -752
  527. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  528. data/rbi/stripe/resources/customer.rbi +0 -993
  529. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  530. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  531. data/rbi/stripe/resources/customer_session.rbi +0 -200
  532. data/rbi/stripe/resources/discount.rbi +0 -53
  533. data/rbi/stripe/resources/dispute.rbi +0 -761
  534. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  535. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  536. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  537. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  538. data/rbi/stripe/resources/event.rbi +0 -137
  539. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  540. data/rbi/stripe/resources/file.rbi +0 -143
  541. data/rbi/stripe/resources/file_link.rbi +0 -141
  542. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  543. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  544. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  545. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  546. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  547. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  548. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  549. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  550. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  551. data/rbi/stripe/resources/invoice.rbi +0 -3894
  552. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  553. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  554. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  555. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  556. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  557. data/rbi/stripe/resources/issuing/card.rbi +0 -749
  558. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  559. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  560. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  561. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  562. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  563. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  564. data/rbi/stripe/resources/line_item.rbi +0 -72
  565. data/rbi/stripe/resources/login_link.rbi +0 -19
  566. data/rbi/stripe/resources/mandate.rbi +0 -191
  567. data/rbi/stripe/resources/payment_intent.rbi +0 -10011
  568. data/rbi/stripe/resources/payment_link.rbi +0 -1891
  569. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  570. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  571. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  572. data/rbi/stripe/resources/payout.rbi +0 -307
  573. data/rbi/stripe/resources/person.rbi +0 -401
  574. data/rbi/stripe/resources/plan.rbi +0 -371
  575. data/rbi/stripe/resources/price.rbi +0 -694
  576. data/rbi/stripe/resources/product.rbi +0 -553
  577. data/rbi/stripe/resources/product_feature.rbi +0 -26
  578. data/rbi/stripe/resources/promotion_code.rbi +0 -264
  579. data/rbi/stripe/resources/quote.rbi +0 -1137
  580. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  581. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  582. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  583. data/rbi/stripe/resources/refund.rbi +0 -523
  584. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  585. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  586. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  587. data/rbi/stripe/resources/reversal.rbi +0 -51
  588. data/rbi/stripe/resources/review.rbi +0 -154
  589. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  590. data/rbi/stripe/resources/setup_intent.rbi +0 -3974
  591. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  592. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  593. data/rbi/stripe/resources/source.rbi +0 -1496
  594. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  595. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  596. data/rbi/stripe/resources/subscription.rbi +0 -2154
  597. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  598. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1795
  599. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  600. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  601. data/rbi/stripe/resources/tax/registration.rbi +0 -3216
  602. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  603. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  604. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  605. data/rbi/stripe/resources/tax_code.rbi +0 -44
  606. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  607. data/rbi/stripe/resources/tax_id.rbi +0 -165
  608. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  609. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1647
  610. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  611. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  612. data/rbi/stripe/resources/terminal/reader.rbi +0 -1016
  613. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  614. data/rbi/stripe/resources/token.rbi +0 -1281
  615. data/rbi/stripe/resources/topup.rbi +0 -222
  616. data/rbi/stripe/resources/transfer.rbi +0 -199
  617. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  618. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  619. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  620. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  621. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  622. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  623. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  624. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  625. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  626. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  627. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  628. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  629. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  630. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  631. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  632. data/rbi/stripe/resources/v2/event.rbi +0 -48
  633. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  634. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  635. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  636. data/rbi/stripe/services/account_link_service.rbi +0 -60
  637. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  638. data/rbi/stripe/services/account_person_service.rbi +0 -1007
  639. data/rbi/stripe/services/account_service.rbi +0 -4281
  640. data/rbi/stripe/services/account_session_service.rbi +0 -748
  641. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  642. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  643. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  644. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  645. data/rbi/stripe/services/apps_service.rbi +0 -9
  646. data/rbi/stripe/services/balance_service.rbi +0 -21
  647. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  648. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  649. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  650. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  651. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  652. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  653. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  654. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  655. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  656. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -561
  657. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  658. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  659. data/rbi/stripe/services/billing_service.rbi +0 -15
  660. data/rbi/stripe/services/charge_service.rbi +0 -448
  661. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  662. data/rbi/stripe/services/checkout/session_service.rbi +0 -2697
  663. data/rbi/stripe/services/checkout_service.rbi +0 -9
  664. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  665. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  666. data/rbi/stripe/services/climate_service.rbi +0 -11
  667. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  668. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  669. data/rbi/stripe/services/coupon_service.rbi +0 -194
  670. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  671. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  672. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  673. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  674. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  675. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  676. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  677. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  678. data/rbi/stripe/services/customer_service.rbi +0 -635
  679. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  680. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  681. data/rbi/stripe/services/dispute_service.rbi +0 -424
  682. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  683. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  684. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  685. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  686. data/rbi/stripe/services/event_service.rbi +0 -83
  687. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  688. data/rbi/stripe/services/file_link_service.rbi +0 -124
  689. data/rbi/stripe/services/file_service.rbi +0 -116
  690. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  691. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  692. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  693. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  694. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  695. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  696. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  697. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  698. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  699. data/rbi/stripe/services/identity_service.rbi +0 -10
  700. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  701. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  702. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  703. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  704. data/rbi/stripe/services/invoice_service.rbi +0 -3073
  705. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  706. data/rbi/stripe/services/issuing/card_service.rbi +0 -503
  707. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  708. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  709. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  710. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  711. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  712. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  713. data/rbi/stripe/services/issuing_service.rbi +0 -16
  714. data/rbi/stripe/services/mandate_service.rbi +0 -20
  715. data/rbi/stripe/services/payment_intent_service.rbi +0 -8010
  716. data/rbi/stripe/services/payment_link_service.rbi +0 -1441
  717. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  718. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  719. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  720. data/rbi/stripe/services/payout_service.rbi +0 -209
  721. data/rbi/stripe/services/plan_service.rbi +0 -282
  722. data/rbi/stripe/services/price_service.rbi +0 -546
  723. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  724. data/rbi/stripe/services/product_service.rbi +0 -477
  725. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  726. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  727. data/rbi/stripe/services/quote_service.rbi +0 -695
  728. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  729. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  730. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  731. data/rbi/stripe/services/radar_service.rbi +0 -11
  732. data/rbi/stripe/services/refund_service.rbi +0 -185
  733. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  734. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  735. data/rbi/stripe/services/reporting_service.rbi +0 -10
  736. data/rbi/stripe/services/review_service.rbi +0 -84
  737. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  738. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  739. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  740. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  741. data/rbi/stripe/services/sigma_service.rbi +0 -9
  742. data/rbi/stripe/services/source_service.rbi +0 -663
  743. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  744. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1425
  745. data/rbi/stripe/services/subscription_service.rbi +0 -1768
  746. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  747. data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
  748. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  749. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  750. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  751. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  752. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  753. data/rbi/stripe/services/tax_service.rbi +0 -12
  754. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1328
  755. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  756. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  757. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  758. data/rbi/stripe/services/terminal_service.rbi +0 -12
  759. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  760. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  761. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  762. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  763. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  764. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  765. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  766. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  767. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -117
  768. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  769. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  770. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  771. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  772. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  773. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  774. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  775. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  776. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  777. data/rbi/stripe/services/token_service.rbi +0 -1255
  778. data/rbi/stripe/services/topup_service.rbi +0 -176
  779. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  780. data/rbi/stripe/services/transfer_service.rbi +0 -152
  781. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  782. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  783. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  784. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  785. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  786. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  787. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  788. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  789. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  790. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  791. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  792. data/rbi/stripe/services/treasury_service.rbi +0 -18
  793. data/rbi/stripe/services/v1_services.rbi +0 -77
  794. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  795. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  796. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  797. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  798. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  799. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  800. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  801. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  802. data/rbi/stripe/services/v2_services.rbi +0 -10
  803. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -7,6 +7,7 @@ module Stripe
7
7
  class Quote < APIResource
8
8
  extend Stripe::APIOperations::Create
9
9
  extend Stripe::APIOperations::List
10
+ extend Stripe::APIOperations::NestedResource
10
11
  include Stripe::APIOperations::Save
11
12
 
12
13
  OBJECT_NAME = "quote"
@@ -14,12 +15,23 @@ module Stripe
14
15
  "quote"
15
16
  end
16
17
 
18
+ nested_resource_class_methods :preview_invoice, operations: %i[list]
19
+ nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
20
+
17
21
  class AutomaticTax < Stripe::StripeObject
18
22
  class Liability < Stripe::StripeObject
19
23
  # The connected account being referenced when `type` is `account`.
20
24
  attr_reader :account
21
25
  # Type of the account referenced.
22
26
  attr_reader :type
27
+
28
+ def self.inner_class_types
29
+ @inner_class_types = {}
30
+ end
31
+
32
+ def self.field_remappings
33
+ @field_remappings = {}
34
+ end
23
35
  end
24
36
  # Automatically calculate taxes
25
37
  attr_reader :enabled
@@ -29,9 +41,48 @@ module Stripe
29
41
  attr_reader :provider
30
42
  # The status of the most recent automated tax calculation for this quote.
31
43
  attr_reader :status
44
+
45
+ def self.inner_class_types
46
+ @inner_class_types = { liability: Liability }
47
+ end
48
+
49
+ def self.field_remappings
50
+ @field_remappings = {}
51
+ end
32
52
  end
33
53
 
34
54
  class Computed < Stripe::StripeObject
55
+ class LastReestimationDetails < Stripe::StripeObject
56
+ class Failed < Stripe::StripeObject
57
+ # The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field.
58
+ attr_reader :failure_code
59
+ # Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID".
60
+ attr_reader :message
61
+ # The reason the reestimation failed.
62
+ attr_reader :reason
63
+
64
+ def self.inner_class_types
65
+ @inner_class_types = {}
66
+ end
67
+
68
+ def self.field_remappings
69
+ @field_remappings = {}
70
+ end
71
+ end
72
+ # When `status` is `failed`, provides details about the quote reestimation failure.
73
+ attr_reader :failed
74
+ # Latest status of the reestimation.
75
+ attr_reader :status
76
+
77
+ def self.inner_class_types
78
+ @inner_class_types = { failed: Failed }
79
+ end
80
+
81
+ def self.field_remappings
82
+ @field_remappings = {}
83
+ end
84
+ end
85
+
35
86
  class Recurring < Stripe::StripeObject
36
87
  class TotalDetails < Stripe::StripeObject
37
88
  class Breakdown < Stripe::StripeObject
@@ -43,6 +94,14 @@ module Stripe
43
94
  #
44
95
  # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
45
96
  attr_reader :discount
97
+
98
+ def self.inner_class_types
99
+ @inner_class_types = {}
100
+ end
101
+
102
+ def self.field_remappings
103
+ @field_remappings = {}
104
+ end
46
105
  end
47
106
 
48
107
  class Tax < Stripe::StripeObject
@@ -56,11 +115,27 @@ module Stripe
56
115
  attr_reader :taxability_reason
57
116
  # The amount on which tax is calculated, in cents (or local equivalent).
58
117
  attr_reader :taxable_amount
118
+
119
+ def self.inner_class_types
120
+ @inner_class_types = {}
121
+ end
122
+
123
+ def self.field_remappings
124
+ @field_remappings = {}
125
+ end
59
126
  end
60
127
  # The aggregated discounts.
61
128
  attr_reader :discounts
62
129
  # The aggregated tax amounts by rate.
63
130
  attr_reader :taxes
131
+
132
+ def self.inner_class_types
133
+ @inner_class_types = { discounts: Discount, taxes: Tax }
134
+ end
135
+
136
+ def self.field_remappings
137
+ @field_remappings = {}
138
+ end
64
139
  end
65
140
  # This is the sum of all the discounts.
66
141
  attr_reader :amount_discount
@@ -70,6 +145,14 @@ module Stripe
70
145
  attr_reader :amount_tax
71
146
  # Attribute for field breakdown
72
147
  attr_reader :breakdown
148
+
149
+ def self.inner_class_types
150
+ @inner_class_types = { breakdown: Breakdown }
151
+ end
152
+
153
+ def self.field_remappings
154
+ @field_remappings = {}
155
+ end
73
156
  end
74
157
  # Total before any discounts or taxes are applied.
75
158
  attr_reader :amount_subtotal
@@ -81,6 +164,14 @@ module Stripe
81
164
  attr_reader :interval_count
82
165
  # Attribute for field total_details
83
166
  attr_reader :total_details
167
+
168
+ def self.inner_class_types
169
+ @inner_class_types = { total_details: TotalDetails }
170
+ end
171
+
172
+ def self.field_remappings
173
+ @field_remappings = {}
174
+ end
84
175
  end
85
176
 
86
177
  class Upfront < Stripe::StripeObject
@@ -94,6 +185,14 @@ module Stripe
94
185
  #
95
186
  # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
96
187
  attr_reader :discount
188
+
189
+ def self.inner_class_types
190
+ @inner_class_types = {}
191
+ end
192
+
193
+ def self.field_remappings
194
+ @field_remappings = {}
195
+ end
97
196
  end
98
197
 
99
198
  class Tax < Stripe::StripeObject
@@ -107,11 +206,27 @@ module Stripe
107
206
  attr_reader :taxability_reason
108
207
  # The amount on which tax is calculated, in cents (or local equivalent).
109
208
  attr_reader :taxable_amount
209
+
210
+ def self.inner_class_types
211
+ @inner_class_types = {}
212
+ end
213
+
214
+ def self.field_remappings
215
+ @field_remappings = {}
216
+ end
110
217
  end
111
218
  # The aggregated discounts.
112
219
  attr_reader :discounts
113
220
  # The aggregated tax amounts by rate.
114
221
  attr_reader :taxes
222
+
223
+ def self.inner_class_types
224
+ @inner_class_types = { discounts: Discount, taxes: Tax }
225
+ end
226
+
227
+ def self.field_remappings
228
+ @field_remappings = {}
229
+ end
115
230
  end
116
231
  # This is the sum of all the discounts.
117
232
  attr_reader :amount_discount
@@ -121,6 +236,14 @@ module Stripe
121
236
  attr_reader :amount_tax
122
237
  # Attribute for field breakdown
123
238
  attr_reader :breakdown
239
+
240
+ def self.inner_class_types
241
+ @inner_class_types = { breakdown: Breakdown }
242
+ end
243
+
244
+ def self.field_remappings
245
+ @field_remappings = {}
246
+ end
124
247
  end
125
248
  # Total before any discounts or taxes are applied.
126
249
  attr_reader :amount_subtotal
@@ -130,11 +253,35 @@ module Stripe
130
253
  attr_reader :line_items
131
254
  # Attribute for field total_details
132
255
  attr_reader :total_details
256
+
257
+ def self.inner_class_types
258
+ @inner_class_types = { total_details: TotalDetails }
259
+ end
260
+
261
+ def self.field_remappings
262
+ @field_remappings = {}
263
+ end
133
264
  end
265
+ # Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation.
266
+ attr_reader :last_reestimation_details
134
267
  # The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices.
135
268
  attr_reader :recurring
269
+ # The time at which the quote's estimated schedules and upcoming invoices were generated.
270
+ attr_reader :updated_at
136
271
  # Attribute for field upfront
137
272
  attr_reader :upfront
273
+
274
+ def self.inner_class_types
275
+ @inner_class_types = {
276
+ last_reestimation_details: LastReestimationDetails,
277
+ recurring: Recurring,
278
+ upfront: Upfront,
279
+ }
280
+ end
281
+
282
+ def self.field_remappings
283
+ @field_remappings = {}
284
+ end
138
285
  end
139
286
 
140
287
  class FromQuote < Stripe::StripeObject
@@ -142,6 +289,14 @@ module Stripe
142
289
  attr_reader :is_revision
143
290
  # The quote that was cloned.
144
291
  attr_reader :quote
292
+
293
+ def self.inner_class_types
294
+ @inner_class_types = {}
295
+ end
296
+
297
+ def self.field_remappings
298
+ @field_remappings = {}
299
+ end
145
300
  end
146
301
 
147
302
  class InvoiceSettings < Stripe::StripeObject
@@ -150,11 +305,149 @@ module Stripe
150
305
  attr_reader :account
151
306
  # Type of the account referenced.
152
307
  attr_reader :type
308
+
309
+ def self.inner_class_types
310
+ @inner_class_types = {}
311
+ end
312
+
313
+ def self.field_remappings
314
+ @field_remappings = {}
315
+ end
153
316
  end
154
317
  # Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
155
318
  attr_reader :days_until_due
156
319
  # Attribute for field issuer
157
320
  attr_reader :issuer
321
+
322
+ def self.inner_class_types
323
+ @inner_class_types = { issuer: Issuer }
324
+ end
325
+
326
+ def self.field_remappings
327
+ @field_remappings = {}
328
+ end
329
+ end
330
+
331
+ class StatusDetails < Stripe::StripeObject
332
+ class Canceled < Stripe::StripeObject
333
+ # The reason this quote was marked as canceled.
334
+ attr_reader :reason
335
+ # Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch.
336
+ attr_reader :transitioned_at
337
+
338
+ def self.inner_class_types
339
+ @inner_class_types = {}
340
+ end
341
+
342
+ def self.field_remappings
343
+ @field_remappings = {}
344
+ end
345
+ end
346
+
347
+ class Stale < Stripe::StripeObject
348
+ class LastReason < Stripe::StripeObject
349
+ class LinesInvalid < Stripe::StripeObject
350
+ # The timestamp at which the lines were marked as invalid.
351
+ attr_reader :invalid_at
352
+ # The list of lines that became invalid at the given timestamp.
353
+ attr_reader :lines
354
+
355
+ def self.inner_class_types
356
+ @inner_class_types = {}
357
+ end
358
+
359
+ def self.field_remappings
360
+ @field_remappings = {}
361
+ end
362
+ end
363
+
364
+ class SubscriptionChanged < Stripe::StripeObject
365
+ # The subscription's state before the quote was marked as stale.
366
+ attr_reader :previous_subscription
367
+
368
+ def self.inner_class_types
369
+ @inner_class_types = {}
370
+ end
371
+
372
+ def self.field_remappings
373
+ @field_remappings = {}
374
+ end
375
+ end
376
+
377
+ class SubscriptionScheduleChanged < Stripe::StripeObject
378
+ # The subscription schedule's state before the quote was marked as stale.
379
+ attr_reader :previous_subscription_schedule
380
+
381
+ def self.inner_class_types
382
+ @inner_class_types = {}
383
+ end
384
+
385
+ def self.field_remappings
386
+ @field_remappings = {}
387
+ end
388
+ end
389
+ # The ID of the line that is invalid if the stale reason type is `line_invalid`.
390
+ attr_reader :line_invalid
391
+ # The IDs of the lines that are invalid if the stale reason type is `lines_invalid`.
392
+ attr_reader :lines_invalid
393
+ # The user supplied mark stale reason.
394
+ attr_reader :marked_stale
395
+ # The ID of the subscription that was canceled.
396
+ attr_reader :subscription_canceled
397
+ # Attribute for field subscription_changed
398
+ attr_reader :subscription_changed
399
+ # The ID of the subscription that was expired.
400
+ attr_reader :subscription_expired
401
+ # The ID of the subscription schedule that was canceled.
402
+ attr_reader :subscription_schedule_canceled
403
+ # Attribute for field subscription_schedule_changed
404
+ attr_reader :subscription_schedule_changed
405
+ # The ID of the subscription schedule that was released.
406
+ attr_reader :subscription_schedule_released
407
+ # The reason the quote was marked as stale.
408
+ attr_reader :type
409
+
410
+ def self.inner_class_types
411
+ @inner_class_types = {
412
+ lines_invalid: LinesInvalid,
413
+ subscription_changed: SubscriptionChanged,
414
+ subscription_schedule_changed: SubscriptionScheduleChanged,
415
+ }
416
+ end
417
+
418
+ def self.field_remappings
419
+ @field_remappings = {}
420
+ end
421
+ end
422
+ # Time at which the quote expires. Measured in seconds since the Unix epoch.
423
+ attr_reader :expires_at
424
+ # The most recent reason this quote was marked as stale.
425
+ attr_reader :last_reason
426
+ # Time at which the stale reason was updated. Measured in seconds since the Unix epoch.
427
+ attr_reader :last_updated_at
428
+ # Time at which the quote was marked as stale. Measured in seconds since the Unix epoch.
429
+ attr_reader :transitioned_at
430
+
431
+ def self.inner_class_types
432
+ @inner_class_types = { last_reason: LastReason }
433
+ end
434
+
435
+ def self.field_remappings
436
+ @field_remappings = {}
437
+ end
438
+ end
439
+ # Attribute for field canceled
440
+ attr_reader :canceled
441
+ # Attribute for field stale
442
+ attr_reader :stale
443
+
444
+ def self.inner_class_types
445
+ @inner_class_types = { canceled: Canceled, stale: Stale }
446
+ end
447
+
448
+ def self.field_remappings
449
+ @field_remappings = {}
450
+ end
158
451
  end
159
452
 
160
453
  class StatusTransitions < Stripe::StripeObject
@@ -164,23 +457,336 @@ module Stripe
164
457
  attr_reader :canceled_at
165
458
  # The time that the quote was finalized. Measured in seconds since Unix epoch.
166
459
  attr_reader :finalized_at
460
+
461
+ def self.inner_class_types
462
+ @inner_class_types = {}
463
+ end
464
+
465
+ def self.field_remappings
466
+ @field_remappings = {}
467
+ end
167
468
  end
168
469
 
169
470
  class SubscriptionData < Stripe::StripeObject
471
+ class BillOnAcceptance < Stripe::StripeObject
472
+ class BillFrom < Stripe::StripeObject
473
+ class LineStartsAt < Stripe::StripeObject
474
+ # Unique identifier for the object.
475
+ attr_reader :id
476
+
477
+ def self.inner_class_types
478
+ @inner_class_types = {}
479
+ end
480
+
481
+ def self.field_remappings
482
+ @field_remappings = {}
483
+ end
484
+ end
485
+ # The materialized time.
486
+ attr_reader :computed
487
+ # The timestamp the given line starts at.
488
+ attr_reader :line_starts_at
489
+ # A precise Unix timestamp.
490
+ attr_reader :timestamp
491
+ # The type of method to specify the `bill_from` time.
492
+ attr_reader :type
493
+
494
+ def self.inner_class_types
495
+ @inner_class_types = { line_starts_at: LineStartsAt }
496
+ end
497
+
498
+ def self.field_remappings
499
+ @field_remappings = {}
500
+ end
501
+ end
502
+
503
+ class BillUntil < Stripe::StripeObject
504
+ class Duration < Stripe::StripeObject
505
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
506
+ attr_reader :interval
507
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
508
+ attr_reader :interval_count
509
+
510
+ def self.inner_class_types
511
+ @inner_class_types = {}
512
+ end
513
+
514
+ def self.field_remappings
515
+ @field_remappings = {}
516
+ end
517
+ end
518
+
519
+ class LineEndsAt < Stripe::StripeObject
520
+ # Unique identifier for the object.
521
+ attr_reader :id
522
+
523
+ def self.inner_class_types
524
+ @inner_class_types = {}
525
+ end
526
+
527
+ def self.field_remappings
528
+ @field_remappings = {}
529
+ end
530
+ end
531
+ # The materialized time.
532
+ attr_reader :computed
533
+ # Time span for the quote line starting from the `starts_at` date.
534
+ attr_reader :duration
535
+ # The timestamp the given line ends at.
536
+ attr_reader :line_ends_at
537
+ # A precise Unix timestamp.
538
+ attr_reader :timestamp
539
+ # The type of method to specify the `bill_until` time.
540
+ attr_reader :type
541
+
542
+ def self.inner_class_types
543
+ @inner_class_types = { duration: Duration, line_ends_at: LineEndsAt }
544
+ end
545
+
546
+ def self.field_remappings
547
+ @field_remappings = {}
548
+ end
549
+ end
550
+ # The start of the period to bill from when the Quote is accepted.
551
+ attr_reader :bill_from
552
+ # The end of the period to bill until when the Quote is accepted.
553
+ attr_reader :bill_until
554
+
555
+ def self.inner_class_types
556
+ @inner_class_types = { bill_from: BillFrom, bill_until: BillUntil }
557
+ end
558
+
559
+ def self.field_remappings
560
+ @field_remappings = {}
561
+ end
562
+ end
563
+
170
564
  class BillingMode < Stripe::StripeObject
171
565
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
172
566
  attr_reader :type
567
+
568
+ def self.inner_class_types
569
+ @inner_class_types = {}
570
+ end
571
+
572
+ def self.field_remappings
573
+ @field_remappings = {}
574
+ end
575
+ end
576
+
577
+ class Prebilling < Stripe::StripeObject
578
+ # Attribute for field iterations
579
+ attr_reader :iterations
580
+
581
+ def self.inner_class_types
582
+ @inner_class_types = {}
583
+ end
584
+
585
+ def self.field_remappings
586
+ @field_remappings = {}
587
+ end
173
588
  end
589
+ # Describes the period to bill for upon accepting the quote.
590
+ attr_reader :bill_on_acceptance
591
+ # 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.
592
+ attr_reader :billing_behavior
593
+ # Whether the subscription will always start a new billing period when the quote is accepted.
594
+ attr_reader :billing_cycle_anchor
174
595
  # The billing mode of the quote.
175
596
  attr_reader :billing_mode
176
597
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
177
598
  attr_reader :description
178
599
  # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch.
179
600
  attr_reader :effective_date
601
+ # Behavior of the subscription schedule and underlying subscription when it ends.
602
+ attr_reader :end_behavior
603
+ # The id of the subscription that will be updated when the quote is accepted.
604
+ attr_reader :from_subscription
180
605
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
181
606
  attr_reader :metadata
607
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
608
+ attr_reader :prebilling
609
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
610
+ attr_reader :proration_behavior
182
611
  # Integer representing the number of trial period days before the customer is charged for the first time.
183
612
  attr_reader :trial_period_days
613
+
614
+ def self.inner_class_types
615
+ @inner_class_types = {
616
+ bill_on_acceptance: BillOnAcceptance,
617
+ billing_mode: BillingMode,
618
+ prebilling: Prebilling,
619
+ }
620
+ end
621
+
622
+ def self.field_remappings
623
+ @field_remappings = {}
624
+ end
625
+ end
626
+
627
+ class SubscriptionDataOverride < Stripe::StripeObject
628
+ class AppliesTo < Stripe::StripeObject
629
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
630
+ attr_reader :new_reference
631
+ # The ID of the schedule the line applies to.
632
+ attr_reader :subscription_schedule
633
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
634
+ attr_reader :type
635
+
636
+ def self.inner_class_types
637
+ @inner_class_types = {}
638
+ end
639
+
640
+ def self.field_remappings
641
+ @field_remappings = {}
642
+ end
643
+ end
644
+
645
+ class BillOnAcceptance < Stripe::StripeObject
646
+ class BillFrom < Stripe::StripeObject
647
+ class LineStartsAt < Stripe::StripeObject
648
+ # Unique identifier for the object.
649
+ attr_reader :id
650
+
651
+ def self.inner_class_types
652
+ @inner_class_types = {}
653
+ end
654
+
655
+ def self.field_remappings
656
+ @field_remappings = {}
657
+ end
658
+ end
659
+ # The materialized time.
660
+ attr_reader :computed
661
+ # The timestamp the given line starts at.
662
+ attr_reader :line_starts_at
663
+ # A precise Unix timestamp.
664
+ attr_reader :timestamp
665
+ # The type of method to specify the `bill_from` time.
666
+ attr_reader :type
667
+
668
+ def self.inner_class_types
669
+ @inner_class_types = { line_starts_at: LineStartsAt }
670
+ end
671
+
672
+ def self.field_remappings
673
+ @field_remappings = {}
674
+ end
675
+ end
676
+
677
+ class BillUntil < Stripe::StripeObject
678
+ class Duration < Stripe::StripeObject
679
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
680
+ attr_reader :interval
681
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
682
+ attr_reader :interval_count
683
+
684
+ def self.inner_class_types
685
+ @inner_class_types = {}
686
+ end
687
+
688
+ def self.field_remappings
689
+ @field_remappings = {}
690
+ end
691
+ end
692
+
693
+ class LineEndsAt < Stripe::StripeObject
694
+ # Unique identifier for the object.
695
+ attr_reader :id
696
+
697
+ def self.inner_class_types
698
+ @inner_class_types = {}
699
+ end
700
+
701
+ def self.field_remappings
702
+ @field_remappings = {}
703
+ end
704
+ end
705
+ # The materialized time.
706
+ attr_reader :computed
707
+ # Time span for the quote line starting from the `starts_at` date.
708
+ attr_reader :duration
709
+ # The timestamp the given line ends at.
710
+ attr_reader :line_ends_at
711
+ # A precise Unix timestamp.
712
+ attr_reader :timestamp
713
+ # The type of method to specify the `bill_until` time.
714
+ attr_reader :type
715
+
716
+ def self.inner_class_types
717
+ @inner_class_types = { duration: Duration, line_ends_at: LineEndsAt }
718
+ end
719
+
720
+ def self.field_remappings
721
+ @field_remappings = {}
722
+ end
723
+ end
724
+ # The start of the period to bill from when the Quote is accepted.
725
+ attr_reader :bill_from
726
+ # The end of the period to bill until when the Quote is accepted.
727
+ attr_reader :bill_until
728
+
729
+ def self.inner_class_types
730
+ @inner_class_types = { bill_from: BillFrom, bill_until: BillUntil }
731
+ end
732
+
733
+ def self.field_remappings
734
+ @field_remappings = {}
735
+ end
736
+ end
737
+ # Attribute for field applies_to
738
+ attr_reader :applies_to
739
+ # Describes the period to bill for upon accepting the quote.
740
+ attr_reader :bill_on_acceptance
741
+ # 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.
742
+ attr_reader :billing_behavior
743
+ # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
744
+ attr_reader :customer
745
+ # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
746
+ attr_reader :description
747
+ # Behavior of the subscription schedule and underlying subscription when it ends.
748
+ attr_reader :end_behavior
749
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted.
750
+ attr_reader :proration_behavior
751
+
752
+ def self.inner_class_types
753
+ @inner_class_types = { applies_to: AppliesTo, bill_on_acceptance: BillOnAcceptance }
754
+ end
755
+
756
+ def self.field_remappings
757
+ @field_remappings = {}
758
+ end
759
+ end
760
+
761
+ class SubscriptionSchedule < Stripe::StripeObject
762
+ class AppliesTo < Stripe::StripeObject
763
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
764
+ attr_reader :new_reference
765
+ # The ID of the schedule the line applies to.
766
+ attr_reader :subscription_schedule
767
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
768
+ attr_reader :type
769
+
770
+ def self.inner_class_types
771
+ @inner_class_types = {}
772
+ end
773
+
774
+ def self.field_remappings
775
+ @field_remappings = {}
776
+ end
777
+ end
778
+ # Attribute for field applies_to
779
+ attr_reader :applies_to
780
+ # The subscription schedule that was created or updated from this quote.
781
+ attr_reader :subscription_schedule
782
+
783
+ def self.inner_class_types
784
+ @inner_class_types = { applies_to: AppliesTo }
785
+ end
786
+
787
+ def self.field_remappings
788
+ @field_remappings = {}
789
+ end
184
790
  end
185
791
 
186
792
  class TotalDetails < Stripe::StripeObject
@@ -193,6 +799,14 @@ module Stripe
193
799
  #
194
800
  # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
195
801
  attr_reader :discount
802
+
803
+ def self.inner_class_types
804
+ @inner_class_types = {}
805
+ end
806
+
807
+ def self.field_remappings
808
+ @field_remappings = {}
809
+ end
196
810
  end
197
811
 
198
812
  class Tax < Stripe::StripeObject
@@ -206,11 +820,27 @@ module Stripe
206
820
  attr_reader :taxability_reason
207
821
  # The amount on which tax is calculated, in cents (or local equivalent).
208
822
  attr_reader :taxable_amount
823
+
824
+ def self.inner_class_types
825
+ @inner_class_types = {}
826
+ end
827
+
828
+ def self.field_remappings
829
+ @field_remappings = {}
830
+ end
209
831
  end
210
832
  # The aggregated discounts.
211
833
  attr_reader :discounts
212
834
  # The aggregated tax amounts by rate.
213
835
  attr_reader :taxes
836
+
837
+ def self.inner_class_types
838
+ @inner_class_types = { discounts: Discount, taxes: Tax }
839
+ end
840
+
841
+ def self.field_remappings
842
+ @field_remappings = {}
843
+ end
214
844
  end
215
845
  # This is the sum of all the discounts.
216
846
  attr_reader :amount_discount
@@ -220,6 +850,14 @@ module Stripe
220
850
  attr_reader :amount_tax
221
851
  # Attribute for field breakdown
222
852
  attr_reader :breakdown
853
+
854
+ def self.inner_class_types
855
+ @inner_class_types = { breakdown: Breakdown }
856
+ end
857
+
858
+ def self.field_remappings
859
+ @field_remappings = {}
860
+ end
223
861
  end
224
862
 
225
863
  class TransferData < Stripe::StripeObject
@@ -229,15 +867,27 @@ module Stripe
229
867
  attr_reader :amount_percent
230
868
  # The account where funds from the payment will be transferred to upon payment success.
231
869
  attr_reader :destination
870
+
871
+ def self.inner_class_types
872
+ @inner_class_types = {}
873
+ end
874
+
875
+ def self.field_remappings
876
+ @field_remappings = {}
877
+ end
232
878
  end
233
879
 
234
880
  class ListParams < Stripe::RequestParams
235
881
  # The ID of the customer whose quotes will be retrieved.
236
882
  attr_accessor :customer
883
+ # The ID of the account whose quotes will be retrieved.
884
+ attr_accessor :customer_account
237
885
  # 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.
238
886
  attr_accessor :ending_before
239
887
  # Specifies which fields in the response should be expanded.
240
888
  attr_accessor :expand
889
+ # The subscription which the quote updates.
890
+ attr_accessor :from_subscription
241
891
  # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
242
892
  attr_accessor :limit
243
893
  # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
@@ -249,16 +899,20 @@ module Stripe
249
899
 
250
900
  def initialize(
251
901
  customer: nil,
902
+ customer_account: nil,
252
903
  ending_before: nil,
253
904
  expand: nil,
905
+ from_subscription: nil,
254
906
  limit: nil,
255
907
  starting_after: nil,
256
908
  status: nil,
257
909
  test_clock: nil
258
910
  )
259
911
  @customer = customer
912
+ @customer_account = customer_account
260
913
  @ending_before = ending_before
261
914
  @expand = expand
915
+ @from_subscription = from_subscription
262
916
  @limit = limit
263
917
  @starting_after = starting_after
264
918
  @status = status
@@ -291,16 +945,44 @@ module Stripe
291
945
  end
292
946
 
293
947
  class Discount < Stripe::RequestParams
948
+ class DiscountEnd < Stripe::RequestParams
949
+ class Duration < Stripe::RequestParams
950
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
951
+ attr_accessor :interval
952
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
953
+ attr_accessor :interval_count
954
+
955
+ def initialize(interval: nil, interval_count: nil)
956
+ @interval = interval
957
+ @interval_count = interval_count
958
+ end
959
+ end
960
+ # Time span for the redeemed discount.
961
+ attr_accessor :duration
962
+ # A precise Unix timestamp for the discount to end. Must be in the future.
963
+ attr_accessor :timestamp
964
+ # The type of calculation made to determine when the discount ends.
965
+ attr_accessor :type
966
+
967
+ def initialize(duration: nil, timestamp: nil, type: nil)
968
+ @duration = duration
969
+ @timestamp = timestamp
970
+ @type = type
971
+ end
972
+ end
294
973
  # ID of the coupon to create a new discount for.
295
974
  attr_accessor :coupon
296
975
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
297
976
  attr_accessor :discount
977
+ # Details to determine how long the discount should be applied for.
978
+ attr_accessor :discount_end
298
979
  # ID of the promotion code to create a new discount for.
299
980
  attr_accessor :promotion_code
300
981
 
301
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
982
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
302
983
  @coupon = coupon
303
984
  @discount = discount
985
+ @discount_end = discount_end
304
986
  @promotion_code = promotion_code
305
987
  end
306
988
  end
@@ -340,18 +1022,522 @@ module Stripe
340
1022
  end
341
1023
  end
342
1024
 
1025
+ class Line < Stripe::RequestParams
1026
+ class Action < Stripe::RequestParams
1027
+ class AddDiscount < Stripe::RequestParams
1028
+ class DiscountEnd < Stripe::RequestParams
1029
+ # The type of calculation made to determine when the discount ends.
1030
+ attr_accessor :type
1031
+
1032
+ def initialize(type: nil)
1033
+ @type = type
1034
+ end
1035
+ end
1036
+ # The coupon code to redeem.
1037
+ attr_accessor :coupon
1038
+ # An ID of an existing discount for a coupon that was already redeemed.
1039
+ attr_accessor :discount
1040
+ # Details to determine how long the discount should be applied for.
1041
+ attr_accessor :discount_end
1042
+ # 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.
1043
+ attr_accessor :index
1044
+ # The promotion code to redeem.
1045
+ attr_accessor :promotion_code
1046
+
1047
+ def initialize(
1048
+ coupon: nil,
1049
+ discount: nil,
1050
+ discount_end: nil,
1051
+ index: nil,
1052
+ promotion_code: nil
1053
+ )
1054
+ @coupon = coupon
1055
+ @discount = discount
1056
+ @discount_end = discount_end
1057
+ @index = index
1058
+ @promotion_code = promotion_code
1059
+ end
1060
+ end
1061
+
1062
+ class AddItem < Stripe::RequestParams
1063
+ class Discount < Stripe::RequestParams
1064
+ class DiscountEnd < Stripe::RequestParams
1065
+ class Duration < Stripe::RequestParams
1066
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1067
+ attr_accessor :interval
1068
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1069
+ attr_accessor :interval_count
1070
+
1071
+ def initialize(interval: nil, interval_count: nil)
1072
+ @interval = interval
1073
+ @interval_count = interval_count
1074
+ end
1075
+ end
1076
+ # Time span for the redeemed discount.
1077
+ attr_accessor :duration
1078
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1079
+ attr_accessor :timestamp
1080
+ # The type of calculation made to determine when the discount ends.
1081
+ attr_accessor :type
1082
+
1083
+ def initialize(duration: nil, timestamp: nil, type: nil)
1084
+ @duration = duration
1085
+ @timestamp = timestamp
1086
+ @type = type
1087
+ end
1088
+ end
1089
+ # ID of the coupon to create a new discount for.
1090
+ attr_accessor :coupon
1091
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1092
+ attr_accessor :discount
1093
+ # Details to determine how long the discount should be applied for.
1094
+ attr_accessor :discount_end
1095
+ # ID of the promotion code to create a new discount for.
1096
+ attr_accessor :promotion_code
1097
+
1098
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1099
+ @coupon = coupon
1100
+ @discount = discount
1101
+ @discount_end = discount_end
1102
+ @promotion_code = promotion_code
1103
+ end
1104
+ end
1105
+
1106
+ class Trial < Stripe::RequestParams
1107
+ # 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.
1108
+ attr_accessor :converts_to
1109
+ # Determines the type of trial for this item.
1110
+ attr_accessor :type
1111
+
1112
+ def initialize(converts_to: nil, type: nil)
1113
+ @converts_to = converts_to
1114
+ @type = type
1115
+ end
1116
+ end
1117
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1118
+ attr_accessor :discounts
1119
+ # 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`.
1120
+ attr_accessor :metadata
1121
+ # The ID of the price object.
1122
+ attr_accessor :price
1123
+ # Quantity for this item.
1124
+ attr_accessor :quantity
1125
+ # 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`.
1126
+ attr_accessor :tax_rates
1127
+ # Options that configure the trial on the subscription item.
1128
+ attr_accessor :trial
1129
+
1130
+ def initialize(
1131
+ discounts: nil,
1132
+ metadata: nil,
1133
+ price: nil,
1134
+ quantity: nil,
1135
+ tax_rates: nil,
1136
+ trial: nil
1137
+ )
1138
+ @discounts = discounts
1139
+ @metadata = metadata
1140
+ @price = price
1141
+ @quantity = quantity
1142
+ @tax_rates = tax_rates
1143
+ @trial = trial
1144
+ end
1145
+ end
1146
+
1147
+ class RemoveDiscount < Stripe::RequestParams
1148
+ # The coupon code to remove from the `discounts` array.
1149
+ attr_accessor :coupon
1150
+ # The ID of a discount to remove from the `discounts` array.
1151
+ attr_accessor :discount
1152
+ # The ID of a promotion code to remove from the `discounts` array.
1153
+ attr_accessor :promotion_code
1154
+
1155
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1156
+ @coupon = coupon
1157
+ @discount = discount
1158
+ @promotion_code = promotion_code
1159
+ end
1160
+ end
1161
+
1162
+ class RemoveItem < Stripe::RequestParams
1163
+ # ID of a price to remove.
1164
+ attr_accessor :price
1165
+
1166
+ def initialize(price: nil)
1167
+ @price = price
1168
+ end
1169
+ end
1170
+
1171
+ class SetDiscount < Stripe::RequestParams
1172
+ # The coupon code to replace the `discounts` array with.
1173
+ attr_accessor :coupon
1174
+ # An ID of an existing discount to replace the `discounts` array with.
1175
+ attr_accessor :discount
1176
+ # An ID of an existing promotion code to replace the `discounts` array with.
1177
+ attr_accessor :promotion_code
1178
+
1179
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1180
+ @coupon = coupon
1181
+ @discount = discount
1182
+ @promotion_code = promotion_code
1183
+ end
1184
+ end
1185
+
1186
+ class SetItem < Stripe::RequestParams
1187
+ class Discount < Stripe::RequestParams
1188
+ class DiscountEnd < Stripe::RequestParams
1189
+ class Duration < Stripe::RequestParams
1190
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1191
+ attr_accessor :interval
1192
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1193
+ attr_accessor :interval_count
1194
+
1195
+ def initialize(interval: nil, interval_count: nil)
1196
+ @interval = interval
1197
+ @interval_count = interval_count
1198
+ end
1199
+ end
1200
+ # Time span for the redeemed discount.
1201
+ attr_accessor :duration
1202
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1203
+ attr_accessor :timestamp
1204
+ # The type of calculation made to determine when the discount ends.
1205
+ attr_accessor :type
1206
+
1207
+ def initialize(duration: nil, timestamp: nil, type: nil)
1208
+ @duration = duration
1209
+ @timestamp = timestamp
1210
+ @type = type
1211
+ end
1212
+ end
1213
+ # ID of the coupon to create a new discount for.
1214
+ attr_accessor :coupon
1215
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1216
+ attr_accessor :discount
1217
+ # Details to determine how long the discount should be applied for.
1218
+ attr_accessor :discount_end
1219
+ # ID of the promotion code to create a new discount for.
1220
+ attr_accessor :promotion_code
1221
+
1222
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1223
+ @coupon = coupon
1224
+ @discount = discount
1225
+ @discount_end = discount_end
1226
+ @promotion_code = promotion_code
1227
+ end
1228
+ end
1229
+
1230
+ class Trial < Stripe::RequestParams
1231
+ # 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.
1232
+ attr_accessor :converts_to
1233
+ # Determines the type of trial for this item.
1234
+ attr_accessor :type
1235
+
1236
+ def initialize(converts_to: nil, type: nil)
1237
+ @converts_to = converts_to
1238
+ @type = type
1239
+ end
1240
+ end
1241
+ # 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`.
1242
+ attr_accessor :discounts
1243
+ # 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`.
1244
+ attr_accessor :metadata
1245
+ # The ID of the price object.
1246
+ attr_accessor :price
1247
+ # 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`.
1248
+ attr_accessor :quantity
1249
+ # 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`.
1250
+ attr_accessor :tax_rates
1251
+ # 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`.
1252
+ attr_accessor :trial
1253
+
1254
+ def initialize(
1255
+ discounts: nil,
1256
+ metadata: nil,
1257
+ price: nil,
1258
+ quantity: nil,
1259
+ tax_rates: nil,
1260
+ trial: nil
1261
+ )
1262
+ @discounts = discounts
1263
+ @metadata = metadata
1264
+ @price = price
1265
+ @quantity = quantity
1266
+ @tax_rates = tax_rates
1267
+ @trial = trial
1268
+ end
1269
+ end
1270
+ # Details for the `add_discount` type.
1271
+ attr_accessor :add_discount
1272
+ # Details for the `add_item` type.
1273
+ attr_accessor :add_item
1274
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
1275
+ attr_accessor :add_metadata
1276
+ # Details for the `remove_discount` type.
1277
+ attr_accessor :remove_discount
1278
+ # Details for the `remove_item` type.
1279
+ attr_accessor :remove_item
1280
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
1281
+ attr_accessor :remove_metadata
1282
+ # Details for the `set_discounts` type.
1283
+ attr_accessor :set_discounts
1284
+ # Details for the `set_items` type.
1285
+ attr_accessor :set_items
1286
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
1287
+ attr_accessor :set_metadata
1288
+ # The type of action the quote line performs.
1289
+ attr_accessor :type
1290
+
1291
+ def initialize(
1292
+ add_discount: nil,
1293
+ add_item: nil,
1294
+ add_metadata: nil,
1295
+ remove_discount: nil,
1296
+ remove_item: nil,
1297
+ remove_metadata: nil,
1298
+ set_discounts: nil,
1299
+ set_items: nil,
1300
+ set_metadata: nil,
1301
+ type: nil
1302
+ )
1303
+ @add_discount = add_discount
1304
+ @add_item = add_item
1305
+ @add_metadata = add_metadata
1306
+ @remove_discount = remove_discount
1307
+ @remove_item = remove_item
1308
+ @remove_metadata = remove_metadata
1309
+ @set_discounts = set_discounts
1310
+ @set_items = set_items
1311
+ @set_metadata = set_metadata
1312
+ @type = type
1313
+ end
1314
+ end
1315
+
1316
+ class AppliesTo < Stripe::RequestParams
1317
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1318
+ attr_accessor :new_reference
1319
+ # The ID of the schedule the line applies to.
1320
+ attr_accessor :subscription_schedule
1321
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1322
+ attr_accessor :type
1323
+
1324
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1325
+ @new_reference = new_reference
1326
+ @subscription_schedule = subscription_schedule
1327
+ @type = type
1328
+ end
1329
+ end
1330
+
1331
+ class CancelSubscriptionSchedule < Stripe::RequestParams
1332
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
1333
+ attr_accessor :cancel_at
1334
+ # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
1335
+ attr_accessor :invoice_now
1336
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
1337
+ attr_accessor :prorate
1338
+
1339
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
1340
+ @cancel_at = cancel_at
1341
+ @invoice_now = invoice_now
1342
+ @prorate = prorate
1343
+ end
1344
+ end
1345
+
1346
+ class EndsAt < Stripe::RequestParams
1347
+ class DiscountEnd < Stripe::RequestParams
1348
+ # The ID of a specific discount.
1349
+ attr_accessor :discount
1350
+
1351
+ def initialize(discount: nil)
1352
+ @discount = discount
1353
+ end
1354
+ end
1355
+
1356
+ class Duration < Stripe::RequestParams
1357
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1358
+ attr_accessor :interval
1359
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1360
+ attr_accessor :interval_count
1361
+
1362
+ def initialize(interval: nil, interval_count: nil)
1363
+ @interval = interval
1364
+ @interval_count = interval_count
1365
+ end
1366
+ end
1367
+ # Use the `end` time of a given discount.
1368
+ attr_accessor :discount_end
1369
+ # Time span for the quote line starting from the `starts_at` date.
1370
+ attr_accessor :duration
1371
+ # A precise Unix timestamp.
1372
+ attr_accessor :timestamp
1373
+ # Select a way to pass in `ends_at`.
1374
+ attr_accessor :type
1375
+
1376
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1377
+ @discount_end = discount_end
1378
+ @duration = duration
1379
+ @timestamp = timestamp
1380
+ @type = type
1381
+ end
1382
+ end
1383
+
1384
+ class SetPauseCollection < Stripe::RequestParams
1385
+ class Set < Stripe::RequestParams
1386
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1387
+ attr_accessor :behavior
1388
+
1389
+ def initialize(behavior: nil)
1390
+ @behavior = behavior
1391
+ end
1392
+ end
1393
+ # Details of the pause_collection behavior to apply to the amendment.
1394
+ attr_accessor :set
1395
+ # Determines the type of the pause_collection amendment.
1396
+ attr_accessor :type
1397
+
1398
+ def initialize(set: nil, type: nil)
1399
+ @set = set
1400
+ @type = type
1401
+ end
1402
+ end
1403
+
1404
+ class StartsAt < Stripe::RequestParams
1405
+ class DiscountEnd < Stripe::RequestParams
1406
+ # The ID of a specific discount.
1407
+ attr_accessor :discount
1408
+
1409
+ def initialize(discount: nil)
1410
+ @discount = discount
1411
+ end
1412
+ end
1413
+
1414
+ class LineEndsAt < Stripe::RequestParams
1415
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1416
+ attr_accessor :index
1417
+
1418
+ def initialize(index: nil)
1419
+ @index = index
1420
+ end
1421
+ end
1422
+ # Use the `end` time of a given discount.
1423
+ attr_accessor :discount_end
1424
+ # The timestamp the given line ends at.
1425
+ attr_accessor :line_ends_at
1426
+ # A precise Unix timestamp.
1427
+ attr_accessor :timestamp
1428
+ # Select a way to pass in `starts_at`.
1429
+ attr_accessor :type
1430
+
1431
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
1432
+ @discount_end = discount_end
1433
+ @line_ends_at = line_ends_at
1434
+ @timestamp = timestamp
1435
+ @type = type
1436
+ end
1437
+ end
1438
+
1439
+ class TrialSettings < Stripe::RequestParams
1440
+ class EndBehavior < Stripe::RequestParams
1441
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1442
+ attr_accessor :prorate_up_front
1443
+
1444
+ def initialize(prorate_up_front: nil)
1445
+ @prorate_up_front = prorate_up_front
1446
+ end
1447
+ end
1448
+ # Defines how the subscription should behave when a trial ends.
1449
+ attr_accessor :end_behavior
1450
+
1451
+ def initialize(end_behavior: nil)
1452
+ @end_behavior = end_behavior
1453
+ end
1454
+ end
1455
+ # An array of operations the quote line performs.
1456
+ attr_accessor :actions
1457
+ # Details to identify the subscription schedule the quote line applies to.
1458
+ attr_accessor :applies_to
1459
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
1460
+ attr_accessor :billing_cycle_anchor
1461
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
1462
+ attr_accessor :cancel_subscription_schedule
1463
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
1464
+ attr_accessor :ends_at
1465
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
1466
+ attr_accessor :proration_behavior
1467
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1468
+ attr_accessor :set_pause_collection
1469
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
1470
+ attr_accessor :set_schedule_end
1471
+ # Details to identify the earliest timestamp where the proposed change should take effect.
1472
+ attr_accessor :starts_at
1473
+ # Settings related to subscription trials.
1474
+ attr_accessor :trial_settings
1475
+
1476
+ def initialize(
1477
+ actions: nil,
1478
+ applies_to: nil,
1479
+ billing_cycle_anchor: nil,
1480
+ cancel_subscription_schedule: nil,
1481
+ ends_at: nil,
1482
+ proration_behavior: nil,
1483
+ set_pause_collection: nil,
1484
+ set_schedule_end: nil,
1485
+ starts_at: nil,
1486
+ trial_settings: nil
1487
+ )
1488
+ @actions = actions
1489
+ @applies_to = applies_to
1490
+ @billing_cycle_anchor = billing_cycle_anchor
1491
+ @cancel_subscription_schedule = cancel_subscription_schedule
1492
+ @ends_at = ends_at
1493
+ @proration_behavior = proration_behavior
1494
+ @set_pause_collection = set_pause_collection
1495
+ @set_schedule_end = set_schedule_end
1496
+ @starts_at = starts_at
1497
+ @trial_settings = trial_settings
1498
+ end
1499
+ end
1500
+
343
1501
  class LineItem < Stripe::RequestParams
344
1502
  class Discount < Stripe::RequestParams
1503
+ class DiscountEnd < Stripe::RequestParams
1504
+ class Duration < Stripe::RequestParams
1505
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1506
+ attr_accessor :interval
1507
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1508
+ attr_accessor :interval_count
1509
+
1510
+ def initialize(interval: nil, interval_count: nil)
1511
+ @interval = interval
1512
+ @interval_count = interval_count
1513
+ end
1514
+ end
1515
+ # Time span for the redeemed discount.
1516
+ attr_accessor :duration
1517
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1518
+ attr_accessor :timestamp
1519
+ # The type of calculation made to determine when the discount ends.
1520
+ attr_accessor :type
1521
+
1522
+ def initialize(duration: nil, timestamp: nil, type: nil)
1523
+ @duration = duration
1524
+ @timestamp = timestamp
1525
+ @type = type
1526
+ end
1527
+ end
345
1528
  # ID of the coupon to create a new discount for.
346
1529
  attr_accessor :coupon
347
1530
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
348
1531
  attr_accessor :discount
1532
+ # Details to determine how long the discount should be applied for.
1533
+ attr_accessor :discount_end
349
1534
  # ID of the promotion code to create a new discount for.
350
1535
  attr_accessor :promotion_code
351
1536
 
352
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1537
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
353
1538
  @coupon = coupon
354
1539
  @discount = discount
1540
+ @discount_end = discount_end
355
1541
  @promotion_code = promotion_code
356
1542
  end
357
1543
  end
@@ -418,6 +1604,84 @@ module Stripe
418
1604
  end
419
1605
 
420
1606
  class SubscriptionData < Stripe::RequestParams
1607
+ class BillOnAcceptance < Stripe::RequestParams
1608
+ class BillFrom < Stripe::RequestParams
1609
+ class LineStartsAt < Stripe::RequestParams
1610
+ # The ID of a quote line.
1611
+ attr_accessor :id
1612
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1613
+ attr_accessor :index
1614
+
1615
+ def initialize(id: nil, index: nil)
1616
+ @id = id
1617
+ @index = index
1618
+ end
1619
+ end
1620
+ # Details of a Quote line to start the bill period from.
1621
+ attr_accessor :line_starts_at
1622
+ # A precise Unix timestamp.
1623
+ attr_accessor :timestamp
1624
+ # The type of method to specify the `bill_from` time.
1625
+ attr_accessor :type
1626
+
1627
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
1628
+ @line_starts_at = line_starts_at
1629
+ @timestamp = timestamp
1630
+ @type = type
1631
+ end
1632
+ end
1633
+
1634
+ class BillUntil < Stripe::RequestParams
1635
+ class Duration < Stripe::RequestParams
1636
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1637
+ attr_accessor :interval
1638
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1639
+ attr_accessor :interval_count
1640
+
1641
+ def initialize(interval: nil, interval_count: nil)
1642
+ @interval = interval
1643
+ @interval_count = interval_count
1644
+ end
1645
+ end
1646
+
1647
+ class LineEndsAt < Stripe::RequestParams
1648
+ # The ID of a quote line.
1649
+ attr_accessor :id
1650
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1651
+ attr_accessor :index
1652
+
1653
+ def initialize(id: nil, index: nil)
1654
+ @id = id
1655
+ @index = index
1656
+ end
1657
+ end
1658
+ # Details of the duration over which to bill.
1659
+ attr_accessor :duration
1660
+ # Details of a Quote line item from which to bill until.
1661
+ attr_accessor :line_ends_at
1662
+ # A precise Unix timestamp.
1663
+ attr_accessor :timestamp
1664
+ # The type of method to specify the `bill_until` time.
1665
+ attr_accessor :type
1666
+
1667
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
1668
+ @duration = duration
1669
+ @line_ends_at = line_ends_at
1670
+ @timestamp = timestamp
1671
+ @type = type
1672
+ end
1673
+ end
1674
+ # The start of the period to bill from when the Quote is accepted.
1675
+ attr_accessor :bill_from
1676
+ # The end of the period to bill until when the Quote is accepted.
1677
+ attr_accessor :bill_until
1678
+
1679
+ def initialize(bill_from: nil, bill_until: nil)
1680
+ @bill_from = bill_from
1681
+ @bill_until = bill_until
1682
+ end
1683
+ end
1684
+
421
1685
  class BillingMode < Stripe::RequestParams
422
1686
  # Controls the calculation and orchestration of prorations and invoices for subscriptions.
423
1687
  attr_accessor :type
@@ -426,32 +1690,208 @@ module Stripe
426
1690
  @type = type
427
1691
  end
428
1692
  end
1693
+
1694
+ class Prebilling < Stripe::RequestParams
1695
+ # This is used to determine the number of billing cycles to prebill.
1696
+ attr_accessor :iterations
1697
+
1698
+ def initialize(iterations: nil)
1699
+ @iterations = iterations
1700
+ end
1701
+ end
1702
+ # Describes the period to bill for upon accepting the quote.
1703
+ attr_accessor :bill_on_acceptance
1704
+ # 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.
1705
+ attr_accessor :billing_behavior
1706
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
1707
+ attr_accessor :billing_cycle_anchor
429
1708
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
430
1709
  attr_accessor :billing_mode
431
1710
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
432
1711
  attr_accessor :description
433
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
1712
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
434
1713
  attr_accessor :effective_date
1714
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1715
+ attr_accessor :end_behavior
1716
+ # The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
1717
+ attr_accessor :from_subscription
435
1718
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
436
1719
  attr_accessor :metadata
1720
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
1721
+ attr_accessor :prebilling
1722
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1723
+ #
1724
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1725
+ #
1726
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1727
+ #
1728
+ # Prorations can be disabled by passing `none`.
1729
+ attr_accessor :proration_behavior
437
1730
  # Integer representing the number of trial period days before the customer is charged for the first time.
438
1731
  attr_accessor :trial_period_days
439
1732
 
440
1733
  def initialize(
1734
+ bill_on_acceptance: nil,
1735
+ billing_behavior: nil,
1736
+ billing_cycle_anchor: nil,
441
1737
  billing_mode: nil,
442
1738
  description: nil,
443
1739
  effective_date: nil,
1740
+ end_behavior: nil,
1741
+ from_subscription: nil,
444
1742
  metadata: nil,
1743
+ prebilling: nil,
1744
+ proration_behavior: nil,
445
1745
  trial_period_days: nil
446
1746
  )
1747
+ @bill_on_acceptance = bill_on_acceptance
1748
+ @billing_behavior = billing_behavior
1749
+ @billing_cycle_anchor = billing_cycle_anchor
447
1750
  @billing_mode = billing_mode
448
1751
  @description = description
449
1752
  @effective_date = effective_date
1753
+ @end_behavior = end_behavior
1754
+ @from_subscription = from_subscription
450
1755
  @metadata = metadata
1756
+ @prebilling = prebilling
1757
+ @proration_behavior = proration_behavior
451
1758
  @trial_period_days = trial_period_days
452
1759
  end
453
1760
  end
454
1761
 
1762
+ class SubscriptionDataOverride < Stripe::RequestParams
1763
+ class AppliesTo < Stripe::RequestParams
1764
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1765
+ attr_accessor :new_reference
1766
+ # The ID of the schedule the line applies to.
1767
+ attr_accessor :subscription_schedule
1768
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1769
+ attr_accessor :type
1770
+
1771
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1772
+ @new_reference = new_reference
1773
+ @subscription_schedule = subscription_schedule
1774
+ @type = type
1775
+ end
1776
+ end
1777
+
1778
+ class BillOnAcceptance < Stripe::RequestParams
1779
+ class BillFrom < Stripe::RequestParams
1780
+ class LineStartsAt < Stripe::RequestParams
1781
+ # The ID of a quote line.
1782
+ attr_accessor :id
1783
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1784
+ attr_accessor :index
1785
+
1786
+ def initialize(id: nil, index: nil)
1787
+ @id = id
1788
+ @index = index
1789
+ end
1790
+ end
1791
+ # Details of a Quote line to start the bill period from.
1792
+ attr_accessor :line_starts_at
1793
+ # A precise Unix timestamp.
1794
+ attr_accessor :timestamp
1795
+ # The type of method to specify the `bill_from` time.
1796
+ attr_accessor :type
1797
+
1798
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
1799
+ @line_starts_at = line_starts_at
1800
+ @timestamp = timestamp
1801
+ @type = type
1802
+ end
1803
+ end
1804
+
1805
+ class BillUntil < Stripe::RequestParams
1806
+ class Duration < Stripe::RequestParams
1807
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1808
+ attr_accessor :interval
1809
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1810
+ attr_accessor :interval_count
1811
+
1812
+ def initialize(interval: nil, interval_count: nil)
1813
+ @interval = interval
1814
+ @interval_count = interval_count
1815
+ end
1816
+ end
1817
+
1818
+ class LineEndsAt < Stripe::RequestParams
1819
+ # The ID of a quote line.
1820
+ attr_accessor :id
1821
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1822
+ attr_accessor :index
1823
+
1824
+ def initialize(id: nil, index: nil)
1825
+ @id = id
1826
+ @index = index
1827
+ end
1828
+ end
1829
+ # Details of the duration over which to bill.
1830
+ attr_accessor :duration
1831
+ # Details of a Quote line item from which to bill until.
1832
+ attr_accessor :line_ends_at
1833
+ # A precise Unix timestamp.
1834
+ attr_accessor :timestamp
1835
+ # The type of method to specify the `bill_until` time.
1836
+ attr_accessor :type
1837
+
1838
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
1839
+ @duration = duration
1840
+ @line_ends_at = line_ends_at
1841
+ @timestamp = timestamp
1842
+ @type = type
1843
+ end
1844
+ end
1845
+ # The start of the period to bill from when the Quote is accepted.
1846
+ attr_accessor :bill_from
1847
+ # The end of the period to bill until when the Quote is accepted.
1848
+ attr_accessor :bill_until
1849
+
1850
+ def initialize(bill_from: nil, bill_until: nil)
1851
+ @bill_from = bill_from
1852
+ @bill_until = bill_until
1853
+ end
1854
+ end
1855
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
1856
+ attr_accessor :applies_to
1857
+ # Describes the period to bill for upon accepting the quote.
1858
+ attr_accessor :bill_on_acceptance
1859
+ # 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.
1860
+ attr_accessor :billing_behavior
1861
+ # The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
1862
+ attr_accessor :customer
1863
+ # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
1864
+ attr_accessor :description
1865
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1866
+ attr_accessor :end_behavior
1867
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1868
+ #
1869
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1870
+ #
1871
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1872
+ #
1873
+ # Prorations can be disabled by passing `none`.
1874
+ attr_accessor :proration_behavior
1875
+
1876
+ def initialize(
1877
+ applies_to: nil,
1878
+ bill_on_acceptance: nil,
1879
+ billing_behavior: nil,
1880
+ customer: nil,
1881
+ description: nil,
1882
+ end_behavior: nil,
1883
+ proration_behavior: nil
1884
+ )
1885
+ @applies_to = applies_to
1886
+ @bill_on_acceptance = bill_on_acceptance
1887
+ @billing_behavior = billing_behavior
1888
+ @customer = customer
1889
+ @description = description
1890
+ @end_behavior = end_behavior
1891
+ @proration_behavior = proration_behavior
1892
+ end
1893
+ end
1894
+
455
1895
  class TransferData < Stripe::RequestParams
456
1896
  # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
457
1897
  attr_accessor :amount
@@ -466,6 +1906,8 @@ module Stripe
466
1906
  @destination = destination
467
1907
  end
468
1908
  end
1909
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
1910
+ attr_accessor :allow_backdated_lines
469
1911
  # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
470
1912
  attr_accessor :application_fee_amount
471
1913
  # 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. There must be at least 1 line item with a recurring price to use this field.
@@ -476,6 +1918,8 @@ module Stripe
476
1918
  attr_accessor :collection_method
477
1919
  # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
478
1920
  attr_accessor :customer
1921
+ # The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
1922
+ attr_accessor :customer_account
479
1923
  # The tax rates that will apply to any line item that does not have `tax_rates` set.
480
1924
  attr_accessor :default_tax_rates
481
1925
  # A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
@@ -496,23 +1940,29 @@ module Stripe
496
1940
  attr_accessor :invoice_settings
497
1941
  # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
498
1942
  attr_accessor :line_items
1943
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
1944
+ attr_accessor :lines
499
1945
  # 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`.
500
1946
  attr_accessor :metadata
501
1947
  # The account on behalf of which to charge.
502
1948
  attr_accessor :on_behalf_of
503
1949
  # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
504
1950
  attr_accessor :subscription_data
1951
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
1952
+ attr_accessor :subscription_data_overrides
505
1953
  # ID of the test clock to attach to the quote.
506
1954
  attr_accessor :test_clock
507
1955
  # The data with which to automatically create a Transfer for each of the invoices.
508
1956
  attr_accessor :transfer_data
509
1957
 
510
1958
  def initialize(
1959
+ allow_backdated_lines: nil,
511
1960
  application_fee_amount: nil,
512
1961
  application_fee_percent: nil,
513
1962
  automatic_tax: nil,
514
1963
  collection_method: nil,
515
1964
  customer: nil,
1965
+ customer_account: nil,
516
1966
  default_tax_rates: nil,
517
1967
  description: nil,
518
1968
  discounts: nil,
@@ -523,17 +1973,21 @@ module Stripe
523
1973
  header: nil,
524
1974
  invoice_settings: nil,
525
1975
  line_items: nil,
1976
+ lines: nil,
526
1977
  metadata: nil,
527
1978
  on_behalf_of: nil,
528
1979
  subscription_data: nil,
1980
+ subscription_data_overrides: nil,
529
1981
  test_clock: nil,
530
1982
  transfer_data: nil
531
1983
  )
1984
+ @allow_backdated_lines = allow_backdated_lines
532
1985
  @application_fee_amount = application_fee_amount
533
1986
  @application_fee_percent = application_fee_percent
534
1987
  @automatic_tax = automatic_tax
535
1988
  @collection_method = collection_method
536
1989
  @customer = customer
1990
+ @customer_account = customer_account
537
1991
  @default_tax_rates = default_tax_rates
538
1992
  @description = description
539
1993
  @discounts = discounts
@@ -544,88 +1998,629 @@ module Stripe
544
1998
  @header = header
545
1999
  @invoice_settings = invoice_settings
546
2000
  @line_items = line_items
2001
+ @lines = lines
547
2002
  @metadata = metadata
548
2003
  @on_behalf_of = on_behalf_of
549
2004
  @subscription_data = subscription_data
2005
+ @subscription_data_overrides = subscription_data_overrides
550
2006
  @test_clock = test_clock
551
2007
  @transfer_data = transfer_data
552
2008
  end
553
2009
  end
554
2010
 
555
- class UpdateParams < Stripe::RequestParams
556
- class AutomaticTax < Stripe::RequestParams
557
- class Liability < Stripe::RequestParams
558
- # The connected account being referenced when `type` is `account`.
559
- attr_accessor :account
560
- # Type of the account referenced in the request.
2011
+ class UpdateParams < Stripe::RequestParams
2012
+ class AutomaticTax < Stripe::RequestParams
2013
+ class Liability < Stripe::RequestParams
2014
+ # The connected account being referenced when `type` is `account`.
2015
+ attr_accessor :account
2016
+ # Type of the account referenced in the request.
2017
+ attr_accessor :type
2018
+
2019
+ def initialize(account: nil, type: nil)
2020
+ @account = account
2021
+ @type = type
2022
+ end
2023
+ end
2024
+ # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
2025
+ attr_accessor :enabled
2026
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
2027
+ attr_accessor :liability
2028
+
2029
+ def initialize(enabled: nil, liability: nil)
2030
+ @enabled = enabled
2031
+ @liability = liability
2032
+ end
2033
+ end
2034
+
2035
+ class Discount < Stripe::RequestParams
2036
+ class DiscountEnd < Stripe::RequestParams
2037
+ class Duration < Stripe::RequestParams
2038
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2039
+ attr_accessor :interval
2040
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2041
+ attr_accessor :interval_count
2042
+
2043
+ def initialize(interval: nil, interval_count: nil)
2044
+ @interval = interval
2045
+ @interval_count = interval_count
2046
+ end
2047
+ end
2048
+ # Time span for the redeemed discount.
2049
+ attr_accessor :duration
2050
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2051
+ attr_accessor :timestamp
2052
+ # The type of calculation made to determine when the discount ends.
2053
+ attr_accessor :type
2054
+
2055
+ def initialize(duration: nil, timestamp: nil, type: nil)
2056
+ @duration = duration
2057
+ @timestamp = timestamp
2058
+ @type = type
2059
+ end
2060
+ end
2061
+ # ID of the coupon to create a new discount for.
2062
+ attr_accessor :coupon
2063
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2064
+ attr_accessor :discount
2065
+ # Details to determine how long the discount should be applied for.
2066
+ attr_accessor :discount_end
2067
+ # ID of the promotion code to create a new discount for.
2068
+ attr_accessor :promotion_code
2069
+
2070
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2071
+ @coupon = coupon
2072
+ @discount = discount
2073
+ @discount_end = discount_end
2074
+ @promotion_code = promotion_code
2075
+ end
2076
+ end
2077
+
2078
+ class InvoiceSettings < Stripe::RequestParams
2079
+ class Issuer < Stripe::RequestParams
2080
+ # The connected account being referenced when `type` is `account`.
2081
+ attr_accessor :account
2082
+ # Type of the account referenced in the request.
2083
+ attr_accessor :type
2084
+
2085
+ def initialize(account: nil, type: nil)
2086
+ @account = account
2087
+ @type = type
2088
+ end
2089
+ end
2090
+ # Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
2091
+ attr_accessor :days_until_due
2092
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2093
+ attr_accessor :issuer
2094
+
2095
+ def initialize(days_until_due: nil, issuer: nil)
2096
+ @days_until_due = days_until_due
2097
+ @issuer = issuer
2098
+ end
2099
+ end
2100
+
2101
+ class Line < Stripe::RequestParams
2102
+ class Action < Stripe::RequestParams
2103
+ class AddDiscount < Stripe::RequestParams
2104
+ class DiscountEnd < Stripe::RequestParams
2105
+ # The type of calculation made to determine when the discount ends.
2106
+ attr_accessor :type
2107
+
2108
+ def initialize(type: nil)
2109
+ @type = type
2110
+ end
2111
+ end
2112
+ # The coupon code to redeem.
2113
+ attr_accessor :coupon
2114
+ # An ID of an existing discount for a coupon that was already redeemed.
2115
+ attr_accessor :discount
2116
+ # Details to determine how long the discount should be applied for.
2117
+ attr_accessor :discount_end
2118
+ # 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.
2119
+ attr_accessor :index
2120
+ # The promotion code to redeem.
2121
+ attr_accessor :promotion_code
2122
+
2123
+ def initialize(
2124
+ coupon: nil,
2125
+ discount: nil,
2126
+ discount_end: nil,
2127
+ index: nil,
2128
+ promotion_code: nil
2129
+ )
2130
+ @coupon = coupon
2131
+ @discount = discount
2132
+ @discount_end = discount_end
2133
+ @index = index
2134
+ @promotion_code = promotion_code
2135
+ end
2136
+ end
2137
+
2138
+ class AddItem < Stripe::RequestParams
2139
+ class Discount < Stripe::RequestParams
2140
+ class DiscountEnd < Stripe::RequestParams
2141
+ class Duration < Stripe::RequestParams
2142
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2143
+ attr_accessor :interval
2144
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2145
+ attr_accessor :interval_count
2146
+
2147
+ def initialize(interval: nil, interval_count: nil)
2148
+ @interval = interval
2149
+ @interval_count = interval_count
2150
+ end
2151
+ end
2152
+ # Time span for the redeemed discount.
2153
+ attr_accessor :duration
2154
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2155
+ attr_accessor :timestamp
2156
+ # The type of calculation made to determine when the discount ends.
2157
+ attr_accessor :type
2158
+
2159
+ def initialize(duration: nil, timestamp: nil, type: nil)
2160
+ @duration = duration
2161
+ @timestamp = timestamp
2162
+ @type = type
2163
+ end
2164
+ end
2165
+ # ID of the coupon to create a new discount for.
2166
+ attr_accessor :coupon
2167
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2168
+ attr_accessor :discount
2169
+ # Details to determine how long the discount should be applied for.
2170
+ attr_accessor :discount_end
2171
+ # ID of the promotion code to create a new discount for.
2172
+ attr_accessor :promotion_code
2173
+
2174
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2175
+ @coupon = coupon
2176
+ @discount = discount
2177
+ @discount_end = discount_end
2178
+ @promotion_code = promotion_code
2179
+ end
2180
+ end
2181
+
2182
+ class Trial < Stripe::RequestParams
2183
+ # 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.
2184
+ attr_accessor :converts_to
2185
+ # Determines the type of trial for this item.
2186
+ attr_accessor :type
2187
+
2188
+ def initialize(converts_to: nil, type: nil)
2189
+ @converts_to = converts_to
2190
+ @type = type
2191
+ end
2192
+ end
2193
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2194
+ attr_accessor :discounts
2195
+ # 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`.
2196
+ attr_accessor :metadata
2197
+ # The ID of the price object.
2198
+ attr_accessor :price
2199
+ # Quantity for this item.
2200
+ attr_accessor :quantity
2201
+ # 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`.
2202
+ attr_accessor :tax_rates
2203
+ # Options that configure the trial on the subscription item.
2204
+ attr_accessor :trial
2205
+
2206
+ def initialize(
2207
+ discounts: nil,
2208
+ metadata: nil,
2209
+ price: nil,
2210
+ quantity: nil,
2211
+ tax_rates: nil,
2212
+ trial: nil
2213
+ )
2214
+ @discounts = discounts
2215
+ @metadata = metadata
2216
+ @price = price
2217
+ @quantity = quantity
2218
+ @tax_rates = tax_rates
2219
+ @trial = trial
2220
+ end
2221
+ end
2222
+
2223
+ class RemoveDiscount < Stripe::RequestParams
2224
+ # The coupon code to remove from the `discounts` array.
2225
+ attr_accessor :coupon
2226
+ # The ID of a discount to remove from the `discounts` array.
2227
+ attr_accessor :discount
2228
+ # The ID of a promotion code to remove from the `discounts` array.
2229
+ attr_accessor :promotion_code
2230
+
2231
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2232
+ @coupon = coupon
2233
+ @discount = discount
2234
+ @promotion_code = promotion_code
2235
+ end
2236
+ end
2237
+
2238
+ class RemoveItem < Stripe::RequestParams
2239
+ # ID of a price to remove.
2240
+ attr_accessor :price
2241
+
2242
+ def initialize(price: nil)
2243
+ @price = price
2244
+ end
2245
+ end
2246
+
2247
+ class SetDiscount < Stripe::RequestParams
2248
+ # The coupon code to replace the `discounts` array with.
2249
+ attr_accessor :coupon
2250
+ # An ID of an existing discount to replace the `discounts` array with.
2251
+ attr_accessor :discount
2252
+ # An ID of an existing promotion code to replace the `discounts` array with.
2253
+ attr_accessor :promotion_code
2254
+
2255
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2256
+ @coupon = coupon
2257
+ @discount = discount
2258
+ @promotion_code = promotion_code
2259
+ end
2260
+ end
2261
+
2262
+ class SetItem < Stripe::RequestParams
2263
+ class Discount < Stripe::RequestParams
2264
+ class DiscountEnd < Stripe::RequestParams
2265
+ class Duration < Stripe::RequestParams
2266
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2267
+ attr_accessor :interval
2268
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2269
+ attr_accessor :interval_count
2270
+
2271
+ def initialize(interval: nil, interval_count: nil)
2272
+ @interval = interval
2273
+ @interval_count = interval_count
2274
+ end
2275
+ end
2276
+ # Time span for the redeemed discount.
2277
+ attr_accessor :duration
2278
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2279
+ attr_accessor :timestamp
2280
+ # The type of calculation made to determine when the discount ends.
2281
+ attr_accessor :type
2282
+
2283
+ def initialize(duration: nil, timestamp: nil, type: nil)
2284
+ @duration = duration
2285
+ @timestamp = timestamp
2286
+ @type = type
2287
+ end
2288
+ end
2289
+ # ID of the coupon to create a new discount for.
2290
+ attr_accessor :coupon
2291
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2292
+ attr_accessor :discount
2293
+ # Details to determine how long the discount should be applied for.
2294
+ attr_accessor :discount_end
2295
+ # ID of the promotion code to create a new discount for.
2296
+ attr_accessor :promotion_code
2297
+
2298
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2299
+ @coupon = coupon
2300
+ @discount = discount
2301
+ @discount_end = discount_end
2302
+ @promotion_code = promotion_code
2303
+ end
2304
+ end
2305
+
2306
+ class Trial < Stripe::RequestParams
2307
+ # 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.
2308
+ attr_accessor :converts_to
2309
+ # Determines the type of trial for this item.
2310
+ attr_accessor :type
2311
+
2312
+ def initialize(converts_to: nil, type: nil)
2313
+ @converts_to = converts_to
2314
+ @type = type
2315
+ end
2316
+ end
2317
+ # 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`.
2318
+ attr_accessor :discounts
2319
+ # 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`.
2320
+ attr_accessor :metadata
2321
+ # The ID of the price object.
2322
+ attr_accessor :price
2323
+ # 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`.
2324
+ attr_accessor :quantity
2325
+ # 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`.
2326
+ attr_accessor :tax_rates
2327
+ # 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`.
2328
+ attr_accessor :trial
2329
+
2330
+ def initialize(
2331
+ discounts: nil,
2332
+ metadata: nil,
2333
+ price: nil,
2334
+ quantity: nil,
2335
+ tax_rates: nil,
2336
+ trial: nil
2337
+ )
2338
+ @discounts = discounts
2339
+ @metadata = metadata
2340
+ @price = price
2341
+ @quantity = quantity
2342
+ @tax_rates = tax_rates
2343
+ @trial = trial
2344
+ end
2345
+ end
2346
+ # Details for the `add_discount` type.
2347
+ attr_accessor :add_discount
2348
+ # Details for the `add_item` type.
2349
+ attr_accessor :add_item
2350
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
2351
+ attr_accessor :add_metadata
2352
+ # Details for the `remove_discount` type.
2353
+ attr_accessor :remove_discount
2354
+ # Details for the `remove_item` type.
2355
+ attr_accessor :remove_item
2356
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
2357
+ attr_accessor :remove_metadata
2358
+ # Details for the `set_discounts` type.
2359
+ attr_accessor :set_discounts
2360
+ # Details for the `set_items` type.
2361
+ attr_accessor :set_items
2362
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
2363
+ attr_accessor :set_metadata
2364
+ # The type of action the quote line performs.
2365
+ attr_accessor :type
2366
+
2367
+ def initialize(
2368
+ add_discount: nil,
2369
+ add_item: nil,
2370
+ add_metadata: nil,
2371
+ remove_discount: nil,
2372
+ remove_item: nil,
2373
+ remove_metadata: nil,
2374
+ set_discounts: nil,
2375
+ set_items: nil,
2376
+ set_metadata: nil,
2377
+ type: nil
2378
+ )
2379
+ @add_discount = add_discount
2380
+ @add_item = add_item
2381
+ @add_metadata = add_metadata
2382
+ @remove_discount = remove_discount
2383
+ @remove_item = remove_item
2384
+ @remove_metadata = remove_metadata
2385
+ @set_discounts = set_discounts
2386
+ @set_items = set_items
2387
+ @set_metadata = set_metadata
2388
+ @type = type
2389
+ end
2390
+ end
2391
+
2392
+ class AppliesTo < Stripe::RequestParams
2393
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
2394
+ attr_accessor :new_reference
2395
+ # The ID of the schedule the line applies to.
2396
+ attr_accessor :subscription_schedule
2397
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
2398
+ attr_accessor :type
2399
+
2400
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
2401
+ @new_reference = new_reference
2402
+ @subscription_schedule = subscription_schedule
2403
+ @type = type
2404
+ end
2405
+ end
2406
+
2407
+ class CancelSubscriptionSchedule < Stripe::RequestParams
2408
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
2409
+ attr_accessor :cancel_at
2410
+ # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
2411
+ attr_accessor :invoice_now
2412
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
2413
+ attr_accessor :prorate
2414
+
2415
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
2416
+ @cancel_at = cancel_at
2417
+ @invoice_now = invoice_now
2418
+ @prorate = prorate
2419
+ end
2420
+ end
2421
+
2422
+ class EndsAt < Stripe::RequestParams
2423
+ class DiscountEnd < Stripe::RequestParams
2424
+ # The ID of a specific discount.
2425
+ attr_accessor :discount
2426
+
2427
+ def initialize(discount: nil)
2428
+ @discount = discount
2429
+ end
2430
+ end
2431
+
2432
+ class Duration < Stripe::RequestParams
2433
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2434
+ attr_accessor :interval
2435
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2436
+ attr_accessor :interval_count
2437
+
2438
+ def initialize(interval: nil, interval_count: nil)
2439
+ @interval = interval
2440
+ @interval_count = interval_count
2441
+ end
2442
+ end
2443
+ # Use the `end` time of a given discount.
2444
+ attr_accessor :discount_end
2445
+ # Time span for the quote line starting from the `starts_at` date.
2446
+ attr_accessor :duration
2447
+ # A precise Unix timestamp.
2448
+ attr_accessor :timestamp
2449
+ # Select a way to pass in `ends_at`.
561
2450
  attr_accessor :type
562
2451
 
563
- def initialize(account: nil, type: nil)
564
- @account = account
2452
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2453
+ @discount_end = discount_end
2454
+ @duration = duration
2455
+ @timestamp = timestamp
565
2456
  @type = type
566
2457
  end
567
2458
  end
568
- # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
569
- attr_accessor :enabled
570
- # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
571
- attr_accessor :liability
572
2459
 
573
- def initialize(enabled: nil, liability: nil)
574
- @enabled = enabled
575
- @liability = liability
576
- end
577
- end
2460
+ class SetPauseCollection < Stripe::RequestParams
2461
+ class Set < Stripe::RequestParams
2462
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2463
+ attr_accessor :behavior
578
2464
 
579
- class Discount < Stripe::RequestParams
580
- # ID of the coupon to create a new discount for.
581
- attr_accessor :coupon
582
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
583
- attr_accessor :discount
584
- # ID of the promotion code to create a new discount for.
585
- attr_accessor :promotion_code
2465
+ def initialize(behavior: nil)
2466
+ @behavior = behavior
2467
+ end
2468
+ end
2469
+ # Details of the pause_collection behavior to apply to the amendment.
2470
+ attr_accessor :set
2471
+ # Determines the type of the pause_collection amendment.
2472
+ attr_accessor :type
586
2473
 
587
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
588
- @coupon = coupon
589
- @discount = discount
590
- @promotion_code = promotion_code
2474
+ def initialize(set: nil, type: nil)
2475
+ @set = set
2476
+ @type = type
2477
+ end
591
2478
  end
592
- end
593
2479
 
594
- class InvoiceSettings < Stripe::RequestParams
595
- class Issuer < Stripe::RequestParams
596
- # The connected account being referenced when `type` is `account`.
597
- attr_accessor :account
598
- # Type of the account referenced in the request.
2480
+ class StartsAt < Stripe::RequestParams
2481
+ class DiscountEnd < Stripe::RequestParams
2482
+ # The ID of a specific discount.
2483
+ attr_accessor :discount
2484
+
2485
+ def initialize(discount: nil)
2486
+ @discount = discount
2487
+ end
2488
+ end
2489
+
2490
+ class LineEndsAt < Stripe::RequestParams
2491
+ # The ID of a quote line.
2492
+ attr_accessor :id
2493
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2494
+ attr_accessor :index
2495
+
2496
+ def initialize(id: nil, index: nil)
2497
+ @id = id
2498
+ @index = index
2499
+ end
2500
+ end
2501
+ # Use the `end` time of a given discount.
2502
+ attr_accessor :discount_end
2503
+ # The timestamp the given line ends at.
2504
+ attr_accessor :line_ends_at
2505
+ # A precise Unix timestamp.
2506
+ attr_accessor :timestamp
2507
+ # Select a way to pass in `starts_at`.
599
2508
  attr_accessor :type
600
2509
 
601
- def initialize(account: nil, type: nil)
602
- @account = account
2510
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
2511
+ @discount_end = discount_end
2512
+ @line_ends_at = line_ends_at
2513
+ @timestamp = timestamp
603
2514
  @type = type
604
2515
  end
605
2516
  end
606
- # Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
607
- attr_accessor :days_until_due
608
- # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
609
- attr_accessor :issuer
610
2517
 
611
- def initialize(days_until_due: nil, issuer: nil)
612
- @days_until_due = days_until_due
613
- @issuer = issuer
2518
+ class TrialSettings < Stripe::RequestParams
2519
+ class EndBehavior < Stripe::RequestParams
2520
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2521
+ attr_accessor :prorate_up_front
2522
+
2523
+ def initialize(prorate_up_front: nil)
2524
+ @prorate_up_front = prorate_up_front
2525
+ end
2526
+ end
2527
+ # Defines how the subscription should behave when a trial ends.
2528
+ attr_accessor :end_behavior
2529
+
2530
+ def initialize(end_behavior: nil)
2531
+ @end_behavior = end_behavior
2532
+ end
2533
+ end
2534
+ # An array of operations the quote line performs.
2535
+ attr_accessor :actions
2536
+ # Details to identify the subscription schedule the quote line applies to.
2537
+ attr_accessor :applies_to
2538
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
2539
+ attr_accessor :billing_cycle_anchor
2540
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
2541
+ attr_accessor :cancel_subscription_schedule
2542
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
2543
+ attr_accessor :ends_at
2544
+ # The ID of an existing line on the quote.
2545
+ attr_accessor :id
2546
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
2547
+ attr_accessor :proration_behavior
2548
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2549
+ attr_accessor :set_pause_collection
2550
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
2551
+ attr_accessor :set_schedule_end
2552
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2553
+ attr_accessor :starts_at
2554
+ # Settings related to subscription trials.
2555
+ attr_accessor :trial_settings
2556
+
2557
+ def initialize(
2558
+ actions: nil,
2559
+ applies_to: nil,
2560
+ billing_cycle_anchor: nil,
2561
+ cancel_subscription_schedule: nil,
2562
+ ends_at: nil,
2563
+ id: nil,
2564
+ proration_behavior: nil,
2565
+ set_pause_collection: nil,
2566
+ set_schedule_end: nil,
2567
+ starts_at: nil,
2568
+ trial_settings: nil
2569
+ )
2570
+ @actions = actions
2571
+ @applies_to = applies_to
2572
+ @billing_cycle_anchor = billing_cycle_anchor
2573
+ @cancel_subscription_schedule = cancel_subscription_schedule
2574
+ @ends_at = ends_at
2575
+ @id = id
2576
+ @proration_behavior = proration_behavior
2577
+ @set_pause_collection = set_pause_collection
2578
+ @set_schedule_end = set_schedule_end
2579
+ @starts_at = starts_at
2580
+ @trial_settings = trial_settings
614
2581
  end
615
2582
  end
616
2583
 
617
2584
  class LineItem < Stripe::RequestParams
618
2585
  class Discount < Stripe::RequestParams
2586
+ class DiscountEnd < Stripe::RequestParams
2587
+ class Duration < Stripe::RequestParams
2588
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2589
+ attr_accessor :interval
2590
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2591
+ attr_accessor :interval_count
2592
+
2593
+ def initialize(interval: nil, interval_count: nil)
2594
+ @interval = interval
2595
+ @interval_count = interval_count
2596
+ end
2597
+ end
2598
+ # Time span for the redeemed discount.
2599
+ attr_accessor :duration
2600
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2601
+ attr_accessor :timestamp
2602
+ # The type of calculation made to determine when the discount ends.
2603
+ attr_accessor :type
2604
+
2605
+ def initialize(duration: nil, timestamp: nil, type: nil)
2606
+ @duration = duration
2607
+ @timestamp = timestamp
2608
+ @type = type
2609
+ end
2610
+ end
619
2611
  # ID of the coupon to create a new discount for.
620
2612
  attr_accessor :coupon
621
2613
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
622
2614
  attr_accessor :discount
2615
+ # Details to determine how long the discount should be applied for.
2616
+ attr_accessor :discount_end
623
2617
  # ID of the promotion code to create a new discount for.
624
2618
  attr_accessor :promotion_code
625
2619
 
626
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2620
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
627
2621
  @coupon = coupon
628
2622
  @discount = discount
2623
+ @discount_end = discount_end
629
2624
  @promotion_code = promotion_code
630
2625
  end
631
2626
  end
@@ -702,23 +2697,277 @@ module Stripe
702
2697
  end
703
2698
 
704
2699
  class SubscriptionData < Stripe::RequestParams
2700
+ class BillOnAcceptance < Stripe::RequestParams
2701
+ class BillFrom < Stripe::RequestParams
2702
+ class LineStartsAt < Stripe::RequestParams
2703
+ # The ID of a quote line.
2704
+ attr_accessor :id
2705
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2706
+ attr_accessor :index
2707
+
2708
+ def initialize(id: nil, index: nil)
2709
+ @id = id
2710
+ @index = index
2711
+ end
2712
+ end
2713
+ # Details of a Quote line to start the bill period from.
2714
+ attr_accessor :line_starts_at
2715
+ # A precise Unix timestamp.
2716
+ attr_accessor :timestamp
2717
+ # The type of method to specify the `bill_from` time.
2718
+ attr_accessor :type
2719
+
2720
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
2721
+ @line_starts_at = line_starts_at
2722
+ @timestamp = timestamp
2723
+ @type = type
2724
+ end
2725
+ end
2726
+
2727
+ class BillUntil < Stripe::RequestParams
2728
+ class Duration < Stripe::RequestParams
2729
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2730
+ attr_accessor :interval
2731
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2732
+ attr_accessor :interval_count
2733
+
2734
+ def initialize(interval: nil, interval_count: nil)
2735
+ @interval = interval
2736
+ @interval_count = interval_count
2737
+ end
2738
+ end
2739
+
2740
+ class LineEndsAt < Stripe::RequestParams
2741
+ # The ID of a quote line.
2742
+ attr_accessor :id
2743
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2744
+ attr_accessor :index
2745
+
2746
+ def initialize(id: nil, index: nil)
2747
+ @id = id
2748
+ @index = index
2749
+ end
2750
+ end
2751
+ # Details of the duration over which to bill.
2752
+ attr_accessor :duration
2753
+ # Details of a Quote line item from which to bill until.
2754
+ attr_accessor :line_ends_at
2755
+ # A precise Unix timestamp.
2756
+ attr_accessor :timestamp
2757
+ # The type of method to specify the `bill_until` time.
2758
+ attr_accessor :type
2759
+
2760
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
2761
+ @duration = duration
2762
+ @line_ends_at = line_ends_at
2763
+ @timestamp = timestamp
2764
+ @type = type
2765
+ end
2766
+ end
2767
+ # The start of the period to bill from when the Quote is accepted.
2768
+ attr_accessor :bill_from
2769
+ # The end of the period to bill until when the Quote is accepted.
2770
+ attr_accessor :bill_until
2771
+
2772
+ def initialize(bill_from: nil, bill_until: nil)
2773
+ @bill_from = bill_from
2774
+ @bill_until = bill_until
2775
+ end
2776
+ end
2777
+
2778
+ class Prebilling < Stripe::RequestParams
2779
+ # This is used to determine the number of billing cycles to prebill.
2780
+ attr_accessor :iterations
2781
+
2782
+ def initialize(iterations: nil)
2783
+ @iterations = iterations
2784
+ end
2785
+ end
2786
+ # Describes the period to bill for upon accepting the quote.
2787
+ attr_accessor :bill_on_acceptance
2788
+ # 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.
2789
+ attr_accessor :billing_behavior
2790
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
2791
+ attr_accessor :billing_cycle_anchor
705
2792
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
706
2793
  attr_accessor :description
707
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
2794
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
708
2795
  attr_accessor :effective_date
2796
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2797
+ attr_accessor :end_behavior
709
2798
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
710
2799
  attr_accessor :metadata
2800
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
2801
+ attr_accessor :prebilling
2802
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
2803
+ #
2804
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
2805
+ #
2806
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
2807
+ #
2808
+ # Prorations can be disabled by passing `none`.
2809
+ attr_accessor :proration_behavior
711
2810
  # Integer representing the number of trial period days before the customer is charged for the first time.
712
2811
  attr_accessor :trial_period_days
713
2812
 
714
- def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
2813
+ def initialize(
2814
+ bill_on_acceptance: nil,
2815
+ billing_behavior: nil,
2816
+ billing_cycle_anchor: nil,
2817
+ description: nil,
2818
+ effective_date: nil,
2819
+ end_behavior: nil,
2820
+ metadata: nil,
2821
+ prebilling: nil,
2822
+ proration_behavior: nil,
2823
+ trial_period_days: nil
2824
+ )
2825
+ @bill_on_acceptance = bill_on_acceptance
2826
+ @billing_behavior = billing_behavior
2827
+ @billing_cycle_anchor = billing_cycle_anchor
715
2828
  @description = description
716
2829
  @effective_date = effective_date
2830
+ @end_behavior = end_behavior
717
2831
  @metadata = metadata
2832
+ @prebilling = prebilling
2833
+ @proration_behavior = proration_behavior
718
2834
  @trial_period_days = trial_period_days
719
2835
  end
720
2836
  end
721
2837
 
2838
+ class SubscriptionDataOverride < Stripe::RequestParams
2839
+ class AppliesTo < Stripe::RequestParams
2840
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
2841
+ attr_accessor :new_reference
2842
+ # The ID of the schedule the line applies to.
2843
+ attr_accessor :subscription_schedule
2844
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
2845
+ attr_accessor :type
2846
+
2847
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
2848
+ @new_reference = new_reference
2849
+ @subscription_schedule = subscription_schedule
2850
+ @type = type
2851
+ end
2852
+ end
2853
+
2854
+ class BillOnAcceptance < Stripe::RequestParams
2855
+ class BillFrom < Stripe::RequestParams
2856
+ class LineStartsAt < Stripe::RequestParams
2857
+ # The ID of a quote line.
2858
+ attr_accessor :id
2859
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2860
+ attr_accessor :index
2861
+
2862
+ def initialize(id: nil, index: nil)
2863
+ @id = id
2864
+ @index = index
2865
+ end
2866
+ end
2867
+ # Details of a Quote line to start the bill period from.
2868
+ attr_accessor :line_starts_at
2869
+ # A precise Unix timestamp.
2870
+ attr_accessor :timestamp
2871
+ # The type of method to specify the `bill_from` time.
2872
+ attr_accessor :type
2873
+
2874
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
2875
+ @line_starts_at = line_starts_at
2876
+ @timestamp = timestamp
2877
+ @type = type
2878
+ end
2879
+ end
2880
+
2881
+ class BillUntil < Stripe::RequestParams
2882
+ class Duration < Stripe::RequestParams
2883
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2884
+ attr_accessor :interval
2885
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2886
+ attr_accessor :interval_count
2887
+
2888
+ def initialize(interval: nil, interval_count: nil)
2889
+ @interval = interval
2890
+ @interval_count = interval_count
2891
+ end
2892
+ end
2893
+
2894
+ class LineEndsAt < Stripe::RequestParams
2895
+ # The ID of a quote line.
2896
+ attr_accessor :id
2897
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2898
+ attr_accessor :index
2899
+
2900
+ def initialize(id: nil, index: nil)
2901
+ @id = id
2902
+ @index = index
2903
+ end
2904
+ end
2905
+ # Details of the duration over which to bill.
2906
+ attr_accessor :duration
2907
+ # Details of a Quote line item from which to bill until.
2908
+ attr_accessor :line_ends_at
2909
+ # A precise Unix timestamp.
2910
+ attr_accessor :timestamp
2911
+ # The type of method to specify the `bill_until` time.
2912
+ attr_accessor :type
2913
+
2914
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
2915
+ @duration = duration
2916
+ @line_ends_at = line_ends_at
2917
+ @timestamp = timestamp
2918
+ @type = type
2919
+ end
2920
+ end
2921
+ # The start of the period to bill from when the Quote is accepted.
2922
+ attr_accessor :bill_from
2923
+ # The end of the period to bill until when the Quote is accepted.
2924
+ attr_accessor :bill_until
2925
+
2926
+ def initialize(bill_from: nil, bill_until: nil)
2927
+ @bill_from = bill_from
2928
+ @bill_until = bill_until
2929
+ end
2930
+ end
2931
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
2932
+ attr_accessor :applies_to
2933
+ # Describes the period to bill for upon accepting the quote.
2934
+ attr_accessor :bill_on_acceptance
2935
+ # 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.
2936
+ attr_accessor :billing_behavior
2937
+ # The customer the Subscription Data override applies to.
2938
+ attr_accessor :customer
2939
+ # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
2940
+ attr_accessor :description
2941
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2942
+ attr_accessor :end_behavior
2943
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
2944
+ #
2945
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
2946
+ #
2947
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
2948
+ #
2949
+ # Prorations can be disabled by passing `none`.
2950
+ attr_accessor :proration_behavior
2951
+
2952
+ def initialize(
2953
+ applies_to: nil,
2954
+ bill_on_acceptance: nil,
2955
+ billing_behavior: nil,
2956
+ customer: nil,
2957
+ description: nil,
2958
+ end_behavior: nil,
2959
+ proration_behavior: nil
2960
+ )
2961
+ @applies_to = applies_to
2962
+ @bill_on_acceptance = bill_on_acceptance
2963
+ @billing_behavior = billing_behavior
2964
+ @customer = customer
2965
+ @description = description
2966
+ @end_behavior = end_behavior
2967
+ @proration_behavior = proration_behavior
2968
+ end
2969
+ end
2970
+
722
2971
  class TransferData < Stripe::RequestParams
723
2972
  # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
724
2973
  attr_accessor :amount
@@ -733,6 +2982,8 @@ module Stripe
733
2982
  @destination = destination
734
2983
  end
735
2984
  end
2985
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
2986
+ attr_accessor :allow_backdated_lines
736
2987
  # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
737
2988
  attr_accessor :application_fee_amount
738
2989
  # 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. There must be at least 1 line item with a recurring price to use this field.
@@ -743,6 +2994,8 @@ module Stripe
743
2994
  attr_accessor :collection_method
744
2995
  # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
745
2996
  attr_accessor :customer
2997
+ # The account for which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
2998
+ attr_accessor :customer_account
746
2999
  # The tax rates that will apply to any line item that does not have `tax_rates` set.
747
3000
  attr_accessor :default_tax_rates
748
3001
  # A description that will be displayed on the quote PDF.
@@ -761,21 +3014,27 @@ module Stripe
761
3014
  attr_accessor :invoice_settings
762
3015
  # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
763
3016
  attr_accessor :line_items
3017
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3018
+ attr_accessor :lines
764
3019
  # 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`.
765
3020
  attr_accessor :metadata
766
3021
  # The account on behalf of which to charge.
767
3022
  attr_accessor :on_behalf_of
768
3023
  # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
769
3024
  attr_accessor :subscription_data
3025
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
3026
+ attr_accessor :subscription_data_overrides
770
3027
  # The data with which to automatically create a Transfer for each of the invoices.
771
3028
  attr_accessor :transfer_data
772
3029
 
773
3030
  def initialize(
3031
+ allow_backdated_lines: nil,
774
3032
  application_fee_amount: nil,
775
3033
  application_fee_percent: nil,
776
3034
  automatic_tax: nil,
777
3035
  collection_method: nil,
778
3036
  customer: nil,
3037
+ customer_account: nil,
779
3038
  default_tax_rates: nil,
780
3039
  description: nil,
781
3040
  discounts: nil,
@@ -785,16 +3044,20 @@ module Stripe
785
3044
  header: nil,
786
3045
  invoice_settings: nil,
787
3046
  line_items: nil,
3047
+ lines: nil,
788
3048
  metadata: nil,
789
3049
  on_behalf_of: nil,
790
3050
  subscription_data: nil,
3051
+ subscription_data_overrides: nil,
791
3052
  transfer_data: nil
792
3053
  )
3054
+ @allow_backdated_lines = allow_backdated_lines
793
3055
  @application_fee_amount = application_fee_amount
794
3056
  @application_fee_percent = application_fee_percent
795
3057
  @automatic_tax = automatic_tax
796
3058
  @collection_method = collection_method
797
3059
  @customer = customer
3060
+ @customer_account = customer_account
798
3061
  @default_tax_rates = default_tax_rates
799
3062
  @description = description
800
3063
  @discounts = discounts
@@ -804,9 +3067,11 @@ module Stripe
804
3067
  @header = header
805
3068
  @invoice_settings = invoice_settings
806
3069
  @line_items = line_items
3070
+ @lines = lines
807
3071
  @metadata = metadata
808
3072
  @on_behalf_of = on_behalf_of
809
3073
  @subscription_data = subscription_data
3074
+ @subscription_data_overrides = subscription_data_overrides
810
3075
  @transfer_data = transfer_data
811
3076
  end
812
3077
  end
@@ -847,6 +3112,24 @@ module Stripe
847
3112
  end
848
3113
  end
849
3114
 
3115
+ class ListLinesParams < Stripe::RequestParams
3116
+ # 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.
3117
+ attr_accessor :ending_before
3118
+ # Specifies which fields in the response should be expanded.
3119
+ attr_accessor :expand
3120
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
3121
+ attr_accessor :limit
3122
+ # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
3123
+ attr_accessor :starting_after
3124
+
3125
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
3126
+ @ending_before = ending_before
3127
+ @expand = expand
3128
+ @limit = limit
3129
+ @starting_after = starting_after
3130
+ end
3131
+ end
3132
+
850
3133
  class AcceptParams < Stripe::RequestParams
851
3134
  # Specifies which fields in the response should be expanded.
852
3135
  attr_accessor :expand
@@ -877,6 +3160,36 @@ module Stripe
877
3160
  end
878
3161
  end
879
3162
 
3163
+ class MarkDraftParams < Stripe::RequestParams
3164
+ # Specifies which fields in the response should be expanded.
3165
+ attr_accessor :expand
3166
+
3167
+ def initialize(expand: nil)
3168
+ @expand = expand
3169
+ end
3170
+ end
3171
+
3172
+ class MarkStaleParams < Stripe::RequestParams
3173
+ # Specifies which fields in the response should be expanded.
3174
+ attr_accessor :expand
3175
+ # Reason the Quote is being marked stale.
3176
+ attr_accessor :reason
3177
+
3178
+ def initialize(expand: nil, reason: nil)
3179
+ @expand = expand
3180
+ @reason = reason
3181
+ end
3182
+ end
3183
+
3184
+ class ReestimateParams < Stripe::RequestParams
3185
+ # Specifies which fields in the response should be expanded.
3186
+ attr_accessor :expand
3187
+
3188
+ def initialize(expand: nil)
3189
+ @expand = expand
3190
+ end
3191
+ end
3192
+
880
3193
  class PdfParams < Stripe::RequestParams
881
3194
  # Specifies which fields in the response should be expanded.
882
3195
  attr_accessor :expand
@@ -885,6 +3198,26 @@ module Stripe
885
3198
  @expand = expand
886
3199
  end
887
3200
  end
3201
+
3202
+ class ListPreviewInvoiceLinesParams < Stripe::RequestParams
3203
+ # 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.
3204
+ attr_accessor :ending_before
3205
+ # Specifies which fields in the response should be expanded.
3206
+ attr_accessor :expand
3207
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
3208
+ attr_accessor :limit
3209
+ # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
3210
+ attr_accessor :starting_after
3211
+
3212
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
3213
+ @ending_before = ending_before
3214
+ @expand = expand
3215
+ @limit = limit
3216
+ @starting_after = starting_after
3217
+ end
3218
+ end
3219
+ # Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
3220
+ attr_reader :allow_backdated_lines
888
3221
  # Total before any discounts or taxes are applied.
889
3222
  attr_reader :amount_subtotal
890
3223
  # Total after discounts and taxes are applied.
@@ -907,6 +3240,8 @@ module Stripe
907
3240
  attr_reader :currency
908
3241
  # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
909
3242
  attr_reader :customer
3243
+ # The account which this quote belongs to. A customer or account is required before finalizing the quote. Once specified, it cannot be changed.
3244
+ attr_reader :customer_account
910
3245
  # The tax rates applied to this quote.
911
3246
  attr_reader :default_tax_rates
912
3247
  # A description that will be displayed on the quote PDF.
@@ -929,6 +3264,8 @@ module Stripe
929
3264
  attr_reader :invoice_settings
930
3265
  # A list of items the customer is being quoted for.
931
3266
  attr_reader :line_items
3267
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3268
+ attr_reader :lines
932
3269
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
933
3270
  attr_reader :livemode
934
3271
  # 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.
@@ -941,14 +3278,20 @@ module Stripe
941
3278
  attr_reader :on_behalf_of
942
3279
  # The status of the quote.
943
3280
  attr_reader :status
3281
+ # Details on when and why a quote has been marked as stale or canceled.
3282
+ attr_reader :status_details
944
3283
  # Attribute for field status_transitions
945
3284
  attr_reader :status_transitions
946
3285
  # The subscription that was created or updated from this quote.
947
3286
  attr_reader :subscription
948
3287
  # Attribute for field subscription_data
949
3288
  attr_reader :subscription_data
3289
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
3290
+ attr_reader :subscription_data_overrides
950
3291
  # The subscription schedule that was created or updated from this quote.
951
3292
  attr_reader :subscription_schedule
3293
+ # The subscription schedules that were created or updated from this quote.
3294
+ attr_reader :subscription_schedules
952
3295
  # ID of the test clock this quote belongs to.
953
3296
  attr_reader :test_clock
954
3297
  # Attribute for field total_details
@@ -1066,6 +3409,86 @@ module Stripe
1066
3409
  )
1067
3410
  end
1068
3411
 
3412
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3413
+ def list_lines(params = {}, opts = {})
3414
+ request_stripe_object(
3415
+ method: :get,
3416
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
3417
+ params: params,
3418
+ opts: opts
3419
+ )
3420
+ end
3421
+
3422
+ # Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
3423
+ def self.list_lines(quote, params = {}, opts = {})
3424
+ request_stripe_object(
3425
+ method: :get,
3426
+ path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
3427
+ params: params,
3428
+ opts: opts
3429
+ )
3430
+ end
3431
+
3432
+ # Preview the invoice line items that would be generated by accepting the quote.
3433
+ def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
3434
+ request_stripe_object(
3435
+ method: :get,
3436
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
3437
+ params: params,
3438
+ opts: opts
3439
+ )
3440
+ end
3441
+
3442
+ # Preview the invoice line items that would be generated by accepting the quote.
3443
+ def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
3444
+ request_stripe_object(
3445
+ method: :get,
3446
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
3447
+ params: params,
3448
+ opts: opts
3449
+ )
3450
+ end
3451
+
3452
+ # Converts a stale quote to draft.
3453
+ def mark_draft(params = {}, opts = {})
3454
+ request_stripe_object(
3455
+ method: :post,
3456
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
3457
+ params: params,
3458
+ opts: opts
3459
+ )
3460
+ end
3461
+
3462
+ # Converts a stale quote to draft.
3463
+ def self.mark_draft(quote, params = {}, opts = {})
3464
+ request_stripe_object(
3465
+ method: :post,
3466
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
3467
+ params: params,
3468
+ opts: opts
3469
+ )
3470
+ end
3471
+
3472
+ # Converts a draft or open quote to stale.
3473
+ def mark_stale(params = {}, opts = {})
3474
+ request_stripe_object(
3475
+ method: :post,
3476
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
3477
+ params: params,
3478
+ opts: opts
3479
+ )
3480
+ end
3481
+
3482
+ # Converts a draft or open quote to stale.
3483
+ def self.mark_stale(quote, params = {}, opts = {})
3484
+ request_stripe_object(
3485
+ method: :post,
3486
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
3487
+ params: params,
3488
+ opts: opts
3489
+ )
3490
+ end
3491
+
1069
3492
  # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
1070
3493
  def pdf(params = {}, opts = {}, &read_body_chunk_block)
1071
3494
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
@@ -1092,6 +3515,26 @@ module Stripe
1092
3515
  )
1093
3516
  end
1094
3517
 
3518
+ # Recompute the upcoming invoice estimate for the quote.
3519
+ def reestimate(params = {}, opts = {})
3520
+ request_stripe_object(
3521
+ method: :post,
3522
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
3523
+ params: params,
3524
+ opts: opts
3525
+ )
3526
+ end
3527
+
3528
+ # Recompute the upcoming invoice estimate for the quote.
3529
+ def self.reestimate(quote, params = {}, opts = {})
3530
+ request_stripe_object(
3531
+ method: :post,
3532
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
3533
+ params: params,
3534
+ opts: opts
3535
+ )
3536
+ end
3537
+
1095
3538
  # A quote models prices and services for a customer.
1096
3539
  def self.update(quote, params = {}, opts = {})
1097
3540
  request_stripe_object(
@@ -1101,5 +3544,25 @@ module Stripe
1101
3544
  opts: opts
1102
3545
  )
1103
3546
  end
3547
+
3548
+ def self.inner_class_types
3549
+ @inner_class_types = {
3550
+ automatic_tax: AutomaticTax,
3551
+ computed: Computed,
3552
+ from_quote: FromQuote,
3553
+ invoice_settings: InvoiceSettings,
3554
+ status_details: StatusDetails,
3555
+ status_transitions: StatusTransitions,
3556
+ subscription_data: SubscriptionData,
3557
+ subscription_data_overrides: SubscriptionDataOverride,
3558
+ subscription_schedules: SubscriptionSchedule,
3559
+ total_details: TotalDetails,
3560
+ transfer_data: TransferData,
3561
+ }
3562
+ end
3563
+
3564
+ def self.field_remappings
3565
+ @field_remappings = {}
3566
+ end
1104
3567
  end
1105
3568
  end