stripe 15.4.0 → 15.5.0.pre.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (597) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1639 -662
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +32 -0
  7. data/lib/stripe/api_version.rb +1 -2
  8. data/lib/stripe/errors.rb +60 -0
  9. data/lib/stripe/event_types.rb +102 -0
  10. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  11. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  17. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
  19. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  23. data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
  24. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  25. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  26. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  27. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  30. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  53. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  58. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  59. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  60. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  61. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  62. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
  65. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  66. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  67. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  68. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  69. data/lib/stripe/object_types.rb +53 -0
  70. data/lib/stripe/resources/account.rb +653 -1
  71. data/lib/stripe/resources/account_notice.rb +123 -0
  72. data/lib/stripe/resources/account_session.rb +256 -1
  73. data/lib/stripe/resources/balance_settings.rb +105 -0
  74. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  75. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  76. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  77. data/lib/stripe/resources/billing/meter_usage.rb +23 -0
  78. data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
  79. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  80. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  81. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  82. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  83. data/lib/stripe/resources/card.rb +2 -0
  84. data/lib/stripe/resources/cash_balance.rb +2 -0
  85. data/lib/stripe/resources/charge.rb +1538 -0
  86. data/lib/stripe/resources/checkout/session.rb +399 -3
  87. data/lib/stripe/resources/confirmation_token.rb +170 -0
  88. data/lib/stripe/resources/coupon.rb +30 -1
  89. data/lib/stripe/resources/credit_note.rb +6 -0
  90. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  91. data/lib/stripe/resources/customer.rb +2 -0
  92. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  93. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  94. data/lib/stripe/resources/customer_session.rb +6 -1
  95. data/lib/stripe/resources/discount.rb +2 -0
  96. data/lib/stripe/resources/dispute.rb +11 -0
  97. data/lib/stripe/resources/event.rb +31 -0
  98. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  99. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  100. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  101. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  102. data/lib/stripe/resources/fx_quote.rb +186 -0
  103. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  104. data/lib/stripe/resources/invoice.rb +1140 -16
  105. data/lib/stripe/resources/invoice_item.rb +78 -2
  106. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  107. data/lib/stripe/resources/invoice_payment.rb +6 -1
  108. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  109. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  110. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  111. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  112. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  113. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  114. data/lib/stripe/resources/line_item.rb +37 -0
  115. data/lib/stripe/resources/mandate.rb +24 -0
  116. data/lib/stripe/resources/margin.rb +115 -0
  117. data/lib/stripe/resources/order.rb +2958 -0
  118. data/lib/stripe/resources/payment_attempt_record.rb +1101 -0
  119. data/lib/stripe/resources/payment_intent.rb +9469 -3712
  120. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  121. data/lib/stripe/resources/payment_method.rb +192 -1
  122. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  123. data/lib/stripe/resources/payment_record.rb +1630 -0
  124. data/lib/stripe/resources/payout.rb +6 -0
  125. data/lib/stripe/resources/price.rb +30 -0
  126. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  127. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  128. data/lib/stripe/resources/promotion_code.rb +10 -0
  129. data/lib/stripe/resources/quote.rb +2038 -7
  130. data/lib/stripe/resources/quote_line.rb +274 -0
  131. data/lib/stripe/resources/quote_preview_invoice.rb +680 -0
  132. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +371 -0
  133. data/lib/stripe/resources/refund.rb +9 -0
  134. data/lib/stripe/resources/setup_attempt.rb +21 -0
  135. data/lib/stripe/resources/setup_intent.rb +578 -9
  136. data/lib/stripe/resources/source.rb +29 -0
  137. data/lib/stripe/resources/subscription.rb +365 -9
  138. data/lib/stripe/resources/subscription_item.rb +84 -3
  139. data/lib/stripe/resources/subscription_schedule.rb +1007 -10
  140. data/lib/stripe/resources/tax/association.rb +66 -0
  141. data/lib/stripe/resources/tax/form.rb +211 -0
  142. data/lib/stripe/resources/tax_id.rb +12 -2
  143. data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
  144. data/lib/stripe/resources/terminal/reader.rb +8 -0
  145. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  146. data/lib/stripe/resources/transfer.rb +6 -0
  147. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  148. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  149. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  150. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  151. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  152. data/lib/stripe/resources/v2/core/account.rb +1930 -0
  153. data/lib/stripe/resources/v2/core/account_link.rb +72 -0
  154. data/lib/stripe/resources/v2/core/person.rb +276 -0
  155. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  156. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  157. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  158. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  159. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  160. data/lib/stripe/resources/v2/money_management/financial_account.rb +77 -0
  161. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  162. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  163. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  164. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  165. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  166. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  167. data/lib/stripe/resources/v2/money_management/payout_method.rb +77 -0
  168. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  169. data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
  170. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  171. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  172. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  173. data/lib/stripe/resources/v2/payments/off_session_payment.rb +89 -0
  174. data/lib/stripe/resources.rb +109 -0
  175. data/lib/stripe/services/account_notice_service.rb +101 -0
  176. data/lib/stripe/services/account_service.rb +562 -1
  177. data/lib/stripe/services/account_session_service.rb +226 -1
  178. data/lib/stripe/services/balance_settings_service.rb +96 -0
  179. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  180. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  181. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  182. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  183. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  184. data/lib/stripe/services/billing_service.rb +2 -1
  185. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  186. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  187. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  188. data/lib/stripe/services/capital_service.rb +15 -0
  189. data/lib/stripe/services/charge_service.rb +1418 -0
  190. data/lib/stripe/services/checkout/session_service.rb +316 -3
  191. data/lib/stripe/services/coupon_service.rb +17 -1
  192. data/lib/stripe/services/credit_note_service.rb +4 -0
  193. data/lib/stripe/services/customer_session_service.rb +4 -1
  194. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  195. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  196. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  197. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  198. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  199. data/lib/stripe/services/financial_connections_service.rb +2 -1
  200. data/lib/stripe/services/fx_quote_service.rb +123 -0
  201. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  202. data/lib/stripe/services/invoice_item_service.rb +74 -2
  203. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  204. data/lib/stripe/services/invoice_payment_service.rb +4 -1
  205. data/lib/stripe/services/invoice_service.rb +1074 -16
  206. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  207. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  208. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  209. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  210. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  211. data/lib/stripe/services/issuing_service.rb +5 -1
  212. data/lib/stripe/services/margin_service.rb +119 -0
  213. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  214. data/lib/stripe/services/order_service.rb +2388 -0
  215. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  216. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  217. data/lib/stripe/services/payment_intent_service.rb +5724 -435
  218. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  219. data/lib/stripe/services/payment_method_service.rb +120 -1
  220. data/lib/stripe/services/payment_record_service.rb +542 -0
  221. data/lib/stripe/services/payout_service.rb +4 -0
  222. data/lib/stripe/services/price_service.rb +19 -0
  223. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  224. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  225. data/lib/stripe/services/privacy_service.rb +13 -0
  226. data/lib/stripe/services/promotion_code_service.rb +8 -0
  227. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  228. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  229. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  230. data/lib/stripe/services/quote_service.rb +1723 -8
  231. data/lib/stripe/services/setup_intent_service.rb +538 -9
  232. data/lib/stripe/services/subscription_item_service.rb +75 -3
  233. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  234. data/lib/stripe/services/subscription_service.rb +309 -9
  235. data/lib/stripe/services/tax/association_service.rb +31 -0
  236. data/lib/stripe/services/tax/form_service.rb +100 -0
  237. data/lib/stripe/services/tax_id_service.rb +8 -2
  238. data/lib/stripe/services/tax_service.rb +3 -1
  239. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  240. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  241. data/lib/stripe/services/terminal_service.rb +3 -1
  242. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  243. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  244. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  245. data/lib/stripe/services/transfer_service.rb +4 -0
  246. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  247. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  248. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  249. data/lib/stripe/services/v1_services.rb +11 -1
  250. data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
  251. data/lib/stripe/services/v2/core/account_service.rb +4522 -0
  252. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  253. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  254. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  255. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  256. data/lib/stripe/services/v2/core_service.rb +4 -1
  257. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  258. data/lib/stripe/services/v2/money_management/financial_account_service.rb +116 -0
  259. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  260. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  261. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  262. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  263. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  264. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  265. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  266. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  267. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  268. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  269. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  270. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  271. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  272. data/lib/stripe/services/v2/payment_service.rb +15 -0
  273. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
  274. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  275. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
  276. data/lib/stripe/services/v2_services.rb +4 -1
  277. data/lib/stripe/services.rb +55 -0
  278. data/lib/stripe/stripe_configuration.rb +3 -1
  279. data/lib/stripe/stripe_object.rb +1 -1
  280. data/lib/stripe/util.rb +7 -1
  281. data/lib/stripe/version.rb +1 -1
  282. data/lib/stripe.rb +53 -0
  283. data/rbi/stripe.rbi +199145 -0
  284. data/stripe.gemspec +4 -1
  285. metadata +169 -324
  286. data/rbi/stripe/resources/account.rbi +0 -4995
  287. data/rbi/stripe/resources/account_link.rbi +0 -76
  288. data/rbi/stripe/resources/account_session.rbi +0 -1074
  289. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  290. data/rbi/stripe/resources/application.rbi +0 -20
  291. data/rbi/stripe/resources/application_fee.rbi +0 -118
  292. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  293. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  294. data/rbi/stripe/resources/balance.rbi +0 -235
  295. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  296. data/rbi/stripe/resources/bank_account.rbi +0 -127
  297. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  298. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  299. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  300. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  301. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  302. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  303. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  304. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  305. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  306. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -703
  307. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  308. data/rbi/stripe/resources/capability.rbi +0 -125
  309. data/rbi/stripe/resources/card.rbi +0 -125
  310. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  311. data/rbi/stripe/resources/charge.rbi +0 -2089
  312. data/rbi/stripe/resources/checkout/session.rbi +0 -4095
  313. data/rbi/stripe/resources/climate/order.rbi +0 -245
  314. data/rbi/stripe/resources/climate/product.rbi +0 -75
  315. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  316. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  317. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  318. data/rbi/stripe/resources/country_spec.rbi +0 -85
  319. data/rbi/stripe/resources/coupon.rbi +0 -250
  320. data/rbi/stripe/resources/credit_note.rbi +0 -752
  321. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  322. data/rbi/stripe/resources/customer.rbi +0 -1005
  323. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  324. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  325. data/rbi/stripe/resources/customer_session.rbi +0 -200
  326. data/rbi/stripe/resources/discount.rbi +0 -53
  327. data/rbi/stripe/resources/dispute.rbi +0 -761
  328. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  329. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  330. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  331. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  332. data/rbi/stripe/resources/event.rbi +0 -137
  333. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  334. data/rbi/stripe/resources/file.rbi +0 -143
  335. data/rbi/stripe/resources/file_link.rbi +0 -141
  336. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  337. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  338. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  339. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  340. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  341. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  342. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  343. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  344. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  345. data/rbi/stripe/resources/invoice.rbi +0 -3858
  346. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  347. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  348. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  349. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  350. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  351. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  352. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  353. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  354. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  355. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  356. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  357. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  358. data/rbi/stripe/resources/line_item.rbi +0 -72
  359. data/rbi/stripe/resources/login_link.rbi +0 -19
  360. data/rbi/stripe/resources/mandate.rbi +0 -191
  361. data/rbi/stripe/resources/payment_intent.rbi +0 -9997
  362. data/rbi/stripe/resources/payment_link.rbi +0 -1893
  363. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  364. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  365. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  366. data/rbi/stripe/resources/payout.rbi +0 -300
  367. data/rbi/stripe/resources/person.rbi +0 -401
  368. data/rbi/stripe/resources/plan.rbi +0 -371
  369. data/rbi/stripe/resources/price.rbi +0 -694
  370. data/rbi/stripe/resources/product.rbi +0 -555
  371. data/rbi/stripe/resources/product_feature.rbi +0 -26
  372. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  373. data/rbi/stripe/resources/quote.rbi +0 -1145
  374. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  375. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  376. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  377. data/rbi/stripe/resources/refund.rbi +0 -523
  378. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  379. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  380. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  381. data/rbi/stripe/resources/reversal.rbi +0 -51
  382. data/rbi/stripe/resources/review.rbi +0 -154
  383. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  384. data/rbi/stripe/resources/setup_intent.rbi +0 -3978
  385. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  386. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  387. data/rbi/stripe/resources/source.rbi +0 -1496
  388. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  389. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  390. data/rbi/stripe/resources/subscription.rbi +0 -2080
  391. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  392. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1673
  393. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  394. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  395. data/rbi/stripe/resources/tax/registration.rbi +0 -3216
  396. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  397. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  398. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  399. data/rbi/stripe/resources/tax_code.rbi +0 -44
  400. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  401. data/rbi/stripe/resources/tax_id.rbi +0 -165
  402. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  403. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1595
  404. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  405. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  406. data/rbi/stripe/resources/terminal/reader.rbi +0 -994
  407. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  408. data/rbi/stripe/resources/token.rbi +0 -1283
  409. data/rbi/stripe/resources/topup.rbi +0 -222
  410. data/rbi/stripe/resources/transfer.rbi +0 -199
  411. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  412. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  413. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  414. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  415. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  416. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  417. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  418. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  419. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  420. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  421. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  422. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  423. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  424. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  425. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  426. data/rbi/stripe/resources/v2/event.rbi +0 -48
  427. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  428. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  429. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  430. data/rbi/stripe/services/account_link_service.rbi +0 -60
  431. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  432. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  433. data/rbi/stripe/services/account_service.rbi +0 -4281
  434. data/rbi/stripe/services/account_session_service.rbi +0 -685
  435. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  436. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  437. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  438. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  439. data/rbi/stripe/services/apps_service.rbi +0 -9
  440. data/rbi/stripe/services/balance_service.rbi +0 -21
  441. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  442. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  443. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  444. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  445. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  446. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  447. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  448. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  449. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  450. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -555
  451. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  452. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  453. data/rbi/stripe/services/billing_service.rbi +0 -15
  454. data/rbi/stripe/services/charge_service.rbi +0 -448
  455. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  456. data/rbi/stripe/services/checkout/session_service.rbi +0 -2690
  457. data/rbi/stripe/services/checkout_service.rbi +0 -9
  458. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  459. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  460. data/rbi/stripe/services/climate_service.rbi +0 -11
  461. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  462. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  463. data/rbi/stripe/services/coupon_service.rbi +0 -194
  464. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  465. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  466. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  467. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  468. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  469. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  470. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  471. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  472. data/rbi/stripe/services/customer_service.rbi +0 -647
  473. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  474. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  475. data/rbi/stripe/services/dispute_service.rbi +0 -424
  476. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  477. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  478. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  479. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  480. data/rbi/stripe/services/event_service.rbi +0 -83
  481. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  482. data/rbi/stripe/services/file_link_service.rbi +0 -124
  483. data/rbi/stripe/services/file_service.rbi +0 -116
  484. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  485. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  486. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  487. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  488. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  489. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  490. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  491. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  492. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  493. data/rbi/stripe/services/identity_service.rbi +0 -10
  494. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  495. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  496. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  497. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  498. data/rbi/stripe/services/invoice_service.rbi +0 -3027
  499. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  500. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  501. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  502. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  503. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  504. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  505. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  506. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  507. data/rbi/stripe/services/issuing_service.rbi +0 -16
  508. data/rbi/stripe/services/mandate_service.rbi +0 -20
  509. data/rbi/stripe/services/payment_intent_service.rbi +0 -7994
  510. data/rbi/stripe/services/payment_link_service.rbi +0 -1441
  511. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  512. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  513. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  514. data/rbi/stripe/services/payout_service.rbi +0 -205
  515. data/rbi/stripe/services/plan_service.rbi +0 -282
  516. data/rbi/stripe/services/price_service.rbi +0 -546
  517. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  518. data/rbi/stripe/services/product_service.rbi +0 -477
  519. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  520. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  521. data/rbi/stripe/services/quote_service.rbi +0 -699
  522. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  523. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  524. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  525. data/rbi/stripe/services/radar_service.rbi +0 -11
  526. data/rbi/stripe/services/refund_service.rbi +0 -185
  527. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  528. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  529. data/rbi/stripe/services/reporting_service.rbi +0 -10
  530. data/rbi/stripe/services/review_service.rbi +0 -84
  531. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  532. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  533. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  534. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  535. data/rbi/stripe/services/sigma_service.rbi +0 -9
  536. data/rbi/stripe/services/source_service.rbi +0 -663
  537. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  538. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1333
  539. data/rbi/stripe/services/subscription_service.rbi +0 -1684
  540. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  541. data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
  542. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  543. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  544. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  545. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  546. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  547. data/rbi/stripe/services/tax_service.rbi +0 -12
  548. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1286
  549. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  550. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  551. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  552. data/rbi/stripe/services/terminal_service.rbi +0 -12
  553. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  554. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  555. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  556. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  557. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  558. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  559. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  560. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  561. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  562. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  563. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  564. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  565. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  566. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  567. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  568. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  569. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  570. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  571. data/rbi/stripe/services/token_service.rbi +0 -1257
  572. data/rbi/stripe/services/topup_service.rbi +0 -176
  573. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  574. data/rbi/stripe/services/transfer_service.rbi +0 -152
  575. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  576. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  577. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  578. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  579. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  580. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  581. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  582. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  583. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  584. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  585. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  586. data/rbi/stripe/services/treasury_service.rbi +0 -18
  587. data/rbi/stripe/services/v1_services.rbi +0 -77
  588. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  589. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  590. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  591. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  592. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  593. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  594. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  595. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  596. data/rbi/stripe/services/v2_services.rbi +0 -10
  597. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -49,6 +49,25 @@ module Stripe
