stripe 15.5.0 → 15.6.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 (598) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +1670 -659
  4. data/README.md +4 -6
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_requestor.rb +32 -0
  7. data/lib/stripe/api_version.rb +1 -2
  8. data/lib/stripe/errors.rb +60 -0
  9. data/lib/stripe/event_types.rb +102 -0
  10. data/lib/stripe/events/v2_core_account_closed_event.rb +21 -0
  11. data/lib/stripe/events/v2_core_account_created_event.rb +21 -0
  12. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +23 -0
  13. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +21 -0
  14. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +23 -0
  15. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +21 -0
  16. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +23 -0
  17. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +21 -0
  18. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +23 -0
  19. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +21 -0
  20. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +21 -0
  21. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +21 -0
  22. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +21 -0
  23. data/lib/stripe/events/v2_core_account_link_returned_event.rb +13 -0
  24. data/lib/stripe/events/v2_core_account_person_created_event.rb +23 -0
  25. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +23 -0
  26. data/lib/stripe/events/v2_core_account_person_updated_event.rb +23 -0
  27. data/lib/stripe/events/v2_core_account_updated_event.rb +21 -0
  28. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +21 -0
  29. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +21 -0
  30. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +21 -0
  31. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +21 -0
  32. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +21 -0
  33. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +23 -0
  34. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +21 -0
  35. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +21 -0
  36. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +21 -0
  37. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +21 -0
  38. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +21 -0
  39. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +21 -0
  40. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +21 -0
  41. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +21 -0
  42. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +21 -0
  43. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +21 -0
  44. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +21 -0
  45. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +21 -0
  46. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +21 -0
  47. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +21 -0
  48. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +21 -0
  49. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +21 -0
  50. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +21 -0
  51. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +21 -0
  52. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +23 -0
  53. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +21 -0
  54. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +21 -0
  55. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +21 -0
  56. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +21 -0
  57. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +21 -0
  58. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +21 -0
  59. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +21 -0
  60. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +21 -0
  61. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +21 -0
  62. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +21 -0
  63. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +21 -0
  64. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +22 -0
  65. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +21 -0
  66. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +21 -0
  67. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +21 -0
  68. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +21 -0
  69. data/lib/stripe/object_types.rb +53 -0
  70. data/lib/stripe/resources/account.rb +653 -1
  71. data/lib/stripe/resources/account_notice.rb +123 -0
  72. data/lib/stripe/resources/account_session.rb +256 -1
  73. data/lib/stripe/resources/balance_settings.rb +112 -0
  74. data/lib/stripe/resources/billing/credit_balance_summary.rb +2 -0
  75. data/lib/stripe/resources/billing/credit_balance_transaction.rb +4 -0
  76. data/lib/stripe/resources/billing/credit_grant.rb +10 -0
  77. data/lib/stripe/resources/billing/meter_usage.rb +23 -0
  78. data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
  79. data/lib/stripe/resources/billing_portal/session.rb +6 -0
  80. data/lib/stripe/resources/capital/financing_offer.rb +179 -0
  81. data/lib/stripe/resources/capital/financing_summary.rb +55 -0
  82. data/lib/stripe/resources/capital/financing_transaction.rb +114 -0
  83. data/lib/stripe/resources/card.rb +2 -0
  84. data/lib/stripe/resources/cash_balance.rb +2 -0
  85. data/lib/stripe/resources/charge.rb +1540 -0
  86. data/lib/stripe/resources/checkout/session.rb +495 -4
  87. data/lib/stripe/resources/confirmation_token.rb +170 -0
  88. data/lib/stripe/resources/coupon.rb +30 -1
  89. data/lib/stripe/resources/credit_note.rb +6 -0
  90. data/lib/stripe/resources/credit_note_line_item.rb +9 -0
  91. data/lib/stripe/resources/customer.rb +2 -0
  92. data/lib/stripe/resources/customer_balance_transaction.rb +2 -0
  93. data/lib/stripe/resources/customer_cash_balance_transaction.rb +2 -0
  94. data/lib/stripe/resources/customer_session.rb +6 -1
  95. data/lib/stripe/resources/discount.rb +2 -0
  96. data/lib/stripe/resources/dispute.rb +11 -0
  97. data/lib/stripe/resources/event.rb +31 -0
  98. data/lib/stripe/resources/financial_connections/account.rb +22 -1
  99. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +27 -0
  100. data/lib/stripe/resources/financial_connections/institution.rb +92 -0
  101. data/lib/stripe/resources/financial_connections/session.rb +62 -2
  102. data/lib/stripe/resources/fx_quote.rb +186 -0
  103. data/lib/stripe/resources/identity/verification_session.rb +10 -0
  104. data/lib/stripe/resources/invoice.rb +1140 -16
  105. data/lib/stripe/resources/invoice_item.rb +78 -2
  106. data/lib/stripe/resources/invoice_line_item.rb +55 -1
  107. data/lib/stripe/resources/invoice_payment.rb +6 -1
  108. data/lib/stripe/resources/issuing/cardholder.rb +2 -1
  109. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +602 -0
  110. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +82 -0
  111. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +86 -0
  112. data/lib/stripe/resources/issuing/settlement.rb +53 -0
  113. data/lib/stripe/resources/issuing/transaction.rb +6 -0
  114. data/lib/stripe/resources/line_item.rb +37 -0
  115. data/lib/stripe/resources/mandate.rb +89 -1
  116. data/lib/stripe/resources/margin.rb +115 -0
  117. data/lib/stripe/resources/order.rb +2958 -0
  118. data/lib/stripe/resources/payment_attempt_record.rb +1181 -0
  119. data/lib/stripe/resources/payment_intent.rb +6448 -545
  120. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +72 -0
  121. data/lib/stripe/resources/payment_method.rb +194 -1
  122. data/lib/stripe/resources/payment_method_configuration.rb +295 -0
  123. data/lib/stripe/resources/payment_record.rb +1727 -0
  124. data/lib/stripe/resources/price.rb +30 -0
  125. data/lib/stripe/resources/privacy/redaction_job.rb +298 -0
  126. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +33 -0
  127. data/lib/stripe/resources/promotion_code.rb +10 -0
  128. data/lib/stripe/resources/quote.rb +2038 -7
  129. data/lib/stripe/resources/quote_line.rb +274 -0
  130. data/lib/stripe/resources/quote_preview_invoice.rb +680 -0
  131. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +395 -0
  132. data/lib/stripe/resources/refund.rb +9 -0
  133. data/lib/stripe/resources/setup_attempt.rb +24 -0
  134. data/lib/stripe/resources/setup_intent.rb +771 -9
  135. data/lib/stripe/resources/source.rb +29 -0
  136. data/lib/stripe/resources/subscription.rb +365 -9
  137. data/lib/stripe/resources/subscription_item.rb +84 -3
  138. data/lib/stripe/resources/subscription_schedule.rb +1007 -10
  139. data/lib/stripe/resources/tax/association.rb +66 -0
  140. data/lib/stripe/resources/tax/form.rb +211 -0
  141. data/lib/stripe/resources/tax_id.rb +12 -2
  142. data/lib/stripe/resources/terminal/configuration.rb +33 -0
  143. data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
  144. data/lib/stripe/resources/terminal/reader.rb +8 -0
  145. data/lib/stripe/resources/terminal/reader_collected_data.rb +31 -0
  146. data/lib/stripe/resources/transfer.rb +6 -0
  147. data/lib/stripe/resources/treasury/financial_account.rb +22 -3
  148. data/lib/stripe/resources/treasury/financial_account_features.rb +2 -0
  149. data/lib/stripe/resources/treasury/outbound_transfer.rb +37 -0
  150. data/lib/stripe/resources/treasury/received_credit.rb +38 -1
  151. data/lib/stripe/resources/treasury/received_debit.rb +40 -1
  152. data/lib/stripe/resources/v2/core/account.rb +1938 -0
  153. data/lib/stripe/resources/v2/core/account_link.rb +72 -0
  154. data/lib/stripe/resources/v2/core/person.rb +276 -0
  155. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +74 -0
  156. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +39 -0
  157. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +20 -0
  158. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +22 -0
  159. data/lib/stripe/resources/v2/money_management/adjustment.rb +51 -0
  160. data/lib/stripe/resources/v2/money_management/financial_account.rb +79 -0
  161. data/lib/stripe/resources/v2/money_management/financial_address.rb +68 -0
  162. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +94 -0
  163. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +129 -0
  164. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +82 -0
  165. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +45 -0
  166. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +117 -0
  167. data/lib/stripe/resources/v2/money_management/payout_method.rb +77 -0
  168. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +49 -0
  169. data/lib/stripe/resources/v2/money_management/received_credit.rb +122 -0
  170. data/lib/stripe/resources/v2/money_management/received_debit.rb +84 -0
  171. data/lib/stripe/resources/v2/money_management/transaction.rb +80 -0
  172. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +70 -0
  173. data/lib/stripe/resources/v2/payments/off_session_payment.rb +89 -0
  174. data/lib/stripe/resources.rb +109 -0
  175. data/lib/stripe/services/account_notice_service.rb +101 -0
  176. data/lib/stripe/services/account_service.rb +562 -1
  177. data/lib/stripe/services/account_session_service.rb +226 -1
  178. data/lib/stripe/services/balance_settings_service.rb +99 -0
  179. data/lib/stripe/services/billing/credit_balance_summary_service.rb +4 -1
  180. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +4 -0
  181. data/lib/stripe/services/billing/credit_grant_service.rb +8 -0
  182. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  183. data/lib/stripe/services/billing_portal/session_service.rb +4 -0
  184. data/lib/stripe/services/billing_service.rb +2 -1
  185. data/lib/stripe/services/capital/financing_offer_service.rb +112 -0
  186. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  187. data/lib/stripe/services/capital/financing_transaction_service.rb +79 -0
  188. data/lib/stripe/services/capital_service.rb +15 -0
  189. data/lib/stripe/services/charge_service.rb +1418 -0
  190. data/lib/stripe/services/checkout/session_service.rb +392 -4
  191. data/lib/stripe/services/coupon_service.rb +17 -1
  192. data/lib/stripe/services/credit_note_service.rb +4 -0
  193. data/lib/stripe/services/customer_session_service.rb +4 -1
  194. data/{rbi/stripe/services/account_external_account_service.rbi → lib/stripe/services/external_account_service.rb} +135 -122
  195. data/{rbi/stripe/services/tax/transaction_line_item_service.rbi → lib/stripe/services/financial_connections/account_inferred_balance_service.rb} +21 -17
  196. data/lib/stripe/services/financial_connections/account_service.rb +7 -2
  197. data/{rbi/stripe/services/climate/supplier_service.rbi → lib/stripe/services/financial_connections/institution_service.rb} +36 -25
  198. data/lib/stripe/services/financial_connections/session_service.rb +34 -2
  199. data/lib/stripe/services/financial_connections_service.rb +2 -1
  200. data/lib/stripe/services/fx_quote_service.rb +123 -0
  201. data/lib/stripe/services/identity/verification_session_service.rb +8 -0
  202. data/lib/stripe/services/invoice_item_service.rb +74 -2
  203. data/lib/stripe/services/invoice_line_item_service.rb +33 -1
  204. data/lib/stripe/services/invoice_payment_service.rb +4 -1
  205. data/lib/stripe/services/invoice_service.rb +1074 -16
  206. data/lib/stripe/services/issuing/cardholder_service.rb +2 -1
  207. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +504 -0
  208. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +66 -0
  209. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +83 -0
  210. data/lib/stripe/services/issuing/transaction_service.rb +4 -0
  211. data/lib/stripe/services/issuing_service.rb +5 -1
  212. data/lib/stripe/services/mandate_service.rb +40 -0
  213. data/lib/stripe/services/margin_service.rb +119 -0
  214. data/{rbi/stripe/services/source_transaction_service.rbi → lib/stripe/services/order_line_item_service.rb} +20 -16
  215. data/lib/stripe/services/order_service.rb +2388 -0
  216. data/lib/stripe/services/payment_attempt_record_service.rb +52 -0
  217. data/{rbi/stripe/services/quote_line_item_service.rbi → lib/stripe/services/payment_intent_amount_details_line_item_service.rb} +20 -16
  218. data/lib/stripe/services/payment_intent_service.rb +7630 -2215
  219. data/lib/stripe/services/payment_method_configuration_service.rb +210 -0
  220. data/lib/stripe/services/payment_method_service.rb +120 -1
  221. data/lib/stripe/services/payment_record_service.rb +562 -0
  222. data/lib/stripe/services/price_service.rb +19 -0
  223. data/lib/stripe/services/privacy/redaction_job_service.rb +240 -0
  224. data/{rbi/stripe/services/tax/calculation_line_item_service.rbi → lib/stripe/services/privacy/redaction_job_validation_error_service.rb} +21 -17
  225. data/lib/stripe/services/privacy_service.rb +13 -0
  226. data/lib/stripe/services/promotion_code_service.rb +8 -0
  227. data/{rbi/stripe/services/credit_note_line_item_service.rbi → lib/stripe/services/quote_line_service.rb} +20 -16
  228. data/{rbi/stripe/services/payment_link_line_item_service.rbi → lib/stripe/services/quote_preview_invoice_service.rb} +20 -16
  229. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +35 -0
  230. data/lib/stripe/services/quote_service.rb +1723 -8
  231. data/lib/stripe/services/setup_intent_service.rb +691 -9
  232. data/lib/stripe/services/subscription_item_service.rb +75 -3
  233. data/lib/stripe/services/subscription_schedule_service.rb +911 -10
  234. data/lib/stripe/services/subscription_service.rb +309 -9
  235. data/lib/stripe/services/tax/association_service.rb +31 -0
  236. data/lib/stripe/services/tax/form_service.rb +100 -0
  237. data/lib/stripe/services/tax_id_service.rb +8 -2
  238. data/lib/stripe/services/tax_service.rb +3 -1
  239. data/lib/stripe/services/terminal/configuration_service.rb +26 -0
  240. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  241. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  242. data/lib/stripe/services/terminal_service.rb +3 -1
  243. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +97 -0
  244. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +25 -1
  245. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +25 -1
  246. data/lib/stripe/services/transfer_service.rb +4 -0
  247. data/lib/stripe/services/treasury/financial_account_features_service.rb +4 -1
  248. data/lib/stripe/services/treasury/financial_account_service.rb +16 -2
  249. data/lib/stripe/services/treasury/outbound_transfer_service.rb +24 -0
  250. data/lib/stripe/services/v1_services.rb +11 -1
  251. data/lib/stripe/services/v2/core/account_link_service.rb +114 -0
  252. data/lib/stripe/services/v2/core/account_service.rb +4536 -0
  253. data/lib/stripe/services/v2/core/accounts/person_service.rb +1045 -0
  254. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +130 -0
  255. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +107 -0
  256. data/lib/stripe/services/v2/core/vault_service.rb +18 -0
  257. data/lib/stripe/services/v2/core_service.rb +4 -1
  258. data/lib/stripe/services/v2/money_management/adjustment_service.rb +74 -0
  259. data/lib/stripe/services/v2/money_management/financial_account_service.rb +119 -0
  260. data/lib/stripe/services/v2/money_management/financial_address_service.rb +82 -0
  261. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +125 -0
  262. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +95 -0
  263. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +199 -0
  264. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +235 -0
  265. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +172 -0
  266. data/lib/stripe/services/v2/money_management/payout_method_service.rb +90 -0
  267. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +32 -0
  268. data/lib/stripe/services/v2/money_management/received_credit_service.rb +70 -0
  269. data/lib/stripe/services/v2/money_management/received_debit_service.rb +43 -0
  270. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +69 -0
  271. data/lib/stripe/services/v2/money_management/transaction_service.rb +73 -0
  272. data/lib/stripe/services/v2/money_management_service.rb +31 -0
  273. data/lib/stripe/services/v2/payment_service.rb +15 -0
  274. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +152 -0
  275. data/lib/stripe/services/v2/test_helper_service.rb +15 -0
  276. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +53 -0
  277. data/lib/stripe/services/v2_services.rb +4 -1
  278. data/lib/stripe/services.rb +55 -0
  279. data/lib/stripe/stripe_configuration.rb +3 -1
  280. data/lib/stripe/stripe_object.rb +1 -1
  281. data/lib/stripe/util.rb +7 -1
  282. data/lib/stripe/version.rb +1 -1
  283. data/lib/stripe.rb +53 -0
  284. data/rbi/stripe.rbi +201354 -0
  285. data/stripe.gemspec +4 -1
  286. metadata +168 -323
  287. data/rbi/stripe/resources/account.rbi +0 -4991
  288. data/rbi/stripe/resources/account_link.rbi +0 -76
  289. data/rbi/stripe/resources/account_session.rbi +0 -1173
  290. data/rbi/stripe/resources/apple_pay_domain.rbi +0 -88
  291. data/rbi/stripe/resources/application.rbi +0 -20
  292. data/rbi/stripe/resources/application_fee.rbi +0 -118
  293. data/rbi/stripe/resources/application_fee_refund.rbi +0 -37
  294. data/rbi/stripe/resources/apps/secret.rbi +0 -195
  295. data/rbi/stripe/resources/balance.rbi +0 -230
  296. data/rbi/stripe/resources/balance_transaction.rbi +0 -147
  297. data/rbi/stripe/resources/bank_account.rbi +0 -127
  298. data/rbi/stripe/resources/billing/alert.rbi +0 -201
  299. data/rbi/stripe/resources/billing/alert_triggered.rbi +0 -28
  300. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +0 -63
  301. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +0 -147
  302. data/rbi/stripe/resources/billing/credit_grant.rbi +0 -291
  303. data/rbi/stripe/resources/billing/meter.rbi +0 -226
  304. data/rbi/stripe/resources/billing/meter_event.rbi +0 -64
  305. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +0 -64
  306. data/rbi/stripe/resources/billing/meter_event_summary.rbi +0 -35
  307. data/rbi/stripe/resources/billing_portal/configuration.rbi +0 -712
  308. data/rbi/stripe/resources/billing_portal/session.rbi +0 -345
  309. data/rbi/stripe/resources/capability.rbi +0 -125
  310. data/rbi/stripe/resources/card.rbi +0 -125
  311. data/rbi/stripe/resources/cash_balance.rbi +0 -32
  312. data/rbi/stripe/resources/charge.rbi +0 -2136
  313. data/rbi/stripe/resources/checkout/session.rbi +0 -4105
  314. data/rbi/stripe/resources/climate/order.rbi +0 -245
  315. data/rbi/stripe/resources/climate/product.rbi +0 -75
  316. data/rbi/stripe/resources/climate/supplier.rbi +0 -72
  317. data/rbi/stripe/resources/confirmation_token.rbi +0 -1818
  318. data/rbi/stripe/resources/connect_collection_transfer.rbi +0 -26
  319. data/rbi/stripe/resources/country_spec.rbi +0 -85
  320. data/rbi/stripe/resources/coupon.rbi +0 -250
  321. data/rbi/stripe/resources/credit_note.rbi +0 -752
  322. data/rbi/stripe/resources/credit_note_line_item.rbi +0 -101
  323. data/rbi/stripe/resources/customer.rbi +0 -993
  324. data/rbi/stripe/resources/customer_balance_transaction.rbi +0 -56
  325. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +0 -151
  326. data/rbi/stripe/resources/customer_session.rbi +0 -200
  327. data/rbi/stripe/resources/discount.rbi +0 -53
  328. data/rbi/stripe/resources/dispute.rbi +0 -761
  329. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +0 -58
  330. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +0 -23
  331. data/rbi/stripe/resources/entitlements/feature.rbi +0 -117
  332. data/rbi/stripe/resources/ephemeral_key.rbi +0 -44
  333. data/rbi/stripe/resources/event.rbi +0 -137
  334. data/rbi/stripe/resources/exchange_rate.rbi +0 -66
  335. data/rbi/stripe/resources/file.rbi +0 -143
  336. data/rbi/stripe/resources/file_link.rbi +0 -141
  337. data/rbi/stripe/resources/financial_connections/account.rbi +0 -339
  338. data/rbi/stripe/resources/financial_connections/account_owner.rbi +0 -35
  339. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +0 -23
  340. data/rbi/stripe/resources/financial_connections/session.rbi +0 -123
  341. data/rbi/stripe/resources/financial_connections/transaction.rbi +0 -124
  342. data/rbi/stripe/resources/forwarding/request.rbi +0 -216
  343. data/rbi/stripe/resources/funding_instructions.rbi +0 -437
  344. data/rbi/stripe/resources/identity/verification_report.rbi +0 -360
  345. data/rbi/stripe/resources/identity/verification_session.rbi +0 -564
  346. data/rbi/stripe/resources/invoice.rbi +0 -3894
  347. data/rbi/stripe/resources/invoice_item.rbi +0 -470
  348. data/rbi/stripe/resources/invoice_line_item.rbi +0 -432
  349. data/rbi/stripe/resources/invoice_payment.rbi +0 -121
  350. data/rbi/stripe/resources/invoice_rendering_template.rbi +0 -104
  351. data/rbi/stripe/resources/issuing/authorization.rbi +0 -1283
  352. data/rbi/stripe/resources/issuing/card.rbi +0 -749
  353. data/rbi/stripe/resources/issuing/cardholder.rbi +0 -744
  354. data/rbi/stripe/resources/issuing/dispute.rbi +0 -913
  355. data/rbi/stripe/resources/issuing/personalization_design.rbi +0 -338
  356. data/rbi/stripe/resources/issuing/physical_bundle.rbi +0 -79
  357. data/rbi/stripe/resources/issuing/token.rbi +0 -226
  358. data/rbi/stripe/resources/issuing/transaction.rbi +0 -1061
  359. data/rbi/stripe/resources/line_item.rbi +0 -72
  360. data/rbi/stripe/resources/login_link.rbi +0 -19
  361. data/rbi/stripe/resources/mandate.rbi +0 -191
  362. data/rbi/stripe/resources/payment_intent.rbi +0 -10011
  363. data/rbi/stripe/resources/payment_link.rbi +0 -1891
  364. data/rbi/stripe/resources/payment_method.rbi +0 -1770
  365. data/rbi/stripe/resources/payment_method_configuration.rbi +0 -3550
  366. data/rbi/stripe/resources/payment_method_domain.rbi +0 -228
  367. data/rbi/stripe/resources/payout.rbi +0 -307
  368. data/rbi/stripe/resources/person.rbi +0 -401
  369. data/rbi/stripe/resources/plan.rbi +0 -371
  370. data/rbi/stripe/resources/price.rbi +0 -694
  371. data/rbi/stripe/resources/product.rbi +0 -553
  372. data/rbi/stripe/resources/product_feature.rbi +0 -26
  373. data/rbi/stripe/resources/promotion_code.rbi +0 -264
  374. data/rbi/stripe/resources/quote.rbi +0 -1137
  375. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +0 -98
  376. data/rbi/stripe/resources/radar/value_list.rbi +0 -168
  377. data/rbi/stripe/resources/radar/value_list_item.rbi +0 -129
  378. data/rbi/stripe/resources/refund.rbi +0 -523
  379. data/rbi/stripe/resources/reporting/report_run.rbi +0 -191
  380. data/rbi/stripe/resources/reporting/report_type.rbi +0 -57
  381. data/rbi/stripe/resources/reserve_transaction.rbi +0 -23
  382. data/rbi/stripe/resources/reversal.rbi +0 -51
  383. data/rbi/stripe/resources/review.rbi +0 -154
  384. data/rbi/stripe/resources/setup_attempt.rbi +0 -477
  385. data/rbi/stripe/resources/setup_intent.rbi +0 -3974
  386. data/rbi/stripe/resources/shipping_rate.rbi +0 -305
  387. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +0 -75
  388. data/rbi/stripe/resources/source.rbi +0 -1496
  389. data/rbi/stripe/resources/source_mandate_notification.rbi +0 -77
  390. data/rbi/stripe/resources/source_transaction.rbi +0 -127
  391. data/rbi/stripe/resources/subscription.rbi +0 -2154
  392. data/rbi/stripe/resources/subscription_item.rbi +0 -404
  393. data/rbi/stripe/resources/subscription_schedule.rbi +0 -1795
  394. data/rbi/stripe/resources/tax/calculation.rbi +0 -478
  395. data/rbi/stripe/resources/tax/calculation_line_item.rbi +0 -91
  396. data/rbi/stripe/resources/tax/registration.rbi +0 -3216
  397. data/rbi/stripe/resources/tax/settings.rbi +0 -141
  398. data/rbi/stripe/resources/tax/transaction.rbi +0 -351
  399. data/rbi/stripe/resources/tax/transaction_line_item.rbi +0 -54
  400. data/rbi/stripe/resources/tax_code.rbi +0 -44
  401. data/rbi/stripe/resources/tax_deducted_at_source.rbi +0 -23
  402. data/rbi/stripe/resources/tax_id.rbi +0 -165
  403. data/rbi/stripe/resources/tax_rate.rbi +0 -239
  404. data/rbi/stripe/resources/terminal/configuration.rbi +0 -1647
  405. data/rbi/stripe/resources/terminal/connection_token.rbi +0 -37
  406. data/rbi/stripe/resources/terminal/location.rbi +0 -222
  407. data/rbi/stripe/resources/terminal/reader.rbi +0 -1016
  408. data/rbi/stripe/resources/test_helpers/test_clock.rbi +0 -132
  409. data/rbi/stripe/resources/token.rbi +0 -1281
  410. data/rbi/stripe/resources/topup.rbi +0 -222
  411. data/rbi/stripe/resources/transfer.rbi +0 -199
  412. data/rbi/stripe/resources/treasury/credit_reversal.rbi +0 -119
  413. data/rbi/stripe/resources/treasury/debit_reversal.rbi +0 -131
  414. data/rbi/stripe/resources/treasury/financial_account.rbi +0 -869
  415. data/rbi/stripe/resources/treasury/financial_account_features.rbi +0 -260
  416. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +0 -295
  417. data/rbi/stripe/resources/treasury/outbound_payment.rbi +0 -592
  418. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +0 -431
  419. data/rbi/stripe/resources/treasury/received_credit.rbi +0 -302
  420. data/rbi/stripe/resources/treasury/received_debit.rbi +0 -256
  421. data/rbi/stripe/resources/treasury/transaction.rbi +0 -215
  422. data/rbi/stripe/resources/treasury/transaction_entry.rbi +0 -192
  423. data/rbi/stripe/resources/v2/amount.rbi +0 -14
  424. data/rbi/stripe/resources/v2/billing/meter_event.rbi +0 -37
  425. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +0 -41
  426. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +0 -31
  427. data/rbi/stripe/resources/v2/event.rbi +0 -48
  428. data/rbi/stripe/resources/v2/event_destination.rbi +0 -91
  429. data/rbi/stripe/resources/webhook_endpoint.rbi +0 -168
  430. data/rbi/stripe/services/account_capability_service.rbi +0 -51
  431. data/rbi/stripe/services/account_link_service.rbi +0 -60
  432. data/rbi/stripe/services/account_login_link_service.rbi +0 -22
  433. data/rbi/stripe/services/account_person_service.rbi +0 -1007
  434. data/rbi/stripe/services/account_service.rbi +0 -4281
  435. data/rbi/stripe/services/account_session_service.rbi +0 -748
  436. data/rbi/stripe/services/apple_pay_domain_service.rbi +0 -76
  437. data/rbi/stripe/services/application_fee_refund_service.rbi +0 -93
  438. data/rbi/stripe/services/application_fee_service.rbi +0 -78
  439. data/rbi/stripe/services/apps/secret_service.rbi +0 -151
  440. data/rbi/stripe/services/apps_service.rbi +0 -9
  441. data/rbi/stripe/services/balance_service.rbi +0 -21
  442. data/rbi/stripe/services/balance_transaction_service.rbi +0 -93
  443. data/rbi/stripe/services/billing/alert_service.rbi +0 -152
  444. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +0 -68
  445. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +0 -59
  446. data/rbi/stripe/services/billing/credit_grant_service.rbi +0 -211
  447. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +0 -42
  448. data/rbi/stripe/services/billing/meter_event_service.rbi +0 -42
  449. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +0 -54
  450. data/rbi/stripe/services/billing/meter_service.rbi +0 -163
  451. data/rbi/stripe/services/billing_portal/configuration_service.rbi +0 -561
  452. data/rbi/stripe/services/billing_portal/session_service.rbi +0 -204
  453. data/rbi/stripe/services/billing_portal_service.rbi +0 -10
  454. data/rbi/stripe/services/billing_service.rbi +0 -15
  455. data/rbi/stripe/services/charge_service.rbi +0 -448
  456. data/rbi/stripe/services/checkout/session_line_item_service.rbi +0 -33
  457. data/rbi/stripe/services/checkout/session_service.rbi +0 -2697
  458. data/rbi/stripe/services/checkout_service.rbi +0 -9
  459. data/rbi/stripe/services/climate/order_service.rbi +0 -142
  460. data/rbi/stripe/services/climate/product_service.rbi +0 -46
  461. data/rbi/stripe/services/climate_service.rbi +0 -11
  462. data/rbi/stripe/services/confirmation_token_service.rbi +0 -20
  463. data/rbi/stripe/services/country_spec_service.rbi +0 -44
  464. data/rbi/stripe/services/coupon_service.rbi +0 -194
  465. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +0 -167
  466. data/rbi/stripe/services/credit_note_service.rbi +0 -415
  467. data/rbi/stripe/services/customer_balance_transaction_service.rbi +0 -92
  468. data/rbi/stripe/services/customer_cash_balance_service.rbi +0 -45
  469. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +0 -44
  470. data/rbi/stripe/services/customer_funding_instructions_service.rbi +0 -59
  471. data/rbi/stripe/services/customer_payment_method_service.rbi +0 -57
  472. data/rbi/stripe/services/customer_payment_source_service.rbi +0 -232
  473. data/rbi/stripe/services/customer_service.rbi +0 -635
  474. data/rbi/stripe/services/customer_session_service.rbi +0 -116
  475. data/rbi/stripe/services/customer_tax_id_service.rbi +0 -70
  476. data/rbi/stripe/services/dispute_service.rbi +0 -424
  477. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +0 -55
  478. data/rbi/stripe/services/entitlements/feature_service.rbi +0 -107
  479. data/rbi/stripe/services/entitlements_service.rbi +0 -10
  480. data/rbi/stripe/services/ephemeral_key_service.rbi +0 -53
  481. data/rbi/stripe/services/event_service.rbi +0 -83
  482. data/rbi/stripe/services/exchange_rate_service.rbi +0 -44
  483. data/rbi/stripe/services/file_link_service.rbi +0 -124
  484. data/rbi/stripe/services/file_service.rbi +0 -116
  485. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +0 -42
  486. data/rbi/stripe/services/financial_connections/account_service.rbi +0 -133
  487. data/rbi/stripe/services/financial_connections/session_service.rbi +0 -88
  488. data/rbi/stripe/services/financial_connections/transaction_service.rbi +0 -92
  489. data/rbi/stripe/services/financial_connections_service.rbi +0 -11
  490. data/rbi/stripe/services/forwarding/request_service.rbi +0 -134
  491. data/rbi/stripe/services/forwarding_service.rbi +0 -9
  492. data/rbi/stripe/services/identity/verification_report_service.rbi +0 -87
  493. data/rbi/stripe/services/identity/verification_session_service.rbi +0 -339
  494. data/rbi/stripe/services/identity_service.rbi +0 -10
  495. data/rbi/stripe/services/invoice_item_service.rbi +0 -366
  496. data/rbi/stripe/services/invoice_line_item_service.rbi +0 -259
  497. data/rbi/stripe/services/invoice_payment_service.rbi +0 -71
  498. data/rbi/stripe/services/invoice_rendering_template_service.rbi +0 -82
  499. data/rbi/stripe/services/invoice_service.rbi +0 -3073
  500. data/rbi/stripe/services/issuing/authorization_service.rbi +0 -146
  501. data/rbi/stripe/services/issuing/card_service.rbi +0 -503
  502. data/rbi/stripe/services/issuing/cardholder_service.rbi +0 -587
  503. data/rbi/stripe/services/issuing/dispute_service.rbi +0 -707
  504. data/rbi/stripe/services/issuing/personalization_design_service.rbi +0 -243
  505. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +0 -59
  506. data/rbi/stripe/services/issuing/token_service.rbi +0 -99
  507. data/rbi/stripe/services/issuing/transaction_service.rbi +0 -105
  508. data/rbi/stripe/services/issuing_service.rbi +0 -16
  509. data/rbi/stripe/services/mandate_service.rbi +0 -20
  510. data/rbi/stripe/services/payment_intent_service.rbi +0 -8010
  511. data/rbi/stripe/services/payment_link_service.rbi +0 -1441
  512. data/rbi/stripe/services/payment_method_configuration_service.rbi +0 -2487
  513. data/rbi/stripe/services/payment_method_domain_service.rbi +0 -112
  514. data/rbi/stripe/services/payment_method_service.rbi +0 -781
  515. data/rbi/stripe/services/payout_service.rbi +0 -209
  516. data/rbi/stripe/services/plan_service.rbi +0 -282
  517. data/rbi/stripe/services/price_service.rbi +0 -546
  518. data/rbi/stripe/services/product_feature_service.rbi +0 -67
  519. data/rbi/stripe/services/product_service.rbi +0 -477
  520. data/rbi/stripe/services/promotion_code_service.rbi +0 -214
  521. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +0 -31
  522. data/rbi/stripe/services/quote_service.rbi +0 -695
  523. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +0 -85
  524. data/rbi/stripe/services/radar/value_list_item_service.rbi +0 -109
  525. data/rbi/stripe/services/radar/value_list_service.rbi +0 -141
  526. data/rbi/stripe/services/radar_service.rbi +0 -11
  527. data/rbi/stripe/services/refund_service.rbi +0 -185
  528. data/rbi/stripe/services/reporting/report_run_service.rbi +0 -135
  529. data/rbi/stripe/services/reporting/report_type_service.rbi +0 -35
  530. data/rbi/stripe/services/reporting_service.rbi +0 -10
  531. data/rbi/stripe/services/review_service.rbi +0 -84
  532. data/rbi/stripe/services/setup_attempt_service.rbi +0 -65
  533. data/rbi/stripe/services/setup_intent_service.rbi +0 -3709
  534. data/rbi/stripe/services/shipping_rate_service.rbi +0 -241
  535. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +0 -46
  536. data/rbi/stripe/services/sigma_service.rbi +0 -9
  537. data/rbi/stripe/services/source_service.rbi +0 -663
  538. data/rbi/stripe/services/subscription_item_service.rbi +0 -350
  539. data/rbi/stripe/services/subscription_schedule_service.rbi +0 -1425
  540. data/rbi/stripe/services/subscription_service.rbi +0 -1768
  541. data/rbi/stripe/services/tax/calculation_service.rbi +0 -234
  542. data/rbi/stripe/services/tax/registration_service.rbi +0 -2278
  543. data/rbi/stripe/services/tax/settings_service.rbi +0 -93
  544. data/rbi/stripe/services/tax/transaction_service.rbi +0 -146
  545. data/rbi/stripe/services/tax_code_service.rbi +0 -44
  546. data/rbi/stripe/services/tax_id_service.rbi +0 -110
  547. data/rbi/stripe/services/tax_rate_service.rbi +0 -185
  548. data/rbi/stripe/services/tax_service.rbi +0 -12
  549. data/rbi/stripe/services/terminal/configuration_service.rbi +0 -1328
  550. data/rbi/stripe/services/terminal/connection_token_service.rbi +0 -25
  551. data/rbi/stripe/services/terminal/location_service.rbi +0 -182
  552. data/rbi/stripe/services/terminal/reader_service.rbi +0 -540
  553. data/rbi/stripe/services/terminal_service.rbi +0 -12
  554. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +0 -746
  555. data/rbi/stripe/services/test_helpers/customer_service.rbi +0 -33
  556. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +0 -848
  557. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +0 -76
  558. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +0 -69
  559. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +0 -711
  560. data/rbi/stripe/services/test_helpers/issuing_service.rbi +0 -14
  561. data/rbi/stripe/services/test_helpers/refund_service.rbi +0 -22
  562. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +0 -117
  563. data/rbi/stripe/services/test_helpers/terminal_service.rbi +0 -11
  564. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +0 -90
  565. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +0 -64
  566. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +0 -125
  567. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +0 -125
  568. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +0 -87
  569. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +0 -87
  570. data/rbi/stripe/services/test_helpers/treasury_service.rbi +0 -15
  571. data/rbi/stripe/services/test_helpers_service.rbi +0 -15
  572. data/rbi/stripe/services/token_service.rbi +0 -1255
  573. data/rbi/stripe/services/topup_service.rbi +0 -176
  574. data/rbi/stripe/services/transfer_reversal_service.rbi +0 -101
  575. data/rbi/stripe/services/transfer_service.rbi +0 -152
  576. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +0 -84
  577. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +0 -88
  578. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +0 -198
  579. data/rbi/stripe/services/treasury/financial_account_service.rbi +0 -566
  580. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +0 -117
  581. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +0 -304
  582. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +0 -157
  583. data/rbi/stripe/services/treasury/received_credit_service.rbi +0 -72
  584. data/rbi/stripe/services/treasury/received_debit_service.rbi +0 -59
  585. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +0 -111
  586. data/rbi/stripe/services/treasury/transaction_service.rbi +0 -122
  587. data/rbi/stripe/services/treasury_service.rbi +0 -18
  588. data/rbi/stripe/services/v1_services.rbi +0 -77
  589. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +0 -39
  590. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +0 -42
  591. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +0 -18
  592. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +0 -55
  593. data/rbi/stripe/services/v2/billing_service.rbi +0 -14
  594. data/rbi/stripe/services/v2/core/event_destination_service.rbi +0 -192
  595. data/rbi/stripe/services/v2/core/event_service.rbi +0 -36
  596. data/rbi/stripe/services/v2/core_service.rbi +0 -12
  597. data/rbi/stripe/services/v2_services.rbi +0 -10
  598. data/rbi/stripe/services/webhook_endpoint_service.rbi +0 -129
