stripe 15.5.0.pre.beta.2 → 15.5.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 (616) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +680 -1639
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +6 -4
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +0 -32
  8. data/lib/stripe/api_version.rb +2 -1
  9. data/lib/stripe/errors.rb +0 -60
  10. data/lib/stripe/event_types.rb +0 -102
  11. data/lib/stripe/object_types.rb +0 -53
  12. data/lib/stripe/resources/account.rb +3 -655
  13. data/lib/stripe/resources/account_session.rb +76 -250
  14. data/lib/stripe/resources/balance.rb +2 -7
  15. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  16. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  17. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  18. data/lib/stripe/resources/billing/meter.rb +2 -2
  19. data/lib/stripe/resources/billing_portal/configuration.rb +12 -2
  20. data/lib/stripe/resources/billing_portal/session.rb +0 -6
  21. data/lib/stripe/resources/card.rb +0 -2
  22. data/lib/stripe/resources/cash_balance.rb +0 -2
  23. data/lib/stripe/resources/charge.rb +38 -1543
  24. data/lib/stripe/resources/checkout/session.rb +16 -403
  25. data/lib/stripe/resources/confirmation_token.rb +0 -170
  26. data/lib/stripe/resources/coupon.rb +1 -30
  27. data/lib/stripe/resources/credit_note.rb +3 -9
  28. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  29. data/lib/stripe/resources/customer.rb +0 -2
  30. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  31. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  32. data/lib/stripe/resources/customer_session.rb +1 -6
  33. data/lib/stripe/resources/discount.rb +0 -2
  34. data/lib/stripe/resources/dispute.rb +1 -12
  35. data/lib/stripe/resources/event.rb +0 -31
  36. data/lib/stripe/resources/file.rb +1 -1
  37. data/lib/stripe/resources/file_link.rb +1 -1
  38. data/lib/stripe/resources/financial_connections/account.rb +1 -22
  39. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  40. data/lib/stripe/resources/identity/verification_session.rb +0 -10
  41. data/lib/stripe/resources/invoice.rb +55 -1136
  42. data/lib/stripe/resources/invoice_item.rb +2 -78
  43. data/lib/stripe/resources/invoice_line_item.rb +1 -55
  44. data/lib/stripe/resources/invoice_payment.rb +1 -6
  45. data/lib/stripe/resources/issuing/card.rb +8 -0
  46. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  47. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  48. data/lib/stripe/resources/line_item.rb +0 -37
  49. data/lib/stripe/resources/mandate.rb +0 -24
  50. data/lib/stripe/resources/payment_intent.rb +401 -6126
  51. data/lib/stripe/resources/payment_link.rb +1 -1
  52. data/lib/stripe/resources/payment_method.rb +1 -192
  53. data/lib/stripe/resources/payment_method_configuration.rb +0 -295
  54. data/lib/stripe/resources/price.rb +0 -30
  55. data/lib/stripe/resources/promotion_code.rb +5 -12
  56. data/lib/stripe/resources/quote.rb +7 -2038
  57. data/lib/stripe/resources/refund.rb +0 -9
  58. data/lib/stripe/resources/setup_attempt.rb +1 -22
  59. data/lib/stripe/resources/setup_intent.rb +10 -579
  60. data/lib/stripe/resources/source.rb +0 -29
  61. data/lib/stripe/resources/subscription.rb +116 -374
  62. data/lib/stripe/resources/subscription_item.rb +3 -84
  63. data/lib/stripe/resources/subscription_schedule.rb +134 -1009
  64. data/lib/stripe/resources/tax_id.rb +2 -12
  65. data/lib/stripe/resources/terminal/configuration.rb +49 -0
  66. data/lib/stripe/resources/terminal/reader.rb +22 -8
  67. data/lib/stripe/resources/transfer.rb +0 -6
  68. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  69. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  70. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  71. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  72. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  73. data/lib/stripe/resources.rb +0 -109
  74. data/lib/stripe/services/account_service.rb +1 -562
  75. data/lib/stripe/services/account_session_service.rb +46 -220
  76. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  77. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  78. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  79. data/lib/stripe/services/billing/meter_service.rb +1 -1
  80. data/lib/stripe/services/billing_portal/configuration_service.rb +10 -2
  81. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  82. data/lib/stripe/services/billing_service.rb +1 -2
  83. data/lib/stripe/services/charge_service.rb +0 -1418
  84. data/lib/stripe/services/checkout/session_service.rb +13 -319
  85. data/lib/stripe/services/coupon_service.rb +1 -17
  86. data/lib/stripe/services/credit_note_preview_lines_service.rb +1 -1
  87. data/lib/stripe/services/credit_note_service.rb +2 -6
  88. data/lib/stripe/services/customer_service.rb +4 -4
  89. data/lib/stripe/services/customer_session_service.rb +1 -4
  90. data/lib/stripe/services/file_link_service.rb +1 -1
  91. data/lib/stripe/services/file_service.rb +1 -1
  92. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  93. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  94. data/lib/stripe/services/financial_connections_service.rb +1 -2
  95. data/lib/stripe/services/identity/verification_session_service.rb +0 -8
  96. data/lib/stripe/services/invoice_item_service.rb +2 -74
  97. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  98. data/lib/stripe/services/invoice_payment_service.rb +1 -4
  99. data/lib/stripe/services/invoice_service.rb +54 -1069
  100. data/lib/stripe/services/issuing/card_service.rb +8 -0
  101. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  102. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  103. data/lib/stripe/services/issuing_service.rb +1 -5
  104. data/lib/stripe/services/payment_intent_service.rb +351 -5612
  105. data/lib/stripe/services/payment_link_service.rb +1 -1
  106. data/lib/stripe/services/payment_method_configuration_service.rb +0 -210
  107. data/lib/stripe/services/payment_method_service.rb +1 -120
  108. data/lib/stripe/services/price_service.rb +0 -19
  109. data/lib/stripe/services/promotion_code_service.rb +0 -8
  110. data/lib/stripe/services/quote_service.rb +9 -1724
  111. data/lib/stripe/services/setup_intent_service.rb +9 -538
  112. data/lib/stripe/services/subscription_item_service.rb +3 -75
  113. data/lib/stripe/services/subscription_schedule_service.rb +110 -913
  114. data/lib/stripe/services/subscription_service.rb +116 -318
  115. data/lib/stripe/services/tax_id_service.rb +2 -8
  116. data/lib/stripe/services/tax_service.rb +1 -3
  117. data/lib/stripe/services/terminal/configuration_service.rb +38 -0
  118. data/lib/stripe/services/terminal_service.rb +1 -3
  119. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +0 -97
  120. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +22 -0
  121. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  122. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  123. data/lib/stripe/services/transfer_service.rb +0 -4
  124. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  125. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  126. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  127. data/lib/stripe/services/v1_services.rb +4 -14
  128. data/lib/stripe/services/v2/billing_service.rb +2 -2
  129. data/lib/stripe/services/v2/core_service.rb +2 -5
  130. data/lib/stripe/services/v2_services.rb +1 -4
  131. data/lib/stripe/services.rb +0 -55
  132. data/lib/stripe/stripe_configuration.rb +1 -3
  133. data/lib/stripe/stripe_object.rb +1 -1
  134. data/lib/stripe/stripe_service.rb +3 -1
  135. data/lib/stripe/util.rb +1 -7
  136. data/lib/stripe/version.rb +1 -1
  137. data/lib/stripe.rb +0 -53
  138. data/rbi/stripe/resources/account.rbi +4991 -0
  139. data/rbi/stripe/resources/account_link.rbi +76 -0
  140. data/rbi/stripe/resources/account_session.rbi +1173 -0
  141. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  142. data/rbi/stripe/resources/application.rbi +20 -0
  143. data/rbi/stripe/resources/application_fee.rbi +118 -0
  144. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  145. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  146. data/rbi/stripe/resources/balance.rbi +230 -0
  147. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  148. data/rbi/stripe/resources/bank_account.rbi +127 -0
  149. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  150. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  151. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  152. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  153. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  154. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  155. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  156. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  157. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  158. data/rbi/stripe/resources/billing_portal/configuration.rbi +712 -0
  159. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  160. data/rbi/stripe/resources/capability.rbi +125 -0
  161. data/rbi/stripe/resources/card.rbi +125 -0
  162. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  163. data/rbi/stripe/resources/charge.rbi +2136 -0
  164. data/rbi/stripe/resources/checkout/session.rbi +4105 -0
  165. data/rbi/stripe/resources/climate/order.rbi +245 -0
  166. data/rbi/stripe/resources/climate/product.rbi +75 -0
  167. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  168. data/rbi/stripe/resources/confirmation_token.rbi +1818 -0
  169. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  170. data/rbi/stripe/resources/country_spec.rbi +85 -0
  171. data/rbi/stripe/resources/coupon.rbi +250 -0
  172. data/rbi/stripe/resources/credit_note.rbi +752 -0
  173. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  174. data/rbi/stripe/resources/customer.rbi +993 -0
  175. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  176. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  177. data/rbi/stripe/resources/customer_session.rbi +200 -0
  178. data/rbi/stripe/resources/discount.rbi +53 -0
  179. data/rbi/stripe/resources/dispute.rbi +761 -0
  180. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  181. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  182. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  183. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  184. data/rbi/stripe/resources/event.rbi +137 -0
  185. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  186. data/rbi/stripe/resources/file.rbi +143 -0
  187. data/rbi/stripe/resources/file_link.rbi +141 -0
  188. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  189. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  190. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  191. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  192. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  193. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  194. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  195. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  196. data/rbi/stripe/resources/identity/verification_session.rbi +564 -0
  197. data/rbi/stripe/resources/invoice.rbi +3894 -0
  198. data/rbi/stripe/resources/invoice_item.rbi +470 -0
  199. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  200. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  201. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  202. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  203. data/rbi/stripe/resources/issuing/card.rbi +749 -0
  204. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  205. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  206. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  207. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  208. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  209. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  210. data/rbi/stripe/resources/line_item.rbi +72 -0
  211. data/rbi/stripe/resources/login_link.rbi +19 -0
  212. data/rbi/stripe/resources/mandate.rbi +191 -0
  213. data/rbi/stripe/resources/payment_intent.rbi +10011 -0
  214. data/rbi/stripe/resources/payment_link.rbi +1891 -0
  215. data/rbi/stripe/resources/payment_method.rbi +1770 -0
  216. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  217. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  218. data/rbi/stripe/resources/payout.rbi +307 -0
  219. data/rbi/stripe/resources/person.rbi +401 -0
  220. data/rbi/stripe/resources/plan.rbi +371 -0
  221. data/rbi/stripe/resources/price.rbi +694 -0
  222. data/rbi/stripe/resources/product.rbi +553 -0
  223. data/rbi/stripe/resources/product_feature.rbi +26 -0
  224. data/rbi/stripe/resources/promotion_code.rbi +264 -0
  225. data/rbi/stripe/resources/quote.rbi +1137 -0
  226. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  227. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  228. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  229. data/rbi/stripe/resources/refund.rbi +523 -0
  230. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  231. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  232. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  233. data/rbi/stripe/resources/reversal.rbi +51 -0
  234. data/rbi/stripe/resources/review.rbi +154 -0
  235. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  236. data/rbi/stripe/resources/setup_intent.rbi +3974 -0
  237. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  238. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  239. data/rbi/stripe/resources/source.rbi +1496 -0
  240. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  241. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  242. data/rbi/stripe/resources/subscription.rbi +2154 -0
  243. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  244. data/rbi/stripe/resources/subscription_schedule.rbi +1795 -0
  245. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  246. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  247. data/rbi/stripe/resources/tax/registration.rbi +3216 -0
  248. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  249. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  250. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  251. data/rbi/stripe/resources/tax_code.rbi +44 -0
  252. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  253. data/rbi/stripe/resources/tax_id.rbi +165 -0
  254. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  255. data/rbi/stripe/resources/terminal/configuration.rbi +1647 -0
  256. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  257. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  258. data/rbi/stripe/resources/terminal/reader.rbi +1016 -0
  259. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  260. data/rbi/stripe/resources/token.rbi +1281 -0
  261. data/rbi/stripe/resources/topup.rbi +222 -0
  262. data/rbi/stripe/resources/transfer.rbi +199 -0
  263. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  264. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  265. data/rbi/stripe/resources/treasury/financial_account.rbi +869 -0
  266. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  267. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  268. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  269. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  270. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  271. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  272. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  273. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  274. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  275. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  276. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  277. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  278. data/rbi/stripe/resources/v2/event.rbi +48 -0
  279. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  280. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  281. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  282. data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +122 -135
  283. data/rbi/stripe/services/account_link_service.rbi +60 -0
  284. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  285. data/rbi/stripe/services/account_person_service.rbi +1007 -0
  286. data/rbi/stripe/services/account_service.rbi +4281 -0
  287. data/rbi/stripe/services/account_session_service.rbi +748 -0
  288. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  289. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  290. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  291. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  292. data/rbi/stripe/services/apps_service.rbi +9 -0
  293. data/rbi/stripe/services/balance_service.rbi +21 -0
  294. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  295. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  296. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  297. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  298. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  299. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  300. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  301. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  302. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  303. data/rbi/stripe/services/billing_portal/configuration_service.rbi +561 -0
  304. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  305. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  306. data/rbi/stripe/services/billing_service.rbi +15 -0
  307. data/rbi/stripe/services/charge_service.rbi +448 -0
  308. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  309. data/rbi/stripe/services/checkout/session_service.rbi +2697 -0
  310. data/rbi/stripe/services/checkout_service.rbi +9 -0
  311. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  312. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  313. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  314. data/rbi/stripe/services/climate_service.rbi +11 -0
  315. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  316. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  317. data/rbi/stripe/services/coupon_service.rbi +194 -0
  318. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  319. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  320. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  321. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  322. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  323. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  324. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  325. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  326. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  327. data/rbi/stripe/services/customer_service.rbi +635 -0
  328. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  329. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  330. data/rbi/stripe/services/dispute_service.rbi +424 -0
  331. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  332. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  333. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  334. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  335. data/rbi/stripe/services/event_service.rbi +83 -0
  336. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  337. data/rbi/stripe/services/file_link_service.rbi +124 -0
  338. data/rbi/stripe/services/file_service.rbi +116 -0
  339. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  340. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  341. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  342. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  343. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  344. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  345. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  346. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  347. data/rbi/stripe/services/identity/verification_session_service.rbi +339 -0
  348. data/rbi/stripe/services/identity_service.rbi +10 -0
  349. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  350. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  351. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  352. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  353. data/rbi/stripe/services/invoice_service.rbi +3073 -0
  354. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  355. data/rbi/stripe/services/issuing/card_service.rbi +503 -0
  356. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  357. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  358. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  359. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  360. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  361. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  362. data/rbi/stripe/services/issuing_service.rbi +16 -0
  363. data/rbi/stripe/services/mandate_service.rbi +20 -0
  364. data/rbi/stripe/services/payment_intent_service.rbi +8010 -0
  365. data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  366. data/rbi/stripe/services/payment_link_service.rbi +1441 -0
  367. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  368. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  369. data/rbi/stripe/services/payment_method_service.rbi +781 -0
  370. data/rbi/stripe/services/payout_service.rbi +209 -0
  371. data/rbi/stripe/services/plan_service.rbi +282 -0
  372. data/rbi/stripe/services/price_service.rbi +546 -0
  373. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  374. data/rbi/stripe/services/product_service.rbi +477 -0
  375. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  376. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  377. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  378. data/rbi/stripe/services/quote_service.rbi +695 -0
  379. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  380. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  381. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  382. data/rbi/stripe/services/radar_service.rbi +11 -0
  383. data/rbi/stripe/services/refund_service.rbi +185 -0
  384. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  385. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  386. data/rbi/stripe/services/reporting_service.rbi +10 -0
  387. data/rbi/stripe/services/review_service.rbi +84 -0
  388. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  389. data/rbi/stripe/services/setup_intent_service.rbi +3709 -0
  390. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  391. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  392. data/rbi/stripe/services/sigma_service.rbi +9 -0
  393. data/rbi/stripe/services/source_service.rbi +663 -0
  394. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  395. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  396. data/rbi/stripe/services/subscription_schedule_service.rbi +1425 -0
  397. data/rbi/stripe/services/subscription_service.rbi +1768 -0
  398. data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/tax/calculation_line_item_service.rbi} +17 -21
  399. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  400. data/rbi/stripe/services/tax/registration_service.rbi +2278 -0
  401. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  402. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  403. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  404. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  405. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  406. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  407. data/rbi/stripe/services/tax_service.rbi +12 -0
  408. data/rbi/stripe/services/terminal/configuration_service.rbi +1328 -0
  409. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  410. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  411. data/rbi/stripe/services/terminal/reader_service.rbi +540 -0
  412. data/rbi/stripe/services/terminal_service.rbi +12 -0
  413. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +746 -0
  414. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  415. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  416. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  417. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  418. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  419. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  420. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  421. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +117 -0
  422. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  423. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  424. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  425. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  426. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  427. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  428. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  429. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  430. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  431. data/rbi/stripe/services/token_service.rbi +1255 -0
  432. data/rbi/stripe/services/topup_service.rbi +176 -0
  433. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  434. data/rbi/stripe/services/transfer_service.rbi +152 -0
  435. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  436. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  437. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  438. data/rbi/stripe/services/treasury/financial_account_service.rbi +566 -0
  439. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  440. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  441. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  442. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  443. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  444. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  445. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  446. data/rbi/stripe/services/treasury_service.rbi +18 -0
  447. data/rbi/stripe/services/v1_services.rbi +77 -0
  448. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  449. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  450. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  451. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  452. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  453. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  454. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  455. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  456. data/rbi/stripe/services/v2_services.rbi +10 -0
  457. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  458. data/stripe.gemspec +1 -4
  459. metadata +324 -169
  460. data/lib/stripe/events/v2_core_account_closed_event.rb +0 -21
  461. data/lib/stripe/events/v2_core_account_created_event.rb +0 -21
  462. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  463. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  464. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  465. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  466. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  467. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  468. data/lib/stripe/events/v2_core_account_including_configuration_storer_capability_status_updated_event.rb +0 -23
  469. data/lib/stripe/events/v2_core_account_including_configuration_storer_updated_event.rb +0 -21
  470. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +0 -21
  471. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
  472. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  473. data/lib/stripe/events/v2_core_account_link_returned_event.rb +0 -13
  474. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  475. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  476. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  477. data/lib/stripe/events/v2_core_account_updated_event.rb +0 -21
  478. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +0 -21
  479. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  480. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +0 -21
  481. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  482. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  483. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  484. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  485. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  486. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  487. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  488. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  489. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  490. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  491. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  492. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  493. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  494. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +0 -21
  495. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  496. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  497. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  498. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  499. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  500. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +0 -21
  501. data/lib/stripe/events/v2_money_management_payout_method_updated_event.rb +0 -21
  502. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  503. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  504. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  505. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  506. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  507. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  508. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  509. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  510. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  511. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +0 -21
  512. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +0 -21
  513. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +0 -21
  514. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +0 -22
  515. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +0 -21
  516. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +0 -21
  517. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +0 -21
  518. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +0 -21
  519. data/lib/stripe/resources/account_notice.rb +0 -123
  520. data/lib/stripe/resources/balance_settings.rb +0 -105
  521. data/lib/stripe/resources/billing/meter_usage.rb +0 -23
  522. data/lib/stripe/resources/billing/meter_usage_row.rb +0 -28
  523. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  524. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  525. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  526. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  527. data/lib/stripe/resources/financial_connections/institution.rb +0 -92
  528. data/lib/stripe/resources/fx_quote.rb +0 -186
  529. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  530. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  531. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  532. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  533. data/lib/stripe/resources/margin.rb +0 -115
  534. data/lib/stripe/resources/order.rb +0 -2958
  535. data/lib/stripe/resources/payment_attempt_record.rb +0 -1101
  536. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -72
  537. data/lib/stripe/resources/payment_record.rb +0 -1630
  538. data/lib/stripe/resources/privacy/redaction_job.rb +0 -298
  539. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -33
  540. data/lib/stripe/resources/quote_line.rb +0 -274
  541. data/lib/stripe/resources/quote_preview_invoice.rb +0 -680
  542. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -371
  543. data/lib/stripe/resources/tax/association.rb +0 -66
  544. data/lib/stripe/resources/tax/form.rb +0 -211
  545. data/lib/stripe/resources/terminal/onboarding_link.rb +0 -84
  546. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  547. data/lib/stripe/resources/v2/core/account.rb +0 -1930
  548. data/lib/stripe/resources/v2/core/account_link.rb +0 -72
  549. data/lib/stripe/resources/v2/core/person.rb +0 -276
  550. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -74
  551. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -39
  552. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -20
  553. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -22
  554. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -51
  555. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -77
  556. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -68
  557. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -94
  558. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -129
  559. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -82
  560. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -45
  561. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -117
  562. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -77
  563. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -49
  564. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -122
  565. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -84
  566. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -78
  567. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -68
  568. data/lib/stripe/resources/v2/payments/off_session_payment.rb +0 -89
  569. data/lib/stripe/services/account_notice_service.rb +0 -101
  570. data/lib/stripe/services/balance_settings_service.rb +0 -96
  571. data/lib/stripe/services/billing/meter_usage_service.rb +0 -76
  572. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  573. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  574. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  575. data/lib/stripe/services/capital_service.rb +0 -15
  576. data/lib/stripe/services/fx_quote_service.rb +0 -123
  577. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  578. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  579. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  580. data/lib/stripe/services/margin_service.rb +0 -119
  581. data/lib/stripe/services/order_service.rb +0 -2388
  582. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  583. data/lib/stripe/services/payment_record_service.rb +0 -542
  584. data/lib/stripe/services/privacy/redaction_job_service.rb +0 -240
  585. data/lib/stripe/services/privacy_service.rb +0 -13
  586. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  587. data/lib/stripe/services/tax/association_service.rb +0 -31
  588. data/lib/stripe/services/tax/form_service.rb +0 -100
  589. data/lib/stripe/services/terminal/onboarding_link_service.rb +0 -56
  590. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  591. data/lib/stripe/services/v2/core/account_link_service.rb +0 -114
  592. data/lib/stripe/services/v2/core/account_service.rb +0 -4522
  593. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1045
  594. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -130
  595. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -107
  596. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  597. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -74
  598. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -116
  599. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -82
  600. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -125
  601. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -95
  602. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -199
  603. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -235
  604. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -172
  605. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -90
  606. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  607. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -70
  608. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -43
  609. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -69
  610. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -73
  611. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  612. data/lib/stripe/services/v2/payment_service.rb +0 -15
  613. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +0 -152
  614. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  615. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -53
  616. data/rbi/stripe.rbi +0 -199145
