stripe 19.2.0 → 19.3.0.pre.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +36 -3
  3. data/lib/stripe/api_version.rb +1 -2
  4. data/lib/stripe/errors.rb +87 -0
  5. data/lib/stripe/event_types.rb +228 -0
  6. data/lib/stripe/events/unknown_event_notification.rb +1 -0
  7. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +63 -0
  8. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +44 -0
  9. data/lib/stripe/events/v2_core_batch_job_batch_failed_event.rb +44 -0
  10. data/lib/stripe/events/v2_core_batch_job_canceled_event.rb +44 -0
  11. data/lib/stripe/events/v2_core_batch_job_completed_event.rb +44 -0
  12. data/lib/stripe/events/v2_core_batch_job_created_event.rb +44 -0
  13. data/lib/stripe/events/v2_core_batch_job_ready_for_upload_event.rb +44 -0
  14. data/lib/stripe/events/v2_core_batch_job_timeout_event.rb +44 -0
  15. data/lib/stripe/events/v2_core_batch_job_updated_event.rb +44 -0
  16. data/lib/stripe/events/v2_core_batch_job_upload_timeout_event.rb +44 -0
  17. data/lib/stripe/events/v2_core_batch_job_validating_event.rb +44 -0
  18. data/lib/stripe/events/v2_core_batch_job_validation_failed_event.rb +44 -0
  19. data/lib/stripe/events/v2_core_health_event_generation_failure_resolved_event.rb +78 -0
  20. data/lib/stripe/events/v2_data_reporting_query_run_created_event.rb +44 -0
  21. data/lib/stripe/events/v2_data_reporting_query_run_failed_event.rb +44 -0
  22. data/lib/stripe/events/v2_data_reporting_query_run_succeeded_event.rb +44 -0
  23. data/lib/stripe/events/v2_data_reporting_query_run_updated_event.rb +44 -0
  24. data/lib/stripe/events/v2_extend_workflow_run_failed_event.rb +75 -0
  25. data/lib/stripe/events/v2_extend_workflow_run_started_event.rb +44 -0
  26. data/lib/stripe/events/v2_extend_workflow_run_succeeded_event.rb +44 -0
  27. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +44 -0
  28. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +44 -0
  29. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +44 -0
  30. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +44 -0
  31. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +44 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +61 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +44 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +44 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +44 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +44 -0
  37. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +44 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +44 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +44 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +44 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +44 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +44 -0
  43. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +44 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +44 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +44 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +44 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +44 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +44 -0
  49. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +44 -0
  50. data/lib/stripe/events/v2_money_management_payout_method_created_event.rb +44 -0
  51. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +44 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +61 -0
  53. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +44 -0
  54. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +44 -0
  55. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +44 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +44 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +44 -0
  58. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +44 -0
  59. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +44 -0
  60. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +44 -0
  61. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +63 -0
  62. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +44 -0
  63. data/lib/stripe/events/v2_orchestrated_commerce_agreement_confirmed_event.rb +97 -0
  64. data/lib/stripe/events/v2_orchestrated_commerce_agreement_created_event.rb +97 -0
  65. data/lib/stripe/events/v2_orchestrated_commerce_agreement_partially_confirmed_event.rb +97 -0
  66. data/lib/stripe/events/v2_orchestrated_commerce_agreement_terminated_event.rb +97 -0
  67. data/lib/stripe/object_types.rb +61 -0
  68. data/lib/stripe/params/account_create_params.rb +374 -1
  69. data/lib/stripe/params/account_notice_list_params.rb +25 -0
  70. data/lib/stripe/params/account_notice_retrieve_params.rb +13 -0
  71. data/lib/stripe/params/account_notice_update_params.rb +36 -0
  72. data/lib/stripe/params/account_session_create_params.rb +226 -1
  73. data/lib/stripe/params/account_update_params.rb +336 -0
  74. data/lib/stripe/params/billing/analytics/meter_usage_retrieve_params.rb +65 -0
  75. data/lib/stripe/params/capital/financing_offer_list_params.rb +58 -0
  76. data/lib/stripe/params/capital/financing_offer_mark_delivered_params.rb +15 -0
  77. data/lib/stripe/params/capital/financing_offer_retrieve_params.rb +15 -0
  78. data/lib/stripe/params/capital/financing_summary_retrieve_params.rb +15 -0
  79. data/lib/stripe/params/capital/financing_transaction_list_params.rb +45 -0
  80. data/lib/stripe/params/capital/financing_transaction_retrieve_params.rb +15 -0
  81. data/lib/stripe/params/charge_capture_params.rb +1646 -0
  82. data/lib/stripe/params/charge_update_params.rb +1646 -0
  83. data/lib/stripe/params/checkout/session_create_params.rb +126 -3
  84. data/lib/stripe/params/checkout/session_update_params.rb +176 -1
  85. data/lib/stripe/params/confirmation_token_create_params.rb +78 -0
  86. data/lib/stripe/params/coupon_create_params.rb +17 -1
  87. data/lib/stripe/params/customer_session_create_params.rb +32 -1
  88. data/lib/stripe/params/dispute_update_params.rb +10 -1
  89. data/lib/stripe/params/external_account_create_params.rb +134 -0
  90. data/lib/stripe/params/external_account_delete_params.rb +6 -0
  91. data/lib/stripe/params/external_account_list_params.rb +25 -0
  92. data/lib/stripe/params/external_account_retrieve_params.rb +13 -0
  93. data/lib/stripe/params/external_account_update_params.rb +91 -0
  94. data/lib/stripe/params/financial_connections/account_inferred_balance_list_params.rb +24 -0
  95. data/lib/stripe/params/financial_connections/authorization_retrieve_params.rb +15 -0
  96. data/lib/stripe/params/financial_connections/institution_list_params.rb +24 -0
  97. data/lib/stripe/params/financial_connections/institution_retrieve_params.rb +15 -0
  98. data/lib/stripe/params/financial_connections/session_create_params.rb +64 -2
  99. data/lib/stripe/params/fx_quote_create_params.rb +73 -0
  100. data/lib/stripe/params/fx_quote_list_params.rb +22 -0
  101. data/lib/stripe/params/fx_quote_retrieve_params.rb +13 -0
  102. data/lib/stripe/params/invoice_add_lines_params.rb +48 -1
  103. data/lib/stripe/params/invoice_attach_payment_params.rb +43 -1
  104. data/lib/stripe/params/invoice_create_params.rb +70 -2
  105. data/lib/stripe/params/invoice_create_preview_params.rb +790 -9
  106. data/lib/stripe/params/invoice_detach_payment_params.rb +16 -0
  107. data/lib/stripe/params/invoice_item_create_params.rb +33 -1
  108. data/lib/stripe/params/invoice_item_update_params.rb +33 -1
  109. data/lib/stripe/params/invoice_line_item_update_params.rb +48 -1
  110. data/lib/stripe/params/invoice_update_lines_params.rb +48 -1
  111. data/lib/stripe/params/invoice_update_params.rb +70 -2
  112. data/lib/stripe/params/issuing/cardholder_create_params.rb +2 -1
  113. data/lib/stripe/params/issuing/credit_underwriting_record_correct_params.rb +163 -0
  114. data/lib/stripe/params/issuing/credit_underwriting_record_create_from_application_params.rb +50 -0
  115. data/lib/stripe/params/issuing/credit_underwriting_record_create_from_proactive_review_params.rb +128 -0
  116. data/lib/stripe/params/issuing/credit_underwriting_record_list_params.rb +24 -0
  117. data/lib/stripe/params/issuing/credit_underwriting_record_report_decision_params.rb +86 -0
  118. data/lib/stripe/params/issuing/credit_underwriting_record_retrieve_params.rb +15 -0
  119. data/lib/stripe/params/issuing/dispute_settlement_detail_list_params.rb +33 -0
  120. data/lib/stripe/params/issuing/dispute_settlement_detail_retrieve_params.rb +15 -0
  121. data/lib/stripe/params/issuing/fraud_liability_debit_list_params.rb +44 -0
  122. data/lib/stripe/params/issuing/fraud_liability_debit_retrieve_params.rb +15 -0
  123. data/lib/stripe/params/issuing/transaction_list_params.rb +4 -0
  124. data/lib/stripe/params/mandate_list_params.rb +39 -0
  125. data/lib/stripe/params/margin_create_params.rb +25 -0
  126. data/lib/stripe/params/margin_list_params.rb +25 -0
  127. data/lib/stripe/params/margin_retrieve_params.rb +13 -0
  128. data/lib/stripe/params/margin_update_params.rb +22 -0
  129. data/lib/stripe/params/order_create_params.rb +2083 -0
  130. data/lib/stripe/params/order_list_params.rb +25 -0
  131. data/lib/stripe/params/order_retrieve_params.rb +13 -0
  132. data/lib/stripe/params/order_submit_params.rb +16 -0
  133. data/lib/stripe/params/order_update_params.rb +2087 -0
  134. data/lib/stripe/params/payment_intent_capture_params.rb +1643 -1
  135. data/lib/stripe/params/payment_intent_confirm_params.rb +3022 -87
  136. data/lib/stripe/params/payment_intent_create_params.rb +3034 -99
  137. data/lib/stripe/params/payment_intent_decrement_authorization_params.rb +297 -0
  138. data/lib/stripe/params/payment_intent_increment_authorization_params.rb +37 -0
  139. data/lib/stripe/params/payment_intent_trigger_action_params.rb +27 -0
  140. data/lib/stripe/params/payment_intent_update_params.rb +3023 -57
  141. data/lib/stripe/params/payment_link_create_params.rb +15 -0
  142. data/lib/stripe/params/payment_method_configuration_create_params.rb +105 -0
  143. data/lib/stripe/params/payment_method_configuration_update_params.rb +105 -0
  144. data/lib/stripe/params/payment_method_create_params.rb +74 -0
  145. data/lib/stripe/params/plan_create_params.rb +15 -0
  146. data/lib/stripe/params/price_create_params.rb +15 -0
  147. data/lib/stripe/params/price_update_params.rb +19 -0
  148. data/lib/stripe/params/privacy/redaction_job_cancel_params.rb +15 -0
  149. data/lib/stripe/params/privacy/redaction_job_create_params.rb +67 -0
  150. data/lib/stripe/params/privacy/redaction_job_list_params.rb +27 -0
  151. data/lib/stripe/params/privacy/redaction_job_retrieve_params.rb +15 -0
  152. data/lib/stripe/params/privacy/redaction_job_run_params.rb +15 -0
  153. data/lib/stripe/params/privacy/redaction_job_update_params.rb +18 -0
  154. data/lib/stripe/params/privacy/redaction_job_validate_params.rb +15 -0
  155. data/lib/stripe/params/privacy/redaction_job_validation_error_list_params.rb +24 -0
  156. data/lib/stripe/params/product_catalog/trial_offer_create_params.rb +63 -0
  157. data/lib/stripe/params/product_create_params.rb +16 -0
  158. data/lib/stripe/params/product_update_params.rb +16 -0
  159. data/lib/stripe/params/quote_create_params.rb +809 -3
  160. data/lib/stripe/params/quote_line_list_params.rb +22 -0
  161. data/lib/stripe/params/quote_list_lines_params.rb +22 -0
  162. data/lib/stripe/params/quote_list_params.rb +4 -0
  163. data/lib/stripe/params/quote_list_preview_invoice_lines_params.rb +22 -0
  164. data/lib/stripe/params/quote_mark_draft_params.rb +13 -0
  165. data/lib/stripe/params/quote_mark_stale_params.rb +16 -0
  166. data/lib/stripe/params/quote_preview_invoice_list_params.rb +22 -0
  167. data/lib/stripe/params/quote_preview_subscription_schedule_list_params.rb +22 -0
  168. data/lib/stripe/params/quote_reestimate_params.rb +13 -0
  169. data/lib/stripe/params/quote_update_params.rb +817 -4
  170. data/lib/stripe/params/reserve/hold_list_params.rb +53 -0
  171. data/lib/stripe/params/reserve/hold_retrieve_params.rb +15 -0
  172. data/lib/stripe/params/reserve/plan_retrieve_params.rb +15 -0
  173. data/lib/stripe/params/reserve/release_list_params.rb +41 -0
  174. data/lib/stripe/params/reserve/release_retrieve_params.rb +15 -0
  175. data/lib/stripe/params/setup_intent_confirm_params.rb +108 -3
  176. data/lib/stripe/params/setup_intent_create_params.rb +108 -3
  177. data/lib/stripe/params/setup_intent_update_params.rb +108 -3
  178. data/lib/stripe/params/shared_payment/granted_token_create_params.rb +47 -0
  179. data/lib/stripe/params/shared_payment/granted_token_retrieve_params.rb +15 -0
  180. data/lib/stripe/params/shared_payment/granted_token_revoke_params.rb +15 -0
  181. data/lib/stripe/params/shared_payment/issued_token_create_params.rb +67 -0
  182. data/lib/stripe/params/shared_payment/issued_token_retrieve_params.rb +15 -0
  183. data/lib/stripe/params/shared_payment/issued_token_revoke_params.rb +15 -0
  184. data/lib/stripe/params/subscription_create_params.rb +170 -6
  185. data/lib/stripe/params/subscription_item_create_params.rb +62 -2
  186. data/lib/stripe/params/subscription_item_update_params.rb +45 -1
  187. data/lib/stripe/params/subscription_pause_params.rb +50 -0
  188. data/lib/stripe/params/subscription_resume_params.rb +4 -0
  189. data/lib/stripe/params/subscription_schedule_amend_params.rb +578 -0
  190. data/lib/stripe/params/subscription_schedule_create_params.rb +167 -5
  191. data/lib/stripe/params/subscription_schedule_update_params.rb +167 -5
  192. data/lib/stripe/params/subscription_update_params.rb +153 -5
  193. data/lib/stripe/params/tax/calculation_create_params.rb +4 -0
  194. data/lib/stripe/params/tax/form_list_params.rb +51 -0
  195. data/lib/stripe/params/tax/form_pdf_params.rb +15 -0
  196. data/lib/stripe/params/tax/form_retrieve_params.rb +15 -0
  197. data/lib/stripe/params/tax/location_create_params.rb +54 -0
  198. data/lib/stripe/params/tax/location_list_params.rb +27 -0
  199. data/lib/stripe/params/tax/location_retrieve_params.rb +15 -0
  200. data/lib/stripe/params/tax/registration_create_params.rb +104 -0
  201. data/lib/stripe/params/terminal/configuration_create_params.rb +13 -0
  202. data/lib/stripe/params/terminal/configuration_update_params.rb +13 -0
  203. data/lib/stripe/params/terminal/reader_collected_data_retrieve_params.rb +15 -0
  204. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +78 -0
  205. data/lib/stripe/params/test_helpers/shared_payment/granted_token_create_params.rb +49 -0
  206. data/lib/stripe/params/test_helpers/shared_payment/granted_token_revoke_params.rb +17 -0
  207. data/lib/stripe/params/test_helpers/treasury/received_credit_create_params.rb +25 -1
  208. data/lib/stripe/params/test_helpers/treasury/received_debit_create_params.rb +25 -1
  209. data/lib/stripe/params/transfer_create_params.rb +4 -0
  210. data/lib/stripe/params/treasury/financial_account_create_params.rb +8 -1
  211. data/lib/stripe/params/treasury/financial_account_features_update_params.rb +4 -1
  212. data/lib/stripe/params/treasury/financial_account_update_features_params.rb +4 -1
  213. data/lib/stripe/params/treasury/financial_account_update_params.rb +8 -1
  214. data/lib/stripe/params/treasury/outbound_payment_create_params.rb +4 -0
  215. data/lib/stripe/params/treasury/outbound_transfer_create_params.rb +24 -0
  216. data/lib/stripe/params/treasury/received_credit_create_params.rb +25 -1
  217. data/lib/stripe/params/treasury/received_debit_create_params.rb +25 -1
  218. data/lib/stripe/params/v2/billing/bill_setting_create_params.rb +74 -0
  219. data/lib/stripe/params/v2/billing/bill_setting_list_params.rb +21 -0
  220. data/lib/stripe/params/v2/billing/bill_setting_retrieve_params.rb +10 -0
  221. data/lib/stripe/params/v2/billing/bill_setting_update_params.rb +80 -0
  222. data/lib/stripe/params/v2/billing/bill_settings/version_list_params.rb +19 -0
  223. data/lib/stripe/params/v2/billing/bill_settings/version_retrieve_params.rb +12 -0
  224. data/lib/stripe/params/v2/billing/cadence_cancel_params.rb +10 -0
  225. data/lib/stripe/params/v2/billing/cadence_create_params.rb +253 -0
  226. data/lib/stripe/params/v2/billing/cadence_list_params.rb +43 -0
  227. data/lib/stripe/params/v2/billing/cadence_retrieve_params.rb +17 -0
  228. data/lib/stripe/params/v2/billing/cadence_update_params.rb +75 -0
  229. data/lib/stripe/params/v2/billing/collection_setting_create_params.rb +257 -0
  230. data/lib/stripe/params/v2/billing/collection_setting_list_params.rb +21 -0
  231. data/lib/stripe/params/v2/billing/collection_setting_retrieve_params.rb +10 -0
  232. data/lib/stripe/params/v2/billing/collection_setting_update_params.rb +263 -0
  233. data/lib/stripe/params/v2/billing/collection_settings/version_list_params.rb +19 -0
  234. data/lib/stripe/params/v2/billing/collection_settings/version_retrieve_params.rb +12 -0
  235. data/lib/stripe/params/v2/billing/profile_create_params.rb +37 -0
  236. data/lib/stripe/params/v2/billing/profile_list_params.rb +40 -0
  237. data/lib/stripe/params/v2/billing/profile_retrieve_params.rb +10 -0
  238. data/lib/stripe/params/v2/billing/profile_update_params.rb +35 -0
  239. data/lib/stripe/params/v2/core/account_create_params.rb +282 -5
  240. data/lib/stripe/params/v2/core/account_token_create_params.rb +13 -1
  241. data/lib/stripe/params/v2/core/account_update_params.rb +274 -4
  242. data/lib/stripe/params/v2/core/batch_job_cancel_params.rb +10 -0
  243. data/lib/stripe/params/v2/core/batch_job_create_params.rb +58 -0
  244. data/lib/stripe/params/v2/core/batch_job_retrieve_params.rb +10 -0
  245. data/lib/stripe/params/v2/core/vault/gb_bank_account_acknowledge_confirmation_of_payee_params.rb +12 -0
  246. data/lib/stripe/params/v2/core/vault/gb_bank_account_archive_params.rb +12 -0
  247. data/lib/stripe/params/v2/core/vault/gb_bank_account_create_params.rb +58 -0
  248. data/lib/stripe/params/v2/core/vault/gb_bank_account_initiate_confirmation_of_payee_params.rb +22 -0
  249. data/lib/stripe/params/v2/core/vault/gb_bank_account_list_params.rb +19 -0
  250. data/lib/stripe/params/v2/core/vault/gb_bank_account_retrieve_params.rb +12 -0
  251. data/lib/stripe/params/v2/core/vault/us_bank_account_archive_params.rb +12 -0
  252. data/lib/stripe/params/v2/core/vault/us_bank_account_confirm_microdeposits_params.rb +22 -0
  253. data/lib/stripe/params/v2/core/vault/us_bank_account_create_params.rb +37 -0
  254. data/lib/stripe/params/v2/core/vault/us_bank_account_list_params.rb +22 -0
  255. data/lib/stripe/params/v2/core/vault/us_bank_account_retrieve_params.rb +12 -0
  256. data/lib/stripe/params/v2/core/vault/us_bank_account_send_microdeposits_params.rb +12 -0
  257. data/lib/stripe/params/v2/core/vault/us_bank_account_update_params.rb +22 -0
  258. data/lib/stripe/params/v2/data/reporting/query_run_create_params.rb +31 -0
  259. data/lib/stripe/params/v2/data/reporting/query_run_retrieve_params.rb +12 -0
  260. data/lib/stripe/params/v2/extend/workflow_invoke_params.rb +17 -0
  261. data/lib/stripe/params/v2/extend/workflow_list_params.rb +21 -0
  262. data/lib/stripe/params/v2/extend/workflow_retrieve_params.rb +10 -0
  263. data/lib/stripe/params/v2/extend/workflow_run_list_params.rb +23 -0
  264. data/lib/stripe/params/v2/extend/workflow_run_retrieve_params.rb +10 -0
  265. data/lib/stripe/params/v2/iam/activity_log_list_params.rb +23 -0
  266. data/lib/stripe/params/v2/iam/activity_log_retrieve_params.rb +10 -0
  267. data/lib/stripe/params/v2/money_management/adjustment_list_params.rb +48 -0
  268. data/lib/stripe/params/v2/money_management/adjustment_retrieve_params.rb +10 -0
  269. data/lib/stripe/params/v2/money_management/financial_account_close_params.rb +28 -0
  270. data/lib/stripe/params/v2/money_management/financial_account_create_params.rb +34 -0
  271. data/lib/stripe/params/v2/money_management/financial_account_list_params.rb +20 -0
  272. data/lib/stripe/params/v2/money_management/financial_account_retrieve_params.rb +10 -0
  273. data/lib/stripe/params/v2/money_management/financial_account_update_params.rb +20 -0
  274. data/lib/stripe/params/v2/money_management/financial_address_create_params.rb +20 -0
  275. data/lib/stripe/params/v2/money_management/financial_address_list_params.rb +23 -0
  276. data/lib/stripe/params/v2/money_management/financial_address_retrieve_params.rb +17 -0
  277. data/lib/stripe/params/v2/money_management/inbound_transfer_create_params.rb +50 -0
  278. data/lib/stripe/params/v2/money_management/inbound_transfer_list_params.rb +44 -0
  279. data/lib/stripe/params/v2/money_management/inbound_transfer_retrieve_params.rb +10 -0
  280. data/lib/stripe/params/v2/money_management/outbound_payment_cancel_params.rb +10 -0
  281. data/lib/stripe/params/v2/money_management/outbound_payment_create_params.rb +102 -0
  282. data/lib/stripe/params/v2/money_management/outbound_payment_list_params.rb +52 -0
  283. data/lib/stripe/params/v2/money_management/outbound_payment_quote_create_params.rb +67 -0
  284. data/lib/stripe/params/v2/money_management/outbound_payment_quote_retrieve_params.rb +10 -0
  285. data/lib/stripe/params/v2/money_management/outbound_payment_retrieve_params.rb +10 -0
  286. data/lib/stripe/params/v2/money_management/outbound_setup_intent_cancel_params.rb +10 -0
  287. data/lib/stripe/params/v2/money_management/outbound_setup_intent_create_params.rb +92 -0
  288. data/lib/stripe/params/v2/money_management/outbound_setup_intent_list_params.rb +17 -0
  289. data/lib/stripe/params/v2/money_management/outbound_setup_intent_retrieve_params.rb +10 -0
  290. data/lib/stripe/params/v2/money_management/outbound_setup_intent_update_params.rb +88 -0
  291. data/lib/stripe/params/v2/money_management/outbound_transfer_cancel_params.rb +10 -0
  292. data/lib/stripe/params/v2/money_management/outbound_transfer_create_params.rb +77 -0
  293. data/lib/stripe/params/v2/money_management/outbound_transfer_list_params.rb +48 -0
  294. data/lib/stripe/params/v2/money_management/outbound_transfer_retrieve_params.rb +10 -0
  295. data/lib/stripe/params/v2/money_management/payout_method_archive_params.rb +10 -0
  296. data/lib/stripe/params/v2/money_management/payout_method_list_params.rb +31 -0
  297. data/lib/stripe/params/v2/money_management/payout_method_retrieve_params.rb +10 -0
  298. data/lib/stripe/params/v2/money_management/payout_method_unarchive_params.rb +10 -0
  299. data/lib/stripe/params/v2/money_management/payout_methods_bank_account_spec_retrieve_params.rb +17 -0
  300. data/lib/stripe/params/v2/money_management/received_credit_list_params.rb +44 -0
  301. data/lib/stripe/params/v2/money_management/received_credit_retrieve_params.rb +10 -0
  302. data/lib/stripe/params/v2/money_management/received_debit_list_params.rb +17 -0
  303. data/lib/stripe/params/v2/money_management/received_debit_retrieve_params.rb +10 -0
  304. data/lib/stripe/params/v2/money_management/transaction_entry_list_params.rb +43 -0
  305. data/lib/stripe/params/v2/money_management/transaction_entry_retrieve_params.rb +10 -0
  306. data/lib/stripe/params/v2/money_management/transaction_list_params.rb +47 -0
  307. data/lib/stripe/params/v2/money_management/transaction_retrieve_params.rb +10 -0
  308. data/lib/stripe/params/v2/network/business_profile_me_params.rb +10 -0
  309. data/lib/stripe/params/v2/network/business_profile_retrieve_params.rb +10 -0
  310. data/lib/stripe/params/v2/orchestrated_commerce/agreement_confirm_params.rb +10 -0
  311. data/lib/stripe/params/v2/orchestrated_commerce/agreement_create_params.rb +17 -0
  312. data/lib/stripe/params/v2/orchestrated_commerce/agreement_list_params.rb +20 -0
  313. data/lib/stripe/params/v2/orchestrated_commerce/agreement_retrieve_params.rb +10 -0
  314. data/lib/stripe/params/v2/orchestrated_commerce/agreement_terminate_params.rb +10 -0
  315. data/lib/stripe/params/v2/test_helpers/financial_address_credit_params.rb +23 -0
  316. data/lib/stripe/params/v2/test_helpers/financial_address_generate_microdeposits_params.rb +10 -0
  317. data/lib/stripe/params.rb +426 -0
  318. data/lib/stripe/resources/account.rb +259 -1
  319. data/lib/stripe/resources/account_notice.rb +94 -0
  320. data/lib/stripe/resources/account_session.rb +81 -0
  321. data/lib/stripe/resources/balance.rb +83 -0
  322. data/lib/stripe/resources/billing/alert_triggered.rb +4 -0
  323. data/lib/stripe/resources/billing/analytics/meter_usage.rb +33 -0
  324. data/lib/stripe/resources/billing/analytics/meter_usage_row.rb +38 -0
  325. data/lib/stripe/resources/capital/financing_offer.rb +142 -0
  326. data/lib/stripe/resources/capital/financing_summary.rb +82 -0
  327. data/lib/stripe/resources/capital/financing_transaction.rb +99 -0
  328. data/lib/stripe/resources/card.rb +2 -0
  329. data/lib/stripe/resources/charge.rb +211 -1
  330. data/lib/stripe/resources/checkout/session.rb +75 -3
  331. data/lib/stripe/resources/confirmation_token.rb +131 -0
  332. data/lib/stripe/resources/coupon.rb +26 -1
  333. data/lib/stripe/resources/credit_note_line_item.rb +18 -0
  334. data/lib/stripe/resources/customer_session.rb +36 -0
  335. data/lib/stripe/resources/dispute.rb +22 -0
  336. data/lib/stripe/resources/event.rb +64 -1
  337. data/lib/stripe/resources/financial_connections/account.rb +57 -0
  338. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +35 -0
  339. data/lib/stripe/resources/financial_connections/authorization.rb +82 -0
  340. data/lib/stripe/resources/financial_connections/institution.rb +127 -0
  341. data/lib/stripe/resources/financial_connections/session.rb +125 -1
  342. data/lib/stripe/resources/fx_quote.rb +147 -0
  343. data/lib/stripe/resources/invoice.rb +117 -1
  344. data/lib/stripe/resources/invoice_item.rb +2 -0
  345. data/lib/stripe/resources/invoice_line_item.rb +40 -0
  346. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +263 -0
  347. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +71 -0
  348. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +51 -0
  349. data/lib/stripe/resources/issuing/settlement.rb +61 -0
  350. data/lib/stripe/resources/issuing/transaction.rb +2 -0
  351. data/lib/stripe/resources/line_item.rb +42 -0
  352. data/lib/stripe/resources/mandate.rb +12 -0
  353. data/lib/stripe/resources/margin.rb +64 -0
  354. data/lib/stripe/resources/order.rb +927 -0
  355. data/lib/stripe/resources/payment_attempt_record.rb +177 -1
  356. data/lib/stripe/resources/payment_intent.rb +1561 -8
  357. data/lib/stripe/resources/payment_method.rb +135 -0
  358. data/lib/stripe/resources/payment_method_configuration.rb +170 -0
  359. data/lib/stripe/resources/payment_record.rb +177 -1
  360. data/lib/stripe/resources/price.rb +20 -0
  361. data/lib/stripe/resources/privacy/redaction_job.rb +189 -0
  362. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +49 -0
  363. data/lib/stripe/resources/product.rb +18 -0
  364. data/lib/stripe/resources/product_catalog/trial_offer.rb +106 -0
  365. data/lib/stripe/resources/quote.rb +569 -2
  366. data/lib/stripe/resources/quote_line.rb +525 -0
  367. data/lib/stripe/resources/quote_preview_invoice.rb +1183 -0
  368. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +736 -0
  369. data/lib/stripe/resources/refund.rb +18 -0
  370. data/lib/stripe/resources/reserve/hold.rb +7 -0
  371. data/lib/stripe/resources/reserve/release.rb +12 -0
  372. data/lib/stripe/resources/setup_attempt.rb +35 -0
  373. data/lib/stripe/resources/setup_intent.rb +22 -1
  374. data/lib/stripe/resources/shared_payment/granted_token.rb +1792 -0
  375. data/lib/stripe/resources/shared_payment/issued_token.rb +291 -0
  376. data/lib/stripe/resources/source.rb +38 -0
  377. data/lib/stripe/resources/subscription.rb +167 -0
  378. data/lib/stripe/resources/subscription_item.rb +41 -1
  379. data/lib/stripe/resources/subscription_schedule.rb +198 -3
  380. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  381. data/lib/stripe/resources/tax/form.rb +264 -0
  382. data/lib/stripe/resources/tax/location.rb +72 -0
  383. data/lib/stripe/resources/tax/registration.rb +128 -0
  384. data/lib/stripe/resources/tax_code.rb +15 -1
  385. data/lib/stripe/resources/terminal/configuration.rb +16 -0
  386. data/lib/stripe/resources/terminal/reader.rb +8 -0
  387. data/lib/stripe/resources/terminal/reader_collected_data.rb +47 -0
  388. data/lib/stripe/resources/transfer.rb +2 -0
  389. data/lib/stripe/resources/treasury/financial_account.rb +2 -0
  390. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  391. data/lib/stripe/resources/treasury/outbound_payment.rb +2 -0
  392. data/lib/stripe/resources/treasury/outbound_transfer.rb +30 -0
  393. data/lib/stripe/resources/treasury/received_credit.rb +30 -0
  394. data/lib/stripe/resources/treasury/received_debit.rb +32 -0
  395. data/lib/stripe/resources/v2/billing/bill_setting.rb +102 -0
  396. data/lib/stripe/resources/v2/billing/bill_setting_version.rb +91 -0
  397. data/lib/stripe/resources/v2/billing/cadence.rb +710 -0
  398. data/lib/stripe/resources/v2/billing/collection_setting.rb +327 -0
  399. data/lib/stripe/resources/v2/billing/collection_setting_version.rb +316 -0
  400. data/lib/stripe/resources/v2/billing/profile.rb +47 -0
  401. data/lib/stripe/resources/v2/core/account.rb +597 -3
  402. data/lib/stripe/resources/v2/core/batch_job.rb +488 -0
  403. data/lib/stripe/resources/v2/core/event_notification.rb +1 -0
  404. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +136 -0
  405. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +105 -0
  406. data/lib/stripe/resources/v2/data/reporting/query_run.rb +142 -0
  407. data/lib/stripe/resources/v2/extend/workflow.rb +80 -0
  408. data/lib/stripe/resources/v2/extend/workflow_run.rb +158 -0
  409. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +29 -0
  410. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +31 -0
  411. data/lib/stripe/resources/v2/iam/activity_log.rb +187 -0
  412. data/lib/stripe/resources/v2/money_management/adjustment.rb +67 -0
  413. data/lib/stripe/resources/v2/money_management/financial_account.rb +140 -0
  414. data/lib/stripe/resources/v2/money_management/financial_address.rb +160 -0
  415. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +181 -0
  416. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +219 -0
  417. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +144 -0
  418. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +69 -0
  419. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +196 -0
  420. data/lib/stripe/resources/v2/money_management/payout_method.rb +145 -0
  421. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +83 -0
  422. data/lib/stripe/resources/v2/money_management/received_credit.rb +230 -0
  423. data/lib/stripe/resources/v2/money_management/received_debit.rb +136 -0
  424. data/lib/stripe/resources/v2/money_management/transaction.rb +135 -0
  425. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +105 -0
  426. data/lib/stripe/resources/v2/network/business_profile.rb +84 -0
  427. data/lib/stripe/resources/v2/orchestrated_commerce/agreement.rb +93 -0
  428. data/lib/stripe/resources.rb +417 -0
  429. data/lib/stripe/services/account_notice_service.rb +39 -0
  430. data/lib/stripe/services/account_service.rb +15 -0
  431. data/lib/stripe/services/billing/analytics/meter_usage_service.rb +21 -0
  432. data/lib/stripe/services/billing/analytics_service.rb +15 -0
  433. data/lib/stripe/services/billing_service.rb +2 -1
  434. data/lib/stripe/services/capital/financing_offer_service.rb +42 -0
  435. data/lib/stripe/services/capital/financing_summary_service.rb +19 -0
  436. data/lib/stripe/services/capital/financing_transaction_service.rb +31 -0
  437. data/lib/stripe/services/capital_service.rb +15 -0
  438. data/lib/stripe/services/coupon_service.rb +14 -0
  439. data/lib/stripe/services/customer_service.rb +15 -0
  440. data/lib/stripe/services/external_account_service.rb +68 -0
  441. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +19 -0
  442. data/lib/stripe/services/financial_connections/account_service.rb +3 -1
  443. data/lib/stripe/services/financial_connections/authorization_service.rb +19 -0
  444. data/lib/stripe/services/financial_connections/institution_service.rb +30 -0
  445. data/lib/stripe/services/financial_connections_service.rb +3 -1
  446. data/lib/stripe/services/fx_quote_service.rb +27 -0
  447. data/lib/stripe/services/invoice_service.rb +11 -0
  448. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +74 -0
  449. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +30 -0
  450. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +30 -0
  451. data/lib/stripe/services/issuing_service.rb +5 -1
  452. data/lib/stripe/services/mandate_service.rb +5 -0
  453. data/lib/stripe/services/margin_service.rb +50 -0
  454. data/lib/stripe/services/order_service.rb +53 -0
  455. data/lib/stripe/services/payment_intent_service.rb +37 -0
  456. data/lib/stripe/services/privacy/redaction_job_service.rb +104 -0
  457. data/lib/stripe/services/privacy/redaction_job_validation_error_service.rb +19 -0
  458. data/lib/stripe/services/privacy_service.rb +13 -0
  459. data/lib/stripe/services/product_catalog/trial_offer_service.rb +19 -0
  460. data/lib/stripe/services/product_catalog_service.rb +13 -0
  461. data/lib/stripe/services/promotion_code_service.rb +29 -0
  462. data/lib/stripe/services/quote_line_service.rb +17 -0
  463. data/lib/stripe/services/quote_preview_invoice_service.rb +17 -0
  464. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +17 -0
  465. data/lib/stripe/services/quote_service.rb +49 -1
  466. data/lib/stripe/services/reserve/hold_service.rb +30 -0
  467. data/lib/stripe/services/reserve/plan_service.rb +19 -0
  468. data/lib/stripe/services/reserve/release_service.rb +30 -0
  469. data/lib/stripe/services/reserve_service.rb +15 -0
  470. data/lib/stripe/services/shared_payment/granted_token_service.rb +19 -0
  471. data/lib/stripe/services/shared_payment/issued_token_service.rb +41 -0
  472. data/lib/stripe/services/shared_payment_service.rb +14 -0
  473. data/lib/stripe/services/subscription_schedule_service.rb +11 -0
  474. data/lib/stripe/services/subscription_service.rb +56 -0
  475. data/lib/stripe/services/tax/form_service.rb +37 -0
  476. data/lib/stripe/services/tax/location_service.rb +45 -0
  477. data/lib/stripe/services/tax_service.rb +3 -1
  478. data/lib/stripe/services/terminal/reader_collected_data_service.rb +19 -0
  479. data/lib/stripe/services/terminal_service.rb +2 -1
  480. data/lib/stripe/services/test_helpers/shared_payment/granted_token_service.rb +32 -0
  481. data/lib/stripe/services/test_helpers/shared_payment_service.rb +15 -0
  482. data/lib/stripe/services/test_helpers_service.rb +2 -1
  483. data/lib/stripe/services/v1_services.rb +11 -1
  484. data/lib/stripe/services/v2/billing/bill_setting_service.rb +61 -0
  485. data/lib/stripe/services/v2/billing/bill_settings/version_service.rb +34 -0
  486. data/lib/stripe/services/v2/billing/cadence_service.rb +65 -0
  487. data/lib/stripe/services/v2/billing/collection_setting_service.rb +69 -0
  488. data/lib/stripe/services/v2/billing/collection_settings/version_service.rb +34 -0
  489. data/lib/stripe/services/v2/billing/profile_service.rb +54 -0
  490. data/lib/stripe/services/v2/billing_service.rb +5 -1
  491. data/lib/stripe/services/v2/core/batch_job_service.rb +43 -0
  492. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +85 -0
  493. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +101 -0
  494. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  495. data/lib/stripe/services/v2/core_service.rb +3 -1
  496. data/lib/stripe/services/v2/data/reporting/query_run_service.rb +35 -0
  497. data/lib/stripe/services/v2/data/reporting_service.rb +17 -0
  498. data/lib/stripe/services/v2/data_service.rb +15 -0
  499. data/lib/stripe/services/v2/extend/workflow_run_service.rb +32 -0
  500. data/lib/stripe/services/v2/extend/workflow_service.rb +45 -0
  501. data/lib/stripe/services/v2/extend_service.rb +16 -0
  502. data/lib/stripe/services/v2/iam/activity_log_service.rb +32 -0
  503. data/lib/stripe/services/v2/iam_service.rb +15 -0
  504. data/lib/stripe/services/v2/money_management/adjustment_service.rb +32 -0
  505. data/lib/stripe/services/v2/money_management/financial_account_service.rb +70 -0
  506. data/lib/stripe/services/v2/money_management/financial_address_service.rb +46 -0
  507. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +45 -0
  508. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +34 -0
  509. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +62 -0
  510. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +75 -0
  511. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +60 -0
  512. data/lib/stripe/services/v2/money_management/payout_method_service.rb +66 -0
  513. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +23 -0
  514. data/lib/stripe/services/v2/money_management/received_credit_service.rb +32 -0
  515. data/lib/stripe/services/v2/money_management/received_debit_service.rb +32 -0
  516. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +32 -0
  517. data/lib/stripe/services/v2/money_management/transaction_service.rb +32 -0
  518. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  519. data/lib/stripe/services/v2/network/business_profile_service.rb +32 -0
  520. data/lib/stripe/services/v2/network_service.rb +15 -0
  521. data/lib/stripe/services/v2/orchestrated_commerce/agreement_service.rb +65 -0
  522. data/lib/stripe/services/v2/orchestrated_commerce_service.rb +15 -0
  523. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  524. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +36 -0
  525. data/lib/stripe/services/v2_services.rb +8 -1
  526. data/lib/stripe/services.rb +209 -0
  527. data/lib/stripe/stripe_client.rb +8 -1
  528. data/lib/stripe/stripe_configuration.rb +3 -1
  529. data/lib/stripe/stripe_event_notification_handler.rb +582 -0
  530. data/lib/stripe/stripe_object.rb +1 -1
  531. data/lib/stripe/util.rb +7 -1
  532. data/lib/stripe/version.rb +1 -1
  533. data/lib/stripe.rb +54 -0
  534. data/rbi/stripe/resources/v2/core/event_notification.rbi +3 -0
  535. data/rbi/stripe/stripe_client.rbi +13 -0
  536. data/rbi/stripe.rbi +124159 -57389
  537. metadata +378 -3
