stripe 15.4.0 → 15.5.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 (596) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1634 -662
  4. data/VERSION +1 -1
  5. data/lib/stripe/api_requestor.rb +32 -0
  6. data/lib/stripe/api_version.rb +1 -2
  7. data/lib/stripe/errors.rb +60 -0
  8. data/lib/stripe/event_types.rb +102 -0
  9. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  10. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  11. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  16. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
  18. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
  23. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  24. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  25. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  26. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  27. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  30. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  53. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  58. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  59. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  60. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  61. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  62. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  65. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  66. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  67. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  68. data/lib/stripe/object_types.rb +53 -0
  69. data/lib/stripe/resources/account.rb +653 -1
  70. data/lib/stripe/resources/account_notice.rb +123 -0
  71. data/lib/stripe/resources/account_session.rb +256 -1
  72. data/lib/stripe/resources/balance_settings.rb +105 -0
  73. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  74. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  75. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  76. data/lib/stripe/resources/billing/meter_usage.rb +23 -0
  77. data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
  78. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  79. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  80. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  81. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  82. data/lib/stripe/resources/card.rb +2 -0
  83. data/lib/stripe/resources/cash_balance.rb +2 -0
  84. data/lib/stripe/resources/charge.rb +1538 -0
  85. data/lib/stripe/resources/checkout/session.rb +399 -3
  86. data/lib/stripe/resources/confirmation_token.rb +170 -0
  87. data/lib/stripe/resources/coupon.rb +30 -1
  88. data/lib/stripe/resources/credit_note.rb +6 -0
  89. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  90. data/lib/stripe/resources/customer.rb +2 -0
  91. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  92. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  93. data/lib/stripe/resources/customer_session.rb +6 -1
  94. data/lib/stripe/resources/discount.rb +2 -0
  95. data/lib/stripe/resources/dispute.rb +11 -0
  96. data/lib/stripe/resources/event.rb +31 -0
  97. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  98. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  99. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  100. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  101. data/lib/stripe/resources/fx_quote.rb +186 -0
  102. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  103. data/lib/stripe/resources/invoice.rb +1140 -16
  104. data/lib/stripe/resources/invoice_item.rb +78 -2
  105. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  106. data/lib/stripe/resources/invoice_payment.rb +2 -53
  107. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  108. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  109. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  110. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  111. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  112. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  113. data/lib/stripe/resources/line_item.rb +37 -0
  114. data/lib/stripe/resources/mandate.rb +24 -0
  115. data/lib/stripe/resources/margin.rb +115 -0
  116. data/lib/stripe/resources/order.rb +2958 -0
  117. data/lib/stripe/resources/payment_attempt_record.rb +1101 -0
  118. data/lib/stripe/resources/payment_intent.rb +9469 -3712
  119. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  120. data/lib/stripe/resources/payment_method.rb +192 -1
  121. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  122. data/lib/stripe/resources/payment_record.rb +1630 -0
  123. data/lib/stripe/resources/payout.rb +6 -0
  124. data/lib/stripe/resources/price.rb +30 -0
  125. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  126. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  127. data/lib/stripe/resources/promotion_code.rb +10 -0
  128. data/lib/stripe/resources/quote.rb +2038 -7
  129. data/lib/stripe/resources/quote_line.rb +274 -0
  130. data/lib/stripe/resources/quote_preview_invoice.rb +680 -0
  131. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +371 -0
  132. data/lib/stripe/resources/refund.rb +9 -0
  133. data/lib/stripe/resources/setup_attempt.rb +21 -0
  134. data/lib/stripe/resources/setup_intent.rb +578 -9
  135. data/lib/stripe/resources/source.rb +29 -0
  136. data/lib/stripe/resources/subscription.rb +365 -9
  137. data/lib/stripe/resources/subscription_item.rb +84 -3
  138. data/lib/stripe/resources/subscription_schedule.rb +1007 -10
  139. data/lib/stripe/resources/tax/association.rb +66 -0
  140. data/lib/stripe/resources/tax/form.rb +211 -0
  141. data/lib/stripe/resources/tax_id.rb +12 -2
  142. data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
  143. data/lib/stripe/resources/terminal/reader.rb +8 -0
  144. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  145. data/lib/stripe/resources/transfer.rb +6 -0
  146. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  147. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  148. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  149. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  150. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  151. data/lib/stripe/resources/v2/core/account.rb +1930 -0
  152. data/lib/stripe/resources/v2/core/account_link.rb +72 -0
  153. data/lib/stripe/resources/v2/core/person.rb +276 -0
  154. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  155. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  156. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  157. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  158. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  159. data/lib/stripe/resources/v2/money_management/financial_account.rb +77 -0
  160. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  161. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  162. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  163. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  164. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  165. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  166. data/lib/stripe/resources/v2/money_management/payout_method.rb +77 -0
  167. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  168. data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
  169. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  170. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  171. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  172. data/lib/stripe/resources/v2/payments/off_session_payment.rb +89 -0
  173. data/lib/stripe/resources.rb +109 -0
  174. data/lib/stripe/services/account_notice_service.rb +101 -0
  175. data/lib/stripe/services/account_service.rb +562 -1
  176. data/lib/stripe/services/account_session_service.rb +226 -1
  177. data/lib/stripe/services/balance_settings_service.rb +96 -0
  178. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  179. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  180. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  181. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  182. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  183. data/lib/stripe/services/billing_service.rb +2 -1
  184. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  185. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  186. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  187. data/lib/stripe/services/capital_service.rb +15 -0
  188. data/lib/stripe/services/charge_service.rb +1418 -0
  189. data/lib/stripe/services/checkout/session_service.rb +316 -3
  190. data/lib/stripe/services/coupon_service.rb +17 -1
  191. data/lib/stripe/services/credit_note_service.rb +4 -0
  192. data/lib/stripe/services/customer_session_service.rb +4 -1
  193. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  194. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  195. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  196. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  197. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  198. data/lib/stripe/services/financial_connections_service.rb +2 -1
  199. data/lib/stripe/services/fx_quote_service.rb +123 -0
  200. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  201. data/lib/stripe/services/invoice_item_service.rb +74 -2
  202. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  203. data/lib/stripe/services/invoice_service.rb +1074 -16
  204. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  205. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  206. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  207. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  208. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  209. data/lib/stripe/services/issuing_service.rb +5 -1
  210. data/lib/stripe/services/margin_service.rb +119 -0
  211. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  212. data/lib/stripe/services/order_service.rb +2388 -0
  213. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  214. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  215. data/lib/stripe/services/payment_intent_service.rb +5724 -435
  216. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  217. data/lib/stripe/services/payment_method_service.rb +120 -1
  218. data/lib/stripe/services/payment_record_service.rb +542 -0
  219. data/lib/stripe/services/payout_service.rb +4 -0
  220. data/lib/stripe/services/price_service.rb +19 -0
  221. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  222. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  223. data/lib/stripe/services/privacy_service.rb +13 -0
  224. data/lib/stripe/services/promotion_code_service.rb +8 -0
  225. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  226. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  227. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  228. data/lib/stripe/services/quote_service.rb +1723 -8
  229. data/lib/stripe/services/setup_intent_service.rb +538 -9
  230. data/lib/stripe/services/subscription_item_service.rb +75 -3
  231. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  232. data/lib/stripe/services/subscription_service.rb +309 -9
  233. data/lib/stripe/services/tax/association_service.rb +31 -0
  234. data/lib/stripe/services/tax/form_service.rb +100 -0
  235. data/lib/stripe/services/tax_id_service.rb +8 -2
  236. data/lib/stripe/services/tax_service.rb +3 -1
  237. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  238. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  239. data/lib/stripe/services/terminal_service.rb +3 -1
  240. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  241. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  242. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  243. data/lib/stripe/services/transfer_service.rb +4 -0
  244. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  245. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  246. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  247. data/lib/stripe/services/v1_services.rb +11 -2
  248. data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
  249. data/lib/stripe/services/v2/core/account_service.rb +4522 -0
  250. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  251. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  252. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  253. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  254. data/lib/stripe/services/v2/core_service.rb +4 -1
  255. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  256. data/lib/stripe/services/v2/money_management/financial_account_service.rb +116 -0
  257. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  258. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  259. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  260. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  261. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  262. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  263. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  264. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  265. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  266. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  267. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  268. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  269. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  270. data/lib/stripe/services/v2/payment_service.rb +15 -0
  271. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
  272. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  273. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
  274. data/lib/stripe/services/v2_services.rb +4 -1
  275. data/lib/stripe/services.rb +55 -1
  276. data/lib/stripe/stripe_configuration.rb +3 -1
  277. data/lib/stripe/stripe_object.rb +1 -1
  278. data/lib/stripe/util.rb +7 -1
  279. data/lib/stripe/version.rb +1 -1
  280. data/lib/stripe.rb +53 -0
  281. data/rbi/stripe.rbi +199016 -0
  282. data/stripe.gemspec +4 -1
  283. metadata +168 -324
  284. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  285. data/rbi/stripe/resources/account.rbi +0 -4995
  286. data/rbi/stripe/resources/account_link.rbi +0 -76
  287. data/rbi/stripe/resources/account_session.rbi +0 -1074
  288. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  289. data/rbi/stripe/resources/application.rbi +0 -20
  290. data/rbi/stripe/resources/application_fee.rbi +0 -118
  291. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  292. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  293. data/rbi/stripe/resources/balance.rbi +0 -235
  294. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  295. data/rbi/stripe/resources/bank_account.rbi +0 -127
  296. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  297. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  298. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  299. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  300. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  301. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  302. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  303. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  304. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  305. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -703
  306. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  307. data/rbi/stripe/resources/capability.rbi +0 -125
  308. data/rbi/stripe/resources/card.rbi +0 -125
  309. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  310. data/rbi/stripe/resources/charge.rbi +0 -2089
  311. data/rbi/stripe/resources/checkout/session.rbi +0 -4095
  312. data/rbi/stripe/resources/climate/order.rbi +0 -245
  313. data/rbi/stripe/resources/climate/product.rbi +0 -75
  314. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  315. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  316. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  317. data/rbi/stripe/resources/country_spec.rbi +0 -85
  318. data/rbi/stripe/resources/coupon.rbi +0 -250
  319. data/rbi/stripe/resources/credit_note.rbi +0 -752
  320. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  321. data/rbi/stripe/resources/customer.rbi +0 -1005
  322. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  323. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  324. data/rbi/stripe/resources/customer_session.rbi +0 -200
  325. data/rbi/stripe/resources/discount.rbi +0 -53
  326. data/rbi/stripe/resources/dispute.rbi +0 -761
  327. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  328. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  329. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  330. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  331. data/rbi/stripe/resources/event.rbi +0 -137
  332. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  333. data/rbi/stripe/resources/file.rbi +0 -143
  334. data/rbi/stripe/resources/file_link.rbi +0 -141
  335. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  336. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  337. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  338. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  339. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  340. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  341. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  342. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  343. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  344. data/rbi/stripe/resources/invoice.rbi +0 -3858
  345. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  346. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  347. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  348. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  349. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  350. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  351. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  352. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  353. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  354. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  355. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  356. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  357. data/rbi/stripe/resources/line_item.rbi +0 -72
  358. data/rbi/stripe/resources/login_link.rbi +0 -19
  359. data/rbi/stripe/resources/mandate.rbi +0 -191
  360. data/rbi/stripe/resources/payment_intent.rbi +0 -9997
  361. data/rbi/stripe/resources/payment_link.rbi +0 -1893
  362. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  363. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  364. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  365. data/rbi/stripe/resources/payout.rbi +0 -300
  366. data/rbi/stripe/resources/person.rbi +0 -401
  367. data/rbi/stripe/resources/plan.rbi +0 -371
  368. data/rbi/stripe/resources/price.rbi +0 -694
  369. data/rbi/stripe/resources/product.rbi +0 -555
  370. data/rbi/stripe/resources/product_feature.rbi +0 -26
  371. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  372. data/rbi/stripe/resources/quote.rbi +0 -1145
  373. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  374. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  375. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  376. data/rbi/stripe/resources/refund.rbi +0 -523
  377. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  378. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  379. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  380. data/rbi/stripe/resources/reversal.rbi +0 -51
  381. data/rbi/stripe/resources/review.rbi +0 -154
  382. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  383. data/rbi/stripe/resources/setup_intent.rbi +0 -3978
  384. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  385. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  386. data/rbi/stripe/resources/source.rbi +0 -1496
  387. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  388. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  389. data/rbi/stripe/resources/subscription.rbi +0 -2080
  390. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  391. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1673
  392. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  393. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  394. data/rbi/stripe/resources/tax/registration.rbi +0 -3216
  395. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  396. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  397. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  398. data/rbi/stripe/resources/tax_code.rbi +0 -44
  399. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  400. data/rbi/stripe/resources/tax_id.rbi +0 -165
  401. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  402. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1595
  403. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  404. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  405. data/rbi/stripe/resources/terminal/reader.rbi +0 -994
  406. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  407. data/rbi/stripe/resources/token.rbi +0 -1283
  408. data/rbi/stripe/resources/topup.rbi +0 -222
  409. data/rbi/stripe/resources/transfer.rbi +0 -199
  410. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  411. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  412. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  413. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  414. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  415. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  416. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  417. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  418. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  419. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  420. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  421. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  422. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  423. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  424. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  425. data/rbi/stripe/resources/v2/event.rbi +0 -48
  426. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  427. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  428. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  429. data/rbi/stripe/services/account_link_service.rbi +0 -60
  430. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  431. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  432. data/rbi/stripe/services/account_service.rbi +0 -4281
  433. data/rbi/stripe/services/account_session_service.rbi +0 -685
  434. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  435. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  436. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  437. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  438. data/rbi/stripe/services/apps_service.rbi +0 -9
  439. data/rbi/stripe/services/balance_service.rbi +0 -21
  440. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  441. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  442. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  443. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  444. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  445. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  446. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  447. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  448. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  449. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -555
  450. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  451. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  452. data/rbi/stripe/services/billing_service.rbi +0 -15
  453. data/rbi/stripe/services/charge_service.rbi +0 -448
  454. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  455. data/rbi/stripe/services/checkout/session_service.rbi +0 -2690
  456. data/rbi/stripe/services/checkout_service.rbi +0 -9
  457. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  458. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  459. data/rbi/stripe/services/climate_service.rbi +0 -11
  460. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  461. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  462. data/rbi/stripe/services/coupon_service.rbi +0 -194
  463. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  464. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  465. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  466. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  467. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  468. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  469. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  470. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  471. data/rbi/stripe/services/customer_service.rbi +0 -647
  472. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  473. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  474. data/rbi/stripe/services/dispute_service.rbi +0 -424
  475. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  476. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  477. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  478. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  479. data/rbi/stripe/services/event_service.rbi +0 -83
  480. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  481. data/rbi/stripe/services/file_link_service.rbi +0 -124
  482. data/rbi/stripe/services/file_service.rbi +0 -116
  483. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  484. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  485. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  486. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  487. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  488. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  489. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  490. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  491. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  492. data/rbi/stripe/services/identity_service.rbi +0 -10
  493. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  494. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  495. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  496. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  497. data/rbi/stripe/services/invoice_service.rbi +0 -3027
  498. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  499. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  500. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  501. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  502. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  503. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  504. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  505. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  506. data/rbi/stripe/services/issuing_service.rbi +0 -16
  507. data/rbi/stripe/services/mandate_service.rbi +0 -20
  508. data/rbi/stripe/services/payment_intent_service.rbi +0 -7994
  509. data/rbi/stripe/services/payment_link_service.rbi +0 -1441
  510. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  511. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  512. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  513. data/rbi/stripe/services/payout_service.rbi +0 -205
  514. data/rbi/stripe/services/plan_service.rbi +0 -282
  515. data/rbi/stripe/services/price_service.rbi +0 -546
  516. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  517. data/rbi/stripe/services/product_service.rbi +0 -477
  518. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  519. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  520. data/rbi/stripe/services/quote_service.rbi +0 -699
  521. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  522. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  523. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  524. data/rbi/stripe/services/radar_service.rbi +0 -11
  525. data/rbi/stripe/services/refund_service.rbi +0 -185
  526. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  527. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  528. data/rbi/stripe/services/reporting_service.rbi +0 -10
  529. data/rbi/stripe/services/review_service.rbi +0 -84
  530. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  531. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  532. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  533. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  534. data/rbi/stripe/services/sigma_service.rbi +0 -9
  535. data/rbi/stripe/services/source_service.rbi +0 -663
  536. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  537. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1333
  538. data/rbi/stripe/services/subscription_service.rbi +0 -1684
  539. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  540. data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
  541. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  542. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  543. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  544. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  545. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  546. data/rbi/stripe/services/tax_service.rbi +0 -12
  547. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1286
  548. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  549. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  550. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  551. data/rbi/stripe/services/terminal_service.rbi +0 -12
  552. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  553. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  554. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  555. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  556. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  557. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  558. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  559. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  560. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  561. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  562. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  563. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  564. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  565. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  566. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  567. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  568. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  569. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  570. data/rbi/stripe/services/token_service.rbi +0 -1257
  571. data/rbi/stripe/services/topup_service.rbi +0 -176
  572. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  573. data/rbi/stripe/services/transfer_service.rbi +0 -152
  574. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  575. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  576. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  577. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  578. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  579. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  580. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  581. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  582. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  583. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  584. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  585. data/rbi/stripe/services/treasury_service.rbi +0 -18
  586. data/rbi/stripe/services/v1_services.rbi +0 -77
  587. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  588. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  589. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  590. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  591. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  592. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  593. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  594. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  595. data/rbi/stripe/services/v2_services.rbi +0 -10
  596. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -22,6 +22,24 @@ module Stripe