49
49
 
50
50
  nested_resource_class_methods :line, operations: %i[list]
51
51
 
52
+ class AmountsDue < Stripe::StripeObject
53
+ # Incremental amount due for this payment in cents (or local equivalent).
54
+ attr_reader :amount
55
+ # The amount in cents (or local equivalent) that was paid for this payment.
56
+ attr_reader :amount_paid
57
+ # The difference between the payment’s amount and amount_paid, in cents (or local equivalent).
58
+ attr_reader :amount_remaining
59
+ # Number of days from when invoice is finalized until the payment is due.
60
+ attr_reader :days_until_due
61
+ # An arbitrary string attached to the object. Often useful for displaying to users.
62
+ attr_reader :description
63
+ # Date on which a payment plan’s payment is due.
64
+ attr_reader :due_date
65
+ # Timestamp when the payment was paid.
66
+ attr_reader :paid_at
67
+ # The status of the payment, one of `open`, `paid`, or `past_due`
68
+ attr_reader :status
69
+ end
70
+
52
71
  class AutomaticTax < Stripe::StripeObject
53
72
  class Liability < Stripe::StripeObject
54
73
  # The connected account being referenced when `type` is `account`.
@@ -221,9 +240,17 @@ module Stripe
221
240
  end
222
241
 
223
242
  class SubscriptionDetails < Stripe::StripeObject
243
+ class PauseCollection < Stripe::StripeObject
244
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
245
+ attr_reader :behavior
246
+ # The time after which the subscription will resume collecting payments.
247
+ attr_reader :resumes_at
248
+ end
224
249
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization.
225
250
  # *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
226
251
  attr_reader :metadata
252
+ # 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).
253
+ attr_reader :pause_collection
227
254
  # The subscription that generated this invoice
228
255
  attr_reader :subscription
229
256
  # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
@@ -283,14 +310,32 @@ module Stripe
283
310
  attr_reader :funding_type
284
311
  end
285
312
 
313
+ class IdBankTransfer < Stripe::StripeObject; end
286
314
  class Konbini < Stripe::StripeObject; end
287
315
  class SepaDebit < Stripe::StripeObject; end
288
316
 
317
+ class Upi < Stripe::StripeObject
318
+ class MandateOptions < Stripe::StripeObject
319
+ # Amount to be charged for future payments.
320
+ attr_reader :amount
321
+ # 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.
322
+ attr_reader :amount_type
323
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
324
+ attr_reader :description
325
+ # 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.
326
+ attr_reader :end_date
327
+ end
328
+ # Attribute for field mandate_options
329
+ attr_reader :mandate_options
330
+ end
331
+
289
332
  class UsBankAccount < Stripe::StripeObject
290
333
  class FinancialConnections < Stripe::StripeObject
291
334
  class Filters < Stripe::StripeObject
292
335
  # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
293
336
  attr_reader :account_subcategories
337
+ # The institution to use to filter for possible accounts to link.
338
+ attr_reader :institution
294
339
  end
295
340
  # Attribute for field filters
296
341
  attr_reader :filters
@@ -312,10 +357,14 @@ module Stripe
312
357
  attr_reader :card
313
358
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
314
359
  attr_reader :customer_balance