@@ -49,6 +49,25 @@ module Stripe
49
49
 
50
50
  nested_resource_class_methods :line, operations: %i[list]
51
51
 
52
+ class AmountsDue < Stripe::StripeObject
53
+ # Incremental amount due for this payment in cents (or local equivalent).
54
+ attr_reader :amount
55
+ # The amount in cents (or local equivalent) that was paid for this payment.
56
+ attr_reader :amount_paid
57
+ # The difference between the payment’s amount and amount_paid, in cents (or local equivalent).
58
+ attr_reader :amount_remaining
59
+ # Number of days from when invoice is finalized until the payment is due.
60
+ attr_reader :days_until_due
61
+ # An arbitrary string attached to the object. Often useful for displaying to users.
62
+ attr_reader :description
63
+ # Date on which a payment plan’s payment is due.
64
+ attr_reader :due_date
65
+ # Timestamp when the payment was paid.
66
+ attr_reader :paid_at
67
+ # The status of the payment, one of `open`, `paid`, or `past_due`
68
+ attr_reader :status
69
+ end
70
+
52
71
  class AutomaticTax < Stripe::StripeObject
53
72
  class Liability < Stripe::StripeObject
54
73
  # The connected account being referenced when `type` is `account`.
@@ -221,9 +240,17 @@ module Stripe
221
240
  end