22
22
  end
23
23
 
24
24
  class UpdateParams < Stripe::RequestParams
25
+ class AmountsDue < Stripe::RequestParams
26
+ # The amount in cents (or local equivalent).
27
+ attr_accessor :amount
28
+ # Number of days from when invoice is finalized until the payment is due.
29
+ attr_accessor :days_until_due
30
+ # An arbitrary string attached to the object. Often useful for displaying to users.
31
+ attr_accessor :description
32
+ # Date on which a payment plan’s payment is due.
33
+ attr_accessor :due_date
34
+
35
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
36
+ @amount = amount
37
+ @days_until_due = days_until_due
38
+ @description = description
39
+ @due_date = due_date
40
+ end
41
+ end
42
+
25
43
  class AutomaticTax < Stripe::RequestParams
26
44
  class Liability < Stripe::RequestParams
27
45
  # The connected account being referenced when `type` is `account`.
@@ -58,16 +76,44 @@ module Stripe
58
76
  end
59
77
 
60
78
  class Discount < Stripe::RequestParams
79
+ class DiscountEnd < Stripe::RequestParams
80
+ class Duration < Stripe::RequestParams
81
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
82
+ attr_accessor :interval
83
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
84
+ attr_accessor :interval_count
85
+
86
+ def initialize(interval: nil, interval_count: nil)
87
+ @interval = interval
88
+ @interval_count = interval_count
89
+ end
90
+ end
91
+ # Time span for the redeemed discount.
92
+ attr_accessor :duration
93
+ # A precise Unix timestamp for the discount to end. Must be in the future.
94
+ attr_accessor :timestamp
95
+ # The type of calculation made to determine when the discount ends.
96
+ attr_accessor :type
97
+
98
+ def initialize(duration: nil, timestamp: nil, type: nil)
99
+ @duration = duration
100
+ @timestamp = timestamp
101
+ @type = type
102
+ end
103
+ end
61
104
  # ID of the coupon to create a new discount for.
