stripe 15.2.0 → 15.3.0.pre.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1600 -670
  3. data/VERSION +1 -1
  4. data/lib/stripe/api_requestor.rb +28 -0
  5. data/lib/stripe/api_version.rb +1 -1
  6. data/lib/stripe/errors.rb +54 -0
  7. data/lib/stripe/event_types.rb +98 -0
  8. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  9. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  10. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  11. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  17. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  19. data/lib/stripe/events/v2_core_account_link_completed_event.rb +13 -0
  20. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  21. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  22. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  23. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  24. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  25. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  26. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  27. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  30. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  48. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  53. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  58. data/lib/stripe/events/v2_off_session_payment_requires_capture_event.rb +21 -0
  59. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  60. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +21 -0
  61. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  62. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  65. data/lib/stripe/object_types.rb +50 -0
  66. data/lib/stripe/resources/account.rb +653 -1
  67. data/lib/stripe/resources/account_notice.rb +123 -0
  68. data/lib/stripe/resources/account_session.rb +256 -1
  69. data/lib/stripe/resources/balance_settings.rb +105 -0
  70. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  71. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  72. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  73. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  74. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  75. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  76. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  77. data/lib/stripe/resources/card.rb +2 -0
  78. data/lib/stripe/resources/cash_balance.rb +2 -0
  79. data/lib/stripe/resources/charge.rb +1538 -0
  80. data/lib/stripe/resources/checkout/session.rb +330 -2
  81. data/lib/stripe/resources/confirmation_token.rb +170 -0
  82. data/lib/stripe/resources/coupon.rb +30 -1
  83. data/lib/stripe/resources/credit_note.rb +6 -0
  84. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  85. data/lib/stripe/resources/customer.rb +2 -0
  86. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  87. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  88. data/lib/stripe/resources/customer_session.rb +6 -1
  89. data/lib/stripe/resources/discount.rb +2 -0
  90. data/lib/stripe/resources/event.rb +31 -0
  91. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  92. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  93. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  94. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  95. data/lib/stripe/resources/fx_quote.rb +184 -0
  96. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  97. data/lib/stripe/resources/invoice.rb +1070 -16
  98. data/lib/stripe/resources/invoice_item.rb +78 -2
  99. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  100. data/lib/stripe/resources/invoice_payment.rb +2 -53
  101. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  102. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  103. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  104. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  105. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  106. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  107. data/lib/stripe/resources/line_item.rb +37 -0
  108. data/lib/stripe/resources/mandate.rb +24 -0
  109. data/lib/stripe/resources/margin.rb +115 -0
  110. data/lib/stripe/resources/order.rb +2806 -0
  111. data/lib/stripe/resources/payment_attempt_record.rb +1086 -0
  112. data/lib/stripe/resources/payment_intent.rb +7694 -2738
  113. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  114. data/lib/stripe/resources/payment_method.rb +192 -1
  115. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  116. data/lib/stripe/resources/payment_record.rb +1615 -0
  117. data/lib/stripe/resources/payout.rb +6 -0
  118. data/lib/stripe/resources/price.rb +30 -0
  119. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  120. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  121. data/lib/stripe/resources/promotion_code.rb +10 -0
  122. data/lib/stripe/resources/quote.rb +2046 -6
  123. data/lib/stripe/resources/quote_line.rb +274 -0
  124. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  125. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +364 -0
  126. data/lib/stripe/resources/refund.rb +9 -0
  127. data/lib/stripe/resources/setup_attempt.rb +21 -0
  128. data/lib/stripe/resources/setup_intent.rb +578 -9
  129. data/lib/stripe/resources/source.rb +29 -0
  130. data/lib/stripe/resources/subscription.rb +333 -9
  131. data/lib/stripe/resources/subscription_item.rb +84 -3
  132. data/lib/stripe/resources/subscription_schedule.rb +1013 -10
  133. data/lib/stripe/resources/tax/association.rb +66 -0
  134. data/lib/stripe/resources/tax/form.rb +211 -0
  135. data/lib/stripe/resources/tax_id.rb +12 -2
  136. data/lib/stripe/resources/terminal/reader.rb +156 -0
  137. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  138. data/lib/stripe/resources/transfer.rb +6 -0
  139. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  140. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  141. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  142. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  143. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  144. data/lib/stripe/resources/v2/core/account.rb +1746 -0
  145. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  146. data/lib/stripe/resources/v2/core/person.rb +276 -0
  147. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  148. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  149. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  150. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  151. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  152. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  153. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  154. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  155. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  156. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  157. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  158. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  159. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  160. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  161. data/lib/stripe/resources/v2/money_management/received_credit.rb +116 -0
  162. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  163. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  164. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  165. data/lib/stripe/resources/v2/payments/off_session_payment.rb +74 -0
  166. data/lib/stripe/resources.rb +104 -0
  167. data/lib/stripe/services/account_notice_service.rb +101 -0
  168. data/lib/stripe/services/account_service.rb +562 -1
  169. data/lib/stripe/services/account_session_service.rb +226 -1
  170. data/lib/stripe/services/balance_settings_service.rb +96 -0
  171. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  172. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  173. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  174. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  175. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  176. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  177. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  178. data/lib/stripe/services/capital_service.rb +15 -0
  179. data/lib/stripe/services/charge_service.rb +1418 -0
  180. data/lib/stripe/services/checkout/session_service.rb +247 -2
  181. data/lib/stripe/services/coupon_service.rb +17 -1
  182. data/lib/stripe/services/credit_note_service.rb +4 -0
  183. data/lib/stripe/services/customer_session_service.rb +4 -1
  184. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  185. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  186. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  187. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  188. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  189. data/lib/stripe/services/financial_connections_service.rb +2 -1
  190. data/lib/stripe/services/fx_quote_service.rb +123 -0
  191. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  192. data/lib/stripe/services/invoice_item_service.rb +74 -2
  193. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  194. data/lib/stripe/services/invoice_service.rb +1021 -16
  195. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  196. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  197. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  198. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  199. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  200. data/lib/stripe/services/issuing_service.rb +5 -1
  201. data/lib/stripe/services/margin_service.rb +119 -0
  202. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  203. data/lib/stripe/services/order_service.rb +2236 -0
  204. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  205. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  206. data/lib/stripe/services/payment_intent_service.rb +4733 -245
  207. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  208. data/lib/stripe/services/payment_method_service.rb +120 -1
  209. data/lib/stripe/services/payment_record_service.rb +542 -0
  210. data/lib/stripe/services/payout_service.rb +4 -0
  211. data/lib/stripe/services/price_service.rb +19 -0
  212. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  213. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  214. data/lib/stripe/services/privacy_service.rb +13 -0
  215. data/lib/stripe/services/promotion_code_service.rb +8 -0
  216. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  217. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  218. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  219. data/lib/stripe/services/quote_service.rb +1730 -7
  220. data/lib/stripe/services/setup_intent_service.rb +538 -9
  221. data/lib/stripe/services/subscription_item_service.rb +75 -3
  222. data/lib/stripe/services/subscription_schedule_service.rb +915 -10
  223. data/lib/stripe/services/subscription_service.rb +276 -9
  224. data/lib/stripe/services/tax/association_service.rb +31 -0
  225. data/lib/stripe/services/tax/form_service.rb +100 -0
  226. data/lib/stripe/services/tax_id_service.rb +8 -2
  227. data/lib/stripe/services/tax_service.rb +3 -1
  228. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  229. data/lib/stripe/services/terminal/reader_service.rb +90 -0
  230. data/lib/stripe/services/terminal_service.rb +2 -1
  231. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  232. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  233. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  234. data/lib/stripe/services/transfer_service.rb +4 -0
  235. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  236. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  237. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  238. data/lib/stripe/services/v1_services.rb +11 -2
  239. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  240. data/lib/stripe/services/v2/core/account_service.rb +4138 -0
  241. data/lib/stripe/services/v2/core/accounts/person_service.rb +1046 -0
  242. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +131 -0
  243. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  244. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  245. data/lib/stripe/services/v2/core_service.rb +4 -1
  246. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  247. data/lib/stripe/services/v2/money_management/financial_account_service.rb +43 -0
  248. data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -0
  249. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  250. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  251. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +200 -0
  252. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  253. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  254. data/lib/stripe/services/v2/money_management/payout_method_service.rb +91 -0
  255. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  256. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  257. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  258. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  259. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  260. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  261. data/lib/stripe/services/v2/payment_service.rb +15 -0
  262. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +138 -0
  263. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  264. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +49 -0
  265. data/lib/stripe/services/v2_services.rb +5 -2
  266. data/lib/stripe/services.rb +53 -1
  267. data/lib/stripe/stripe_configuration.rb +3 -1
  268. data/lib/stripe/stripe_object.rb +1 -1
  269. data/lib/stripe/util.rb +7 -1
  270. data/lib/stripe/version.rb +1 -1
  271. data/lib/stripe.rb +53 -0
  272. data/rbi/stripe.rbi +191639 -0
  273. data/stripe.gemspec +4 -1
  274. metadata +161 -324
  275. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  276. data/rbi/stripe/resources/account.rbi +0 -4926
  277. data/rbi/stripe/resources/account_link.rbi +0 -74
  278. data/rbi/stripe/resources/account_session.rbi +0 -1013
  279. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  280. data/rbi/stripe/resources/application.rbi +0 -20
  281. data/rbi/stripe/resources/application_fee.rbi +0 -118
  282. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  283. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  284. data/rbi/stripe/resources/balance.rbi +0 -235
  285. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  286. data/rbi/stripe/resources/bank_account.rbi +0 -127
  287. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  288. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  289. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  290. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  291. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  292. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  293. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  294. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  295. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  296. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  297. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  298. data/rbi/stripe/resources/capability.rbi +0 -125
  299. data/rbi/stripe/resources/card.rbi +0 -125
  300. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  301. data/rbi/stripe/resources/charge.rbi +0 -2069
  302. data/rbi/stripe/resources/checkout/session.rbi +0 -4004
  303. data/rbi/stripe/resources/climate/order.rbi +0 -245
  304. data/rbi/stripe/resources/climate/product.rbi +0 -75
  305. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  306. data/rbi/stripe/resources/confirmation_token.rbi +0 -1807
  307. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  308. data/rbi/stripe/resources/country_spec.rbi +0 -85
  309. data/rbi/stripe/resources/coupon.rbi +0 -250
  310. data/rbi/stripe/resources/credit_note.rbi +0 -752
  311. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  312. data/rbi/stripe/resources/customer.rbi +0 -1005
  313. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  314. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  315. data/rbi/stripe/resources/customer_session.rbi +0 -200
  316. data/rbi/stripe/resources/discount.rbi +0 -53
  317. data/rbi/stripe/resources/dispute.rbi +0 -761
  318. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  319. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  320. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  321. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  322. data/rbi/stripe/resources/event.rbi +0 -149
  323. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  324. data/rbi/stripe/resources/file.rbi +0 -143
  325. data/rbi/stripe/resources/file_link.rbi +0 -141
  326. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  327. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  328. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  329. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  330. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  331. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  332. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  333. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  334. data/rbi/stripe/resources/identity/verification_session.rbi +0 -526
  335. data/rbi/stripe/resources/invoice.rbi +0 -3812
  336. data/rbi/stripe/resources/invoice_item.rbi +0 -473
  337. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  338. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  339. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  340. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  341. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  342. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  343. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  344. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  345. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  346. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  347. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  348. data/rbi/stripe/resources/line_item.rbi +0 -72
  349. data/rbi/stripe/resources/login_link.rbi +0 -19
  350. data/rbi/stripe/resources/mandate.rbi +0 -187
  351. data/rbi/stripe/resources/payment_intent.rbi +0 -9647
  352. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  353. data/rbi/stripe/resources/payment_method.rbi +0 -1761
  354. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  355. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  356. data/rbi/stripe/resources/payout.rbi +0 -300
  357. data/rbi/stripe/resources/person.rbi +0 -401
  358. data/rbi/stripe/resources/plan.rbi +0 -371
  359. data/rbi/stripe/resources/price.rbi +0 -694
  360. data/rbi/stripe/resources/product.rbi +0 -555
  361. data/rbi/stripe/resources/product_feature.rbi +0 -26
  362. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  363. data/rbi/stripe/resources/quote.rbi +0 -1126
  364. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  365. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  366. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  367. data/rbi/stripe/resources/refund.rbi +0 -523
  368. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  369. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  370. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  371. data/rbi/stripe/resources/reversal.rbi +0 -51
  372. data/rbi/stripe/resources/review.rbi +0 -154
  373. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  374. data/rbi/stripe/resources/setup_intent.rbi +0 -3655
  375. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  376. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  377. data/rbi/stripe/resources/source.rbi +0 -1496
  378. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  379. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  380. data/rbi/stripe/resources/subscription.rbi +0 -2027
  381. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  382. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1623
  383. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  384. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  385. data/rbi/stripe/resources/tax/registration.rbi +0 -2713
  386. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  387. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  388. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  389. data/rbi/stripe/resources/tax_code.rbi +0 -44
  390. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  391. data/rbi/stripe/resources/tax_id.rbi +0 -165
  392. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  393. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1386
  394. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  395. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  396. data/rbi/stripe/resources/terminal/reader.rbi +0 -847
  397. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  398. data/rbi/stripe/resources/token.rbi +0 -1283
  399. data/rbi/stripe/resources/topup.rbi +0 -222
  400. data/rbi/stripe/resources/transfer.rbi +0 -199
  401. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  402. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  403. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -865
  404. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  405. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  406. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  407. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  408. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  409. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  410. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  411. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  412. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  413. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  414. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  415. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  416. data/rbi/stripe/resources/v2/event.rbi +0 -48
  417. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  418. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  419. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  420. data/rbi/stripe/services/account_link_service.rbi +0 -58
  421. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  422. data/rbi/stripe/services/account_person_service.rbi +0 -1011
  423. data/rbi/stripe/services/account_service.rbi +0 -4213
  424. data/rbi/stripe/services/account_session_service.rbi +0 -646
  425. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  426. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  427. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  428. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  429. data/rbi/stripe/services/apps_service.rbi +0 -9
  430. data/rbi/stripe/services/balance_service.rbi +0 -21
  431. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  432. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  433. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  434. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  435. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  436. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  437. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  438. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  439. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  440. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  441. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  442. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  443. data/rbi/stripe/services/billing_service.rbi +0 -15
  444. data/rbi/stripe/services/charge_service.rbi +0 -448
  445. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  446. data/rbi/stripe/services/checkout/session_service.rbi +0 -2614
  447. data/rbi/stripe/services/checkout_service.rbi +0 -9
  448. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  449. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  450. data/rbi/stripe/services/climate_service.rbi +0 -11
  451. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  452. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  453. data/rbi/stripe/services/coupon_service.rbi +0 -194
  454. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  455. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  456. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  457. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  458. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  459. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  460. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  461. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  462. data/rbi/stripe/services/customer_service.rbi +0 -647
  463. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  464. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  465. data/rbi/stripe/services/dispute_service.rbi +0 -424
  466. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  467. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  468. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  469. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  470. data/rbi/stripe/services/event_service.rbi +0 -83
  471. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  472. data/rbi/stripe/services/file_link_service.rbi +0 -124
  473. data/rbi/stripe/services/file_service.rbi +0 -116
  474. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  475. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  476. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  477. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  478. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  479. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  480. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  481. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  482. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -323
  483. data/rbi/stripe/services/identity_service.rbi +0 -10
  484. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  485. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  486. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  487. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  488. data/rbi/stripe/services/invoice_service.rbi +0 -2981
  489. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  490. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  491. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  492. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  493. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  494. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  495. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  496. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  497. data/rbi/stripe/services/issuing_service.rbi +0 -16
  498. data/rbi/stripe/services/mandate_service.rbi +0 -20
  499. data/rbi/stripe/services/payment_intent_service.rbi +0 -7659
  500. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  501. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  502. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  503. data/rbi/stripe/services/payment_method_service.rbi +0 -776
  504. data/rbi/stripe/services/payout_service.rbi +0 -205
  505. data/rbi/stripe/services/plan_service.rbi +0 -282
  506. data/rbi/stripe/services/price_service.rbi +0 -546
  507. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  508. data/rbi/stripe/services/product_service.rbi +0 -477
  509. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  510. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  511. data/rbi/stripe/services/quote_service.rbi +0 -686
  512. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  513. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  514. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  515. data/rbi/stripe/services/radar_service.rbi +0 -11
  516. data/rbi/stripe/services/refund_service.rbi +0 -185
  517. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  518. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  519. data/rbi/stripe/services/reporting_service.rbi +0 -10
  520. data/rbi/stripe/services/review_service.rbi +0 -84
  521. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  522. data/rbi/stripe/services/setup_intent_service.rbi +0 -3391
  523. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  524. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  525. data/rbi/stripe/services/sigma_service.rbi +0 -9
  526. data/rbi/stripe/services/source_service.rbi +0 -663
  527. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  528. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1290
  529. data/rbi/stripe/services/subscription_service.rbi +0 -1648
  530. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  531. data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
  532. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  533. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  534. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  535. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  536. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  537. data/rbi/stripe/services/tax_service.rbi +0 -12
  538. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1118
  539. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  540. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  541. data/rbi/stripe/services/terminal/reader_service.rbi +0 -455
  542. data/rbi/stripe/services/terminal_service.rbi +0 -12
  543. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -739
  544. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  545. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  546. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  547. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  548. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  549. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  550. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  551. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -93
  552. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  553. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  554. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  555. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  556. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  557. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  558. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  559. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  560. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  561. data/rbi/stripe/services/token_service.rbi +0 -1257
  562. data/rbi/stripe/services/topup_service.rbi +0 -176
  563. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  564. data/rbi/stripe/services/transfer_service.rbi +0 -152
  565. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  566. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  567. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  568. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -562
  569. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  570. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  571. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  572. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  573. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  574. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  575. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  576. data/rbi/stripe/services/treasury_service.rbi +0 -18
  577. data/rbi/stripe/services/v1_services.rbi +0 -77
  578. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  579. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  580. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  581. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  582. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  583. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  584. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  585. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  586. data/rbi/stripe/services/v2_services.rbi +0 -10
  587. 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,6 +310,7 @@ 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
 
