stripe 15.2.0.pre.beta.1 → 15.2.0

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 (648) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +718 -1556
  3. data/CONTRIBUTING.md +25 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +10 -7
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +0 -28
  8. data/lib/stripe/api_version.rb +1 -1
  9. data/lib/stripe/errors.rb +0 -54
  10. data/lib/stripe/event_types.rb +0 -89
  11. data/lib/stripe/object_types.rb +0 -52
  12. data/lib/stripe/resources/account.rb +32 -657
  13. data/lib/stripe/resources/account_session.rb +59 -253
  14. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  15. data/lib/stripe/resources/balance.rb +42 -0
  16. data/lib/stripe/resources/balance_transaction.rb +2 -0
  17. data/lib/stripe/resources/bank_account.rb +2 -2
  18. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  19. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  20. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  21. data/lib/stripe/resources/billing_portal/session.rb +1 -7
  22. data/lib/stripe/resources/capability.rb +1 -1
  23. data/lib/stripe/resources/card.rb +0 -2
  24. data/lib/stripe/resources/cash_balance.rb +0 -2
  25. data/lib/stripe/resources/charge.rb +13 -1475
  26. data/lib/stripe/resources/checkout/session.rb +21 -333
  27. data/lib/stripe/resources/confirmation_token.rb +33 -263
  28. data/lib/stripe/resources/country_spec.rb +1 -1
  29. data/lib/stripe/resources/coupon.rb +2 -32
  30. data/lib/stripe/resources/credit_note.rb +10 -17
  31. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  32. data/lib/stripe/resources/customer.rb +2 -6
  33. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  34. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  35. data/lib/stripe/resources/customer_session.rb +4 -9
  36. data/lib/stripe/resources/discount.rb +0 -2
  37. data/lib/stripe/resources/dispute.rb +2 -2
  38. data/lib/stripe/resources/event.rb +1 -32
  39. data/lib/stripe/resources/file.rb +1 -1
  40. data/lib/stripe/resources/financial_connections/account.rb +1 -20
  41. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  42. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  43. data/lib/stripe/resources/identity/verification_session.rb +17 -21
  44. data/lib/stripe/resources/invoice.rb +79 -1106
  45. data/lib/stripe/resources/invoice_item.rb +4 -81
  46. data/lib/stripe/resources/invoice_line_item.rb +2 -56
  47. data/lib/stripe/resources/invoice_payment.rb +62 -4
  48. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  49. data/lib/stripe/resources/issuing/card.rb +1 -1
  50. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  51. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  52. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  53. data/lib/stripe/resources/line_item.rb +0 -37
  54. data/lib/stripe/resources/mandate.rb +0 -24
  55. data/lib/stripe/resources/payment_intent.rb +1912 -6840
  56. data/lib/stripe/resources/payment_method.rb +47 -301
  57. data/lib/stripe/resources/payment_method_configuration.rb +112 -112
  58. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  59. data/lib/stripe/resources/payout.rb +4 -10
  60. data/lib/stripe/resources/person.rb +2 -2
  61. data/lib/stripe/resources/plan.rb +2 -3
  62. data/lib/stripe/resources/price.rb +1 -31
  63. data/lib/stripe/resources/product.rb +1 -61
  64. data/lib/stripe/resources/promotion_code.rb +0 -10
  65. data/lib/stripe/resources/quote.rb +6 -2046
  66. data/lib/stripe/resources/radar/value_list.rb +1 -2
  67. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  68. data/lib/stripe/resources/refund.rb +6 -10
  69. data/lib/stripe/resources/reversal.rb +1 -1
  70. data/lib/stripe/resources/review.rb +1 -1
  71. data/lib/stripe/resources/setup_attempt.rb +0 -21
  72. data/lib/stripe/resources/setup_intent.rb +120 -877
  73. data/lib/stripe/resources/source.rb +1 -30
  74. data/lib/stripe/resources/subscription.rb +97 -326
  75. data/lib/stripe/resources/subscription_item.rb +32 -80
  76. data/lib/stripe/resources/subscription_schedule.rb +127 -1015
  77. data/lib/stripe/resources/tax/calculation.rb +4 -0
  78. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  79. data/lib/stripe/resources/tax/registration.rb +1 -1
  80. data/lib/stripe/resources/tax_id.rb +3 -14
  81. data/lib/stripe/resources/tax_rate.rb +2 -2
  82. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  83. data/lib/stripe/resources/terminal/location.rb +2 -3
  84. data/lib/stripe/resources/terminal/reader.rb +8 -142
  85. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  86. data/lib/stripe/resources/token.rb +2 -2
  87. data/lib/stripe/resources/transfer.rb +1 -7
  88. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  89. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  90. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  91. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  92. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  93. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  94. data/lib/stripe/resources.rb +0 -99
  95. data/lib/stripe/services/account_external_account_service.rb +2 -3
  96. data/lib/stripe/services/account_login_link_service.rb +1 -1
  97. data/lib/stripe/services/account_person_service.rb +1 -2
  98. data/lib/stripe/services/account_service.rb +23 -559
  99. data/lib/stripe/services/account_session_service.rb +29 -229
  100. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  101. data/lib/stripe/services/balance_service.rb +1 -1
  102. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  103. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  104. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  105. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  106. data/lib/stripe/services/charge_service.rb +4 -1354
  107. data/lib/stripe/services/checkout/session_service.rb +13 -250
  108. data/lib/stripe/services/coupon_service.rb +2 -19
  109. data/lib/stripe/services/credit_note_service.rb +7 -12
  110. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  111. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  112. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  113. data/lib/stripe/services/customer_service.rb +3 -5
  114. data/lib/stripe/services/customer_session_service.rb +1 -4
  115. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  116. data/lib/stripe/services/dispute_service.rb +1 -1
  117. data/lib/stripe/services/file_service.rb +1 -1
  118. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  119. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  120. data/lib/stripe/services/financial_connections_service.rb +1 -2
  121. data/lib/stripe/services/identity/verification_session_service.rb +5 -13
  122. data/lib/stripe/services/invoice_item_service.rb +3 -76
  123. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  124. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  125. data/lib/stripe/services/invoice_service.rb +74 -1049
  126. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  127. data/lib/stripe/services/issuing/card_service.rb +1 -1
  128. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  131. data/lib/stripe/services/issuing_service.rb +1 -5
  132. data/lib/stripe/services/payment_intent_service.rb +439 -4928
  133. data/lib/stripe/services/payment_method_configuration_service.rb +82 -82
  134. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  135. data/lib/stripe/services/payment_method_service.rb +44 -226
  136. data/lib/stripe/services/payout_service.rb +2 -6
  137. data/lib/stripe/services/plan_service.rb +2 -3
  138. data/lib/stripe/services/price_service.rb +2 -21
  139. data/lib/stripe/services/product_feature_service.rb +1 -2
  140. data/lib/stripe/services/product_service.rb +2 -41
  141. data/lib/stripe/services/promotion_code_service.rb +1 -9
  142. data/lib/stripe/services/quote_service.rb +7 -1730
  143. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  144. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  145. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  146. data/lib/stripe/services/setup_intent_service.rb +119 -836
  147. data/lib/stripe/services/source_service.rb +1 -1
  148. data/lib/stripe/services/subscription_item_service.rb +27 -73
  149. data/lib/stripe/services/subscription_schedule_service.rb +101 -916
  150. data/lib/stripe/services/subscription_service.rb +85 -282
  151. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  152. data/lib/stripe/services/tax/registration_service.rb +1 -1
  153. data/lib/stripe/services/tax_id_service.rb +3 -10
  154. data/lib/stripe/services/tax_service.rb +1 -3
  155. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  156. data/lib/stripe/services/terminal/location_service.rb +2 -3
  157. data/lib/stripe/services/terminal/reader_service.rb +5 -81
  158. data/lib/stripe/services/terminal_service.rb +1 -2
  159. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +33 -190
  160. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  161. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  162. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  163. data/lib/stripe/services/token_service.rb +1 -1
  164. data/lib/stripe/services/transfer_service.rb +1 -5
  165. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  166. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  167. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  168. data/lib/stripe/services/v1_services.rb +2 -12
  169. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  170. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  171. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  172. data/lib/stripe/services/v2/core_service.rb +1 -4
  173. data/lib/stripe/services/v2_services.rb +2 -4
  174. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  175. data/lib/stripe/services.rb +1 -54
  176. data/lib/stripe/stripe_configuration.rb +1 -3
  177. data/lib/stripe/stripe_object.rb +1 -1
  178. data/lib/stripe/util.rb +1 -7
  179. data/lib/stripe/version.rb +1 -1
  180. data/lib/stripe.rb +0 -53
  181. data/rbi/stripe/resources/account.rbi +4926 -0
  182. data/rbi/stripe/resources/account_link.rbi +74 -0
  183. data/rbi/stripe/resources/account_session.rbi +1013 -0
  184. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  185. data/rbi/stripe/resources/application.rbi +20 -0
  186. data/rbi/stripe/resources/application_fee.rbi +118 -0
  187. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  188. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  189. data/rbi/stripe/resources/balance.rbi +235 -0
  190. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  191. data/rbi/stripe/resources/bank_account.rbi +127 -0
  192. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  193. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  194. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  195. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  196. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  197. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  198. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  199. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  200. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  201. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  202. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  203. data/rbi/stripe/resources/capability.rbi +125 -0
  204. data/rbi/stripe/resources/card.rbi +125 -0
  205. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  206. data/rbi/stripe/resources/charge.rbi +2069 -0
  207. data/rbi/stripe/resources/checkout/session.rbi +4004 -0
  208. data/rbi/stripe/resources/climate/order.rbi +245 -0
  209. data/rbi/stripe/resources/climate/product.rbi +75 -0
  210. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  211. data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
  212. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  213. data/rbi/stripe/resources/country_spec.rbi +85 -0
  214. data/rbi/stripe/resources/coupon.rbi +250 -0
  215. data/rbi/stripe/resources/credit_note.rbi +752 -0
  216. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  217. data/rbi/stripe/resources/customer.rbi +1005 -0
  218. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  219. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  220. data/rbi/stripe/resources/customer_session.rbi +200 -0
  221. data/rbi/stripe/resources/discount.rbi +53 -0
  222. data/rbi/stripe/resources/dispute.rbi +761 -0
  223. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  224. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  225. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  226. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  227. data/rbi/stripe/resources/event.rbi +149 -0
  228. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  229. data/rbi/stripe/resources/file.rbi +143 -0
  230. data/rbi/stripe/resources/file_link.rbi +141 -0
  231. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  232. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  233. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  234. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  235. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  236. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  237. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  238. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  239. data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
  240. data/rbi/stripe/resources/invoice.rbi +3812 -0
  241. data/rbi/stripe/resources/invoice_item.rbi +473 -0
  242. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  243. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  244. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  245. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  246. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  247. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  248. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  249. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  250. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  251. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  252. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  253. data/rbi/stripe/resources/line_item.rbi +72 -0
  254. data/rbi/stripe/resources/login_link.rbi +19 -0
  255. data/rbi/stripe/resources/mandate.rbi +187 -0
  256. data/rbi/stripe/resources/payment_intent.rbi +9647 -0
  257. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  258. data/rbi/stripe/resources/payment_method.rbi +1761 -0
  259. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  260. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  261. data/rbi/stripe/resources/payout.rbi +300 -0
  262. data/rbi/stripe/resources/person.rbi +401 -0
  263. data/rbi/stripe/resources/plan.rbi +371 -0
  264. data/rbi/stripe/resources/price.rbi +694 -0
  265. data/rbi/stripe/resources/product.rbi +555 -0
  266. data/rbi/stripe/resources/product_feature.rbi +26 -0
  267. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  268. data/rbi/stripe/resources/quote.rbi +1126 -0
  269. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  270. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  271. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  272. data/rbi/stripe/resources/refund.rbi +523 -0
  273. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  274. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  275. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  276. data/rbi/stripe/resources/reversal.rbi +51 -0
  277. data/rbi/stripe/resources/review.rbi +154 -0
  278. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  279. data/rbi/stripe/resources/setup_intent.rbi +3655 -0
  280. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  281. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  282. data/rbi/stripe/resources/source.rbi +1496 -0
  283. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  284. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  285. data/rbi/stripe/resources/subscription.rbi +2027 -0
  286. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  287. data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
  288. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  289. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  290. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  291. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  292. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  293. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  294. data/rbi/stripe/resources/tax_code.rbi +44 -0
  295. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  296. data/rbi/stripe/resources/tax_id.rbi +165 -0
  297. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  298. data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
  299. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  300. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  301. data/rbi/stripe/resources/terminal/reader.rbi +847 -0
  302. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  303. data/rbi/stripe/resources/token.rbi +1283 -0
  304. data/rbi/stripe/resources/topup.rbi +222 -0
  305. data/rbi/stripe/resources/transfer.rbi +199 -0
  306. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  307. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  308. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  309. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  310. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  311. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  312. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  313. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  314. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  315. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  316. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  317. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  318. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  319. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  320. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  321. data/rbi/stripe/resources/v2/event.rbi +48 -0
  322. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  323. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  324. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  325. data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +124 -138
  326. data/rbi/stripe/services/account_link_service.rbi +58 -0
  327. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  328. data/rbi/stripe/services/account_person_service.rbi +1011 -0
  329. data/rbi/stripe/services/account_service.rbi +4213 -0
  330. data/rbi/stripe/services/account_session_service.rbi +646 -0
  331. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  332. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  333. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  334. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  335. data/rbi/stripe/services/apps_service.rbi +9 -0
  336. data/rbi/stripe/services/balance_service.rbi +21 -0
  337. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  338. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  339. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  340. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  341. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  342. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  343. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  344. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  345. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  346. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  347. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  348. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  349. data/rbi/stripe/services/billing_service.rbi +15 -0
  350. data/rbi/stripe/services/charge_service.rbi +448 -0
  351. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  352. data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
  353. data/rbi/stripe/services/checkout_service.rbi +9 -0
  354. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  355. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  356. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  357. data/rbi/stripe/services/climate_service.rbi +11 -0
  358. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  359. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  360. data/rbi/stripe/services/coupon_service.rbi +194 -0
  361. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  362. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  363. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  364. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  365. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  366. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  367. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  368. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  369. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  370. data/rbi/stripe/services/customer_service.rbi +647 -0
  371. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  372. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  373. data/rbi/stripe/services/dispute_service.rbi +424 -0
  374. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  375. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  376. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  377. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  378. data/rbi/stripe/services/event_service.rbi +83 -0
  379. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  380. data/rbi/stripe/services/file_link_service.rbi +124 -0
  381. data/rbi/stripe/services/file_service.rbi +116 -0
  382. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  383. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  384. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  385. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  386. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  387. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  388. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  389. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  390. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  391. data/rbi/stripe/services/identity_service.rbi +10 -0
  392. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  393. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  394. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  395. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  396. data/rbi/stripe/services/invoice_service.rbi +2981 -0
  397. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  398. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  399. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  400. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  401. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  402. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  403. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  404. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  405. data/rbi/stripe/services/issuing_service.rbi +16 -0
  406. data/rbi/stripe/services/mandate_service.rbi +20 -0
  407. data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
  408. data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  409. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  410. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  411. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  412. data/rbi/stripe/services/payment_method_service.rbi +776 -0
  413. data/rbi/stripe/services/payout_service.rbi +205 -0
  414. data/rbi/stripe/services/plan_service.rbi +282 -0
  415. data/rbi/stripe/services/price_service.rbi +546 -0
  416. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  417. data/rbi/stripe/services/product_service.rbi +477 -0
  418. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  419. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  420. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  421. data/rbi/stripe/services/quote_service.rbi +686 -0
  422. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  423. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  424. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  425. data/rbi/stripe/services/radar_service.rbi +11 -0
  426. data/rbi/stripe/services/refund_service.rbi +185 -0
  427. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  428. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  429. data/rbi/stripe/services/reporting_service.rbi +10 -0
  430. data/rbi/stripe/services/review_service.rbi +84 -0
  431. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  432. data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
  433. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  434. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  435. data/rbi/stripe/services/sigma_service.rbi +9 -0
  436. data/rbi/stripe/services/source_service.rbi +663 -0
  437. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  438. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  439. data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
  440. data/rbi/stripe/services/subscription_service.rbi +1648 -0
  441. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/calculation_line_item_service.rbi} +17 -21
  442. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  443. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  444. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  445. data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  446. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  447. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  448. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  449. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  450. data/rbi/stripe/services/tax_service.rbi +12 -0
  451. data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
  452. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  453. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  454. data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
  455. data/rbi/stripe/services/terminal_service.rbi +12 -0
  456. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
  457. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  458. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  459. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  460. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  461. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  462. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  463. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  464. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
  465. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  466. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  467. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  468. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  469. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  470. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  471. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  472. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  473. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  474. data/rbi/stripe/services/token_service.rbi +1257 -0
  475. data/rbi/stripe/services/topup_service.rbi +176 -0
  476. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  477. data/rbi/stripe/services/transfer_service.rbi +152 -0
  478. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  479. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  480. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  481. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  482. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  483. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  484. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  485. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  486. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  487. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  488. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  489. data/rbi/stripe/services/treasury_service.rbi +18 -0
  490. data/rbi/stripe/services/v1_services.rbi +77 -0
  491. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  492. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  493. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  494. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  495. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  496. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  497. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  498. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  499. data/rbi/stripe/services/v2_services.rbi +10 -0
  500. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  501. data/stripe.gemspec +1 -4
  502. metadata +326 -158
  503. data/lib/stripe/events/v2_core_account_closed_event.rb +0 -21
  504. data/lib/stripe/events/v2_core_account_created_event.rb +0 -21
  505. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  506. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  507. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  508. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  509. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  510. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  511. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +0 -21
  512. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
  513. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  514. data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
  515. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  516. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  517. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  518. data/lib/stripe/events/v2_core_account_updated_event.rb +0 -21
  519. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +0 -21
  520. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  521. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +0 -21
  522. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  523. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  524. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  525. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  526. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  527. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  528. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  529. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  530. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  531. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  532. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  533. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  534. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  535. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +0 -21
  536. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  537. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  538. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  539. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  540. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  541. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +0 -21
  542. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  543. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  544. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  545. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  546. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  547. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  548. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  549. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  550. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  551. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +0 -21
  552. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +0 -21
  553. data/lib/stripe/resources/account_notice.rb +0 -123
  554. data/lib/stripe/resources/balance_settings.rb +0 -105
  555. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  556. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  557. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  558. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  559. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  560. data/lib/stripe/resources/financial_connections/institution.rb +0 -90
  561. data/lib/stripe/resources/fx_quote.rb +0 -184
  562. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  563. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  564. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  565. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  566. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  567. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  568. data/lib/stripe/resources/margin.rb +0 -115
  569. data/lib/stripe/resources/order.rb +0 -2859
  570. data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
  571. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -65
  572. data/lib/stripe/resources/payment_record.rb +0 -1607
  573. data/lib/stripe/resources/privacy/redaction_job.rb +0 -275
  574. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -25
  575. data/lib/stripe/resources/quote_line.rb +0 -274
  576. data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
  577. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -339
  578. data/lib/stripe/resources/tax/association.rb +0 -89
  579. data/lib/stripe/resources/tax/form.rb +0 -211
  580. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  581. data/lib/stripe/resources/v2/core/account.rb +0 -1746
  582. data/lib/stripe/resources/v2/core/account_link.rb +0 -56
  583. data/lib/stripe/resources/v2/core/person.rb +0 -276
  584. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -74
  585. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -39
  586. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -20
  587. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -22
  588. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -51
  589. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -58
  590. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -68
  591. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -94
  592. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -129
  593. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -82
  594. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -45
  595. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -117
  596. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -75
  597. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -49
  598. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -136
  599. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -108
  600. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -78
  601. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -68
  602. data/lib/stripe/services/account_notice_service.rb +0 -101
  603. data/lib/stripe/services/balance_settings_service.rb +0 -96
  604. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  605. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  606. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  607. data/lib/stripe/services/capital_service.rb +0 -15
  608. data/lib/stripe/services/fx_quote_service.rb +0 -123
  609. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  610. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  611. data/lib/stripe/services/gift_cards_service.rb +0 -14
  612. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  613. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  614. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  615. data/lib/stripe/services/margin_service.rb +0 -119
  616. data/lib/stripe/services/order_service.rb +0 -2268
  617. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  618. data/lib/stripe/services/payment_record_service.rb +0 -542
  619. data/lib/stripe/services/privacy/redaction_job_service.rb +0 -231
  620. data/lib/stripe/services/privacy_service.rb +0 -13
  621. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  622. data/lib/stripe/services/tax/association_service.rb +0 -31
  623. data/lib/stripe/services/tax/form_service.rb +0 -100
  624. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  625. data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
  626. data/lib/stripe/services/v2/core/account_service.rb +0 -4138
  627. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1048
  628. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
  629. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
  630. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  631. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
  632. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
  633. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
  634. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
  635. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -96
  636. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
  637. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
  638. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
  639. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
  640. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  641. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
  642. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
  643. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
  644. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
  645. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  646. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  647. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
  648. data/rbi/stripe.rbi +0 -191867