62
105
  attr_accessor :coupon
63
106
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
64
107
  attr_accessor :discount
108
+ # Details to determine how long the discount should be applied for.
109
+ attr_accessor :discount_end
65
110
  # ID of the promotion code to create a new discount for.
66
111
  attr_accessor :promotion_code
67
112
 
68
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
113
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
69
114
  @coupon = coupon
70
115
  @discount = discount
116
+ @discount_end = discount_end
71
117
  @promotion_code = promotion_code
72
118
  end
73
119
  end
@@ -187,17 +233,47 @@ module Stripe
187
233
  end
188
234
  end
189
235
 
236
+ class IdBankTransfer < Stripe::RequestParams; end
190
237
  class Konbini < Stripe::RequestParams; end
191
238
  class SepaDebit < Stripe::RequestParams; end
192
239
 
240
+ class Upi < Stripe::RequestParams
241
+ class MandateOptions < Stripe::RequestParams
242
+ # Amount to be charged for future payments.
243
+ attr_accessor :amount
244
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
245
+ attr_accessor :amount_type
246
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
247
+ attr_accessor :description
248
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
249
+ attr_accessor :end_date
250
+
251
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
252
+ @amount = amount
253
+ @amount_type = amount_type
254
+ @description = description
255
+ @end_date = end_date
256
+ end
257
+ end
258
+ # Configuration options for setting up an eMandate
259
+ attr_accessor :mandate_options
260
+
261
+ def initialize(mandate_options: nil)
262
+ @mandate_options = mandate_options
263
+ end
264
+ end
265
+
193
266
  class UsBankAccount < Stripe::RequestParams
194
267
  class FinancialConnections < Stripe::RequestParams
195
268
  class Filters < Stripe::RequestParams
196
269
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
197
270
  attr_accessor :account_subcategories
271
+ # ID of the institution to use to filter for selectable accounts.
272
+ attr_accessor :institution
198
273
 
199
- def initialize(account_subcategories: nil)
274
+ def initialize(account_subcategories: nil, institution: nil)
200
275
  @account_subcategories = account_subcategories
276
+ @institution = institution
201
277
  end
202
278
  end
203
279
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -231,10 +307,14 @@ module Stripe
231
307
  attr_accessor :card
232
308
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
233
309
  attr_accessor :customer_balance
310
+ # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
311
+ attr_accessor :id_bank_transfer
234
312
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
235
313
  attr_accessor :konbini
236
314
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
237
315
  attr_accessor :sepa_debit
316
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
317
+ attr_accessor :upi
238
318
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
239
319
  attr_accessor :us_bank_account
240
320
 
@@ -243,16 +323,20 @@ module Stripe
243
323
  bancontact: nil,
244
324
  card: nil,
245
325
  customer_balance: nil,
326
+ id_bank_transfer: nil,
246
327
  konbini: nil,
247
328
  sepa_debit: nil,
329
+ upi: nil,
248
330
  us_bank_account: nil
249
331
  )
250
332
  @acss_debit = acss_debit
251
333
  @bancontact = bancontact
252
334
  @card = card
253
335
  @customer_balance = customer_balance
336
+ @id_bank_transfer = id_bank_transfer
254
337
  @konbini = konbini
255
338
  @sepa_debit = sepa_debit
339
+ @upi = upi
256
340
  @us_bank_account = us_bank_account
257
341
  end
258
342
  end
@@ -462,6 +546,8 @@ module Stripe
462
546
  end
463
547
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
464
548
  attr_accessor :account_tax_ids
549
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
550
+ attr_accessor :amounts_due
465
551
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
466
552
  attr_accessor :application_fee_amount
467
553
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -476,6 +562,8 @@ module Stripe
476
562
  attr_accessor :custom_fields
477
563
  # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
478
564
  attr_accessor :days_until_due
565
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
566
+ attr_accessor :default_margins
479
567
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
480
568
  attr_accessor :default_payment_method
481
569
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -517,6 +605,7 @@ module Stripe
517
605
 
518
606
  def initialize(
519
607
  account_tax_ids: nil,
608
+ amounts_due: nil,
520
609
  application_fee_amount: nil,
521
610
  auto_advance: nil,
522
611
  automatic_tax: nil,
@@ -524,6 +613,7 @@ module Stripe
524
613
  collection_method: nil,
525
614
  custom_fields: nil,
526
615
  days_until_due: nil,
616
+ default_margins: nil,
527
617
  default_payment_method: nil,
528
618
  default_source: nil,
529
619
  default_tax_rates: nil,
@@ -545,6 +635,7 @@ module Stripe
545
635
  transfer_data: nil
546
636
  )
547
637
  @account_tax_ids = account_tax_ids
638
+ @amounts_due = amounts_due
548
639
  @application_fee_amount = application_fee_amount
549
640
  @auto_advance = auto_advance
550
641
  @automatic_tax = automatic_tax
@@ -552,6 +643,7 @@ module Stripe
552
643
  @collection_method = collection_method
553
644
  @custom_fields = custom_fields
554
645
  @days_until_due = days_until_due
646
+ @default_margins = default_margins
555
647
  @default_payment_method = default_payment_method
556
648
  @default_source = default_source
557
649
  @default_tax_rates = default_tax_rates
@@ -616,6 +708,8 @@ module Stripe
616
708
  attr_accessor :created
617
709
  # Only return invoices for the customer specified by this customer ID.
618
710
  attr_accessor :customer
711
+ # Only return invoices for the account specified by this account ID.
712
+ attr_accessor :customer_account
619
713
  # Attribute for param field due_date
620
714
  attr_accessor :due_date
621
715
  # 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.
@@ -635,6 +729,7 @@ module Stripe
635
729
  collection_method: nil,
636
730
  created: nil,
637
731
  customer: nil,
732
+ customer_account: nil,
638
733
  due_date: nil,
639
734
  ending_before: nil,
640
735
  expand: nil,
@@ -646,6 +741,7 @@ module Stripe
646
741
  @collection_method = collection_method
647
742
  @created = created
648
743
  @customer = customer
744
+ @customer_account = customer_account
649
745
  @due_date = due_date
650
746
  @ending_before = ending_before
651
747
  @expand = expand
@@ -657,6 +753,24 @@ module Stripe
657
753
  end
658
754
 
659
755
  class CreateParams < Stripe::RequestParams
756
+ class AmountsDue < Stripe::RequestParams
757
+ # The amount in cents (or local equivalent).
758
+ attr_accessor :amount
759
+ # Number of days from when invoice is finalized until the payment is due.
760
+ attr_accessor :days_until_due
761
+ # An arbitrary string attached to the object. Often useful for displaying to users.
762
+ attr_accessor :description
763
+ # Date on which a payment plan’s payment is due.
764
+ attr_accessor :due_date
765
+
766
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
767
+ @amount = amount
768
+ @days_until_due = days_until_due
769
+ @description = description
770
+ @due_date = due_date
771
+ end
772
+ end
773
+
660
774
  class AutomaticTax < Stripe::RequestParams
661
775
  class Liability < Stripe::RequestParams
662
776
  # The connected account being referenced when `type` is `account`.
@@ -693,16 +807,44 @@ module Stripe
693
807
  end
694
808
 
695
809
  class Discount < Stripe::RequestParams
810
+ class DiscountEnd < Stripe::RequestParams
811
+ class Duration < Stripe::RequestParams
812
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
813
+ attr_accessor :interval
814
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
815
+ attr_accessor :interval_count
816
+
817
+ def initialize(interval: nil, interval_count: nil)
818
+ @interval = interval
819
+ @interval_count = interval_count
820
+ end
821
+ end
822
+ # Time span for the redeemed discount.
823
+ attr_accessor :duration
824
+ # A precise Unix timestamp for the discount to end. Must be in the future.
825
+ attr_accessor :timestamp
826
+ # The type of calculation made to determine when the discount ends.
827
+ attr_accessor :type
828
+
829
+ def initialize(duration: nil, timestamp: nil, type: nil)
830
+ @duration = duration
831
+ @timestamp = timestamp
832
+ @type = type
833
+ end
834
+ end
696
835
  # ID of the coupon to create a new discount for.
697
836
  attr_accessor :coupon
698
837
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
699
838
  attr_accessor :discount
839
+ # Details to determine how long the discount should be applied for.
840
+ attr_accessor :discount_end
700
841
  # ID of the promotion code to create a new discount for.
701
842
  attr_accessor :promotion_code
702
843
 
703
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
844
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
704
845
  @coupon = coupon
705
846
  @discount = discount
847
+ @discount_end = discount_end
706
848
  @promotion_code = promotion_code
707
849
  end
708
850
  end
@@ -834,17 +976,47 @@ module Stripe
834
976
  end
835
977
  end
836
978
 
979
+ class IdBankTransfer < Stripe::RequestParams; end
837
980
  class Konbini < Stripe::RequestParams; end
838
981
  class SepaDebit < Stripe::RequestParams; end
839
982
 