360
+ # 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.
361
+ attr_reader :id_bank_transfer
315
362
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
316
363
  attr_reader :konbini
317
364
  # 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.
318
365
  attr_reader :sepa_debit
366
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
367
+ attr_reader :upi
319
368
  # 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.
320
369
  attr_reader :us_bank_account
321
370
  end
@@ -425,6 +474,13 @@ module Stripe
425
474
  attr_reader :discount
426
475
  end
427
476
 
477
+ class TotalMarginAmount < Stripe::StripeObject
478
+ # The amount, in cents (or local equivalent), of the reduction in line item amount.
479
+ attr_reader :amount
480
+ # The margin that was applied to get this margin amount.
481
+ attr_reader :margin
482
+ end
483
+
428
484
  class TotalPretaxCreditAmount < Stripe::StripeObject
429
485
  # The amount, in cents (or local equivalent), of the pretax credit amount.
430
486
  attr_reader :amount
@@ -432,6 +488,8 @@ module Stripe
432
488
  attr_reader :credit_balance_transaction
433
489
  # The discount that was applied to get this pretax credit amount.
434
490
  attr_reader :discount
491
+ # The margin that was applied to get this pretax credit amount.
492
+ attr_reader :margin
435
493
  # Type of the pretax credit amount referenced.
436
494
  attr_reader :type
437
495
  end
@@ -458,6 +516,24 @@ module Stripe
458
516
  class DeleteParams < Stripe::RequestParams; end
459
517
 
460
518
  class UpdateParams < Stripe::RequestParams
519
+ class AmountsDue < Stripe::RequestParams
520
+ # The amount in cents (or local equivalent).
521
+ attr_accessor :amount
522
+ # Number of days from when invoice is finalized until the payment is due.
523
+ attr_accessor :days_until_due
524
+ # An arbitrary string attached to the object. Often useful for displaying to users.
525
+ attr_accessor :description
526
+ # Date on which a payment plan’s payment is due.
527
+ attr_accessor :due_date
528
+
529
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
530
+ @amount = amount
531
+ @days_until_due = days_until_due
532
+ @description = description
533
+ @due_date = due_date
534
+ end
535
+ end
536
+
461
537
  class AutomaticTax < Stripe::RequestParams
462
538
  class Liability < Stripe::RequestParams
463
539
  # The connected account being referenced when `type` is `account`.
@@ -494,16 +570,44 @@ module Stripe
494
570
  end
495
571
 
496
572
  class Discount < Stripe::RequestParams
573
+ class DiscountEnd < Stripe::RequestParams
574
+ class Duration < Stripe::RequestParams
575
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
576
+ attr_accessor :interval
577
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
578
+ attr_accessor :interval_count
579
+
580
+ def initialize(interval: nil, interval_count: nil)
581
+ @interval = interval
582
+ @interval_count = interval_count
583
+ end
584
+ end
585
+ # Time span for the redeemed discount.
586
+ attr_accessor :duration
587
+ # A precise Unix timestamp for the discount to end. Must be in the future.
588
+ attr_accessor :timestamp
589
+ # The type of calculation made to determine when the discount ends.
590
+ attr_accessor :type
591
+
592
+ def initialize(duration: nil, timestamp: nil, type: nil)
593
+ @duration = duration
594
+ @timestamp = timestamp
595
+ @type = type
596
+ end
597
+ end
497
598
  # ID of the coupon to create a new discount for.
498
599
  attr_accessor :coupon
499
600
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
500
601
  attr_accessor :discount
602
+ # Details to determine how long the discount should be applied for.
603
+ attr_accessor :discount_end
501
604
  # ID of the promotion code to create a new discount for.
502
605
  attr_accessor :promotion_code
503
606
 
504
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
607
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
505
608
  @coupon = coupon
506
609
  @discount = discount
610
+ @discount_end = discount_end
507
611
  @promotion_code = promotion_code
508
612
  end
509
613
  end
@@ -623,17 +727,47 @@ module Stripe
623
727
  end
624
728
  end
625
729
 
730
+ class IdBankTransfer < Stripe::RequestParams; end
626
731
  class Konbini < Stripe::RequestParams; end
627
732
  class SepaDebit < Stripe::RequestParams; end
628
733
 
734
+ class Upi < Stripe::RequestParams
735
+ class MandateOptions < Stripe::RequestParams
736
+ # Amount to be charged for future payments.
737
+ attr_accessor :amount
738
+ # 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.
739
+ attr_accessor :amount_type
740
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
741
+ attr_accessor :description
742
+ # 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.
743
+ attr_accessor :end_date
744
+
745
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
746
+ @amount = amount
747
+ @amount_type = amount_type
748
+ @description = description
749
+ @end_date = end_date
750
+ end
751
+ end
752
+ # Configuration options for setting up an eMandate
753
+ attr_accessor :mandate_options
754
+
755
+ def initialize(mandate_options: nil)
756
+ @mandate_options = mandate_options
757
+ end
758
+ end
759
+
629
760
  class UsBankAccount < Stripe::RequestParams
630
761
  class FinancialConnections < Stripe::RequestParams
631
762
  class Filters < Stripe::RequestParams
632
763
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
633
764
  attr_accessor :account_subcategories
765
+ # ID of the institution to use to filter for selectable accounts.
766
+ attr_accessor :institution
634
767
 
635
- def initialize(account_subcategories: nil)
768
+ def initialize(account_subcategories: nil, institution: nil)
636
769
  @account_subcategories = account_subcategories
770
+ @institution = institution
637
771
  end
638
772
  end
639
773
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -667,10 +801,14 @@ module Stripe
667
801
  attr_accessor :card
668
802
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
669
803
  attr_accessor :customer_balance
804
+ # 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.
805
+ attr_accessor :id_bank_transfer
670
806
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
671
807
  attr_accessor :konbini
672
808
  # 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.
673
809
  attr_accessor :sepa_debit
810
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
811
+ attr_accessor :upi
674
812
  # 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.
675
813
  attr_accessor :us_bank_account
676
814
 
@@ -679,16 +817,20 @@ module Stripe
679
817
  bancontact: nil,
680
818
  card: nil,
681
819
  customer_balance: nil,
820
+ id_bank_transfer: nil,
682
821
  konbini: nil,
683
822
  sepa_debit: nil,
823
+ upi: nil,
684
824
  us_bank_account: nil
685
825
  )
686
826
  @acss_debit = acss_debit
687
827
  @bancontact = bancontact
688
828
  @card = card
689
829
  @customer_balance = customer_balance
830
+ @id_bank_transfer = id_bank_transfer
690
831
  @konbini = konbini
691
832
  @sepa_debit = sepa_debit
833
+ @upi = upi
692
834
  @us_bank_account = us_bank_account
693
835
  end
694
836
  end
@@ -898,6 +1040,8 @@ module Stripe
898
1040
  end
899
1041
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
900
1042
  attr_accessor :account_tax_ids
1043
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1044
+ attr_accessor :amounts_due
901
1045
  # 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).
902
1046
  attr_accessor :application_fee_amount
903
1047
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -912,6 +1056,8 @@ module Stripe
912
1056
  attr_accessor :custom_fields
913
1057
  # 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.
914
1058
  attr_accessor :days_until_due
1059
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1060
+ attr_accessor :default_margins
915
1061
  # 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.
916
1062
  attr_accessor :default_payment_method
917
1063
  # 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.
@@ -953,6 +1099,7 @@ module Stripe
953
1099
 
954
1100
  def initialize(
955
1101
  account_tax_ids: nil,
1102
+ amounts_due: nil,
956
1103
  application_fee_amount: nil,
957
1104
  auto_advance: nil,
958
1105
  automatic_tax: nil,
@@ -960,6 +1107,7 @@ module Stripe
960
1107
  collection_method: nil,
961
1108
  custom_fields: nil,
962
1109
  days_until_due: nil,
1110
+ default_margins: nil,
963
1111
  default_payment_method: nil,
964
1112
  default_source: nil,
965
1113
  default_tax_rates: nil,
@@ -981,6 +1129,7 @@ module Stripe
981
1129
  transfer_data: nil
982
1130
  )
983
1131
  @account_tax_ids = account_tax_ids
1132
+ @amounts_due = amounts_due
984
1133
  @application_fee_amount = application_fee_amount
985
1134
  @auto_advance = auto_advance
986
1135
  @automatic_tax = automatic_tax
@@ -988,6 +1137,7 @@ module Stripe
988
1137
  @collection_method = collection_method
989
1138
  @custom_fields = custom_fields
990
1139
  @days_until_due = days_until_due
1140
+ @default_margins = default_margins
991
1141
  @default_payment_method = default_payment_method
992
1142
  @default_source = default_source
993
1143
  @default_tax_rates = default_tax_rates
@@ -1052,6 +1202,8 @@ module Stripe
1052
1202
  attr_accessor :created
1053
1203
  # Only return invoices for the customer specified by this customer ID.
1054
1204
  attr_accessor :customer
1205
+ # Only return invoices for the account specified by this account ID.
1206
+ attr_accessor :customer_account
1055
1207
  # Attribute for param field due_date
1056
1208
  attr_accessor :due_date
1057
1209
  # 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.
@@ -1071,6 +1223,7 @@ module Stripe
1071
1223
  collection_method: nil,
1072
1224
  created: nil,
1073
1225
  customer: nil,
1226
+ customer_account: nil,
1074
1227
  due_date: nil,
1075
1228
  ending_before: nil,
1076
1229
  expand: nil,
@@ -1082,6 +1235,7 @@ module Stripe
1082
1235
  @collection_method = collection_method
1083
1236
  @created = created
1084
1237
  @customer = customer
1238
+ @customer_account = customer_account
1085
1239
  @due_date = due_date
1086
1240
  @ending_before = ending_before
1087
1241
  @expand = expand
@@ -1093,6 +1247,24 @@ module Stripe
1093
1247
  end
1094
1248
 
1095
1249
  class CreateParams < Stripe::RequestParams
1250
+ class AmountsDue < Stripe::RequestParams
1251
+ # The amount in cents (or local equivalent).
1252
+ attr_accessor :amount
1253
+ # Number of days from when invoice is finalized until the payment is due.
1254
+ attr_accessor :days_until_due
1255
+ # An arbitrary string attached to the object. Often useful for displaying to users.
1256
+ attr_accessor :description
1257
+ # Date on which a payment plan’s payment is due.
1258
+ attr_accessor :due_date
1259
+
1260
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
1261
+ @amount = amount
1262
+ @days_until_due = days_until_due
1263
+ @description = description
1264
+ @due_date = due_date
1265
+ end
1266
+ end
1267
+
1096
1268
  class AutomaticTax < Stripe::RequestParams