@@ -83,8 +83,6 @@ module Stripe
83
83
  attr_accessor :created
84
84
  # Only return subscription schedules for the given customer.
85
85
  attr_accessor :customer
86
- # Only return subscription schedules for the given account.
87
- attr_accessor :customer_account
88
86
  # 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.
89
87
  attr_accessor :ending_before
90
88
  # Specifies which fields in the response should be expanded.
@@ -103,7 +101,6 @@ module Stripe
103
101
  completed_at: nil,
104
102
  created: nil,
105
103
  customer: nil,
106
- customer_account: nil,
107
104
  ending_before: nil,
108
105
  expand: nil,
109
106
  limit: nil,
@@ -115,7 +112,6 @@ module Stripe
115
112
  @completed_at = completed_at
116
113
  @created = created
117
114
  @customer = customer
118
- @customer_account = customer_account
119
115
  @ending_before = ending_before
120
116
  @expand = expand
121
117
  @limit = limit
@@ -150,6 +146,18 @@ module Stripe
150
146
  end
151
147
  end
152
148
 
149
+ class BillingThresholds < Stripe::RequestParams
150
+ # Monetary threshold that triggers the subscription to advance to a new billing period
151
+ attr_accessor :amount_gte
152
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
153
+ attr_accessor :reset_billing_cycle_anchor
154
+
155
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
156
+ @amount_gte = amount_gte
157
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
158
+ end
159
+ end
160
+
153
161
  class InvoiceSettings < Stripe::RequestParams
