stripe 15.1.0 → 15.2.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 (586) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1561 -695
  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 +89 -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/object_types.rb +52 -0
  59. data/lib/stripe/resources/account.rb +653 -1
  60. data/lib/stripe/resources/account_notice.rb +123 -0
  61. data/lib/stripe/resources/account_session.rb +299 -1
  62. data/lib/stripe/resources/balance_settings.rb +105 -0
  63. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  64. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  65. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  66. data/lib/stripe/resources/billing/meter_error_report.rb +59 -0
  67. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  68. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  69. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  70. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  71. data/lib/stripe/resources/card.rb +2 -0
  72. data/lib/stripe/resources/cash_balance.rb +2 -0
  73. data/lib/stripe/resources/charge.rb +1470 -0
  74. data/lib/stripe/resources/checkout/session.rb +331 -3
  75. data/lib/stripe/resources/confirmation_token.rb +176 -0
  76. data/lib/stripe/resources/coupon.rb +30 -1
  77. data/lib/stripe/resources/credit_note.rb +10 -0
  78. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  79. data/lib/stripe/resources/customer.rb +2 -0
  80. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  81. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  82. data/lib/stripe/resources/customer_session.rb +6 -1
  83. data/lib/stripe/resources/discount.rb +2 -0
  84. data/lib/stripe/resources/event.rb +31 -0
  85. data/lib/stripe/resources/financial_connections/account.rb +20 -1
  86. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  87. data/lib/stripe/resources/financial_connections/institution.rb +90 -0
  88. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  89. data/lib/stripe/resources/fx_quote.rb +184 -0
  90. data/lib/stripe/resources/gift_cards/card.rb +208 -0
  91. data/lib/stripe/resources/gift_cards/transaction.rb +272 -0
  92. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  93. data/lib/stripe/resources/invoice.rb +1129 -15
  94. data/lib/stripe/resources/invoice_item.rb +78 -2
  95. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  96. data/lib/stripe/resources/invoice_payment.rb +2 -53
  97. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  98. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  99. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  100. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  101. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  102. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  103. data/lib/stripe/resources/line_item.rb +37 -0
  104. data/lib/stripe/resources/mandate.rb +24 -0
  105. data/lib/stripe/resources/margin.rb +115 -0
  106. data/lib/stripe/resources/order.rb +2859 -0
  107. data/lib/stripe/resources/payment_attempt_record.rb +1078 -0
  108. data/lib/stripe/resources/payment_intent.rb +6036 -1214
  109. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +65 -0
  110. data/lib/stripe/resources/payment_method.rb +198 -1
  111. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  112. data/lib/stripe/resources/payment_record.rb +1607 -0
  113. data/lib/stripe/resources/payout.rb +6 -0
  114. data/lib/stripe/resources/price.rb +30 -0
  115. data/lib/stripe/resources/privacy/redaction_job.rb +275 -0
  116. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +25 -0
  117. data/lib/stripe/resources/product.rb +59 -0
  118. data/lib/stripe/resources/promotion_code.rb +10 -0
  119. data/lib/stripe/resources/quote.rb +2046 -6
  120. data/lib/stripe/resources/quote_line.rb +274 -0
  121. data/lib/stripe/resources/quote_preview_invoice.rb +663 -0
  122. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +339 -0
  123. data/lib/stripe/resources/refund.rb +9 -0
  124. data/lib/stripe/resources/setup_attempt.rb +21 -0
  125. data/lib/stripe/resources/setup_intent.rb +596 -9
  126. data/lib/stripe/resources/source.rb +29 -0
  127. data/lib/stripe/resources/subscription.rb +298 -9
  128. data/lib/stripe/resources/subscription_item.rb +84 -3
  129. data/lib/stripe/resources/subscription_schedule.rb +1013 -10
  130. data/lib/stripe/resources/tax/association.rb +89 -0
  131. data/lib/stripe/resources/tax/form.rb +211 -0
  132. data/lib/stripe/resources/tax_id.rb +12 -2
  133. data/lib/stripe/resources/terminal/reader.rb +406 -0
  134. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  135. data/lib/stripe/resources/transfer.rb +6 -0
  136. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  137. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  138. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  139. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  140. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  141. data/lib/stripe/resources/v2/core/account.rb +1746 -0
  142. data/lib/stripe/resources/v2/core/account_link.rb +56 -0
  143. data/lib/stripe/resources/v2/core/person.rb +276 -0
  144. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  145. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  146. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  147. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  148. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  149. data/lib/stripe/resources/v2/money_management/financial_account.rb +58 -0
  150. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  151. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  152. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  153. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  154. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  155. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  156. data/lib/stripe/resources/v2/money_management/payout_method.rb +75 -0
  157. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  158. data/lib/stripe/resources/v2/money_management/received_credit.rb +136 -0
  159. data/lib/stripe/resources/v2/money_management/received_debit.rb +108 -0
  160. data/lib/stripe/resources/v2/money_management/transaction.rb +78 -0
  161. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +68 -0
  162. data/lib/stripe/resources.rb +99 -0
  163. data/lib/stripe/services/account_notice_service.rb +101 -0
  164. data/lib/stripe/services/account_service.rb +562 -1
  165. data/lib/stripe/services/account_session_service.rb +269 -1
  166. data/lib/stripe/services/balance_settings_service.rb +96 -0
  167. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  168. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  169. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  170. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  171. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  172. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  173. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  174. data/lib/stripe/services/capital_service.rb +15 -0
  175. data/lib/stripe/services/charge_service.rb +1350 -0
  176. data/lib/stripe/services/checkout/session_service.rb +247 -2
  177. data/lib/stripe/services/coupon_service.rb +17 -1
  178. data/lib/stripe/services/credit_note_service.rb +4 -0
  179. data/lib/stripe/services/customer_session_service.rb +4 -1
  180. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -123
  181. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  182. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  183. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  184. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  185. data/lib/stripe/services/financial_connections_service.rb +2 -1
  186. data/lib/stripe/services/fx_quote_service.rb +123 -0
  187. data/lib/stripe/services/gift_cards/card_service.rb +170 -0
  188. data/lib/stripe/services/gift_cards/transaction_service.rb +209 -0
  189. data/lib/stripe/services/gift_cards_service.rb +14 -0
  190. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  191. data/lib/stripe/services/invoice_item_service.rb +74 -2
  192. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  193. data/lib/stripe/services/invoice_service.rb +1059 -15
  194. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  195. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  196. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  197. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  198. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  199. data/lib/stripe/services/issuing_service.rb +5 -1
  200. data/lib/stripe/services/margin_service.rb +119 -0
  201. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  202. data/lib/stripe/services/order_service.rb +2268 -0
  203. data/lib/stripe/services/payment_attempt_record_service.rb +49 -0
  204. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  205. data/lib/stripe/services/payment_intent_service.rb +4631 -258
  206. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  207. data/lib/stripe/services/payment_method_service.rb +126 -1
  208. data/lib/stripe/services/payment_record_service.rb +542 -0
  209. data/lib/stripe/services/payout_service.rb +4 -0
  210. data/lib/stripe/services/price_service.rb +19 -0
  211. data/lib/stripe/services/privacy/redaction_job_service.rb +231 -0
  212. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  213. data/lib/stripe/services/privacy_service.rb +13 -0
  214. data/lib/stripe/services/product_service.rb +38 -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 +556 -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 +257 -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 +180 -0
  230. data/lib/stripe/services/terminal_service.rb +2 -1
  231. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +103 -0
  232. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  233. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  234. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  235. data/lib/stripe/services/transfer_service.rb +4 -0
  236. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  237. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  238. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  239. data/lib/stripe/services/v1_services.rb +12 -2
  240. data/lib/stripe/services/v2/core/account_link_service.rb +76 -0
  241. data/lib/stripe/services/v2/core/account_service.rb +4138 -0
  242. data/lib/stripe/services/v2/core/accounts/person_service.rb +1048 -0
  243. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +135 -0
  244. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +109 -0
  245. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  246. data/lib/stripe/services/v2/core_service.rb +4 -1
  247. data/lib/stripe/services/v2/money_management/adjustment_service.rb +75 -0
  248. data/lib/stripe/services/v2/money_management/financial_account_service.rb +44 -0
  249. data/lib/stripe/services/v2/money_management/financial_address_service.rb +81 -0
  250. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +126 -0
  251. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +96 -0
  252. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +202 -0
  253. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +237 -0
  254. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +174 -0
  255. data/lib/stripe/services/v2/money_management/payout_method_service.rb +95 -0
  256. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  257. data/lib/stripe/services/v2/money_management/received_credit_service.rb +71 -0
  258. data/lib/stripe/services/v2/money_management/received_debit_service.rb +44 -0
  259. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +70 -0
  260. data/lib/stripe/services/v2/money_management/transaction_service.rb +74 -0
  261. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  262. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  263. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +50 -0
  264. data/lib/stripe/services/v2_services.rb +4 -2
  265. data/lib/stripe/services.rb +54 -1
  266. data/lib/stripe/stripe_configuration.rb +3 -1
  267. data/lib/stripe/stripe_object.rb +1 -1
  268. data/lib/stripe/util.rb +7 -1
  269. data/lib/stripe/version.rb +1 -1
  270. data/lib/stripe.rb +53 -0
  271. data/rbi/stripe.rbi +191867 -0
  272. data/stripe.gemspec +4 -1
  273. metadata +157 -324
  274. data/lib/stripe/services/invoice_payment_service.rb +0 -83
  275. data/rbi/stripe/resources/account.rbi +0 -4903
  276. data/rbi/stripe/resources/account_link.rbi +0 -74
  277. data/rbi/stripe/resources/account_session.rbi +0 -894
  278. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -90
  279. data/rbi/stripe/resources/application.rbi +0 -20
  280. data/rbi/stripe/resources/application_fee.rbi +0 -118
  281. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  282. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  283. data/rbi/stripe/resources/balance.rbi +0 -180
  284. data/rbi/stripe/resources/balance_transaction.rbi +0 -144
  285. data/rbi/stripe/resources/bank_account.rbi +0 -127
  286. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  287. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  288. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  289. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  290. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  291. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  292. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  293. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  294. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  295. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -645
  296. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  297. data/rbi/stripe/resources/capability.rbi +0 -125
  298. data/rbi/stripe/resources/card.rbi +0 -125
  299. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  300. data/rbi/stripe/resources/charge.rbi +0 -2057
  301. data/rbi/stripe/resources/checkout/session.rbi +0 -3988
  302. data/rbi/stripe/resources/climate/order.rbi +0 -245
  303. data/rbi/stripe/resources/climate/product.rbi +0 -75
  304. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  305. data/rbi/stripe/resources/confirmation_token.rbi +0 -1873
  306. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  307. data/rbi/stripe/resources/country_spec.rbi +0 -85
  308. data/rbi/stripe/resources/coupon.rbi +0 -252
  309. data/rbi/stripe/resources/credit_note.rbi +0 -747
  310. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  311. data/rbi/stripe/resources/customer.rbi +0 -1009
  312. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  313. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  314. data/rbi/stripe/resources/customer_session.rbi +0 -200
  315. data/rbi/stripe/resources/discount.rbi +0 -53
  316. data/rbi/stripe/resources/dispute.rbi +0 -761
  317. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  318. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  319. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  320. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  321. data/rbi/stripe/resources/event.rbi +0 -149
  322. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  323. data/rbi/stripe/resources/file.rbi +0 -143
  324. data/rbi/stripe/resources/file_link.rbi +0 -141
  325. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  326. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  327. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  328. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  329. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  330. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  331. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  332. data/rbi/stripe/resources/identity/verification_report.rbi +0 -351
  333. data/rbi/stripe/resources/identity/verification_session.rbi +0 -517
  334. data/rbi/stripe/resources/invoice.rbi +0 -3736
  335. data/rbi/stripe/resources/invoice_item.rbi +0 -475
  336. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  337. data/rbi/stripe/resources/invoice_payment.rbi +0 -114
  338. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  339. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  340. data/rbi/stripe/resources/issuing/card.rbi +0 -741
  341. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  342. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  343. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  344. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  345. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  346. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  347. data/rbi/stripe/resources/line_item.rbi +0 -72
  348. data/rbi/stripe/resources/login_link.rbi +0 -19
  349. data/rbi/stripe/resources/mandate.rbi +0 -187
  350. data/rbi/stripe/resources/payment_intent.rbi +0 -9795
  351. data/rbi/stripe/resources/payment_link.rbi +0 -1801
  352. data/rbi/stripe/resources/payment_method.rbi +0 -1831
  353. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3220
  354. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  355. data/rbi/stripe/resources/payout.rbi +0 -300
  356. data/rbi/stripe/resources/person.rbi +0 -401
  357. data/rbi/stripe/resources/plan.rbi +0 -373
  358. data/rbi/stripe/resources/price.rbi +0 -694
  359. data/rbi/stripe/resources/product.rbi +0 -557
  360. data/rbi/stripe/resources/product_feature.rbi +0 -26
  361. data/rbi/stripe/resources/promotion_code.rbi +0 -261
  362. data/rbi/stripe/resources/quote.rbi +0 -1126
  363. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  364. data/rbi/stripe/resources/radar/value_list.rbi +0 -170
  365. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -131
  366. data/rbi/stripe/resources/refund.rbi +0 -519
  367. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  368. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  369. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  370. data/rbi/stripe/resources/reversal.rbi +0 -51
  371. data/rbi/stripe/resources/review.rbi +0 -154
  372. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  373. data/rbi/stripe/resources/setup_intent.rbi +0 -3869
  374. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  375. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  376. data/rbi/stripe/resources/source.rbi +0 -1496
  377. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  378. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  379. data/rbi/stripe/resources/subscription.rbi +0 -1964
  380. data/rbi/stripe/resources/subscription_item.rbi +0 -370
  381. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1495
  382. data/rbi/stripe/resources/tax/calculation.rbi +0 -474
  383. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -88
  384. data/rbi/stripe/resources/tax/registration.rbi +0 -2713
  385. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  386. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  387. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  388. data/rbi/stripe/resources/tax_code.rbi +0 -44
  389. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  390. data/rbi/stripe/resources/tax_id.rbi +0 -167
  391. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  392. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1388
  393. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  394. data/rbi/stripe/resources/terminal/location.rbi +0 -224
  395. data/rbi/stripe/resources/terminal/reader.rbi +0 -587
  396. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -134
  397. data/rbi/stripe/resources/token.rbi +0 -1283
  398. data/rbi/stripe/resources/topup.rbi +0 -222
  399. data/rbi/stripe/resources/transfer.rbi +0 -199
  400. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  401. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  402. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -865
  403. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  404. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  405. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  406. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  407. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  408. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  409. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  410. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  411. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  412. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  413. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  414. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  415. data/rbi/stripe/resources/v2/event.rbi +0 -48
  416. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  417. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -170
  418. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  419. data/rbi/stripe/services/account_link_service.rbi +0 -58
  420. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  421. data/rbi/stripe/services/account_person_service.rbi +0 -1013
  422. data/rbi/stripe/services/account_service.rbi +0 -4189
  423. data/rbi/stripe/services/account_session_service.rbi +0 -572
  424. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -78
  425. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  426. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  427. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  428. data/rbi/stripe/services/apps_service.rbi +0 -9
  429. data/rbi/stripe/services/balance_service.rbi +0 -21
  430. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  431. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  432. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  433. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  434. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  435. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  436. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  437. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  438. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  439. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -511
  440. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  441. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  442. data/rbi/stripe/services/billing_service.rbi +0 -15
  443. data/rbi/stripe/services/charge_service.rbi +0 -448
  444. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  445. data/rbi/stripe/services/checkout/session_service.rbi +0 -2607
  446. data/rbi/stripe/services/checkout_service.rbi +0 -9
  447. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  448. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  449. data/rbi/stripe/services/climate_service.rbi +0 -11
  450. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  451. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  452. data/rbi/stripe/services/coupon_service.rbi +0 -196
  453. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  454. data/rbi/stripe/services/credit_note_service.rbi +0 -416
  455. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  456. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  457. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  458. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  459. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  460. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  461. data/rbi/stripe/services/customer_service.rbi +0 -651
  462. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  463. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -72
  464. data/rbi/stripe/services/dispute_service.rbi +0 -424
  465. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  466. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  467. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  468. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  469. data/rbi/stripe/services/event_service.rbi +0 -83
  470. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  471. data/rbi/stripe/services/file_link_service.rbi +0 -124
  472. data/rbi/stripe/services/file_service.rbi +0 -116
  473. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  474. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  475. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  476. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  477. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  478. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  479. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  480. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  481. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -323
  482. data/rbi/stripe/services/identity_service.rbi +0 -10
  483. data/rbi/stripe/services/invoice_item_service.rbi +0 -368
  484. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  485. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  486. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  487. data/rbi/stripe/services/invoice_service.rbi +0 -2920
  488. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  489. data/rbi/stripe/services/issuing/card_service.rbi +0 -495
  490. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  491. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  492. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  493. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  494. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  495. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  496. data/rbi/stripe/services/issuing_service.rbi +0 -16
  497. data/rbi/stripe/services/mandate_service.rbi +0 -20
  498. data/rbi/stripe/services/payment_intent_service.rbi +0 -7819
  499. data/rbi/stripe/services/payment_link_service.rbi +0 -1352
  500. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2255
  501. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  502. data/rbi/stripe/services/payment_method_service.rbi +0 -846
  503. data/rbi/stripe/services/payout_service.rbi +0 -205
  504. data/rbi/stripe/services/plan_service.rbi +0 -284
  505. data/rbi/stripe/services/price_service.rbi +0 -546
  506. data/rbi/stripe/services/product_feature_service.rbi +0 -69
  507. data/rbi/stripe/services/product_service.rbi +0 -479
  508. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  509. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  510. data/rbi/stripe/services/quote_service.rbi +0 -686
  511. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  512. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -111
  513. data/rbi/stripe/services/radar/value_list_service.rbi +0 -143
  514. data/rbi/stripe/services/radar_service.rbi +0 -11
  515. data/rbi/stripe/services/refund_service.rbi +0 -185
  516. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  517. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  518. data/rbi/stripe/services/reporting_service.rbi +0 -10
  519. data/rbi/stripe/services/review_service.rbi +0 -84
  520. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  521. data/rbi/stripe/services/setup_intent_service.rbi +0 -3605
  522. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  523. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  524. data/rbi/stripe/services/sigma_service.rbi +0 -9
  525. data/rbi/stripe/services/source_service.rbi +0 -663
  526. data/rbi/stripe/services/subscription_item_service.rbi +0 -324
  527. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1192
  528. data/rbi/stripe/services/subscription_service.rbi +0 -1596
  529. data/rbi/stripe/services/tax/calculation_service.rbi +0 -230
  530. data/rbi/stripe/services/tax/registration_service.rbi +0 -1845
  531. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  532. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  533. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  534. data/rbi/stripe/services/tax_id_service.rbi +0 -112
  535. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  536. data/rbi/stripe/services/tax_service.rbi +0 -12
  537. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1120
  538. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  539. data/rbi/stripe/services/terminal/location_service.rbi +0 -184
  540. data/rbi/stripe/services/terminal/reader_service.rbi +0 -344
  541. data/rbi/stripe/services/terminal_service.rbi +0 -12
  542. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -805
  543. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  544. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  545. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  546. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  547. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  548. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  549. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  550. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -62
  551. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  552. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -92
  553. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  554. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  555. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  556. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  557. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  558. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  559. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  560. data/rbi/stripe/services/token_service.rbi +0 -1257
  561. data/rbi/stripe/services/topup_service.rbi +0 -176
  562. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  563. data/rbi/stripe/services/transfer_service.rbi +0 -152
  564. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  565. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  566. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  567. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -562
  568. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  569. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  570. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  571. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  572. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  573. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  574. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  575. data/rbi/stripe/services/treasury_service.rbi +0 -18
  576. data/rbi/stripe/services/v1_services.rbi +0 -77
  577. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  578. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  579. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -20
  580. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  581. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  582. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -200
  583. data/rbi/stripe/services/v2/core/event_service.rbi +0 -38
  584. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  585. data/rbi/stripe/services/v2_services.rbi +0 -10
  586. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -131