@@ -291,6 +319,8 @@ module Stripe
291
319
  class Filters < Stripe::StripeObject
292
320
  # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
293
321
  attr_reader :account_subcategories
322
+ # The institution to use to filter for possible accounts to link.
323
+ attr_reader :institution
294
324
  end
295
325
  # Attribute for field filters
296
326
  attr_reader :filters
@@ -312,6 +342,8 @@ module Stripe
312
342
  attr_reader :card
313
343
  # 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
344
  attr_reader :customer_balance
345
+ # 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.
346
+ attr_reader :id_bank_transfer
315
347
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
316
348
  attr_reader :konbini
317
349
  # 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.
@@ -425,6 +457,13 @@ module Stripe
425
457
  attr_reader :discount
426
458
  end
427
459
 
460
+ class TotalMarginAmount < Stripe::StripeObject
461
+ # The amount, in cents (or local equivalent), of the reduction in line item amount.
462
+ attr_reader :amount
463
+ # The margin that was applied to get this margin amount.
464
+ attr_reader :margin
465
+ end
466
+
428
467
  class TotalPretaxCreditAmount < Stripe::StripeObject
429
468
  # The amount, in cents (or local equivalent), of the pretax credit amount.
430
469
  attr_reader :amount
@@ -432,6 +471,8 @@ module Stripe
432
471
  attr_reader :credit_balance_transaction
433
472
  # The discount that was applied to get this pretax credit amount.
434
473
  attr_reader :discount
474
+ # The margin that was applied to get this pretax credit amount.
475
+ attr_reader :margin
435
476
  # Type of the pretax credit amount referenced.