154
162
  class Issuer < Stripe::RequestParams
155
163
  # The connected account being referenced when `type` is `account`.
@@ -193,6 +201,8 @@ module Stripe
193
201
  attr_accessor :automatic_tax
194
202
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
195
203
  attr_accessor :billing_cycle_anchor
204
+ # 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.
205
+ attr_accessor :billing_thresholds
196
206
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
197
207
  attr_accessor :collection_method
198
208
  # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
@@ -210,6 +220,7 @@ module Stripe
210
220
  application_fee_percent: nil,
211
221
  automatic_tax: nil,
212
222
  billing_cycle_anchor: nil,
223
+ billing_thresholds: nil,
213
224
  collection_method: nil,
214
225
  default_payment_method: nil,
215
226
  description: nil,
@@ -220,6 +231,7 @@ module Stripe
220
231
  @application_fee_percent = application_fee_percent
221
232
  @automatic_tax = automatic_tax
222
233
  @billing_cycle_anchor = billing_cycle_anchor
234
+ @billing_thresholds = billing_thresholds
223
235
  @collection_method = collection_method
224
236
  @default_payment_method = default_payment_method
225
237
  @description = description
@@ -232,44 +244,16 @@ module Stripe
232
244
  class Phase < Stripe::RequestParams
233
245
  class AddInvoiceItem < Stripe::RequestParams
234
246
  class Discount < Stripe::RequestParams
235
- class DiscountEnd < Stripe::RequestParams
236
- class Duration < Stripe::RequestParams
237
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
238
- attr_accessor :interval
239
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
240
- attr_accessor :interval_count
241
-
242
- def initialize(interval: nil, interval_count: nil)
243
- @interval = interval
244
- @interval_count = interval_count
245
- end
246
- end
247
- # Time span for the redeemed discount.
248
- attr_accessor :duration
249
- # A precise Unix timestamp for the discount to end. Must be in the future.
250
- attr_accessor :timestamp
251
- # The type of calculation made to determine when the discount ends.
252
- attr_accessor :type
253
-
254
- def initialize(duration: nil, timestamp: nil, type: nil)
255
- @duration = duration
256
- @timestamp = timestamp
257
- @type = type
258
- end
259
- end
260
247
  # ID of the coupon to create a new discount for.
261
248
  attr_accessor :coupon
262
249
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
263
250
  attr_accessor :discount
264
- # Details to determine how long the discount should be applied for.
265
- attr_accessor :discount_end
266
251
  # ID of the promotion code to create a new discount for.
267
252
  attr_accessor :promotion_code
268
253
 
269
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
254
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
270
255
  @coupon = coupon
271
256
  @discount = discount
272
- @discount_end = discount_end
273
257
  @promotion_code = promotion_code
274
258
  end
275
259
  end
@@ -343,45 +327,29 @@ module Stripe
343
327
  end
344
328
  end
345
329
 
346
- class Discount < Stripe::RequestParams
347
- class DiscountEnd < Stripe::RequestParams
348
- class Duration < Stripe::RequestParams
349
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
350
- attr_accessor :interval
351
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
352
- attr_accessor :interval_count
353
-
354
- def initialize(interval: nil, interval_count: nil)
355
- @interval = interval
356
- @interval_count = interval_count
357
- end
358
- end
359
- # Time span for the redeemed discount.
360
- attr_accessor :duration
361
- # A precise Unix timestamp for the discount to end. Must be in the future.
362
- attr_accessor :timestamp
363
- # The type of calculation made to determine when the discount ends.
364
- attr_accessor :type
330
+ class BillingThresholds < Stripe::RequestParams
331
+ # Monetary threshold that triggers the subscription to advance to a new billing period
332
+ attr_accessor :amount_gte
333
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
334
+ attr_accessor :reset_billing_cycle_anchor
365
335
 