@@ -23,6 +23,24 @@ module Stripe
23
23
  end
24
24
 
25
25
  class UpdateParams < Stripe::RequestParams
26
+ class AmountsDue < Stripe::RequestParams
27
+ # The amount in cents (or local equivalent).
28
+ attr_accessor :amount
29
+ # Number of days from when invoice is finalized until the payment is due.
30
+ attr_accessor :days_until_due
31
+ # An arbitrary string attached to the object. Often useful for displaying to users.
32
+ attr_accessor :description
33
+ # Date on which a payment plan’s payment is due.
34
+ attr_accessor :due_date
35
+
36
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
37
+ @amount = amount
38
+ @days_until_due = days_until_due
39
+ @description = description
40
+ @due_date = due_date
41
+ end
42
+ end
43
+
26
44
  class AutomaticTax < Stripe::RequestParams
27
45
  class Liability < Stripe::RequestParams
28
46
  # The connected account being referenced when `type` is `account`.
@@ -59,16 +77,44 @@ module Stripe
59
77
  end
60
78
 
61
79
  class Discount < Stripe::RequestParams
80
+ class DiscountEnd < Stripe::RequestParams
81
+ class Duration < Stripe::RequestParams
82
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
83
+ attr_accessor :interval
84
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
85
+ attr_accessor :interval_count
86
+
87
+ def initialize(interval: nil, interval_count: nil)
88
+ @interval = interval
89
+ @interval_count = interval_count
90
+ end
91
+ end
92
+ # Time span for the redeemed discount.
93
+ attr_accessor :duration
94
+ # A precise Unix timestamp for the discount to end. Must be in the future.
95
+ attr_accessor :timestamp
96
+ # The type of calculation made to determine when the discount ends.
97
+ attr_accessor :type
98
+
99
+ def initialize(duration: nil, timestamp: nil, type: nil)
100
+ @duration = duration
101
+ @timestamp = timestamp
102
+ @type = type
103
+ end
104
+ end
62
105
  # ID of the coupon to create a new discount for.