1097
1269
  class Liability < Stripe::RequestParams
1098
1270
  # The connected account being referenced when `type` is `account`.
@@ -1129,16 +1301,44 @@ module Stripe
1129
1301
  end
1130
1302
 
1131
1303
  class Discount < Stripe::RequestParams
1304
+ class DiscountEnd < Stripe::RequestParams
1305
+ class Duration < Stripe::RequestParams
1306
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1307
+ attr_accessor :interval
1308
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1309
+ attr_accessor :interval_count
1310
+
1311
+ def initialize(interval: nil, interval_count: nil)
1312
+ @interval = interval
1313
+ @interval_count = interval_count
1314
+ end
1315
+ end
1316
+ # Time span for the redeemed discount.
1317
+ attr_accessor :duration
1318
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1319
+ attr_accessor :timestamp
1320
+ # The type of calculation made to determine when the discount ends.
1321
+ attr_accessor :type
1322
+
1323
+ def initialize(duration: nil, timestamp: nil, type: nil)
1324
+ @duration = duration
1325
+ @timestamp = timestamp
1326
+ @type = type
1327
+ end
1328
+ end
1132
1329
  # ID of the coupon to create a new discount for.
1133
1330
  attr_accessor :coupon
1134
1331
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1135
1332
  attr_accessor :discount
1333
+ # Details to determine how long the discount should be applied for.
1334
+ attr_accessor :discount_end
1136
1335
  # ID of the promotion code to create a new discount for.
1137
1336
  attr_accessor :promotion_code
1138
1337
 
1139
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1338
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1140
1339
  @coupon = coupon
1141
1340
  @discount = discount
1341
+ @discount_end = discount_end
1142
1342
  @promotion_code = promotion_code
1143
1343
  end
1144
1344
  end
@@ -1270,17 +1470,47 @@ module Stripe
1270
1470
  end
1271
1471
  end
1272
1472
 
1473
+ class IdBankTransfer < Stripe::RequestParams; end
1273
1474
  class Konbini < Stripe::RequestParams; end
1274
1475
  class SepaDebit < Stripe::RequestParams; end
1275
1476
 
1477
+ class Upi < Stripe::RequestParams
1478
+ class MandateOptions < Stripe::RequestParams
1479
+ # Amount to be charged for future payments.
1480
+ attr_accessor :amount
1481
+ # 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.
1482
+ attr_accessor :amount_type
1483
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1484
+ attr_accessor :description
1485
+ # 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.
1486
+ attr_accessor :end_date
1487
+
1488
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
1489
+ @amount = amount
1490
+ @amount_type = amount_type
1491
+ @description = description
1492
+ @end_date = end_date
1493
+ end
1494
+ end
1495
+ # Configuration options for setting up an eMandate
1496
+ attr_accessor :mandate_options
1497
+
1498
+ def initialize(mandate_options: nil)
1499
+ @mandate_options = mandate_options
1500
+ end
1501
+ end
1502
+
1276
1503
  class UsBankAccount < Stripe::RequestParams
1277
1504
  class FinancialConnections < Stripe::RequestParams
1278
1505
  class Filters < Stripe::RequestParams
1279
1506
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1280
1507
  attr_accessor :account_subcategories
1508
+ # ID of the institution to use to filter for selectable accounts.
1509
+ attr_accessor :institution
1281
1510
 
1282
- def initialize(account_subcategories: nil)
1511
+ def initialize(account_subcategories: nil, institution: nil)
1283
1512
  @account_subcategories = account_subcategories
1513
+ @institution = institution
1284
1514
  end
1285
1515
  end
1286
1516
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -1314,10 +1544,14 @@ module Stripe
1314
1544
  attr_accessor :card
1315
1545
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1316
1546
  attr_accessor :customer_balance
1547
+ # 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.
1548
+ attr_accessor :id_bank_transfer
1317
1549
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1318
1550
  attr_accessor :konbini
1319
1551
  # 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.
1320
1552
  attr_accessor :sepa_debit
1553
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
1554
+ attr_accessor :upi
1321
1555
  # 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.
1322
1556
  attr_accessor :us_bank_account
1323
1557
 
@@ -1326,16 +1560,20 @@ module Stripe
1326
1560
  bancontact: nil,
1327
1561
  card: nil,
1328
1562
  customer_balance: nil,
1563
+ id_bank_transfer: nil,
1329
1564
  konbini: nil,
1330
1565
  sepa_debit: nil,
1566
+ upi: nil,
1331
1567
  us_bank_account: nil
1332
1568
  )
1333
1569
  @acss_debit = acss_debit
1334
1570
  @bancontact = bancontact
1335
1571
  @card = card
1336
1572
  @customer_balance = customer_balance
1573
+ @id_bank_transfer = id_bank_transfer
1337
1574
  @konbini = konbini
1338
1575
  @sepa_debit = sepa_debit
1576
+ @upi = upi
1339
1577
  @us_bank_account = us_bank_account
1340
1578
  end
1341
1579
  end
@@ -1545,6 +1783,8 @@ module Stripe
1545
1783
  end
1546
1784
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1547
1785
  attr_accessor :account_tax_ids
1786
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1787
+ attr_accessor :amounts_due
1548
1788
  # 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).
1549
1789
  attr_accessor :application_fee_amount
1550
1790
  # 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.
@@ -1561,8 +1801,12 @@ module Stripe
1561
1801
  attr_accessor :custom_fields
1562
1802
  # The ID of the customer who will be billed.
1563
1803
  attr_accessor :customer
1804
+ # The ID of the account who will be billed.
1805
+ attr_accessor :customer_account
1564
1806
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1565
1807
  attr_accessor :days_until_due
1808
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1809
+ attr_accessor :default_margins
1566
1810
  # 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.
1567
1811
  attr_accessor :default_payment_method
1568
1812
  # 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.
@@ -1610,6 +1854,7 @@ module Stripe
1610
1854
 
1611
1855
  def initialize(
1612
1856
  account_tax_ids: nil,
1857
+ amounts_due: nil,
1613
1858
  application_fee_amount: nil,
1614
1859
  auto_advance: nil,
1615
1860
  automatic_tax: nil,
@@ -1618,7 +1863,9 @@ module Stripe
1618
1863
  currency: nil,
1619
1864
  custom_fields: nil,
1620
1865
  customer: nil,
1866
+ customer_account: nil,
1621
1867
  days_until_due: nil,
1868
+ default_margins: nil,
1622
1869
  default_payment_method: nil,
1623
1870
  default_source: nil,
1624
1871
  default_tax_rates: nil,
@@ -1643,6 +1890,7 @@ module Stripe
1643
1890
  transfer_data: nil
1644
1891
  )
1645
1892
  @account_tax_ids = account_tax_ids
1893
+ @amounts_due = amounts_due
1646
1894
  @application_fee_amount = application_fee_amount
1647
1895
  @auto_advance = auto_advance
1648
1896
  @automatic_tax = automatic_tax
@@ -1651,7 +1899,9 @@ module Stripe
1651
1899
  @currency = currency
1652
1900
  @custom_fields = custom_fields
1653
1901
  @customer = customer
1902
+ @customer_account = customer_account
1654
1903
  @days_until_due = days_until_due
1904
+ @default_margins = default_margins
1655
1905
  @default_payment_method = default_payment_method
1656
1906
  @default_source = default_source
1657
1907
  @default_tax_rates = default_tax_rates
@@ -1698,16 +1948,44 @@ module Stripe
1698
1948
  class AddLinesParams < Stripe::RequestParams
1699
1949
  class Line < Stripe::RequestParams
1700
1950
  class Discount < Stripe::RequestParams
1951
+ class DiscountEnd < Stripe::RequestParams
1952
+ class Duration < Stripe::RequestParams
1953
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1954
+ attr_accessor :interval
1955
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1956
+ attr_accessor :interval_count
1957
+
1958
+ def initialize(interval: nil, interval_count: nil)
1959
+ @interval = interval
1960
+ @interval_count = interval_count
1961
+ end
1962
+ end
1963
+ # Time span for the redeemed discount.
1964
+ attr_accessor :duration
1965
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1966
+ attr_accessor :timestamp
1967
+ # The type of calculation made to determine when the discount ends.
1968
+ attr_accessor :type
1969
+
1970
+ def initialize(duration: nil, timestamp: nil, type: nil)
1971
+ @duration = duration
1972
+ @timestamp = timestamp
1973
+ @type = type
1974
+ end
1975
+ end
1701
1976
  # ID of the coupon to create a new discount for.
1702
1977
  attr_accessor :coupon
1703
1978
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1704
1979
  attr_accessor :discount
1980
+ # Details to determine how long the discount should be applied for.
1981
+ attr_accessor :discount_end
1705
1982
  # ID of the promotion code to create a new discount for.
1706
1983
  attr_accessor :promotion_code
1707
1984
 
1708
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1985
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1709
1986
  @coupon = coupon
1710
1987
  @discount = discount
1988
+ @discount_end = discount_end
1711
1989
  @promotion_code = promotion_code
1712
1990
  end
1713
1991
  end
@@ -1860,6 +2138,8 @@ module Stripe
1860
2138
  attr_accessor :discounts
1861
2139
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1862
2140
  attr_accessor :invoice_item
2141
+ # 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.
2142
+ attr_accessor :margins
1863
2143
  # 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`.
1864
2144
  attr_accessor :metadata
1865
2145
  # 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.
@@ -1881,6 +2161,7 @@ module Stripe
1881
2161
  discountable: nil,
1882
2162
  discounts: nil,
1883
2163
  invoice_item: nil,
2164
+ margins: nil,
1884
2165
  metadata: nil,
1885
2166
  period: nil,
1886
2167
  price_data: nil,
@@ -1894,6 +2175,7 @@ module Stripe
1894
2175
  @discountable = discountable
1895
2176
  @discounts = discounts
1896
2177
  @invoice_item = invoice_item
2178
+ @margins = margins
1897
2179
  @metadata = metadata
1898
2180
  @period = period
1899
2181
  @price_data = price_data
@@ -1918,14 +2200,59 @@ module Stripe
1918
2200
  end
1919
2201
 
1920
2202
  class AttachPaymentParams < Stripe::RequestParams