366
- def initialize(duration: nil, timestamp: nil, type: nil)
367
- @duration = duration
368
- @timestamp = timestamp
369
- @type = type
370
- end
336
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
337
+ @amount_gte = amount_gte
338
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
371
339
  end
340
+ end
341
+
342
+ class Discount < Stripe::RequestParams
372
343
  # ID of the coupon to create a new discount for.
373
344
  attr_accessor :coupon
374
345
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
375
346
  attr_accessor :discount
376
- # Details to determine how long the discount should be applied for.
377
- attr_accessor :discount_end
378
347
  # ID of the promotion code to create a new discount for.
379
348
  attr_accessor :promotion_code
380
349
 
381
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
350
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
382
351
  @coupon = coupon
383
352
  @discount = discount
384
- @discount_end = discount_end
385
353
  @promotion_code = promotion_code
386
354
  end
387
355
  end
@@ -413,45 +381,26 @@ module Stripe
413
381
  end
414
382
 
415
383
  class Item < Stripe::RequestParams
416
- class Discount < Stripe::RequestParams
417
- class DiscountEnd < Stripe::RequestParams
418
- class Duration < Stripe::RequestParams
419
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
420
- attr_accessor :interval
421
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
422
- attr_accessor :interval_count
423
-
424
- def initialize(interval: nil, interval_count: nil)
425
- @interval = interval
426
- @interval_count = interval_count
427
- end
428
- end
429
- # Time span for the redeemed discount.
430
- attr_accessor :duration
431
- # A precise Unix timestamp for the discount to end. Must be in the future.
432
- attr_accessor :timestamp
433
- # The type of calculation made to determine when the discount ends.
434
- attr_accessor :type
435
-
436
- def initialize(duration: nil, timestamp: nil, type: nil)
437
- @duration = duration
438
- @timestamp = timestamp
439
- @type = type
440
- end
384
+ class BillingThresholds < Stripe::RequestParams
385
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
386
+ attr_accessor :usage_gte
387
+
388
+ def initialize(usage_gte: nil)
389
+ @usage_gte = usage_gte
441
390
  end
391
+ end
392
+
393
+ class Discount < Stripe::RequestParams
442
394
  # ID of the coupon to create a new discount for.
443
395
  attr_accessor :coupon
444
396
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
445
397
  attr_accessor :discount
446
- # Details to determine how long the discount should be applied for.
447
- attr_accessor :discount_end
448
398
  # ID of the promotion code to create a new discount for.
449
399
  attr_accessor :promotion_code
450
400
 
451
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
401
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
452
402
  @coupon = coupon
453
403
  @discount = discount
454
- @discount_end = discount_end
455
404
  @promotion_code = promotion_code
456
405
  end
457
406
  end
@@ -497,18 +446,8 @@ module Stripe
497
446
  @unit_amount_decimal = unit_amount_decimal
498
447
  end
499
448
  end
500
-
501
- class Trial < Stripe::RequestParams
502
- # 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.
503
- attr_accessor :converts_to
504
- # Determines the type of trial for this item.
505
- attr_accessor :type
506
-
507
- def initialize(converts_to: nil, type: nil)
508
- @converts_to = converts_to
509
- @type = type
510
- end
511
- end
449
+ # 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.
450
+ attr_accessor :billing_thresholds
512
451
  # The coupons to redeem into discounts for the subscription item.
513
452
  attr_accessor :discounts
514
453
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -523,19 +462,18 @@ module Stripe
523
462
  attr_accessor :quantity
524
463
  # 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.
525
464
  attr_accessor :tax_rates
526
- # Options that configure the trial on the subscription item.
527
- attr_accessor :trial
528
465
 
529
466
  def initialize(
467
+ billing_thresholds: nil,
530
468
  discounts: nil,
531
469
  metadata: nil,
532
470
  plan: nil,
533
471
  price: nil,
534
472
  price_data: nil,
535
473
  quantity: nil,
536
- tax_rates: nil,
537
- trial: nil
474
+ tax_rates: nil
538
475
  )
476
+ @billing_thresholds = billing_thresholds
539
477
  @discounts = discounts
540
478
  @metadata = metadata
541
479
  @plan = plan
@@ -543,16 +481,6 @@ module Stripe
543
481
  @price_data = price_data
544
482
  @quantity = quantity
545
483
  @tax_rates = tax_rates
546
- @trial = trial
547
- end
548
- end
549
-
550
- class PauseCollection < Stripe::RequestParams
551
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
552
- attr_accessor :behavior
553
-
554
- def initialize(behavior: nil)
555
- @behavior = behavior
556
484
  end
557
485
  end
558
486
 
@@ -567,23 +495,6 @@ module Stripe
567
495
  @destination = destination
568
496
  end
569
497
  end
570
-
571
- class TrialSettings < Stripe::RequestParams
572
- class EndBehavior < Stripe::RequestParams
573
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
574
- attr_accessor :prorate_up_front
575
-
576
- def initialize(prorate_up_front: nil)
577
- @prorate_up_front = prorate_up_front
578
- end
579
- end
580
- # Defines how the subscription should behave when a trial ends.
581
- attr_accessor :end_behavior
582
-
583
- def initialize(end_behavior: nil)
584
- @end_behavior = end_behavior
585
- end
586
- end
587
498
  # 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.
588
499
  attr_accessor :add_invoice_items
589
500
  # 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).
@@ -592,6 +503,8 @@ module Stripe
592
503
  attr_accessor :automatic_tax
593
504
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
594
505
  attr_accessor :billing_cycle_anchor
506
+ # 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.
507
+ attr_accessor :billing_thresholds
595
508
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
596
509
  attr_accessor :collection_method
597
510
  # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -616,26 +529,21 @@ module Stripe
616
529
  attr_accessor :metadata
617
530
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
618
531
  attr_accessor :on_behalf_of
619
- # 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).
620
- attr_accessor :pause_collection
621
- # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
532
+ # 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.
622
533
  attr_accessor :proration_behavior
623
534
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
624
535
  attr_accessor :transfer_data
625
536
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
626
537
  attr_accessor :trial
627
- # Specify trial behavior when crossing phase boundaries
628
- attr_accessor :trial_continuation
629
538
  # 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`
630
539
  attr_accessor :trial_end
631
- # Settings related to subscription trials.
632
- attr_accessor :trial_settings
633
540
 
634
541
  def initialize(
635
542
  add_invoice_items: nil,
636
543
  application_fee_percent: nil,
637
544
  automatic_tax: nil,
638
545
  billing_cycle_anchor: nil,
546
+ billing_thresholds: nil,
639
547
  collection_method: nil,
640
548
  currency: nil,
641
549
  default_payment_method: nil,
@@ -648,18 +556,16 @@ module Stripe
648
556
  iterations: nil,
649
557
  metadata: nil,
650
558
  on_behalf_of: nil,
651
- pause_collection: nil,
652
559
  proration_behavior: nil,
653
560
  transfer_data: nil,
654
561
  trial: nil,
655
- trial_continuation: nil,
656
- trial_end: nil,
657
- trial_settings: nil
562
+ trial_end: nil
658
563
  )
659
564
  @add_invoice_items = add_invoice_items
660
565
  @application_fee_percent = application_fee_percent
661
566
  @automatic_tax = automatic_tax
662
567
  @billing_cycle_anchor = billing_cycle_anchor
568
+ @billing_thresholds = billing_thresholds
663
569
  @collection_method = collection_method
664
570
  @currency = currency
665
571
  @default_payment_method = default_payment_method
@@ -672,35 +578,14 @@ module Stripe
672
578
  @iterations = iterations
673
579
  @metadata = metadata
674
580
  @on_behalf_of = on_behalf_of
675
- @pause_collection = pause_collection
676
581
  @proration_behavior = proration_behavior
677
582
  @transfer_data = transfer_data
678
583
  @trial = trial
679
- @trial_continuation = trial_continuation
680
584
  @trial_end = trial_end
681
- @trial_settings = trial_settings
682
- end
683
- end
684
-
685
- class Prebilling < Stripe::RequestParams
686
- # This is used to determine the number of billing cycles to prebill.
687
- attr_accessor :iterations
688
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
689
- attr_accessor :update_behavior
690
-
691
- def initialize(iterations: nil, update_behavior: nil)
692
- @iterations = iterations
693
- @update_behavior = update_behavior
694
585
  end
695
586
  end
696
- # 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.
697
- attr_accessor :billing_behavior
698
- # Configure billing_mode to opt in improved credit proration behavior.When the schedule creates a subscription, the subscription's `billing_mode` will be set to the same value as the schedule's `billing_mode`.
699
- attr_accessor :billing_mode
700
587
  # The identifier of the customer to create the subscription schedule for.
701
588
  attr_accessor :customer
702
- # The identifier of the account to create the subscription schedule for.
703
- attr_accessor :customer_account
704
589
  # Object representing the subscription schedule's default settings.
705
590
  attr_accessor :default_settings
706
591
  # 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.