63
106
  attr_accessor :coupon
64
107
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
65
108
  attr_accessor :discount
109
+ # Details to determine how long the discount should be applied for.
110
+ attr_accessor :discount_end
66
111
  # ID of the promotion code to create a new discount for.
67
112
  attr_accessor :promotion_code
68
113
 
69
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
114
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
70
115
  @coupon = coupon
71
116
  @discount = discount
117
+ @discount_end = discount_end
72
118
  @promotion_code = promotion_code
73
119
  end
74
120
  end
@@ -188,6 +234,9 @@ module Stripe
188
234
  end
189
235
  end
190
236
 
237
+ class IdBankTransfer < Stripe::RequestParams
238
+ end
239
+
191
240
  class Konbini < Stripe::RequestParams
192
241
  end
193
242
 
@@ -199,9 +248,12 @@ module Stripe
199
248
  class Filters < Stripe::RequestParams
200
249
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
201
250
  attr_accessor :account_subcategories
251
+ # ID of the institution to use to filter for selectable accounts.
252
+ attr_accessor :institution
202
253
 
203
- def initialize(account_subcategories: nil)
254
+ def initialize(account_subcategories: nil, institution: nil)
204
255
  @account_subcategories = account_subcategories
256
+ @institution = institution
205
257
  end
206
258
  end
207
259
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -235,6 +287,8 @@ module Stripe
235
287
  attr_accessor :card
236
288
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
237
289
  attr_accessor :customer_balance
290
+ # 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.
291
+ attr_accessor :id_bank_transfer
238
292
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
239
293
  attr_accessor :konbini
240
294
  # 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.
@@ -247,6 +301,7 @@ module Stripe
247
301
  bancontact: nil,
248
302
  card: nil,
249
303
  customer_balance: nil,
304
+ id_bank_transfer: nil,
250
305
  konbini: nil,
251
306
  sepa_debit: nil,
252
307
  us_bank_account: nil
@@ -255,6 +310,7 @@ module Stripe
255
310
  @bancontact = bancontact
256
311
  @card = card
257
312
  @customer_balance = customer_balance
313
+ @id_bank_transfer = id_bank_transfer
258
314
  @konbini = konbini
259
315
  @sepa_debit = sepa_debit
260
316
  @us_bank_account = us_bank_account
@@ -466,6 +522,8 @@ module Stripe
466
522
  end
467
523
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
468
524
  attr_accessor :account_tax_ids
525
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
526
+ attr_accessor :amounts_due
469
527
  # 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).
470
528
  attr_accessor :application_fee_amount
471
529
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -480,6 +538,8 @@ module Stripe
480
538
  attr_accessor :custom_fields
481
539
  # 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.
482
540
  attr_accessor :days_until_due
541
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
542
+ attr_accessor :default_margins
483
543
  # 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.
484
544
  attr_accessor :default_payment_method
485
545
  # 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.
@@ -521,6 +581,7 @@ module Stripe
521
581
 
522
582
  def initialize(
523
583
  account_tax_ids: nil,
584
+ amounts_due: nil,
524
585
  application_fee_amount: nil,
525
586
  auto_advance: nil,
526
587
  automatic_tax: nil,
@@ -528,6 +589,7 @@ module Stripe
528
589
  collection_method: nil,
529
590
  custom_fields: nil,
530
591
  days_until_due: nil,
592
+ default_margins: nil,
531
593
  default_payment_method: nil,
532
594
  default_source: nil,
533
595
  default_tax_rates: nil,
@@ -549,6 +611,7 @@ module Stripe
549
611
  transfer_data: nil
550
612
  )
551
613
  @account_tax_ids = account_tax_ids
614
+ @amounts_due = amounts_due
552
615
  @application_fee_amount = application_fee_amount
553
616
  @auto_advance = auto_advance
554
617
  @automatic_tax = automatic_tax
@@ -556,6 +619,7 @@ module Stripe
556
619
  @collection_method = collection_method
557
620
  @custom_fields = custom_fields
558
621
  @days_until_due = days_until_due
622
+ @default_margins = default_margins
559
623
  @default_payment_method = default_payment_method
560
624
  @default_source = default_source
561
625
  @default_tax_rates = default_tax_rates
@@ -620,6 +684,8 @@ module Stripe
620
684
  attr_accessor :created
621
685
  # Only return invoices for the customer specified by this customer ID.
622
686
  attr_accessor :customer
687
+ # Only return invoices for the account specified by this account ID.
688
+ attr_accessor :customer_account
623
689
  # Attribute for param field due_date
624
690
  attr_accessor :due_date
625
691
  # 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.
@@ -639,6 +705,7 @@ module Stripe
639
705
  collection_method: nil,
640
706
  created: nil,
641
707
  customer: nil,
708
+ customer_account: nil,
642
709
  due_date: nil,
643
710
  ending_before: nil,
644
711
  expand: nil,
@@ -650,6 +717,7 @@ module Stripe
650
717
  @collection_method = collection_method
651
718
  @created = created
652
719
  @customer = customer
720
+ @customer_account = customer_account
653
721
  @due_date = due_date
654
722
  @ending_before = ending_before
655
723
  @expand = expand
@@ -661,6 +729,24 @@ module Stripe
661
729
  end
662
730
 
663
731
  class CreateParams < Stripe::RequestParams
732
+ class AmountsDue < Stripe::RequestParams
733
+ # The amount in cents (or local equivalent).
734
+ attr_accessor :amount
735
+ # Number of days from when invoice is finalized until the payment is due.
736
+ attr_accessor :days_until_due
737
+ # An arbitrary string attached to the object. Often useful for displaying to users.
738
+ attr_accessor :description
739
+ # Date on which a payment plan’s payment is due.
740
+ attr_accessor :due_date
741
+
742
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
743
+ @amount = amount
744
+ @days_until_due = days_until_due
745
+ @description = description
746
+ @due_date = due_date
747
+ end
748
+ end
749
+
664
750
  class AutomaticTax < Stripe::RequestParams
665
751
  class Liability < Stripe::RequestParams
666
752
  # The connected account being referenced when `type` is `account`.
@@ -697,16 +783,44 @@ module Stripe
697
783
  end
698
784
 
699
785
  class Discount < Stripe::RequestParams
786
+ class DiscountEnd < Stripe::RequestParams
787
+ class Duration < Stripe::RequestParams
788
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
789
+ attr_accessor :interval
790
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
791
+ attr_accessor :interval_count
792
+
793
+ def initialize(interval: nil, interval_count: nil)
794
+ @interval = interval
795
+ @interval_count = interval_count
796
+ end
797
+ end
798
+ # Time span for the redeemed discount.
799
+ attr_accessor :duration
800
+ # A precise Unix timestamp for the discount to end. Must be in the future.
801
+ attr_accessor :timestamp
802
+ # The type of calculation made to determine when the discount ends.
803
+ attr_accessor :type
804
+
805
+ def initialize(duration: nil, timestamp: nil, type: nil)
806
+ @duration = duration
807
+ @timestamp = timestamp
808
+ @type = type
809
+ end
810
+ end
700
811
  # ID of the coupon to create a new discount for.
701
812
  attr_accessor :coupon
702
813
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
703
814
  attr_accessor :discount
815
+ # Details to determine how long the discount should be applied for.
816
+ attr_accessor :discount_end
704
817
  # ID of the promotion code to create a new discount for.