@@ -144,32 +144,88 @@ module Stripe
144
144
  end
145
145
 
146
146
  class Discount < ::Stripe::RequestParams
147
+ class DiscountEnd < ::Stripe::RequestParams
148
+ class Duration < ::Stripe::RequestParams
149
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
150
+ attr_accessor :interval
151
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
152
+ attr_accessor :interval_count
153
+
154
+ def initialize(interval: nil, interval_count: nil)
155
+ @interval = interval
156
+ @interval_count = interval_count
157
+ end
158
+ end
159
+ # Time span for the redeemed discount.
160
+ attr_accessor :duration
161
+ # A precise Unix timestamp for the discount to end. Must be in the future.
162
+ attr_accessor :timestamp
163
+ # The type of calculation made to determine when the discount ends.
164
+ attr_accessor :type
165
+
166
+ def initialize(duration: nil, timestamp: nil, type: nil)
167
+ @duration = duration
168
+ @timestamp = timestamp
169
+ @type = type
170
+ end
171
+ end
147
172
  # ID of the coupon to create a new discount for.
148
173
  attr_accessor :coupon
149
174
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
150
175
  attr_accessor :discount
176
+ # Details to determine how long the discount should be applied for.
177
+ attr_accessor :discount_end
151
178
  # ID of the promotion code to create a new discount for.