222
241
 
223
242
  class SubscriptionDetails < Stripe::StripeObject
243
+ class PauseCollection < Stripe::StripeObject
244
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
245
+ attr_reader :behavior
246
+ # The time after which the subscription will resume collecting payments.
247
+ attr_reader :resumes_at
248
+ end
224
249
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization.
225
250
  # *Note: This attribute is populated only for invoices created on or after June 29, 2023.*
226
251
  attr_reader :metadata
252
+ # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
253
+ attr_reader :pause_collection
227
254
  # The subscription that generated this invoice
228
255
  attr_reader :subscription
229
256
  # Only set for upcoming invoices that preview prorations. The time used to calculate prorations.
@@ -283,14 +310,32 @@ module Stripe
283
310
  attr_reader :funding_type
284
311
  end
285
312
 
313
+ class IdBankTransfer < Stripe::StripeObject; end
286
314
  class Konbini < Stripe::StripeObject; end
287
315
  class SepaDebit < Stripe::StripeObject; end
288
316
 
317
+ class Upi < Stripe::StripeObject
318
+ class MandateOptions < Stripe::StripeObject
319
+ # Amount to be charged for future payments.
320
+ attr_reader :amount
321
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
322
+ attr_reader :amount_type
323
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
324
+ attr_reader :description
325
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
326
+ attr_reader :end_date
327
+ end
328
+ # Attribute for field mandate_options
329
+ attr_reader :mandate_options
330
+ end
331
+
289
332
  class UsBankAccount < Stripe::StripeObject