436
477
  attr_reader :type
437
478
  end
@@ -458,6 +499,24 @@ module Stripe
458
499
  class DeleteParams < Stripe::RequestParams; end
459
500
 
460
501
  class UpdateParams < Stripe::RequestParams
502
+ class AmountsDue < Stripe::RequestParams
503
+ # The amount in cents (or local equivalent).
504
+ attr_accessor :amount
505
+ # Number of days from when invoice is finalized until the payment is due.
506
+ attr_accessor :days_until_due
507
+ # An arbitrary string attached to the object. Often useful for displaying to users.
508
+ attr_accessor :description
509
+ # Date on which a payment plan’s payment is due.
510
+ attr_accessor :due_date
511
+
512
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
513
+ @amount = amount
514
+ @days_until_due = days_until_due
515
+ @description = description
516
+ @due_date = due_date
517
+ end
518
+ end
519
+
461
520
  class AutomaticTax < Stripe::RequestParams
462
521
  class Liability < Stripe::RequestParams
463
522
  # The connected account being referenced when `type` is `account`.
@@ -494,16 +553,44 @@ module Stripe
494
553
  end
495
554
 
496
555
  class Discount < Stripe::RequestParams
556
+ class DiscountEnd < Stripe::RequestParams
557
+ class Duration < Stripe::RequestParams
558
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
559
+ attr_accessor :interval
560
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
561
+ attr_accessor :interval_count
562
+
563
+ def initialize(interval: nil, interval_count: nil)
564
+ @interval = interval
565
+ @interval_count = interval_count
566
+ end
567
+ end
568
+ # Time span for the redeemed discount.
569
+ attr_accessor :duration
570
+ # A precise Unix timestamp for the discount to end. Must be in the future.
571
+ attr_accessor :timestamp
572
+ # The type of calculation made to determine when the discount ends.
573
+ attr_accessor :type
574
+
575
+ def initialize(duration: nil, timestamp: nil, type: nil)
576
+ @duration = duration
577
+ @timestamp = timestamp
578
+ @type = type
579
+ end
580
+ end
497
581
  # ID of the coupon to create a new discount for.
498
582
  attr_accessor :coupon
499
583
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
500
584
  attr_accessor :discount
585
+ # Details to determine how long the discount should be applied for.
586
+ attr_accessor :discount_end
501
587
  # ID of the promotion code to create a new discount for.
502
588
  attr_accessor :promotion_code
503
589
 
504
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
590
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
505
591
  @coupon = coupon
506
592
  @discount = discount
593
+ @discount_end = discount_end
507
594
  @promotion_code = promotion_code
508
595
  end
509
596
  end
@@ -623,6 +710,7 @@ module Stripe
623
710
  end
624
711
  end
625
712
 
713
+ class IdBankTransfer < Stripe::RequestParams; end
626
714
  class Konbini < Stripe::RequestParams; end
627
715
  class SepaDebit < Stripe::RequestParams; end
628
716
 
@@ -631,9 +719,12 @@ module Stripe
631
719
  class Filters < Stripe::RequestParams
632
720
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
633
721
  attr_accessor :account_subcategories
722
+ # ID of the institution to use to filter for selectable accounts.
723
+ attr_accessor :institution
634
724
 
635
- def initialize(account_subcategories: nil)
725
+ def initialize(account_subcategories: nil, institution: nil)
636
726
  @account_subcategories = account_subcategories
727
+ @institution = institution
637
728
  end
638
729
  end
639
730
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -667,6 +758,8 @@ module Stripe
667
758
  attr_accessor :card
668
759
  # 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
760
  attr_accessor :customer_balance
761
+ # 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.
762
+ attr_accessor :id_bank_transfer
670
763
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
671
764
  attr_accessor :konbini
672
765
  # 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.
@@ -679,6 +772,7 @@ module Stripe
679
772
  bancontact: nil,
680
773
  card: nil,
681
774
  customer_balance: nil,
775
+ id_bank_transfer: nil,
682
776
  konbini: nil,
683
777
  sepa_debit: nil,
684
778
  us_bank_account: nil
@@ -687,6 +781,7 @@ module Stripe
687
781
  @bancontact = bancontact
688
782
  @card = card
689
783
  @customer_balance = customer_balance
784
+ @id_bank_transfer = id_bank_transfer
690
785
  @konbini = konbini
691
786
  @sepa_debit = sepa_debit
692
787
  @us_bank_account = us_bank_account
@@ -898,6 +993,8 @@ module Stripe
898
993
  end
899
994
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
900
995
  attr_accessor :account_tax_ids
996
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
997
+ attr_accessor :amounts_due
901
998
  # 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
999
  attr_accessor :application_fee_amount
903
1000
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -912,6 +1009,8 @@ module Stripe
912
1009
  attr_accessor :custom_fields
913
1010
  # 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
1011
  attr_accessor :days_until_due
1012
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1013
+ attr_accessor :default_margins
915
1014
  # 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
1015
  attr_accessor :default_payment_method
917
1016
  # 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 +1052,7 @@ module Stripe
953
1052
 
954
1053
  def initialize(
955
1054
  account_tax_ids: nil,
1055
+ amounts_due: nil,
956
1056
  application_fee_amount: nil,
957
1057
  auto_advance: nil,
958
1058
  automatic_tax: nil,
@@ -960,6 +1060,7 @@ module Stripe
960
1060
  collection_method: nil,
961
1061
  custom_fields: nil,
962
1062
  days_until_due: nil,
1063
+ default_margins: nil,
963
1064
  default_payment_method: nil,
964
1065
  default_source: nil,
965
1066
  default_tax_rates: nil,
@@ -981,6 +1082,7 @@ module Stripe
981
1082
  transfer_data: nil
982
1083
  )
983
1084
  @account_tax_ids = account_tax_ids
1085
+ @amounts_due = amounts_due
984
1086
  @application_fee_amount = application_fee_amount
985
1087
  @auto_advance = auto_advance
986
1088
  @automatic_tax = automatic_tax
@@ -988,6 +1090,7 @@ module Stripe
988
1090
  @collection_method = collection_method
989
1091
  @custom_fields = custom_fields
990
1092
  @days_until_due = days_until_due
1093
+ @default_margins = default_margins
991
1094
  @default_payment_method = default_payment_method
992
1095
  @default_source = default_source
993
1096
  @default_tax_rates = default_tax_rates
@@ -1052,6 +1155,8 @@ module Stripe
1052
1155
  attr_accessor :created
1053
1156
  # Only return invoices for the customer specified by this customer ID.
1054
1157
  attr_accessor :customer
1158
+ # Only return invoices for the account specified by this account ID.
1159
+ attr_accessor :customer_account
1055
1160
  # Attribute for param field due_date
1056
1161
  attr_accessor :due_date
1057
1162
  # 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 +1176,7 @@ module Stripe
1071
1176
  collection_method: nil,
1072
1177
  created: nil,
1073
1178
  customer: nil,
1179
+ customer_account: nil,
1074
1180
  due_date: nil,
1075
1181
  ending_before: nil,
1076
1182
  expand: nil,
@@ -1082,6 +1188,7 @@ module Stripe
1082
1188
  @collection_method = collection_method
1083
1189
  @created = created
1084
1190
  @customer = customer
1191
+ @customer_account = customer_account
1085
1192
  @due_date = due_date
1086
1193
  @ending_before = ending_before
1087
1194
  @expand = expand
@@ -1093,6 +1200,24 @@ module Stripe
1093
1200
  end
1094
1201
 
1095
1202
  class CreateParams < Stripe::RequestParams
1203
+ class AmountsDue < Stripe::RequestParams
1204
+ # The amount in cents (or local equivalent).
1205
+ attr_accessor :amount
1206
+ # Number of days from when invoice is finalized until the payment is due.
1207
+ attr_accessor :days_until_due
1208
+ # An arbitrary string attached to the object. Often useful for displaying to users.
1209
+ attr_accessor :description
1210
+ # Date on which a payment plan’s payment is due.
1211
+ attr_accessor :due_date
1212
+
1213
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
1214
+ @amount = amount
1215
+ @days_until_due = days_until_due
1216
+ @description = description
1217
+ @due_date = due_date
1218
+ end
1219
+ end
1220
+
1096
1221
  class AutomaticTax < Stripe::RequestParams
1097
1222
  class Liability < Stripe::RequestParams
1098
1223
  # The connected account being referenced when `type` is `account`.
@@ -1129,16 +1254,44 @@ module Stripe
1129
1254
  end
1130
1255
 
1131
1256
  class Discount < Stripe::RequestParams
1257
+ class DiscountEnd < Stripe::RequestParams
1258
+ class Duration < Stripe::RequestParams
1259
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1260
+ attr_accessor :interval
1261
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1262
+ attr_accessor :interval_count
1263
+
1264
+ def initialize(interval: nil, interval_count: nil)
1265
+ @interval = interval
1266
+ @interval_count = interval_count
1267
+ end
1268
+ end
1269
+ # Time span for the redeemed discount.
1270
+ attr_accessor :duration
1271
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1272
+ attr_accessor :timestamp
1273
+ # The type of calculation made to determine when the discount ends.
1274
+ attr_accessor :type
1275
+
1276
+ def initialize(duration: nil, timestamp: nil, type: nil)
1277
+ @duration = duration
1278
+ @timestamp = timestamp
1279
+ @type = type
1280
+ end
1281
+ end
1132
1282
  # ID of the coupon to create a new discount for.
1133
1283
  attr_accessor :coupon
1134
1284
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1135
1285
  attr_accessor :discount
1286
+ # Details to determine how long the discount should be applied for.
1287
+ attr_accessor :discount_end
1136
1288
  # ID of the promotion code to create a new discount for.
1137
1289
  attr_accessor :promotion_code
1138
1290
 
1139
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1291
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1140
1292
  @coupon = coupon
1141
1293
  @discount = discount
1294
+ @discount_end = discount_end
1142
1295
  @promotion_code = promotion_code