152
179
  attr_accessor :promotion_code
153
180
 
154
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
181
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
155
182
  @coupon = coupon
156
183
  @discount = discount
184
+ @discount_end = discount_end
157
185
  @promotion_code = promotion_code
158
186
  end
159
187
  end
160
188
 
161
189
  class InvoiceItem < ::Stripe::RequestParams
162
190
  class Discount < ::Stripe::RequestParams
191
+ class DiscountEnd < ::Stripe::RequestParams
192
+ class Duration < ::Stripe::RequestParams
193
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
194
+ attr_accessor :interval
195
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
196
+ attr_accessor :interval_count
197
+
198
+ def initialize(interval: nil, interval_count: nil)
199
+ @interval = interval
200
+ @interval_count = interval_count
201
+ end
202
+ end
203
+ # Time span for the redeemed discount.
204
+ attr_accessor :duration
205
+ # A precise Unix timestamp for the discount to end. Must be in the future.
206
+ attr_accessor :timestamp
207
+ # The type of calculation made to determine when the discount ends.
208
+ attr_accessor :type
209
+
210
+ def initialize(duration: nil, timestamp: nil, type: nil)
211
+ @duration = duration
212
+ @timestamp = timestamp
213
+ @type = type
214
+ end
215
+ end
163
216
  # ID of the coupon to create a new discount for.