705
818
  attr_accessor :promotion_code
706
819
 
707
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
820
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
708
821
  @coupon = coupon
709
822
  @discount = discount
823
+ @discount_end = discount_end
710
824
  @promotion_code = promotion_code
711
825
  end
712
826
  end
@@ -838,6 +952,9 @@ module Stripe
838
952
  end
839
953
  end
840
954
 
955
+ class IdBankTransfer < Stripe::RequestParams
956
+ end
957
+
841
958
  class Konbini < Stripe::RequestParams
842
959
  end
843
960
 
@@ -849,9 +966,12 @@ module Stripe
849
966
  class Filters < Stripe::RequestParams
850
967
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
851
968
  attr_accessor :account_subcategories
969
+ # ID of the institution to use to filter for selectable accounts.
970
+ attr_accessor :institution
852
971
 
853
- def initialize(account_subcategories: nil)
972
+ def initialize(account_subcategories: nil, institution: nil)
854
973
  @account_subcategories = account_subcategories
974
+ @institution = institution
855
975
  end
856
976
  end
857
977
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -885,6 +1005,8 @@ module Stripe
885
1005
  attr_accessor :card
886
1006
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
887
1007
  attr_accessor :customer_balance
1008
+ # 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.
1009
+ attr_accessor :id_bank_transfer
888
1010
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
889
1011
  attr_accessor :konbini
890
1012
  # 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.
@@ -897,6 +1019,7 @@ module Stripe
897
1019
  bancontact: nil,
898
1020
  card: nil,
899
1021
  customer_balance: nil,
1022
+ id_bank_transfer: nil,
900
1023
  konbini: nil,
901
1024
  sepa_debit: nil,
902
1025
  us_bank_account: nil
@@ -905,6 +1028,7 @@ module Stripe
905
1028
  @bancontact = bancontact
906
1029
  @card = card
907
1030
  @customer_balance = customer_balance
1031
+ @id_bank_transfer = id_bank_transfer
908
1032
  @konbini = konbini
909
1033
  @sepa_debit = sepa_debit
910
1034
  @us_bank_account = us_bank_account
@@ -1116,6 +1240,8 @@ module Stripe
1116
1240
  end
1117
1241
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1118
1242
  attr_accessor :account_tax_ids
1243
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1244
+ attr_accessor :amounts_due
1119
1245
  # 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).
1120
1246
  attr_accessor :application_fee_amount
1121
1247
  # 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.
@@ -1132,8 +1258,12 @@ module Stripe
1132
1258
  attr_accessor :custom_fields
1133
1259
  # The ID of the customer who will be billed.
1134
1260
  attr_accessor :customer
1261
+ # The ID of the account who will be billed.
1262
+ attr_accessor :customer_account
1135
1263
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1136
1264
  attr_accessor :days_until_due
1265
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1266
+ attr_accessor :default_margins
1137
1267
  # 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.
1138
1268
  attr_accessor :default_payment_method
1139
1269
  # 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.
@@ -1181,6 +1311,7 @@ module Stripe
1181
1311
 
1182
1312
  def initialize(
1183
1313
  account_tax_ids: nil,
1314
+ amounts_due: nil,
1184
1315
  application_fee_amount: nil,
1185
1316
  auto_advance: nil,
1186
1317
  automatic_tax: nil,
@@ -1189,7 +1320,9 @@ module Stripe
1189
1320
  currency: nil,
1190
1321
  custom_fields: nil,
1191
1322
  customer: nil,
1323
+ customer_account: nil,
1192
1324
  days_until_due: nil,
1325
+ default_margins: nil,
1193
1326
  default_payment_method: nil,
1194
1327
  default_source: nil,
1195
1328
  default_tax_rates: nil,
@@ -1214,6 +1347,7 @@ module Stripe
1214
1347
  transfer_data: nil
1215
1348
  )
1216
1349
  @account_tax_ids = account_tax_ids
1350
+ @amounts_due = amounts_due
1217
1351
  @application_fee_amount = application_fee_amount
1218
1352
  @auto_advance = auto_advance
1219
1353
  @automatic_tax = automatic_tax
@@ -1222,7 +1356,9 @@ module Stripe
1222
1356
  @currency = currency
1223
1357
  @custom_fields = custom_fields
1224
1358
  @customer = customer
1359
+ @customer_account = customer_account
1225
1360
  @days_until_due = days_until_due
1361
+ @default_margins = default_margins
1226
1362
  @default_payment_method = default_payment_method
1227
1363
  @default_source = default_source
1228
1364
  @default_tax_rates = default_tax_rates
@@ -1269,16 +1405,44 @@ module Stripe
1269
1405
  class AddLinesParams < Stripe::RequestParams
1270
1406
  class Line < Stripe::RequestParams
1271
1407
  class Discount < Stripe::RequestParams
1408
+ class DiscountEnd < Stripe::RequestParams
1409
+ class Duration < Stripe::RequestParams
1410
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1411
+ attr_accessor :interval
1412
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1413
+ attr_accessor :interval_count
1414
+
1415
+ def initialize(interval: nil, interval_count: nil)
1416
+ @interval = interval
1417
+ @interval_count = interval_count
1418
+ end
1419
+ end
1420
+ # Time span for the redeemed discount.
1421
+ attr_accessor :duration
1422
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1423
+ attr_accessor :timestamp
1424
+ # The type of calculation made to determine when the discount ends.
1425
+ attr_accessor :type
1426
+
1427
+ def initialize(duration: nil, timestamp: nil, type: nil)
1428
+ @duration = duration
1429
+ @timestamp = timestamp
1430
+ @type = type
1431
+ end
1432
+ end
1272
1433
  # ID of the coupon to create a new discount for.
1273
1434
  attr_accessor :coupon
1274
1435
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1275
1436
  attr_accessor :discount
1437
+ # Details to determine how long the discount should be applied for.
1438
+ attr_accessor :discount_end
1276
1439
  # ID of the promotion code to create a new discount for.
1277
1440
  attr_accessor :promotion_code
1278
1441
 
1279
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1442
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1280
1443
  @coupon = coupon
1281
1444
  @discount = discount
1445
+ @discount_end = discount_end
1282
1446
  @promotion_code = promotion_code
1283
1447
  end
1284
1448
  end
@@ -1431,6 +1595,8 @@ module Stripe
1431
1595
  attr_accessor :discounts
1432
1596
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1433
1597
  attr_accessor :invoice_item
1598
+ # 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.
1599
+ attr_accessor :margins
1434
1600
  # 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`.
1435
1601
  attr_accessor :metadata
1436
1602
  # 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.
@@ -1452,6 +1618,7 @@ module Stripe
1452
1618
  discountable: nil,
1453
1619
  discounts: nil,
1454
1620
  invoice_item: nil,
1621
+ margins: nil,
1455
1622
  metadata: nil,
1456
1623
  period: nil,
1457
1624
  price_data: nil,
@@ -1465,6 +1632,7 @@ module Stripe
1465
1632
  @discountable = discountable
1466
1633
  @discounts = discounts
1467
1634
  @invoice_item = invoice_item
1635
+ @margins = margins
1468
1636
  @metadata = metadata
1469
1637
  @period = period
1470
1638
  @price_data = price_data
@@ -1488,6 +1656,63 @@ module Stripe
1488
1656
  end
1489
1657
  end
1490
1658
 
1659
+ class AttachPaymentParams < Stripe::RequestParams
1660
+ class PaymentRecordData < Stripe::RequestParams
1661
+ # The amount that was paid out of band.
1662
+ attr_accessor :amount
1663
+ # The currency that was paid out of band.
1664
+ attr_accessor :currency
1665
+ # 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`.
1666
+ attr_accessor :metadata
1667
+ # The type of money movement for this out of band payment record.
1668
+ attr_accessor :money_movement_type
1669
+ # The timestamp when this out of band payment was paid.
1670
+ attr_accessor :paid_at
1671
+ # The reference for this out of band payment record.
1672
+ attr_accessor :payment_reference
1673
+
1674
+ def initialize(
1675
+ amount: nil,
1676
+ currency: nil,
1677
+ metadata: nil,
1678
+ money_movement_type: nil,
1679
+ paid_at: nil,
1680
+ payment_reference: nil
1681
+ )
1682
+ @amount = amount
1683
+ @currency = currency
1684
+ @metadata = metadata
1685
+ @money_movement_type = money_movement_type
1686
+ @paid_at = paid_at
1687
+ @payment_reference = payment_reference
1688
+ end
1689
+ end
1690
+ # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
1691
+ attr_accessor :amount_requested
1692
+ # Specifies which fields in the response should be expanded.
1693
+ attr_accessor :expand
1694
+ # The ID of the PaymentIntent to attach to the invoice.
1695
+ attr_accessor :payment_intent
1696
+ # The ID of the PaymentRecord to attach to the invoice.
1697
+ attr_accessor :payment_record
1698
+ # The PaymentRecord data for attaching an out of band payment to the invoice.
1699
+ attr_accessor :payment_record_data
1700
+
1701
+ def initialize(
1702
+ amount_requested: nil,
1703
+ expand: nil,
1704
+ payment_intent: nil,
1705
+ payment_record: nil,
1706
+ payment_record_data: nil
1707
+ )
1708
+ @amount_requested = amount_requested
1709
+ @expand = expand
1710
+ @payment_intent = payment_intent
1711
+ @payment_record = payment_record
1712
+ @payment_record_data = payment_record_data
1713
+ end
1714
+ end
1715
+
1491
1716
  class FinalizeInvoiceParams < Stripe::RequestParams
1492
1717
  # 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.
1493
1718
  attr_accessor :auto_advance
@@ -1584,16 +1809,44 @@ module Stripe
1584
1809
  class UpdateLinesParams < Stripe::RequestParams
1585
1810
  class Line < Stripe::RequestParams
1586
1811
  class Discount < Stripe::RequestParams