1143
1296
  end
1144
1297
  end
@@ -1270,6 +1423,7 @@ module Stripe
1270
1423
  end
1271
1424
  end
1272
1425
 
1426
+ class IdBankTransfer < Stripe::RequestParams; end
1273
1427
  class Konbini < Stripe::RequestParams; end
1274
1428
  class SepaDebit < Stripe::RequestParams; end
1275
1429
 
@@ -1278,9 +1432,12 @@ module Stripe
1278
1432
  class Filters < Stripe::RequestParams
1279
1433
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1280
1434
  attr_accessor :account_subcategories
1435
+ # ID of the institution to use to filter for selectable accounts.
1436
+ attr_accessor :institution
1281
1437
 
1282
- def initialize(account_subcategories: nil)
1438
+ def initialize(account_subcategories: nil, institution: nil)
1283
1439
  @account_subcategories = account_subcategories
1440
+ @institution = institution
1284
1441
  end
1285
1442
  end
1286
1443
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -1314,6 +1471,8 @@ module Stripe
1314
1471
  attr_accessor :card
1315
1472
  # 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
1473
  attr_accessor :customer_balance
1474
+ # 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.
1475
+ attr_accessor :id_bank_transfer
1317
1476
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1318
1477
  attr_accessor :konbini
1319
1478
  # 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.
@@ -1326,6 +1485,7 @@ module Stripe
1326
1485
  bancontact: nil,
1327
1486
  card: nil,
1328
1487
  customer_balance: nil,
1488
+ id_bank_transfer: nil,
1329
1489
  konbini: nil,
1330
1490
  sepa_debit: nil,
1331
1491
  us_bank_account: nil
@@ -1334,6 +1494,7 @@ module Stripe
1334
1494
  @bancontact = bancontact
1335
1495
  @card = card
1336
1496
  @customer_balance = customer_balance
1497
+ @id_bank_transfer = id_bank_transfer
1337
1498
  @konbini = konbini
1338
1499
  @sepa_debit = sepa_debit
1339
1500
  @us_bank_account = us_bank_account
@@ -1545,6 +1706,8 @@ module Stripe
1545
1706
  end
1546
1707
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1547
1708
  attr_accessor :account_tax_ids
1709
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1710
+ attr_accessor :amounts_due
1548
1711
  # 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
1712
  attr_accessor :application_fee_amount
1550
1713
  # 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.
@@ -1561,8 +1724,12 @@ module Stripe
1561
1724
  attr_accessor :custom_fields
1562
1725
  # The ID of the customer who will be billed.
1563
1726
  attr_accessor :customer
1727
+ # The ID of the account who will be billed.
1728
+ attr_accessor :customer_account
1564
1729
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1565
1730
  attr_accessor :days_until_due
1731
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1732
+ attr_accessor :default_margins
1566
1733
  # 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
1734
  attr_accessor :default_payment_method
1568
1735
  # 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 +1777,7 @@ module Stripe
1610
1777
 
1611
1778
  def initialize(
1612
1779
  account_tax_ids: nil,
1780
+ amounts_due: nil,
1613
1781
  application_fee_amount: nil,
1614
1782
  auto_advance: nil,
1615
1783
  automatic_tax: nil,
@@ -1618,7 +1786,9 @@ module Stripe
1618
1786
  currency: nil,
1619
1787
  custom_fields: nil,
1620
1788
  customer: nil,
1789
+ customer_account: nil,
1621
1790
  days_until_due: nil,
1791
+ default_margins: nil,
1622
1792
  default_payment_method: nil,
1623
1793
  default_source: nil,
1624
1794
  default_tax_rates: nil,
@@ -1643,6 +1813,7 @@ module Stripe
1643
1813
  transfer_data: nil
1644
1814
  )
1645
1815
  @account_tax_ids = account_tax_ids
1816
+ @amounts_due = amounts_due
1646
1817
  @application_fee_amount = application_fee_amount
1647
1818
  @auto_advance = auto_advance
1648
1819
  @automatic_tax = automatic_tax
@@ -1651,7 +1822,9 @@ module Stripe
1651
1822
  @currency = currency
1652
1823
  @custom_fields = custom_fields
1653
1824
  @customer = customer
1825
+ @customer_account = customer_account
1654
1826
  @days_until_due = days_until_due
1827
+ @default_margins = default_margins
1655
1828
  @default_payment_method = default_payment_method
1656
1829
  @default_source = default_source
1657
1830
  @default_tax_rates = default_tax_rates
@@ -1698,16 +1871,44 @@ module Stripe
1698
1871
  class AddLinesParams < Stripe::RequestParams
1699
1872
  class Line < Stripe::RequestParams
1700
1873
  class Discount < Stripe::RequestParams
1874
+ class DiscountEnd < Stripe::RequestParams
1875
+ class Duration < Stripe::RequestParams
1876
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1877
+ attr_accessor :interval
1878
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1879
+ attr_accessor :interval_count
1880
+
1881
+ def initialize(interval: nil, interval_count: nil)
1882
+ @interval = interval
1883
+ @interval_count = interval_count
1884
+ end
1885
+ end
1886
+ # Time span for the redeemed discount.
1887
+ attr_accessor :duration
1888
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1889
+ attr_accessor :timestamp
1890
+ # The type of calculation made to determine when the discount ends.
1891
+ attr_accessor :type
1892
+
1893
+ def initialize(duration: nil, timestamp: nil, type: nil)
1894
+ @duration = duration
1895
+ @timestamp = timestamp
1896
+ @type = type
1897
+ end
1898
+ end
1701
1899
  # ID of the coupon to create a new discount for.
1702
1900
  attr_accessor :coupon
1703
1901
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1704
1902
  attr_accessor :discount
1903
+ # Details to determine how long the discount should be applied for.
1904
+ attr_accessor :discount_end
1705
1905
  # ID of the promotion code to create a new discount for.
1706
1906
  attr_accessor :promotion_code
1707
1907
 
1708
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1908
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1709
1909
  @coupon = coupon
1710
1910
  @discount = discount
1911
+ @discount_end = discount_end
1711
1912
  @promotion_code = promotion_code
1712
1913
  end
1713
1914
  end
@@ -1860,6 +2061,8 @@ module Stripe
1860
2061
  attr_accessor :discounts
1861
2062
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1862
2063
  attr_accessor :invoice_item
2064
+ # 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.
2065
+ attr_accessor :margins
1863
2066
  # 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
2067
  attr_accessor :metadata
1865
2068
  # 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 +2084,7 @@ module Stripe
1881
2084
  discountable: nil,
1882
2085
  discounts: nil,
1883
2086
  invoice_item: nil,
2087
+ margins: nil,
1884
2088
  metadata: nil,
1885
2089
  period: nil,
1886
2090
  price_data: nil,
@@ -1894,6 +2098,7 @@ module Stripe
1894
2098
  @discountable = discountable
1895
2099
  @discounts = discounts
1896
2100
  @invoice_item = invoice_item
2101
+ @margins = margins
1897
2102
  @metadata = metadata
1898
2103
  @period = period
1899
2104
  @price_data = price_data
@@ -1918,14 +2123,59 @@ module Stripe
1918
2123
  end
1919
2124
 
1920
2125
  class AttachPaymentParams < Stripe::RequestParams
2126
+ class PaymentRecordData < Stripe::RequestParams
2127
+ # The amount that was paid out of band.
2128
+ attr_accessor :amount
2129
+ # The currency that was paid out of band.
2130
+ attr_accessor :currency
2131
+ # 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`.
2132
+ attr_accessor :metadata
2133
+ # The type of money movement for this out of band payment record.
2134
+ attr_accessor :money_movement_type
2135
+ # The timestamp when this out of band payment was paid.
2136
+ attr_accessor :paid_at
2137
+ # The reference for this out of band payment record.
2138
+ attr_accessor :payment_reference
2139
+
2140
+ def initialize(
2141
+ amount: nil,
2142
+ currency: nil,
2143
+ metadata: nil,
2144
+ money_movement_type: nil,
2145
+ paid_at: nil,
2146
+ payment_reference: nil
2147
+ )
2148
+ @amount = amount
2149
+ @currency = currency
2150
+ @metadata = metadata
2151
+ @money_movement_type = money_movement_type
2152
+ @paid_at = paid_at
2153
+ @payment_reference = payment_reference
2154
+ end
2155
+ end
2156
+ # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
2157
+ attr_accessor :amount_requested
1921
2158
  # Specifies which fields in the response should be expanded.
1922
2159
  attr_accessor :expand
1923
2160
  # The ID of the PaymentIntent to attach to the invoice.
1924
2161
  attr_accessor :payment_intent
2162
+ # The ID of the PaymentRecord to attach to the invoice.
2163
+ attr_accessor :payment_record
2164
+ # The PaymentRecord data for attaching an out of band payment to the invoice.
2165
+ attr_accessor :payment_record_data
1925
2166
 
1926
- def initialize(expand: nil, payment_intent: nil)
2167
+ def initialize(
2168
+ amount_requested: nil,
2169
+ expand: nil,
2170
+ payment_intent: nil,
2171
+ payment_record: nil,
2172
+ payment_record_data: nil
2173
+ )
2174
+ @amount_requested = amount_requested
1927
2175
  @expand = expand
1928
2176
  @payment_intent = payment_intent
2177
+ @payment_record = payment_record
2178
+ @payment_record_data = payment_record_data
1929
2179
  end
1930
2180
  end
1931
2181
 
@@ -2025,16 +2275,44 @@ module Stripe
2025
2275
  class UpdateLinesParams < Stripe::RequestParams
2026
2276
  class Line < Stripe::RequestParams
2027
2277
  class Discount < Stripe::RequestParams