@@ -713,36 +598,26 @@ module Stripe
713
598
  attr_accessor :metadata
714
599
  # 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.
715
600
  attr_accessor :phases
716
- # If specified, the invoicing for the given billing cycle iterations will be processed now.
717
- attr_accessor :prebilling
718
601
  # When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
719
602
  attr_accessor :start_date
720
603
 
721
604
  def initialize(
722
- billing_behavior: nil,
723
- billing_mode: nil,
724
605
  customer: nil,
725
- customer_account: nil,
726
606
  default_settings: nil,
727
607
  end_behavior: nil,
728
608
  expand: nil,
729
609
  from_subscription: nil,
730
610
  metadata: nil,
731
611
  phases: nil,
732
- prebilling: nil,
733
612
  start_date: nil
734
613
  )
735
- @billing_behavior = billing_behavior
736
- @billing_mode = billing_mode
737
614
  @customer = customer
738
- @customer_account = customer_account
739
615
  @default_settings = default_settings
740
616
  @end_behavior = end_behavior
741
617
  @expand = expand
742
618
  @from_subscription = from_subscription
743
619
  @metadata = metadata
744
620
  @phases = phases
745
- @prebilling = prebilling
746
621
  @start_date = start_date
747
622
  end
748
623
  end
@@ -781,6 +656,18 @@ module Stripe
781
656
  end
782
657
  end
783
658
 
659
+ class BillingThresholds < Stripe::RequestParams
660
+ # Monetary threshold that triggers the subscription to advance to a new billing period
661
+ attr_accessor :amount_gte
662
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
663
+ attr_accessor :reset_billing_cycle_anchor
664
+
665
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
666
+ @amount_gte = amount_gte
667
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
668
+ end
669
+ end
670
+
784
671
  class InvoiceSettings < Stripe::RequestParams
785
672
  class Issuer < Stripe::RequestParams
786
673
  # The connected account being referenced when `type` is `account`.
@@ -824,6 +711,8 @@ module Stripe
824
711
  attr_accessor :automatic_tax
825
712
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
826
713
  attr_accessor :billing_cycle_anchor
714
+ # 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.
715
+ attr_accessor :billing_thresholds
827
716
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
828
717
  attr_accessor :collection_method
829
718
  # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
@@ -841,6 +730,7 @@ module Stripe
841
730
  application_fee_percent: nil,
842
731
  automatic_tax: nil,
843
732
  billing_cycle_anchor: nil,
733
+ billing_thresholds: nil,
844
734
  collection_method: nil,
845
735
  default_payment_method: nil,
846
736
  description: nil,
@@ -851,6 +741,7 @@ module Stripe
851
741
  @application_fee_percent = application_fee_percent
852
742
  @automatic_tax = automatic_tax
853
743
  @billing_cycle_anchor = billing_cycle_anchor
744
+ @billing_thresholds = billing_thresholds
854
745
  @collection_method = collection_method
855
746
  @default_payment_method = default_payment_method
856
747
  @description = description
@@ -863,44 +754,16 @@ module Stripe
863
754
  class Phase < Stripe::RequestParams
864
755
  class AddInvoiceItem < Stripe::RequestParams
865
756
  class Discount < Stripe::RequestParams
866
- class DiscountEnd < Stripe::RequestParams
867
- class Duration < Stripe::RequestParams
868
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
869
- attr_accessor :interval
870
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
871
- attr_accessor :interval_count
872
-
873
- def initialize(interval: nil, interval_count: nil)
874
- @interval = interval
875
- @interval_count = interval_count
876
- end
877
- end
878
- # Time span for the redeemed discount.
879
- attr_accessor :duration
880
- # A precise Unix timestamp for the discount to end. Must be in the future.
881
- attr_accessor :timestamp
882
- # The type of calculation made to determine when the discount ends.
883
- attr_accessor :type
884
-
885
- def initialize(duration: nil, timestamp: nil, type: nil)
886
- @duration = duration
887
- @timestamp = timestamp
888
- @type = type
889
- end
890
- end
891
757
  # ID of the coupon to create a new discount for.
892
758
  attr_accessor :coupon
893
759
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
894
760
  attr_accessor :discount
895
- # Details to determine how long the discount should be applied for.
896
- attr_accessor :discount_end
897
761
  # ID of the promotion code to create a new discount for.
898
762
  attr_accessor :promotion_code
899
763
 
900
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
764
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
901
765
  @coupon = coupon
902
766
  @discount = discount
903
- @discount_end = discount_end
904
767
  @promotion_code = promotion_code
905
768
  end
906
769
  end
@@ -974,45 +837,29 @@ module Stripe
974
837
  end
975
838
  end
976
839
 
977
- class Discount < Stripe::RequestParams
978
- class DiscountEnd < Stripe::RequestParams
979
- class Duration < Stripe::RequestParams
980
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
981
- attr_accessor :interval
982
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
983
- attr_accessor :interval_count
984
-
985
- def initialize(interval: nil, interval_count: nil)
986
- @interval = interval
987
- @interval_count = interval_count
988
- end
989
- end
990
- # Time span for the redeemed discount.
991
- attr_accessor :duration
992
- # A precise Unix timestamp for the discount to end. Must be in the future.
993
- attr_accessor :timestamp
994
- # The type of calculation made to determine when the discount ends.
995
- attr_accessor :type
840
+ class BillingThresholds < Stripe::RequestParams
841
+ # Monetary threshold that triggers the subscription to advance to a new billing period
842
+ attr_accessor :amount_gte
843
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
844
+ attr_accessor :reset_billing_cycle_anchor
996
845
 
997
- def initialize(duration: nil, timestamp: nil, type: nil)
998
- @duration = duration
999
- @timestamp = timestamp
1000
- @type = type
1001
- end
846
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
847
+ @amount_gte = amount_gte
848
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
1002
849
  end
850
+ end
851
+
852
+ class Discount < Stripe::RequestParams
1003
853
  # ID of the coupon to create a new discount for.
1004
854
  attr_accessor :coupon
1005
855
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1006
856
  attr_accessor :discount
1007
- # Details to determine how long the discount should be applied for.
1008
- attr_accessor :discount_end
1009
857
  # ID of the promotion code to create a new discount for.
1010
858
  attr_accessor :promotion_code
1011
859
 
1012
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
860
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1013
861
  @coupon = coupon
1014
862
  @discount = discount
1015
- @discount_end = discount_end
1016
863
  @promotion_code = promotion_code
1017
864
  end
1018
865
  end
@@ -1044,45 +891,26 @@ module Stripe
1044
891
  end
1045
892
 
1046
893
  class Item < Stripe::RequestParams
1047
- class Discount < Stripe::RequestParams
1048
- class DiscountEnd < Stripe::RequestParams
1049
- class Duration < Stripe::RequestParams
1050
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1051
- attr_accessor :interval
1052
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1053
- attr_accessor :interval_count
1054
-
1055
- def initialize(interval: nil, interval_count: nil)
1056
- @interval = interval
1057
- @interval_count = interval_count
1058
- end
1059
- end
1060
- # Time span for the redeemed discount.
1061
- attr_accessor :duration
1062
- # A precise Unix timestamp for the discount to end. Must be in the future.
1063
- attr_accessor :timestamp
1064
- # The type of calculation made to determine when the discount ends.
1065
- attr_accessor :type
1066
-
1067
- def initialize(duration: nil, timestamp: nil, type: nil)
1068
- @duration = duration
1069
- @timestamp = timestamp
1070
- @type = type
1071
- end
894
+ class BillingThresholds < Stripe::RequestParams
895
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
896
+ attr_accessor :usage_gte
897
+
898
+ def initialize(usage_gte: nil)
899
+ @usage_gte = usage_gte
1072
900
  end
901
+ end
902
+
903
+ class Discount < Stripe::RequestParams
1073
904
  # ID of the coupon to create a new discount for.
1074
905
  attr_accessor :coupon
1075
906
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1076
907
  attr_accessor :discount
1077
- # Details to determine how long the discount should be applied for.
1078
- attr_accessor :discount_end
1079
908
  # ID of the promotion code to create a new discount for.
1080
909
  attr_accessor :promotion_code
1081
910
 
1082
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
911
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1083
912
  @coupon = coupon
1084
913
  @discount = discount
1085
- @discount_end = discount_end
1086
914
  @promotion_code = promotion_code
1087
915
  end
1088
916
  end
@@ -1128,18 +956,8 @@ module Stripe
1128
956
  @unit_amount_decimal = unit_amount_decimal
1129
957
  end
1130
958
  end
1131
-
1132
- class Trial < Stripe::RequestParams
1133
- # 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.
1134
- attr_accessor :converts_to
1135
- # Determines the type of trial for this item.
1136
- attr_accessor :type
1137
-
1138
- def initialize(converts_to: nil, type: nil)
1139
- @converts_to = converts_to
1140
- @type = type
1141
- end
1142
- end
959
+ # 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.
960
+ attr_accessor :billing_thresholds
1143
961
  # The coupons to redeem into discounts for the subscription item.