1812
+ class DiscountEnd < Stripe::RequestParams
1813
+ class Duration < Stripe::RequestParams
1814
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1815
+ attr_accessor :interval
1816
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1817
+ attr_accessor :interval_count
1818
+
1819
+ def initialize(interval: nil, interval_count: nil)
1820
+ @interval = interval
1821
+ @interval_count = interval_count
1822
+ end
1823
+ end
1824
+ # Time span for the redeemed discount.
1825
+ attr_accessor :duration
1826
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1827
+ attr_accessor :timestamp
1828
+ # The type of calculation made to determine when the discount ends.
1829
+ attr_accessor :type
1830
+
1831
+ def initialize(duration: nil, timestamp: nil, type: nil)
1832
+ @duration = duration
1833
+ @timestamp = timestamp
1834
+ @type = type
1835
+ end
1836
+ end
1587
1837
  # ID of the coupon to create a new discount for.
1588
1838
  attr_accessor :coupon
1589
1839
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1590
1840
  attr_accessor :discount
1841
+ # Details to determine how long the discount should be applied for.
1842
+ attr_accessor :discount_end
1591
1843
  # ID of the promotion code to create a new discount for.
1592
1844
  attr_accessor :promotion_code
1593
1845
 
1594
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1846
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1595
1847
  @coupon = coupon
1596
1848
  @discount = discount
1849
+ @discount_end = discount_end
1597
1850
  @promotion_code = promotion_code
1598
1851
  end
1599
1852
  end
@@ -1746,6 +1999,8 @@ module Stripe
1746
1999
  attr_accessor :discounts
1747
2000
  # ID of an existing line item on the invoice.
1748
2001
  attr_accessor :id
2002
+ # 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.
2003
+ attr_accessor :margins
1749
2004
  # 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.
1750
2005
  attr_accessor :metadata
1751
2006
  # 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.
@@ -1767,6 +2022,7 @@ module Stripe
1767
2022
  discountable: nil,
1768
2023
  discounts: nil,
1769
2024
  id: nil,
2025
+ margins: nil,
1770
2026
  metadata: nil,
1771
2027
  period: nil,
1772
2028
  price_data: nil,
@@ -1780,6 +2036,7 @@ module Stripe
1780
2036
  @discountable = discountable
1781
2037
  @discounts = discounts
1782
2038
  @id = id
2039
+ @margins = margins
1783
2040
  @metadata = metadata
1784
2041
  @period = period
1785
2042
  @price_data = price_data
@@ -1954,32 +2211,88 @@ module Stripe
1954
2211
  end
1955
2212
 
1956
2213
  class Discount < Stripe::RequestParams
2214
+ class DiscountEnd < Stripe::RequestParams
2215
+ class Duration < Stripe::RequestParams
2216
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2217
+ attr_accessor :interval
2218
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2219
+ attr_accessor :interval_count
2220
+
2221
+ def initialize(interval: nil, interval_count: nil)
2222
+ @interval = interval
2223
+ @interval_count = interval_count
2224
+ end
2225
+ end
2226
+ # Time span for the redeemed discount.
2227
+ attr_accessor :duration
2228
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2229
+ attr_accessor :timestamp
2230
+ # The type of calculation made to determine when the discount ends.
2231
+ attr_accessor :type
2232
+
2233
+ def initialize(duration: nil, timestamp: nil, type: nil)
2234
+ @duration = duration
2235
+ @timestamp = timestamp
2236
+ @type = type
2237
+ end
2238
+ end
1957
2239
  # ID of the coupon to create a new discount for.
1958
2240
  attr_accessor :coupon
1959
2241
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1960
2242
  attr_accessor :discount
2243
+ # Details to determine how long the discount should be applied for.
2244
+ attr_accessor :discount_end
1961
2245
  # ID of the promotion code to create a new discount for.
1962
2246
  attr_accessor :promotion_code
1963
2247
 
1964
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2248
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1965
2249
  @coupon = coupon
1966
2250
  @discount = discount
2251
+ @discount_end = discount_end
1967
2252
  @promotion_code = promotion_code
1968
2253
  end
1969
2254
  end
1970
2255
 
1971
2256
  class InvoiceItem < Stripe::RequestParams
1972
2257
  class Discount < Stripe::RequestParams
2258
+ class DiscountEnd < Stripe::RequestParams
2259
+ class Duration < Stripe::RequestParams
2260
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2261
+ attr_accessor :interval
2262
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2263
+ attr_accessor :interval_count
2264
+
2265
+ def initialize(interval: nil, interval_count: nil)
2266
+ @interval = interval
2267
+ @interval_count = interval_count
2268
+ end
2269
+ end
2270
+ # Time span for the redeemed discount.
2271
+ attr_accessor :duration
2272
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2273
+ attr_accessor :timestamp
2274
+ # The type of calculation made to determine when the discount ends.
2275
+ attr_accessor :type
2276
+
2277
+ def initialize(duration: nil, timestamp: nil, type: nil)
2278
+ @duration = duration
2279
+ @timestamp = timestamp
2280
+ @type = type
2281
+ end
2282
+ end
1973
2283
  # ID of the coupon to create a new discount for.
1974
2284
  attr_accessor :coupon
1975
2285
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1976
2286
  attr_accessor :discount
2287
+ # Details to determine how long the discount should be applied for.
2288
+ attr_accessor :discount_end
1977
2289
  # ID of the promotion code to create a new discount for.
1978
2290
  attr_accessor :promotion_code
1979
2291
 
1980
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2292
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1981
2293
  @coupon = coupon
1982
2294
  @discount = discount
2295
+ @discount_end = discount_end
1983
2296
  @promotion_code = promotion_code
1984
2297
  end
1985
2298
  end
@@ -2105,19 +2418,499 @@ module Stripe
2105
2418
  end
2106
2419
 
2107
2420
  class ScheduleDetails < Stripe::RequestParams