2203
+ class PaymentRecordData < Stripe::RequestParams
2204
+ # The amount that was paid out of band.
2205
+ attr_accessor :amount
2206
+ # The currency that was paid out of band.
2207
+ attr_accessor :currency
2208
+ # 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`.
2209
+ attr_accessor :metadata
2210
+ # The type of money movement for this out of band payment record.
2211
+ attr_accessor :money_movement_type
2212
+ # The timestamp when this out of band payment was paid.
2213
+ attr_accessor :paid_at
2214
+ # The reference for this out of band payment record.
2215
+ attr_accessor :payment_reference
2216
+
2217
+ def initialize(
2218
+ amount: nil,
2219
+ currency: nil,
2220
+ metadata: nil,
2221
+ money_movement_type: nil,
2222
+ paid_at: nil,
2223
+ payment_reference: nil
2224
+ )
2225
+ @amount = amount
2226
+ @currency = currency
2227
+ @metadata = metadata
2228
+ @money_movement_type = money_movement_type
2229
+ @paid_at = paid_at
2230
+ @payment_reference = payment_reference
2231
+ end
2232
+ end
2233
+ # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
2234
+ attr_accessor :amount_requested
1921
2235
  # Specifies which fields in the response should be expanded.
1922
2236
  attr_accessor :expand
1923
2237
  # The ID of the PaymentIntent to attach to the invoice.
1924
2238
  attr_accessor :payment_intent
2239
+ # The ID of the PaymentRecord to attach to the invoice.
2240
+ attr_accessor :payment_record
2241
+ # The PaymentRecord data for attaching an out of band payment to the invoice.
2242
+ attr_accessor :payment_record_data
1925
2243
 
1926
- def initialize(expand: nil, payment_intent: nil)
2244
+ def initialize(
2245
+ amount_requested: nil,
2246
+ expand: nil,
2247
+ payment_intent: nil,
2248
+ payment_record: nil,
2249
+ payment_record_data: nil
2250
+ )
2251
+ @amount_requested = amount_requested
1927
2252
  @expand = expand
1928
2253
  @payment_intent = payment_intent
2254
+ @payment_record = payment_record
2255
+ @payment_record_data = payment_record_data
1929
2256
  end
1930
2257
  end
1931
2258
 
@@ -2025,16 +2352,44 @@ module Stripe
2025
2352
  class UpdateLinesParams < Stripe::RequestParams
2026
2353
  class Line < Stripe::RequestParams
2027
2354
  class Discount < Stripe::RequestParams
2355
+ class DiscountEnd < Stripe::RequestParams
2356
+ class Duration < Stripe::RequestParams
2357
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2358
+ attr_accessor :interval
2359
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2360
+ attr_accessor :interval_count
2361
+
2362
+ def initialize(interval: nil, interval_count: nil)
2363
+ @interval = interval
2364
+ @interval_count = interval_count
2365
+ end
2366
+ end
2367
+ # Time span for the redeemed discount.
2368
+ attr_accessor :duration
2369
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2370
+ attr_accessor :timestamp
2371
+ # The type of calculation made to determine when the discount ends.
2372
+ attr_accessor :type
2373
+
2374
+ def initialize(duration: nil, timestamp: nil, type: nil)
2375
+ @duration = duration
2376
+ @timestamp = timestamp
2377
+ @type = type
2378
+ end
2379
+ end
2028
2380
  # ID of the coupon to create a new discount for.
2029
2381
  attr_accessor :coupon
2030
2382
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2031
2383
  attr_accessor :discount
2384
+ # Details to determine how long the discount should be applied for.
2385
+ attr_accessor :discount_end
2032
2386
  # ID of the promotion code to create a new discount for.
2033
2387
  attr_accessor :promotion_code
2034
2388
 
2035
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2389
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2036
2390
  @coupon = coupon
2037
2391
  @discount = discount
2392
+ @discount_end = discount_end
2038
2393
  @promotion_code = promotion_code
2039
2394
  end
2040
2395
  end
@@ -2187,6 +2542,8 @@ module Stripe
2187
2542
  attr_accessor :discounts
2188
2543
  # ID of an existing line item on the invoice.
2189
2544
  attr_accessor :id
2545
+ # 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.
2546
+ attr_accessor :margins
2190
2547
  # 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.
2191
2548
  attr_accessor :metadata
2192
2549
  # 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.
@@ -2208,6 +2565,7 @@ module Stripe
2208
2565
  discountable: nil,
2209
2566
  discounts: nil,
2210
2567
  id: nil,
2568
+ margins: nil,
2211
2569
  metadata: nil,
2212
2570
  period: nil,
2213
2571
  price_data: nil,
@@ -2221,6 +2579,7 @@ module Stripe
2221
2579
  @discountable = discountable
2222
2580
  @discounts = discounts
2223
2581
  @id = id
2582
+ @margins = margins
2224
2583
  @metadata = metadata
2225
2584
  @period = period
2226
2585
  @price_data = price_data
@@ -2395,32 +2754,88 @@ module Stripe
2395
2754
  end
2396
2755
 
2397
2756
  class Discount < Stripe::RequestParams
2757
+ class DiscountEnd < Stripe::RequestParams
2758
+ class Duration < Stripe::RequestParams
2759
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2760
+ attr_accessor :interval
2761
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2762
+ attr_accessor :interval_count
2763
+
2764
+ def initialize(interval: nil, interval_count: nil)
2765
+ @interval = interval
2766
+ @interval_count = interval_count
2767
+ end
2768
+ end
2769
+ # Time span for the redeemed discount.
2770
+ attr_accessor :duration
2771
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2772
+ attr_accessor :timestamp
2773
+ # The type of calculation made to determine when the discount ends.
2774
+ attr_accessor :type
2775
+
2776
+ def initialize(duration: nil, timestamp: nil, type: nil)
2777
+ @duration = duration
2778
+ @timestamp = timestamp
2779
+ @type = type
2780
+ end
2781
+ end
2398
2782
  # ID of the coupon to create a new discount for.
2399
2783
  attr_accessor :coupon
2400
2784
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2401
2785
  attr_accessor :discount
2786
+ # Details to determine how long the discount should be applied for.
2787
+ attr_accessor :discount_end
2402
2788
  # ID of the promotion code to create a new discount for.
2403
2789
  attr_accessor :promotion_code
2404
2790
 
2405
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2791
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2406
2792
  @coupon = coupon
2407
2793
  @discount = discount
2794
+ @discount_end = discount_end
2408
2795
  @promotion_code = promotion_code
2409
2796
  end
2410
2797
  end
2411
2798
 
2412
2799
  class InvoiceItem < Stripe::RequestParams
2413
2800
  class Discount < Stripe::RequestParams
2801
+ class DiscountEnd < Stripe::RequestParams
2802
+ class Duration < Stripe::RequestParams
2803
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2804
+ attr_accessor :interval
2805
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2806
+ attr_accessor :interval_count
2807
+
2808
+ def initialize(interval: nil, interval_count: nil)
2809
+ @interval = interval
2810
+ @interval_count = interval_count
2811
+ end
2812
+ end
2813
+ # Time span for the redeemed discount.
2814
+ attr_accessor :duration
2815
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2816
+ attr_accessor :timestamp
2817
+ # The type of calculation made to determine when the discount ends.
2818
+ attr_accessor :type
2819
+
2820
+ def initialize(duration: nil, timestamp: nil, type: nil)
2821
+ @duration = duration
2822
+ @timestamp = timestamp
2823
+ @type = type
2824
+ end
2825
+ end
2414
2826
  # ID of the coupon to create a new discount for.
2415
2827
  attr_accessor :coupon
2416
2828
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2417
2829
  attr_accessor :discount
2830
+ # Details to determine how long the discount should be applied for.
2831
+ attr_accessor :discount_end
2418
2832
  # ID of the promotion code to create a new discount for.
2419
2833
  attr_accessor :promotion_code
2420
2834
 
2421
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2835
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2422
2836
  @coupon = coupon
2423
2837
  @discount = discount
2838
+ @discount_end = discount_end
2424
2839
  @promotion_code = promotion_code
2425
2840
  end
2426
2841
  end
@@ -2546,6 +2961,458 @@ module Stripe
2546
2961
  end
2547
2962
 
2548
2963
  class ScheduleDetails < Stripe::RequestParams