983
+ class Upi < Stripe::RequestParams
984
+ class MandateOptions < Stripe::RequestParams
985
+ # Amount to be charged for future payments.
986
+ attr_accessor :amount
987
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
988
+ attr_accessor :amount_type
989
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
990
+ attr_accessor :description
991
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
992
+ attr_accessor :end_date
993
+
994
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
995
+ @amount = amount
996
+ @amount_type = amount_type
997
+ @description = description
998
+ @end_date = end_date
999
+ end
1000
+ end
1001
+ # Configuration options for setting up an eMandate
1002
+ attr_accessor :mandate_options
1003
+
1004
+ def initialize(mandate_options: nil)
1005
+ @mandate_options = mandate_options
1006
+ end
1007
+ end
1008
+
840
1009
  class UsBankAccount < Stripe::RequestParams
841
1010
  class FinancialConnections < Stripe::RequestParams
842
1011
  class Filters < Stripe::RequestParams
843
1012
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
844
1013
  attr_accessor :account_subcategories
1014
+ # ID of the institution to use to filter for selectable accounts.
1015
+ attr_accessor :institution
845
1016
 
846
- def initialize(account_subcategories: nil)
1017
+ def initialize(account_subcategories: nil, institution: nil)
847
1018
  @account_subcategories = account_subcategories
1019
+ @institution = institution
848
1020
  end
849
1021
  end
850
1022
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -878,10 +1050,14 @@ module Stripe
878
1050
  attr_accessor :card
879
1051
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
880
1052
  attr_accessor :customer_balance
1053
+ # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
1054
+ attr_accessor :id_bank_transfer
881
1055
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
882
1056
  attr_accessor :konbini
883
1057
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
884
1058
  attr_accessor :sepa_debit
1059
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
1060
+ attr_accessor :upi
885
1061
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
886
1062
  attr_accessor :us_bank_account
887
1063
 
@@ -890,16 +1066,20 @@ module Stripe
890
1066
  bancontact: nil,
891
1067
  card: nil,
892
1068
  customer_balance: nil,
1069
+ id_bank_transfer: nil,
893
1070
  konbini: nil,
894
1071
  sepa_debit: nil,
1072
+ upi: nil,
895
1073
  us_bank_account: nil
896
1074
  )
897
1075
  @acss_debit = acss_debit
898
1076
  @bancontact = bancontact
899
1077
  @card = card
900
1078
  @customer_balance = customer_balance
1079
+ @id_bank_transfer = id_bank_transfer
901
1080
  @konbini = konbini
902
1081
  @sepa_debit = sepa_debit
1082
+ @upi = upi
903
1083
  @us_bank_account = us_bank_account
904
1084
  end
905
1085
  end
@@ -1109,6 +1289,8 @@ module Stripe
1109
1289
  end
1110
1290
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1111
1291
  attr_accessor :account_tax_ids
1292
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1293
+ attr_accessor :amounts_due
1112
1294
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1113
1295
  attr_accessor :application_fee_amount
1114
1296
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. Defaults to false.
@@ -1125,8 +1307,12 @@ module Stripe
1125
1307
  attr_accessor :custom_fields
1126
1308
  # The ID of the customer who will be billed.
1127
1309
  attr_accessor :customer
1310
+ # The ID of the account who will be billed.
1311
+ attr_accessor :customer_account
1128
1312
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1129
1313
  attr_accessor :days_until_due
1314
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1315
+ attr_accessor :default_margins
1130
1316
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1131
1317
  attr_accessor :default_payment_method
1132
1318
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -1174,6 +1360,7 @@ module Stripe
1174
1360
 
1175
1361
  def initialize(
1176
1362
  account_tax_ids: nil,
1363
+ amounts_due: nil,
1177
1364
  application_fee_amount: nil,
1178
1365
  auto_advance: nil,
1179
1366
  automatic_tax: nil,
@@ -1182,7 +1369,9 @@ module Stripe
1182
1369
  currency: nil,
1183
1370
  custom_fields: nil,
1184
1371
  customer: nil,
1372
+ customer_account: nil,
1185
1373
  days_until_due: nil,
1374
+ default_margins: nil,
1186
1375
  default_payment_method: nil,
1187
1376
  default_source: nil,
1188
1377
  default_tax_rates: nil,
@@ -1207,6 +1396,7 @@ module Stripe
1207
1396
  transfer_data: nil
1208
1397
  )
1209
1398
  @account_tax_ids = account_tax_ids
1399
+ @amounts_due = amounts_due
1210
1400
  @application_fee_amount = application_fee_amount
1211
1401
  @auto_advance = auto_advance
1212
1402
  @automatic_tax = automatic_tax
@@ -1215,7 +1405,9 @@ module Stripe
1215
1405
  @currency = currency
1216
1406
  @custom_fields = custom_fields
1217
1407
  @customer = customer
1408
+ @customer_account = customer_account
1218
1409
  @days_until_due = days_until_due
1410
+ @default_margins = default_margins
1219
1411
  @default_payment_method = default_payment_method
1220
1412
  @default_source = default_source
1221
1413
  @default_tax_rates = default_tax_rates
@@ -1262,16 +1454,44 @@ module Stripe
1262
1454
  class AddLinesParams < Stripe::RequestParams
1263
1455
  class Line < Stripe::RequestParams
1264
1456
  class Discount < Stripe::RequestParams
1457
+ class DiscountEnd < Stripe::RequestParams
1458
+ class Duration < Stripe::RequestParams
1459
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1460
+ attr_accessor :interval
1461
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1462
+ attr_accessor :interval_count
1463
+
1464
+ def initialize(interval: nil, interval_count: nil)
1465
+ @interval = interval
1466
+ @interval_count = interval_count
1467
+ end
1468
+ end
1469
+ # Time span for the redeemed discount.
1470
+ attr_accessor :duration
1471
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1472
+ attr_accessor :timestamp
1473
+ # The type of calculation made to determine when the discount ends.
1474
+ attr_accessor :type
1475
+
1476
+ def initialize(duration: nil, timestamp: nil, type: nil)
1477
+ @duration = duration
1478
+ @timestamp = timestamp
1479
+ @type = type
1480
+ end
1481
+ end
1265
1482
  # ID of the coupon to create a new discount for.
1266
1483
  attr_accessor :coupon
1267
1484
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1268
1485
  attr_accessor :discount
1486
+ # Details to determine how long the discount should be applied for.
1487
+ attr_accessor :discount_end
1269
1488
  # ID of the promotion code to create a new discount for.
1270
1489
  attr_accessor :promotion_code
1271
1490
 
1272
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1491
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1273
1492
  @coupon = coupon
1274
1493
  @discount = discount
1494
+ @discount_end = discount_end
1275
1495
  @promotion_code = promotion_code
1276
1496
  end
1277
1497
  end
@@ -1424,6 +1644,8 @@ module Stripe
1424
1644
  attr_accessor :discounts
1425
1645
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1426
1646
  attr_accessor :invoice_item
1647
+ # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
1648
+ attr_accessor :margins
1427
1649
  # 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`.
1428
1650
  attr_accessor :metadata
1429
1651
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -1445,6 +1667,7 @@ module Stripe
1445
1667
  discountable: nil,
1446
1668
  discounts: nil,
1447
1669
  invoice_item: nil,
1670
+ margins: nil,
1448
1671
  metadata: nil,
1449
1672
  period: nil,
1450
1673
  price_data: nil,
@@ -1458,6 +1681,7 @@ module Stripe
1458
1681
  @discountable = discountable
1459
1682
  @discounts = discounts
1460
1683
  @invoice_item = invoice_item
1684
+ @margins = margins
1461
1685
  @metadata = metadata
1462
1686
  @period = period
1463
1687
  @price_data = price_data
@@ -1482,14 +1706,59 @@ module Stripe
1482
1706
  end
1483
1707
 
1484
1708
  class AttachPaymentParams < Stripe::RequestParams
1709
+ class PaymentRecordData < Stripe::RequestParams
1710
+ # The amount that was paid out of band.
1711
+ attr_accessor :amount
1712
+ # The currency that was paid out of band.
1713
+ attr_accessor :currency
1714
+ # 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`.
1715
+ attr_accessor :metadata
1716
+ # The type of money movement for this out of band payment record.
1717
+ attr_accessor :money_movement_type
1718
+ # The timestamp when this out of band payment was paid.
1719
+ attr_accessor :paid_at
1720
+ # The reference for this out of band payment record.
1721
+ attr_accessor :payment_reference
1722
+
1723
+ def initialize(
1724
+ amount: nil,
1725
+ currency: nil,
1726
+ metadata: nil,
1727
+ money_movement_type: nil,
1728
+ paid_at: nil,
1729
+ payment_reference: nil
1730
+ )
1731
+ @amount = amount
1732
+ @currency = currency
1733
+ @metadata = metadata
1734
+ @money_movement_type = money_movement_type
1735
+ @paid_at = paid_at
1736
+ @payment_reference = payment_reference
1737
+ end
1738
+ end
1739
+ # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
1740
+ attr_accessor :amount_requested
1485
1741
  # Specifies which fields in the response should be expanded.
1486
1742
  attr_accessor :expand
1487
1743
  # The ID of the PaymentIntent to attach to the invoice.
1488
1744
  attr_accessor :payment_intent
1745
+ # The ID of the PaymentRecord to attach to the invoice.
1746
+ attr_accessor :payment_record
1747
+ # The PaymentRecord data for attaching an out of band payment to the invoice.
1748
+ attr_accessor :payment_record_data
1489
1749
 
1490
- def initialize(expand: nil, payment_intent: nil)
1750
+ def initialize(
1751
+ amount_requested: nil,
1752
+ expand: nil,
1753
+ payment_intent: nil,
1754
+ payment_record: nil,
1755
+ payment_record_data: nil
1756
+ )
1757
+ @amount_requested = amount_requested
1491
1758
  @expand = expand