2421
+ class Amendment < Stripe::RequestParams
2422
+ class AmendmentEnd < Stripe::RequestParams
2423
+ class DiscountEnd < Stripe::RequestParams
2424
+ # The ID of a specific discount.
2425
+ attr_accessor :discount
2426
+
2427
+ def initialize(discount: nil)
2428
+ @discount = discount
2429
+ end
2430
+ end
2431
+
2432
+ class Duration < Stripe::RequestParams
2433
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2434
+ attr_accessor :interval
2435
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2436
+ attr_accessor :interval_count
2437
+
2438
+ def initialize(interval: nil, interval_count: nil)
2439
+ @interval = interval
2440
+ @interval_count = interval_count
2441
+ end
2442
+ end
2443
+ # Use the `end` time of a given discount.
2444
+ attr_accessor :discount_end
2445
+ # Time span for the amendment starting from the `amendment_start`.
2446
+ attr_accessor :duration
2447
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2448
+ attr_accessor :timestamp
2449
+ # Select one of three ways to pass the `amendment_end`.
2450
+ attr_accessor :type
2451
+
2452
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2453
+ @discount_end = discount_end
2454
+ @duration = duration
2455
+ @timestamp = timestamp
2456
+ @type = type
2457
+ end
2458
+ end
2459
+
2460
+ class AmendmentStart < Stripe::RequestParams
2461
+ class AmendmentEnd < Stripe::RequestParams
2462
+ # 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.
2463
+ attr_accessor :index
2464
+
2465
+ def initialize(index: nil)
2466
+ @index = index
2467
+ end
2468
+ end
2469
+
2470
+ class DiscountEnd < Stripe::RequestParams
2471
+ # The ID of a specific discount.
2472
+ attr_accessor :discount
2473
+
2474
+ def initialize(discount: nil)
2475
+ @discount = discount
2476
+ end
2477
+ end
2478
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
2479
+ attr_accessor :amendment_end
2480
+ # Use the `end` time of a given discount.
2481
+ attr_accessor :discount_end
2482
+ # A precise Unix timestamp for the amendment to start.
2483
+ attr_accessor :timestamp
2484
+ # Select one of three ways to pass the `amendment_start`.
2485
+ attr_accessor :type
2486
+
2487
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
2488
+ @amendment_end = amendment_end
2489
+ @discount_end = discount_end
2490
+ @timestamp = timestamp
2491
+ @type = type
2492
+ end
2493
+ end
2494
+
2495
+ class DiscountAction < Stripe::RequestParams
2496
+ class Add < Stripe::RequestParams
2497
+ class DiscountEnd < Stripe::RequestParams
2498
+ # The type of calculation made to determine when the discount ends.
2499
+ attr_accessor :type
2500
+
2501
+ def initialize(type: nil)
2502
+ @type = type
2503
+ end
2504
+ end
2505
+ # The coupon code to redeem.
2506
+ attr_accessor :coupon
2507
+ # An ID of an existing discount for a coupon that was already redeemed.
2508
+ attr_accessor :discount
2509
+ # Details to determine how long the discount should be applied for.
2510
+ attr_accessor :discount_end
2511
+ # 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.
2512
+ attr_accessor :index
2513
+ # The promotion code to redeem.
2514
+ attr_accessor :promotion_code
2515
+
2516
+ def initialize(
2517
+ coupon: nil,
2518
+ discount: nil,
2519
+ discount_end: nil,
2520
+ index: nil,
2521
+ promotion_code: nil
2522
+ )
2523
+ @coupon = coupon
2524
+ @discount = discount
2525
+ @discount_end = discount_end
2526
+ @index = index
2527
+ @promotion_code = promotion_code
2528
+ end
2529
+ end
2530
+
2531
+ class Remove < Stripe::RequestParams
2532
+ # The coupon code to remove from the `discounts` array.
2533
+ attr_accessor :coupon
2534
+ # The ID of a discount to remove from the `discounts` array.
2535
+ attr_accessor :discount
2536
+ # The ID of a promotion code to remove from the `discounts` array.
2537
+ attr_accessor :promotion_code
2538
+
2539
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2540
+ @coupon = coupon
2541
+ @discount = discount
2542
+ @promotion_code = promotion_code
2543
+ end
2544
+ end
2545
+
2546
+ class Set < Stripe::RequestParams
2547
+ # The coupon code to replace the `discounts` array with.
2548
+ attr_accessor :coupon
2549
+ # An ID of an existing discount to replace the `discounts` array with.
2550
+ attr_accessor :discount
2551
+ # An ID of an existing promotion code to replace the `discounts` array with.
2552
+ attr_accessor :promotion_code
2553
+
2554
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2555
+ @coupon = coupon
2556
+ @discount = discount
2557
+ @promotion_code = promotion_code
2558
+ end
2559
+ end
2560
+ # Details of the discount to add.
2561
+ attr_accessor :add
2562
+ # Details of the discount to remove.
2563
+ attr_accessor :remove
2564
+ # Details of the discount to replace the existing discounts with.
2565
+ attr_accessor :set
2566
+ # Determines the type of discount action.
2567
+ attr_accessor :type
2568
+
2569
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2570
+ @add = add
2571
+ @remove = remove
2572
+ @set = set
2573
+ @type = type
2574
+ end
2575
+ end
2576
+
2577
+ class ItemAction < Stripe::RequestParams
2578
+ class Add < Stripe::RequestParams
2579
+ class Discount < Stripe::RequestParams
2580
+ class DiscountEnd < Stripe::RequestParams
2581
+ class Duration < Stripe::RequestParams
2582
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2583
+ attr_accessor :interval
2584
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2585
+ attr_accessor :interval_count
2586
+
2587
+ def initialize(interval: nil, interval_count: nil)
2588
+ @interval = interval
2589
+ @interval_count = interval_count
2590
+ end
2591
+ end
2592
+ # Time span for the redeemed discount.
2593
+ attr_accessor :duration
2594
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2595
+ attr_accessor :timestamp
2596
+ # The type of calculation made to determine when the discount ends.
2597
+ attr_accessor :type
2598
+
2599
+ def initialize(duration: nil, timestamp: nil, type: nil)
2600
+ @duration = duration
2601
+ @timestamp = timestamp
2602
+ @type = type
2603
+ end
2604
+ end
2605
+ # ID of the coupon to create a new discount for.
2606
+ attr_accessor :coupon
2607
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2608
+ attr_accessor :discount
2609
+ # Details to determine how long the discount should be applied for.
2610
+ attr_accessor :discount_end
2611
+ # ID of the promotion code to create a new discount for.
2612
+ attr_accessor :promotion_code
2613
+
2614
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2615
+ @coupon = coupon
2616
+ @discount = discount
2617
+ @discount_end = discount_end
2618
+ @promotion_code = promotion_code
2619
+ end
2620
+ end
2621
+
2622
+ class Trial < Stripe::RequestParams
2623
+ # 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.
2624
+ attr_accessor :converts_to
2625
+ # Determines the type of trial for this item.
2626
+ attr_accessor :type
2627
+
2628
+ def initialize(converts_to: nil, type: nil)
2629
+ @converts_to = converts_to
2630
+ @type = type
2631
+ end
2632
+ end
2633
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2634
+ attr_accessor :discounts
2635
+ # 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`.
2636
+ attr_accessor :metadata
2637
+ # The ID of the price object.
2638
+ attr_accessor :price
2639
+ # Quantity for this item.
2640
+ attr_accessor :quantity
2641
+ # 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`.
2642
+ attr_accessor :tax_rates
2643
+ # Options that configure the trial on the subscription item.
2644
+ attr_accessor :trial
2645
+
2646
+ def initialize(
2647
+ discounts: nil,
2648
+ metadata: nil,
2649
+ price: nil,
2650
+ quantity: nil,
2651
+ tax_rates: nil,
2652
+ trial: nil
2653
+ )
2654
+ @discounts = discounts
2655
+ @metadata = metadata
2656
+ @price = price
2657
+ @quantity = quantity
2658
+ @tax_rates = tax_rates
2659
+ @trial = trial
2660
+ end
2661
+ end
2662
+
2663
+ class Remove < Stripe::RequestParams
2664
+ # ID of a price to remove.
2665
+ attr_accessor :price
2666
+
2667
+ def initialize(price: nil)
2668
+ @price = price
2669
+ end
2670
+ end
2671
+
2672
+ class Set < Stripe::RequestParams
2673
+ class Discount < Stripe::RequestParams
2674
+ class DiscountEnd < Stripe::RequestParams
2675
+ class Duration < Stripe::RequestParams
2676
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2677
+ attr_accessor :interval
2678
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2679
+ attr_accessor :interval_count
2680
+
2681
+ def initialize(interval: nil, interval_count: nil)
2682
+ @interval = interval
2683
+ @interval_count = interval_count
2684
+ end
2685
+ end
2686
+ # Time span for the redeemed discount.
2687
+ attr_accessor :duration
2688
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2689
+ attr_accessor :timestamp
2690
+ # The type of calculation made to determine when the discount ends.
2691
+ attr_accessor :type
2692
+
2693
+ def initialize(duration: nil, timestamp: nil, type: nil)
2694
+ @duration = duration
2695
+ @timestamp = timestamp
2696
+ @type = type
2697
+ end
2698
+ end
2699
+ # ID of the coupon to create a new discount for.
2700
+ attr_accessor :coupon
2701
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
2702
+ attr_accessor :discount
2703
+ # Details to determine how long the discount should be applied for.
2704
+ attr_accessor :discount_end
2705
+ # ID of the promotion code to create a new discount for.
2706
+ attr_accessor :promotion_code
2707
+
2708
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2709
+ @coupon = coupon
2710
+ @discount = discount
2711
+ @discount_end = discount_end
2712
+ @promotion_code = promotion_code
2713
+ end
2714
+ end
2715
+
2716
+ class Trial < Stripe::RequestParams
2717
+ # 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.
2718
+ attr_accessor :converts_to
2719
+ # Determines the type of trial for this item.
2720
+ attr_accessor :type
2721
+
2722
+ def initialize(converts_to: nil, type: nil)
2723
+ @converts_to = converts_to
2724
+ @type = type
2725
+ end
2726
+ end
2727
+ # 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`.
2728
+ attr_accessor :discounts
2729
+ # 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`.
2730
+ attr_accessor :metadata
2731
+ # The ID of the price object.
2732
+ attr_accessor :price
2733
+ # 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`.
2734
+ attr_accessor :quantity
2735
+ # 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`.
2736
+ attr_accessor :tax_rates
2737
+ # 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`.
2738
+ attr_accessor :trial
2739
+
2740
+ def initialize(
2741
+ discounts: nil,
2742
+ metadata: nil,
2743
+ price: nil,
2744
+ quantity: nil,
2745
+ tax_rates: nil,
2746
+ trial: nil
2747
+ )
2748
+ @discounts = discounts
2749
+ @metadata = metadata
2750
+ @price = price
2751
+ @quantity = quantity
2752
+ @tax_rates = tax_rates
2753
+ @trial = trial
2754
+ end
2755
+ end
2756
+ # 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.
2757
+ attr_accessor :add
2758
+ # Details of the subscription item to remove.
2759
+ attr_accessor :remove
2760
+ # 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.
2761
+ attr_accessor :set
2762
+ # Determines the type of item action.
2763
+ attr_accessor :type
2764
+
2765
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2766
+ @add = add
2767
+ @remove = remove
2768
+ @set = set
2769
+ @type = type
2770
+ end
2771
+ end
2772
+
2773
+ class MetadataAction < Stripe::RequestParams
2774
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2775
+ attr_accessor :add
2776
+ # Keys to remove from schedule phase metadata.
2777
+ attr_accessor :remove
2778
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2779
+ attr_accessor :set
2780
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
2781
+ attr_accessor :type
2782
+
2783
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
2784
+ @add = add
2785
+ @remove = remove
2786
+ @set = set
2787
+ @type = type
2788
+ end
2789
+ end
2790
+
2791
+ class SetPauseCollection < Stripe::RequestParams
2792
+ class Set < Stripe::RequestParams
2793
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2794
+ attr_accessor :behavior
2795
+
2796
+ def initialize(behavior: nil)
2797
+ @behavior = behavior
2798
+ end
2799
+ end
2800
+ # Details of the pause_collection behavior to apply to the amendment.
2801
+ attr_accessor :set
2802
+ # Determines the type of the pause_collection amendment.
2803
+ attr_accessor :type
2804
+
2805
+ def initialize(set: nil, type: nil)
2806
+ @set = set
2807
+ @type = type
2808
+ end
2809
+ end
2810
+
2811
+ class TrialSettings < Stripe::RequestParams
2812
+ class EndBehavior < Stripe::RequestParams
2813
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2814
+ attr_accessor :prorate_up_front
2815
+
2816
+ def initialize(prorate_up_front: nil)
2817
+ @prorate_up_front = prorate_up_front
2818
+ end
2819
+ end
2820
+ # Defines how the subscription should behave when a trial ends.
2821
+ attr_accessor :end_behavior
2822
+
2823
+ def initialize(end_behavior: nil)
2824
+ @end_behavior = end_behavior
2825
+ end
2826
+ end
2827
+ # 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.
2828
+ attr_accessor :amendment_end
2829
+ # Details to identify the earliest timestamp where the proposed change should take effect.
2830
+ attr_accessor :amendment_start
2831
+ # 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.
2832
+ attr_accessor :billing_cycle_anchor
2833
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2834
+ attr_accessor :discount_actions
2835
+ # Changes to the subscription items during the amendment time span.
2836
+ attr_accessor :item_actions
2837
+ # Instructions for how to modify phase metadata
2838
+ attr_accessor :metadata_actions
2839
+ # 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`.
2840
+ attr_accessor :proration_behavior
2841
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2842
+ attr_accessor :set_pause_collection
2843
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2844
+ attr_accessor :set_schedule_end
2845
+ # Settings related to subscription trials.
2846
+ attr_accessor :trial_settings
2847
+
2848
+ def initialize(
2849
+ amendment_end: nil,
2850
+ amendment_start: nil,
2851
+ billing_cycle_anchor: nil,
2852
+ discount_actions: nil,
2853
+ item_actions: nil,
2854
+ metadata_actions: nil,
2855
+ proration_behavior: nil,
2856
+ set_pause_collection: nil,
2857
+ set_schedule_end: nil,
2858
+ trial_settings: nil
2859
+ )
2860
+ @amendment_end = amendment_end
2861
+ @amendment_start = amendment_start
2862
+ @billing_cycle_anchor = billing_cycle_anchor
2863
+ @discount_actions = discount_actions
2864
+ @item_actions = item_actions
2865
+ @metadata_actions = metadata_actions
2866
+ @proration_behavior = proration_behavior
2867
+ @set_pause_collection = set_pause_collection
2868
+ @set_schedule_end = set_schedule_end
2869
+ @trial_settings = trial_settings
2870
+ end
2871
+ end
2872
+
2108
2873
  class Phase < Stripe::RequestParams