2964
+ class Amendment < Stripe::RequestParams
2965
+ class AmendmentEnd < Stripe::RequestParams
2966
+ class DiscountEnd < Stripe::RequestParams
2967
+ # The ID of a specific discount.
2968
+ attr_accessor :discount
2969
+
2970
+ def initialize(discount: nil)
2971
+ @discount = discount
2972
+ end
2973
+ end
2974
+
2975
+ class Duration < Stripe::RequestParams
2976
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2977
+ attr_accessor :interval
2978
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2979
+ attr_accessor :interval_count
2980
+
2981
+ def initialize(interval: nil, interval_count: nil)
2982
+ @interval = interval
2983
+ @interval_count = interval_count
2984
+ end
2985
+ end
2986
+ # Use the `end` time of a given discount.
2987
+ attr_accessor :discount_end
2988
+ # Time span for the amendment starting from the `amendment_start`.
2989
+ attr_accessor :duration
2990
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2991
+ attr_accessor :timestamp
2992
+ # Select one of three ways to pass the `amendment_end`.
2993
+ attr_accessor :type
2994
+
2995
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2996
+ @discount_end = discount_end
2997
+ @duration = duration
2998
+ @timestamp = timestamp
2999
+ @type = type
3000
+ end
3001
+ end
3002
+
3003
+ class AmendmentStart < Stripe::RequestParams
3004
+ class AmendmentEnd < Stripe::RequestParams
3005
+ # 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.
3006
+ attr_accessor :index
3007
+
3008
+ def initialize(index: nil)
3009
+ @index = index
3010
+ end
3011
+ end
3012
+
3013
+ class DiscountEnd < Stripe::RequestParams
3014
+ # The ID of a specific discount.
3015
+ attr_accessor :discount
3016
+
3017
+ def initialize(discount: nil)
3018
+ @discount = discount
3019
+ end
3020
+ end
3021
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
3022
+ attr_accessor :amendment_end
3023
+ # Use the `end` time of a given discount.
3024
+ attr_accessor :discount_end
3025
+ # A precise Unix timestamp for the amendment to start.
3026
+ attr_accessor :timestamp
3027
+ # Select one of three ways to pass the `amendment_start`.
3028
+ attr_accessor :type
3029
+
3030
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
3031
+ @amendment_end = amendment_end
3032
+ @discount_end = discount_end
3033
+ @timestamp = timestamp
3034
+ @type = type
3035
+ end
3036
+ end
3037
+
3038
+ class DiscountAction < Stripe::RequestParams
3039
+ class Add < Stripe::RequestParams
3040
+ class DiscountEnd < Stripe::RequestParams
3041
+ # The type of calculation made to determine when the discount ends.
3042
+ attr_accessor :type
3043
+
3044
+ def initialize(type: nil)
3045
+ @type = type
3046
+ end
3047
+ end
3048
+ # The coupon code to redeem.
3049
+ attr_accessor :coupon
3050
+ # An ID of an existing discount for a coupon that was already redeemed.
3051
+ attr_accessor :discount
3052
+ # Details to determine how long the discount should be applied for.
3053
+ attr_accessor :discount_end
3054
+ # 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.
3055
+ attr_accessor :index
3056
+ # The promotion code to redeem.
3057
+ attr_accessor :promotion_code
3058
+
3059
+ def initialize(
3060
+ coupon: nil,
3061
+ discount: nil,
3062
+ discount_end: nil,
3063
+ index: nil,
3064
+ promotion_code: nil
3065
+ )
3066
+ @coupon = coupon
3067
+ @discount = discount
3068
+ @discount_end = discount_end
3069
+ @index = index
3070
+ @promotion_code = promotion_code
3071
+ end
3072
+ end
3073
+
3074
+ class Remove < Stripe::RequestParams
3075
+ # The coupon code to remove from the `discounts` array.
3076
+ attr_accessor :coupon
3077
+ # The ID of a discount to remove from the `discounts` array.
3078
+ attr_accessor :discount
3079
+ # The ID of a promotion code to remove from the `discounts` array.
3080
+ attr_accessor :promotion_code
3081
+
3082
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3083
+ @coupon = coupon
3084
+ @discount = discount
3085
+ @promotion_code = promotion_code
3086
+ end
3087
+ end
3088
+
3089
+ class Set < Stripe::RequestParams
3090
+ # The coupon code to replace the `discounts` array with.
3091
+ attr_accessor :coupon
3092
+ # An ID of an existing discount to replace the `discounts` array with.
3093
+ attr_accessor :discount
3094
+ # An ID of an existing promotion code to replace the `discounts` array with.
3095
+ attr_accessor :promotion_code
3096
+
3097
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3098
+ @coupon = coupon
3099
+ @discount = discount
3100
+ @promotion_code = promotion_code
3101
+ end
3102
+ end
3103
+ # Details of the discount to add.
3104
+ attr_accessor :add
3105
+ # Details of the discount to remove.
3106
+ attr_accessor :remove
3107
+ # Details of the discount to replace the existing discounts with.
3108
+ attr_accessor :set
3109
+ # Determines the type of discount action.
3110
+ attr_accessor :type
3111
+
3112
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3113
+ @add = add
3114
+ @remove = remove
3115
+ @set = set
3116
+ @type = type
3117
+ end
3118
+ end
3119
+
3120
+ class ItemAction < Stripe::RequestParams
3121
+ class Add < Stripe::RequestParams
3122
+ class Discount < Stripe::RequestParams
3123
+ class DiscountEnd < Stripe::RequestParams
3124
+ class Duration < Stripe::RequestParams
3125
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3126
+ attr_accessor :interval
3127
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3128
+ attr_accessor :interval_count
3129
+
3130
+ def initialize(interval: nil, interval_count: nil)
3131
+ @interval = interval
3132
+ @interval_count = interval_count
3133
+ end
3134
+ end
3135
+ # Time span for the redeemed discount.
3136
+ attr_accessor :duration
3137
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3138
+ attr_accessor :timestamp
3139
+ # The type of calculation made to determine when the discount ends.
3140
+ attr_accessor :type
3141
+
3142
+ def initialize(duration: nil, timestamp: nil, type: nil)
3143
+ @duration = duration
3144
+ @timestamp = timestamp
3145
+ @type = type
3146
+ end
3147
+ end
3148
+ # ID of the coupon to create a new discount for.
3149
+ attr_accessor :coupon
3150
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3151
+ attr_accessor :discount
3152
+ # Details to determine how long the discount should be applied for.
3153
+ attr_accessor :discount_end
3154
+ # ID of the promotion code to create a new discount for.
3155
+ attr_accessor :promotion_code
3156
+
3157
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3158
+ @coupon = coupon
3159
+ @discount = discount
3160
+ @discount_end = discount_end
3161
+ @promotion_code = promotion_code
3162
+ end
3163
+ end
3164
+
3165
+ class Trial < Stripe::RequestParams
3166
+ # 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.
3167
+ attr_accessor :converts_to
3168
+ # Determines the type of trial for this item.
3169
+ attr_accessor :type
3170
+
3171
+ def initialize(converts_to: nil, type: nil)
3172
+ @converts_to = converts_to
3173
+ @type = type
3174
+ end
3175
+ end
3176
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
3177
+ attr_accessor :discounts
3178
+ # 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`.
3179
+ attr_accessor :metadata
3180
+ # The ID of the price object.
3181
+ attr_accessor :price
3182
+ # Quantity for this item.
3183
+ attr_accessor :quantity
3184
+ # 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`.
3185
+ attr_accessor :tax_rates
3186
+ # Options that configure the trial on the subscription item.
3187
+ attr_accessor :trial
3188
+
3189
+ def initialize(
3190
+ discounts: nil,
3191
+ metadata: nil,
3192
+ price: nil,
3193
+ quantity: nil,
3194
+ tax_rates: nil,
3195
+ trial: nil
3196
+ )
3197
+ @discounts = discounts
3198
+ @metadata = metadata
3199
+ @price = price
3200
+ @quantity = quantity
3201
+ @tax_rates = tax_rates
3202
+ @trial = trial
3203
+ end
3204
+ end
3205
+
3206
+ class Remove < Stripe::RequestParams
3207
+ # ID of a price to remove.
3208
+ attr_accessor :price
3209
+
3210
+ def initialize(price: nil)
3211
+ @price = price
3212
+ end
3213
+ end
3214
+
3215
+ class Set < Stripe::RequestParams
3216
+ class Discount < Stripe::RequestParams
3217
+ class DiscountEnd < Stripe::RequestParams
3218
+ class Duration < Stripe::RequestParams
3219
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3220
+ attr_accessor :interval
3221
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3222
+ attr_accessor :interval_count
3223
+
3224
+ def initialize(interval: nil, interval_count: nil)
3225
+ @interval = interval
3226
+ @interval_count = interval_count
3227
+ end
3228
+ end
3229
+ # Time span for the redeemed discount.
3230
+ attr_accessor :duration
3231
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3232
+ attr_accessor :timestamp
3233
+ # The type of calculation made to determine when the discount ends.
3234
+ attr_accessor :type
3235
+
3236
+ def initialize(duration: nil, timestamp: nil, type: nil)
3237
+ @duration = duration
3238
+ @timestamp = timestamp
3239
+ @type = type
3240
+ end
3241
+ end
3242
+ # ID of the coupon to create a new discount for.
3243
+ attr_accessor :coupon
3244
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3245
+ attr_accessor :discount
3246
+ # Details to determine how long the discount should be applied for.
3247
+ attr_accessor :discount_end
3248
+ # ID of the promotion code to create a new discount for.
3249
+ attr_accessor :promotion_code
3250
+
3251
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3252
+ @coupon = coupon
3253
+ @discount = discount
3254
+ @discount_end = discount_end
3255
+ @promotion_code = promotion_code
3256
+ end
3257
+ end
3258
+
3259
+ class Trial < Stripe::RequestParams
3260
+ # 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.
3261
+ attr_accessor :converts_to
3262
+ # Determines the type of trial for this item.
3263
+ attr_accessor :type
3264
+
3265
+ def initialize(converts_to: nil, type: nil)
3266
+ @converts_to = converts_to
3267
+ @type = type
3268
+ end
3269
+ end
3270
+ # 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`.
3271
+ attr_accessor :discounts
3272
+ # 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`.
3273
+ attr_accessor :metadata
3274
+ # The ID of the price object.
3275
+ attr_accessor :price
3276
+ # 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`.
3277
+ attr_accessor :quantity
3278
+ # 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`.
3279
+ attr_accessor :tax_rates
3280
+ # 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`.
3281
+ attr_accessor :trial
3282
+
3283
+ def initialize(
3284
+ discounts: nil,
3285
+ metadata: nil,
3286
+ price: nil,
3287
+ quantity: nil,
3288
+ tax_rates: nil,
3289
+ trial: nil
3290
+ )
3291
+ @discounts = discounts
3292
+ @metadata = metadata
3293
+ @price = price
3294
+ @quantity = quantity
3295
+ @tax_rates = tax_rates
3296
+ @trial = trial
3297
+ end
3298
+ end
3299
+ # 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.
3300
+ attr_accessor :add
3301
+ # Details of the subscription item to remove.
3302
+ attr_accessor :remove
3303
+ # 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.
3304
+ attr_accessor :set
3305
+ # Determines the type of item action.
3306
+ attr_accessor :type
3307
+
3308
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3309
+ @add = add
3310
+ @remove = remove
3311
+ @set = set
3312
+ @type = type
3313
+ end
3314
+ end
3315
+
3316
+ class MetadataAction < Stripe::RequestParams
3317
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
3318
+ attr_accessor :add
3319
+ # Keys to remove from schedule phase metadata.
3320
+ attr_accessor :remove
3321
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
3322
+ attr_accessor :set
3323
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
3324
+ attr_accessor :type
3325
+
3326
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3327
+ @add = add
3328
+ @remove = remove
3329
+ @set = set
3330
+ @type = type
3331
+ end
3332
+ end
3333
+
3334
+ class SetPauseCollection < Stripe::RequestParams
3335
+ class Set < Stripe::RequestParams
3336
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3337
+ attr_accessor :behavior
3338
+
3339
+ def initialize(behavior: nil)
3340
+ @behavior = behavior
3341
+ end
3342
+ end
3343
+ # Details of the pause_collection behavior to apply to the amendment.
3344
+ attr_accessor :set
3345
+ # Determines the type of the pause_collection amendment.
3346
+ attr_accessor :type
3347
+
3348
+ def initialize(set: nil, type: nil)
3349
+ @set = set
3350
+ @type = type
3351
+ end
3352
+ end
3353
+
3354
+ class TrialSettings < Stripe::RequestParams
3355
+ class EndBehavior < Stripe::RequestParams
3356
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3357
+ attr_accessor :prorate_up_front
3358
+
3359
+ def initialize(prorate_up_front: nil)
3360
+ @prorate_up_front = prorate_up_front
3361
+ end
3362
+ end
3363
+ # Defines how the subscription should behave when a trial ends.
3364
+ attr_accessor :end_behavior
3365
+
3366
+ def initialize(end_behavior: nil)
3367
+ @end_behavior = end_behavior
3368
+ end
3369
+ end
3370
+ # 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.
3371
+ attr_accessor :amendment_end
3372
+ # Details to identify the earliest timestamp where the proposed change should take effect.
3373
+ attr_accessor :amendment_start
3374
+ # 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.
3375
+ attr_accessor :billing_cycle_anchor
3376
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
3377
+ attr_accessor :discount_actions
3378
+ # Changes to the subscription items during the amendment time span.
3379
+ attr_accessor :item_actions
3380
+ # Instructions for how to modify phase metadata
3381
+ attr_accessor :metadata_actions
3382
+ # 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`.
3383
+ attr_accessor :proration_behavior
3384
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
3385
+ attr_accessor :set_pause_collection
3386
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
3387
+ attr_accessor :set_schedule_end
3388
+ # Settings related to subscription trials.
3389
+ attr_accessor :trial_settings
3390
+
3391
+ def initialize(
3392
+ amendment_end: nil,
3393
+ amendment_start: nil,
3394
+ billing_cycle_anchor: nil,
3395
+ discount_actions: nil,
3396
+ item_actions: nil,
3397
+ metadata_actions: nil,
3398
+ proration_behavior: nil,
3399
+ set_pause_collection: nil,
3400
+ set_schedule_end: nil,
3401
+ trial_settings: nil
3402
+ )
3403
+ @amendment_end = amendment_end
3404
+ @amendment_start = amendment_start
3405
+ @billing_cycle_anchor = billing_cycle_anchor
3406
+ @discount_actions = discount_actions
3407
+ @item_actions = item_actions
3408
+ @metadata_actions = metadata_actions
3409
+ @proration_behavior = proration_behavior
3410
+ @set_pause_collection = set_pause_collection
3411
+ @set_schedule_end = set_schedule_end
3412
+ @trial_settings = trial_settings
3413
+ end
3414
+ end
3415
+
2549
3416
  class BillingMode < Stripe::RequestParams