2278
+ class DiscountEnd < Stripe::RequestParams
2279
+ class Duration < Stripe::RequestParams
2280
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2281
+ attr_accessor :interval
2282
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2283
+ attr_accessor :interval_count
2284
+
2285
+ def initialize(interval: nil, interval_count: nil)
2286
+ @interval = interval
2287
+ @interval_count = interval_count
2288
+ end
2289
+ end
2290
+ # Time span for the redeemed discount.
2291
+ attr_accessor :duration
2292
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2293
+ attr_accessor :timestamp
2294
+ # The type of calculation made to determine when the discount ends.
2295
+ attr_accessor :type
2296
+
2297
+ def initialize(duration: nil, timestamp: nil, type: nil)
2298
+ @duration = duration
2299
+ @timestamp = timestamp
2300
+ @type = type
2301
+ end
2302
+ end
2028
2303
  # ID of the coupon to create a new discount for.
2029
2304
  attr_accessor :coupon
2030
2305
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2031
2306
  attr_accessor :discount
2307
+ # Details to determine how long the discount should be applied for.
2308
+ attr_accessor :discount_end
2032
2309
  # ID of the promotion code to create a new discount for.
2033
2310
  attr_accessor :promotion_code
2034
2311
 
2035
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2312
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2036
2313
  @coupon = coupon
2037
2314
  @discount = discount
2315
+ @discount_end = discount_end
2038
2316
  @promotion_code = promotion_code
2039
2317
  end
2040
2318
  end
@@ -2187,6 +2465,8 @@ module Stripe
2187
2465
  attr_accessor :discounts
2188
2466
  # ID of an existing line item on the invoice.
2189
2467
  attr_accessor :id
2468
+ # 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.
2469
+ attr_accessor :margins
2190
2470
  # 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
2471
  attr_accessor :metadata
2192
2472
  # 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 +2488,7 @@ module Stripe
2208
2488
  discountable: nil,
2209
2489
  discounts: nil,
2210
2490
  id: nil,
2491
+ margins: nil,
2211
2492
  metadata: nil,
2212
2493
  period: nil,
2213
2494
  price_data: nil,
@@ -2221,6 +2502,7 @@ module Stripe
2221
2502
  @discountable = discountable
2222
2503
  @discounts = discounts
2223
2504
  @id = id
2505
+ @margins = margins
2224
2506
  @metadata = metadata
2225
2507
  @period = period
2226
2508
  @price_data = price_data
@@ -2395,32 +2677,88 @@ module Stripe
2395
2677
  end
2396
2678
 
2397
2679
  class Discount < Stripe::RequestParams
2680
+ class DiscountEnd < Stripe::RequestParams
2681
+ class Duration < Stripe::RequestParams
2682
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2683
+ attr_accessor :interval
2684
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2685
+ attr_accessor :interval_count
2686
+
2687
+ def initialize(interval: nil, interval_count: nil)
2688
+ @interval = interval
2689
+ @interval_count = interval_count
2690
+ end
2691
+ end
2692
+ # Time span for the redeemed discount.
2693
+ attr_accessor :duration
2694
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2695
+ attr_accessor :timestamp
2696
+ # The type of calculation made to determine when the discount ends.
2697
+ attr_accessor :type
2698
+
2699
+ def initialize(duration: nil, timestamp: nil, type: nil)
2700
+ @duration = duration
2701
+ @timestamp = timestamp
2702
+ @type = type
2703
+ end
2704
+ end
2398
2705
  # ID of the coupon to create a new discount for.
2399
2706
  attr_accessor :coupon
2400
2707
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2401
2708
  attr_accessor :discount
2709
+ # Details to determine how long the discount should be applied for.
2710
+ attr_accessor :discount_end
2402
2711
  # ID of the promotion code to create a new discount for.
2403
2712
  attr_accessor :promotion_code
2404
2713
 
2405
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2714
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2406
2715
  @coupon = coupon
2407
2716
  @discount = discount
2717
+ @discount_end = discount_end
2408
2718
  @promotion_code = promotion_code
2409
2719
  end
2410
2720
  end
2411
2721
 
2412
2722
  class InvoiceItem < Stripe::RequestParams
2413
2723
  class Discount < Stripe::RequestParams
2724
+ class DiscountEnd < Stripe::RequestParams
2725
+ class Duration < Stripe::RequestParams
2726
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2727
+ attr_accessor :interval
2728
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2729
+ attr_accessor :interval_count
2730
+
2731
+ def initialize(interval: nil, interval_count: nil)
2732
+ @interval = interval
2733
+ @interval_count = interval_count
2734
+ end
2735
+ end
2736
+ # Time span for the redeemed discount.
2737
+ attr_accessor :duration
2738
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2739
+ attr_accessor :timestamp
2740
+ # The type of calculation made to determine when the discount ends.
2741
+ attr_accessor :type
2742
+
2743
+ def initialize(duration: nil, timestamp: nil, type: nil)
2744
+ @duration = duration
2745
+ @timestamp = timestamp
2746
+ @type = type
2747
+ end
2748
+ end
2414
2749
  # ID of the coupon to create a new discount for.
2415
2750
  attr_accessor :coupon
2416
2751
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2417
2752
  attr_accessor :discount
2753
+ # Details to determine how long the discount should be applied for.
2754
+ attr_accessor :discount_end
2418
2755
  # ID of the promotion code to create a new discount for.
2419
2756
  attr_accessor :promotion_code
2420
2757
 
2421
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2758
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2422
2759
  @coupon = coupon
2423
2760
  @discount = discount
2761
+ @discount_end = discount_end
2424
2762
  @promotion_code = promotion_code
2425
2763
  end
2426
2764
  end
@@ -2546,19 +2884,499 @@ module Stripe
2546
2884
  end
2547
2885
 
2548
2886
  class ScheduleDetails < Stripe::RequestParams