2109
2874
  class AddInvoiceItem < Stripe::RequestParams
2110
2875
  class Discount < Stripe::RequestParams
2876
+ class DiscountEnd < Stripe::RequestParams
2877
+ class Duration < Stripe::RequestParams
2878
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2879
+ attr_accessor :interval
2880
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2881
+ attr_accessor :interval_count
2882
+
2883
+ def initialize(interval: nil, interval_count: nil)
2884
+ @interval = interval
2885
+ @interval_count = interval_count
2886
+ end
2887
+ end
2888
+ # Time span for the redeemed discount.
2889
+ attr_accessor :duration
2890
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2891
+ attr_accessor :timestamp
2892
+ # The type of calculation made to determine when the discount ends.
2893
+ attr_accessor :type
2894
+
2895
+ def initialize(duration: nil, timestamp: nil, type: nil)
2896
+ @duration = duration
2897
+ @timestamp = timestamp
2898
+ @type = type
2899
+ end
2900
+ end
2111
2901
  # ID of the coupon to create a new discount for.
2112
2902
  attr_accessor :coupon
2113
2903
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2114
2904
  attr_accessor :discount
2905
+ # Details to determine how long the discount should be applied for.
2906
+ attr_accessor :discount_end
2115
2907
  # ID of the promotion code to create a new discount for.
2116
2908
  attr_accessor :promotion_code
2117
2909
 
2118
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2910
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2119
2911
  @coupon = coupon
2120
2912
  @discount = discount
2913
+ @discount_end = discount_end
2121
2914
  @promotion_code = promotion_code
2122
2915
  end
2123
2916
  end
@@ -2198,16 +2991,44 @@ module Stripe
2198
2991
  end
2199
2992
 
2200
2993
  class Discount < Stripe::RequestParams
2994
+ class DiscountEnd < Stripe::RequestParams
2995
+ class Duration < Stripe::RequestParams
2996
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2997
+ attr_accessor :interval
2998
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2999
+ attr_accessor :interval_count
3000
+
3001
+ def initialize(interval: nil, interval_count: nil)
3002
+ @interval = interval
3003
+ @interval_count = interval_count
3004
+ end
3005
+ end
3006
+ # Time span for the redeemed discount.
3007
+ attr_accessor :duration
3008
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3009
+ attr_accessor :timestamp
3010
+ # The type of calculation made to determine when the discount ends.
3011
+ attr_accessor :type
3012
+
3013
+ def initialize(duration: nil, timestamp: nil, type: nil)
3014
+ @duration = duration
3015
+ @timestamp = timestamp
3016
+ @type = type
3017
+ end
3018
+ end
2201
3019
  # ID of the coupon to create a new discount for.
2202
3020
  attr_accessor :coupon
2203
3021
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2204
3022
  attr_accessor :discount
3023
+ # Details to determine how long the discount should be applied for.
3024
+ attr_accessor :discount_end
2205
3025
  # ID of the promotion code to create a new discount for.
2206
3026
  attr_accessor :promotion_code
2207
3027
 
2208
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3028
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2209
3029
  @coupon = coupon
2210
3030
  @discount = discount
3031
+ @discount_end = discount_end
2211
3032
  @promotion_code = promotion_code
2212
3033
  end
2213
3034
  end
@@ -2240,16 +3061,44 @@ module Stripe
2240
3061
 
2241
3062
  class Item < Stripe::RequestParams
2242
3063
  class Discount < Stripe::RequestParams
3064
+ class DiscountEnd < Stripe::RequestParams
3065
+ class Duration < Stripe::RequestParams
3066
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3067
+ attr_accessor :interval
3068
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3069
+ attr_accessor :interval_count
3070
+
3071
+ def initialize(interval: nil, interval_count: nil)
3072
+ @interval = interval
3073
+ @interval_count = interval_count
3074
+ end
3075
+ end
3076
+ # Time span for the redeemed discount.
3077
+ attr_accessor :duration
3078
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3079
+ attr_accessor :timestamp
3080
+ # The type of calculation made to determine when the discount ends.
3081
+ attr_accessor :type
3082
+
3083
+ def initialize(duration: nil, timestamp: nil, type: nil)
3084
+ @duration = duration
3085
+ @timestamp = timestamp
3086
+ @type = type
3087
+ end
3088
+ end
2243
3089
  # ID of the coupon to create a new discount for.
2244
3090
  attr_accessor :coupon
2245
3091
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2246
3092
  attr_accessor :discount
3093
+ # Details to determine how long the discount should be applied for.
3094
+ attr_accessor :discount_end
2247
3095
  # ID of the promotion code to create a new discount for.
2248
3096
  attr_accessor :promotion_code
2249
3097
 
2250
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3098
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2251
3099
  @coupon = coupon
2252
3100
  @discount = discount
3101
+ @discount_end = discount_end
2253
3102
  @promotion_code = promotion_code
2254
3103
  end
2255
3104
  end
@@ -2295,6 +3144,18 @@ module Stripe
2295
3144
  @unit_amount_decimal = unit_amount_decimal
2296
3145
  end
2297
3146
  end
3147
+
3148
+ class Trial < Stripe::RequestParams
3149
+ # 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.
3150
+ attr_accessor :converts_to
3151
+ # Determines the type of trial for this item.
3152
+ attr_accessor :type
3153
+
3154
+ def initialize(converts_to: nil, type: nil)
3155
+ @converts_to = converts_to
3156
+ @type = type
3157
+ end
3158
+ end
2298
3159
  # The coupons to redeem into discounts for the subscription item.
2299
3160
  attr_accessor :discounts
2300
3161
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -2309,6 +3170,8 @@ module Stripe
2309
3170
  attr_accessor :quantity
2310
3171
  # 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.
2311
3172
  attr_accessor :tax_rates
3173
+ # Options that configure the trial on the subscription item.
3174
+ attr_accessor :trial
2312
3175
 
2313
3176
  def initialize(
2314
3177
  discounts: nil,
@@ -2317,7 +3180,8 @@ module Stripe
2317
3180
  price: nil,
2318
3181
  price_data: nil,
2319
3182
  quantity: nil,
2320
- tax_rates: nil
3183
+ tax_rates: nil,
3184
+ trial: nil
2321
3185
  )
2322
3186
  @discounts = discounts
2323
3187
  @metadata = metadata
@@ -2326,6 +3190,16 @@ module Stripe
2326
3190
  @price_data = price_data
2327
3191
  @quantity = quantity
2328
3192
  @tax_rates = tax_rates
3193
+ @trial = trial
3194
+ end
3195
+ end
3196
+
3197
+ class PauseCollection < Stripe::RequestParams
3198
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3199
+ attr_accessor :behavior
3200
+
3201
+ def initialize(behavior: nil)
3202
+ @behavior = behavior
2329
3203
  end
2330
3204
  end
2331
3205
 
@@ -2340,6 +3214,23 @@ module Stripe
2340
3214
  @destination = destination
2341
3215
  end
2342
3216
  end
3217
+
3218
+ class TrialSettings < Stripe::RequestParams
3219
+ class EndBehavior < Stripe::RequestParams
3220
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3221
+ attr_accessor :prorate_up_front
3222
+
3223
+ def initialize(prorate_up_front: nil)
3224
+ @prorate_up_front = prorate_up_front
3225
+ end
3226
+ end
3227
+ # Defines how the subscription should behave when a trial ends.
3228
+ attr_accessor :end_behavior
3229
+
3230
+ def initialize(end_behavior: nil)
3231
+ @end_behavior = end_behavior
3232
+ end
3233
+ end
2343
3234
  # 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.
2344
3235
  attr_accessor :add_invoice_items
2345
3236
  # 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).
@@ -2372,6 +3263,8 @@ module Stripe
2372
3263
  attr_accessor :metadata
2373
3264
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2374
3265
  attr_accessor :on_behalf_of
3266
+ # 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).
3267
+ attr_accessor :pause_collection
2375
3268
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. 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 of the current phase.
2376
3269
  attr_accessor :proration_behavior
2377
3270
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -2380,8 +3273,12 @@ module Stripe
2380
3273
  attr_accessor :transfer_data
2381
3274
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2382
3275
  attr_accessor :trial
3276
+ # Specify trial behavior when crossing phase boundaries
3277
+ attr_accessor :trial_continuation
2383
3278
  # 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`
2384
3279
  attr_accessor :trial_end
3280
+ # Settings related to subscription trials.
3281
+ attr_accessor :trial_settings
2385
3282
 