2550
3417
  # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2551
3418
  attr_accessor :type
@@ -2558,16 +3425,44 @@ module Stripe
2558
3425
  class Phase < Stripe::RequestParams
2559
3426
  class AddInvoiceItem < Stripe::RequestParams
2560
3427
  class Discount < Stripe::RequestParams
3428
+ class DiscountEnd < Stripe::RequestParams
3429
+ class Duration < Stripe::RequestParams
3430
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3431
+ attr_accessor :interval
3432
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3433
+ attr_accessor :interval_count
3434
+
3435
+ def initialize(interval: nil, interval_count: nil)
3436
+ @interval = interval
3437
+ @interval_count = interval_count
3438
+ end
3439
+ end
3440
+ # Time span for the redeemed discount.
3441
+ attr_accessor :duration
3442
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3443
+ attr_accessor :timestamp
3444
+ # The type of calculation made to determine when the discount ends.
3445
+ attr_accessor :type
3446
+
3447
+ def initialize(duration: nil, timestamp: nil, type: nil)
3448
+ @duration = duration
3449
+ @timestamp = timestamp
3450
+ @type = type
3451
+ end
3452
+ end
2561
3453
  # ID of the coupon to create a new discount for.
2562
3454
  attr_accessor :coupon
2563
3455
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2564
3456
  attr_accessor :discount
3457
+ # Details to determine how long the discount should be applied for.
3458
+ attr_accessor :discount_end
2565
3459
  # ID of the promotion code to create a new discount for.
2566
3460
  attr_accessor :promotion_code
2567
3461
 
2568
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3462
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2569
3463
  @coupon = coupon
2570
3464
  @discount = discount
3465
+ @discount_end = discount_end
2571
3466
  @promotion_code = promotion_code
2572
3467
  end
2573
3468
  end
@@ -2660,16 +3555,44 @@ module Stripe
2660
3555
  end
2661
3556
 
2662
3557
  class Discount < Stripe::RequestParams
3558
+ class DiscountEnd < Stripe::RequestParams
3559
+ class Duration < Stripe::RequestParams
3560
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3561
+ attr_accessor :interval
3562
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3563
+ attr_accessor :interval_count
3564
+
3565
+ def initialize(interval: nil, interval_count: nil)
3566
+ @interval = interval
3567
+ @interval_count = interval_count
3568
+ end
3569
+ end
3570
+ # Time span for the redeemed discount.
3571
+ attr_accessor :duration
3572
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3573
+ attr_accessor :timestamp
3574
+ # The type of calculation made to determine when the discount ends.
3575
+ attr_accessor :type
3576
+
3577
+ def initialize(duration: nil, timestamp: nil, type: nil)
3578
+ @duration = duration
3579
+ @timestamp = timestamp
3580
+ @type = type
3581
+ end
3582
+ end
2663
3583
  # ID of the coupon to create a new discount for.
2664
3584
  attr_accessor :coupon
2665
3585
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2666
3586
  attr_accessor :discount
3587
+ # Details to determine how long the discount should be applied for.
3588
+ attr_accessor :discount_end
2667
3589
  # ID of the promotion code to create a new discount for.
2668
3590
  attr_accessor :promotion_code
2669
3591
 
2670
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3592
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2671
3593
  @coupon = coupon
2672
3594
  @discount = discount
3595
+ @discount_end = discount_end
2673
3596
  @promotion_code = promotion_code
2674
3597
  end
2675
3598
  end
@@ -2723,16 +3646,44 @@ module Stripe
2723
3646
  end
2724
3647
 
2725
3648
  class Discount < Stripe::RequestParams
3649
+ class DiscountEnd < Stripe::RequestParams
3650
+ class Duration < Stripe::RequestParams
3651
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3652
+ attr_accessor :interval
3653
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3654
+ attr_accessor :interval_count
3655
+
3656
+ def initialize(interval: nil, interval_count: nil)
3657
+ @interval = interval
3658
+ @interval_count = interval_count
3659
+ end
3660
+ end
3661
+ # Time span for the redeemed discount.
3662
+ attr_accessor :duration
3663
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3664
+ attr_accessor :timestamp
3665
+ # The type of calculation made to determine when the discount ends.
3666
+ attr_accessor :type
3667
+
3668
+ def initialize(duration: nil, timestamp: nil, type: nil)
3669
+ @duration = duration
3670
+ @timestamp = timestamp
3671
+ @type = type
3672
+ end
3673
+ end
2726
3674
  # ID of the coupon to create a new discount for.
2727
3675
  attr_accessor :coupon
2728
3676
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2729
3677
  attr_accessor :discount
3678
+ # Details to determine how long the discount should be applied for.
3679
+ attr_accessor :discount_end
2730
3680
  # ID of the promotion code to create a new discount for.
2731
3681
  attr_accessor :promotion_code
2732
3682
 
2733
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3683
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2734
3684
  @coupon = coupon
2735
3685
  @discount = discount
3686
+ @discount_end = discount_end
2736
3687
  @promotion_code = promotion_code
2737
3688
  end
2738
3689
  end
@@ -2778,6 +3729,18 @@ module Stripe
2778
3729
  @unit_amount_decimal = unit_amount_decimal
2779
3730
  end
2780
3731
  end
3732
+
3733
+ class Trial < Stripe::RequestParams
3734
+ # 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.
3735
+ attr_accessor :converts_to
3736
+ # Determines the type of trial for this item.
3737
+ attr_accessor :type
3738
+
3739
+ def initialize(converts_to: nil, type: nil)
3740
+ @converts_to = converts_to
3741
+ @type = type
3742
+ end
3743
+ end
2781
3744
  # 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.
2782
3745
  attr_accessor :billing_thresholds
2783
3746
  # The coupons to redeem into discounts for the subscription item.
@@ -2794,6 +3757,8 @@ module Stripe
2794
3757
  attr_accessor :quantity
2795
3758
  # 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.
2796
3759
  attr_accessor :tax_rates
3760
+ # Options that configure the trial on the subscription item.
3761
+ attr_accessor :trial
2797
3762
 
2798
3763
  def initialize(
2799
3764
  billing_thresholds: nil,
@@ -2803,7 +3768,8 @@ module Stripe
2803
3768
  price: nil,
2804
3769
  price_data: nil,
2805
3770
  quantity: nil,
2806
- tax_rates: nil
3771
+ tax_rates: nil,
3772
+ trial: nil
2807
3773
  )
2808
3774
  @billing_thresholds = billing_thresholds
2809
3775
  @discounts = discounts
@@ -2813,6 +3779,16 @@ module Stripe
2813
3779
  @price_data = price_data
2814
3780
  @quantity = quantity
2815
3781
  @tax_rates = tax_rates
3782
+ @trial = trial
3783
+ end
3784
+ end
3785
+
3786
+ class PauseCollection < Stripe::RequestParams
3787
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3788
+ attr_accessor :behavior
3789
+
3790
+ def initialize(behavior: nil)
3791
+ @behavior = behavior
2816
3792
  end
2817
3793
  end
2818
3794
 
@@ -2827,6 +3803,23 @@ module Stripe
2827
3803
  @destination = destination
2828
3804
  end
2829
3805
  end
3806
+
3807
+ class TrialSettings < Stripe::RequestParams
3808
+ class EndBehavior < Stripe::RequestParams
3809
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3810
+ attr_accessor :prorate_up_front
3811
+
3812
+ def initialize(prorate_up_front: nil)
3813
+ @prorate_up_front = prorate_up_front
3814
+ end
3815
+ end
3816
+ # Defines how the subscription should behave when a trial ends.
3817
+ attr_accessor :end_behavior
3818
+
3819
+ def initialize(end_behavior: nil)
3820
+ @end_behavior = end_behavior
3821
+ end
3822
+ end
2830
3823
  # 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.
2831
3824
  attr_accessor :add_invoice_items
2832
3825
  # 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).
@@ -2863,6 +3856,8 @@ module Stripe
2863
3856
  attr_accessor :metadata
2864
3857
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2865
3858
  attr_accessor :on_behalf_of
3859
+ # 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).
3860
+ attr_accessor :pause_collection
2866
3861
  # 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.
2867
3862
  attr_accessor :proration_behavior
2868
3863
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -2871,8 +3866,12 @@ module Stripe
2871
3866
  attr_accessor :transfer_data
2872
3867
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2873
3868
  attr_accessor :trial