@@ -0,0 +1,1768 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ class SubscriptionService < StripeService
7
+ class CancelParams < Stripe::RequestParams
8
+ class CancellationDetails < Stripe::RequestParams
9
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
10
+ sig { returns(T.nilable(String)) }
11
+ attr_accessor :comment
12
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
13
+ sig { returns(T.nilable(T.any(String, String))) }
14
+ attr_accessor :feedback
15
+ sig { params(comment: T.nilable(String), feedback: T.nilable(T.any(String, String))).void }
16
+ def initialize(comment: nil, feedback: nil); end
17
+ end
18
+ # Details about why this subscription was cancelled
19
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CancelParams::CancellationDetails)) }
20
+ attr_accessor :cancellation_details
21
+ # Specifies which fields in the response should be expanded.
22
+ sig { returns(T.nilable(T::Array[String])) }
23
+ attr_accessor :expand
24
+ # Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `false`.
25
+ sig { returns(T.nilable(T::Boolean)) }
26
+ attr_accessor :invoice_now
27
+ # Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`.
28
+ sig { returns(T.nilable(T::Boolean)) }
29
+ attr_accessor :prorate
30
+ sig {
31
+ params(cancellation_details: T.nilable(::Stripe::SubscriptionService::CancelParams::CancellationDetails), expand: T.nilable(T::Array[String]), invoice_now: T.nilable(T::Boolean), prorate: T.nilable(T::Boolean)).void
32
+ }
33
+ def initialize(cancellation_details: nil, expand: nil, invoice_now: nil, prorate: nil); end
34
+ end
35
+ class RetrieveParams < Stripe::RequestParams
36
+ # Specifies which fields in the response should be expanded.
37
+ sig { returns(T.nilable(T::Array[String])) }
38
+ attr_accessor :expand
39
+ sig { params(expand: T.nilable(T::Array[String])).void }
40
+ def initialize(expand: nil); end
41
+ end
42
+ class UpdateParams < Stripe::RequestParams
43
+ class AddInvoiceItem < Stripe::RequestParams
44
+ class Discount < Stripe::RequestParams
45
+ # ID of the coupon to create a new discount for.
46
+ sig { returns(T.nilable(String)) }
47
+ attr_accessor :coupon
48
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_accessor :discount
51
+ # ID of the promotion code to create a new discount for.
52
+ sig { returns(T.nilable(String)) }
53
+ attr_accessor :promotion_code
54
+ sig {
55
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
56
+ }
57
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
58
+ end
59
+ class Period < Stripe::RequestParams
60
+ class End < Stripe::RequestParams
61
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
62
+ sig { returns(T.nilable(Integer)) }
63
+ attr_accessor :timestamp
64
+ # Select how to calculate the end of the invoice item period.
65
+ sig { returns(String) }
66
+ attr_accessor :type
67
+ sig { params(timestamp: T.nilable(Integer), type: String).void }
68
+ def initialize(timestamp: nil, type: nil); end
69
+ end
70
+ class Start < Stripe::RequestParams
71
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
72
+ sig { returns(T.nilable(Integer)) }
73
+ attr_accessor :timestamp
74
+ # Select how to calculate the start of the invoice item period.
75
+ sig { returns(String) }
76
+ attr_accessor :type
77
+ sig { params(timestamp: T.nilable(Integer), type: String).void }
78
+ def initialize(timestamp: nil, type: nil); end
79
+ end
80
+ # End of the invoice item period.
81
+ sig { returns(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period::End) }
82
+ attr_accessor :end
83
+ # Start of the invoice item period.
84
+ sig {
85
+ returns(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period::Start)
86
+ }
87
+ attr_accessor :start
88
+ sig {
89
+ params(end_: ::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period::End, start: ::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period::Start).void
90
+ }
91
+ def initialize(end_: nil, start: nil); end
92
+ end
93
+ class PriceData < Stripe::RequestParams
94
+ # 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).
95
+ sig { returns(String) }
96
+ attr_accessor :currency
97
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
98
+ sig { returns(String) }
99
+ attr_accessor :product
100
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
101
+ sig { returns(T.nilable(String)) }
102
+ attr_accessor :tax_behavior
103
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
104
+ sig { returns(T.nilable(Integer)) }
105
+ attr_accessor :unit_amount
106
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
107
+ sig { returns(T.nilable(String)) }
108
+ attr_accessor :unit_amount_decimal
109
+ sig {
110
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
111
+ }
112
+ def initialize(
113
+ currency: nil,
114
+ product: nil,
115
+ tax_behavior: nil,
116
+ unit_amount: nil,
117
+ unit_amount_decimal: nil
118
+ ); end
119
+ end
120
+ # The coupons to redeem into discounts for the item.
121
+ sig {
122
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Discount]))
123
+ }
124
+ attr_accessor :discounts
125
+ # 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`.
126
+ sig { returns(T.nilable(T::Hash[String, String])) }
127
+ attr_accessor :metadata
128
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
129
+ sig {
130
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period))
131
+ }
132
+ attr_accessor :period
133
+ # The ID of the price object. One of `price` or `price_data` is required.
134
+ sig { returns(T.nilable(String)) }
135
+ attr_accessor :price
136
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
137
+ sig {
138
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::PriceData))
139
+ }
140
+ attr_accessor :price_data
141
+ # Quantity for this item. Defaults to 1.
142
+ sig { returns(T.nilable(Integer)) }
143
+ attr_accessor :quantity
144
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
145
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
146
+ attr_accessor :tax_rates
147
+ sig {
148
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Discount]), metadata: T.nilable(T::Hash[String, String]), period: T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Period), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.any(String, T::Array[String]))).void
149
+ }
150
+ def initialize(
151
+ discounts: nil,
152
+ metadata: nil,
153
+ period: nil,
154
+ price: nil,
155
+ price_data: nil,
156
+ quantity: nil,
157
+ tax_rates: nil
158
+ ); end
159
+ end
160
+ class AutomaticTax < Stripe::RequestParams
161
+ class Liability < Stripe::RequestParams
162
+ # The connected account being referenced when `type` is `account`.
163
+ sig { returns(T.nilable(String)) }
164
+ attr_accessor :account
165
+ # Type of the account referenced in the request.
166
+ sig { returns(String) }
167
+ attr_accessor :type
168
+ sig { params(account: T.nilable(String), type: String).void }
169
+ def initialize(account: nil, type: nil); end
170
+ end
171
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
172
+ sig { returns(T::Boolean) }
173
+ attr_accessor :enabled
174
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
175
+ sig {
176
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax::Liability))
177
+ }
178
+ attr_accessor :liability
179
+ sig {
180
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax::Liability)).void
181
+ }
182
+ def initialize(enabled: nil, liability: nil); end
183
+ end
184
+ class BillingThresholds < Stripe::RequestParams
185
+ # Monetary threshold that triggers the subscription to advance to a new billing period
186
+ sig { returns(T.nilable(Integer)) }
187
+ attr_accessor :amount_gte
188
+ # 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.
189
+ sig { returns(T.nilable(T::Boolean)) }
190
+ attr_accessor :reset_billing_cycle_anchor
191
+ sig {
192
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
193
+ }
194
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
195
+ end
196
+ class CancellationDetails < Stripe::RequestParams
197
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
198
+ sig { returns(T.nilable(String)) }
199
+ attr_accessor :comment
200
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
201
+ sig { returns(T.nilable(T.any(String, String))) }
202
+ attr_accessor :feedback
203
+ sig { params(comment: T.nilable(String), feedback: T.nilable(T.any(String, String))).void }
204
+ def initialize(comment: nil, feedback: nil); end
205
+ end
206
+ class Discount < Stripe::RequestParams
207
+ # ID of the coupon to create a new discount for.
208
+ sig { returns(T.nilable(String)) }
209
+ attr_accessor :coupon
210
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
211
+ sig { returns(T.nilable(String)) }
212
+ attr_accessor :discount
213
+ # ID of the promotion code to create a new discount for.
214
+ sig { returns(T.nilable(String)) }
215
+ attr_accessor :promotion_code
216
+ sig {
217
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
218
+ }
219
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
220
+ end
221
+ class InvoiceSettings < Stripe::RequestParams
222
+ class Issuer < Stripe::RequestParams
223
+ # The connected account being referenced when `type` is `account`.
224
+ sig { returns(T.nilable(String)) }
225
+ attr_accessor :account
226
+ # Type of the account referenced in the request.
227
+ sig { returns(String) }
228
+ attr_accessor :type
229
+ sig { params(account: T.nilable(String), type: String).void }
230
+ def initialize(account: nil, type: nil); end
231
+ end
232
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
233
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
234
+ attr_accessor :account_tax_ids
235
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
236
+ sig {
237
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings::Issuer))
238
+ }
239
+ attr_accessor :issuer
240
+ sig {
241
+ params(account_tax_ids: T.nilable(T.any(String, T::Array[String])), issuer: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings::Issuer)).void
242
+ }
243
+ def initialize(account_tax_ids: nil, issuer: nil); end
244
+ end
245
+ class Item < Stripe::RequestParams
246
+ class BillingThresholds < Stripe::RequestParams
247
+ # 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))
248
+ sig { returns(Integer) }
249
+ attr_accessor :usage_gte
250
+ sig { params(usage_gte: Integer).void }
251
+ def initialize(usage_gte: nil); end
252
+ end
253
+ class Discount < Stripe::RequestParams
254
+ # ID of the coupon to create a new discount for.
255
+ sig { returns(T.nilable(String)) }
256
+ attr_accessor :coupon
257
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
258
+ sig { returns(T.nilable(String)) }
259
+ attr_accessor :discount
260
+ # ID of the promotion code to create a new discount for.
261
+ sig { returns(T.nilable(String)) }
262
+ attr_accessor :promotion_code
263
+ sig {
264
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
265
+ }
266
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
267
+ end
268
+ class PriceData < Stripe::RequestParams
269
+ class Recurring < Stripe::RequestParams
270
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
271
+ sig { returns(String) }
272
+ attr_accessor :interval
273
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
274
+ sig { returns(T.nilable(Integer)) }
275
+ attr_accessor :interval_count
276
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
277
+ def initialize(interval: nil, interval_count: nil); end
278
+ end
279
+ # 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).
280
+ sig { returns(String) }
281
+ attr_accessor :currency
282
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
283
+ sig { returns(String) }
284
+ attr_accessor :product
285
+ # The recurring components of a price such as `interval` and `interval_count`.
286
+ sig { returns(::Stripe::SubscriptionService::UpdateParams::Item::PriceData::Recurring) }
287
+ attr_accessor :recurring
288
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
289
+ sig { returns(T.nilable(String)) }
290
+ attr_accessor :tax_behavior
291
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
292
+ sig { returns(T.nilable(Integer)) }
293
+ attr_accessor :unit_amount
294
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
295
+ sig { returns(T.nilable(String)) }
296
+ attr_accessor :unit_amount_decimal
297
+ sig {
298
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionService::UpdateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
299
+ }
300
+ def initialize(
301
+ currency: nil,
302
+ product: nil,
303
+ recurring: nil,
304
+ tax_behavior: nil,
305
+ unit_amount: nil,
306
+ unit_amount_decimal: nil
307
+ ); end
308
+ end
309
+ # 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.
310
+ sig {
311
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds)))
312
+ }
313
+ attr_accessor :billing_thresholds
314
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
315
+ sig { returns(T.nilable(T::Boolean)) }
316
+ attr_accessor :clear_usage
317
+ # A flag that, if set to `true`, will delete the specified item.
318
+ sig { returns(T.nilable(T::Boolean)) }
319
+ attr_accessor :deleted
320
+ # The coupons to redeem into discounts for the subscription item.
321
+ sig {
322
+ returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Item::Discount])))
323
+ }
324
+ attr_accessor :discounts
325
+ # Subscription item to update.
326
+ sig { returns(T.nilable(String)) }
327
+ attr_accessor :id
328
+ # 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`.
329
+ sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
330
+ attr_accessor :metadata
331
+ # Plan ID for this item, as a string.
332
+ sig { returns(T.nilable(String)) }
333
+ attr_accessor :plan
334
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
335
+ sig { returns(T.nilable(String)) }
336
+ attr_accessor :price
337
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
338
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::Item::PriceData)) }
339
+ attr_accessor :price_data
340
+ # Quantity for this item.
341
+ sig { returns(T.nilable(Integer)) }
342
+ attr_accessor :quantity
343
+ # 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.
344
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
345
+ attr_accessor :tax_rates
346
+ sig {
347
+ params(billing_thresholds: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds)), clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Item::Discount])), id: T.nilable(String), metadata: T.nilable(T.any(String, T::Hash[String, String])), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::UpdateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.any(String, T::Array[String]))).void
348
+ }
349
+ def initialize(
350
+ billing_thresholds: nil,
351
+ clear_usage: nil,
352
+ deleted: nil,
353
+ discounts: nil,
354
+ id: nil,
355
+ metadata: nil,
356
+ plan: nil,
357
+ price: nil,
358
+ price_data: nil,
359
+ quantity: nil,
360
+ tax_rates: nil
361
+ ); end
362
+ end
363
+ class PauseCollection < Stripe::RequestParams
364
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
365
+ sig { returns(String) }
366
+ attr_accessor :behavior
367
+ # The time after which the subscription will resume collecting payments.
368
+ sig { returns(T.nilable(Integer)) }
369
+ attr_accessor :resumes_at
370
+ sig { params(behavior: String, resumes_at: T.nilable(Integer)).void }
371
+ def initialize(behavior: nil, resumes_at: nil); end
372
+ end
373
+ class PaymentSettings < Stripe::RequestParams
374
+ class PaymentMethodOptions < Stripe::RequestParams
375
+ class AcssDebit < Stripe::RequestParams
376
+ class MandateOptions < Stripe::RequestParams
377
+ # Transaction type of the mandate.
378
+ sig { returns(T.nilable(String)) }
379
+ attr_accessor :transaction_type
380
+ sig { params(transaction_type: T.nilable(String)).void }
381
+ def initialize(transaction_type: nil); end
382
+ end
383
+ # Additional fields for Mandate creation
384
+ sig {
385
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
386
+ }
387
+ attr_accessor :mandate_options
388
+ # Verification method for the intent
389
+ sig { returns(T.nilable(String)) }
390
+ attr_accessor :verification_method
391
+ sig {
392
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
393
+ }
394
+ def initialize(mandate_options: nil, verification_method: nil); end
395
+ end
396
+ class Bancontact < Stripe::RequestParams
397
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
398
+ sig { returns(T.nilable(String)) }
399
+ attr_accessor :preferred_language
400
+ sig { params(preferred_language: T.nilable(String)).void }
401
+ def initialize(preferred_language: nil); end
402
+ end
403
+ class Card < Stripe::RequestParams
404
+ class MandateOptions < Stripe::RequestParams
405
+ # Amount to be charged for future payments.
406
+ sig { returns(T.nilable(Integer)) }
407
+ attr_accessor :amount
408
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
409
+ sig { returns(T.nilable(String)) }
410
+ attr_accessor :amount_type
411
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
412
+ sig { returns(T.nilable(String)) }
413
+ attr_accessor :description
414
+ sig {
415
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
416
+ }
417
+ def initialize(amount: nil, amount_type: nil, description: nil); end
418
+ end
419
+ # Configuration options for setting up an eMandate for cards issued in India.
420
+ sig {
421
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
422
+ }
423
+ attr_accessor :mandate_options
424
+ # Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time.
425
+ sig { returns(T.nilable(String)) }
426
+ attr_accessor :network
427
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
428
+ sig { returns(T.nilable(String)) }
429
+ attr_accessor :request_three_d_secure
430
+ sig {
431
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
432
+ }
433
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
434
+ end
435
+ class CustomerBalance < Stripe::RequestParams
436
+ class BankTransfer < Stripe::RequestParams
437
+ class EuBankTransfer < Stripe::RequestParams
438
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
439
+ sig { returns(String) }
440
+ attr_accessor :country
441
+ sig { params(country: String).void }
442
+ def initialize(country: nil); end
443
+ end
444
+ # Configuration for eu_bank_transfer funding type.
445
+ sig {
446
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
447
+ }
448
+ attr_accessor :eu_bank_transfer
449
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
450
+ sig { returns(T.nilable(String)) }
451
+ attr_accessor :type
452
+ sig {
453
+ params(eu_bank_transfer: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
454
+ }
455
+ def initialize(eu_bank_transfer: nil, type: nil); end
456
+ end
457
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
458
+ sig {
459
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
460
+ }
461
+ attr_accessor :bank_transfer
462
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
463
+ sig { returns(T.nilable(String)) }
464
+ attr_accessor :funding_type
465
+ sig {
466
+ params(bank_transfer: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
467
+ }
468
+ def initialize(bank_transfer: nil, funding_type: nil); end
469
+ end
470
+ class Konbini < Stripe::RequestParams; end
471
+ class SepaDebit < Stripe::RequestParams; end
472
+ class UsBankAccount < Stripe::RequestParams
473
+ class FinancialConnections < Stripe::RequestParams
474
+ class Filters < Stripe::RequestParams
475
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
476
+ sig { returns(T.nilable(T::Array[String])) }
477
+ attr_accessor :account_subcategories
478
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
479
+ def initialize(account_subcategories: nil); end
480
+ end
481
+ # Provide filters for the linked accounts that the customer can select for the payment method.
482
+ sig {
483
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
484
+ }
485
+ attr_accessor :filters
486
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
487
+ sig { returns(T.nilable(T::Array[String])) }
488
+ attr_accessor :permissions
489
+ # List of data features that you would like to retrieve upon account creation.
490
+ sig { returns(T.nilable(T::Array[String])) }
491
+ attr_accessor :prefetch
492
+ sig {
493
+ params(filters: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
494
+ }
495
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
496
+ end
497
+ # Additional fields for Financial Connections Session creation
498
+ sig {
499
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
500
+ }
501
+ attr_accessor :financial_connections
502
+ # Verification method for the intent
503
+ sig { returns(T.nilable(String)) }
504
+ attr_accessor :verification_method
505
+ sig {
506
+ params(financial_connections: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
507
+ }
508
+ def initialize(financial_connections: nil, verification_method: nil); end
509
+ end
510
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
511
+ sig {
512
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit)))
513
+ }
514
+ attr_accessor :acss_debit
515
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
516
+ sig {
517
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact)))
518
+ }
519
+ attr_accessor :bancontact
520
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
521
+ sig {
522
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card)))
523
+ }
524
+ attr_accessor :card
525
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
526
+ sig {
527
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance)))
528
+ }
529
+ attr_accessor :customer_balance
530
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
531
+ sig {
532
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini)))
533
+ }
534
+ attr_accessor :konbini
535
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
536
+ sig {
537
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit)))
538
+ }
539
+ attr_accessor :sepa_debit
540
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
541
+ sig {
542
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))
543
+ }
544
+ attr_accessor :us_bank_account
545
+ sig {
546
+ params(acss_debit: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit)), bancontact: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact)), card: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card)), customer_balance: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance)), konbini: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini)), sepa_debit: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit)), us_bank_account: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))).void
547
+ }
548
+ def initialize(
549
+ acss_debit: nil,
550
+ bancontact: nil,
551
+ card: nil,
552
+ customer_balance: nil,
553
+ konbini: nil,
554
+ sepa_debit: nil,
555
+ us_bank_account: nil
556
+ ); end
557
+ end
558
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
559
+ sig {
560
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions))
561
+ }
562
+ attr_accessor :payment_method_options
563
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
564
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
565
+ attr_accessor :payment_method_types
566
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
567
+ sig { returns(T.nilable(String)) }
568
+ attr_accessor :save_default_payment_method
569
+ sig {
570
+ params(payment_method_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.any(String, T::Array[String])), save_default_payment_method: T.nilable(String)).void
571
+ }
572
+ def initialize(
573
+ payment_method_options: nil,
574
+ payment_method_types: nil,
575
+ save_default_payment_method: nil
576
+ ); end
577
+ end
578
+ class PendingInvoiceItemInterval < Stripe::RequestParams
579
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
580
+ sig { returns(String) }
581
+ attr_accessor :interval
582
+ # The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
583
+ sig { returns(T.nilable(Integer)) }
584
+ attr_accessor :interval_count
585
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
586
+ def initialize(interval: nil, interval_count: nil); end
587
+ end
588
+ class TransferData < Stripe::RequestParams
589
+ # 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 destination account. By default, the entire amount is transferred to the destination.
590
+ sig { returns(T.nilable(Float)) }
591
+ attr_accessor :amount_percent
592
+ # ID of an existing, connected Stripe account.
593
+ sig { returns(String) }
594
+ attr_accessor :destination
595
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
596
+ def initialize(amount_percent: nil, destination: nil); end
597
+ end
598
+ class TrialSettings < Stripe::RequestParams
599
+ class EndBehavior < Stripe::RequestParams
600
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
601
+ sig { returns(String) }
602
+ attr_accessor :missing_payment_method
603
+ sig { params(missing_payment_method: String).void }
604
+ def initialize(missing_payment_method: nil); end
605
+ end
606
+ # Defines how the subscription should behave when the user's free trial ends.
607
+ sig { returns(::Stripe::SubscriptionService::UpdateParams::TrialSettings::EndBehavior) }
608
+ attr_accessor :end_behavior
609
+ sig {
610
+ params(end_behavior: ::Stripe::SubscriptionService::UpdateParams::TrialSettings::EndBehavior).void
611
+ }
612
+ def initialize(end_behavior: nil); end
613
+ end
614
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
615
+ sig {
616
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]))
617
+ }
618
+ attr_accessor :add_invoice_items
619
+ # 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).
620
+ sig { returns(T.nilable(T.any(String, Float))) }
621
+ attr_accessor :application_fee_percent
622
+ # Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
623
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax)) }
624
+ attr_accessor :automatic_tax
625
+ # Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
626
+ sig { returns(T.nilable(String)) }
627
+ attr_accessor :billing_cycle_anchor
628
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
629
+ sig {
630
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::BillingThresholds)))
631
+ }
632
+ attr_accessor :billing_thresholds
633
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
634
+ sig { returns(T.nilable(T.any(String, T.any(Integer, String)))) }
635
+ attr_accessor :cancel_at
636
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
637
+ sig { returns(T.nilable(T::Boolean)) }
638
+ attr_accessor :cancel_at_period_end
639
+ # Details about why this subscription was cancelled
640
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::CancellationDetails)) }
641
+ attr_accessor :cancellation_details
642
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the 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`.
643
+ sig { returns(T.nilable(String)) }
644
+ attr_accessor :collection_method
645
+ # Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
646
+ sig { returns(T.nilable(Integer)) }
647
+ attr_accessor :days_until_due
648
+ # ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
649
+ sig { returns(T.nilable(String)) }
650
+ attr_accessor :default_payment_method
651
+ # ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
652
+ sig { returns(T.nilable(String)) }
653
+ attr_accessor :default_source
654
+ # The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates.
655
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
656
+ attr_accessor :default_tax_rates
657
+ # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
658
+ sig { returns(T.nilable(String)) }
659
+ attr_accessor :description
660
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
661
+ sig {
662
+ returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Discount])))
663
+ }
664
+ attr_accessor :discounts
665
+ # Specifies which fields in the response should be expanded.
666
+ sig { returns(T.nilable(T::Array[String])) }
667
+ attr_accessor :expand
668
+ # All invoices will be billed using the specified settings.
669
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings)) }
670
+ attr_accessor :invoice_settings
671
+ # A list of up to 20 subscription items, each with an attached price.
672
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::Item])) }
673
+ attr_accessor :items
674
+ # 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`.
675
+ sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
676
+ attr_accessor :metadata
677
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
678
+ sig { returns(T.nilable(T::Boolean)) }
679
+ attr_accessor :off_session
680
+ # The account on behalf of which to charge, for each of the subscription's invoices.
681
+ sig { returns(T.nilable(String)) }
682
+ attr_accessor :on_behalf_of
683
+ # 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).
684
+ sig {
685
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PauseCollection)))
686
+ }
687
+ attr_accessor :pause_collection
688
+ # Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.
689
+ #
690
+ # Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.
691
+ #
692
+ # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
693
+ #
694
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
695
+ sig { returns(T.nilable(String)) }
696
+ attr_accessor :payment_behavior
697
+ # Payment settings to pass to invoices created by the subscription.
698
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings)) }
699
+ attr_accessor :payment_settings
700
+ # Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
701
+ sig {
702
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval)))
703
+ }
704
+ attr_accessor :pending_invoice_item_interval
705
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
706
+ sig { returns(T.nilable(String)) }
707
+ attr_accessor :proration_behavior
708
+ # If set, prorations will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. `proration_date` can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
709
+ sig { returns(T.nilable(Integer)) }
710
+ attr_accessor :proration_date
711
+ # If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value.
712
+ sig {
713
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData)))
714
+ }
715
+ attr_accessor :transfer_data
716
+ # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, `trial_end` will override the default trial period of the plan the customer is being subscribed to. The `billing_cycle_anchor` will be updated to the `trial_end` value. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`.
717
+ sig { returns(T.nilable(T.any(String, Integer))) }
718
+ attr_accessor :trial_end
719
+ # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
720
+ sig { returns(T.nilable(T::Boolean)) }
721
+ attr_accessor :trial_from_plan
722
+ # Settings related to subscription trials.
723
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)) }
724
+ attr_accessor :trial_settings
725
+ sig {
726
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.any(String, Float)), automatic_tax: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::BillingThresholds)), cancel_at: T.nilable(T.any(String, T.any(Integer, String))), cancel_at_period_end: T.nilable(T::Boolean), cancellation_details: T.nilable(::Stripe::SubscriptionService::UpdateParams::CancellationDetails), collection_method: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T.any(String, T::Array[String])), description: T.nilable(String), discounts: T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Discount])), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::Item]), metadata: T.nilable(T.any(String, T::Hash[String, String])), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(String), pause_collection: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PauseCollection)), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval)), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData)), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)).void
727
+ }
728
+ def initialize(
729
+ add_invoice_items: nil,
730
+ application_fee_percent: nil,
731
+ automatic_tax: nil,
732
+ billing_cycle_anchor: nil,
733
+ billing_thresholds: nil,
734
+ cancel_at: nil,
735
+ cancel_at_period_end: nil,
736
+ cancellation_details: nil,
737
+ collection_method: nil,
738
+ days_until_due: nil,
739
+ default_payment_method: nil,
740
+ default_source: nil,
741
+ default_tax_rates: nil,
742
+ description: nil,
743
+ discounts: nil,
744
+ expand: nil,
745
+ invoice_settings: nil,
746
+ items: nil,
747
+ metadata: nil,
748
+ off_session: nil,
749
+ on_behalf_of: nil,
750
+ pause_collection: nil,
751
+ payment_behavior: nil,
752
+ payment_settings: nil,
753
+ pending_invoice_item_interval: nil,
754
+ proration_behavior: nil,
755
+ proration_date: nil,
756
+ transfer_data: nil,
757
+ trial_end: nil,
758
+ trial_from_plan: nil,
759
+ trial_settings: nil
760
+ ); end
761
+ end
762
+ class DeleteDiscountParams < Stripe::RequestParams; end
763
+ class ListParams < Stripe::RequestParams
764
+ class AutomaticTax < Stripe::RequestParams
765
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
766
+ sig { returns(T::Boolean) }
767
+ attr_accessor :enabled
768
+ sig { params(enabled: T::Boolean).void }
769
+ def initialize(enabled: nil); end
770
+ end
771
+ class Created < Stripe::RequestParams
772
+ # Minimum value to filter by (exclusive)
773
+ sig { returns(T.nilable(Integer)) }
774
+ attr_accessor :gt
775
+ # Minimum value to filter by (inclusive)
776
+ sig { returns(T.nilable(Integer)) }
777
+ attr_accessor :gte
778
+ # Maximum value to filter by (exclusive)
779
+ sig { returns(T.nilable(Integer)) }
780
+ attr_accessor :lt
781
+ # Maximum value to filter by (inclusive)
782
+ sig { returns(T.nilable(Integer)) }
783
+ attr_accessor :lte
784
+ sig {
785
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
786
+ }
787
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
788
+ end
789
+ class CurrentPeriodEnd < Stripe::RequestParams
790
+ # Minimum value to filter by (exclusive)
791
+ sig { returns(T.nilable(Integer)) }
792
+ attr_accessor :gt
793
+ # Minimum value to filter by (inclusive)
794
+ sig { returns(T.nilable(Integer)) }
795
+ attr_accessor :gte
796
+ # Maximum value to filter by (exclusive)
797
+ sig { returns(T.nilable(Integer)) }
798
+ attr_accessor :lt
799
+ # Maximum value to filter by (inclusive)
800
+ sig { returns(T.nilable(Integer)) }
801
+ attr_accessor :lte
802
+ sig {
803
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
804
+ }
805
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
806
+ end
807
+ class CurrentPeriodStart < Stripe::RequestParams
808
+ # Minimum value to filter by (exclusive)
809
+ sig { returns(T.nilable(Integer)) }
810
+ attr_accessor :gt
811
+ # Minimum value to filter by (inclusive)
812
+ sig { returns(T.nilable(Integer)) }
813
+ attr_accessor :gte
814
+ # Maximum value to filter by (exclusive)
815
+ sig { returns(T.nilable(Integer)) }
816
+ attr_accessor :lt
817
+ # Maximum value to filter by (inclusive)
818
+ sig { returns(T.nilable(Integer)) }
819
+ attr_accessor :lte
820
+ sig {
821
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
822
+ }
823
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
824
+ end
825
+ # Filter subscriptions by their automatic tax settings.
826
+ sig { returns(T.nilable(::Stripe::SubscriptionService::ListParams::AutomaticTax)) }
827
+ attr_accessor :automatic_tax
828
+ # The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`.
829
+ sig { returns(T.nilable(String)) }
830
+ attr_accessor :collection_method
831
+ # Only return subscriptions that were created during the given date interval.
832
+ sig { returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::Created, Integer))) }
833
+ attr_accessor :created
834
+ # Only return subscriptions whose minimum item current_period_end falls within the given date interval.
835
+ sig {
836
+ returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodEnd, Integer)))
837
+ }
838
+ attr_accessor :current_period_end
839
+ # Only return subscriptions whose maximum item current_period_start falls within the given date interval.
840
+ sig {
841
+ returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodStart, Integer)))
842
+ }
843
+ attr_accessor :current_period_start
844
+ # The ID of the customer whose subscriptions will be retrieved.
845
+ sig { returns(T.nilable(String)) }
846
+ attr_accessor :customer
847
+ # 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.
848
+ sig { returns(T.nilable(String)) }
849
+ attr_accessor :ending_before
850
+ # Specifies which fields in the response should be expanded.
851
+ sig { returns(T.nilable(T::Array[String])) }
852
+ attr_accessor :expand
853
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
854
+ sig { returns(T.nilable(Integer)) }
855
+ attr_accessor :limit
856
+ # The ID of the plan whose subscriptions will be retrieved.
857
+ sig { returns(T.nilable(String)) }
858
+ attr_accessor :plan
859
+ # Filter for subscriptions that contain this recurring price ID.
860
+ sig { returns(T.nilable(String)) }
861
+ attr_accessor :price
862
+ # A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
863
+ sig { returns(T.nilable(String)) }
864
+ attr_accessor :starting_after
865
+ # The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned.
866
+ sig { returns(T.nilable(String)) }
867
+ attr_accessor :status
868
+ # Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set.
869
+ sig { returns(T.nilable(String)) }
870
+ attr_accessor :test_clock
871
+ sig {
872
+ params(automatic_tax: T.nilable(::Stripe::SubscriptionService::ListParams::AutomaticTax), collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::Created, Integer)), current_period_end: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodEnd, Integer)), current_period_start: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodStart, Integer)), customer: T.nilable(String), ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), plan: T.nilable(String), price: T.nilable(String), starting_after: T.nilable(String), status: T.nilable(String), test_clock: T.nilable(String)).void
873
+ }
874
+ def initialize(
875
+ automatic_tax: nil,
876
+ collection_method: nil,
877
+ created: nil,
878
+ current_period_end: nil,
879
+ current_period_start: nil,
880
+ customer: nil,
881
+ ending_before: nil,
882
+ expand: nil,
883
+ limit: nil,
884
+ plan: nil,
885
+ price: nil,
886
+ starting_after: nil,
887
+ status: nil,
888
+ test_clock: nil
889
+ ); end
890
+ end
891
+ class CreateParams < Stripe::RequestParams
892
+ class AddInvoiceItem < Stripe::RequestParams
893
+ class Discount < Stripe::RequestParams
894
+ # ID of the coupon to create a new discount for.
895
+ sig { returns(T.nilable(String)) }
896
+ attr_accessor :coupon
897
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
898
+ sig { returns(T.nilable(String)) }
899
+ attr_accessor :discount
900
+ # ID of the promotion code to create a new discount for.
901
+ sig { returns(T.nilable(String)) }
902
+ attr_accessor :promotion_code
903
+ sig {
904
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
905
+ }
906
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
907
+ end
908
+ class Period < Stripe::RequestParams
909
+ class End < Stripe::RequestParams
910
+ # A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`.
911
+ sig { returns(T.nilable(Integer)) }
912
+ attr_accessor :timestamp
913
+ # Select how to calculate the end of the invoice item period.
914
+ sig { returns(String) }
915
+ attr_accessor :type
916
+ sig { params(timestamp: T.nilable(Integer), type: String).void }
917
+ def initialize(timestamp: nil, type: nil); end
918
+ end
919
+ class Start < Stripe::RequestParams
920
+ # A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`.
921
+ sig { returns(T.nilable(Integer)) }
922
+ attr_accessor :timestamp
923
+ # Select how to calculate the start of the invoice item period.
924
+ sig { returns(String) }
925
+ attr_accessor :type
926
+ sig { params(timestamp: T.nilable(Integer), type: String).void }
927
+ def initialize(timestamp: nil, type: nil); end
928
+ end
929
+ # End of the invoice item period.
930
+ sig { returns(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period::End) }
931
+ attr_accessor :end
932
+ # Start of the invoice item period.
933
+ sig {
934
+ returns(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period::Start)
935
+ }
936
+ attr_accessor :start
937
+ sig {
938
+ params(end_: ::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period::End, start: ::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period::Start).void
939
+ }
940
+ def initialize(end_: nil, start: nil); end
941
+ end
942
+ class PriceData < Stripe::RequestParams
943
+ # 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).
944
+ sig { returns(String) }
945
+ attr_accessor :currency
946
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
947
+ sig { returns(String) }
948
+ attr_accessor :product
949
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
950
+ sig { returns(T.nilable(String)) }
951
+ attr_accessor :tax_behavior
952
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
953
+ sig { returns(T.nilable(Integer)) }
954
+ attr_accessor :unit_amount
955
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
956
+ sig { returns(T.nilable(String)) }
957
+ attr_accessor :unit_amount_decimal
958
+ sig {
959
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
960
+ }
961
+ def initialize(
962
+ currency: nil,
963
+ product: nil,
964
+ tax_behavior: nil,
965
+ unit_amount: nil,
966
+ unit_amount_decimal: nil
967
+ ); end
968
+ end
969
+ # The coupons to redeem into discounts for the item.
970
+ sig {
971
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Discount]))
972
+ }
973
+ attr_accessor :discounts
974
+ # 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`.
975
+ sig { returns(T.nilable(T::Hash[String, String])) }
976
+ attr_accessor :metadata
977
+ # The period associated with this invoice item. Defaults to the current period of the subscription.
978
+ sig {
979
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period))
980
+ }
981
+ attr_accessor :period
982
+ # The ID of the price object. One of `price` or `price_data` is required.
983
+ sig { returns(T.nilable(String)) }
984
+ attr_accessor :price
985
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
986
+ sig {
987
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::PriceData))
988
+ }
989
+ attr_accessor :price_data
990
+ # Quantity for this item. Defaults to 1.
991
+ sig { returns(T.nilable(Integer)) }
992
+ attr_accessor :quantity
993
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
994
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
995
+ attr_accessor :tax_rates
996
+ sig {
997
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Discount]), metadata: T.nilable(T::Hash[String, String]), period: T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Period), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.any(String, T::Array[String]))).void
998
+ }
999
+ def initialize(
1000
+ discounts: nil,
1001
+ metadata: nil,
1002
+ period: nil,
1003
+ price: nil,
1004
+ price_data: nil,
1005
+ quantity: nil,
1006
+ tax_rates: nil
1007
+ ); end
1008
+ end
1009
+ class AutomaticTax < Stripe::RequestParams
1010
+ class Liability < Stripe::RequestParams
1011
+ # The connected account being referenced when `type` is `account`.
1012
+ sig { returns(T.nilable(String)) }
1013
+ attr_accessor :account
1014
+ # Type of the account referenced in the request.
1015
+ sig { returns(String) }
1016
+ attr_accessor :type
1017
+ sig { params(account: T.nilable(String), type: String).void }
1018
+ def initialize(account: nil, type: nil); end
1019
+ end
1020
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1021
+ sig { returns(T::Boolean) }
1022
+ attr_accessor :enabled
1023
+ # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
1024
+ sig {
1025
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax::Liability))
1026
+ }
1027
+ attr_accessor :liability
1028
+ sig {
1029
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax::Liability)).void
1030
+ }
1031
+ def initialize(enabled: nil, liability: nil); end
1032
+ end
1033
+ class BillingCycleAnchorConfig < Stripe::RequestParams
1034
+ # The day of the month the anchor should be. Ranges from 1 to 31.
1035
+ sig { returns(Integer) }
1036
+ attr_accessor :day_of_month
1037
+ # The hour of the day the anchor should be. Ranges from 0 to 23.
1038
+ sig { returns(T.nilable(Integer)) }
1039
+ attr_accessor :hour
1040
+ # The minute of the hour the anchor should be. Ranges from 0 to 59.
1041
+ sig { returns(T.nilable(Integer)) }
1042
+ attr_accessor :minute
1043
+ # The month to start full cycle periods. Ranges from 1 to 12.
1044
+ sig { returns(T.nilable(Integer)) }
1045
+ attr_accessor :month
1046
+ # The second of the minute the anchor should be. Ranges from 0 to 59.
1047
+ sig { returns(T.nilable(Integer)) }
1048
+ attr_accessor :second
1049
+ sig {
1050
+ params(day_of_month: Integer, hour: T.nilable(Integer), minute: T.nilable(Integer), month: T.nilable(Integer), second: T.nilable(Integer)).void
1051
+ }
1052
+ def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil); end
1053
+ end
1054
+ class BillingMode < Stripe::RequestParams
1055
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
1056
+ sig { returns(String) }
1057
+ attr_accessor :type
1058
+ sig { params(type: String).void }
1059
+ def initialize(type: nil); end
1060
+ end
1061
+ class BillingThresholds < Stripe::RequestParams
1062
+ # Monetary threshold that triggers the subscription to advance to a new billing period
1063
+ sig { returns(T.nilable(Integer)) }
1064
+ attr_accessor :amount_gte
1065
+ # 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.
1066
+ sig { returns(T.nilable(T::Boolean)) }
1067
+ attr_accessor :reset_billing_cycle_anchor
1068
+ sig {
1069
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
1070
+ }
1071
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
1072
+ end
1073
+ class Discount < Stripe::RequestParams
1074
+ # ID of the coupon to create a new discount for.
1075
+ sig { returns(T.nilable(String)) }
1076
+ attr_accessor :coupon
1077
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1078
+ sig { returns(T.nilable(String)) }
1079
+ attr_accessor :discount
1080
+ # ID of the promotion code to create a new discount for.
1081
+ sig { returns(T.nilable(String)) }
1082
+ attr_accessor :promotion_code
1083
+ sig {
1084
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1085
+ }
1086
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1087
+ end
1088
+ class InvoiceSettings < Stripe::RequestParams
1089
+ class Issuer < Stripe::RequestParams
1090
+ # The connected account being referenced when `type` is `account`.
1091
+ sig { returns(T.nilable(String)) }
1092
+ attr_accessor :account
1093
+ # Type of the account referenced in the request.
1094
+ sig { returns(String) }
1095
+ attr_accessor :type
1096
+ sig { params(account: T.nilable(String), type: String).void }
1097
+ def initialize(account: nil, type: nil); end
1098
+ end
1099
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
1100
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
1101
+ attr_accessor :account_tax_ids
1102
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1103
+ sig {
1104
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings::Issuer))
1105
+ }
1106
+ attr_accessor :issuer
1107
+ sig {
1108
+ params(account_tax_ids: T.nilable(T.any(String, T::Array[String])), issuer: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings::Issuer)).void
1109
+ }
1110
+ def initialize(account_tax_ids: nil, issuer: nil); end
1111
+ end
1112
+ class Item < Stripe::RequestParams
1113
+ class BillingThresholds < Stripe::RequestParams
1114
+ # 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))
1115
+ sig { returns(Integer) }
1116
+ attr_accessor :usage_gte
1117
+ sig { params(usage_gte: Integer).void }
1118
+ def initialize(usage_gte: nil); end
1119
+ end
1120
+ class Discount < Stripe::RequestParams
1121
+ # ID of the coupon to create a new discount for.
1122
+ sig { returns(T.nilable(String)) }
1123
+ attr_accessor :coupon
1124
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1125
+ sig { returns(T.nilable(String)) }
1126
+ attr_accessor :discount
1127
+ # ID of the promotion code to create a new discount for.
1128
+ sig { returns(T.nilable(String)) }
1129
+ attr_accessor :promotion_code
1130
+ sig {
1131
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1132
+ }
1133
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1134
+ end
1135
+ class PriceData < Stripe::RequestParams
1136
+ class Recurring < Stripe::RequestParams
1137
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1138
+ sig { returns(String) }
1139
+ attr_accessor :interval
1140
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
1141
+ sig { returns(T.nilable(Integer)) }
1142
+ attr_accessor :interval_count
1143
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1144
+ def initialize(interval: nil, interval_count: nil); end
1145
+ end
1146
+ # 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).
1147
+ sig { returns(String) }
1148
+ attr_accessor :currency
1149
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1150
+ sig { returns(String) }
1151
+ attr_accessor :product
1152
+ # The recurring components of a price such as `interval` and `interval_count`.
1153
+ sig { returns(::Stripe::SubscriptionService::CreateParams::Item::PriceData::Recurring) }
1154
+ attr_accessor :recurring
1155
+ # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
1156
+ sig { returns(T.nilable(String)) }
1157
+ attr_accessor :tax_behavior
1158
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1159
+ sig { returns(T.nilable(Integer)) }
1160
+ attr_accessor :unit_amount
1161
+ # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
1162
+ sig { returns(T.nilable(String)) }
1163
+ attr_accessor :unit_amount_decimal
1164
+ sig {
1165
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionService::CreateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1166
+ }
1167
+ def initialize(
1168
+ currency: nil,
1169
+ product: nil,
1170
+ recurring: nil,
1171
+ tax_behavior: nil,
1172
+ unit_amount: nil,
1173
+ unit_amount_decimal: nil
1174
+ ); end
1175
+ end
1176
+ # 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.
1177
+ sig {
1178
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds)))
1179
+ }
1180
+ attr_accessor :billing_thresholds
1181
+ # The coupons to redeem into discounts for the subscription item.
1182
+ sig {
1183
+ returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount])))
1184
+ }
1185
+ attr_accessor :discounts
1186
+ # 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`.
1187
+ sig { returns(T.nilable(T::Hash[String, String])) }
1188
+ attr_accessor :metadata
1189
+ # Plan ID for this item, as a string.
1190
+ sig { returns(T.nilable(String)) }
1191
+ attr_accessor :plan
1192
+ # The ID of the price object.
1193
+ sig { returns(T.nilable(String)) }
1194
+ attr_accessor :price
1195
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1196
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData)) }
1197
+ attr_accessor :price_data
1198
+ # Quantity for this item.
1199
+ sig { returns(T.nilable(Integer)) }
1200
+ attr_accessor :quantity
1201
+ # 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.
1202
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
1203
+ attr_accessor :tax_rates
1204
+ sig {
1205
+ params(billing_thresholds: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds)), discounts: T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount])), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.any(String, T::Array[String]))).void
1206
+ }
1207
+ def initialize(
1208
+ billing_thresholds: nil,
1209
+ discounts: nil,
1210
+ metadata: nil,
1211
+ plan: nil,
1212
+ price: nil,
1213
+ price_data: nil,
1214
+ quantity: nil,
1215
+ tax_rates: nil
1216
+ ); end
1217
+ end
1218
+ class PaymentSettings < Stripe::RequestParams
1219
+ class PaymentMethodOptions < Stripe::RequestParams
1220
+ class AcssDebit < Stripe::RequestParams
1221
+ class MandateOptions < Stripe::RequestParams
1222
+ # Transaction type of the mandate.
1223
+ sig { returns(T.nilable(String)) }
1224
+ attr_accessor :transaction_type
1225
+ sig { params(transaction_type: T.nilable(String)).void }
1226
+ def initialize(transaction_type: nil); end
1227
+ end
1228
+ # Additional fields for Mandate creation
1229
+ sig {
1230
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
1231
+ }
1232
+ attr_accessor :mandate_options
1233
+ # Verification method for the intent
1234
+ sig { returns(T.nilable(String)) }
1235
+ attr_accessor :verification_method
1236
+ sig {
1237
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
1238
+ }
1239
+ def initialize(mandate_options: nil, verification_method: nil); end
1240
+ end
1241
+ class Bancontact < Stripe::RequestParams
1242
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1243
+ sig { returns(T.nilable(String)) }
1244
+ attr_accessor :preferred_language
1245
+ sig { params(preferred_language: T.nilable(String)).void }
1246
+ def initialize(preferred_language: nil); end
1247
+ end
1248
+ class Card < Stripe::RequestParams
1249
+ class MandateOptions < Stripe::RequestParams
1250
+ # Amount to be charged for future payments.
1251
+ sig { returns(T.nilable(Integer)) }
1252
+ attr_accessor :amount
1253
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1254
+ sig { returns(T.nilable(String)) }
1255
+ attr_accessor :amount_type
1256
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1257
+ sig { returns(T.nilable(String)) }
1258
+ attr_accessor :description
1259
+ sig {
1260
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
1261
+ }
1262
+ def initialize(amount: nil, amount_type: nil, description: nil); end
1263
+ end
1264
+ # Configuration options for setting up an eMandate for cards issued in India.
1265
+ sig {
1266
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
1267
+ }
1268
+ attr_accessor :mandate_options
1269
+ # Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time.
1270
+ sig { returns(T.nilable(String)) }
1271
+ attr_accessor :network
1272
+ # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
1273
+ sig { returns(T.nilable(String)) }
1274
+ attr_accessor :request_three_d_secure
1275
+ sig {
1276
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
1277
+ }
1278
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
1279
+ end
1280
+ class CustomerBalance < Stripe::RequestParams
1281
+ class BankTransfer < Stripe::RequestParams
1282
+ class EuBankTransfer < Stripe::RequestParams
1283
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1284
+ sig { returns(String) }
1285
+ attr_accessor :country
1286
+ sig { params(country: String).void }
1287
+ def initialize(country: nil); end
1288
+ end
1289
+ # Configuration for eu_bank_transfer funding type.
1290
+ sig {
1291
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
1292
+ }
1293
+ attr_accessor :eu_bank_transfer
1294
+ # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
1295
+ sig { returns(T.nilable(String)) }
1296
+ attr_accessor :type
1297
+ sig {
1298
+ params(eu_bank_transfer: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
1299
+ }
1300
+ def initialize(eu_bank_transfer: nil, type: nil); end
1301
+ end
1302
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1303
+ sig {
1304
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
1305
+ }
1306
+ attr_accessor :bank_transfer
1307
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1308
+ sig { returns(T.nilable(String)) }
1309
+ attr_accessor :funding_type
1310
+ sig {
1311
+ params(bank_transfer: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
1312
+ }
1313
+ def initialize(bank_transfer: nil, funding_type: nil); end
1314
+ end
1315
+ class Konbini < Stripe::RequestParams; end
1316
+ class SepaDebit < Stripe::RequestParams; end
1317
+ class UsBankAccount < Stripe::RequestParams
1318
+ class FinancialConnections < Stripe::RequestParams
1319
+ class Filters < Stripe::RequestParams
1320
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1321
+ sig { returns(T.nilable(T::Array[String])) }
1322
+ attr_accessor :account_subcategories
1323
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
1324
+ def initialize(account_subcategories: nil); end
1325
+ end
1326
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1327
+ sig {
1328
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
1329
+ }
1330
+ attr_accessor :filters
1331
+ # The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
1332
+ sig { returns(T.nilable(T::Array[String])) }
1333
+ attr_accessor :permissions
1334
+ # List of data features that you would like to retrieve upon account creation.
1335
+ sig { returns(T.nilable(T::Array[String])) }
1336
+ attr_accessor :prefetch
1337
+ sig {
1338
+ params(filters: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
1339
+ }
1340
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
1341
+ end
1342
+ # Additional fields for Financial Connections Session creation
1343
+ sig {
1344
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
1345
+ }
1346
+ attr_accessor :financial_connections
1347
+ # Verification method for the intent
1348
+ sig { returns(T.nilable(String)) }
1349
+ attr_accessor :verification_method
1350
+ sig {
1351
+ params(financial_connections: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1352
+ }
1353
+ def initialize(financial_connections: nil, verification_method: nil); end
1354
+ end
1355
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1356
+ sig {
1357
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit)))
1358
+ }
1359
+ attr_accessor :acss_debit
1360
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1361
+ sig {
1362
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact)))
1363
+ }
1364
+ attr_accessor :bancontact
1365
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1366
+ sig {
1367
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card)))
1368
+ }
1369
+ attr_accessor :card
1370
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1371
+ sig {
1372
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance)))
1373
+ }
1374
+ attr_accessor :customer_balance
1375
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1376
+ sig {
1377
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini)))
1378
+ }
1379
+ attr_accessor :konbini
1380
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1381
+ sig {
1382
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit)))
1383
+ }
1384
+ attr_accessor :sepa_debit
1385
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1386
+ sig {
1387
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))
1388
+ }
1389
+ attr_accessor :us_bank_account
1390
+ sig {
1391
+ params(acss_debit: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit)), bancontact: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact)), card: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card)), customer_balance: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance)), konbini: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini)), sepa_debit: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit)), us_bank_account: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))).void
1392
+ }
1393
+ def initialize(
1394
+ acss_debit: nil,
1395
+ bancontact: nil,
1396
+ card: nil,
1397
+ customer_balance: nil,
1398
+ konbini: nil,
1399
+ sepa_debit: nil,
1400
+ us_bank_account: nil
1401
+ ); end
1402
+ end
1403
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
1404
+ sig {
1405
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions))
1406
+ }
1407
+ attr_accessor :payment_method_options
1408
+ # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration
1409
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
1410
+ attr_accessor :payment_method_types
1411
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
1412
+ sig { returns(T.nilable(String)) }
1413
+ attr_accessor :save_default_payment_method
1414
+ sig {
1415
+ params(payment_method_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.any(String, T::Array[String])), save_default_payment_method: T.nilable(String)).void
1416
+ }
1417
+ def initialize(
1418
+ payment_method_options: nil,
1419
+ payment_method_types: nil,
1420
+ save_default_payment_method: nil
1421
+ ); end
1422
+ end
1423
+ class PendingInvoiceItemInterval < Stripe::RequestParams
1424
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
1425
+ sig { returns(String) }
1426
+ attr_accessor :interval
1427
+ # The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
1428
+ sig { returns(T.nilable(Integer)) }
1429
+ attr_accessor :interval_count
1430
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1431
+ def initialize(interval: nil, interval_count: nil); end
1432
+ end
1433
+ class TransferData < Stripe::RequestParams
1434
+ # 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 destination account. By default, the entire amount is transferred to the destination.
1435
+ sig { returns(T.nilable(Float)) }
1436
+ attr_accessor :amount_percent
1437
+ # ID of an existing, connected Stripe account.
1438
+ sig { returns(String) }
1439
+ attr_accessor :destination
1440
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1441
+ def initialize(amount_percent: nil, destination: nil); end
1442
+ end
1443
+ class TrialSettings < Stripe::RequestParams
1444
+ class EndBehavior < Stripe::RequestParams
1445
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1446
+ sig { returns(String) }
1447
+ attr_accessor :missing_payment_method
1448
+ sig { params(missing_payment_method: String).void }
1449
+ def initialize(missing_payment_method: nil); end
1450
+ end
1451
+ # Defines how the subscription should behave when the user's free trial ends.
1452
+ sig { returns(::Stripe::SubscriptionService::CreateParams::TrialSettings::EndBehavior) }
1453
+ attr_accessor :end_behavior
1454
+ sig {
1455
+ params(end_behavior: ::Stripe::SubscriptionService::CreateParams::TrialSettings::EndBehavior).void
1456
+ }
1457
+ def initialize(end_behavior: nil); end
1458
+ end
1459
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.
1460
+ sig {
1461
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]))
1462
+ }
1463
+ attr_accessor :add_invoice_items
1464
+ # 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).
1465
+ sig { returns(T.nilable(T.any(String, Float))) }
1466
+ attr_accessor :application_fee_percent
1467
+ # Automatic tax settings for this subscription.
1468
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax)) }
1469
+ attr_accessor :automatic_tax
1470
+ # A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
1471
+ sig { returns(T.nilable(Integer)) }
1472
+ attr_accessor :backdate_start_date
1473
+ # A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
1474
+ sig { returns(T.nilable(Integer)) }
1475
+ attr_accessor :billing_cycle_anchor
1476
+ # Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC.
1477
+ sig {
1478
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig))
1479
+ }
1480
+ attr_accessor :billing_cycle_anchor_config
1481
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
1482
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::BillingMode)) }
1483
+ attr_accessor :billing_mode
1484
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1485
+ sig {
1486
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::BillingThresholds)))
1487
+ }
1488
+ attr_accessor :billing_thresholds
1489
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
1490
+ sig { returns(T.nilable(T.any(Integer, String))) }
1491
+ attr_accessor :cancel_at
1492
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
1493
+ sig { returns(T.nilable(T::Boolean)) }
1494
+ attr_accessor :cancel_at_period_end
1495
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the 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`.
1496
+ sig { returns(T.nilable(String)) }
1497
+ attr_accessor :collection_method
1498
+ # 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).
1499
+ sig { returns(T.nilable(String)) }
1500
+ attr_accessor :currency
1501
+ # The identifier of the customer to subscribe.
1502
+ sig { returns(String) }
1503
+ attr_accessor :customer
1504
+ # Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.
1505
+ sig { returns(T.nilable(Integer)) }
1506
+ attr_accessor :days_until_due
1507
+ # ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
1508
+ sig { returns(T.nilable(String)) }
1509
+ attr_accessor :default_payment_method
1510
+ # ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).
1511
+ sig { returns(T.nilable(String)) }
1512
+ attr_accessor :default_source
1513
+ # The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.
1514
+ sig { returns(T.nilable(T.any(String, T::Array[String]))) }
1515
+ attr_accessor :default_tax_rates
1516
+ # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
1517
+ sig { returns(T.nilable(String)) }
1518
+ attr_accessor :description
1519
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
1520
+ sig {
1521
+ returns(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Discount])))
1522
+ }
1523
+ attr_accessor :discounts
1524
+ # Specifies which fields in the response should be expanded.
1525
+ sig { returns(T.nilable(T::Array[String])) }
1526
+ attr_accessor :expand
1527
+ # All invoices will be billed using the specified settings.
1528
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings)) }
1529
+ attr_accessor :invoice_settings
1530
+ # A list of up to 20 subscription items, each with an attached price.
1531
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::Item])) }
1532
+ attr_accessor :items
1533
+ # 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`.
1534
+ sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
1535
+ attr_accessor :metadata
1536
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
1537
+ sig { returns(T.nilable(T::Boolean)) }
1538
+ attr_accessor :off_session
1539
+ # The account on behalf of which to charge, for each of the subscription's invoices.
1540
+ sig { returns(T.nilable(String)) }
1541
+ attr_accessor :on_behalf_of
1542
+ # Only applies to subscriptions with `collection_method=charge_automatically`.
1543
+ #
1544
+ # Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.
1545
+ #
1546
+ # Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer actions are needed to pay a subscription’s invoice, such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state.
1547
+ #
1548
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a Subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
1549
+ #
1550
+ # `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription.
1551
+ #
1552
+ # Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status.
1553
+ sig { returns(T.nilable(String)) }
1554
+ attr_accessor :payment_behavior
1555
+ # Payment settings to pass to invoices created by the subscription.
1556
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings)) }
1557
+ attr_accessor :payment_settings
1558
+ # Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.
1559
+ sig {
1560
+ returns(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval)))
1561
+ }
1562
+ attr_accessor :pending_invoice_item_interval
1563
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.
1564
+ sig { returns(T.nilable(String)) }
1565
+ attr_accessor :proration_behavior
1566
+ # If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.
1567
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::TransferData)) }
1568
+ attr_accessor :transfer_data
1569
+ # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
1570
+ sig { returns(T.nilable(T.any(String, Integer))) }
1571
+ attr_accessor :trial_end
1572
+ # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
1573
+ sig { returns(T.nilable(T::Boolean)) }
1574
+ attr_accessor :trial_from_plan
1575
+ # Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
1576
+ sig { returns(T.nilable(Integer)) }
1577
+ attr_accessor :trial_period_days
1578
+ # Settings related to subscription trials.
1579
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::TrialSettings)) }
1580
+ attr_accessor :trial_settings
1581
+ sig {
1582
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.any(String, Float)), automatic_tax: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig), billing_mode: T.nilable(::Stripe::SubscriptionService::CreateParams::BillingMode), billing_thresholds: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::BillingThresholds)), cancel_at: T.nilable(T.any(Integer, String)), cancel_at_period_end: T.nilable(T::Boolean), collection_method: T.nilable(String), currency: T.nilable(String), customer: String, days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(String), default_tax_rates: T.nilable(T.any(String, T::Array[String])), description: T.nilable(String), discounts: T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Discount])), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::Item]), metadata: T.nilable(T.any(String, T::Hash[String, String])), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(String), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval)), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionService::CreateParams::TransferData), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_period_days: T.nilable(Integer), trial_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::TrialSettings)).void
1583
+ }
1584
+ def initialize(
1585
+ add_invoice_items: nil,
1586
+ application_fee_percent: nil,
1587
+ automatic_tax: nil,
1588
+ backdate_start_date: nil,
1589
+ billing_cycle_anchor: nil,
1590
+ billing_cycle_anchor_config: nil,
1591
+ billing_mode: nil,
1592
+ billing_thresholds: nil,
1593
+ cancel_at: nil,
1594
+ cancel_at_period_end: nil,
1595
+ collection_method: nil,
1596
+ currency: nil,
1597
+ customer: nil,
1598
+ days_until_due: nil,
1599
+ default_payment_method: nil,
1600
+ default_source: nil,
1601
+ default_tax_rates: nil,
1602
+ description: nil,
1603
+ discounts: nil,
1604
+ expand: nil,
1605
+ invoice_settings: nil,
1606
+ items: nil,
1607
+ metadata: nil,
1608
+ off_session: nil,
1609
+ on_behalf_of: nil,
1610
+ payment_behavior: nil,
1611
+ payment_settings: nil,
1612
+ pending_invoice_item_interval: nil,
1613
+ proration_behavior: nil,
1614
+ transfer_data: nil,
1615
+ trial_end: nil,
1616
+ trial_from_plan: nil,
1617
+ trial_period_days: nil,
1618
+ trial_settings: nil
1619
+ ); end
1620
+ end
1621
+ class SearchParams < Stripe::RequestParams
1622
+ # Specifies which fields in the response should be expanded.
1623
+ sig { returns(T.nilable(T::Array[String])) }
1624
+ attr_accessor :expand
1625
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1626
+ sig { returns(T.nilable(Integer)) }
1627
+ attr_accessor :limit
1628
+ # A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
1629
+ sig { returns(T.nilable(String)) }
1630
+ attr_accessor :page
1631
+ # The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions).
1632
+ sig { returns(String) }
1633
+ attr_accessor :query
1634
+ sig {
1635
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
1636
+ }
1637
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
1638
+ end
1639
+ class MigrateParams < Stripe::RequestParams
1640
+ class BillingMode < Stripe::RequestParams
1641
+ # Attribute for param field type
1642
+ sig { returns(String) }
1643
+ attr_accessor :type
1644
+ sig { params(type: String).void }
1645
+ def initialize(type: nil); end
1646
+ end
1647
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
1648
+ sig { returns(::Stripe::SubscriptionService::MigrateParams::BillingMode) }
1649
+ attr_accessor :billing_mode
1650
+ # Specifies which fields in the response should be expanded.
1651
+ sig { returns(T.nilable(T::Array[String])) }
1652
+ attr_accessor :expand
1653
+ sig {
1654
+ params(billing_mode: ::Stripe::SubscriptionService::MigrateParams::BillingMode, expand: T.nilable(T::Array[String])).void
1655
+ }
1656
+ def initialize(billing_mode: nil, expand: nil); end
1657
+ end
1658
+ class ResumeParams < Stripe::RequestParams
1659
+ # The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
1660
+ sig { returns(T.nilable(String)) }
1661
+ attr_accessor :billing_cycle_anchor
1662
+ # Specifies which fields in the response should be expanded.
1663
+ sig { returns(T.nilable(T::Array[String])) }
1664
+ attr_accessor :expand
1665
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor` being `unchanged`. When the `billing_cycle_anchor` is set to `now` (default value), no prorations are generated. If no value is passed, the default is `create_prorations`.
1666
+ sig { returns(T.nilable(String)) }
1667
+ attr_accessor :proration_behavior
1668
+ # If set, prorations will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
1669
+ sig { returns(T.nilable(Integer)) }
1670
+ attr_accessor :proration_date
1671
+ sig {
1672
+ params(billing_cycle_anchor: T.nilable(String), expand: T.nilable(T::Array[String]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer)).void
1673
+ }
1674
+ def initialize(
1675
+ billing_cycle_anchor: nil,
1676
+ expand: nil,
1677
+ proration_behavior: nil,
1678
+ proration_date: nil
1679
+ ); end
1680
+ end
1681
+ # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).
1682
+ #
1683
+ # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
1684
+ #
1685
+ # By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
1686
+ sig {
1687
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1688
+ }
1689
+ def cancel(subscription_exposed_id, params = {}, opts = {}); end
1690
+
1691
+ # Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
1692
+ #
1693
+ # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
1694
+ # The payment_behavior parameter determines the exact behavior of the initial payment.
1695
+ #
1696
+ # To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://docs.stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
1697
+ # Schedules provide the flexibility to model more complex billing configurations that change over time.
1698
+ sig {
1699
+ params(params: T.any(::Stripe::SubscriptionService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1700
+ }
1701
+ def create(params = {}, opts = {}); end
1702
+
1703
+ # Removes the currently applied discount on a subscription.
1704
+ sig {
1705
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::DeleteDiscountParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Discount)
1706
+ }
1707
+ def delete_discount(subscription_exposed_id, params = {}, opts = {}); end
1708
+
1709
+ # By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
1710
+ sig {
1711
+ params(params: T.any(::Stripe::SubscriptionService::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
1712
+ }
1713
+ def list(params = {}, opts = {}); end
1714
+
1715
+ # Upgrade the billing_mode of an existing subscription.
1716
+ sig {
1717
+ params(subscription: String, params: T.any(::Stripe::SubscriptionService::MigrateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1718
+ }
1719
+ def migrate(subscription, params = {}, opts = {}); end
1720
+
1721
+ # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
1722
+ sig {
1723
+ params(subscription: String, params: T.any(::Stripe::SubscriptionService::ResumeParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1724
+ }
1725
+ def resume(subscription, params = {}, opts = {}); end
1726
+
1727
+ # Retrieves the subscription with the given ID.
1728
+ sig {
1729
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1730
+ }
1731
+ def retrieve(subscription_exposed_id, params = {}, opts = {}); end
1732
+
1733
+ # Search for subscriptions you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
1734
+ # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
1735
+ # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
1736
+ # to an hour behind during outages. Search functionality is not available to merchants in India.
1737
+ sig {
1738
+ params(params: T.any(::Stripe::SubscriptionService::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
1739
+ }
1740
+ def search(params = {}, opts = {}); end
1741
+
1742
+ # Updates an existing subscription to match the specified parameters.
1743
+ # When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
1744
+ # To preview how the proration is calculated, use the [create preview](https://docs.stripe.com/docs/api/invoices/create_preview) endpoint.
1745
+ #
1746
+ # By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
1747
+ #
1748
+ # Switching prices does not normally change the billing date or generate an immediate charge unless:
1749
+ #
1750
+ #
1751
+ # The billing interval is changed (for example, from monthly to yearly).
1752
+ # The subscription moves from free to paid.
1753
+ # A trial starts or ends.
1754
+ #
1755
+ #
1756
+ # In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://docs.stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment).
1757
+ #
1758
+ # If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://docs.stripe.com/docs/api/invoices/create).
1759
+ #
1760
+ # If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription.
1761
+ #
1762
+ # Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://docs.stripe.com/docs/rate-limits) instead.
1763
+ sig {
1764
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1765
+ }
1766
+ def update(subscription_exposed_id, params = {}, opts = {}); end
1767
+ end
1768
+ end