164
217
  attr_accessor :coupon
165
218
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
166
219
  attr_accessor :discount
220
+ # Details to determine how long the discount should be applied for.
221
+ attr_accessor :discount_end
167
222
  # ID of the promotion code to create a new discount for.
168
223
  attr_accessor :promotion_code
169
224
 
170
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
225
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
171
226
  @coupon = coupon
172
227
  @discount = discount
228
+ @discount_end = discount_end
173
229
  @promotion_code = promotion_code
174
230
  end
175
231
  end
@@ -311,6 +367,466 @@ module Stripe
311
367
  end
312
368
 
313
369
  class ScheduleDetails < ::Stripe::RequestParams
370
+ class Amendment < ::Stripe::RequestParams
371
+ class AmendmentEnd < ::Stripe::RequestParams
372
+ class DiscountEnd < ::Stripe::RequestParams
373
+ # The ID of a specific discount.
374
+ attr_accessor :discount
375
+
376
+ def initialize(discount: nil)
377
+ @discount = discount
378
+ end
379
+ end
380
+
381
+ class Duration < ::Stripe::RequestParams
382
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
383
+ attr_accessor :interval
384
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
385
+ attr_accessor :interval_count
386
+
387
+ def initialize(interval: nil, interval_count: nil)
388
+ @interval = interval
389
+ @interval_count = interval_count
390
+ end
391
+ end
392
+ # Use the `end` time of a given discount.
393
+ attr_accessor :discount_end
394
+ # Time span for the amendment starting from the `amendment_start`.
395
+ attr_accessor :duration
396
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
397
+ attr_accessor :timestamp
398
+ # Select one of three ways to pass the `amendment_end`.
399
+ attr_accessor :type
400
+
401
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
402
+ @discount_end = discount_end
403
+ @duration = duration
404
+ @timestamp = timestamp
405
+ @type = type
406
+ end
407
+ end
408
+
409
+ class AmendmentStart < ::Stripe::RequestParams
410
+ class AmendmentEnd < ::Stripe::RequestParams
411
+ # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
412
+ attr_accessor :index
413
+
414
+ def initialize(index: nil)
415
+ @index = index
416
+ end
417
+ end
418
+
419
+ class DiscountEnd < ::Stripe::RequestParams
420
+ # The ID of a specific discount.
421
+ attr_accessor :discount
422
+
423
+ def initialize(discount: nil)
424
+ @discount = discount
425
+ end
426
+ end
427
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
428
+ attr_accessor :amendment_end
429
+ # Use the `end` time of a given discount.
430
+ attr_accessor :discount_end
431
+ # A precise Unix timestamp for the amendment to start.
432
+ attr_accessor :timestamp
433
+ # Select one of three ways to pass the `amendment_start`.
434
+ attr_accessor :type
435
+
436
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
437
+ @amendment_end = amendment_end
438
+ @discount_end = discount_end
439
+ @timestamp = timestamp
440
+ @type = type
441
+ end
442
+ end
443
+
444
+ class DiscountAction < ::Stripe::RequestParams
445
+ class Add < ::Stripe::RequestParams
446
+ class DiscountEnd < ::Stripe::RequestParams
447
+ # The type of calculation made to determine when the discount ends.
448
+ attr_accessor :type
449
+
450
+ def initialize(type: nil)
451
+ @type = type
452
+ end
453
+ end
454
+ # The coupon code to redeem.
455
+ attr_accessor :coupon
456
+ # An ID of an existing discount for a coupon that was already redeemed.
457
+ attr_accessor :discount
458
+ # Details to determine how long the discount should be applied for.
459
+ attr_accessor :discount_end
460
+ # 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.
461
+ attr_accessor :index
462
+ # The promotion code to redeem.
463
+ attr_accessor :promotion_code
464
+
465
+ def initialize(
466
+ coupon: nil,
467
+ discount: nil,
468
+ discount_end: nil,
469
+ index: nil,
470
+ promotion_code: nil
471
+ )
472
+ @coupon = coupon
473
+ @discount = discount
474
+ @discount_end = discount_end
475
+ @index = index
476
+ @promotion_code = promotion_code
477
+ end
478
+ end
479
+
480
+ class Remove < ::Stripe::RequestParams
481
+ # The coupon code to remove from the `discounts` array.
482
+ attr_accessor :coupon
483
+ # The ID of a discount to remove from the `discounts` array.
484
+ attr_accessor :discount
485
+ # The ID of a promotion code to remove from the `discounts` array.
486
+ attr_accessor :promotion_code
487
+
488
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
489
+ @coupon = coupon
490
+ @discount = discount
491
+ @promotion_code = promotion_code
492
+ end
493
+ end
494
+
495
+ class Set < ::Stripe::RequestParams
496
+ # The coupon code to replace the `discounts` array with.
497
+ attr_accessor :coupon
498
+ # An ID of an existing discount to replace the `discounts` array with.
499
+ attr_accessor :discount
500
+ # An ID of an existing promotion code to replace the `discounts` array with.
501
+ attr_accessor :promotion_code
502
+
503
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
504
+ @coupon = coupon
505
+ @discount = discount
506
+ @promotion_code = promotion_code
507
+ end
508
+ end
509
+ # Details of the discount to add.
510
+ attr_accessor :add
511
+ # Details of the discount to remove.
512
+ attr_accessor :remove
513
+ # Details of the discount to replace the existing discounts with.
514
+ attr_accessor :set
515
+ # Determines the type of discount action.
516
+ attr_accessor :type
517
+
518
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
519
+ @add = add
520
+ @remove = remove
521
+ @set = set
522
+ @type = type
523
+ end
524
+ end
525
+
526
+ class ItemAction < ::Stripe::RequestParams
527
+ class Add < ::Stripe::RequestParams
528
+ class Discount < ::Stripe::RequestParams
529
+ class DiscountEnd < ::Stripe::RequestParams
530
+ class Duration < ::Stripe::RequestParams
531
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
532
+ attr_accessor :interval
533
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
534
+ attr_accessor :interval_count
535
+
536
+ def initialize(interval: nil, interval_count: nil)
537
+ @interval = interval
538
+ @interval_count = interval_count
539
+ end
540
+ end
541
+ # Time span for the redeemed discount.
542
+ attr_accessor :duration
543
+ # A precise Unix timestamp for the discount to end. Must be in the future.
544
+ attr_accessor :timestamp
545
+ # The type of calculation made to determine when the discount ends.
546
+ attr_accessor :type
547
+
548
+ def initialize(duration: nil, timestamp: nil, type: nil)
549
+ @duration = duration
550
+ @timestamp = timestamp
551
+ @type = type
552
+ end
553
+ end
554
+ # ID of the coupon to create a new discount for.
555
+ attr_accessor :coupon
556
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
557
+ attr_accessor :discount
558
+ # Details to determine how long the discount should be applied for.
559
+ attr_accessor :discount_end
560
+ # ID of the promotion code to create a new discount for.
561
+ attr_accessor :promotion_code
562
+
563
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
564
+ @coupon = coupon
565
+ @discount = discount
566
+ @discount_end = discount_end
567
+ @promotion_code = promotion_code
568
+ end
569
+ end
570
+
571
+ class Trial < ::Stripe::RequestParams
572
+ # 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.
573
+ attr_accessor :converts_to
574
+ # Determines the type of trial for this item.
575
+ attr_accessor :type
576
+
577
+ def initialize(converts_to: nil, type: nil)
578
+ @converts_to = converts_to
579
+ @type = type
580
+ end
581
+ end
582
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
583
+ attr_accessor :discounts
584
+ # Set of [key-value pairs](https://docs.stripe.com/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`.
585
+ attr_accessor :metadata
586
+ # The ID of the price object.
587
+ attr_accessor :price
588
+ # Quantity for this item.
589
+ attr_accessor :quantity
590
+ # 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`.
591
+ attr_accessor :tax_rates
592
+ # Options that configure the trial on the subscription item.
593
+ attr_accessor :trial
594
+ # The ID of the trial offer to apply to the configuration item.
595
+ attr_accessor :trial_offer
596
+
597
+ def initialize(
598
+ discounts: nil,
599
+ metadata: nil,
600
+ price: nil,
601
+ quantity: nil,
602
+ tax_rates: nil,
603
+ trial: nil,
604
+ trial_offer: nil
605
+ )
606
+ @discounts = discounts
607
+ @metadata = metadata
608
+ @price = price
609
+ @quantity = quantity
610
+ @tax_rates = tax_rates
611
+ @trial = trial
612
+ @trial_offer = trial_offer
613
+ end
614
+ end
615
+
616
+ class Remove < ::Stripe::RequestParams
617
+ # ID of a price to remove.
618
+ attr_accessor :price
619
+
620
+ def initialize(price: nil)
621
+ @price = price
622
+ end
623
+ end
624
+
625
+ class Set < ::Stripe::RequestParams
626
+ class Discount < ::Stripe::RequestParams
627
+ class DiscountEnd < ::Stripe::RequestParams
628
+ class Duration < ::Stripe::RequestParams
629
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
630
+ attr_accessor :interval
631
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
632
+ attr_accessor :interval_count
633
+
634
+ def initialize(interval: nil, interval_count: nil)
635
+ @interval = interval
636
+ @interval_count = interval_count
637
+ end
638
+ end
639
+ # Time span for the redeemed discount.
640
+ attr_accessor :duration
641
+ # A precise Unix timestamp for the discount to end. Must be in the future.
642
+ attr_accessor :timestamp
643
+ # The type of calculation made to determine when the discount ends.
644
+ attr_accessor :type
645
+
646
+ def initialize(duration: nil, timestamp: nil, type: nil)
647
+ @duration = duration
648
+ @timestamp = timestamp
649
+ @type = type
650
+ end
651
+ end
652
+ # ID of the coupon to create a new discount for.
653
+ attr_accessor :coupon
654
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
655
+ attr_accessor :discount
656
+ # Details to determine how long the discount should be applied for.
657
+ attr_accessor :discount_end
658
+ # ID of the promotion code to create a new discount for.
659
+ attr_accessor :promotion_code
660
+
661
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
662
+ @coupon = coupon
663
+ @discount = discount
664
+ @discount_end = discount_end
665
+ @promotion_code = promotion_code
666
+ end
667
+ end
668
+
669
+ class Trial < ::Stripe::RequestParams
670
+ # 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.
671
+ attr_accessor :converts_to
672
+ # Determines the type of trial for this item.
673
+ attr_accessor :type
674
+
675
+ def initialize(converts_to: nil, type: nil)
676
+ @converts_to = converts_to
677
+ @type = type
678
+ end
679
+ end
680
+ # 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`.
681
+ attr_accessor :discounts
682
+ # 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`.
683
+ attr_accessor :metadata
684
+ # The ID of the price object.
685
+ attr_accessor :price
686
+ # 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`.
687
+ attr_accessor :quantity
688
+ # 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`.
689
+ attr_accessor :tax_rates
690
+ # 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`.
691
+ attr_accessor :trial
692
+ # The ID of the trial offer to apply to the configuration item.
693
+ attr_accessor :trial_offer
694
+
695
+ def initialize(
696
+ discounts: nil,
697
+ metadata: nil,
698
+ price: nil,
699
+ quantity: nil,
700
+ tax_rates: nil,
701
+ trial: nil,
702
+ trial_offer: nil
703
+ )
704
+ @discounts = discounts
705
+ @metadata = metadata
706
+ @price = price
707
+ @quantity = quantity
708
+ @tax_rates = tax_rates
709
+ @trial = trial
710
+ @trial_offer = trial_offer
711
+ end
712
+ end
713
+ # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
714
+ attr_accessor :add
715
+ # Details of the subscription item to remove.
716
+ attr_accessor :remove
717
+ # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
718
+ attr_accessor :set
719
+ # Determines the type of item action.
720
+ attr_accessor :type
721
+
722
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
723
+ @add = add
724
+ @remove = remove
725
+ @set = set
726
+ @type = type
727
+ end
728
+ end
729
+
730
+ class MetadataAction < ::Stripe::RequestParams
731
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
732
+ attr_accessor :add
733
+ # Keys to remove from schedule phase metadata.
734
+ attr_accessor :remove
735
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
736
+ attr_accessor :set
737
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
738
+ attr_accessor :type
739
+
740
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
741
+ @add = add
742
+ @remove = remove
743
+ @set = set
744
+ @type = type
745
+ end
746
+ end
747
+
748
+ class SetPauseCollection < ::Stripe::RequestParams
749
+ class Set < ::Stripe::RequestParams
750
+ # The payment collection behavior for this subscription while paused.
751
+ attr_accessor :behavior
752
+
753
+ def initialize(behavior: nil)
754
+ @behavior = behavior
755
+ end
756
+ end
757
+ # Details of the pause_collection behavior to apply to the amendment.
758
+ attr_accessor :set
759
+ # Determines the type of the pause_collection amendment.
760
+ attr_accessor :type
761
+
762
+ def initialize(set: nil, type: nil)
763
+ @set = set
764
+ @type = type
765
+ end
766
+ end
767
+
768
+ class TrialSettings < ::Stripe::RequestParams
769
+ class EndBehavior < ::Stripe::RequestParams
770
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
771
+ attr_accessor :prorate_up_front
772
+
773
+ def initialize(prorate_up_front: nil)
774
+ @prorate_up_front = prorate_up_front
775
+ end
776
+ end
777
+ # Defines how the subscription should behave when a trial ends.
778
+ attr_accessor :end_behavior
779
+
780
+ def initialize(end_behavior: nil)
781
+ @end_behavior = end_behavior
782
+ end
783
+ end
784
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
785
+ attr_accessor :amendment_end
786
+ # Details to identify the earliest timestamp where the proposed change should take effect.
787
+ attr_accessor :amendment_start
788
+ # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
789
+ attr_accessor :billing_cycle_anchor
790
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
791
+ attr_accessor :discount_actions
792
+ # Changes to the subscription items during the amendment time span.
793
+ attr_accessor :item_actions
794
+ # Instructions for how to modify phase metadata
795
+ attr_accessor :metadata_actions
796
+ # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
797
+ attr_accessor :proration_behavior
798
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
799
+ attr_accessor :set_pause_collection
800
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
801
+ attr_accessor :set_schedule_end
802
+ # Settings related to subscription trials.
803
+ attr_accessor :trial_settings
804
+
805
+ def initialize(
806
+ amendment_end: nil,
807
+ amendment_start: nil,
808
+ billing_cycle_anchor: nil,
809
+ discount_actions: nil,
810
+ item_actions: nil,
811
+ metadata_actions: nil,
812
+ proration_behavior: nil,
813
+ set_pause_collection: nil,
814
+ set_schedule_end: nil,
815
+ trial_settings: nil
816
+ )
817
+ @amendment_end = amendment_end
818
+ @amendment_start = amendment_start
819
+ @billing_cycle_anchor = billing_cycle_anchor
820
+ @discount_actions = discount_actions
821
+ @item_actions = item_actions
822
+ @metadata_actions = metadata_actions
823
+ @proration_behavior = proration_behavior
824
+ @set_pause_collection = set_pause_collection
825
+ @set_schedule_end = set_schedule_end
826
+ @trial_settings = trial_settings
827
+ end
828
+ end
829
+
314
830
  class BillingMode < ::Stripe::RequestParams