2887
+ class Amendment < Stripe::RequestParams
2888
+ class AmendmentEnd < Stripe::RequestParams
2889
+ class DiscountEnd < Stripe::RequestParams
2890
+ # The ID of a specific discount.
2891
+ attr_accessor :discount
2892
+
2893
+ def initialize(discount: nil)
2894
+ @discount = discount
2895
+ end
2896
+ end
2897
+
2898
+ class Duration < Stripe::RequestParams
2899
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2900
+ attr_accessor :interval
2901
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2902
+ attr_accessor :interval_count
2903
+
2904
+ def initialize(interval: nil, interval_count: nil)
2905
+ @interval = interval
2906
+ @interval_count = interval_count
2907
+ end
2908
+ end
2909
+ # Use the `end` time of a given discount.
2910
+ attr_accessor :discount_end
2911
+ # Time span for the amendment starting from the `amendment_start`.
2912
+ attr_accessor :duration
2913
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2914
+ attr_accessor :timestamp
2915
+ # Select one of three ways to pass the `amendment_end`.
2916
+ attr_accessor :type
2917
+
2918
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2919
+ @discount_end = discount_end
2920
+ @duration = duration
2921
+ @timestamp = timestamp
2922
+ @type = type
2923
+ end
2924
+ end
2925
+
2926
+ class AmendmentStart < Stripe::RequestParams
2927
+ class AmendmentEnd < Stripe::RequestParams
2928
+ # 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.
2929
+ attr_accessor :index
2930
+
2931
+ def initialize(index: nil)
2932
+ @index = index
2933
+ end
2934
+ end
2935
+
2936
+ class DiscountEnd < Stripe::RequestParams
2937
+ # The ID of a specific discount.
2938
+ attr_accessor :discount
2939
+
2940
+ def initialize(discount: nil)
2941
+ @discount = discount
2942
+ end
2943
+ end
2944
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
2945
+ attr_accessor :amendment_end
2946
+ # Use the `end` time of a given discount.
2947
+ attr_accessor :discount_end
2948
+ # A precise Unix timestamp for the amendment to start.
2949
+ attr_accessor :timestamp
2950
+ # Select one of three ways to pass the `amendment_start`.
2951
+ attr_accessor :type
2952
+
2953
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
2954
+ @amendment_end = amendment_end
2955
+ @discount_end = discount_end
2956
+ @timestamp = timestamp
2957
+ @type = type
2958
+ end
2959
+ end
2960
+
2961
+ class DiscountAction < Stripe::RequestParams
2962
+ class Add < Stripe::RequestParams
2963
+ class DiscountEnd < Stripe::RequestParams
2964
+ # The type of calculation made to determine when the discount ends.
2965
+ attr_accessor :type
2966
+
2967
+ def initialize(type: nil)
2968
+ @type = type
2969
+ end
2970
+ end
2971
+ # The coupon code to redeem.
2972
+ attr_accessor :coupon
2973
+ # An ID of an existing discount for a coupon that was already redeemed.
2974
+ attr_accessor :discount
2975
+ # Details to determine how long the discount should be applied for.
2976
+ attr_accessor :discount_end
2977
+ # 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.
2978
+ attr_accessor :index
2979
+ # The promotion code to redeem.
2980
+ attr_accessor :promotion_code
2981
+
2982
+ def initialize(
2983
+ coupon: nil,
2984
+ discount: nil,
2985
+ discount_end: nil,
2986
+ index: nil,
2987
+ promotion_code: nil
2988
+ )
2989
+ @coupon = coupon
2990
+ @discount = discount
2991
+ @discount_end = discount_end
2992
+ @index = index
2993
+ @promotion_code = promotion_code
2994
+ end
2995
+ end
2996
+
2997
+ class Remove < Stripe::RequestParams
2998
+ # The coupon code to remove from the `discounts` array.
2999
+ attr_accessor :coupon
3000
+ # The ID of a discount to remove from the `discounts` array.
3001
+ attr_accessor :discount
3002
+ # The ID of a promotion code to remove from the `discounts` array.
3003
+ attr_accessor :promotion_code
3004
+
3005
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3006
+ @coupon = coupon
3007
+ @discount = discount
3008
+ @promotion_code = promotion_code
3009
+ end
3010
+ end
3011
+
3012
+ class Set < Stripe::RequestParams
3013
+ # The coupon code to replace the `discounts` array with.
3014
+ attr_accessor :coupon
3015
+ # An ID of an existing discount to replace the `discounts` array with.
3016
+ attr_accessor :discount
3017
+ # An ID of an existing promotion code to replace the `discounts` array with.
3018
+ attr_accessor :promotion_code
3019
+
3020
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3021
+ @coupon = coupon
3022
+ @discount = discount
3023
+ @promotion_code = promotion_code
3024
+ end
3025
+ end
3026
+ # Details of the discount to add.
3027
+ attr_accessor :add
3028
+ # Details of the discount to remove.
3029
+ attr_accessor :remove
3030
+ # Details of the discount to replace the existing discounts with.
3031
+ attr_accessor :set
3032
+ # Determines the type of discount action.
3033
+ attr_accessor :type
3034
+
3035
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3036
+ @add = add
3037
+ @remove = remove
3038
+ @set = set
3039
+ @type = type
3040
+ end
3041
+ end
3042
+
3043
+ class ItemAction < Stripe::RequestParams
3044
+ class Add < Stripe::RequestParams
3045
+ class Discount < Stripe::RequestParams
3046
+ class DiscountEnd < Stripe::RequestParams
3047
+ class Duration < Stripe::RequestParams
3048
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3049
+ attr_accessor :interval
3050
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3051
+ attr_accessor :interval_count
3052
+
3053
+ def initialize(interval: nil, interval_count: nil)
3054
+ @interval = interval
3055
+ @interval_count = interval_count
3056
+ end
3057
+ end
3058
+ # Time span for the redeemed discount.
3059
+ attr_accessor :duration
3060
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3061
+ attr_accessor :timestamp
3062
+ # The type of calculation made to determine when the discount ends.
3063
+ attr_accessor :type
3064
+
3065
+ def initialize(duration: nil, timestamp: nil, type: nil)
3066
+ @duration = duration
3067
+ @timestamp = timestamp
3068
+ @type = type
3069
+ end
3070
+ end
3071
+ # ID of the coupon to create a new discount for.
3072
+ attr_accessor :coupon
3073
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3074
+ attr_accessor :discount
3075
+ # Details to determine how long the discount should be applied for.
3076
+ attr_accessor :discount_end
3077
+ # ID of the promotion code to create a new discount for.
3078
+ attr_accessor :promotion_code
3079
+
3080
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3081
+ @coupon = coupon
3082
+ @discount = discount
3083
+ @discount_end = discount_end
3084
+ @promotion_code = promotion_code
3085
+ end
3086
+ end
3087
+
3088
+ class Trial < Stripe::RequestParams
3089
+ # 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.
3090
+ attr_accessor :converts_to
3091
+ # Determines the type of trial for this item.
3092
+ attr_accessor :type
3093
+
3094
+ def initialize(converts_to: nil, type: nil)
3095
+ @converts_to = converts_to
3096
+ @type = type
3097
+ end
3098
+ end
3099
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
3100
+ attr_accessor :discounts
3101
+ # 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`.
3102
+ attr_accessor :metadata
3103
+ # The ID of the price object.
3104
+ attr_accessor :price
3105
+ # Quantity for this item.
3106
+ attr_accessor :quantity
3107
+ # 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`.
3108
+ attr_accessor :tax_rates
3109
+ # Options that configure the trial on the subscription item.
3110
+ attr_accessor :trial
3111
+
3112
+ def initialize(
3113
+ discounts: nil,
3114
+ metadata: nil,
3115
+ price: nil,
3116
+ quantity: nil,
3117
+ tax_rates: nil,
3118
+ trial: nil
3119
+ )
3120
+ @discounts = discounts
3121
+ @metadata = metadata
3122
+ @price = price
3123
+ @quantity = quantity
3124
+ @tax_rates = tax_rates
3125
+ @trial = trial
3126
+ end
3127
+ end
3128
+
3129
+ class Remove < Stripe::RequestParams
3130
+ # ID of a price to remove.
3131
+ attr_accessor :price
3132
+
3133
+ def initialize(price: nil)
3134
+ @price = price
3135
+ end
3136
+ end
3137
+
3138
+ class Set < Stripe::RequestParams
3139
+ class Discount < Stripe::RequestParams
3140
+ class DiscountEnd < Stripe::RequestParams
3141
+ class Duration < Stripe::RequestParams
3142
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3143
+ attr_accessor :interval
3144
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3145
+ attr_accessor :interval_count
3146
+
3147
+ def initialize(interval: nil, interval_count: nil)
3148
+ @interval = interval
3149
+ @interval_count = interval_count
3150
+ end
3151
+ end
3152
+ # Time span for the redeemed discount.
3153
+ attr_accessor :duration
3154
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3155
+ attr_accessor :timestamp
3156
+ # The type of calculation made to determine when the discount ends.
3157
+ attr_accessor :type
3158
+
3159
+ def initialize(duration: nil, timestamp: nil, type: nil)
3160
+ @duration = duration
3161
+ @timestamp = timestamp
3162
+ @type = type
3163
+ end
3164
+ end
3165
+ # ID of the coupon to create a new discount for.
3166
+ attr_accessor :coupon
3167
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3168
+ attr_accessor :discount
3169
+ # Details to determine how long the discount should be applied for.
3170
+ attr_accessor :discount_end
3171
+ # ID of the promotion code to create a new discount for.
3172
+ attr_accessor :promotion_code
3173
+
3174
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3175
+ @coupon = coupon
3176
+ @discount = discount
3177
+ @discount_end = discount_end
3178
+ @promotion_code = promotion_code
3179
+ end
3180
+ end
3181
+
3182
+ class Trial < Stripe::RequestParams
3183
+ # 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.
3184
+ attr_accessor :converts_to
3185
+ # Determines the type of trial for this item.
3186
+ attr_accessor :type
3187
+
3188
+ def initialize(converts_to: nil, type: nil)
3189
+ @converts_to = converts_to
3190
+ @type = type
3191
+ end
3192
+ end
3193
+ # 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`.
3194
+ attr_accessor :discounts
3195
+ # 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`.
3196
+ attr_accessor :metadata
3197
+ # The ID of the price object.
3198
+ attr_accessor :price
3199
+ # 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`.
3200
+ attr_accessor :quantity
3201
+ # 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`.
3202
+ attr_accessor :tax_rates
3203
+ # 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`.
3204
+ attr_accessor :trial
3205
+
3206
+ def initialize(
3207
+ discounts: nil,
3208
+ metadata: nil,
3209
+ price: nil,
3210
+ quantity: nil,
3211
+ tax_rates: nil,
3212
+ trial: nil
3213
+ )
3214
+ @discounts = discounts
3215
+ @metadata = metadata
3216
+ @price = price
3217
+ @quantity = quantity
3218
+ @tax_rates = tax_rates
3219
+ @trial = trial
3220
+ end
3221
+ end
3222
+ # 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.
3223
+ attr_accessor :add
3224
+ # Details of the subscription item to remove.
3225
+ attr_accessor :remove
3226
+ # 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.
3227
+ attr_accessor :set
3228
+ # Determines the type of item action.
3229
+ attr_accessor :type
3230
+
3231
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3232
+ @add = add
3233
+ @remove = remove
3234
+ @set = set
3235
+ @type = type
3236
+ end
3237
+ end
3238
+
3239
+ class MetadataAction < Stripe::RequestParams
3240
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
3241
+ attr_accessor :add
3242
+ # Keys to remove from schedule phase metadata.
3243
+ attr_accessor :remove
3244
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
3245
+ attr_accessor :set
3246
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
3247
+ attr_accessor :type
3248
+
3249
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3250
+ @add = add
3251
+ @remove = remove
3252
+ @set = set
3253
+ @type = type
3254
+ end
3255
+ end
3256
+
3257
+ class SetPauseCollection < Stripe::RequestParams
3258
+ class Set < Stripe::RequestParams
3259
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3260
+ attr_accessor :behavior
3261
+
3262
+ def initialize(behavior: nil)
3263
+ @behavior = behavior
3264
+ end
3265
+ end
3266
+ # Details of the pause_collection behavior to apply to the amendment.
3267
+ attr_accessor :set
3268
+ # Determines the type of the pause_collection amendment.
3269
+ attr_accessor :type
3270
+
3271
+ def initialize(set: nil, type: nil)
3272
+ @set = set
3273
+ @type = type
3274
+ end
3275
+ end
3276
+
3277
+ class TrialSettings < Stripe::RequestParams
3278
+ class EndBehavior < Stripe::RequestParams
3279
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3280
+ attr_accessor :prorate_up_front
3281
+
3282
+ def initialize(prorate_up_front: nil)
3283
+ @prorate_up_front = prorate_up_front
3284
+ end
3285
+ end
3286
+ # Defines how the subscription should behave when a trial ends.
3287
+ attr_accessor :end_behavior
3288
+
3289
+ def initialize(end_behavior: nil)
3290
+ @end_behavior = end_behavior
3291
+ end
3292
+ end
3293
+ # 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.
3294
+ attr_accessor :amendment_end
3295
+ # Details to identify the earliest timestamp where the proposed change should take effect.
3296
+ attr_accessor :amendment_start
3297
+ # 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.
3298
+ attr_accessor :billing_cycle_anchor
3299
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
3300
+ attr_accessor :discount_actions
3301
+ # Changes to the subscription items during the amendment time span.
3302
+ attr_accessor :item_actions
3303
+ # Instructions for how to modify phase metadata
3304
+ attr_accessor :metadata_actions
3305
+ # 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`.
3306
+ attr_accessor :proration_behavior
3307
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
3308
+ attr_accessor :set_pause_collection
3309
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
3310
+ attr_accessor :set_schedule_end
3311
+ # Settings related to subscription trials.
3312
+ attr_accessor :trial_settings
3313
+
3314
+ def initialize(
3315
+ amendment_end: nil,
3316
+ amendment_start: nil,
3317
+ billing_cycle_anchor: nil,
3318
+ discount_actions: nil,
3319
+ item_actions: nil,
3320
+ metadata_actions: nil,
3321
+ proration_behavior: nil,
3322
+ set_pause_collection: nil,
3323
+ set_schedule_end: nil,
3324
+ trial_settings: nil
3325
+ )
3326
+ @amendment_end = amendment_end
3327
+ @amendment_start = amendment_start
3328
+ @billing_cycle_anchor = billing_cycle_anchor
3329
+ @discount_actions = discount_actions
3330
+ @item_actions = item_actions
3331
+ @metadata_actions = metadata_actions
3332
+ @proration_behavior = proration_behavior
3333
+ @set_pause_collection = set_pause_collection
3334
+ @set_schedule_end = set_schedule_end
3335
+ @trial_settings = trial_settings
3336
+ end
3337
+ end
3338
+
2549
3339
  class Phase < Stripe::RequestParams