290
333
  class FinancialConnections < Stripe::StripeObject
291
334
  class Filters < Stripe::StripeObject
292
335
  # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
293
336
  attr_reader :account_subcategories
337
+ # The institution to use to filter for possible accounts to link.
338
+ attr_reader :institution
294
339
  end
295
340
  # Attribute for field filters
296
341
  attr_reader :filters
@@ -312,10 +357,14 @@ module Stripe
312
357
  attr_reader :card
313
358
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
314
359
  attr_reader :customer_balance
360
+ # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
361
+ attr_reader :id_bank_transfer
315
362
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
316
363
  attr_reader :konbini
317
364
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
318
365
  attr_reader :sepa_debit
366
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
367
+ attr_reader :upi
319
368
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
320
369
  attr_reader :us_bank_account
321
370
  end
@@ -425,6 +474,13 @@ module Stripe
425
474
  attr_reader :discount
426
475
  end
427
476
 
477
+ class TotalMarginAmount < Stripe::StripeObject
478
+ # The amount, in cents (or local equivalent), of the reduction in line item amount.
479
+ attr_reader :amount
480
+ # The margin that was applied to get this margin amount.
481
+ attr_reader :margin
482
+ end
483
+
428
484
  class TotalPretaxCreditAmount < Stripe::StripeObject
429
485
  # The amount, in cents (or local equivalent), of the pretax credit amount.
430
486
  attr_reader :amount
@@ -432,6 +488,8 @@ module Stripe
432
488
  attr_reader :credit_balance_transaction
433
489
  # The discount that was applied to get this pretax credit amount.
434
490
  attr_reader :discount
491
+ # The margin that was applied to get this pretax credit amount.
492
+ attr_reader :margin
435
493
  # Type of the pretax credit amount referenced.
436
494
  attr_reader :type
437
495
  end
@@ -458,6 +516,24 @@ module Stripe
458
516
  class DeleteParams < Stripe::RequestParams; end
459
517
 
460
518
  class UpdateParams < Stripe::RequestParams
519
+ class AmountsDue < Stripe::RequestParams
520
+ # The amount in cents (or local equivalent).
521
+ attr_accessor :amount
522
+ # Number of days from when invoice is finalized until the payment is due.
523
+ attr_accessor :days_until_due
524
+ # An arbitrary string attached to the object. Often useful for displaying to users.
525
+ attr_accessor :description
526
+ # Date on which a payment plan’s payment is due.
527
+ attr_accessor :due_date
528
+
529
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
530
+ @amount = amount
531
+ @days_until_due = days_until_due
532
+ @description = description
533
+ @due_date = due_date
534
+ end
535
+ end
536
+
461
537
  class AutomaticTax < Stripe::RequestParams
462
538
  class Liability < Stripe::RequestParams
463
539
  # The connected account being referenced when `type` is `account`.
@@ -494,16 +570,44 @@ module Stripe
494
570
  end
495
571
 
496
572
  class Discount < Stripe::RequestParams
573
+ class DiscountEnd < Stripe::RequestParams
574
+ class Duration < Stripe::RequestParams
575
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
576
+ attr_accessor :interval
577
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
578
+ attr_accessor :interval_count
579
+
580
+ def initialize(interval: nil, interval_count: nil)
581
+ @interval = interval
582
+ @interval_count = interval_count
583
+ end
584
+ end
585
+ # Time span for the redeemed discount.
586
+ attr_accessor :duration
587
+ # A precise Unix timestamp for the discount to end. Must be in the future.
588
+ attr_accessor :timestamp
589
+ # The type of calculation made to determine when the discount ends.
590
+ attr_accessor :type
591
+
592
+ def initialize(duration: nil, timestamp: nil, type: nil)
593
+ @duration = duration
594
+ @timestamp = timestamp
595
+ @type = type
596
+ end
597
+ end
497
598
  # ID of the coupon to create a new discount for.
498
599
  attr_accessor :coupon
499
600
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
500
601
  attr_accessor :discount
602
+ # Details to determine how long the discount should be applied for.
603
+ attr_accessor :discount_end
501
604
  # ID of the promotion code to create a new discount for.
502
605
  attr_accessor :promotion_code
503
606
 
504
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
607
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
505
608
  @coupon = coupon
506
609
  @discount = discount
610
+ @discount_end = discount_end
507
611
  @promotion_code = promotion_code
508
612
  end
509
613
  end
@@ -623,17 +727,47 @@ module Stripe
623
727
  end
624
728
  end
625
729
 
730
+ class IdBankTransfer < Stripe::RequestParams; end
626
731
  class Konbini < Stripe::RequestParams; end
627
732
  class SepaDebit < Stripe::RequestParams; end
628
733
 
734
+ class Upi < Stripe::RequestParams
735
+ class MandateOptions < Stripe::RequestParams
736
+ # Amount to be charged for future payments.
737
+ attr_accessor :amount
738
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
739
+ attr_accessor :amount_type
740
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
741
+ attr_accessor :description
742
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
743
+ attr_accessor :end_date
744
+
745
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
746
+ @amount = amount
747
+ @amount_type = amount_type
748
+ @description = description
749
+ @end_date = end_date
750
+ end
751
+ end
752
+ # Configuration options for setting up an eMandate
753
+ attr_accessor :mandate_options
754
+
755
+ def initialize(mandate_options: nil)
756
+ @mandate_options = mandate_options
757
+ end
758
+ end
759
+
629
760
  class UsBankAccount < Stripe::RequestParams
630
761
  class FinancialConnections < Stripe::RequestParams
631
762
  class Filters < Stripe::RequestParams
632
763
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
633
764
  attr_accessor :account_subcategories
765
+ # ID of the institution to use to filter for selectable accounts.
766
+ attr_accessor :institution
634
767
 
635
- def initialize(account_subcategories: nil)
768
+ def initialize(account_subcategories: nil, institution: nil)
636
769
  @account_subcategories = account_subcategories
770
+ @institution = institution
637
771
  end
638
772
  end
639
773
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -667,10 +801,14 @@ module Stripe
667
801
  attr_accessor :card
668
802
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
669
803
  attr_accessor :customer_balance
804
+ # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
805
+ attr_accessor :id_bank_transfer
670
806
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
671
807
  attr_accessor :konbini
672
808
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
673
809
  attr_accessor :sepa_debit
810
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
811
+ attr_accessor :upi
674
812
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
675
813
  attr_accessor :us_bank_account
676
814
 
@@ -679,16 +817,20 @@ module Stripe
679
817
  bancontact: nil,
680
818
  card: nil,
681
819
  customer_balance: nil,
820
+ id_bank_transfer: nil,
682
821
  konbini: nil,
683
822
  sepa_debit: nil,
823
+ upi: nil,
684
824
  us_bank_account: nil
685
825
  )
686
826
  @acss_debit = acss_debit
687
827
  @bancontact = bancontact
688
828
  @card = card
689
829
  @customer_balance = customer_balance
830
+ @id_bank_transfer = id_bank_transfer
690
831
  @konbini = konbini
691
832
  @sepa_debit = sepa_debit
833
+ @upi = upi
692
834
  @us_bank_account = us_bank_account
693
835
  end
694
836
  end
@@ -898,6 +1040,8 @@ module Stripe
898
1040
  end
899
1041
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
900
1042
  attr_accessor :account_tax_ids
1043
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1044
+ attr_accessor :amounts_due
901
1045
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
902
1046
  attr_accessor :application_fee_amount
903
1047
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -912,6 +1056,8 @@ module Stripe
912
1056
  attr_accessor :custom_fields
913
1057
  # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
914
1058
  attr_accessor :days_until_due
1059
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1060
+ attr_accessor :default_margins
915
1061
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
916
1062
  attr_accessor :default_payment_method
917
1063
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -953,6 +1099,7 @@ module Stripe
953
1099
 
954
1100
  def initialize(
955
1101
  account_tax_ids: nil,
1102
+ amounts_due: nil,
956
1103
  application_fee_amount: nil,
957
1104
  auto_advance: nil,
958
1105
  automatic_tax: nil,
@@ -960,6 +1107,7 @@ module Stripe
960
1107
  collection_method: nil,
961
1108
  custom_fields: nil,
962
1109
  days_until_due: nil,
1110
+ default_margins: nil,
963
1111
  default_payment_method: nil,
964
1112
  default_source: nil,
965
1113
  default_tax_rates: nil,
@@ -981,6 +1129,7 @@ module Stripe
981
1129
  transfer_data: nil
982
1130
  )
983
1131
  @account_tax_ids = account_tax_ids
1132
+ @amounts_due = amounts_due
984
1133
  @application_fee_amount = application_fee_amount
985
1134
  @auto_advance = auto_advance
986
1135
  @automatic_tax = automatic_tax
@@ -988,6 +1137,7 @@ module Stripe
988
1137
  @collection_method = collection_method
989
1138
  @custom_fields = custom_fields
990
1139
  @days_until_due = days_until_due
1140
+ @default_margins = default_margins
991
1141
  @default_payment_method = default_payment_method
992
1142
  @default_source = default_source
993
1143
  @default_tax_rates = default_tax_rates
@@ -1052,6 +1202,8 @@ module Stripe
1052
1202
  attr_accessor :created
1053
1203
  # Only return invoices for the customer specified by this customer ID.
1054
1204
  attr_accessor :customer
1205
+ # Only return invoices for the account specified by this account ID.
1206
+ attr_accessor :customer_account
1055
1207
  # Attribute for param field due_date
1056
1208
  attr_accessor :due_date
1057
1209
  # A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
@@ -1071,6 +1223,7 @@ module Stripe
1071
1223
  collection_method: nil,
1072
1224
  created: nil,
1073
1225
  customer: nil,
1226
+ customer_account: nil,
1074
1227
  due_date: nil,
1075
1228
  ending_before: nil,
1076
1229
  expand: nil,
@@ -1082,6 +1235,7 @@ module Stripe
1082
1235
  @collection_method = collection_method
1083
1236
  @created = created
1084
1237
  @customer = customer
1238
+ @customer_account = customer_account
1085
1239
  @due_date = due_date
1086
1240
  @ending_before = ending_before
1087
1241
  @expand = expand
@@ -1093,6 +1247,24 @@ module Stripe
1093
1247
  end
1094
1248
 
1095
1249
  class CreateParams < Stripe::RequestParams
1250
+ class AmountsDue < Stripe::RequestParams
1251
+ # The amount in cents (or local equivalent).
1252
+ attr_accessor :amount
1253
+ # Number of days from when invoice is finalized until the payment is due.
1254
+ attr_accessor :days_until_due
1255
+ # An arbitrary string attached to the object. Often useful for displaying to users.
1256
+ attr_accessor :description
1257
+ # Date on which a payment plan’s payment is due.
1258
+ attr_accessor :due_date
1259
+
1260
+ def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
1261
+ @amount = amount
1262
+ @days_until_due = days_until_due
1263
+ @description = description
1264
+ @due_date = due_date
1265
+ end
1266
+ end
1267
+
1096
1268
  class AutomaticTax < Stripe::RequestParams