315
831
  class Flexible < ::Stripe::RequestParams
316
832
  # Controls how invoices and invoice items display proration amounts and discount amounts.
@@ -334,16 +850,44 @@ module Stripe
334
850
  class Phase < ::Stripe::RequestParams
335
851
  class AddInvoiceItem < ::Stripe::RequestParams
336
852
  class Discount < ::Stripe::RequestParams
853
+ class DiscountEnd < ::Stripe::RequestParams
854
+ class Duration < ::Stripe::RequestParams
855
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
856
+ attr_accessor :interval
857
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
858
+ attr_accessor :interval_count
859
+
860
+ def initialize(interval: nil, interval_count: nil)
861
+ @interval = interval
862
+ @interval_count = interval_count
863
+ end
864
+ end
865
+ # Time span for the redeemed discount.
866
+ attr_accessor :duration
867
+ # A precise Unix timestamp for the discount to end. Must be in the future.
868
+ attr_accessor :timestamp
869
+ # The type of calculation made to determine when the discount ends.
870
+ attr_accessor :type
871
+
872
+ def initialize(duration: nil, timestamp: nil, type: nil)
873
+ @duration = duration
874
+ @timestamp = timestamp
875
+ @type = type
876
+ end
877
+ end
337
878
  # ID of the coupon to create a new discount for.