2550
3340
  class AddInvoiceItem < Stripe::RequestParams
2551
3341
  class Discount < Stripe::RequestParams
3342
+ class DiscountEnd < Stripe::RequestParams
3343
+ class Duration < Stripe::RequestParams
3344
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3345
+ attr_accessor :interval
3346
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3347
+ attr_accessor :interval_count
3348
+
3349
+ def initialize(interval: nil, interval_count: nil)
3350
+ @interval = interval
3351
+ @interval_count = interval_count
3352
+ end
3353
+ end
3354
+ # Time span for the redeemed discount.
3355
+ attr_accessor :duration
3356
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3357
+ attr_accessor :timestamp
3358
+ # The type of calculation made to determine when the discount ends.
3359
+ attr_accessor :type
3360
+
3361
+ def initialize(duration: nil, timestamp: nil, type: nil)
3362
+ @duration = duration
3363
+ @timestamp = timestamp
3364
+ @type = type
3365
+ end
3366
+ end
2552
3367
  # ID of the coupon to create a new discount for.
2553
3368
  attr_accessor :coupon
2554
3369
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2555
3370
  attr_accessor :discount
3371
+ # Details to determine how long the discount should be applied for.
3372
+ attr_accessor :discount_end
2556
3373
  # ID of the promotion code to create a new discount for.
2557
3374
  attr_accessor :promotion_code
2558
3375
 
2559
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3376
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2560
3377
  @coupon = coupon
2561
3378
  @discount = discount
3379
+ @discount_end = discount_end
2562
3380
  @promotion_code = promotion_code
2563
3381
  end
2564
3382
  end
@@ -2651,16 +3469,44 @@ module Stripe
2651
3469
  end
2652
3470
 
2653
3471
  class Discount < Stripe::RequestParams
3472
+ class DiscountEnd < Stripe::RequestParams
3473
+ class Duration < Stripe::RequestParams
3474
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3475
+ attr_accessor :interval
3476
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3477
+ attr_accessor :interval_count
3478
+
3479
+ def initialize(interval: nil, interval_count: nil)
3480
+ @interval = interval
3481
+ @interval_count = interval_count
3482
+ end
3483
+ end
3484
+ # Time span for the redeemed discount.
3485
+ attr_accessor :duration
3486
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3487
+ attr_accessor :timestamp
3488
+ # The type of calculation made to determine when the discount ends.
3489
+ attr_accessor :type
3490
+
3491
+ def initialize(duration: nil, timestamp: nil, type: nil)
3492
+ @duration = duration
3493
+ @timestamp = timestamp
3494
+ @type = type
3495
+ end
3496
+ end
2654
3497
  # ID of the coupon to create a new discount for.
2655
3498
  attr_accessor :coupon
2656
3499
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2657
3500
  attr_accessor :discount
3501
+ # Details to determine how long the discount should be applied for.
3502
+ attr_accessor :discount_end
2658
3503
  # ID of the promotion code to create a new discount for.
2659
3504
  attr_accessor :promotion_code
2660
3505
 
2661
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3506
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2662
3507
  @coupon = coupon
2663
3508
  @discount = discount
3509
+ @discount_end = discount_end
2664
3510
  @promotion_code = promotion_code
2665
3511
  end
2666
3512
  end
@@ -2702,16 +3548,44 @@ module Stripe
2702
3548
  end
2703
3549
 
2704
3550
  class Discount < Stripe::RequestParams
3551
+ class DiscountEnd < Stripe::RequestParams
3552
+ class Duration < Stripe::RequestParams
3553
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3554
+ attr_accessor :interval
3555
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3556
+ attr_accessor :interval_count
3557
+
3558
+ def initialize(interval: nil, interval_count: nil)
3559
+ @interval = interval
3560
+ @interval_count = interval_count
3561
+ end
3562
+ end
3563
+ # Time span for the redeemed discount.
3564
+ attr_accessor :duration
3565
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3566
+ attr_accessor :timestamp
3567
+ # The type of calculation made to determine when the discount ends.
3568
+ attr_accessor :type
3569
+
3570
+ def initialize(duration: nil, timestamp: nil, type: nil)
3571
+ @duration = duration
3572
+ @timestamp = timestamp
3573
+ @type = type
3574
+ end
3575
+ end
2705
3576
  # ID of the coupon to create a new discount for.
2706
3577
  attr_accessor :coupon
2707
3578
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2708
3579
  attr_accessor :discount
3580
+ # Details to determine how long the discount should be applied for.
3581
+ attr_accessor :discount_end
2709
3582
  # ID of the promotion code to create a new discount for.
2710
3583
  attr_accessor :promotion_code
2711
3584
 
2712
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3585
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2713
3586
  @coupon = coupon
2714
3587
  @discount = discount
3588
+ @discount_end = discount_end
2715
3589
  @promotion_code = promotion_code
2716
3590
  end
2717
3591
  end
@@ -2757,6 +3631,18 @@ module Stripe
2757
3631
  @unit_amount_decimal = unit_amount_decimal
2758
3632
  end
2759
3633
  end
3634
+
3635
+ class Trial < Stripe::RequestParams
3636
+ # 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.
3637
+ attr_accessor :converts_to
3638
+ # Determines the type of trial for this item.
3639
+ attr_accessor :type
3640
+
3641
+ def initialize(converts_to: nil, type: nil)
3642
+ @converts_to = converts_to
3643
+ @type = type
3644
+ end
3645
+ end
2760
3646
  # 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.
2761
3647
  attr_accessor :billing_thresholds
2762
3648
  # The coupons to redeem into discounts for the subscription item.
@@ -2773,6 +3659,8 @@ module Stripe
2773
3659
  attr_accessor :quantity
2774
3660
  # 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.
2775
3661
  attr_accessor :tax_rates
3662
+ # Options that configure the trial on the subscription item.
3663
+ attr_accessor :trial
2776
3664
 
2777
3665
  def initialize(
2778
3666
  billing_thresholds: nil,
@@ -2782,7 +3670,8 @@ module Stripe
2782
3670
  price: nil,
2783
3671
  price_data: nil,
2784
3672
  quantity: nil,
2785
- tax_rates: nil
3673
+ tax_rates: nil,
3674
+ trial: nil
2786
3675
  )
2787
3676
  @billing_thresholds = billing_thresholds
2788
3677
  @discounts = discounts
@@ -2792,6 +3681,16 @@ module Stripe
2792
3681
  @price_data = price_data
2793
3682
  @quantity = quantity
2794
3683
  @tax_rates = tax_rates
3684
+ @trial = trial
3685
+ end
3686
+ end
3687
+
3688
+ class PauseCollection < Stripe::RequestParams
3689
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3690
+ attr_accessor :behavior
3691
+
3692
+ def initialize(behavior: nil)
3693
+ @behavior = behavior
2795
3694
  end
2796
3695
  end
2797
3696
 
@@ -2806,6 +3705,23 @@ module Stripe
2806
3705
  @destination = destination
2807
3706
  end
2808
3707
  end
3708
+
3709
+ class TrialSettings < Stripe::RequestParams
3710
+ class EndBehavior < Stripe::RequestParams
3711
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3712
+ attr_accessor :prorate_up_front
3713
+
3714
+ def initialize(prorate_up_front: nil)
3715
+ @prorate_up_front = prorate_up_front
3716
+ end
3717
+ end
3718
+ # Defines how the subscription should behave when a trial ends.
3719
+ attr_accessor :end_behavior
3720
+
3721
+ def initialize(end_behavior: nil)
3722
+ @end_behavior = end_behavior
3723
+ end
3724
+ end
2809
3725
  # 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.
2810
3726
  attr_accessor :add_invoice_items
2811
3727
  # 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).
@@ -2840,6 +3756,8 @@ module Stripe
2840
3756
  attr_accessor :metadata
2841
3757
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2842
3758
  attr_accessor :on_behalf_of
3759
+ # 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).
3760
+ attr_accessor :pause_collection
2843
3761
  # 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.
2844
3762
  attr_accessor :proration_behavior
2845
3763
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -2848,8 +3766,12 @@ module Stripe
2848
3766
  attr_accessor :transfer_data
2849
3767
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2850
3768
  attr_accessor :trial
3769
+ # Specify trial behavior when crossing phase boundaries
3770
+ attr_accessor :trial_continuation
2851
3771
  # 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`
2852
3772
  attr_accessor :trial_end
3773
+ # Settings related to subscription trials.
3774
+ attr_accessor :trial_settings
2853
3775
 
2854
3776
  def initialize(
2855
3777
  add_invoice_items: nil,
@@ -2869,11 +3791,14 @@ module Stripe
2869
3791
  iterations: nil,
2870
3792
  metadata: nil,
2871
3793
  on_behalf_of: nil,
3794
+ pause_collection: nil,
2872
3795
  proration_behavior: nil,
2873
3796
  start_date: nil,
2874
3797
  transfer_data: nil,
2875
3798
  trial: nil,
2876
- trial_end: nil
3799
+ trial_continuation: nil,
3800
+ trial_end: nil,
3801
+ trial_settings: nil
2877
3802
  )
2878
3803
  @add_invoice_items = add_invoice_items
2879
3804
  @application_fee_percent = application_fee_percent
@@ -2892,23 +3817,95 @@ module Stripe
2892
3817
  @iterations = iterations