3869
+ # Specify trial behavior when crossing phase boundaries
3870
+ attr_accessor :trial_continuation
2874
3871
  # 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`
2875
3872
  attr_accessor :trial_end
3873
+ # Settings related to subscription trials.
3874
+ attr_accessor :trial_settings
2876
3875
 
2877
3876
  def initialize(
2878
3877
  add_invoice_items: nil,
@@ -2893,11 +3892,14 @@ module Stripe
2893
3892
  iterations: nil,
2894
3893
  metadata: nil,
2895
3894
  on_behalf_of: nil,
3895
+ pause_collection: nil,
2896
3896
  proration_behavior: nil,
2897
3897
  start_date: nil,
2898
3898
  transfer_data: nil,
2899
3899
  trial: nil,
2900
- trial_end: nil
3900
+ trial_continuation: nil,
3901
+ trial_end: nil,
3902
+ trial_settings: nil
2901
3903
  )
2902
3904
  @add_invoice_items = add_invoice_items
2903
3905
  @application_fee_percent = application_fee_percent
@@ -2917,26 +3919,95 @@ module Stripe
2917
3919
  @iterations = iterations
2918
3920
  @metadata = metadata
2919
3921
  @on_behalf_of = on_behalf_of
3922
+ @pause_collection = pause_collection
2920
3923
  @proration_behavior = proration_behavior
2921
3924
  @start_date = start_date
2922
3925
  @transfer_data = transfer_data
2923
3926
  @trial = trial
3927
+ @trial_continuation = trial_continuation
2924
3928
  @trial_end = trial_end
3929
+ @trial_settings = trial_settings
3930
+ end
3931
+ end
3932
+
3933
+ class Prebilling < Stripe::RequestParams
3934
+ class BillUntil < Stripe::RequestParams
3935
+ class AmendmentEnd < Stripe::RequestParams
3936
+ # 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.
3937
+ attr_accessor :index
3938
+
3939
+ def initialize(index: nil)
3940
+ @index = index
3941
+ end
3942
+ end
3943
+
3944
+ class Duration < Stripe::RequestParams
3945
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3946
+ attr_accessor :interval
3947
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3948
+ attr_accessor :interval_count
3949
+
3950
+ def initialize(interval: nil, interval_count: nil)
3951
+ @interval = interval
3952
+ @interval_count = interval_count
3953
+ end
3954
+ end
3955
+ # End the prebilled period when a specified amendment ends.
3956
+ attr_accessor :amendment_end
3957
+ # Time span for prebilling, starting from `bill_from`.
3958
+ attr_accessor :duration
3959
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3960
+ attr_accessor :timestamp
3961
+ # Select one of several ways to pass the `bill_until` value.
3962
+ attr_accessor :type
3963
+
3964
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
3965
+ @amendment_end = amendment_end
3966
+ @duration = duration
3967
+ @timestamp = timestamp
3968
+ @type = type
3969
+ end
3970
+ end
3971
+ # The end of the prebilled time period.
3972
+ attr_accessor :bill_until
3973
+ # This is used to determine the number of billing cycles to prebill.
3974
+ attr_accessor :iterations
3975
+
3976
+ def initialize(bill_until: nil, iterations: nil)
3977
+ @bill_until = bill_until
3978
+ @iterations = iterations
2925
3979
  end
2926
3980
  end
3981
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
3982
+ attr_accessor :amendments
3983
+ # 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.
3984
+ attr_accessor :billing_behavior
2927
3985
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2928
3986
  attr_accessor :billing_mode
2929
3987
  # 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.
2930
3988
  attr_accessor :end_behavior
2931
3989
  # 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.
2932
3990
  attr_accessor :phases
3991
+ # Provide any time periods to bill in advance.
3992
+ attr_accessor :prebilling
2933
3993
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2934
3994
  attr_accessor :proration_behavior
2935
3995
 
2936
- def initialize(billing_mode: nil, end_behavior: nil, phases: nil, proration_behavior: nil)
3996
+ def initialize(
3997
+ amendments: nil,
3998
+ billing_behavior: nil,
3999
+ billing_mode: nil,
4000
+ end_behavior: nil,
4001
+ phases: nil,
4002
+ prebilling: nil,
4003
+ proration_behavior: nil
4004
+ )
4005
+ @amendments = amendments
4006
+ @billing_behavior = billing_behavior
2937
4007
  @billing_mode = billing_mode
2938
4008
  @end_behavior = end_behavior
2939
4009
  @phases = phases
4010
+ @prebilling = prebilling
2940
4011
  @proration_behavior = proration_behavior
2941
4012
  end
2942
4013
  end
@@ -2962,16 +4033,44 @@ module Stripe
2962
4033
  end
2963
4034
 
2964
4035
  class Discount < Stripe::RequestParams
4036
+ class DiscountEnd < Stripe::RequestParams
4037
+ class Duration < Stripe::RequestParams
4038
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4039
+ attr_accessor :interval
4040
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4041
+ attr_accessor :interval_count
4042
+
4043
+ def initialize(interval: nil, interval_count: nil)
4044
+ @interval = interval
4045
+ @interval_count = interval_count
4046
+ end
4047
+ end
4048
+ # Time span for the redeemed discount.
4049
+ attr_accessor :duration
4050
+ # A precise Unix timestamp for the discount to end. Must be in the future.
4051
+ attr_accessor :timestamp
4052
+ # The type of calculation made to determine when the discount ends.
4053
+ attr_accessor :type
4054
+
4055
+ def initialize(duration: nil, timestamp: nil, type: nil)
4056
+ @duration = duration
4057
+ @timestamp = timestamp
4058
+ @type = type
4059
+ end
4060
+ end
2965
4061
  # ID of the coupon to create a new discount for.
2966
4062
  attr_accessor :coupon
2967
4063
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2968
4064
  attr_accessor :discount
4065
+ # Details to determine how long the discount should be applied for.
4066
+ attr_accessor :discount_end
2969
4067
  # ID of the promotion code to create a new discount for.
2970
4068
  attr_accessor :promotion_code
2971
4069
 
2972
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
4070
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2973
4071
  @coupon = coupon
2974
4072
  @discount = discount
4073
+ @discount_end = discount_end
2975
4074
  @promotion_code = promotion_code
2976
4075
  end
2977
4076
  end
@@ -3066,6 +4165,15 @@ module Stripe
3066
4165
  @tax_rates = tax_rates
3067
4166
  end
3068
4167
  end
4168
+
4169
+ class Prebilling < Stripe::RequestParams
4170
+ # This is used to determine the number of billing cycles to prebill.
4171
+ attr_accessor :iterations
4172
+
4173
+ def initialize(iterations: nil)
4174
+ @iterations = iterations
4175
+ end
4176
+ end
3069
4177
  # 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`.
3070
4178
  attr_accessor :billing_cycle_anchor
3071
4179
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
@@ -3080,6 +4188,8 @@ module Stripe
3080
4188
  attr_accessor :default_tax_rates
3081
4189
  # A list of up to 20 subscription items, each with an attached price.
3082
4190
  attr_accessor :items
4191
+ # The pre-billing to apply to the subscription as a preview.
4192
+ attr_accessor :prebilling
3083
4193
  # 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`.
3084
4194
  attr_accessor :proration_behavior
3085
4195
  # 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'.
@@ -3099,6 +4209,7 @@ module Stripe
3099
4209
  cancel_now: nil,
3100
4210
  default_tax_rates: nil,
3101
4211
  items: nil,
4212
+ prebilling: nil,
3102
4213
  proration_behavior: nil,
3103
4214
  proration_date: nil,
3104
4215
  resume_at: nil,
@@ -3112,6 +4223,7 @@ module Stripe
3112
4223
  @cancel_now = cancel_now
3113
4224
  @default_tax_rates = default_tax_rates
3114
4225
  @items = items
4226
+ @prebilling = prebilling
3115
4227
  @proration_behavior = proration_behavior
3116
4228
  @proration_date = proration_date
3117
4229
  @resume_at = resume_at
@@ -3125,6 +4237,8 @@ module Stripe
3125
4237
  attr_accessor :currency
3126
4238
  # 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.
3127
4239
  attr_accessor :customer
4240
+ # 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.
4241
+ attr_accessor :customer_account
3128
4242
  # 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.
3129
4243
  attr_accessor :customer_details
3130
4244
  # 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.
@@ -3152,6 +4266,7 @@ module Stripe
3152
4266
  automatic_tax: nil,
3153
4267
  currency: nil,
3154
4268
  customer: nil,
4269
+ customer_account: nil,
3155
4270
  customer_details: nil,
3156
4271
  discounts: nil,
3157
4272
  expand: nil,
@@ -3167,6 +4282,7 @@ module Stripe
3167
4282
  @automatic_tax = automatic_tax
3168
4283
  @currency = currency
3169
4284
  @customer = customer
4285
+ @customer_account = customer_account
3170
4286
  @customer_details = customer_details
3171
4287
  @discounts = discounts
3172
4288
  @expand = expand
@@ -3196,6 +4312,8 @@ module Stripe
3196
4312
  attr_reader :amount_remaining
3197
4313
  # This is the sum of all the shipping amounts.
3198
4314
  attr_reader :amount_shipping
4315
+ # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
4316
+ attr_reader :amounts_due
3199
4317
  # ID of the Connect Application that created the invoice.
3200
4318
  attr_reader :application
3201
4319
  # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
@@ -3230,6 +4348,8 @@ module Stripe
3230
4348
  attr_reader :custom_fields
3231
4349
  # The ID of the customer who will be billed.
3232
4350
  attr_reader :customer
4351
+ # The ID of the account who will be billed.
4352
+ attr_reader :customer_account
3233
4353
  # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
3234
4354
  attr_reader :customer_address
3235
4355
  # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
@@ -3244,6 +4364,8 @@ module Stripe
3244
4364
  attr_reader :customer_tax_exempt
3245
4365
  # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
3246
4366
  attr_reader :customer_tax_ids
4367
+ # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
4368
+ attr_reader :default_margins
3247
4369
  # 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.
3248
4370
  attr_reader :default_payment_method
3249
4371
  # 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.
@@ -3334,6 +4456,8 @@ module Stripe
3334
4456
  attr_reader :total_discount_amounts
3335
4457
  # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
3336
4458
  attr_reader :total_excluding_tax
4459
+ # The aggregate amounts calculated per margin across all line items.
4460
+ attr_reader :total_margin_amounts
3337
4461
  # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
3338
4462
  attr_reader :total_pretax_credit_amounts
3339
4463
  # The aggregate tax information of all line items.