1144
962
  attr_accessor :discounts
1145
963
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -1154,19 +972,18 @@ module Stripe
1154
972
  attr_accessor :quantity
1155
973
  # 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.
1156
974
  attr_accessor :tax_rates
1157
- # Options that configure the trial on the subscription item.
1158
- attr_accessor :trial
1159
975
 
1160
976
  def initialize(
977
+ billing_thresholds: nil,
1161
978
  discounts: nil,
1162
979
  metadata: nil,
1163
980
  plan: nil,
1164
981
  price: nil,
1165
982
  price_data: nil,
1166
983
  quantity: nil,
1167
- tax_rates: nil,
1168
- trial: nil
984
+ tax_rates: nil
1169
985
  )
986
+ @billing_thresholds = billing_thresholds
1170
987
  @discounts = discounts
1171
988
  @metadata = metadata
1172
989
  @plan = plan
@@ -1174,16 +991,6 @@ module Stripe
1174
991
  @price_data = price_data
1175
992
  @quantity = quantity
1176
993
  @tax_rates = tax_rates
1177
- @trial = trial
1178
- end
1179
- end
1180
-
1181
- class PauseCollection < Stripe::RequestParams
1182
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1183
- attr_accessor :behavior
1184
-
1185
- def initialize(behavior: nil)
1186
- @behavior = behavior
1187
994
  end
1188
995
  end
1189
996
 
@@ -1198,23 +1005,6 @@ module Stripe
1198
1005
  @destination = destination
1199
1006
  end
1200
1007
  end
1201
-
1202
- class TrialSettings < Stripe::RequestParams
1203
- class EndBehavior < Stripe::RequestParams
1204
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1205
- attr_accessor :prorate_up_front
1206
-
1207
- def initialize(prorate_up_front: nil)
1208
- @prorate_up_front = prorate_up_front
1209
- end
1210
- end
1211
- # Defines how the subscription should behave when a trial ends.
1212
- attr_accessor :end_behavior
1213
-
1214
- def initialize(end_behavior: nil)
1215
- @end_behavior = end_behavior
1216
- end
1217
- end
1218
1008
  # 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.
1219
1009
  attr_accessor :add_invoice_items
1220
1010
  # 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).
@@ -1223,6 +1013,8 @@ module Stripe
1223
1013
  attr_accessor :automatic_tax
1224
1014
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
1225
1015
  attr_accessor :billing_cycle_anchor
1016
+ # 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.
1017
+ attr_accessor :billing_thresholds
1226
1018
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
1227
1019
  attr_accessor :collection_method
1228
1020
  # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -1247,9 +1039,7 @@ module Stripe
1247
1039
  attr_accessor :metadata
1248
1040
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1249
1041
  attr_accessor :on_behalf_of
1250
- # 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).
1251
- attr_accessor :pause_collection
1252
- # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
1042
+ # 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.
1253
1043
  attr_accessor :proration_behavior
1254
1044
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
1255
1045
  attr_accessor :start_date
@@ -1257,18 +1047,15 @@ module Stripe
1257
1047
  attr_accessor :transfer_data
1258
1048
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1259
1049
  attr_accessor :trial
1260
- # Specify trial behavior when crossing phase boundaries
1261
- attr_accessor :trial_continuation
1262
1050
  # 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`
1263
1051
  attr_accessor :trial_end
1264
- # Settings related to subscription trials.
1265
- attr_accessor :trial_settings
1266
1052
 
1267
1053
  def initialize(
1268
1054
  add_invoice_items: nil,
1269
1055
  application_fee_percent: nil,
1270
1056
  automatic_tax: nil,
1271
1057
  billing_cycle_anchor: nil,
1058
+ billing_thresholds: nil,
1272
1059
  collection_method: nil,
1273
1060
  currency: nil,
1274
1061
  default_payment_method: nil,
@@ -1281,19 +1068,17 @@ module Stripe
1281
1068
  iterations: nil,
1282
1069
  metadata: nil,
1283
1070
  on_behalf_of: nil,
1284
- pause_collection: nil,
1285
1071
  proration_behavior: nil,
1286
1072
  start_date: nil,
1287
1073
  transfer_data: nil,
1288
1074
  trial: nil,
1289
- trial_continuation: nil,
1290
- trial_end: nil,
1291
- trial_settings: nil
1075
+ trial_end: nil
1292
1076
  )
1293
1077
  @add_invoice_items = add_invoice_items
1294
1078
  @application_fee_percent = application_fee_percent
1295
1079
  @automatic_tax = automatic_tax
1296
1080
  @billing_cycle_anchor = billing_cycle_anchor
1081
+ @billing_thresholds = billing_thresholds
1297
1082
  @collection_method = collection_method
1298
1083
  @currency = currency
1299
1084
  @default_payment_method = default_payment_method
@@ -1306,30 +1091,13 @@ module Stripe
1306
1091
  @iterations = iterations
1307
1092
  @metadata = metadata
1308
1093
  @on_behalf_of = on_behalf_of
1309
- @pause_collection = pause_collection
1310
1094
  @proration_behavior = proration_behavior
1311
1095
  @start_date = start_date
1312
1096
  @transfer_data = transfer_data
1313
1097
  @trial = trial
1314
- @trial_continuation = trial_continuation
1315
1098
  @trial_end = trial_end
1316
- @trial_settings = trial_settings
1317
1099
  end
1318
1100
  end
1319
-
1320
- class Prebilling < Stripe::RequestParams
1321
- # This is used to determine the number of billing cycles to prebill.
1322
- attr_accessor :iterations
1323
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1324
- attr_accessor :update_behavior
1325
-
1326
- def initialize(iterations: nil, update_behavior: nil)
1327
- @iterations = iterations
1328
- @update_behavior = update_behavior
1329
- end
1330
- end
1331
- # 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.
1332
- attr_accessor :billing_behavior
1333
1101
  # Object representing the subscription schedule's default settings.
1334
1102
  attr_accessor :default_settings
1335
1103
  # 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.
@@ -1340,598 +1108,26 @@ module Stripe
1340
1108
  attr_accessor :metadata
1341
1109
  # 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. Note that past phases can be omitted.
1342
1110
  attr_accessor :phases
1343
- # If specified, the invoicing for the given billing cycle iterations will be processed now.
1344
- attr_accessor :prebilling
1345
- # If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1111
+ # If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
1346
1112
  attr_accessor :proration_behavior
1347
1113
 
1348
1114
  def initialize(
1349
- billing_behavior: nil,
1350
1115
  default_settings: nil,
1351
1116
  end_behavior: nil,
1352
1117
  expand: nil,
1353
1118
  metadata: nil,
1354
1119
  phases: nil,
1355
- prebilling: nil,
1356
1120
  proration_behavior: nil
1357
1121
  )
1358
- @billing_behavior = billing_behavior
1359
1122
  @default_settings = default_settings
1360
1123
  @end_behavior = end_behavior
1361
1124
  @expand = expand
1362
1125
  @metadata = metadata
1363
1126
  @phases = phases
1364
- @prebilling = prebilling
1365
1127
  @proration_behavior = proration_behavior
1366
1128
  end
1367
1129
  end
1368
1130
 