2893
3818
  @metadata = metadata
2894
3819
  @on_behalf_of = on_behalf_of
3820
+ @pause_collection = pause_collection
2895
3821
  @proration_behavior = proration_behavior
2896
3822
  @start_date = start_date
2897
3823
  @transfer_data = transfer_data
2898
3824
  @trial = trial
3825
+ @trial_continuation = trial_continuation
2899
3826
  @trial_end = trial_end
3827
+ @trial_settings = trial_settings
3828
+ end
3829
+ end
3830
+
3831
+ class Prebilling < Stripe::RequestParams
3832
+ class BillUntil < Stripe::RequestParams
3833
+ class AmendmentEnd < Stripe::RequestParams
3834
+ # 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.
3835
+ attr_accessor :index
3836
+
3837
+ def initialize(index: nil)
3838
+ @index = index
3839
+ end
3840
+ end
3841
+
3842
+ class Duration < Stripe::RequestParams
3843
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3844
+ attr_accessor :interval
3845
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3846
+ attr_accessor :interval_count
3847
+
3848
+ def initialize(interval: nil, interval_count: nil)
3849
+ @interval = interval
3850
+ @interval_count = interval_count
3851
+ end
3852
+ end
3853
+ # End the prebilled period when a specified amendment ends.
3854
+ attr_accessor :amendment_end
3855
+ # Time span for prebilling, starting from `bill_from`.
3856
+ attr_accessor :duration
3857
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3858
+ attr_accessor :timestamp
3859
+ # Select one of several ways to pass the `bill_until` value.
3860
+ attr_accessor :type
3861
+
3862
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
3863
+ @amendment_end = amendment_end
3864
+ @duration = duration
3865
+ @timestamp = timestamp
3866
+ @type = type
3867
+ end
3868
+ end
3869
+ # The end of the prebilled time period.
3870
+ attr_accessor :bill_until
3871
+ # This is used to determine the number of billing cycles to prebill.
3872
+ attr_accessor :iterations
3873
+
3874
+ def initialize(bill_until: nil, iterations: nil)
3875
+ @bill_until = bill_until
3876
+ @iterations = iterations
2900
3877
  end
2901
3878
  end
3879
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
3880
+ attr_accessor :amendments
3881
+ # 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.
3882
+ attr_accessor :billing_behavior
3883
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3884
+ attr_accessor :billing_mode
2902
3885
  # 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.
2903
3886
  attr_accessor :end_behavior
2904
3887
  # 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.
2905
3888
  attr_accessor :phases
3889
+ # Provide any time periods to bill in advance.
3890
+ attr_accessor :prebilling
2906
3891
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2907
3892
  attr_accessor :proration_behavior
2908
3893
 
2909
- def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
3894
+ def initialize(
3895
+ amendments: nil,
3896
+ billing_behavior: nil,
3897
+ billing_mode: nil,
3898
+ end_behavior: nil,
3899
+ phases: nil,
3900
+ prebilling: nil,
3901
+ proration_behavior: nil
3902
+ )
3903
+ @amendments = amendments
3904
+ @billing_behavior = billing_behavior
3905
+ @billing_mode = billing_mode
2910
3906
  @end_behavior = end_behavior
2911
3907
  @phases = phases
3908
+ @prebilling = prebilling
2912
3909
  @proration_behavior = proration_behavior
2913
3910
  end
2914
3911
  end
@@ -2925,16 +3922,44 @@ module Stripe
2925
3922
  end
2926
3923
 
2927
3924
  class Discount < Stripe::RequestParams
3925
+ class DiscountEnd < Stripe::RequestParams
3926
+ class Duration < Stripe::RequestParams
3927
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3928
+ attr_accessor :interval
3929
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3930
+ attr_accessor :interval_count
3931
+
3932
+ def initialize(interval: nil, interval_count: nil)
3933
+ @interval = interval
3934
+ @interval_count = interval_count
3935
+ end
3936
+ end
3937
+ # Time span for the redeemed discount.
3938
+ attr_accessor :duration
3939
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3940
+ attr_accessor :timestamp
3941
+ # The type of calculation made to determine when the discount ends.
3942
+ attr_accessor :type
3943
+
3944
+ def initialize(duration: nil, timestamp: nil, type: nil)
3945
+ @duration = duration
3946
+ @timestamp = timestamp
3947
+ @type = type
3948
+ end
3949
+ end
2928
3950
  # ID of the coupon to create a new discount for.
2929
3951
  attr_accessor :coupon
2930
3952
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2931
3953
  attr_accessor :discount
3954
+ # Details to determine how long the discount should be applied for.
3955
+ attr_accessor :discount_end
2932
3956
  # ID of the promotion code to create a new discount for.
2933
3957
  attr_accessor :promotion_code
2934
3958
 
2935
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3959
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2936
3960
  @coupon = coupon
2937
3961
  @discount = discount
3962
+ @discount_end = discount_end
2938
3963
  @promotion_code = promotion_code
2939
3964
  end
2940
3965
  end
@@ -3029,8 +4054,19 @@ module Stripe
3029
4054
  @tax_rates = tax_rates
3030
4055
  end
3031
4056
  end
4057
+
4058
+ class Prebilling < Stripe::RequestParams
4059
+ # This is used to determine the number of billing cycles to prebill.
4060
+ attr_accessor :iterations
4061
+
4062
+ def initialize(iterations: nil)
4063
+ @iterations = iterations
4064
+ end
4065
+ end
3032
4066
  # 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`.
3033
4067
  attr_accessor :billing_cycle_anchor
4068
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
4069
+ attr_accessor :billing_mode
3034
4070
  # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
3035
4071
  attr_accessor :cancel_at
3036
4072
  # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
@@ -3041,6 +4077,8 @@ module Stripe
3041
4077
  attr_accessor :default_tax_rates
3042
4078
  # A list of up to 20 subscription items, each with an attached price.
3043
4079
  attr_accessor :items
4080
+ # The pre-billing to apply to the subscription as a preview.
4081
+ attr_accessor :prebilling
3044
4082
  # 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`.
3045
4083
  attr_accessor :proration_behavior
3046
4084
  # 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'.
@@ -3054,11 +4092,13 @@ module Stripe
3054
4092
 
3055
4093
  def initialize(
3056
4094
  billing_cycle_anchor: nil,
4095
+ billing_mode: nil,
3057
4096
  cancel_at: nil,
3058
4097
  cancel_at_period_end: nil,
3059
4098
  cancel_now: nil,
3060
4099
  default_tax_rates: nil,
3061
4100
  items: nil,
4101
+ prebilling: nil,
3062
4102
  proration_behavior: nil,
3063
4103
  proration_date: nil,
3064
4104
  resume_at: nil,
@@ -3066,11 +4106,13 @@ module Stripe
3066
4106
  trial_end: nil
3067
4107
  )
3068
4108
  @billing_cycle_anchor = billing_cycle_anchor
4109
+ @billing_mode = billing_mode
3069
4110
  @cancel_at = cancel_at
3070
4111
  @cancel_at_period_end = cancel_at_period_end
3071
4112
  @cancel_now = cancel_now
3072
4113
  @default_tax_rates = default_tax_rates
3073
4114
  @items = items
4115
+ @prebilling = prebilling
3074
4116
  @proration_behavior = proration_behavior
3075
4117
  @proration_date = proration_date
3076
4118
  @resume_at = resume_at
@@ -3084,6 +4126,8 @@ module Stripe
3084
4126
  attr_accessor :currency
3085
4127
  # 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.
3086
4128
  attr_accessor :customer
4129
+ # 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.
4130
+ attr_accessor :customer_account
3087
4131
  # 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.
3088
4132
  attr_accessor :customer_details
3089
4133
  # 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.
@@ -3111,6 +4155,7 @@ module Stripe
3111
4155
  automatic_tax: nil,
3112
4156
  currency: nil,
3113
4157
  customer: nil,
4158
+ customer_account: nil,
3114
4159
  customer_details: nil,
3115
4160
  discounts: nil,
3116
4161
  expand: nil,
@@ -3126,6 +4171,7 @@ module Stripe
3126
4171
  @automatic_tax = automatic_tax
3127
4172
  @currency = currency
3128
4173
  @customer = customer
4174
+ @customer_account = customer_account
3129
4175
  @customer_details = customer_details
3130
4176
  @discounts = discounts
3131
4177
  @expand = expand
@@ -3155,6 +4201,8 @@ module Stripe
3155
4201
  attr_reader :amount_remaining
3156
4202
  # This is the sum of all the shipping amounts.
3157
4203
  attr_reader :amount_shipping
4204
+ # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
4205
+ attr_reader :amounts_due
3158
4206
  # ID of the Connect Application that created the invoice.
3159
4207
  attr_reader :application
3160
4208
  # 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.
@@ -3189,6 +4237,8 @@ module Stripe
3189
4237
  attr_reader :custom_fields
3190
4238
  # The ID of the customer who will be billed.
3191
4239
  attr_reader :customer
4240
+ # The ID of the account who will be billed.
4241
+ attr_reader :customer_account
3192
4242
  # 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.
3193
4243
  attr_reader :customer_address
3194
4244
  # 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.
@@ -3203,6 +4253,8 @@ module Stripe
3203
4253
  attr_reader :customer_tax_exempt
3204
4254
  # 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.
3205
4255
  attr_reader :customer_tax_ids
4256
+ # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
4257
+ attr_reader :default_margins
3206
4258
  # 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.
3207
4259
  attr_reader :default_payment_method
3208
4260
  # 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.
@@ -3293,6 +4345,8 @@ module Stripe
3293
4345
  attr_reader :total_discount_amounts
3294
4346
  # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
3295
4347
  attr_reader :total_excluding_tax
4348
+ # The aggregate amounts calculated per margin across all line items.
4349
+ attr_reader :total_margin_amounts
3296
4350
  # 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.
3297
4351
  attr_reader :total_pretax_credit_amounts
3298
4352
  # The aggregate tax information of all line items.