338
879
  attr_accessor :coupon
339
880
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
340
881
  attr_accessor :discount
882
+ # Details to determine how long the discount should be applied for.
883
+ attr_accessor :discount_end
341
884
  # ID of the promotion code to create a new discount for.
342
885
  attr_accessor :promotion_code
343
886
 
344
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
887
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
345
888
  @coupon = coupon
346
889
  @discount = discount
890
+ @discount_end = discount_end
347
891
  @promotion_code = promotion_code
348
892
  end
349
893
  end
@@ -493,16 +1037,44 @@ module Stripe
493
1037
  end
494
1038
 
495
1039
  class Discount < ::Stripe::RequestParams
1040
+ class DiscountEnd < ::Stripe::RequestParams
1041
+ class Duration < ::Stripe::RequestParams
1042
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1043
+ attr_accessor :interval
1044
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1045
+ attr_accessor :interval_count
1046
+
1047
+ def initialize(interval: nil, interval_count: nil)
1048
+ @interval = interval
1049
+ @interval_count = interval_count
1050
+ end
1051
+ end
1052
+ # Time span for the redeemed discount.
1053
+ attr_accessor :duration
1054
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1055
+ attr_accessor :timestamp
1056
+ # The type of calculation made to determine when the discount ends.
1057
+ attr_accessor :type
1058
+
1059
+ def initialize(duration: nil, timestamp: nil, type: nil)
1060
+ @duration = duration
1061
+ @timestamp = timestamp
1062
+ @type = type
1063
+ end
1064
+ end
496
1065
  # ID of the coupon to create a new discount for.