1097
1269
  class Liability < Stripe::RequestParams
1098
1270
  # The connected account being referenced when `type` is `account`.
@@ -1129,16 +1301,44 @@ module Stripe
1129
1301
  end
1130
1302
 
1131
1303
  class Discount < Stripe::RequestParams
1304
+ class DiscountEnd < Stripe::RequestParams
1305
+ class Duration < Stripe::RequestParams
1306
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1307
+ attr_accessor :interval
1308
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1309
+ attr_accessor :interval_count
1310
+
1311
+ def initialize(interval: nil, interval_count: nil)
1312
+ @interval = interval
1313
+ @interval_count = interval_count
1314
+ end
1315
+ end
1316
+ # Time span for the redeemed discount.
1317
+ attr_accessor :duration
1318
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1319
+ attr_accessor :timestamp
1320
+ # The type of calculation made to determine when the discount ends.
1321
+ attr_accessor :type
1322
+
1323
+ def initialize(duration: nil, timestamp: nil, type: nil)
1324
+ @duration = duration
1325
+ @timestamp = timestamp
1326
+ @type = type
1327
+ end
1328
+ end
1132
1329
  # ID of the coupon to create a new discount for.
1133
1330
  attr_accessor :coupon
1134
1331
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1135
1332
  attr_accessor :discount
1333
+ # Details to determine how long the discount should be applied for.
1334
+ attr_accessor :discount_end
1136
1335
  # ID of the promotion code to create a new discount for.
1137
1336
  attr_accessor :promotion_code
1138
1337
 
1139
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1338
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1140
1339
  @coupon = coupon
1141
1340
  @discount = discount
1341
+ @discount_end = discount_end
1142
1342
  @promotion_code = promotion_code
1143
1343
  end
1144
1344
  end
@@ -1270,17 +1470,47 @@ module Stripe
1270
1470
  end
1271
1471
  end
1272
1472
 
1473
+ class IdBankTransfer < Stripe::RequestParams; end
1273
1474
  class Konbini < Stripe::RequestParams; end
1274
1475
  class SepaDebit < Stripe::RequestParams; end
1275
1476
 
1477
+ class Upi < Stripe::RequestParams
1478
+ class MandateOptions < Stripe::RequestParams
1479
+ # Amount to be charged for future payments.
1480
+ attr_accessor :amount
1481
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1482
+ attr_accessor :amount_type
1483
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1484
+ attr_accessor :description
1485
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1486
+ attr_accessor :end_date
1487
+
1488
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
1489
+ @amount = amount
1490
+ @amount_type = amount_type
1491
+ @description = description
1492
+ @end_date = end_date
1493
+ end
1494
+ end
1495
+ # Configuration options for setting up an eMandate
1496
+ attr_accessor :mandate_options
1497
+
1498
+ def initialize(mandate_options: nil)
1499
+ @mandate_options = mandate_options
1500
+ end
1501
+ end
1502
+
1276
1503
  class UsBankAccount < Stripe::RequestParams
1277
1504
  class FinancialConnections < Stripe::RequestParams
1278
1505
  class Filters < Stripe::RequestParams
1279
1506
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1280
1507
  attr_accessor :account_subcategories
1508
+ # ID of the institution to use to filter for selectable accounts.
1509
+ attr_accessor :institution
1281
1510
 
1282
- def initialize(account_subcategories: nil)
1511
+ def initialize(account_subcategories: nil, institution: nil)
1283
1512
  @account_subcategories = account_subcategories
1513
+ @institution = institution
1284
1514
  end
1285
1515
  end
1286
1516
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -1314,10 +1544,14 @@ module Stripe
1314
1544
  attr_accessor :card
1315
1545
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1316
1546
  attr_accessor :customer_balance
1547
+ # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
1548
+ attr_accessor :id_bank_transfer
1317
1549
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1318
1550
  attr_accessor :konbini
1319
1551
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1320
1552
  attr_accessor :sepa_debit
1553
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
1554
+ attr_accessor :upi
1321
1555
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1322
1556
  attr_accessor :us_bank_account
1323
1557
 
@@ -1326,16 +1560,20 @@ module Stripe
1326
1560
  bancontact: nil,
1327
1561
  card: nil,
1328
1562
  customer_balance: nil,
1563
+ id_bank_transfer: nil,
1329
1564
  konbini: nil,
1330
1565
  sepa_debit: nil,
1566
+ upi: nil,
1331
1567
  us_bank_account: nil
1332
1568
  )
1333
1569
  @acss_debit = acss_debit
1334
1570
  @bancontact = bancontact
1335
1571
  @card = card
1336
1572
  @customer_balance = customer_balance
1573
+ @id_bank_transfer = id_bank_transfer
1337
1574
  @konbini = konbini
1338
1575
  @sepa_debit = sepa_debit
1576
+ @upi = upi
1339
1577
  @us_bank_account = us_bank_account
1340
1578
  end
1341
1579
  end
@@ -1545,6 +1783,8 @@ module Stripe
1545
1783
  end
1546
1784
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1547
1785
  attr_accessor :account_tax_ids
1786
+ # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1787
+ attr_accessor :amounts_due
1548
1788
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1549
1789
  attr_accessor :application_fee_amount
1550
1790
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. Defaults to false.
@@ -1561,8 +1801,12 @@ module Stripe
1561
1801
  attr_accessor :custom_fields
1562
1802
  # The ID of the customer who will be billed.
1563
1803
  attr_accessor :customer
1804
+ # The ID of the account who will be billed.
1805
+ attr_accessor :customer_account
1564
1806
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1565
1807
  attr_accessor :days_until_due
1808
+ # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1809
+ attr_accessor :default_margins
1566
1810
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1567
1811
  attr_accessor :default_payment_method
1568
1812
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -1610,6 +1854,7 @@ module Stripe
1610
1854
 
1611
1855
  def initialize(
1612
1856
  account_tax_ids: nil,
1857
+ amounts_due: nil,
1613
1858
  application_fee_amount: nil,
1614
1859
  auto_advance: nil,
1615
1860
  automatic_tax: nil,
@@ -1618,7 +1863,9 @@ module Stripe
1618
1863
  currency: nil,
1619
1864
  custom_fields: nil,
1620
1865
  customer: nil,
1866
+ customer_account: nil,
1621
1867
  days_until_due: nil,
1868
+ default_margins: nil,
1622
1869
  default_payment_method: nil,
1623
1870
  default_source: nil,
1624
1871
  default_tax_rates: nil,
@@ -1643,6 +1890,7 @@ module Stripe
1643
1890
  transfer_data: nil
1644
1891
  )
1645
1892
  @account_tax_ids = account_tax_ids
1893
+ @amounts_due = amounts_due
1646
1894
  @application_fee_amount = application_fee_amount
1647
1895
  @auto_advance = auto_advance
1648
1896
  @automatic_tax = automatic_tax
@@ -1651,7 +1899,9 @@ module Stripe
1651
1899
  @currency = currency
1652
1900
  @custom_fields = custom_fields
1653
1901
  @customer = customer
1902
+ @customer_account = customer_account
1654
1903
  @days_until_due = days_until_due
1904
+ @default_margins = default_margins
1655
1905
  @default_payment_method = default_payment_method
1656
1906
  @default_source = default_source
1657
1907
  @default_tax_rates = default_tax_rates
@@ -1698,16 +1948,44 @@ module Stripe
1698
1948
  class AddLinesParams < Stripe::RequestParams
1699
1949
  class Line < Stripe::RequestParams
1700
1950
  class Discount < Stripe::RequestParams
1951
+ class DiscountEnd < Stripe::RequestParams
1952
+ class Duration < Stripe::RequestParams
1953
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1954
+ attr_accessor :interval
1955
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1956
+ attr_accessor :interval_count
1957
+
1958
+ def initialize(interval: nil, interval_count: nil)
1959
+ @interval = interval
1960
+ @interval_count = interval_count
1961
+ end
1962
+ end
1963
+ # Time span for the redeemed discount.
1964
+ attr_accessor :duration
1965
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1966
+ attr_accessor :timestamp
1967
+ # The type of calculation made to determine when the discount ends.
1968
+ attr_accessor :type
1969
+
1970
+ def initialize(duration: nil, timestamp: nil, type: nil)
1971
+ @duration = duration
1972
+ @timestamp = timestamp
1973
+ @type = type
1974
+ end
1975
+ end
1701
1976
  # ID of the coupon to create a new discount for.
1702
1977
  attr_accessor :coupon
1703
1978
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1704
1979
  attr_accessor :discount
1980
+ # Details to determine how long the discount should be applied for.
1981
+ attr_accessor :discount_end
1705
1982
  # ID of the promotion code to create a new discount for.
1706
1983
  attr_accessor :promotion_code
1707
1984
 
1708
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1985
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1709
1986
  @coupon = coupon
1710
1987
  @discount = discount
1988
+ @discount_end = discount_end
1711
1989
  @promotion_code = promotion_code
1712
1990
  end
1713
1991
  end
@@ -1860,6 +2138,8 @@ module Stripe
1860
2138
  attr_accessor :discounts
1861
2139
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1862
2140
  attr_accessor :invoice_item
2141
+ # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
2142
+ attr_accessor :margins
1863
2143
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
1864
2144
  attr_accessor :metadata
1865
2145
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -1881,6 +2161,7 @@ module Stripe
1881
2161
  discountable: nil,
1882
2162
  discounts: nil,
1883
2163
  invoice_item: nil,
2164
+ margins: nil,
1884
2165
  metadata: nil,
1885
2166
  period: nil,
1886
2167
  price_data: nil,
@@ -1894,6 +2175,7 @@ module Stripe
1894
2175
  @discountable = discountable
1895
2176
  @discounts = discounts
1896
2177
  @invoice_item = invoice_item
2178
+ @margins = margins
1897
2179
  @metadata = metadata
1898
2180
  @period = period
1899
2181
  @price_data = price_data
@@ -1918,14 +2200,59 @@ module Stripe
1918
2200
  end
1919
2201
 
1920
2202
  class AttachPaymentParams < Stripe::RequestParams
2203
+ class PaymentRecordData < Stripe::RequestParams
2204
+ # The amount that was paid out of band.
2205
+ attr_accessor :amount
2206
+ # The currency that was paid out of band.
2207
+ attr_accessor :currency
2208
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
2209
+ attr_accessor :metadata
2210
+ # The type of money movement for this out of band payment record.
2211
+ attr_accessor :money_movement_type
2212
+ # The timestamp when this out of band payment was paid.
2213
+ attr_accessor :paid_at
2214
+ # The reference for this out of band payment record.
2215
+ attr_accessor :payment_reference
2216
+
2217
+ def initialize(
2218
+ amount: nil,
2219
+ currency: nil,
2220
+ metadata: nil,
2221
+ money_movement_type: nil,
2222
+ paid_at: nil,
2223
+ payment_reference: nil
2224
+ )
2225
+ @amount = amount
2226
+ @currency = currency
2227
+ @metadata = metadata
2228
+ @money_movement_type = money_movement_type
2229
+ @paid_at = paid_at
2230
+ @payment_reference = payment_reference
2231
+ end
2232
+ end
2233
+ # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
2234
+ attr_accessor :amount_requested
1921
2235
  # Specifies which fields in the response should be expanded.
1922
2236
  attr_accessor :expand
1923
2237
  # The ID of the PaymentIntent to attach to the invoice.
1924
2238
  attr_accessor :payment_intent
2239
+ # The ID of the PaymentRecord to attach to the invoice.
2240
+ attr_accessor :payment_record
2241
+ # The PaymentRecord data for attaching an out of band payment to the invoice.
2242
+ attr_accessor :payment_record_data
1925
2243
 
1926
- def initialize(expand: nil, payment_intent: nil)
2244
+ def initialize(
2245
+ amount_requested: nil,
2246
+ expand: nil,
2247
+ payment_intent: nil,
2248
+ payment_record: nil,
2249
+ payment_record_data: nil
2250
+ )
2251
+ @amount_requested = amount_requested
1927
2252
  @expand = expand
1928
2253
  @payment_intent = payment_intent
2254
+ @payment_record = payment_record
2255
+ @payment_record_data = payment_record_data
1929
2256
  end
1930
2257
  end
1931
2258
 
@@ -2025,16 +2352,44 @@ module Stripe
2025
2352
  class UpdateLinesParams < Stripe::RequestParams
2026
2353
  class Line < Stripe::RequestParams
2027
2354
  class Discount < Stripe::RequestParams
2355
+ class DiscountEnd < Stripe::RequestParams
2356
+ class Duration < Stripe::RequestParams
2357
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2358
+ attr_accessor :interval
2359
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2360
+ attr_accessor :interval_count
2361
+
2362
+ def initialize(interval: nil, interval_count: nil)
2363
+ @interval = interval
2364
+ @interval_count = interval_count
2365
+ end
2366
+ end
2367
+ # Time span for the redeemed discount.
2368
+ attr_accessor :duration
2369
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2370
+ attr_accessor :timestamp
2371
+ # The type of calculation made to determine when the discount ends.
2372
+ attr_accessor :type
2373
+
2374
+ def initialize(duration: nil, timestamp: nil, type: nil)
2375
+ @duration = duration
2376
+ @timestamp = timestamp
2377
+ @type = type
2378
+ end
2379
+ end
2028
2380
  # ID of the coupon to create a new discount for.