1369
- class AmendParams < Stripe::RequestParams
1370
- class Amendment < Stripe::RequestParams
1371
- class AmendmentEnd < Stripe::RequestParams
1372
- class DiscountEnd < Stripe::RequestParams
1373
- # The ID of a specific discount.
1374
- attr_accessor :discount
1375
-
1376
- def initialize(discount: nil)
1377
- @discount = discount
1378
- end
1379
- end
1380
-
1381
- class Duration < Stripe::RequestParams
1382
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1383
- attr_accessor :interval
1384
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1385
- attr_accessor :interval_count
1386
-
1387
- def initialize(interval: nil, interval_count: nil)
1388
- @interval = interval
1389
- @interval_count = interval_count
1390
- end
1391
- end
1392
- # Use the `end` time of a given discount.
1393
- attr_accessor :discount_end
1394
- # Time span for the amendment starting from the `amendment_start`.
1395
- attr_accessor :duration
1396
- # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
1397
- attr_accessor :timestamp
1398
- # Select one of three ways to pass the `amendment_end`.
1399
- attr_accessor :type
1400
-
1401
- def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1402
- @discount_end = discount_end
1403
- @duration = duration
1404
- @timestamp = timestamp
1405
- @type = type
1406
- end
1407
- end
1408
-
1409
- class AmendmentStart < Stripe::RequestParams
1410
- class AmendmentEnd < Stripe::RequestParams
1411
- # 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.
1412
- attr_accessor :index
1413
-
1414
- def initialize(index: nil)
1415
- @index = index
1416
- end
1417
- end
1418
-
1419
- class DiscountEnd < Stripe::RequestParams
1420
- # The ID of a specific discount.
1421
- attr_accessor :discount
1422
-
1423
- def initialize(discount: nil)
1424
- @discount = discount
1425
- end
1426
- end
1427
- # Details of another amendment in the same array, immediately after which this amendment should begin.
1428
- attr_accessor :amendment_end
1429
- # Use the `end` time of a given discount.
1430
- attr_accessor :discount_end
1431
- # A precise Unix timestamp for the amendment to start.
1432
- attr_accessor :timestamp
1433
- # Select one of three ways to pass the `amendment_start`.
1434
- attr_accessor :type
1435
-
1436
- def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
1437
- @amendment_end = amendment_end
1438
- @discount_end = discount_end
1439
- @timestamp = timestamp
1440
- @type = type
1441
- end
1442
- end
1443
-
1444
- class DiscountAction < Stripe::RequestParams
1445
- class Add < Stripe::RequestParams
1446
- class DiscountEnd < Stripe::RequestParams
1447
- # The type of calculation made to determine when the discount ends.
1448
- attr_accessor :type
1449
-
1450
- def initialize(type: nil)
1451
- @type = type
1452
- end
1453
- end
1454
- # The coupon code to redeem.
1455
- attr_accessor :coupon
1456
- # An ID of an existing discount for a coupon that was already redeemed.
1457
- attr_accessor :discount
1458
- # Details to determine how long the discount should be applied for.
1459
- attr_accessor :discount_end
1460
- # 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.
1461
- attr_accessor :index
1462
- # The promotion code to redeem.
1463
- attr_accessor :promotion_code
1464
-
1465
- def initialize(
1466
- coupon: nil,
1467
- discount: nil,
1468
- discount_end: nil,
1469
- index: nil,
1470
- promotion_code: nil
1471
- )
1472
- @coupon = coupon
1473
- @discount = discount
1474
- @discount_end = discount_end
1475
- @index = index
1476
- @promotion_code = promotion_code
1477
- end
1478
- end
1479
-
1480
- class Remove < Stripe::RequestParams
1481
- # The coupon code to remove from the `discounts` array.
1482
- attr_accessor :coupon
1483
- # The ID of a discount to remove from the `discounts` array.
1484
- attr_accessor :discount
1485
- # The ID of a promotion code to remove from the `discounts` array.
1486
- attr_accessor :promotion_code
1487
-
1488
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1489
- @coupon = coupon
1490
- @discount = discount
1491
- @promotion_code = promotion_code
1492
- end
1493
- end
1494
-
1495
- class Set < Stripe::RequestParams
1496
- # The coupon code to replace the `discounts` array with.
1497
- attr_accessor :coupon
1498
- # An ID of an existing discount to replace the `discounts` array with.
1499
- attr_accessor :discount
1500
- # An ID of an existing promotion code to replace the `discounts` array with.
1501
- attr_accessor :promotion_code
1502
-
1503
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
1504
- @coupon = coupon
1505
- @discount = discount
1506
- @promotion_code = promotion_code
1507
- end
1508
- end
1509
- # Details of the discount to add.
1510
- attr_accessor :add
1511
- # Details of the discount to remove.
1512
- attr_accessor :remove
1513
- # Details of the discount to replace the existing discounts with.
1514
- attr_accessor :set
1515
- # Determines the type of discount action.
1516
- attr_accessor :type
1517
-
1518
- def initialize(add: nil, remove: nil, set: nil, type: nil)
1519
- @add = add
1520
- @remove = remove
1521
- @set = set
1522
- @type = type
1523
- end
1524
- end
1525
-
1526
- class ItemAction < Stripe::RequestParams
1527
- class Add < Stripe::RequestParams
1528
- class Discount < Stripe::RequestParams
1529
- class DiscountEnd < Stripe::RequestParams
1530
- class Duration < Stripe::RequestParams
1531
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1532
- attr_accessor :interval
1533
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1534
- attr_accessor :interval_count
1535
-
1536
- def initialize(interval: nil, interval_count: nil)
1537
- @interval = interval
1538
- @interval_count = interval_count
1539
- end
1540
- end
1541
- # Time span for the redeemed discount.
1542
- attr_accessor :duration
1543
- # A precise Unix timestamp for the discount to end. Must be in the future.
1544
- attr_accessor :timestamp
1545
- # The type of calculation made to determine when the discount ends.
1546
- attr_accessor :type
1547
-
1548
- def initialize(duration: nil, timestamp: nil, type: nil)
1549
- @duration = duration
1550
- @timestamp = timestamp
1551
- @type = type
1552
- end
1553
- end
1554
- # ID of the coupon to create a new discount for.
1555
- attr_accessor :coupon
1556
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
1557
- attr_accessor :discount
1558
- # Details to determine how long the discount should be applied for.
1559
- attr_accessor :discount_end
1560
- # ID of the promotion code to create a new discount for.
1561
- attr_accessor :promotion_code
1562
-
1563
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1564
- @coupon = coupon
1565
- @discount = discount
1566
- @discount_end = discount_end
1567
- @promotion_code = promotion_code
1568
- end
1569
- end
1570
-
1571
- class Trial < Stripe::RequestParams
1572
- # 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.
1573
- attr_accessor :converts_to
1574
- # Determines the type of trial for this item.
1575
- attr_accessor :type
1576
-
1577
- def initialize(converts_to: nil, type: nil)
1578
- @converts_to = converts_to
1579
- @type = type
1580
- end
1581
- end
1582
- # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1583
- attr_accessor :discounts
1584
- # 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`.
1585
- attr_accessor :metadata
1586
- # The ID of the price object.
1587
- attr_accessor :price
1588
- # Quantity for this item.
1589
- attr_accessor :quantity
1590
- # 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`.
1591
- attr_accessor :tax_rates
1592
- # Options that configure the trial on the subscription item.
1593
- attr_accessor :trial
1594
-
1595
- def initialize(
1596
- discounts: nil,
1597
- metadata: nil,
1598
- price: nil,
1599
- quantity: nil,
1600
- tax_rates: nil,
1601
- trial: nil
1602
- )
1603
- @discounts = discounts
1604
- @metadata = metadata
1605
- @price = price
1606
- @quantity = quantity
1607
- @tax_rates = tax_rates
1608
- @trial = trial
1609
- end
1610
- end
1611
-
1612
- class Remove < Stripe::RequestParams
1613
- # ID of a price to remove.
1614
- attr_accessor :price
1615
-
1616
- def initialize(price: nil)
1617
- @price = price
1618
- end
1619
- end
1620
-
1621
- class Set < Stripe::RequestParams
1622
- class Discount < Stripe::RequestParams
1623
- class DiscountEnd < Stripe::RequestParams
1624
- class Duration < Stripe::RequestParams
1625
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1626
- attr_accessor :interval
1627
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1628
- attr_accessor :interval_count
1629
-
1630
- def initialize(interval: nil, interval_count: nil)
1631
- @interval = interval
1632
- @interval_count = interval_count
1633
- end
1634
- end
1635
- # Time span for the redeemed discount.
1636
- attr_accessor :duration
1637
- # A precise Unix timestamp for the discount to end. Must be in the future.
1638
- attr_accessor :timestamp
1639
- # The type of calculation made to determine when the discount ends.
1640
- attr_accessor :type
1641
-
1642
- def initialize(duration: nil, timestamp: nil, type: nil)
1643
- @duration = duration
1644
- @timestamp = timestamp
1645
- @type = type
1646
- end
1647
- end
1648
- # ID of the coupon to create a new discount for.
1649
- attr_accessor :coupon
1650
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
1651
- attr_accessor :discount
1652
- # Details to determine how long the discount should be applied for.
1653
- attr_accessor :discount_end
1654
- # ID of the promotion code to create a new discount for.
1655
- attr_accessor :promotion_code
1656
-
1657
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1658
- @coupon = coupon
1659
- @discount = discount
1660
- @discount_end = discount_end
1661
- @promotion_code = promotion_code
1662
- end
1663
- end
1664
-
1665
- class Trial < Stripe::RequestParams
1666
- # 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.
1667
- attr_accessor :converts_to
1668
- # Determines the type of trial for this item.
1669
- attr_accessor :type
1670
-
1671
- def initialize(converts_to: nil, type: nil)
1672
- @converts_to = converts_to
1673
- @type = type
1674
- end
1675
- end
1676
- # 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`.
1677
- attr_accessor :discounts
1678
- # 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`.
1679
- attr_accessor :metadata
1680
- # The ID of the price object.
1681
- attr_accessor :price
1682
- # 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`.
1683
- attr_accessor :quantity
1684
- # 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`.
1685
- attr_accessor :tax_rates
1686
- # 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`.
1687
- attr_accessor :trial
1688
-
1689
- def initialize(
1690
- discounts: nil,
1691
- metadata: nil,
1692
- price: nil,
1693
- quantity: nil,
1694
- tax_rates: nil,
1695
- trial: nil
1696
- )
1697
- @discounts = discounts
1698
- @metadata = metadata
1699
- @price = price
1700
- @quantity = quantity
1701
- @tax_rates = tax_rates
1702
- @trial = trial
1703
- end
1704
- end
1705
- # 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.
1706
- attr_accessor :add
1707
- # Details of the subscription item to remove.
1708
- attr_accessor :remove
1709
- # 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.
1710
- attr_accessor :set
1711
- # Determines the type of item action.
1712
- attr_accessor :type
1713
-
1714
- def initialize(add: nil, remove: nil, set: nil, type: nil)
1715
- @add = add
1716
- @remove = remove
1717
- @set = set
1718
- @type = type
1719
- end
1720
- end
1721
-
1722
- class MetadataAction < Stripe::RequestParams
1723
- # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
1724
- attr_accessor :add
1725
- # Keys to remove from schedule phase metadata.
1726
- attr_accessor :remove
1727
- # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
1728
- attr_accessor :set
1729
- # Select one of three ways to update phase-level `metadata` on subscription schedules.
1730
- attr_accessor :type
1731
-
1732
- def initialize(add: nil, remove: nil, set: nil, type: nil)
1733
- @add = add
1734
- @remove = remove
1735
- @set = set
1736
- @type = type
1737
- end
1738
- end
1739
-
1740
- class SetPauseCollection < Stripe::RequestParams
1741
- class Set < Stripe::RequestParams
1742
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1743
- attr_accessor :behavior
1744
-
1745
- def initialize(behavior: nil)
1746
- @behavior = behavior
1747
- end
1748
- end
1749
- # Details of the pause_collection behavior to apply to the amendment.
1750
- attr_accessor :set
1751
- # Determines the type of the pause_collection amendment.
1752
- attr_accessor :type
1753
-
1754
- def initialize(set: nil, type: nil)
1755
- @set = set
1756
- @type = type
1757
- end
1758
- end
1759
-
1760
- class TrialSettings < Stripe::RequestParams
1761
- class EndBehavior < Stripe::RequestParams
1762
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1763
- attr_accessor :prorate_up_front
1764
-
1765
- def initialize(prorate_up_front: nil)
1766
- @prorate_up_front = prorate_up_front
1767
- end
1768
- end
1769
- # Defines how the subscription should behave when a trial ends.
1770
- attr_accessor :end_behavior
1771
-
1772
- def initialize(end_behavior: nil)
1773
- @end_behavior = end_behavior
1774
- end
1775
- end
1776
- # 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.
1777
- attr_accessor :amendment_end
1778
- # Details to identify the earliest timestamp where the proposed change should take effect.
1779
- attr_accessor :amendment_start
1780
- # 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.
1781
- attr_accessor :billing_cycle_anchor
1782
- # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
1783
- attr_accessor :discount_actions
1784
- # Changes to the subscription items during the amendment time span.
1785
- attr_accessor :item_actions
1786
- # Instructions for how to modify phase metadata
1787
- attr_accessor :metadata_actions
1788
- # 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`.
1789
- attr_accessor :proration_behavior
1790
- # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1791
- attr_accessor :set_pause_collection
1792
- # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
1793
- attr_accessor :set_schedule_end
1794
- # Settings related to subscription trials.
1795
- attr_accessor :trial_settings
1796
-
1797
- def initialize(
1798
- amendment_end: nil,
1799
- amendment_start: nil,
1800
- billing_cycle_anchor: nil,
1801
- discount_actions: nil,
1802
- item_actions: nil,
1803
- metadata_actions: nil,
1804
- proration_behavior: nil,
1805
- set_pause_collection: nil,
1806
- set_schedule_end: nil,
1807
- trial_settings: nil
1808
- )
1809
- @amendment_end = amendment_end
1810
- @amendment_start = amendment_start
1811
- @billing_cycle_anchor = billing_cycle_anchor
1812
- @discount_actions = discount_actions
1813
- @item_actions = item_actions
1814
- @metadata_actions = metadata_actions
1815
- @proration_behavior = proration_behavior
1816
- @set_pause_collection = set_pause_collection
1817
- @set_schedule_end = set_schedule_end
1818
- @trial_settings = trial_settings
1819
- end
1820
- end
1821
-
1822
- class Prebilling < Stripe::RequestParams
1823
- class BillFrom < Stripe::RequestParams
1824
- class AmendmentStart < Stripe::RequestParams
1825
- # The position of the amendment in the `amendments` array with which prebilling should begin. Indexes start from 0 and must be less than the total number of supplied amendments.
1826
- attr_accessor :index
1827
-
1828
- def initialize(index: nil)
1829
- @index = index
1830
- end
1831
- end
1832
- # Start the prebilled period when a specified amendment begins.
1833
- attr_accessor :amendment_start
1834
- # Start the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1835
- attr_accessor :timestamp
1836
- # Select one of several ways to pass the `bill_from` value.
1837
- attr_accessor :type
1838
-
1839
- def initialize(amendment_start: nil, timestamp: nil, type: nil)
1840
- @amendment_start = amendment_start
1841
- @timestamp = timestamp
1842
- @type = type
1843
- end
1844
- end
1845
-
1846
- class BillUntil < Stripe::RequestParams
1847
- class AmendmentEnd < Stripe::RequestParams
1848
- # 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.
1849
- attr_accessor :index
1850
-
1851
- def initialize(index: nil)
1852
- @index = index
1853
- end
1854
- end
1855
-
1856
- class Duration < Stripe::RequestParams
1857
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1858
- attr_accessor :interval
1859
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1860
- attr_accessor :interval_count
1861
-
1862
- def initialize(interval: nil, interval_count: nil)
1863
- @interval = interval
1864
- @interval_count = interval_count
1865
- end
1866
- end
1867
- # End the prebilled period when a specified amendment ends.
1868
- attr_accessor :amendment_end
1869
- # Time span for prebilling, starting from `bill_from`.
1870
- attr_accessor :duration
1871
- # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1872
- attr_accessor :timestamp
1873
- # Select one of several ways to pass the `bill_until` value.
1874
- attr_accessor :type
1875
-
1876
- def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
1877
- @amendment_end = amendment_end
1878
- @duration = duration
1879
- @timestamp = timestamp
1880
- @type = type
1881
- end
1882
- end
1883
- # The beginning of the prebilled time period. The default value is `now`.
1884
- attr_accessor :bill_from
1885
- # The end of the prebilled time period.
1886
- attr_accessor :bill_until
1887
- # When the prebilling invoice should be created. The default value is `now`.
1888
- attr_accessor :invoice_at
1889
- # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. The default value is `reset`.
1890
- attr_accessor :update_behavior
1891
-
1892
- def initialize(bill_from: nil, bill_until: nil, invoice_at: nil, update_behavior: nil)
1893
- @bill_from = bill_from
1894
- @bill_until = bill_until
1895
- @invoice_at = invoice_at
1896
- @update_behavior = update_behavior
1897
- end
1898
- end
1899
-
1900
- class ScheduleSettings < Stripe::RequestParams
1901
- # Behavior of the subscription schedule and underlying subscription when it ends.
1902
- attr_accessor :end_behavior
1903
-
1904
- def initialize(end_behavior: nil)
1905
- @end_behavior = end_behavior
1906
- end
1907
- end
1908
- # Changes to apply to the phases of the subscription schedule, in the order provided.
1909
- attr_accessor :amendments
1910
- # Specifies which fields in the response should be expanded.
1911
- attr_accessor :expand
1912
- # Provide any time periods to bill in advance.
1913
- attr_accessor :prebilling
1914
- # In cases where the amendment changes the currently active phase,
1915
- # specifies if and how to prorate at the time of the request.
1916
- attr_accessor :proration_behavior
1917
- # Changes to apply to the subscription schedule.
1918
- attr_accessor :schedule_settings
1919
-
1920
- def initialize(
1921
- amendments: nil,
1922
- expand: nil,
1923
- prebilling: nil,
1924
- proration_behavior: nil,
1925
- schedule_settings: nil
1926
- )
1927
- @amendments = amendments
1928
- @expand = expand
1929
- @prebilling = prebilling
1930
- @proration_behavior = proration_behavior
1931
- @schedule_settings = schedule_settings
1932
- end
1933
- end
1934
-
1935
1131
  class CancelParams < Stripe::RequestParams
1936
1132
  # Specifies which fields in the response should be expanded.
1937
1133
  attr_accessor :expand
@@ -1959,17 +1155,6 @@ module Stripe
1959
1155
  end
1960
1156
  end
1961
1157
 
1962
- # Amends an existing subscription schedule.
1963
- def amend(schedule, params = {}, opts = {})
1964
- request(
1965
- method: :post,
1966
- path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
1967
- params: params,
1968
- opts: opts,
1969
- base_address: :api
1970
- )
1971
- end
1972
-
1973
1158
  # Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
1974
1159
  def cancel(schedule, params = {}, opts = {})
1975
1160
  request(