497
1066
  attr_accessor :coupon
498
1067
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
499
1068
  attr_accessor :discount
1069
+ # Details to determine how long the discount should be applied for.
1070
+ attr_accessor :discount_end
500
1071
  # ID of the promotion code to create a new discount for.
501
1072
  attr_accessor :promotion_code
502
1073
 
503
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1074
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
504
1075
  @coupon = coupon
505
1076
  @discount = discount
1077
+ @discount_end = discount_end
506
1078
  @promotion_code = promotion_code
507
1079
  end
508
1080
  end
@@ -556,16 +1128,44 @@ module Stripe
556
1128
  end
557
1129
 
558
1130
  class Discount < ::Stripe::RequestParams
1131
+ class DiscountEnd < ::Stripe::RequestParams
1132
+ class Duration < ::Stripe::RequestParams
1133
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1134
+ attr_accessor :interval
1135
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1136
+ attr_accessor :interval_count
1137
+
1138
+ def initialize(interval: nil, interval_count: nil)
1139
+ @interval = interval
1140
+ @interval_count = interval_count
1141
+ end
1142
+ end
1143
+ # Time span for the redeemed discount.
1144
+ attr_accessor :duration
1145
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1146
+ attr_accessor :timestamp
1147
+ # The type of calculation made to determine when the discount ends.
1148
+ attr_accessor :type
1149
+
1150
+ def initialize(duration: nil, timestamp: nil, type: nil)
1151
+ @duration = duration
1152
+ @timestamp = timestamp
1153
+ @type = type
1154
+ end
1155
+ end
559
1156
  # ID of the coupon to create a new discount for.
560
1157
  attr_accessor :coupon
561
1158
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
562
1159
  attr_accessor :discount
1160
+ # Details to determine how long the discount should be applied for.
1161
+ attr_accessor :discount_end
563
1162
  # ID of the promotion code to create a new discount for.
564
1163
  attr_accessor :promotion_code
565
1164
 
566
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1165
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
567
1166
  @coupon = coupon
568
1167
  @discount = discount
1168
+ @discount_end = discount_end
569
1169
  @promotion_code = promotion_code
570
1170
  end
571
1171
  end
@@ -615,6 +1215,18 @@ module Stripe
615
1215
  @field_encodings = { unit_amount_decimal: :decimal_string }
616
1216
  end
617
1217
  end
1218
+
1219
+ class Trial < ::Stripe::RequestParams
1220
+ # 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.
1221
+ attr_accessor :converts_to
1222
+ # Determines the type of trial for this item.
1223
+ attr_accessor :type
1224
+
1225
+ def initialize(converts_to: nil, type: nil)
1226
+ @converts_to = converts_to
1227
+ @type = type
1228
+ end
1229
+ end
618
1230
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
619
1231
  attr_accessor :billing_thresholds
620
1232
  # The coupons to redeem into discounts for the subscription item.
@@ -631,6 +1243,10 @@ module Stripe
631
1243
  attr_accessor :quantity
632
1244
  # A list of [Tax Rate](https://docs.stripe.com/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://docs.stripe.com/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
633
1245
  attr_accessor :tax_rates
1246
+ # Options that configure the trial on the subscription item.
1247
+ attr_accessor :trial
1248
+ # The ID of the trial offer to apply to the configuration item.
1249
+ attr_accessor :trial_offer
634
1250
 
635
1251
  def initialize(
636
1252
  billing_thresholds: nil,
@@ -640,7 +1256,9 @@ module Stripe
640
1256
  price: nil,
641
1257
  price_data: nil,
642
1258
  quantity: nil,
643
- tax_rates: nil
1259
+ tax_rates: nil,
1260
+ trial: nil,
1261
+ trial_offer: nil
644
1262
  )
645
1263
  @billing_thresholds = billing_thresholds
646
1264
  @discounts = discounts
@@ -650,6 +1268,8 @@ module Stripe
650
1268
  @price_data = price_data
651
1269
  @quantity = quantity
652
1270
  @tax_rates = tax_rates
1271
+ @trial = trial
1272
+ @trial_offer = trial_offer
653
1273
  end
654
1274
 
655
1275
  def self.field_encodings
@@ -659,6 +1279,15 @@ module Stripe
659
1279
  end
660
1280
  end
661
1281
 
1282
+ class PauseCollection < ::Stripe::RequestParams
1283
+ # The payment collection behavior for this subscription while paused.
1284
+ attr_accessor :behavior
1285
+
1286
+ def initialize(behavior: nil)
1287
+ @behavior = behavior
1288
+ end
1289
+ end
1290
+
662
1291
  class TransferData < ::Stripe::RequestParams
663
1292
  # 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 destination account. By default, the entire amount is transferred to the destination.
664
1293
  attr_accessor :amount_percent
@@ -670,6 +1299,23 @@ module Stripe
670
1299
  @destination = destination
671
1300
  end
672
1301
  end
1302
+
1303
+ class TrialSettings < ::Stripe::RequestParams
1304
+ class EndBehavior < ::Stripe::RequestParams
1305
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1306
+ attr_accessor :prorate_up_front
1307
+
1308
+ def initialize(prorate_up_front: nil)
1309
+ @prorate_up_front = prorate_up_front
1310
+ end
1311
+ end
1312
+ # Defines how the subscription should behave when a trial ends.
1313
+ attr_accessor :end_behavior
1314
+
1315
+ def initialize(end_behavior: nil)
1316
+ @end_behavior = end_behavior
1317
+ end
1318
+ end
673
1319
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
674
1320
  attr_accessor :add_invoice_items
675
1321
  # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
@@ -704,6 +1350,8 @@ module Stripe
704
1350
  attr_accessor :metadata
705
1351
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
706
1352
  attr_accessor :on_behalf_of
1353
+ # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment).
1354
+ attr_accessor :pause_collection
707
1355
  # Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