1492
1759
  @payment_intent = payment_intent
1760
+ @payment_record = payment_record
1761
+ @payment_record_data = payment_record_data
1493
1762
  end
1494
1763
  end
1495
1764
 
@@ -1589,16 +1858,44 @@ module Stripe
1589
1858
  class UpdateLinesParams < Stripe::RequestParams
1590
1859
  class Line < Stripe::RequestParams
1591
1860
  class Discount < Stripe::RequestParams
1861
+ class DiscountEnd < Stripe::RequestParams
1862
+ class Duration < Stripe::RequestParams
1863
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1864
+ attr_accessor :interval
1865
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1866
+ attr_accessor :interval_count
1867
+
1868
+ def initialize(interval: nil, interval_count: nil)
1869
+ @interval = interval
1870
+ @interval_count = interval_count
1871
+ end
1872
+ end
1873
+ # Time span for the redeemed discount.
1874
+ attr_accessor :duration
1875
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1876
+ attr_accessor :timestamp
1877
+ # The type of calculation made to determine when the discount ends.
1878
+ attr_accessor :type
1879
+
1880
+ def initialize(duration: nil, timestamp: nil, type: nil)
1881
+ @duration = duration
1882
+ @timestamp = timestamp
1883
+ @type = type
1884
+ end
1885
+ end
1592
1886
  # ID of the coupon to create a new discount for.
1593
1887
  attr_accessor :coupon
1594
1888
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1595
1889
  attr_accessor :discount
1890
+ # Details to determine how long the discount should be applied for.
1891
+ attr_accessor :discount_end
1596
1892
  # ID of the promotion code to create a new discount for.
1597
1893
  attr_accessor :promotion_code
1598
1894
 
1599
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1895
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1600
1896
  @coupon = coupon
1601
1897
  @discount = discount
1898
+ @discount_end = discount_end
1602
1899
  @promotion_code = promotion_code
1603
1900
  end
1604
1901
  end
@@ -1751,6 +2048,8 @@ module Stripe
1751
2048
  attr_accessor :discounts
1752
2049
  # ID of an existing line item on the invoice.
1753
2050
  attr_accessor :id
2051
+ # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
2052
+ attr_accessor :margins
1754
2053
  # 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
1755
2054
  attr_accessor :metadata
1756
2055
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -1772,6 +2071,7 @@ module Stripe
1772
2071
  discountable: nil,
1773
2072
  discounts: nil,
1774
2073
  id: nil,
2074
+ margins: nil,
1775
2075
  metadata: nil,
1776
2076
  period: nil,
1777
2077
  price_data: nil,
@@ -1785,6 +2085,7 @@ module Stripe
1785
2085
  @discountable = discountable
1786
2086
  @discounts = discounts
1787
2087
  @id = id
2088
+ @margins = margins
1788
2089
  @metadata = metadata
1789
2090
  @period = period
1790
2091
  @price_data = price_data
@@ -1959,32 +2260,88 @@ module Stripe
1959
2260
  end
1960
2261
 
1961
2262
  class Discount < Stripe::RequestParams
2263
+ class DiscountEnd < Stripe::RequestParams
2264
+ class Duration < Stripe::RequestParams
2265
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2266
+ attr_accessor :interval
2267
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2268
+ attr_accessor :interval_count
2269
+
2270
+ def initialize(interval: nil, interval_count: nil)
2271
+ @interval = interval
2272
+ @interval_count = interval_count
2273
+ end
2274
+ end
2275
+ # Time span for the redeemed discount.
2276
+ attr_accessor :duration
2277
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2278
+ attr_accessor :timestamp
2279
+ # The type of calculation made to determine when the discount ends.
2280
+ attr_accessor :type
2281
+
2282
+ def initialize(duration: nil, timestamp: nil, type: nil)
2283
+ @duration = duration
2284
+ @timestamp = timestamp
2285
+ @type = type
2286
+ end
2287
+ end
1962
2288
  # ID of the coupon to create a new discount for.
1963
2289
  attr_accessor :coupon
1964
2290
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1965
2291
  attr_accessor :discount
2292
+ # Details to determine how long the discount should be applied for.
2293
+ attr_accessor :discount_end
1966
2294
  # ID of the promotion code to create a new discount for.
1967
2295
  attr_accessor :promotion_code
1968
2296
 
1969
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2297
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1970
2298
  @coupon = coupon
1971
2299
  @discount = discount
2300
+ @discount_end = discount_end
1972
2301
  @promotion_code = promotion_code
1973
2302
  end
1974
2303
  end
1975
2304
 
1976
2305
  class InvoiceItem < Stripe::RequestParams
1977
2306
  class Discount < Stripe::RequestParams
2307
+ class DiscountEnd < Stripe::RequestParams
2308
+ class Duration < Stripe::RequestParams
2309
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2310
+ attr_accessor :interval
2311
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2312
+ attr_accessor :interval_count
2313
+
2314
+ def initialize(interval: nil, interval_count: nil)
2315
+ @interval = interval
2316
+ @interval_count = interval_count
2317
+ end
2318
+ end
2319
+ # Time span for the redeemed discount.
2320
+ attr_accessor :duration
2321
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2322
+ attr_accessor :timestamp
2323
+ # The type of calculation made to determine when the discount ends.
2324
+ attr_accessor :type
2325
+
2326
+ def initialize(duration: nil, timestamp: nil, type: nil)
2327
+ @duration = duration
2328
+ @timestamp = timestamp
2329
+ @type = type
2330
+ end
2331
+ end
1978
2332
  # ID of the coupon to create a new discount for.
1979
2333
  attr_accessor :coupon
1980
2334
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1981
2335
  attr_accessor :discount
2336
+ # Details to determine how long the discount should be applied for.
2337
+ attr_accessor :discount_end
1982
2338
  # ID of the promotion code to create a new discount for.
1983
2339
  attr_accessor :promotion_code
1984
2340
 
1985
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2341
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1986
2342
  @coupon = coupon
1987
2343
  @discount = discount
2344
+ @discount_end = discount_end
1988
2345
  @promotion_code = promotion_code
1989
2346
  end
1990
2347
  end
@@ -2110,6 +2467,458 @@ module Stripe
2110
2467
  end
2111
2468
 
2112
2469
  class ScheduleDetails < Stripe::RequestParams