2029
2381
  attr_accessor :coupon
2030
2382
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2031
2383
  attr_accessor :discount
2384
+ # Details to determine how long the discount should be applied for.
2385
+ attr_accessor :discount_end
2032
2386
  # ID of the promotion code to create a new discount for.
2033
2387
  attr_accessor :promotion_code
2034
2388
 
2035
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2389
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2036
2390
  @coupon = coupon
2037
2391
  @discount = discount
2392
+ @discount_end = discount_end
2038
2393
  @promotion_code = promotion_code
2039
2394
  end
2040
2395
  end
@@ -2187,6 +2542,8 @@ module Stripe
2187
2542
  attr_accessor :discounts
2188
2543
  # ID of an existing line item on the invoice.
2189
2544
  attr_accessor :id
2545
+ # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
2546
+ attr_accessor :margins
2190
2547
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2191
2548
  attr_accessor :metadata
2192
2549
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -2208,6 +2565,7 @@ module Stripe
2208
2565
  discountable: nil,
2209
2566
  discounts: nil,
2210
2567
  id: nil,
2568
+ margins: nil,
2211
2569
  metadata: nil,
2212
2570
  period: nil,
2213
2571
  price_data: nil,
@@ -2221,6 +2579,7 @@ module Stripe
2221
2579
  @discountable = discountable
2222
2580
  @discounts = discounts
2223
2581
  @id = id
2582
+ @margins = margins
2224
2583
  @metadata = metadata
2225
2584
  @period = period
2226
2585
  @price_data = price_data
@@ -2395,32 +2754,88 @@ module Stripe
2395
2754
  end
2396
2755
 
2397
2756
  class Discount < Stripe::RequestParams
2757
+ class DiscountEnd < Stripe::RequestParams
2758
+ class Duration < Stripe::RequestParams
2759
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2760
+ attr_accessor :interval
2761
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2762
+ attr_accessor :interval_count
2763
+
2764
+ def initialize(interval: nil, interval_count: nil)
2765
+ @interval = interval
2766
+ @interval_count = interval_count
2767
+ end
2768
+ end
2769
+ # Time span for the redeemed discount.
2770
+ attr_accessor :duration
2771
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2772
+ attr_accessor :timestamp
2773
+ # The type of calculation made to determine when the discount ends.
2774
+ attr_accessor :type
2775
+
2776
+ def initialize(duration: nil, timestamp: nil, type: nil)
2777
+ @duration = duration
2778
+ @timestamp = timestamp
2779
+ @type = type
2780
+ end
2781
+ end
2398
2782
  # ID of the coupon to create a new discount for.
2399
2783
  attr_accessor :coupon
2400
2784
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2401
2785
  attr_accessor :discount
2786
+ # Details to determine how long the discount should be applied for.
2787
+ attr_accessor :discount_end
2402
2788
  # ID of the promotion code to create a new discount for.
2403
2789
  attr_accessor :promotion_code
2404
2790
 
2405
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2791
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2406
2792
  @coupon = coupon
2407
2793
  @discount = discount
2794
+ @discount_end = discount_end
2408
2795
  @promotion_code = promotion_code
2409
2796
  end
2410
2797
  end
2411
2798
 
2412
2799
  class InvoiceItem < Stripe::RequestParams
2413
2800
  class Discount < Stripe::RequestParams
2801
+ class DiscountEnd < Stripe::RequestParams
2802
+ class Duration < Stripe::RequestParams
2803
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2804
+ attr_accessor :interval
2805
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2806
+ attr_accessor :interval_count
2807
+
2808
+ def initialize(interval: nil, interval_count: nil)
2809
+ @interval = interval
2810
+ @interval_count = interval_count
2811
+ end
2812
+ end
2813
+ # Time span for the redeemed discount.
2814
+ attr_accessor :duration
2815
+ # A precise Unix timestamp for the discount to end. Must be in the future.
2816
+ attr_accessor :timestamp
2817
+ # The type of calculation made to determine when the discount ends.
2818
+ attr_accessor :type
2819
+
2820
+ def initialize(duration: nil, timestamp: nil, type: nil)
2821
+ @duration = duration
2822
+ @timestamp = timestamp
2823
+ @type = type
2824
+ end
2825
+ end
2414
2826
  # ID of the coupon to create a new discount for.
2415
2827
  attr_accessor :coupon
2416
2828
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2417
2829
  attr_accessor :discount
2830
+ # Details to determine how long the discount should be applied for.
2831
+ attr_accessor :discount_end
2418
2832
  # ID of the promotion code to create a new discount for.
2419
2833
  attr_accessor :promotion_code
2420
2834
 
2421
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2835
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2422
2836
  @coupon = coupon
2423
2837
  @discount = discount
2838
+ @discount_end = discount_end
2424
2839
  @promotion_code = promotion_code
2425
2840
  end
2426
2841
  end
@@ -2546,6 +2961,458 @@ module Stripe
2546
2961
  end
2547
2962
 
2548
2963
  class ScheduleDetails < Stripe::RequestParams
2964
+ class Amendment < Stripe::RequestParams
2965
+ class AmendmentEnd < Stripe::RequestParams
2966
+ class DiscountEnd < Stripe::RequestParams
2967
+ # The ID of a specific discount.
2968
+ attr_accessor :discount
2969
+
2970
+ def initialize(discount: nil)
2971
+ @discount = discount
2972
+ end
2973
+ end
2974
+
2975
+ class Duration < Stripe::RequestParams
2976
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2977
+ attr_accessor :interval
2978
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2979
+ attr_accessor :interval_count
2980
+
2981
+ def initialize(interval: nil, interval_count: nil)
2982
+ @interval = interval
2983
+ @interval_count = interval_count
2984
+ end
2985
+ end
2986
+ # Use the `end` time of a given discount.
2987
+ attr_accessor :discount_end
2988
+ # Time span for the amendment starting from the `amendment_start`.
2989
+ attr_accessor :duration
2990
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2991
+ attr_accessor :timestamp
2992
+ # Select one of three ways to pass the `amendment_end`.
2993
+ attr_accessor :type
2994
+
2995
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2996
+ @discount_end = discount_end
2997
+ @duration = duration
2998
+ @timestamp = timestamp
2999
+ @type = type
3000
+ end
3001
+ end
3002
+
3003
+ class AmendmentStart < Stripe::RequestParams
3004
+ class AmendmentEnd < Stripe::RequestParams
3005
+ # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
3006
+ attr_accessor :index
3007
+
3008
+ def initialize(index: nil)
3009
+ @index = index
3010
+ end
3011
+ end
3012
+
3013
+ class DiscountEnd < Stripe::RequestParams
3014
+ # The ID of a specific discount.
3015
+ attr_accessor :discount
3016
+
3017
+ def initialize(discount: nil)
3018
+ @discount = discount
3019
+ end
3020
+ end
3021
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
3022
+ attr_accessor :amendment_end
3023
+ # Use the `end` time of a given discount.
3024
+ attr_accessor :discount_end
3025
+ # A precise Unix timestamp for the amendment to start.
3026
+ attr_accessor :timestamp
3027
+ # Select one of three ways to pass the `amendment_start`.
3028
+ attr_accessor :type
3029
+
3030
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
3031
+ @amendment_end = amendment_end
3032
+ @discount_end = discount_end
3033
+ @timestamp = timestamp
3034
+ @type = type
3035
+ end
3036
+ end
3037
+
3038
+ class DiscountAction < Stripe::RequestParams
3039
+ class Add < Stripe::RequestParams
3040
+ class DiscountEnd < Stripe::RequestParams
3041
+ # The type of calculation made to determine when the discount ends.
3042
+ attr_accessor :type
3043
+
3044
+ def initialize(type: nil)
3045
+ @type = type
3046
+ end
3047
+ end
3048
+ # The coupon code to redeem.
3049
+ attr_accessor :coupon
3050
+ # An ID of an existing discount for a coupon that was already redeemed.
3051
+ attr_accessor :discount
3052
+ # Details to determine how long the discount should be applied for.
3053
+ attr_accessor :discount_end
3054
+ # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
3055
+ attr_accessor :index
3056
+ # The promotion code to redeem.
3057
+ attr_accessor :promotion_code
3058
+
3059
+ def initialize(
3060
+ coupon: nil,
3061
+ discount: nil,
3062
+ discount_end: nil,
3063
+ index: nil,
3064
+ promotion_code: nil
3065
+ )
3066
+ @coupon = coupon
3067
+ @discount = discount
3068
+ @discount_end = discount_end
3069
+ @index = index
3070
+ @promotion_code = promotion_code
3071
+ end
3072
+ end
3073
+
3074
+ class Remove < Stripe::RequestParams
3075
+ # The coupon code to remove from the `discounts` array.
3076
+ attr_accessor :coupon
3077
+ # The ID of a discount to remove from the `discounts` array.
3078
+ attr_accessor :discount
3079
+ # The ID of a promotion code to remove from the `discounts` array.
3080
+ attr_accessor :promotion_code
3081
+
3082
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3083
+ @coupon = coupon
3084
+ @discount = discount
3085
+ @promotion_code = promotion_code
3086
+ end
3087
+ end
3088
+
3089
+ class Set < Stripe::RequestParams
3090
+ # The coupon code to replace the `discounts` array with.
3091
+ attr_accessor :coupon
3092
+ # An ID of an existing discount to replace the `discounts` array with.
3093
+ attr_accessor :discount
3094
+ # An ID of an existing promotion code to replace the `discounts` array with.
3095
+ attr_accessor :promotion_code
3096
+
3097
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3098
+ @coupon = coupon
3099
+ @discount = discount
3100
+ @promotion_code = promotion_code
3101
+ end
3102
+ end
3103
+ # Details of the discount to add.
3104
+ attr_accessor :add
3105
+ # Details of the discount to remove.
3106
+ attr_accessor :remove
3107
+ # Details of the discount to replace the existing discounts with.
3108
+ attr_accessor :set
3109
+ # Determines the type of discount action.
3110
+ attr_accessor :type
3111
+
3112
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3113
+ @add = add
3114
+ @remove = remove
3115
+ @set = set
3116
+ @type = type
3117
+ end
3118
+ end
3119
+
3120
+ class ItemAction < Stripe::RequestParams
3121
+ class Add < Stripe::RequestParams
3122
+ class Discount < Stripe::RequestParams
3123
+ class DiscountEnd < Stripe::RequestParams
3124
+ class Duration < Stripe::RequestParams
3125
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3126
+ attr_accessor :interval
3127
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3128
+ attr_accessor :interval_count
3129
+
3130
+ def initialize(interval: nil, interval_count: nil)
3131
+ @interval = interval
3132
+ @interval_count = interval_count
3133
+ end
3134
+ end
3135
+ # Time span for the redeemed discount.
3136
+ attr_accessor :duration
3137
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3138
+ attr_accessor :timestamp
3139
+ # The type of calculation made to determine when the discount ends.
3140
+ attr_accessor :type
3141
+
3142
+ def initialize(duration: nil, timestamp: nil, type: nil)
3143
+ @duration = duration
3144
+ @timestamp = timestamp
3145
+ @type = type
3146
+ end
3147
+ end
3148
+ # ID of the coupon to create a new discount for.
3149
+ attr_accessor :coupon
3150
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3151
+ attr_accessor :discount
3152
+ # Details to determine how long the discount should be applied for.
3153
+ attr_accessor :discount_end
3154
+ # ID of the promotion code to create a new discount for.
3155
+ attr_accessor :promotion_code
3156
+
3157
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3158
+ @coupon = coupon
3159
+ @discount = discount
3160
+ @discount_end = discount_end
3161
+ @promotion_code = promotion_code
3162
+ end
3163
+ end
3164
+
3165
+ class Trial < Stripe::RequestParams
3166
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
3167
+ attr_accessor :converts_to
3168
+ # Determines the type of trial for this item.
3169
+ attr_accessor :type
3170
+
3171
+ def initialize(converts_to: nil, type: nil)
3172
+ @converts_to = converts_to
3173
+ @type = type
3174
+ end
3175
+ end
3176
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
3177
+ attr_accessor :discounts
3178
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
3179
+ attr_accessor :metadata
3180
+ # The ID of the price object.
3181
+ attr_accessor :price
3182
+ # Quantity for this item.
3183
+ attr_accessor :quantity
3184
+ # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
3185
+ attr_accessor :tax_rates
3186
+ # Options that configure the trial on the subscription item.
3187
+ attr_accessor :trial
3188
+
3189
+ def initialize(
3190
+ discounts: nil,
3191
+ metadata: nil,
3192
+ price: nil,
3193
+ quantity: nil,
3194
+ tax_rates: nil,
3195
+ trial: nil
3196
+ )
3197
+ @discounts = discounts
3198
+ @metadata = metadata
3199
+ @price = price
3200
+ @quantity = quantity
3201
+ @tax_rates = tax_rates
3202
+ @trial = trial
3203
+ end
3204
+ end
3205
+
3206
+ class Remove < Stripe::RequestParams
3207
+ # ID of a price to remove.
3208
+ attr_accessor :price
3209
+
3210
+ def initialize(price: nil)
3211
+ @price = price
3212
+ end
3213
+ end
3214
+
3215
+ class Set < Stripe::RequestParams
3216
+ class Discount < Stripe::RequestParams
3217
+ class DiscountEnd < Stripe::RequestParams
3218
+ class Duration < Stripe::RequestParams
3219
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3220
+ attr_accessor :interval
3221
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3222
+ attr_accessor :interval_count
3223
+
3224
+ def initialize(interval: nil, interval_count: nil)
3225
+ @interval = interval
3226
+ @interval_count = interval_count
3227
+ end
3228
+ end
3229
+ # Time span for the redeemed discount.
3230
+ attr_accessor :duration
3231
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3232
+ attr_accessor :timestamp
3233
+ # The type of calculation made to determine when the discount ends.
3234
+ attr_accessor :type
3235
+
3236
+ def initialize(duration: nil, timestamp: nil, type: nil)
3237
+ @duration = duration
3238
+ @timestamp = timestamp
3239
+ @type = type
3240
+ end
3241
+ end
3242
+ # ID of the coupon to create a new discount for.
3243
+ attr_accessor :coupon
3244
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
3245
+ attr_accessor :discount
3246
+ # Details to determine how long the discount should be applied for.
3247
+ attr_accessor :discount_end
3248
+ # ID of the promotion code to create a new discount for.
3249
+ attr_accessor :promotion_code
3250
+
3251
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3252
+ @coupon = coupon
3253
+ @discount = discount
3254
+ @discount_end = discount_end
3255
+ @promotion_code = promotion_code
3256
+ end
3257
+ end
3258
+
3259
+ class Trial < Stripe::RequestParams
3260
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
3261
+ attr_accessor :converts_to
3262
+ # Determines the type of trial for this item.
3263
+ attr_accessor :type
3264
+
3265
+ def initialize(converts_to: nil, type: nil)
3266
+ @converts_to = converts_to
3267
+ @type = type
3268
+ end
3269
+ end
3270
+ # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
3271
+ attr_accessor :discounts
3272
+ # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
3273
+ attr_accessor :metadata
3274
+ # The ID of the price object.
3275
+ attr_accessor :price
3276
+ # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
3277
+ attr_accessor :quantity
3278
+ # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
3279
+ attr_accessor :tax_rates
3280
+ # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
3281
+ attr_accessor :trial
3282
+
3283
+ def initialize(
3284
+ discounts: nil,
3285
+ metadata: nil,
3286
+ price: nil,
3287
+ quantity: nil,
3288
+ tax_rates: nil,
3289
+ trial: nil
3290
+ )
3291
+ @discounts = discounts
3292
+ @metadata = metadata
3293
+ @price = price
3294
+ @quantity = quantity
3295
+ @tax_rates = tax_rates
3296
+ @trial = trial
3297
+ end
3298
+ end
3299
+ # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
3300
+ attr_accessor :add
3301
+ # Details of the subscription item to remove.
3302
+ attr_accessor :remove
3303
+ # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
3304
+ attr_accessor :set
3305
+ # Determines the type of item action.
3306
+ attr_accessor :type
3307
+
3308
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3309
+ @add = add
3310
+ @remove = remove
3311
+ @set = set
3312
+ @type = type
3313
+ end
3314
+ end
3315
+
3316
+ class MetadataAction < Stripe::RequestParams
3317
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
3318
+ attr_accessor :add
3319
+ # Keys to remove from schedule phase metadata.
3320
+ attr_accessor :remove
3321
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
3322
+ attr_accessor :set
3323
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
3324
+ attr_accessor :type
3325
+
3326
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
3327
+ @add = add
3328
+ @remove = remove
3329
+ @set = set
3330
+ @type = type
3331
+ end
3332
+ end
3333
+
3334
+ class SetPauseCollection < Stripe::RequestParams
3335
+ class Set < Stripe::RequestParams
3336
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3337
+ attr_accessor :behavior
3338
+
3339
+ def initialize(behavior: nil)
3340
+ @behavior = behavior
3341
+ end
3342
+ end
3343
+ # Details of the pause_collection behavior to apply to the amendment.
3344
+ attr_accessor :set
3345
+ # Determines the type of the pause_collection amendment.
3346
+ attr_accessor :type
3347
+
3348
+ def initialize(set: nil, type: nil)
3349
+ @set = set
3350
+ @type = type
3351
+ end
3352
+ end
3353
+
3354
+ class TrialSettings < Stripe::RequestParams
3355
+ class EndBehavior < Stripe::RequestParams
3356
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3357
+ attr_accessor :prorate_up_front
3358
+
3359
+ def initialize(prorate_up_front: nil)
3360
+ @prorate_up_front = prorate_up_front
3361
+ end
3362
+ end
3363
+ # Defines how the subscription should behave when a trial ends.
3364
+ attr_accessor :end_behavior
3365
+
3366
+ def initialize(end_behavior: nil)
3367
+ @end_behavior = end_behavior
3368
+ end
3369
+ end
3370
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
3371
+ attr_accessor :amendment_end
3372
+ # Details to identify the earliest timestamp where the proposed change should take effect.
3373
+ attr_accessor :amendment_start
3374
+ # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
3375
+ attr_accessor :billing_cycle_anchor
3376
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
3377
+ attr_accessor :discount_actions
3378
+ # Changes to the subscription items during the amendment time span.
3379
+ attr_accessor :item_actions
3380
+ # Instructions for how to modify phase metadata
3381
+ attr_accessor :metadata_actions
3382
+ # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
3383
+ attr_accessor :proration_behavior
3384
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
3385
+ attr_accessor :set_pause_collection
3386
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
3387
+ attr_accessor :set_schedule_end
3388
+ # Settings related to subscription trials.
3389
+ attr_accessor :trial_settings
3390
+
3391
+ def initialize(
3392
+ amendment_end: nil,
3393
+ amendment_start: nil,
3394
+ billing_cycle_anchor: nil,
3395
+ discount_actions: nil,
3396
+ item_actions: nil,
3397
+ metadata_actions: nil,
3398
+ proration_behavior: nil,
3399
+ set_pause_collection: nil,
3400
+ set_schedule_end: nil,
3401
+ trial_settings: nil
3402
+ )
3403
+ @amendment_end = amendment_end
3404
+ @amendment_start = amendment_start
3405
+ @billing_cycle_anchor = billing_cycle_anchor
3406
+ @discount_actions = discount_actions
3407
+ @item_actions = item_actions
3408
+ @metadata_actions = metadata_actions
3409
+ @proration_behavior = proration_behavior
3410
+ @set_pause_collection = set_pause_collection
3411
+ @set_schedule_end = set_schedule_end
3412
+ @trial_settings = trial_settings
3413
+ end
3414
+ end
3415
+
2549
3416
  class BillingMode < Stripe::RequestParams