2386
3283
  def initialize(
2387
3284
  add_invoice_items: nil,
@@ -2400,11 +3297,14 @@ module Stripe
2400
3297
  iterations: nil,
2401
3298
  metadata: nil,
2402
3299
  on_behalf_of: nil,
3300
+ pause_collection: nil,
2403
3301
  proration_behavior: nil,
2404
3302
  start_date: nil,
2405
3303
  transfer_data: nil,
2406
3304
  trial: nil,
2407
- trial_end: nil
3305
+ trial_continuation: nil,
3306
+ trial_end: nil,
3307
+ trial_settings: nil
2408
3308
  )
2409
3309
  @add_invoice_items = add_invoice_items
2410
3310
  @application_fee_percent = application_fee_percent
@@ -2422,23 +3322,95 @@ module Stripe
2422
3322
  @iterations = iterations
2423
3323
  @metadata = metadata
2424
3324
  @on_behalf_of = on_behalf_of
3325
+ @pause_collection = pause_collection
2425
3326
  @proration_behavior = proration_behavior
2426
3327
  @start_date = start_date
2427
3328
  @transfer_data = transfer_data
2428
3329
  @trial = trial
3330
+ @trial_continuation = trial_continuation
2429
3331
  @trial_end = trial_end
3332
+ @trial_settings = trial_settings
2430
3333
  end
2431
3334
  end
3335
+
3336
+ class Prebilling < Stripe::RequestParams
3337
+ class BillUntil < Stripe::RequestParams
3338
+ class AmendmentEnd < Stripe::RequestParams
3339
+ # 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.
3340
+ attr_accessor :index
3341
+
3342
+ def initialize(index: nil)
3343
+ @index = index
3344
+ end
3345
+ end
3346
+
3347
+ class Duration < Stripe::RequestParams
3348
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3349
+ attr_accessor :interval
3350
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3351
+ attr_accessor :interval_count
3352
+
3353
+ def initialize(interval: nil, interval_count: nil)
3354
+ @interval = interval
3355
+ @interval_count = interval_count
3356
+ end
3357
+ end
3358
+ # End the prebilled period when a specified amendment ends.
3359
+ attr_accessor :amendment_end
3360
+ # Time span for prebilling, starting from `bill_from`.
3361
+ attr_accessor :duration
3362
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3363
+ attr_accessor :timestamp
3364
+ # Select one of several ways to pass the `bill_until` value.
3365
+ attr_accessor :type
3366
+
3367
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
3368
+ @amendment_end = amendment_end
3369
+ @duration = duration
3370
+ @timestamp = timestamp
3371
+ @type = type
3372
+ end
3373
+ end
3374
+ # The end of the prebilled time period.
3375
+ attr_accessor :bill_until
3376
+ # This is used to determine the number of billing cycles to prebill.
3377
+ attr_accessor :iterations
3378
+
3379
+ def initialize(bill_until: nil, iterations: nil)
3380
+ @bill_until = bill_until
3381
+ @iterations = iterations
3382
+ end
3383
+ end
3384
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
3385
+ attr_accessor :amendments
3386
+ # 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.
3387
+ attr_accessor :billing_behavior
3388
+ # Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
3389
+ attr_accessor :billing_mode
2432
3390
  # 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.
2433
3391
  attr_accessor :end_behavior
2434
3392
  # 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.
2435
3393
  attr_accessor :phases
3394
+ # Provide any time periods to bill in advance.
3395
+ attr_accessor :prebilling
2436
3396
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2437
3397
  attr_accessor :proration_behavior
2438
3398
 
2439
- def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
3399
+ def initialize(
3400
+ amendments: nil,
3401
+ billing_behavior: nil,
3402
+ billing_mode: nil,
3403
+ end_behavior: nil,
3404
+ phases: nil,
3405
+ prebilling: nil,
3406
+ proration_behavior: nil
3407
+ )
3408
+ @amendments = amendments
3409
+ @billing_behavior = billing_behavior
3410
+ @billing_mode = billing_mode
2440
3411
  @end_behavior = end_behavior
2441
3412
  @phases = phases
3413
+ @prebilling = prebilling
2442
3414
  @proration_behavior = proration_behavior
2443
3415
  end
2444
3416
  end
@@ -2446,16 +3418,44 @@ module Stripe
2446
3418
  class SubscriptionDetails < Stripe::RequestParams
2447
3419
  class Item < Stripe::RequestParams
2448
3420
  class Discount < Stripe::RequestParams
3421
+ class DiscountEnd < Stripe::RequestParams
3422
+ class Duration < Stripe::RequestParams
3423
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3424
+ attr_accessor :interval
3425
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3426
+ attr_accessor :interval_count
3427
+
3428
+ def initialize(interval: nil, interval_count: nil)
3429
+ @interval = interval
3430
+ @interval_count = interval_count
3431
+ end
3432
+ end
3433
+ # Time span for the redeemed discount.
3434
+ attr_accessor :duration
3435
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3436
+ attr_accessor :timestamp
3437
+ # The type of calculation made to determine when the discount ends.
3438
+ attr_accessor :type
3439
+
3440
+ def initialize(duration: nil, timestamp: nil, type: nil)
3441
+ @duration = duration
3442
+ @timestamp = timestamp
3443
+ @type = type
3444
+ end
3445
+ end
2449
3446
  # ID of the coupon to create a new discount for.
2450
3447
  attr_accessor :coupon
2451
3448
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2452
3449
  attr_accessor :discount
3450
+ # Details to determine how long the discount should be applied for.
3451
+ attr_accessor :discount_end
2453
3452
  # ID of the promotion code to create a new discount for.
2454
3453
  attr_accessor :promotion_code
2455
3454
 
2456
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3455
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2457
3456
  @coupon = coupon
2458
3457
  @discount = discount
3458
+ @discount_end = discount_end
2459
3459
  @promotion_code = promotion_code
2460
3460
  end
2461
3461
  end
@@ -2546,8 +3546,19 @@ module Stripe
2546
3546
  @tax_rates = tax_rates
2547
3547
  end
2548
3548
  end
3549
+
3550
+ class Prebilling < Stripe::RequestParams
3551
+ # This is used to determine the number of billing cycles to prebill.
3552
+ attr_accessor :iterations
3553
+
3554
+ def initialize(iterations: nil)
3555
+ @iterations = iterations
3556
+ end
3557
+ end
2549
3558
  # 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`.
2550
3559
  attr_accessor :billing_cycle_anchor
3560
+ # Configure billing_mode in each subscription to opt in improved credit proration behavior.
3561
+ attr_accessor :billing_mode
2551
3562
  # 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.
2552
3563
  attr_accessor :cancel_at
2553
3564
  # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
@@ -2558,6 +3569,8 @@ module Stripe
2558
3569
  attr_accessor :default_tax_rates
2559
3570
  # A list of up to 20 subscription items, each with an attached price.
2560
3571
  attr_accessor :items
3572
+ # The pre-billing to apply to the subscription as a preview.
3573
+ attr_accessor :prebilling
2561
3574
  # 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`.
2562
3575
  attr_accessor :proration_behavior
2563
3576
  # 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'.
@@ -2571,11 +3584,13 @@ module Stripe
2571
3584
 
2572
3585
  def initialize(
2573
3586
  billing_cycle_anchor: nil,
3587
+ billing_mode: nil,
2574
3588
  cancel_at: nil,
2575
3589
  cancel_at_period_end: nil,
2576
3590
  cancel_now: nil,
2577
3591
  default_tax_rates: nil,
2578
3592
  items: nil,
3593
+ prebilling: nil,
2579
3594
  proration_behavior: nil,
2580
3595
  proration_date: nil,
2581
3596
  resume_at: nil,
@@ -2583,11 +3598,13 @@ module Stripe
2583
3598
  trial_end: nil
2584
3599
  )
2585
3600
  @billing_cycle_anchor = billing_cycle_anchor
3601
+ @billing_mode = billing_mode
2586
3602
  @cancel_at = cancel_at
2587
3603
  @cancel_at_period_end = cancel_at_period_end
2588
3604
  @cancel_now = cancel_now
2589
3605
  @default_tax_rates = default_tax_rates
2590
3606
  @items = items
3607
+ @prebilling = prebilling
2591
3608
  @proration_behavior = proration_behavior
2592
3609
  @proration_date = proration_date
2593
3610
  @resume_at = resume_at
@@ -2601,6 +3618,8 @@ module Stripe
2601
3618
  attr_accessor :currency
2602
3619
  # 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.
2603
3620
  attr_accessor :customer
3621
+ # 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.
3622
+ attr_accessor :customer_account
2604
3623
  # 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.
2605
3624
  attr_accessor :customer_details
2606
3625
  # 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.
@@ -2628,6 +3647,7 @@ module Stripe
2628
3647
  automatic_tax: nil,
2629
3648
  currency: nil,
2630
3649
  customer: nil,
3650
+ customer_account: nil,
2631
3651
  customer_details: nil,
2632
3652
  discounts: nil,
2633
3653
  expand: nil,
@@ -2643,6 +3663,7 @@ module Stripe
2643
3663
  @automatic_tax = automatic_tax
2644
3664
  @currency = currency
2645
3665
  @customer = customer
3666
+ @customer_account = customer_account
2646
3667
  @customer_details = customer_details
2647
3668
  @discounts = discounts
2648
3669
  @expand = expand
@@ -2668,6 +3689,29 @@ module Stripe
2668
3689
  )
2669
3690
  end
2670
3691
 
3692
+ # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
3693
+ #
3694
+ # For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
3695
+ # of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
3696
+ #
3697
+ # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
3698
+ # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3699
+ # invoice's status becomes paid.
3700
+ #
3701
+ # If the PaymentIntent's status is already succeeded when it's attached, it's
3702
+ # credited to the invoice immediately.
3703
+ #
3704
+ # See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
3705
+ def attach_payment(invoice, params = {}, opts = {})
3706
+ request(
3707
+ method: :post,
3708
+ path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
3709
+ params: params,
3710
+ opts: opts,
3711
+ base_address: :api
3712
+ )
3713
+ end
3714
+
2671
3715
  # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
2672
3716
  def create(params = {}, opts = {})
2673
3717
  request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)