708
1356
  attr_accessor :proration_behavior
709
1357
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -712,8 +1360,12 @@ module Stripe
712
1360
  attr_accessor :transfer_data
713
1361
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
714
1362
  attr_accessor :trial
1363
+ # Specify trial behavior when crossing phase boundaries
1364
+ attr_accessor :trial_continuation
715
1365
  # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
716
1366
  attr_accessor :trial_end
1367
+ # Settings related to subscription trials.
1368
+ attr_accessor :trial_settings
717
1369
 
718
1370
  def initialize(
719
1371
  add_invoice_items: nil,
@@ -733,11 +1385,14 @@ module Stripe
733
1385
  items: nil,
734
1386
  metadata: nil,
735
1387
  on_behalf_of: nil,
1388
+ pause_collection: nil,
736
1389
  proration_behavior: nil,
737
1390
  start_date: nil,
738
1391
  transfer_data: nil,
739
1392
  trial: nil,
740
- trial_end: nil
1393
+ trial_continuation: nil,
1394
+ trial_end: nil,
1395
+ trial_settings: nil
741
1396
  )
742
1397
  @add_invoice_items = add_invoice_items
743
1398
  @application_fee_percent = application_fee_percent
@@ -756,11 +1411,14 @@ module Stripe
756
1411
  @items = items
757
1412
  @metadata = metadata
758
1413
  @on_behalf_of = on_behalf_of
1414
+ @pause_collection = pause_collection
759
1415
  @proration_behavior = proration_behavior
760
1416
  @start_date = start_date
761
1417
  @transfer_data = transfer_data
762
1418
  @trial = trial
1419
+ @trial_continuation = trial_continuation
763
1420
  @trial_end = trial_end
1421
+ @trial_settings = trial_settings
764
1422
  end
765
1423
 
766
1424
  def self.field_encodings
@@ -786,19 +1444,85 @@ module Stripe
786
1444
  }
787
1445
  end
788
1446
  end
1447
+
1448
+ class Prebilling < ::Stripe::RequestParams
1449
+ class BillUntil < ::Stripe::RequestParams
1450
+ class AmendmentEnd < ::Stripe::RequestParams
1451
+ # The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
1452
+ attr_accessor :index
1453
+
1454
+ def initialize(index: nil)
1455
+ @index = index
1456
+ end
1457
+ end
1458
+
1459
+ class Duration < ::Stripe::RequestParams
1460
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1461
+ attr_accessor :interval
1462
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1463
+ attr_accessor :interval_count
1464
+
1465
+ def initialize(interval: nil, interval_count: nil)
1466
+ @interval = interval
1467
+ @interval_count = interval_count
1468
+ end
1469
+ end
1470
+ # End the prebilled period when a specified amendment ends.
1471
+ attr_accessor :amendment_end
1472
+ # Time span for prebilling, starting from `bill_from`.
1473
+ attr_accessor :duration
1474
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1475
+ attr_accessor :timestamp
1476
+ # Select one of several ways to pass the `bill_until` value.
1477
+ attr_accessor :type
1478
+
1479
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
1480
+ @amendment_end = amendment_end
1481
+ @duration = duration
1482
+ @timestamp = timestamp
1483
+ @type = type
1484
+ end
1485
+ end
1486
+ # The end of the prebilled time period.
1487
+ attr_accessor :bill_until
1488
+ # This is used to determine the number of billing cycles to prebill.
1489
+ attr_accessor :iterations
1490
+
1491
+ def initialize(bill_until: nil, iterations: nil)
1492
+ @bill_until = bill_until
1493
+ @iterations = iterations
1494
+ end
1495
+ end
1496
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
1497
+ attr_accessor :amendments
1498
+ # 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.
1499
+ attr_accessor :billing_behavior
789
1500
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
790
1501
  attr_accessor :billing_mode
791
1502
  # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
792
1503
  attr_accessor :end_behavior
793
1504
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
794
1505
  attr_accessor :phases
1506
+ # Provide any time periods to bill in advance.
1507
+ attr_accessor :prebilling
795
1508
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
796
1509
  attr_accessor :proration_behavior
797
1510
 
798
- def initialize(billing_mode: nil, end_behavior: nil, phases: nil, proration_behavior: nil)
1511
+ def initialize(
1512
+ amendments: nil,
1513
+ billing_behavior: nil,
1514
+ billing_mode: nil,
1515
+ end_behavior: nil,
1516
+ phases: nil,
1517
+ prebilling: nil,
1518
+ proration_behavior: nil
1519
+ )
1520
+ @amendments = amendments
1521
+ @billing_behavior = billing_behavior
799
1522
  @billing_mode = billing_mode
800
1523
  @end_behavior = end_behavior
801
1524
  @phases = phases
1525
+ @prebilling = prebilling
802
1526
  @proration_behavior = proration_behavior
803
1527
  end
804
1528
 
@@ -917,17 +1641,57 @@ module Stripe
917
1641
  end
918
1642
  end
919
1643
 
1644
+ class CurrentTrial < ::Stripe::RequestParams
1645
+ # Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`.
1646
+ attr_accessor :trial_end
1647
+ # The ID of the trial offer to apply to the subscription item.
1648
+ attr_accessor :trial_offer
1649
+
1650
+ def initialize(trial_end: nil, trial_offer: nil)
1651
+ @trial_end = trial_end
1652
+ @trial_offer = trial_offer
1653
+ end
1654
+ end
1655
+
920
1656
  class Discount < ::Stripe::RequestParams
1657
+ class DiscountEnd < ::Stripe::RequestParams
1658
+ class Duration < ::Stripe::RequestParams
1659
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1660
+ attr_accessor :interval
1661
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1662
+ attr_accessor :interval_count
1663
+
1664
+ def initialize(interval: nil, interval_count: nil)
1665
+ @interval = interval
1666
+ @interval_count = interval_count
1667
+ end
1668
+ end
1669
+ # Time span for the redeemed discount.
1670
+ attr_accessor :duration
1671
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1672
+ attr_accessor :timestamp
1673
+ # The type of calculation made to determine when the discount ends.
1674
+ attr_accessor :type
1675
+
1676
+ def initialize(duration: nil, timestamp: nil, type: nil)
1677
+ @duration = duration
1678
+ @timestamp = timestamp
1679
+ @type = type
1680
+ end
1681
+ end
921
1682
  # ID of the coupon to create a new discount for.
922
1683
  attr_accessor :coupon
923
1684
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
924
1685
  attr_accessor :discount
1686
+ # Details to determine how long the discount should be applied for.
1687
+ attr_accessor :discount_end
925
1688
  # ID of the promotion code to create a new discount for.
926
1689
  attr_accessor :promotion_code
927
1690
 
928
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1691
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
929
1692
  @coupon = coupon
930
1693
  @discount = discount
1694
+ @discount_end = discount_end
931
1695
  @promotion_code = promotion_code
932
1696
  end
933
1697
  end
@@ -981,6 +1745,8 @@ module Stripe
981
1745
  attr_accessor :billing_thresholds
982
1746
  # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
983
1747
  attr_accessor :clear_usage
1748
+ # The trial offer to apply to this subscription item.
1749
+ attr_accessor :current_trial
984
1750
  # A flag that, if set to `true`, will delete the specified item.
985
1751
  attr_accessor :deleted
986
1752
  # The coupons to redeem into discounts for the subscription item.
@@ -1003,6 +1769,7 @@ module Stripe
1003
1769
  def initialize(
1004
1770
  billing_thresholds: nil,
1005
1771
  clear_usage: nil,
1772
+ current_trial: nil,
1006
1773
  deleted: nil,
1007
1774
  discounts: nil,
1008
1775
  id: nil,
@@ -1015,6 +1782,7 @@ module Stripe
1015
1782
  )
1016
1783
  @billing_thresholds = billing_thresholds
1017
1784
  @clear_usage = clear_usage
1785
+ @current_trial = current_trial
1018
1786
  @deleted = deleted
1019
1787
  @discounts = discounts
1020
1788
  @id = id
@@ -1032,6 +1800,15 @@ module Stripe
1032
1800
  }
1033
1801
  end
1034
1802
  end
1803
+
1804
+ class Prebilling < ::Stripe::RequestParams
1805
+ # This is used to determine the number of billing cycles to prebill.
1806
+ attr_accessor :iterations
1807
+
1808
+ def initialize(iterations: nil)
1809
+ @iterations = iterations
1810
+ end
1811
+ end
1035
1812
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
1036
1813
  attr_accessor :billing_cycle_anchor
1037
1814
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
@@ -1048,6 +1825,8 @@ module Stripe
1048
1825
  attr_accessor :default_tax_rates
1049
1826
  # A list of up to 20 subscription items, each with an attached price.
1050
1827
  attr_accessor :items
1828
+ # The pre-billing to apply to the subscription as a preview.
1829
+ attr_accessor :prebilling
1051
1830
  # Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
1052
1831
  attr_accessor :proration_behavior
1053
1832
  # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
@@ -1068,6 +1847,7 @@ module Stripe
1068
1847
  cancel_now: nil,
1069
1848
  default_tax_rates: nil,
1070
1849
  items: nil,
1850
+ prebilling: nil,
1071
1851
  proration_behavior: nil,
1072
1852
  proration_date: nil,
1073
1853
  resume_at: nil,
@@ -1082,6 +1862,7 @@ module Stripe
1082
1862
  @cancel_now = cancel_now
1083
1863
  @default_tax_rates = default_tax_rates
1084
1864
  @items = items
1865
+ @prebilling = prebilling
1085
1866
  @proration_behavior = proration_behavior
1086
1867
  @proration_date = proration_date
1087
1868
  @resume_at = resume_at