2550
3417
  # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2551
3418
  attr_accessor :type
@@ -2558,16 +3425,44 @@ module Stripe
2558
3425
  class Phase < Stripe::RequestParams
2559
3426
  class AddInvoiceItem < Stripe::RequestParams
2560
3427
  class Discount < Stripe::RequestParams
3428
+ class DiscountEnd < Stripe::RequestParams
3429
+ class Duration < Stripe::RequestParams
3430
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3431
+ attr_accessor :interval
3432
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3433
+ attr_accessor :interval_count
3434
+
3435
+ def initialize(interval: nil, interval_count: nil)
3436
+ @interval = interval
3437
+ @interval_count = interval_count
3438
+ end
3439
+ end
3440
+ # Time span for the redeemed discount.
3441
+ attr_accessor :duration
3442
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3443
+ attr_accessor :timestamp
3444
+ # The type of calculation made to determine when the discount ends.
3445
+ attr_accessor :type
3446
+
3447
+ def initialize(duration: nil, timestamp: nil, type: nil)
3448
+ @duration = duration
3449
+ @timestamp = timestamp
3450
+ @type = type
3451
+ end
3452
+ end
2561
3453
  # ID of the coupon to create a new discount for.
2562
3454
  attr_accessor :coupon
2563
3455
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2564
3456
  attr_accessor :discount
3457
+ # Details to determine how long the discount should be applied for.
3458
+ attr_accessor :discount_end
2565
3459
  # ID of the promotion code to create a new discount for.
2566
3460
  attr_accessor :promotion_code
2567
3461
 
2568
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3462
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2569
3463
  @coupon = coupon
2570
3464
  @discount = discount
3465
+ @discount_end = discount_end
2571
3466
  @promotion_code = promotion_code
2572
3467
  end
2573
3468
  end
@@ -2703,16 +3598,44 @@ module Stripe
2703
3598
  end
2704
3599
 
2705
3600
  class Discount < Stripe::RequestParams
3601
+ class DiscountEnd < Stripe::RequestParams
3602
+ class Duration < Stripe::RequestParams
3603
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3604
+ attr_accessor :interval
3605
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3606
+ attr_accessor :interval_count
3607
+
3608
+ def initialize(interval: nil, interval_count: nil)
3609
+ @interval = interval
3610
+ @interval_count = interval_count
3611
+ end
3612
+ end
3613
+ # Time span for the redeemed discount.
3614
+ attr_accessor :duration
3615
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3616
+ attr_accessor :timestamp
3617
+ # The type of calculation made to determine when the discount ends.
3618
+ attr_accessor :type
3619
+
3620
+ def initialize(duration: nil, timestamp: nil, type: nil)
3621
+ @duration = duration
3622
+ @timestamp = timestamp
3623
+ @type = type
3624
+ end
3625
+ end
2706
3626
  # ID of the coupon to create a new discount for.
2707
3627
  attr_accessor :coupon
2708
3628
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2709
3629
  attr_accessor :discount
3630
+ # Details to determine how long the discount should be applied for.
3631
+ attr_accessor :discount_end
2710
3632
  # ID of the promotion code to create a new discount for.
2711
3633
  attr_accessor :promotion_code
2712
3634
 
2713
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3635
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2714
3636
  @coupon = coupon
2715
3637
  @discount = discount
3638
+ @discount_end = discount_end
2716
3639
  @promotion_code = promotion_code
2717
3640
  end
2718
3641
  end
@@ -2766,16 +3689,44 @@ module Stripe
2766
3689
  end
2767
3690
 
2768
3691
  class Discount < Stripe::RequestParams
3692
+ class DiscountEnd < Stripe::RequestParams
3693
+ class Duration < Stripe::RequestParams
3694
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3695
+ attr_accessor :interval
3696
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3697
+ attr_accessor :interval_count
3698
+
3699
+ def initialize(interval: nil, interval_count: nil)
3700
+ @interval = interval
3701
+ @interval_count = interval_count
3702
+ end
3703
+ end
3704
+ # Time span for the redeemed discount.
3705
+ attr_accessor :duration
3706
+ # A precise Unix timestamp for the discount to end. Must be in the future.
3707
+ attr_accessor :timestamp
3708
+ # The type of calculation made to determine when the discount ends.
3709
+ attr_accessor :type
3710
+
3711
+ def initialize(duration: nil, timestamp: nil, type: nil)
3712
+ @duration = duration
3713
+ @timestamp = timestamp
3714
+ @type = type
3715
+ end
3716
+ end
2769
3717
  # ID of the coupon to create a new discount for.
2770
3718
  attr_accessor :coupon
2771
3719
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2772
3720
  attr_accessor :discount
3721
+ # Details to determine how long the discount should be applied for.
3722
+ attr_accessor :discount_end
2773
3723
  # ID of the promotion code to create a new discount for.
2774
3724
  attr_accessor :promotion_code
2775
3725
 
2776
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
3726
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2777
3727
  @coupon = coupon
2778
3728
  @discount = discount
3729
+ @discount_end = discount_end
2779
3730
  @promotion_code = promotion_code
2780
3731
  end
2781
3732
  end
@@ -2821,6 +3772,18 @@ module Stripe
2821
3772
  @unit_amount_decimal = unit_amount_decimal
2822
3773
  end
2823
3774
  end
3775
+
3776
+ class Trial < Stripe::RequestParams
3777
+ # 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.
3778
+ attr_accessor :converts_to
3779
+ # Determines the type of trial for this item.
3780
+ attr_accessor :type
3781
+
3782
+ def initialize(converts_to: nil, type: nil)
3783
+ @converts_to = converts_to
3784
+ @type = type
3785
+ end
3786
+ end
2824
3787
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
2825
3788
  attr_accessor :billing_thresholds
2826
3789
  # The coupons to redeem into discounts for the subscription item.
@@ -2837,6 +3800,8 @@ module Stripe
2837
3800
  attr_accessor :quantity
2838
3801
  # 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.