2470
+ class Amendment < Stripe::RequestParams
2471
+ class AmendmentEnd < Stripe::RequestParams
2472
+ class DiscountEnd < Stripe::RequestParams
2473
+ # The ID of a specific discount.
2474
+ attr_accessor :discount
2475
+
2476
+ def initialize(discount: nil)
2477
+ @discount = discount
2478
+ end
2479
+ end
2480
+
2481
+ class Duration < Stripe::RequestParams
2482
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2483
+ attr_accessor :interval
2484
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2485
+ attr_accessor :interval_count
2486
+
2487
+ def initialize(interval: nil, interval_count: nil)
2488
+ @interval = interval
2489
+ @interval_count = interval_count
2490
+ end
2491
+ end
2492
+ # Use the `end` time of a given discount.
2493
+ attr_accessor :discount_end
2494
+ # Time span for the amendment starting from the `amendment_start`.
2495
+ attr_accessor :duration
2496
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2497
+ attr_accessor :timestamp
2498
+ # Select one of three ways to pass the `amendment_end`.
2499
+ attr_accessor :type
2500
+
2501
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2502
+ @discount_end = discount_end
2503
+ @duration = duration
2504
+ @timestamp = timestamp
2505
+ @type = type
2506
+ end
2507
+ end
2508
+
2509
+ class AmendmentStart < Stripe::RequestParams
2510
+ class AmendmentEnd < Stripe::RequestParams
2511
+ # 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.
2512
+ attr_accessor :index
2513
+
2514
+ def initialize(index: nil)
2515
+ @index = index
2516
+ end
2517
+ end
2518
+
2519
+ class DiscountEnd < Stripe::RequestParams
2520
+ # The ID of a specific discount.
2521
+ attr_accessor :discount
2522
+
2523
+ def initialize(discount: nil)
2524
+ @discount = discount
2525
+ end
2526
+ end
2527
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
2528
+ attr_accessor :amendment_end
2529
+ # Use the `end` time of a given discount.
2530
+ attr_accessor :discount_end
2531
+ # A precise Unix timestamp for the amendment to start.
2532
+ attr_accessor :timestamp
2533
+ # Select one of three ways to pass the `amendment_start`.
2534
+ attr_accessor :type
2535
+
2536
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
2537
+ @amendment_end = amendment_end
2538
+ @discount_end = discount_end
2539
+ @timestamp = timestamp
2540
+ @type = type
2541
+ end
2542
+ end
2543
+
2544
+ class DiscountAction < Stripe::RequestParams
2545
+ class Add < Stripe::RequestParams
2546
+ class DiscountEnd < Stripe::RequestParams
2547
+ # The type of calculation made to determine when the discount ends.
2548
+ attr_accessor :type
2549
+
2550
+ def initialize(type: nil)
2551
+ @type = type
2552
+ end
2553
+ end
2554
+ # The coupon code to redeem.
2555
+ attr_accessor :coupon
2556
+ # An ID of an existing discount for a coupon that was already redeemed.
2557
+ attr_accessor :discount
2558
+ # Details to determine how long the discount should be applied for.
2559
+ attr_accessor :discount_end
2560
+ # 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.
2561
+ attr_accessor :index
2562
+ # The promotion code to redeem.
2563
+ attr_accessor :promotion_code
2564
+
2565
+ def initialize(
2566
+ coupon: nil,
2567
+ discount: nil,
2568
+ discount_end: nil,
2569
+ index: nil,
2570
+ promotion_code: nil
2571
+ )
2572
+ @coupon = coupon
2573
+ @discount = discount
2574
+ @discount_end = discount_end
2575
+ @index = index
2576
+ @promotion_code = promotion_code
2577
+ end
2578
+ end
2579
+
2580
+ class Remove < Stripe::RequestParams
2581
+ # The coupon code to remove from the `discounts` array.
2582
+ attr_accessor :coupon
2583
+ # The ID of a discount to remove from the `discounts` array.
2584
+ attr_accessor :discount
2585
+ # The ID of a promotion code to remove from the `discounts` array.
2586
+ attr_accessor :promotion_code
2587
+
2588
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2589
+ @coupon = coupon
2590
+ @discount = discount
2591
+ @promotion_code = promotion_code
2592
+ end
2593
+ end
2594
+
2595
+ class Set < Stripe::RequestParams
2596
+ # The coupon code to replace the `discounts` array with.
2597
+ attr_accessor :coupon
2598
+ # An ID of an existing discount to replace the `discounts` array with.
2599
+ attr_accessor :discount
2600
+ # An ID of an existing promotion code to replace the `discounts` array with.
2601
+ attr_accessor :promotion_code
2602
+
2603
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2604
+ @coupon = coupon
2605
+ @discount = discount
2606
+ @promotion_code = promotion_code
2607
+ end
2608
+ end
2609
+ # Details of the discount to add.
2610
+ attr_accessor :add
2611
+ # Details of the discount to remove.
2612
+ attr_accessor :remove
2613
+ # Details of the discount to replace the existing discounts with.
2614
+ attr_accessor :set
2615
+ # Determines the type of discount action.
2616
+ attr_accessor :type
2617
+
2618
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2619
+ @add = add
2620
+ @remove = remove
2621
+ @set = set
2622
+ @type = type
2623
+ end
2624
+ end
2625
+
2626
+ class ItemAction < Stripe::RequestParams
2627
+ class Add < Stripe::RequestParams
2628
+ class Discount < Stripe::RequestParams
2629
+ class DiscountEnd < Stripe::RequestParams
2630
+ class Duration < Stripe::RequestParams
2631
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2632
+ attr_accessor :interval
2633
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2634
+ attr_accessor :interval_count
2635
+
2636
+ def initialize(interval: nil, interval_count: nil)
2637
+ @interval = interval
2638
+ @interval_count = interval_count
2639
+ end
2640
+ end
2641
+ # Time span for the redeemed discount.
2642
+ attr_accessor :duration
2643
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2644
+ attr_accessor :timestamp
2645
+ # The type of calculation made to determine when the discount ends.
2646
+ attr_accessor :type
2647
+
2648
+ def initialize(duration: nil, timestamp: nil, type: nil)
2649
+ @duration = duration
2650
+ @timestamp = timestamp
2651
+ @type = type
2652
+ end
2653
+ end
2654
+ # ID of the coupon to create a new discount for.
2655
+ attr_accessor :coupon
2656
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2657
+ attr_accessor :discount
2658
+ # Details to determine how long the discount should be applied for.
2659
+ attr_accessor :discount_end
2660
+ # ID of the promotion code to create a new discount for.
2661
+ attr_accessor :promotion_code
2662
+
2663
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2664
+ @coupon = coupon
2665
+ @discount = discount
2666
+ @discount_end = discount_end
2667
+ @promotion_code = promotion_code
2668
+ end
2669
+ end
2670
+
2671
+ class Trial < Stripe::RequestParams
2672
+ # 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.
2673
+ attr_accessor :converts_to
2674
+ # Determines the type of trial for this item.
2675
+ attr_accessor :type
2676
+
2677
+ def initialize(converts_to: nil, type: nil)
2678
+ @converts_to = converts_to
2679
+ @type = type
2680
+ end
2681
+ end
2682
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2683
+ attr_accessor :discounts
2684
+ # 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`.
2685
+ attr_accessor :metadata
2686
+ # The ID of the price object.
2687
+ attr_accessor :price
2688
+ # Quantity for this item.
2689
+ attr_accessor :quantity
2690
+ # 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`.
2691
+ attr_accessor :tax_rates
2692
+ # Options that configure the trial on the subscription item.
2693
+ attr_accessor :trial
2694
+
2695
+ def initialize(
2696
+ discounts: nil,
2697
+ metadata: nil,
2698
+ price: nil,
2699
+ quantity: nil,
2700
+ tax_rates: nil,
2701
+ trial: nil
2702
+ )
2703
+ @discounts = discounts
2704
+ @metadata = metadata
2705
+ @price = price
2706
+ @quantity = quantity
2707
+ @tax_rates = tax_rates
2708
+ @trial = trial
2709
+ end
2710
+ end
2711
+
2712
+ class Remove < Stripe::RequestParams
2713
+ # ID of a price to remove.
2714
+ attr_accessor :price
2715
+
2716
+ def initialize(price: nil)
2717
+ @price = price
2718
+ end
2719
+ end
2720
+
2721
+ class Set < Stripe::RequestParams
2722
+ class Discount < Stripe::RequestParams
2723
+ class DiscountEnd < Stripe::RequestParams
2724
+ class Duration < Stripe::RequestParams
2725
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2726
+ attr_accessor :interval
2727
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2728
+ attr_accessor :interval_count
2729
+
2730
+ def initialize(interval: nil, interval_count: nil)
2731
+ @interval = interval
2732
+ @interval_count = interval_count
2733
+ end
2734
+ end
2735
+ # Time span for the redeemed discount.
2736
+ attr_accessor :duration
2737
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2738
+ attr_accessor :timestamp
2739
+ # The type of calculation made to determine when the discount ends.
2740
+ attr_accessor :type
2741
+
2742
+ def initialize(duration: nil, timestamp: nil, type: nil)
2743
+ @duration = duration
2744
+ @timestamp = timestamp
2745
+ @type = type
2746
+ end
2747
+ end
2748
+ # ID of the coupon to create a new discount for.
2749
+ attr_accessor :coupon
2750
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2751
+ attr_accessor :discount
2752
+ # Details to determine how long the discount should be applied for.
2753
+ attr_accessor :discount_end
2754
+ # ID of the promotion code to create a new discount for.
2755
+ attr_accessor :promotion_code
2756
+
2757
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2758
+ @coupon = coupon
2759
+ @discount = discount
2760
+ @discount_end = discount_end
2761
+ @promotion_code = promotion_code
2762
+ end
2763
+ end
2764
+
2765
+ class Trial < Stripe::RequestParams
2766
+ # 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.
2767
+ attr_accessor :converts_to
2768
+ # Determines the type of trial for this item.
2769
+ attr_accessor :type
2770
+
2771
+ def initialize(converts_to: nil, type: nil)
2772
+ @converts_to = converts_to
2773
+ @type = type
2774
+ end
2775
+ end
2776
+ # 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`.
2777
+ attr_accessor :discounts
2778
+ # 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`.
2779
+ attr_accessor :metadata
2780
+ # The ID of the price object.
2781
+ attr_accessor :price
2782
+ # 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`.
2783
+ attr_accessor :quantity
2784
+ # 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`.
2785
+ attr_accessor :tax_rates
2786
+ # 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`.
2787
+ attr_accessor :trial
2788
+
2789
+ def initialize(
2790
+ discounts: nil,
2791
+ metadata: nil,
2792
+ price: nil,
2793
+ quantity: nil,
2794
+ tax_rates: nil,
2795
+ trial: nil
2796
+ )
2797
+ @discounts = discounts
2798
+ @metadata = metadata
2799
+ @price = price
2800
+ @quantity = quantity
2801
+ @tax_rates = tax_rates
2802
+ @trial = trial
2803
+ end
2804
+ end
2805
+ # 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.
2806
+ attr_accessor :add
2807
+ # Details of the subscription item to remove.
2808
+ attr_accessor :remove
2809
+ # 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.
2810
+ attr_accessor :set
2811
+ # Determines the type of item action.
2812
+ attr_accessor :type
2813
+
2814
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2815
+ @add = add
2816
+ @remove = remove
2817
+ @set = set
2818
+ @type = type
2819
+ end
2820
+ end
2821
+
2822
+ class MetadataAction < Stripe::RequestParams
2823
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2824
+ attr_accessor :add
2825
+ # Keys to remove from schedule phase metadata.
2826
+ attr_accessor :remove
2827
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2828
+ attr_accessor :set
2829
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
2830
+ attr_accessor :type
2831
+
2832
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2833
+ @add = add
2834
+ @remove = remove
2835
+ @set = set
2836
+ @type = type
2837
+ end
2838
+ end
2839
+
2840
+ class SetPauseCollection < Stripe::RequestParams
2841
+ class Set < Stripe::RequestParams
2842
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2843
+ attr_accessor :behavior
2844
+
2845
+ def initialize(behavior: nil)
2846
+ @behavior = behavior
2847
+ end
2848
+ end
2849
+ # Details of the pause_collection behavior to apply to the amendment.
2850
+ attr_accessor :set
2851
+ # Determines the type of the pause_collection amendment.
2852
+ attr_accessor :type
2853
+
2854
+ def initialize(set: nil, type: nil)
2855
+ @set = set
2856
+ @type = type
2857
+ end
2858
+ end
2859
+
2860
+ class TrialSettings < Stripe::RequestParams
2861
+ class EndBehavior < Stripe::RequestParams
2862
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2863
+ attr_accessor :prorate_up_front
2864
+
2865
+ def initialize(prorate_up_front: nil)
2866
+ @prorate_up_front = prorate_up_front
2867
+ end
2868
+ end
2869
+ # Defines how the subscription should behave when a trial ends.
2870
+ attr_accessor :end_behavior
2871
+
2872
+ def initialize(end_behavior: nil)
2873
+ @end_behavior = end_behavior
2874
+ end
2875
+ end
2876
+ # 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.
2877
+ attr_accessor :amendment_end
2878
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2879
+ attr_accessor :amendment_start
2880
+ # 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.
2881
+ attr_accessor :billing_cycle_anchor
2882
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2883
+ attr_accessor :discount_actions
2884
+ # Changes to the subscription items during the amendment time span.
2885
+ attr_accessor :item_actions
2886
+ # Instructions for how to modify phase metadata
2887
+ attr_accessor :metadata_actions
2888
+ # 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`.
2889
+ attr_accessor :proration_behavior
2890
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2891
+ attr_accessor :set_pause_collection
2892
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2893
+ attr_accessor :set_schedule_end
2894
+ # Settings related to subscription trials.
2895
+ attr_accessor :trial_settings
2896
+
2897
+ def initialize(
2898
+ amendment_end: nil,
2899
+ amendment_start: nil,
2900
+ billing_cycle_anchor: nil,
2901
+ discount_actions: nil,
2902
+ item_actions: nil,
2903
+ metadata_actions: nil,
2904
+ proration_behavior: nil,
2905
+ set_pause_collection: nil,
2906
+ set_schedule_end: nil,
2907
+ trial_settings: nil
2908
+ )
2909
+ @amendment_end = amendment_end
2910
+ @amendment_start = amendment_start
2911
+ @billing_cycle_anchor = billing_cycle_anchor
2912
+ @discount_actions = discount_actions
2913
+ @item_actions = item_actions
2914
+ @metadata_actions = metadata_actions
2915
+ @proration_behavior = proration_behavior
2916
+ @set_pause_collection = set_pause_collection
2917
+ @set_schedule_end = set_schedule_end
2918
+ @trial_settings = trial_settings
2919
+ end
2920
+ end
2921
+
2113
2922
  class BillingMode < Stripe::RequestParams
2114
2923
  # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2115
2924
  attr_accessor :type
@@ -2122,16 +2931,44 @@ module Stripe
2122
2931
  class Phase < Stripe::RequestParams
2123
2932
  class AddInvoiceItem < Stripe::RequestParams
2124
2933
  class Discount < Stripe::RequestParams
2934
+ class DiscountEnd < Stripe::RequestParams
2935
+ class Duration < Stripe::RequestParams
2936
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2937
+ attr_accessor :interval
2938
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2939
+ attr_accessor :interval_count
2940
+
2941
+ def initialize(interval: nil, interval_count: nil)
2942
+ @interval = interval
2943
+ @interval_count = interval_count
2944
+ end
2945
+ end
2946
+ # Time span for the redeemed discount.
2947
+ attr_accessor :duration
2948
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2949
+ attr_accessor :timestamp
2950
+ # The type of calculation made to determine when the discount ends.
2951
+ attr_accessor :type
2952
+
2953
+ def initialize(duration: nil, timestamp: nil, type: nil)
2954
+ @duration = duration
2955
+ @timestamp = timestamp
2956
+ @type = type
2957
+ end
2958
+ end
2125
2959
  # ID of the coupon to create a new discount for.
2126
2960
  attr_accessor :coupon
2127
2961
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2128
2962
  attr_accessor :discount
2963
+ # Details to determine how long the discount should be applied for.
2964
+ attr_accessor :discount_end
2129
2965
  # ID of the promotion code to create a new discount for.
2130
2966
  attr_accessor :promotion_code
2131
2967
 
2132
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2968
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2133
2969
  @coupon = coupon
2134
2970
  @discount = discount
2971
+ @discount_end = discount_end
2135
2972
  @promotion_code = promotion_code
2136
2973
  end
2137
2974
  end
@@ -2224,16 +3061,44 @@ module Stripe
2224
3061
  end
2225
3062
 
2226
3063
  class Discount < Stripe::RequestParams
3064
+ class DiscountEnd < Stripe::RequestParams
3065
+ class Duration < Stripe::RequestParams
3066
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3067
+ attr_accessor :interval
3068
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3069
+ attr_accessor :interval_count
3070
+
3071
+ def initialize(interval: nil, interval_count: nil)
3072
+ @interval = interval
3073
+ @interval_count = interval_count
3074
+ end
3075
+ end
3076
+ # Time span for the redeemed discount.
3077
+ attr_accessor :duration
3078
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3079
+ attr_accessor :timestamp
3080
+ # The type of calculation made to determine when the discount ends.
3081
+ attr_accessor :type
3082
+
3083
+ def initialize(duration: nil, timestamp: nil, type: nil)
3084
+ @duration = duration
3085
+ @timestamp = timestamp
3086
+ @type = type
3087
+ end
3088
+ end
2227
3089
  # ID of the coupon to create a new discount for.
2228
3090
  attr_accessor :coupon
2229
3091
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2230
3092
  attr_accessor :discount
3093
+ # Details to determine how long the discount should be applied for.
3094
+ attr_accessor :discount_end
2231
3095
  # ID of the promotion code to create a new discount for.
2232
3096
  attr_accessor :promotion_code
2233
3097
 
2234
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3098
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2235
3099
  @coupon = coupon
2236
3100
  @discount = discount
3101
+ @discount_end = discount_end
2237
3102
  @promotion_code = promotion_code
2238
3103
  end
2239
3104
  end
@@ -2287,16 +3152,44 @@ module Stripe
2287
3152
  end
2288
3153
 
2289
3154
  class Discount < Stripe::RequestParams
3155
+ class DiscountEnd < Stripe::RequestParams
3156
+ class Duration < Stripe::RequestParams
3157
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3158
+ attr_accessor :interval
3159
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3160
+ attr_accessor :interval_count
3161
+
3162
+ def initialize(interval: nil, interval_count: nil)
3163
+ @interval = interval
3164
+ @interval_count = interval_count
3165
+ end
3166
+ end
3167
+ # Time span for the redeemed discount.
3168
+ attr_accessor :duration
3169
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3170
+ attr_accessor :timestamp
3171
+ # The type of calculation made to determine when the discount ends.
3172
+ attr_accessor :type
3173
+
3174
+ def initialize(duration: nil, timestamp: nil, type: nil)
3175
+ @duration = duration
3176
+ @timestamp = timestamp
3177
+ @type = type
3178
+ end
3179
+ end
2290
3180
  # ID of the coupon to create a new discount for.
2291
3181
  attr_accessor :coupon
2292
3182
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2293
3183
  attr_accessor :discount
3184
+ # Details to determine how long the discount should be applied for.
3185
+ attr_accessor :discount_end
2294
3186
  # ID of the promotion code to create a new discount for.
2295
3187
  attr_accessor :promotion_code
2296
3188
 
2297
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3189
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2298
3190
  @coupon = coupon
2299
3191
  @discount = discount
3192
+ @discount_end = discount_end
2300
3193
  @promotion_code = promotion_code
2301
3194
  end
2302
3195
  end
@@ -2342,6 +3235,18 @@ module Stripe
2342
3235
  @unit_amount_decimal = unit_amount_decimal
2343
3236
  end
2344
3237
  end
3238
+
3239
+ class Trial < Stripe::RequestParams
3240
+ # 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.
3241
+ attr_accessor :converts_to
3242
+ # Determines the type of trial for this item.
3243
+ attr_accessor :type
3244
+
3245
+ def initialize(converts_to: nil, type: nil)
3246
+ @converts_to = converts_to
3247
+ @type = type
3248
+ end
3249
+ end
2345
3250
  # 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.
2346
3251
  attr_accessor :billing_thresholds
2347
3252
  # The coupons to redeem into discounts for the subscription item.
@@ -2358,6 +3263,8 @@ module Stripe
2358
3263
  attr_accessor :quantity
2359
3264
  # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
2360
3265
  attr_accessor :tax_rates
3266
+ # Options that configure the trial on the subscription item.
3267
+ attr_accessor :trial
2361
3268
 
2362
3269
  def initialize(
2363
3270
  billing_thresholds: nil,
@@ -2367,7 +3274,8 @@ module Stripe
2367
3274
  price: nil,
2368
3275
  price_data: nil,
2369
3276
  quantity: nil,
2370
- tax_rates: nil
3277
+ tax_rates: nil,
3278
+ trial: nil
2371
3279
  )
2372
3280
  @billing_thresholds = billing_thresholds
2373
3281
  @discounts = discounts
@@ -2377,6 +3285,16 @@ module Stripe
2377
3285
  @price_data = price_data
2378
3286
  @quantity = quantity
2379
3287
  @tax_rates = tax_rates
3288
+ @trial = trial
3289
+ end
3290
+ end
3291
+
3292
+ class PauseCollection < Stripe::RequestParams
3293
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3294
+ attr_accessor :behavior
3295
+
3296
+ def initialize(behavior: nil)
3297
+ @behavior = behavior
2380
3298
  end
2381
3299
  end
2382
3300
 
@@ -2391,6 +3309,23 @@ module Stripe
2391
3309
  @destination = destination
2392
3310
  end
2393
3311
  end
3312
+
3313
+ class TrialSettings < Stripe::RequestParams
3314
+ class EndBehavior < Stripe::RequestParams
3315
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3316
+ attr_accessor :prorate_up_front
3317
+
3318
+ def initialize(prorate_up_front: nil)
3319
+ @prorate_up_front = prorate_up_front
3320
+ end
3321
+ end
3322
+ # Defines how the subscription should behave when a trial ends.
3323
+ attr_accessor :end_behavior
3324
+
3325
+ def initialize(end_behavior: nil)
3326
+ @end_behavior = end_behavior
3327
+ end
3328
+ end
2394
3329
  # 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.