2839
3802
  attr_accessor :tax_rates
3803
+ # Options that configure the trial on the subscription item.
3804
+ attr_accessor :trial
2840
3805
 
2841
3806
  def initialize(
2842
3807
  billing_thresholds: nil,
@@ -2846,7 +3811,8 @@ module Stripe
2846
3811
  price: nil,
2847
3812
  price_data: nil,
2848
3813
  quantity: nil,
2849
- tax_rates: nil
3814
+ tax_rates: nil,
3815
+ trial: nil
2850
3816
  )
2851
3817
  @billing_thresholds = billing_thresholds
2852
3818
  @discounts = discounts
@@ -2856,6 +3822,16 @@ module Stripe
2856
3822
  @price_data = price_data
2857
3823
  @quantity = quantity
2858
3824
  @tax_rates = tax_rates
3825
+ @trial = trial
3826
+ end
3827
+ end
3828
+
3829
+ class PauseCollection < Stripe::RequestParams
3830
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3831
+ attr_accessor :behavior
3832
+
3833
+ def initialize(behavior: nil)
3834
+ @behavior = behavior
2859
3835
  end
2860
3836
  end
2861
3837
 
@@ -2870,6 +3846,23 @@ module Stripe
2870
3846
  @destination = destination
2871
3847
  end
2872
3848
  end
3849
+
3850
+ class TrialSettings < Stripe::RequestParams
3851
+ class EndBehavior < Stripe::RequestParams
3852
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3853
+ attr_accessor :prorate_up_front
3854
+
3855
+ def initialize(prorate_up_front: nil)
3856
+ @prorate_up_front = prorate_up_front
3857
+ end
3858
+ end
3859
+ # Defines how the subscription should behave when a trial ends.
3860
+ attr_accessor :end_behavior
3861
+
3862
+ def initialize(end_behavior: nil)
3863
+ @end_behavior = end_behavior
3864
+ end
3865
+ end
2873
3866
  # 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.
2874
3867
  attr_accessor :add_invoice_items
2875
3868
  # 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).
@@ -2906,6 +3899,8 @@ module Stripe
2906
3899
  attr_accessor :metadata
2907
3900
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
2908
3901
  attr_accessor :on_behalf_of
3902
+ # 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).
3903
+ attr_accessor :pause_collection
2909
3904
  # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase.
2910
3905
  attr_accessor :proration_behavior
2911
3906
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -2914,8 +3909,12 @@ module Stripe
2914
3909
  attr_accessor :transfer_data
2915
3910
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
2916
3911
  attr_accessor :trial
3912
+ # Specify trial behavior when crossing phase boundaries
3913
+ attr_accessor :trial_continuation
2917
3914
  # 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`
2918
3915
  attr_accessor :trial_end
3916
+ # Settings related to subscription trials.
3917
+ attr_accessor :trial_settings
2919
3918
 
2920
3919
  def initialize(
2921
3920
  add_invoice_items: nil,
@@ -2936,11 +3935,14 @@ module Stripe
2936
3935
  iterations: nil,
2937
3936
  metadata: nil,
2938
3937
  on_behalf_of: nil,
3938
+ pause_collection: nil,
2939
3939
  proration_behavior: nil,
2940
3940
  start_date: nil,
2941
3941
  transfer_data: nil,
2942
3942
  trial: nil,
2943
- trial_end: nil
3943
+ trial_continuation: nil,
3944
+ trial_end: nil,
3945
+ trial_settings: nil
2944
3946
  )
2945
3947
  @add_invoice_items = add_invoice_items
2946
3948
  @application_fee_percent = application_fee_percent
@@ -2960,26 +3962,95 @@ module Stripe
2960
3962
  @iterations = iterations
2961
3963
  @metadata = metadata
2962
3964
  @on_behalf_of = on_behalf_of
3965
+ @pause_collection = pause_collection
2963
3966
  @proration_behavior = proration_behavior
2964
3967
  @start_date = start_date
2965
3968
  @transfer_data = transfer_data
2966
3969
  @trial = trial
3970
+ @trial_continuation = trial_continuation
2967
3971
  @trial_end = trial_end
3972
+ @trial_settings = trial_settings
3973
+ end
3974
+ end
3975
+
3976
+ class Prebilling < Stripe::RequestParams
3977
+ class BillUntil < Stripe::RequestParams
3978
+ class AmendmentEnd < Stripe::RequestParams
3979
+ # 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.
3980
+ attr_accessor :index
3981
+
3982
+ def initialize(index: nil)
3983
+ @index = index
3984
+ end
3985
+ end
3986
+
3987
+ class Duration < Stripe::RequestParams
3988
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3989
+ attr_accessor :interval
3990
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3991
+ attr_accessor :interval_count
3992
+
3993
+ def initialize(interval: nil, interval_count: nil)
3994
+ @interval = interval
3995
+ @interval_count = interval_count
3996
+ end
3997
+ end
3998
+ # End the prebilled period when a specified amendment ends.
3999
+ attr_accessor :amendment_end
4000
+ # Time span for prebilling, starting from `bill_from`.
4001
+ attr_accessor :duration
4002
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
4003
+ attr_accessor :timestamp
4004
+ # Select one of several ways to pass the `bill_until` value.
4005
+ attr_accessor :type
4006
+
4007
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
4008
+ @amendment_end = amendment_end
4009
+ @duration = duration
4010
+ @timestamp = timestamp
4011
+ @type = type
4012
+ end
4013
+ end
4014
+ # The end of the prebilled time period.
4015
+ attr_accessor :bill_until
4016
+ # This is used to determine the number of billing cycles to prebill.
4017
+ attr_accessor :iterations
4018
+
4019
+ def initialize(bill_until: nil, iterations: nil)
4020
+ @bill_until = bill_until
4021
+ @iterations = iterations
2968
4022
  end
2969
4023
  end
4024
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
4025
+ attr_accessor :amendments
4026
+ # 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.
4027
+ attr_accessor :billing_behavior
2970
4028
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
2971
4029
  attr_accessor :billing_mode
2972
4030
  # 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.
2973
4031
  attr_accessor :end_behavior
2974
4032
  # 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.
2975
4033
  attr_accessor :phases
4034
+ # Provide any time periods to bill in advance.
4035
+ attr_accessor :prebilling
2976
4036
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
2977
4037
  attr_accessor :proration_behavior
2978
4038
 
2979
- def initialize(billing_mode: nil, end_behavior: nil, phases: nil, proration_behavior: nil)
4039
+ def initialize(
4040
+ amendments: nil,
4041
+ billing_behavior: nil,
4042
+ billing_mode: nil,
4043
+ end_behavior: nil,
4044
+ phases: nil,
4045
+ prebilling: nil,
4046
+ proration_behavior: nil
4047
+ )
4048
+ @amendments = amendments
4049
+ @billing_behavior = billing_behavior
2980
4050
  @billing_mode = billing_mode
2981
4051
  @end_behavior = end_behavior
2982
4052
  @phases = phases
4053
+ @prebilling = prebilling
2983
4054
  @proration_behavior = proration_behavior
2984
4055
  end
2985
4056
  end
@@ -3005,16 +4076,44 @@ module Stripe
3005
4076
  end
3006
4077
 
3007
4078
  class Discount < Stripe::RequestParams
4079
+ class DiscountEnd < Stripe::RequestParams
4080
+ class Duration < Stripe::RequestParams
4081
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
4082
+ attr_accessor :interval
4083
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
4084
+ attr_accessor :interval_count
4085
+
4086
+ def initialize(interval: nil, interval_count: nil)
4087
+ @interval = interval
4088
+ @interval_count = interval_count
4089
+ end
4090
+ end
4091
+ # Time span for the redeemed discount.
4092
+ attr_accessor :duration
4093
+ # A precise Unix timestamp for the discount to end. Must be in the future.
4094
+ attr_accessor :timestamp
4095
+ # The type of calculation made to determine when the discount ends.
4096
+ attr_accessor :type
4097
+
4098
+ def initialize(duration: nil, timestamp: nil, type: nil)
4099
+ @duration = duration
4100
+ @timestamp = timestamp
4101
+ @type = type
4102
+ end
4103
+ end
3008
4104
  # ID of the coupon to create a new discount for.
3009
4105
  attr_accessor :coupon
3010
4106
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
3011
4107
  attr_accessor :discount
4108
+ # Details to determine how long the discount should be applied for.
4109
+ attr_accessor :discount_end
3012
4110
  # ID of the promotion code to create a new discount for.
3013
4111
  attr_accessor :promotion_code
3014
4112
 
3015
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
4113
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
3016
4114
  @coupon = coupon
3017
4115
  @discount = discount
4116
+ @discount_end = discount_end
3018
4117
  @promotion_code = promotion_code
3019
4118
  end
3020
4119
  end
@@ -3109,6 +4208,15 @@ module Stripe
3109
4208
  @tax_rates = tax_rates
3110
4209
  end
3111
4210
  end
4211
+
4212
+ class Prebilling < Stripe::RequestParams
4213
+ # This is used to determine the number of billing cycles to prebill.
4214
+ attr_accessor :iterations
4215
+
4216
+ def initialize(iterations: nil)
4217
+ @iterations = iterations
4218
+ end
4219
+ end
3112
4220
  # 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`.
3113
4221
  attr_accessor :billing_cycle_anchor
3114
4222
  # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
@@ -3123,6 +4231,8 @@ module Stripe
3123
4231
  attr_accessor :default_tax_rates
3124
4232
  # A list of up to 20 subscription items, each with an attached price.
3125
4233
  attr_accessor :items
4234
+ # The pre-billing to apply to the subscription as a preview.
4235
+ attr_accessor :prebilling
3126
4236
  # 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`.
3127
4237
  attr_accessor :proration_behavior
3128
4238
  # 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'.
@@ -3142,6 +4252,7 @@ module Stripe
3142
4252
  cancel_now: nil,
3143
4253
  default_tax_rates: nil,
3144
4254
  items: nil,
4255
+ prebilling: nil,
3145
4256
  proration_behavior: nil,
3146
4257
  proration_date: nil,
3147
4258
  resume_at: nil,
@@ -3155,6 +4266,7 @@ module Stripe
3155
4266
  @cancel_now = cancel_now
3156
4267
  @default_tax_rates = default_tax_rates
3157
4268
  @items = items
4269
+ @prebilling = prebilling
3158
4270
  @proration_behavior = proration_behavior
3159
4271
  @proration_date = proration_date
3160
4272
  @resume_at = resume_at
@@ -3168,6 +4280,8 @@ module Stripe
3168
4280
  attr_accessor :currency
3169
4281
  # 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.
3170
4282
  attr_accessor :customer
4283
+ # 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.
4284
+ attr_accessor :customer_account
3171
4285
  # 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.
3172
4286
  attr_accessor :customer_details
3173
4287
  # 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.
@@ -3195,6 +4309,7 @@ module Stripe
3195
4309
  automatic_tax: nil,
3196
4310
  currency: nil,
3197
4311
  customer: nil,
4312
+ customer_account: nil,
3198
4313
  customer_details: nil,
3199
4314
  discounts: nil,
3200
4315
  expand: nil,
@@ -3210,6 +4325,7 @@ module Stripe
3210
4325
  @automatic_tax = automatic_tax
3211
4326
  @currency = currency
3212
4327
  @customer = customer
4328
+ @customer_account = customer_account
3213
4329
  @customer_details = customer_details
3214
4330
  @discounts = discounts
3215
4331
  @expand = expand
@@ -3239,6 +4355,8 @@ module Stripe
3239
4355
  attr_reader :amount_remaining
3240
4356
  # This is the sum of all the shipping amounts.
3241
4357
  attr_reader :amount_shipping
4358
+ # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically.
4359
+ attr_reader :amounts_due
3242
4360
  # ID of the Connect Application that created the invoice.
3243
4361
  attr_reader :application
3244
4362
  # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained.
@@ -3273,6 +4391,8 @@ module Stripe
3273
4391
  attr_reader :custom_fields
3274
4392
  # The ID of the customer who will be billed.
3275
4393
  attr_reader :customer
4394
+ # The ID of the account who will be billed.
4395
+ attr_reader :customer_account
3276
4396
  # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated.
3277
4397
  attr_reader :customer_address
3278
4398
  # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated.
@@ -3287,6 +4407,8 @@ module Stripe
3287
4407
  attr_reader :customer_tax_exempt
3288
4408
  # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated.
3289
4409
  attr_reader :customer_tax_ids
4410
+ # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin.
4411
+ attr_reader :default_margins
3290
4412
  # 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.
3291
4413
  attr_reader :default_payment_method
3292
4414
  # 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.
@@ -3377,6 +4499,8 @@ module Stripe
3377
4499
  attr_reader :total_discount_amounts
3378
4500
  # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax.
3379
4501
  attr_reader :total_excluding_tax
4502
+ # The aggregate amounts calculated per margin across all line items.
4503
+ attr_reader :total_margin_amounts
3380
4504
  # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items.
3381
4505
  attr_reader :total_pretax_credit_amounts
3382
4506
  # The aggregate tax information of all line items.