2395
3330
  attr_accessor :add_invoice_items
2396
3331
  # 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).
@@ -2427,6 +3362,8 @@ module Stripe
2427
3362
  attr_accessor :metadata
2428
3363
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2429
3364
  attr_accessor :on_behalf_of
3365
+ # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
3366
+ attr_accessor :pause_collection
2430
3367
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
2431
3368
  attr_accessor :proration_behavior
2432
3369
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -2435,8 +3372,12 @@ module Stripe
2435
3372
  attr_accessor :transfer_data
2436
3373
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2437
3374
  attr_accessor :trial
3375
+ # Specify trial behavior when crossing phase boundaries
3376
+ attr_accessor :trial_continuation
2438
3377
  # 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`
2439
3378
  attr_accessor :trial_end
3379
+ # Settings related to subscription trials.
3380
+ attr_accessor :trial_settings
2440
3381
 
2441
3382
  def initialize(
2442
3383
  add_invoice_items: nil,
@@ -2457,11 +3398,14 @@ module Stripe
2457
3398
  iterations: nil,
2458
3399
  metadata: nil,
2459
3400
  on_behalf_of: nil,
3401
+ pause_collection: nil,
2460
3402
  proration_behavior: nil,
2461
3403
  start_date: nil,
2462
3404
  transfer_data: nil,
2463
3405
  trial: nil,
2464
- trial_end: nil
3406
+ trial_continuation: nil,
3407
+ trial_end: nil,
3408
+ trial_settings: nil
2465
3409
  )
2466
3410
  @add_invoice_items = add_invoice_items
2467
3411
  @application_fee_percent = application_fee_percent
@@ -2481,26 +3425,95 @@ module Stripe
2481
3425
  @iterations = iterations
2482
3426
  @metadata = metadata
2483
3427
  @on_behalf_of = on_behalf_of
3428
+ @pause_collection = pause_collection
2484
3429
  @proration_behavior = proration_behavior
2485
3430
  @start_date = start_date
2486
3431
  @transfer_data = transfer_data
2487
3432
  @trial = trial
3433
+ @trial_continuation = trial_continuation
2488
3434
  @trial_end = trial_end
3435
+ @trial_settings = trial_settings
3436
+ end
3437
+ end
3438
+
3439
+ class Prebilling < Stripe::RequestParams
3440
+ class BillUntil < Stripe::RequestParams
3441
+ class AmendmentEnd < Stripe::RequestParams
3442
+ # 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.
3443
+ attr_accessor :index
3444
+
3445
+ def initialize(index: nil)
3446
+ @index = index
3447
+ end
3448
+ end
3449
+
3450
+ class Duration < Stripe::RequestParams
3451
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3452
+ attr_accessor :interval
3453
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3454
+ attr_accessor :interval_count
3455
+
3456
+ def initialize(interval: nil, interval_count: nil)
3457
+ @interval = interval
3458
+ @interval_count = interval_count
3459
+ end
3460
+ end
3461
+ # End the prebilled period when a specified amendment ends.
3462
+ attr_accessor :amendment_end
3463
+ # Time span for prebilling, starting from `bill_from`.
3464
+ attr_accessor :duration
3465
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3466
+ attr_accessor :timestamp
3467
+ # Select one of several ways to pass the `bill_until` value.
3468
+ attr_accessor :type
3469
+
3470
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
3471
+ @amendment_end = amendment_end
3472
+ @duration = duration
3473
+ @timestamp = timestamp
3474
+ @type = type
3475
+ end
3476
+ end
3477
+ # The end of the prebilled time period.
3478
+ attr_accessor :bill_until
3479
+ # This is used to determine the number of billing cycles to prebill.
3480
+ attr_accessor :iterations
3481
+
3482
+ def initialize(bill_until: nil, iterations: nil)
3483
+ @bill_until = bill_until
3484
+ @iterations = iterations
2489
3485
  end
2490
3486
  end
3487
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
3488
+ attr_accessor :amendments
3489
+ # 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.
3490
+ attr_accessor :billing_behavior
2491
3491
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2492
3492
  attr_accessor :billing_mode
2493
3493
  # 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.
2494
3494
  attr_accessor :end_behavior
2495
3495
  # 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.
2496
3496
  attr_accessor :phases
3497
+ # Provide any time periods to bill in advance.
3498
+ attr_accessor :prebilling
2497
3499
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2498
3500
  attr_accessor :proration_behavior
2499
3501
 
2500
- def initialize(billing_mode: nil, end_behavior: nil, phases: nil, proration_behavior: nil)
3502
+ def initialize(
3503
+ amendments: nil,
3504
+ billing_behavior: nil,
3505
+ billing_mode: nil,
3506
+ end_behavior: nil,
3507
+ phases: nil,
3508
+ prebilling: nil,
3509
+ proration_behavior: nil
3510
+ )
3511
+ @amendments = amendments
3512
+ @billing_behavior = billing_behavior
2501
3513
  @billing_mode = billing_mode
2502
3514
  @end_behavior = end_behavior
2503
3515
  @phases = phases
3516
+ @prebilling = prebilling
2504
3517
  @proration_behavior = proration_behavior
2505
3518
  end
2506
3519
  end
@@ -2526,16 +3539,44 @@ module Stripe
2526
3539
  end
2527
3540
 
2528
3541
  class Discount < Stripe::RequestParams
3542
+ class DiscountEnd < Stripe::RequestParams
3543
+ class Duration < Stripe::RequestParams
3544
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3545
+ attr_accessor :interval
3546
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3547
+ attr_accessor :interval_count
3548
+
3549
+ def initialize(interval: nil, interval_count: nil)
3550
+ @interval = interval
3551
+ @interval_count = interval_count
3552
+ end
3553
+ end
3554
+ # Time span for the redeemed discount.
3555
+ attr_accessor :duration
3556
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3557
+ attr_accessor :timestamp
3558
+ # The type of calculation made to determine when the discount ends.
3559
+ attr_accessor :type
3560
+
3561
+ def initialize(duration: nil, timestamp: nil, type: nil)
3562
+ @duration = duration
3563
+ @timestamp = timestamp
3564
+ @type = type
3565
+ end
3566
+ end
2529
3567
  # ID of the coupon to create a new discount for.
2530
3568
  attr_accessor :coupon
2531
3569
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2532
3570
  attr_accessor :discount
3571
+ # Details to determine how long the discount should be applied for.
3572
+ attr_accessor :discount_end
2533
3573
  # ID of the promotion code to create a new discount for.
2534
3574
  attr_accessor :promotion_code
2535
3575
 
2536
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3576
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2537
3577
  @coupon = coupon
2538
3578
  @discount = discount
3579
+ @discount_end = discount_end
2539
3580
  @promotion_code = promotion_code
2540
3581
  end
2541
3582
  end
@@ -2630,6 +3671,15 @@ module Stripe
2630
3671
  @tax_rates = tax_rates
2631
3672
  end
2632
3673
  end
3674
+
3675
+ class Prebilling < Stripe::RequestParams
3676
+ # This is used to determine the number of billing cycles to prebill.
3677
+ attr_accessor :iterations
3678
+
3679
+ def initialize(iterations: nil)
3680
+ @iterations = iterations
3681
+ end
3682
+ end
2633
3683
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/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`.
2634
3684
  attr_accessor :billing_cycle_anchor
2635
3685
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
@@ -2644,6 +3694,8 @@ module Stripe
2644
3694
  attr_accessor :default_tax_rates
2645
3695
  # A list of up to 20 subscription items, each with an attached price.
2646
3696
  attr_accessor :items
3697
+ # The pre-billing to apply to the subscription as a preview.
3698
+ attr_accessor :prebilling
2647
3699
  # Determines how to handle [prorations](https://stripe.com/docs/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`.
2648
3700
  attr_accessor :proration_behavior
2649
3701
  # 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'.
@@ -2663,6 +3715,7 @@ module Stripe
2663
3715
  cancel_now: nil,
2664
3716
  default_tax_rates: nil,
2665
3717
  items: nil,
3718
+ prebilling: nil,
2666
3719
  proration_behavior: nil,
2667
3720
  proration_date: nil,
2668
3721
  resume_at: nil,
@@ -2676,6 +3729,7 @@ module Stripe
2676
3729
  @cancel_now = cancel_now
2677
3730
  @default_tax_rates = default_tax_rates
2678
3731
  @items = items
3732
+ @prebilling = prebilling
2679
3733
  @proration_behavior = proration_behavior
2680
3734
  @proration_date = proration_date
2681
3735
  @resume_at = resume_at
@@ -2689,6 +3743,8 @@ module Stripe
2689
3743
  attr_accessor :currency
2690
3744
  # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
2691
3745
  attr_accessor :customer
3746
+ # The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.
3747
+ attr_accessor :customer_account
2692
3748
  # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
2693
3749
  attr_accessor :customer_details
2694
3750
  # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
@@ -2716,6 +3772,7 @@ module Stripe
2716
3772
  automatic_tax: nil,
2717
3773
  currency: nil,
2718
3774
  customer: nil,
3775
+ customer_account: nil,
2719
3776
  customer_details: nil,
2720
3777
  discounts: nil,
2721
3778
  expand: nil,
@@ -2731,6 +3788,7 @@ module Stripe
2731
3788
  @automatic_tax = automatic_tax
2732
3789
  @currency = currency
2733
3790
  @customer = customer
3791
+ @customer_account = customer_account
2734
3792
  @customer_details = customer_details
2735
3793
  @discounts = discounts
2736
3794
  @expand = expand