stripe 15.2.0.pre.beta.1 → 15.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (648) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +718 -1556
  3. data/CONTRIBUTING.md +25 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +10 -7
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_requestor.rb +0 -28
  8. data/lib/stripe/api_version.rb +1 -1
  9. data/lib/stripe/errors.rb +0 -54
  10. data/lib/stripe/event_types.rb +0 -89
  11. data/lib/stripe/object_types.rb +0 -52
  12. data/lib/stripe/resources/account.rb +32 -657
  13. data/lib/stripe/resources/account_session.rb +59 -253
  14. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  15. data/lib/stripe/resources/balance.rb +42 -0
  16. data/lib/stripe/resources/balance_transaction.rb +2 -0
  17. data/lib/stripe/resources/bank_account.rb +2 -2
  18. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  19. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  20. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  21. data/lib/stripe/resources/billing_portal/session.rb +1 -7
  22. data/lib/stripe/resources/capability.rb +1 -1
  23. data/lib/stripe/resources/card.rb +0 -2
  24. data/lib/stripe/resources/cash_balance.rb +0 -2
  25. data/lib/stripe/resources/charge.rb +13 -1475
  26. data/lib/stripe/resources/checkout/session.rb +21 -333
  27. data/lib/stripe/resources/confirmation_token.rb +33 -263
  28. data/lib/stripe/resources/country_spec.rb +1 -1
  29. data/lib/stripe/resources/coupon.rb +2 -32
  30. data/lib/stripe/resources/credit_note.rb +10 -17
  31. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  32. data/lib/stripe/resources/customer.rb +2 -6
  33. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  34. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  35. data/lib/stripe/resources/customer_session.rb +4 -9
  36. data/lib/stripe/resources/discount.rb +0 -2
  37. data/lib/stripe/resources/dispute.rb +2 -2
  38. data/lib/stripe/resources/event.rb +1 -32
  39. data/lib/stripe/resources/file.rb +1 -1
  40. data/lib/stripe/resources/financial_connections/account.rb +1 -20
  41. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  42. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  43. data/lib/stripe/resources/identity/verification_session.rb +17 -21
  44. data/lib/stripe/resources/invoice.rb +79 -1106
  45. data/lib/stripe/resources/invoice_item.rb +4 -81
  46. data/lib/stripe/resources/invoice_line_item.rb +2 -56
  47. data/lib/stripe/resources/invoice_payment.rb +62 -4
  48. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  49. data/lib/stripe/resources/issuing/card.rb +1 -1
  50. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  51. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  52. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  53. data/lib/stripe/resources/line_item.rb +0 -37
  54. data/lib/stripe/resources/mandate.rb +0 -24
  55. data/lib/stripe/resources/payment_intent.rb +1912 -6840
  56. data/lib/stripe/resources/payment_method.rb +47 -301
  57. data/lib/stripe/resources/payment_method_configuration.rb +112 -112
  58. data/lib/stripe/resources/payment_method_domain.rb +2 -2
  59. data/lib/stripe/resources/payout.rb +4 -10
  60. data/lib/stripe/resources/person.rb +2 -2
  61. data/lib/stripe/resources/plan.rb +2 -3
  62. data/lib/stripe/resources/price.rb +1 -31
  63. data/lib/stripe/resources/product.rb +1 -61
  64. data/lib/stripe/resources/promotion_code.rb +0 -10
  65. data/lib/stripe/resources/quote.rb +6 -2046
  66. data/lib/stripe/resources/radar/value_list.rb +1 -2
  67. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  68. data/lib/stripe/resources/refund.rb +6 -10
  69. data/lib/stripe/resources/reversal.rb +1 -1
  70. data/lib/stripe/resources/review.rb +1 -1
  71. data/lib/stripe/resources/setup_attempt.rb +0 -21
  72. data/lib/stripe/resources/setup_intent.rb +120 -877
  73. data/lib/stripe/resources/source.rb +1 -30
  74. data/lib/stripe/resources/subscription.rb +97 -326
  75. data/lib/stripe/resources/subscription_item.rb +32 -80
  76. data/lib/stripe/resources/subscription_schedule.rb +127 -1015
  77. data/lib/stripe/resources/tax/calculation.rb +4 -0
  78. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  79. data/lib/stripe/resources/tax/registration.rb +1 -1
  80. data/lib/stripe/resources/tax_id.rb +3 -14
  81. data/lib/stripe/resources/tax_rate.rb +2 -2
  82. data/lib/stripe/resources/terminal/configuration.rb +1 -2
  83. data/lib/stripe/resources/terminal/location.rb +2 -3
  84. data/lib/stripe/resources/terminal/reader.rb +8 -142
  85. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  86. data/lib/stripe/resources/token.rb +2 -2
  87. data/lib/stripe/resources/transfer.rb +1 -7
  88. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  89. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  90. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  91. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  92. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  93. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  94. data/lib/stripe/resources.rb +0 -99
  95. data/lib/stripe/services/account_external_account_service.rb +2 -3
  96. data/lib/stripe/services/account_login_link_service.rb +1 -1
  97. data/lib/stripe/services/account_person_service.rb +1 -2
  98. data/lib/stripe/services/account_service.rb +23 -559
  99. data/lib/stripe/services/account_session_service.rb +29 -229
  100. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  101. data/lib/stripe/services/balance_service.rb +1 -1
  102. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  103. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  104. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  105. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  106. data/lib/stripe/services/charge_service.rb +4 -1354
  107. data/lib/stripe/services/checkout/session_service.rb +13 -250
  108. data/lib/stripe/services/coupon_service.rb +2 -19
  109. data/lib/stripe/services/credit_note_service.rb +7 -12
  110. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  111. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  112. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  113. data/lib/stripe/services/customer_service.rb +3 -5
  114. data/lib/stripe/services/customer_session_service.rb +1 -4
  115. data/lib/stripe/services/customer_tax_id_service.rb +1 -2
  116. data/lib/stripe/services/dispute_service.rb +1 -1
  117. data/lib/stripe/services/file_service.rb +1 -1
  118. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  119. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  120. data/lib/stripe/services/financial_connections_service.rb +1 -2
  121. data/lib/stripe/services/identity/verification_session_service.rb +5 -13
  122. data/lib/stripe/services/invoice_item_service.rb +3 -76
  123. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  124. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  125. data/lib/stripe/services/invoice_service.rb +74 -1049
  126. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  127. data/lib/stripe/services/issuing/card_service.rb +1 -1
  128. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  131. data/lib/stripe/services/issuing_service.rb +1 -5
  132. data/lib/stripe/services/payment_intent_service.rb +439 -4928
  133. data/lib/stripe/services/payment_method_configuration_service.rb +82 -82
  134. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  135. data/lib/stripe/services/payment_method_service.rb +44 -226
  136. data/lib/stripe/services/payout_service.rb +2 -6
  137. data/lib/stripe/services/plan_service.rb +2 -3
  138. data/lib/stripe/services/price_service.rb +2 -21
  139. data/lib/stripe/services/product_feature_service.rb +1 -2
  140. data/lib/stripe/services/product_service.rb +2 -41
  141. data/lib/stripe/services/promotion_code_service.rb +1 -9
  142. data/lib/stripe/services/quote_service.rb +7 -1730
  143. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  144. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  145. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  146. data/lib/stripe/services/setup_intent_service.rb +119 -836
  147. data/lib/stripe/services/source_service.rb +1 -1
  148. data/lib/stripe/services/subscription_item_service.rb +27 -73
  149. data/lib/stripe/services/subscription_schedule_service.rb +101 -916
  150. data/lib/stripe/services/subscription_service.rb +85 -282
  151. data/lib/stripe/services/tax/calculation_service.rb +4 -0
  152. data/lib/stripe/services/tax/registration_service.rb +1 -1
  153. data/lib/stripe/services/tax_id_service.rb +3 -10
  154. data/lib/stripe/services/tax_service.rb +1 -3
  155. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  156. data/lib/stripe/services/terminal/location_service.rb +2 -3
  157. data/lib/stripe/services/terminal/reader_service.rb +5 -81
  158. data/lib/stripe/services/terminal_service.rb +1 -2
  159. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +33 -190
  160. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  161. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  162. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  163. data/lib/stripe/services/token_service.rb +1 -1
  164. data/lib/stripe/services/transfer_service.rb +1 -5
  165. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  166. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  167. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  168. data/lib/stripe/services/v1_services.rb +2 -12
  169. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  170. data/lib/stripe/services/v2/core/event_destination_service.rb +4 -10
  171. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  172. data/lib/stripe/services/v2/core_service.rb +1 -4
  173. data/lib/stripe/services/v2_services.rb +2 -4
  174. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  175. data/lib/stripe/services.rb +1 -54
  176. data/lib/stripe/stripe_configuration.rb +1 -3
  177. data/lib/stripe/stripe_object.rb +1 -1
  178. data/lib/stripe/util.rb +1 -7
  179. data/lib/stripe/version.rb +1 -1
  180. data/lib/stripe.rb +0 -53
  181. data/rbi/stripe/resources/account.rbi +4926 -0
  182. data/rbi/stripe/resources/account_link.rbi +74 -0
  183. data/rbi/stripe/resources/account_session.rbi +1013 -0
  184. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  185. data/rbi/stripe/resources/application.rbi +20 -0
  186. data/rbi/stripe/resources/application_fee.rbi +118 -0
  187. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  188. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  189. data/rbi/stripe/resources/balance.rbi +235 -0
  190. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  191. data/rbi/stripe/resources/bank_account.rbi +127 -0
  192. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  193. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  194. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  195. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  196. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  197. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  198. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  199. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  200. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  201. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  202. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  203. data/rbi/stripe/resources/capability.rbi +125 -0
  204. data/rbi/stripe/resources/card.rbi +125 -0
  205. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  206. data/rbi/stripe/resources/charge.rbi +2069 -0
  207. data/rbi/stripe/resources/checkout/session.rbi +4004 -0
  208. data/rbi/stripe/resources/climate/order.rbi +245 -0
  209. data/rbi/stripe/resources/climate/product.rbi +75 -0
  210. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  211. data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
  212. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  213. data/rbi/stripe/resources/country_spec.rbi +85 -0
  214. data/rbi/stripe/resources/coupon.rbi +250 -0
  215. data/rbi/stripe/resources/credit_note.rbi +752 -0
  216. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  217. data/rbi/stripe/resources/customer.rbi +1005 -0
  218. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  219. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  220. data/rbi/stripe/resources/customer_session.rbi +200 -0
  221. data/rbi/stripe/resources/discount.rbi +53 -0
  222. data/rbi/stripe/resources/dispute.rbi +761 -0
  223. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  224. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  225. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  226. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  227. data/rbi/stripe/resources/event.rbi +149 -0
  228. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  229. data/rbi/stripe/resources/file.rbi +143 -0
  230. data/rbi/stripe/resources/file_link.rbi +141 -0
  231. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  232. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  233. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  234. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  235. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  236. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  237. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  238. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  239. data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
  240. data/rbi/stripe/resources/invoice.rbi +3812 -0
  241. data/rbi/stripe/resources/invoice_item.rbi +473 -0
  242. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  243. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  244. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  245. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  246. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  247. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  248. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  249. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  250. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  251. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  252. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  253. data/rbi/stripe/resources/line_item.rbi +72 -0
  254. data/rbi/stripe/resources/login_link.rbi +19 -0
  255. data/rbi/stripe/resources/mandate.rbi +187 -0
  256. data/rbi/stripe/resources/payment_intent.rbi +9647 -0
  257. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  258. data/rbi/stripe/resources/payment_method.rbi +1761 -0
  259. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  260. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  261. data/rbi/stripe/resources/payout.rbi +300 -0
  262. data/rbi/stripe/resources/person.rbi +401 -0
  263. data/rbi/stripe/resources/plan.rbi +371 -0
  264. data/rbi/stripe/resources/price.rbi +694 -0
  265. data/rbi/stripe/resources/product.rbi +555 -0
  266. data/rbi/stripe/resources/product_feature.rbi +26 -0
  267. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  268. data/rbi/stripe/resources/quote.rbi +1126 -0
  269. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  270. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  271. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  272. data/rbi/stripe/resources/refund.rbi +523 -0
  273. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  274. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  275. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  276. data/rbi/stripe/resources/reversal.rbi +51 -0
  277. data/rbi/stripe/resources/review.rbi +154 -0
  278. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  279. data/rbi/stripe/resources/setup_intent.rbi +3655 -0
  280. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  281. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  282. data/rbi/stripe/resources/source.rbi +1496 -0
  283. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  284. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  285. data/rbi/stripe/resources/subscription.rbi +2027 -0
  286. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  287. data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
  288. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  289. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  290. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  291. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  292. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  293. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  294. data/rbi/stripe/resources/tax_code.rbi +44 -0
  295. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  296. data/rbi/stripe/resources/tax_id.rbi +165 -0
  297. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  298. data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
  299. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  300. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  301. data/rbi/stripe/resources/terminal/reader.rbi +847 -0
  302. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  303. data/rbi/stripe/resources/token.rbi +1283 -0
  304. data/rbi/stripe/resources/topup.rbi +222 -0
  305. data/rbi/stripe/resources/transfer.rbi +199 -0
  306. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  307. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  308. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  309. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  310. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  311. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  312. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  313. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  314. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  315. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  316. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  317. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  318. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  319. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  320. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  321. data/rbi/stripe/resources/v2/event.rbi +48 -0
  322. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  323. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  324. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  325. data/{lib/stripe/services/external_account_service.rb → rbi/stripe/services/account_external_account_service.rbi} +124 -138
  326. data/rbi/stripe/services/account_link_service.rbi +58 -0
  327. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  328. data/rbi/stripe/services/account_person_service.rbi +1011 -0
  329. data/rbi/stripe/services/account_service.rbi +4213 -0
  330. data/rbi/stripe/services/account_session_service.rbi +646 -0
  331. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  332. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  333. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  334. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  335. data/rbi/stripe/services/apps_service.rbi +9 -0
  336. data/rbi/stripe/services/balance_service.rbi +21 -0
  337. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  338. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  339. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  340. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  341. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  342. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  343. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  344. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  345. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  346. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  347. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  348. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  349. data/rbi/stripe/services/billing_service.rbi +15 -0
  350. data/rbi/stripe/services/charge_service.rbi +448 -0
  351. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  352. data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
  353. data/rbi/stripe/services/checkout_service.rbi +9 -0
  354. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  355. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  356. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  357. data/rbi/stripe/services/climate_service.rbi +11 -0
  358. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  359. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  360. data/rbi/stripe/services/coupon_service.rbi +194 -0
  361. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  362. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  363. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  364. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  365. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  366. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  367. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  368. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  369. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  370. data/rbi/stripe/services/customer_service.rbi +647 -0
  371. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  372. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  373. data/rbi/stripe/services/dispute_service.rbi +424 -0
  374. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  375. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  376. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  377. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  378. data/rbi/stripe/services/event_service.rbi +83 -0
  379. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  380. data/rbi/stripe/services/file_link_service.rbi +124 -0
  381. data/rbi/stripe/services/file_service.rbi +116 -0
  382. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  383. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  384. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  385. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  386. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  387. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  388. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  389. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  390. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  391. data/rbi/stripe/services/identity_service.rbi +10 -0
  392. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  393. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  394. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  395. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  396. data/rbi/stripe/services/invoice_service.rbi +2981 -0
  397. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  398. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  399. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  400. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  401. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  402. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  403. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  404. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  405. data/rbi/stripe/services/issuing_service.rbi +16 -0
  406. data/rbi/stripe/services/mandate_service.rbi +20 -0
  407. data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
  408. data/{lib/stripe/services/payment_intent_amount_details_line_item_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  409. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  410. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  411. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  412. data/rbi/stripe/services/payment_method_service.rbi +776 -0
  413. data/rbi/stripe/services/payout_service.rbi +205 -0
  414. data/rbi/stripe/services/plan_service.rbi +282 -0
  415. data/rbi/stripe/services/price_service.rbi +546 -0
  416. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  417. data/rbi/stripe/services/product_service.rbi +477 -0
  418. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  419. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  420. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  421. data/rbi/stripe/services/quote_service.rbi +686 -0
  422. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  423. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  424. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  425. data/rbi/stripe/services/radar_service.rbi +11 -0
  426. data/rbi/stripe/services/refund_service.rbi +185 -0
  427. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  428. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  429. data/rbi/stripe/services/reporting_service.rbi +10 -0
  430. data/rbi/stripe/services/review_service.rbi +84 -0
  431. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  432. data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
  433. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  434. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  435. data/rbi/stripe/services/sigma_service.rbi +9 -0
  436. data/rbi/stripe/services/source_service.rbi +663 -0
  437. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  438. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  439. data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
  440. data/rbi/stripe/services/subscription_service.rbi +1648 -0
  441. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/calculation_line_item_service.rbi} +17 -21
  442. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  443. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  444. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  445. data/{lib/stripe/services/privacy/redaction_job_validation_error_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  446. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  447. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  448. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  449. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  450. data/rbi/stripe/services/tax_service.rbi +12 -0
  451. data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
  452. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  453. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  454. data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
  455. data/rbi/stripe/services/terminal_service.rbi +12 -0
  456. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
  457. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  458. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  459. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  460. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  461. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  462. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  463. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  464. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
  465. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  466. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  467. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  468. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  469. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  470. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  471. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  472. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  473. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  474. data/rbi/stripe/services/token_service.rbi +1257 -0
  475. data/rbi/stripe/services/topup_service.rbi +176 -0
  476. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  477. data/rbi/stripe/services/transfer_service.rbi +152 -0
  478. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  479. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  480. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  481. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  482. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  483. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  484. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  485. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  486. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  487. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  488. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  489. data/rbi/stripe/services/treasury_service.rbi +18 -0
  490. data/rbi/stripe/services/v1_services.rbi +77 -0
  491. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  492. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  493. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  494. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  495. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  496. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  497. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  498. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  499. data/rbi/stripe/services/v2_services.rbi +10 -0
  500. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  501. data/stripe.gemspec +1 -4
  502. metadata +326 -158
  503. data/lib/stripe/events/v2_core_account_closed_event.rb +0 -21
  504. data/lib/stripe/events/v2_core_account_created_event.rb +0 -21
  505. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  506. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  507. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  508. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  509. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  510. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  511. data/lib/stripe/events/v2_core_account_including_defaults_updated_event.rb +0 -21
  512. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
  513. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  514. data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
  515. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  516. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  517. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  518. data/lib/stripe/events/v2_core_account_updated_event.rb +0 -21
  519. data/lib/stripe/events/v2_money_management_adjustment_created_event.rb +0 -21
  520. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  521. data/lib/stripe/events/v2_money_management_financial_account_updated_event.rb +0 -21
  522. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  523. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  524. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  525. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  526. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  527. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  528. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  529. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  530. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  531. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  532. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  533. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  534. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  535. data/lib/stripe/events/v2_money_management_outbound_payment_updated_event.rb +0 -21
  536. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  537. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  538. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  539. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  540. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  541. data/lib/stripe/events/v2_money_management_outbound_transfer_updated_event.rb +0 -21
  542. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  543. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  544. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  545. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  546. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  547. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  548. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  549. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  550. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  551. data/lib/stripe/events/v2_money_management_transaction_created_event.rb +0 -21
  552. data/lib/stripe/events/v2_money_management_transaction_updated_event.rb +0 -21
  553. data/lib/stripe/resources/account_notice.rb +0 -123
  554. data/lib/stripe/resources/balance_settings.rb +0 -105
  555. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  556. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  557. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  558. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  559. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  560. data/lib/stripe/resources/financial_connections/institution.rb +0 -90
  561. data/lib/stripe/resources/fx_quote.rb +0 -184
  562. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  563. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  564. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  565. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  566. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  567. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  568. data/lib/stripe/resources/margin.rb +0 -115
  569. data/lib/stripe/resources/order.rb +0 -2859
  570. data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
  571. data/lib/stripe/resources/payment_intent_amount_details_line_item.rb +0 -65
  572. data/lib/stripe/resources/payment_record.rb +0 -1607
  573. data/lib/stripe/resources/privacy/redaction_job.rb +0 -275
  574. data/lib/stripe/resources/privacy/redaction_job_validation_error.rb +0 -25
  575. data/lib/stripe/resources/quote_line.rb +0 -274
  576. data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
  577. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -339
  578. data/lib/stripe/resources/tax/association.rb +0 -89
  579. data/lib/stripe/resources/tax/form.rb +0 -211
  580. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  581. data/lib/stripe/resources/v2/core/account.rb +0 -1746
  582. data/lib/stripe/resources/v2/core/account_link.rb +0 -56
  583. data/lib/stripe/resources/v2/core/person.rb +0 -276
  584. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -74
  585. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -39
  586. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -20
  587. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -22
  588. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -51
  589. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -58
  590. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -68
  591. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -94
  592. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -129
  593. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -82
  594. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -45
  595. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -117
  596. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -75
  597. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -49
  598. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -136
  599. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -108
  600. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -78
  601. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -68
  602. data/lib/stripe/services/account_notice_service.rb +0 -101
  603. data/lib/stripe/services/balance_settings_service.rb +0 -96
  604. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  605. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  606. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  607. data/lib/stripe/services/capital_service.rb +0 -15
  608. data/lib/stripe/services/fx_quote_service.rb +0 -123
  609. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  610. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  611. data/lib/stripe/services/gift_cards_service.rb +0 -14
  612. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  613. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  614. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  615. data/lib/stripe/services/margin_service.rb +0 -119
  616. data/lib/stripe/services/order_service.rb +0 -2268
  617. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  618. data/lib/stripe/services/payment_record_service.rb +0 -542
  619. data/lib/stripe/services/privacy/redaction_job_service.rb +0 -231
  620. data/lib/stripe/services/privacy_service.rb +0 -13
  621. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +0 -35
  622. data/lib/stripe/services/tax/association_service.rb +0 -31
  623. data/lib/stripe/services/tax/form_service.rb +0 -100
  624. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  625. data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
  626. data/lib/stripe/services/v2/core/account_service.rb +0 -4138
  627. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1048
  628. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
  629. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
  630. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  631. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
  632. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
  633. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
  634. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
  635. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -96
  636. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
  637. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
  638. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
  639. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
  640. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  641. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
  642. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
  643. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
  644. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
  645. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  646. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  647. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
  648. data/rbi/stripe.rbi +0 -191867
@@ -0,0 +1,2027 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ # Subscriptions allow you to charge a customer on a recurring basis.
7
+ #
8
+ # Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating)
9
+ class Subscription < APIResource
10
+ class AutomaticTax < Stripe::StripeObject
11
+ class Liability < Stripe::StripeObject
12
+ # The connected account being referenced when `type` is `account`.
13
+ sig { returns(T.any(String, Stripe::Account)) }
14
+ attr_reader :account
15
+ # Type of the account referenced.
16
+ sig { returns(String) }
17
+ attr_reader :type
18
+ end
19
+ # If Stripe disabled automatic tax, this enum describes why.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :disabled_reason
22
+ # Whether Stripe automatically computes tax on this subscription.
23
+ sig { returns(T::Boolean) }
24
+ attr_reader :enabled
25
+ # 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.
26
+ sig { returns(T.nilable(Liability)) }
27
+ attr_reader :liability
28
+ end
29
+ class BillingCycleAnchorConfig < Stripe::StripeObject
30
+ # The day of the month of the billing_cycle_anchor.
31
+ sig { returns(Integer) }
32
+ attr_reader :day_of_month
33
+ # The hour of the day of the billing_cycle_anchor.
34
+ sig { returns(T.nilable(Integer)) }
35
+ attr_reader :hour
36
+ # The minute of the hour of the billing_cycle_anchor.
37
+ sig { returns(T.nilable(Integer)) }
38
+ attr_reader :minute
39
+ # The month to start full cycle billing periods.
40
+ sig { returns(T.nilable(Integer)) }
41
+ attr_reader :month
42
+ # The second of the minute of the billing_cycle_anchor.
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :second
45
+ end
46
+ class BillingThresholds < Stripe::StripeObject
47
+ # Monetary threshold that triggers the subscription to create an invoice
48
+ sig { returns(T.nilable(Integer)) }
49
+ attr_reader :amount_gte
50
+ # 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. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
51
+ sig { returns(T.nilable(T::Boolean)) }
52
+ attr_reader :reset_billing_cycle_anchor
53
+ end
54
+ class CancellationDetails < Stripe::StripeObject
55
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :comment
58
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :feedback
61
+ # Why this subscription was canceled.
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :reason
64
+ end
65
+ class InvoiceSettings < Stripe::StripeObject
66
+ class Issuer < Stripe::StripeObject
67
+ # The connected account being referenced when `type` is `account`.
68
+ sig { returns(T.any(String, Stripe::Account)) }
69
+ attr_reader :account
70
+ # Type of the account referenced.
71
+ sig { returns(String) }
72
+ attr_reader :type
73
+ end
74
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
75
+ sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) }
76
+ attr_reader :account_tax_ids
77
+ # Attribute for field issuer
78
+ sig { returns(Issuer) }
79
+ attr_reader :issuer
80
+ end
81
+ class PauseCollection < Stripe::StripeObject
82
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
83
+ sig { returns(String) }
84
+ attr_reader :behavior
85
+ # The time after which the subscription will resume collecting payments.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_reader :resumes_at
88
+ end
89
+ class PaymentSettings < Stripe::StripeObject
90
+ class PaymentMethodOptions < Stripe::StripeObject
91
+ class AcssDebit < Stripe::StripeObject
92
+ class MandateOptions < Stripe::StripeObject
93
+ # Transaction type of the mandate.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :transaction_type
96
+ end
97
+ # Attribute for field mandate_options
98
+ sig { returns(MandateOptions) }
99
+ attr_reader :mandate_options
100
+ # Bank account verification method.
101
+ sig { returns(String) }
102
+ attr_reader :verification_method
103
+ end
104
+ class Bancontact < Stripe::StripeObject
105
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
106
+ sig { returns(String) }
107
+ attr_reader :preferred_language
108
+ end
109
+ class Card < Stripe::StripeObject
110
+ class MandateOptions < Stripe::StripeObject
111
+ # Amount to be charged for future payments.
112
+ sig { returns(T.nilable(Integer)) }
113
+ attr_reader :amount
114
+ # 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.
115
+ sig { returns(T.nilable(String)) }
116
+ attr_reader :amount_type
117
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
118
+ sig { returns(T.nilable(String)) }
119
+ attr_reader :description
120
+ end
121
+ # Attribute for field mandate_options
122
+ sig { returns(MandateOptions) }
123
+ attr_reader :mandate_options
124
+ # 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.
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :network
127
+ # 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.
128
+ sig { returns(T.nilable(String)) }
129
+ attr_reader :request_three_d_secure
130
+ end
131
+ class CustomerBalance < Stripe::StripeObject
132
+ class BankTransfer < Stripe::StripeObject
133
+ class EuBankTransfer < Stripe::StripeObject
134
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
135
+ sig { returns(String) }
136
+ attr_reader :country
137
+ end
138
+ # Attribute for field eu_bank_transfer
139
+ sig { returns(EuBankTransfer) }
140
+ attr_reader :eu_bank_transfer
141
+ # 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`.
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :type
144
+ end
145
+ # Attribute for field bank_transfer
146
+ sig { returns(BankTransfer) }
147
+ attr_reader :bank_transfer
148
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
149
+ sig { returns(T.nilable(String)) }
150
+ attr_reader :funding_type
151
+ end
152
+ class Konbini < Stripe::StripeObject; end
153
+ class SepaDebit < Stripe::StripeObject; end
154
+ class UsBankAccount < Stripe::StripeObject
155
+ class FinancialConnections < Stripe::StripeObject
156
+ class Filters < Stripe::StripeObject
157
+ # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
158
+ sig { returns(T::Array[String]) }
159
+ attr_reader :account_subcategories
160
+ end
161
+ # Attribute for field filters
162
+ sig { returns(Filters) }
163
+ attr_reader :filters
164
+ # The list of permissions to request. The `payment_method` permission must be included.
165
+ sig { returns(T::Array[String]) }
166
+ attr_reader :permissions
167
+ # Data features requested to be retrieved upon account creation.
168
+ sig { returns(T.nilable(T::Array[String])) }
169
+ attr_reader :prefetch
170
+ end
171
+ # Attribute for field financial_connections
172
+ sig { returns(FinancialConnections) }
173
+ attr_reader :financial_connections
174
+ # Bank account verification method.
175
+ sig { returns(String) }
176
+ attr_reader :verification_method
177
+ end
178
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription.
179
+ sig { returns(T.nilable(AcssDebit)) }
180
+ attr_reader :acss_debit
181
+ # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription.
182
+ sig { returns(T.nilable(Bancontact)) }
183
+ attr_reader :bancontact
184
+ # This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription.
185
+ sig { returns(T.nilable(Card)) }
186
+ attr_reader :card
187
+ # This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription.
188
+ sig { returns(T.nilable(CustomerBalance)) }
189
+ attr_reader :customer_balance
190
+ # This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription.
191
+ sig { returns(T.nilable(Konbini)) }
192
+ attr_reader :konbini
193
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to invoices created by the subscription.
194
+ sig { returns(T.nilable(SepaDebit)) }
195
+ attr_reader :sepa_debit
196
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription.
197
+ sig { returns(T.nilable(UsBankAccount)) }
198
+ attr_reader :us_bank_account
199
+ end
200
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
201
+ sig { returns(T.nilable(PaymentMethodOptions)) }
202
+ attr_reader :payment_method_options
203
+ # The list of payment method types to provide to every invoice created by the subscription. 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).
204
+ sig { returns(T.nilable(T::Array[String])) }
205
+ attr_reader :payment_method_types
206
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`.
207
+ sig { returns(T.nilable(String)) }
208
+ attr_reader :save_default_payment_method
209
+ end
210
+ class PendingInvoiceItemInterval < Stripe::StripeObject
211
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
212
+ sig { returns(String) }
213
+ attr_reader :interval
214
+ # 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).
215
+ sig { returns(Integer) }
216
+ attr_reader :interval_count
217
+ end
218
+ class PendingUpdate < Stripe::StripeObject
219
+ # If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format.
220
+ sig { returns(T.nilable(Integer)) }
221
+ attr_reader :billing_cycle_anchor
222
+ # The point after which the changes reflected by this update will be discarded and no longer applied.
223
+ sig { returns(Integer) }
224
+ attr_reader :expires_at
225
+ # List of subscription items, each with an attached plan, that will be set if the update is applied.
226
+ sig { returns(T.nilable(T::Array[Stripe::SubscriptionItem])) }
227
+ attr_reader :subscription_items
228
+ # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied.
229
+ sig { returns(T.nilable(Integer)) }
230
+ attr_reader :trial_end
231
+ # 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.
232
+ sig { returns(T.nilable(T::Boolean)) }
233
+ attr_reader :trial_from_plan
234
+ end
235
+ class TransferData < Stripe::StripeObject
236
+ # 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.
237
+ sig { returns(T.nilable(Float)) }
238
+ attr_reader :amount_percent
239
+ # The account where funds from the payment will be transferred to upon payment success.
240
+ sig { returns(T.any(String, Stripe::Account)) }
241
+ attr_reader :destination
242
+ end
243
+ class TrialSettings < Stripe::StripeObject
244
+ class EndBehavior < Stripe::StripeObject
245
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
246
+ sig { returns(String) }
247
+ attr_reader :missing_payment_method
248
+ end
249
+ # Defines how a subscription behaves when a free trial ends.
250
+ sig { returns(EndBehavior) }
251
+ attr_reader :end_behavior
252
+ end
253
+ # ID of the Connect Application that created the subscription.
254
+ sig { returns(T.nilable(T.any(String, Stripe::Application))) }
255
+ attr_reader :application
256
+ # 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.
257
+ sig { returns(T.nilable(Float)) }
258
+ attr_reader :application_fee_percent
259
+ # Attribute for field automatic_tax
260
+ sig { returns(AutomaticTax) }
261
+ attr_reader :automatic_tax
262
+ # The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/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. The timestamp is in UTC format.
263
+ sig { returns(Integer) }
264
+ attr_reader :billing_cycle_anchor
265
+ # The fixed values used to calculate the `billing_cycle_anchor`.
266
+ sig { returns(T.nilable(BillingCycleAnchorConfig)) }
267
+ attr_reader :billing_cycle_anchor_config
268
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
269
+ sig { returns(T.nilable(BillingThresholds)) }
270
+ attr_reader :billing_thresholds
271
+ # A date in the future at which the subscription will automatically get canceled
272
+ sig { returns(T.nilable(Integer)) }
273
+ attr_reader :cancel_at
274
+ # Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. This field will be removed in a future API version. Please use `cancel_at` instead.
275
+ sig { returns(T::Boolean) }
276
+ attr_reader :cancel_at_period_end
277
+ # If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
278
+ sig { returns(T.nilable(Integer)) }
279
+ attr_reader :canceled_at
280
+ # Details about why this subscription was cancelled
281
+ sig { returns(T.nilable(CancellationDetails)) }
282
+ attr_reader :cancellation_details
283
+ # 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`.
284
+ sig { returns(String) }
285
+ attr_reader :collection_method
286
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
287
+ sig { returns(Integer) }
288
+ attr_reader :created
289
+ # 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).
290
+ sig { returns(String) }
291
+ attr_reader :currency
292
+ # ID of the customer who owns the subscription.
293
+ sig { returns(T.any(String, Stripe::Customer)) }
294
+ attr_reader :customer
295
+ # Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.
296
+ sig { returns(T.nilable(Integer)) }
297
+ attr_reader :days_until_due
298
+ # 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).
299
+ sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) }
300
+ attr_reader :default_payment_method
301
+ # 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).
302
+ sig {
303
+ returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source))))
304
+ }
305
+ attr_reader :default_source
306
+ # 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.
307
+ sig { returns(T.nilable(T::Array[Stripe::TaxRate])) }
308
+ attr_reader :default_tax_rates
309
+ # 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.
310
+ sig { returns(T.nilable(String)) }
311
+ attr_reader :description
312
+ # The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
313
+ sig { returns(T::Array[T.any(String, Stripe::Discount)]) }
314
+ attr_reader :discounts
315
+ # If the subscription has ended, the date the subscription ended.
316
+ sig { returns(T.nilable(Integer)) }
317
+ attr_reader :ended_at
318
+ # Unique identifier for the object.
319
+ sig { returns(String) }
320
+ attr_reader :id
321
+ # Attribute for field invoice_settings
322
+ sig { returns(InvoiceSettings) }
323
+ attr_reader :invoice_settings
324
+ # List of subscription items, each with an attached price.
325
+ sig { returns(Stripe::ListObject) }
326
+ attr_reader :items
327
+ # The most recent invoice this subscription has generated.
328
+ sig { returns(T.nilable(T.any(String, Stripe::Invoice))) }
329
+ attr_reader :latest_invoice
330
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
331
+ sig { returns(T::Boolean) }
332
+ attr_reader :livemode
333
+ # 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.
334
+ sig { returns(T::Hash[String, String]) }
335
+ attr_reader :metadata
336
+ # Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.
337
+ sig { returns(T.nilable(Integer)) }
338
+ attr_reader :next_pending_invoice_item_invoice
339
+ # String representing the object's type. Objects of the same type share the same value.
340
+ sig { returns(String) }
341
+ attr_reader :object
342
+ # The account (if any) the charge was made on behalf of for charges associated with this subscription. See the [Connect documentation](https://stripe.com/docs/connect/subscriptions#on-behalf-of) for details.
343
+ sig { returns(T.nilable(T.any(String, Stripe::Account))) }
344
+ attr_reader :on_behalf_of
345
+ # 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).
346
+ sig { returns(T.nilable(PauseCollection)) }
347
+ attr_reader :pause_collection
348
+ # Payment settings passed on to invoices created by the subscription.
349
+ sig { returns(T.nilable(PaymentSettings)) }
350
+ attr_reader :payment_settings
351
+ # 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.
352
+ sig { returns(T.nilable(PendingInvoiceItemInterval)) }
353
+ attr_reader :pending_invoice_item_interval
354
+ # You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2).
355
+ sig { returns(T.nilable(T.any(String, Stripe::SetupIntent))) }
356
+ attr_reader :pending_setup_intent
357
+ # If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.
358
+ sig { returns(T.nilable(PendingUpdate)) }
359
+ attr_reader :pending_update
360
+ # The schedule attached to the subscription
361
+ sig { returns(T.nilable(T.any(String, Stripe::SubscriptionSchedule))) }
362
+ attr_reader :schedule
363
+ # Date when the subscription was first created. The date might differ from the `created` date due to backdating.
364
+ sig { returns(Integer) }
365
+ attr_reader :start_date
366
+ # Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`.
367
+ #
368
+ # For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated.
369
+ #
370
+ # A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over.
371
+ #
372
+ # A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/docs/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged.
373
+ #
374
+ # If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings).
375
+ #
376
+ # If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.
377
+ sig { returns(String) }
378
+ attr_reader :status
379
+ # ID of the test clock this subscription belongs to.
380
+ sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) }
381
+ attr_reader :test_clock
382
+ # The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
383
+ sig { returns(T.nilable(TransferData)) }
384
+ attr_reader :transfer_data
385
+ # If the subscription has a trial, the end of that trial.
386
+ sig { returns(T.nilable(Integer)) }
387
+ attr_reader :trial_end
388
+ # Settings related to subscription trials.
389
+ sig { returns(T.nilable(TrialSettings)) }
390
+ attr_reader :trial_settings
391
+ # If the subscription has a trial, the beginning of that trial. For subsequent trials, this date remains as the start of the first ever trial on the subscription.
392
+ sig { returns(T.nilable(Integer)) }
393
+ attr_reader :trial_start
394
+ class CancelParams < Stripe::RequestParams
395
+ class CancellationDetails < Stripe::RequestParams
396
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
397
+ sig { returns(T.nilable(T.nilable(String))) }
398
+ attr_accessor :comment
399
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
400
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
401
+ attr_accessor :feedback
402
+ sig {
403
+ params(comment: T.nilable(T.nilable(String)), feedback: T.nilable(T.nilable(T.any(String, String)))).void
404
+ }
405
+ def initialize(comment: nil, feedback: nil); end
406
+ end
407
+ # Details about why this subscription was cancelled
408
+ sig { returns(T.nilable(::Stripe::Subscription::CancelParams::CancellationDetails)) }
409
+ attr_accessor :cancellation_details
410
+ # Specifies which fields in the response should be expanded.
411
+ sig { returns(T.nilable(T::Array[String])) }
412
+ attr_accessor :expand
413
+ # Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `false`.
414
+ sig { returns(T.nilable(T::Boolean)) }
415
+ attr_accessor :invoice_now
416
+ # Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`.
417
+ sig { returns(T.nilable(T::Boolean)) }
418
+ attr_accessor :prorate
419
+ sig {
420
+ params(cancellation_details: T.nilable(::Stripe::Subscription::CancelParams::CancellationDetails), expand: T.nilable(T::Array[String]), invoice_now: T.nilable(T::Boolean), prorate: T.nilable(T::Boolean)).void
421
+ }
422
+ def initialize(cancellation_details: nil, expand: nil, invoice_now: nil, prorate: nil); end
423
+ end
424
+ class UpdateParams < Stripe::RequestParams
425
+ class AddInvoiceItem < Stripe::RequestParams
426
+ class Discount < Stripe::RequestParams
427
+ # ID of the coupon to create a new discount for.
428
+ sig { returns(T.nilable(String)) }
429
+ attr_accessor :coupon
430
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
431
+ sig { returns(T.nilable(String)) }
432
+ attr_accessor :discount
433
+ # ID of the promotion code to create a new discount for.
434
+ sig { returns(T.nilable(String)) }
435
+ attr_accessor :promotion_code
436
+ sig {
437
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
438
+ }
439
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
440
+ end
441
+ class PriceData < Stripe::RequestParams
442
+ # 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).
443
+ sig { returns(String) }
444
+ attr_accessor :currency
445
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
446
+ sig { returns(String) }
447
+ attr_accessor :product
448
+ # 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.
449
+ sig { returns(T.nilable(String)) }
450
+ attr_accessor :tax_behavior
451
+ # 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.
452
+ sig { returns(T.nilable(Integer)) }
453
+ attr_accessor :unit_amount
454
+ # 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.
455
+ sig { returns(T.nilable(String)) }
456
+ attr_accessor :unit_amount_decimal
457
+ sig {
458
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
459
+ }
460
+ def initialize(
461
+ currency: nil,
462
+ product: nil,
463
+ tax_behavior: nil,
464
+ unit_amount: nil,
465
+ unit_amount_decimal: nil
466
+ ); end
467
+ end
468
+ # The coupons to redeem into discounts for the item.
469
+ sig {
470
+ returns(T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem::Discount]))
471
+ }
472
+ attr_accessor :discounts
473
+ # The ID of the price object. One of `price` or `price_data` is required.
474
+ sig { returns(T.nilable(String)) }
475
+ attr_accessor :price
476
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
477
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::AddInvoiceItem::PriceData)) }
478
+ attr_accessor :price_data
479
+ # Quantity for this item. Defaults to 1.
480
+ sig { returns(T.nilable(Integer)) }
481
+ attr_accessor :quantity
482
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
483
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
484
+ attr_accessor :tax_rates
485
+ sig {
486
+ params(discounts: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::Subscription::UpdateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
487
+ }
488
+ def initialize(
489
+ discounts: nil,
490
+ price: nil,
491
+ price_data: nil,
492
+ quantity: nil,
493
+ tax_rates: nil
494
+ ); end
495
+ end
496
+ class AutomaticTax < Stripe::RequestParams
497
+ class Liability < Stripe::RequestParams
498
+ # The connected account being referenced when `type` is `account`.
499
+ sig { returns(T.nilable(String)) }
500
+ attr_accessor :account
501
+ # Type of the account referenced in the request.
502
+ sig { returns(String) }
503
+ attr_accessor :type
504
+ sig { params(account: T.nilable(String), type: String).void }
505
+ def initialize(account: nil, type: nil); end
506
+ end
507
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
508
+ sig { returns(T::Boolean) }
509
+ attr_accessor :enabled
510
+ # 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.
511
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax::Liability)) }
512
+ attr_accessor :liability
513
+ sig {
514
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax::Liability)).void
515
+ }
516
+ def initialize(enabled: nil, liability: nil); end
517
+ end
518
+ class BillingThresholds < Stripe::RequestParams
519
+ # Monetary threshold that triggers the subscription to advance to a new billing period
520
+ sig { returns(T.nilable(Integer)) }
521
+ attr_accessor :amount_gte
522
+ # 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.
523
+ sig { returns(T.nilable(T::Boolean)) }
524
+ attr_accessor :reset_billing_cycle_anchor
525
+ sig {
526
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
527
+ }
528
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
529
+ end
530
+ class CancellationDetails < Stripe::RequestParams
531
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
532
+ sig { returns(T.nilable(T.nilable(String))) }
533
+ attr_accessor :comment
534
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
535
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
536
+ attr_accessor :feedback
537
+ sig {
538
+ params(comment: T.nilable(T.nilable(String)), feedback: T.nilable(T.nilable(T.any(String, String)))).void
539
+ }
540
+ def initialize(comment: nil, feedback: nil); end
541
+ end
542
+ class Discount < Stripe::RequestParams
543
+ # ID of the coupon to create a new discount for.
544
+ sig { returns(T.nilable(String)) }
545
+ attr_accessor :coupon
546
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
547
+ sig { returns(T.nilable(String)) }
548
+ attr_accessor :discount
549
+ # ID of the promotion code to create a new discount for.
550
+ sig { returns(T.nilable(String)) }
551
+ attr_accessor :promotion_code
552
+ sig {
553
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
554
+ }
555
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
556
+ end
557
+ class InvoiceSettings < Stripe::RequestParams
558
+ class Issuer < Stripe::RequestParams
559
+ # The connected account being referenced when `type` is `account`.
560
+ sig { returns(T.nilable(String)) }
561
+ attr_accessor :account
562
+ # Type of the account referenced in the request.
563
+ sig { returns(String) }
564
+ attr_accessor :type
565
+ sig { params(account: T.nilable(String), type: String).void }
566
+ def initialize(account: nil, type: nil); end
567
+ end
568
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
569
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
570
+ attr_accessor :account_tax_ids
571
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
572
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings::Issuer)) }
573
+ attr_accessor :issuer
574
+ sig {
575
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), issuer: T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings::Issuer)).void
576
+ }
577
+ def initialize(account_tax_ids: nil, issuer: nil); end
578
+ end
579
+ class Item < Stripe::RequestParams
580
+ class BillingThresholds < Stripe::RequestParams
581
+ # 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))
582
+ sig { returns(Integer) }
583
+ attr_accessor :usage_gte
584
+ sig { params(usage_gte: Integer).void }
585
+ def initialize(usage_gte: nil); end
586
+ end
587
+ class Discount < Stripe::RequestParams
588
+ # ID of the coupon to create a new discount for.
589
+ sig { returns(T.nilable(String)) }
590
+ attr_accessor :coupon
591
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
592
+ sig { returns(T.nilable(String)) }
593
+ attr_accessor :discount
594
+ # ID of the promotion code to create a new discount for.
595
+ sig { returns(T.nilable(String)) }
596
+ attr_accessor :promotion_code
597
+ sig {
598
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
599
+ }
600
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
601
+ end
602
+ class PriceData < Stripe::RequestParams
603
+ class Recurring < Stripe::RequestParams
604
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
605
+ sig { returns(String) }
606
+ attr_accessor :interval
607
+ # 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).
608
+ sig { returns(T.nilable(Integer)) }
609
+ attr_accessor :interval_count
610
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
611
+ def initialize(interval: nil, interval_count: nil); end
612
+ end
613
+ # 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).
614
+ sig { returns(String) }
615
+ attr_accessor :currency
616
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
617
+ sig { returns(String) }
618
+ attr_accessor :product
619
+ # The recurring components of a price such as `interval` and `interval_count`.
620
+ sig { returns(::Stripe::Subscription::UpdateParams::Item::PriceData::Recurring) }
621
+ attr_accessor :recurring
622
+ # 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.
623
+ sig { returns(T.nilable(String)) }
624
+ attr_accessor :tax_behavior
625
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
626
+ sig { returns(T.nilable(Integer)) }
627
+ attr_accessor :unit_amount
628
+ # 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.
629
+ sig { returns(T.nilable(String)) }
630
+ attr_accessor :unit_amount_decimal
631
+ sig {
632
+ params(currency: String, product: String, recurring: ::Stripe::Subscription::UpdateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
633
+ }
634
+ def initialize(
635
+ currency: nil,
636
+ product: nil,
637
+ recurring: nil,
638
+ tax_behavior: nil,
639
+ unit_amount: nil,
640
+ unit_amount_decimal: nil
641
+ ); end
642
+ end
643
+ # 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.
644
+ sig {
645
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::Item::BillingThresholds))))
646
+ }
647
+ attr_accessor :billing_thresholds
648
+ # 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.
649
+ sig { returns(T.nilable(T::Boolean)) }
650
+ attr_accessor :clear_usage
651
+ # A flag that, if set to `true`, will delete the specified item.
652
+ sig { returns(T.nilable(T::Boolean)) }
653
+ attr_accessor :deleted
654
+ # The coupons to redeem into discounts for the subscription item.
655
+ sig {
656
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Item::Discount]))))
657
+ }
658
+ attr_accessor :discounts
659
+ # Subscription item to update.
660
+ sig { returns(T.nilable(String)) }
661
+ attr_accessor :id
662
+ # 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`.
663
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
664
+ attr_accessor :metadata
665
+ # Plan ID for this item, as a string.
666
+ sig { returns(T.nilable(String)) }
667
+ attr_accessor :plan
668
+ # 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.
669
+ sig { returns(T.nilable(String)) }
670
+ attr_accessor :price
671
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
672
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::Item::PriceData)) }
673
+ attr_accessor :price_data
674
+ # Quantity for this item.
675
+ sig { returns(T.nilable(Integer)) }
676
+ attr_accessor :quantity
677
+ # 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.
678
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
679
+ attr_accessor :tax_rates
680
+ sig {
681
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::Item::BillingThresholds))), clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Item::Discount]))), id: T.nilable(String), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Subscription::UpdateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
682
+ }
683
+ def initialize(
684
+ billing_thresholds: nil,
685
+ clear_usage: nil,
686
+ deleted: nil,
687
+ discounts: nil,
688
+ id: nil,
689
+ metadata: nil,
690
+ plan: nil,
691
+ price: nil,
692
+ price_data: nil,
693
+ quantity: nil,
694
+ tax_rates: nil
695
+ ); end
696
+ end
697
+ class PauseCollection < Stripe::RequestParams
698
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
699
+ sig { returns(String) }
700
+ attr_accessor :behavior
701
+ # The time after which the subscription will resume collecting payments.
702
+ sig { returns(T.nilable(Integer)) }
703
+ attr_accessor :resumes_at
704
+ sig { params(behavior: String, resumes_at: T.nilable(Integer)).void }
705
+ def initialize(behavior: nil, resumes_at: nil); end
706
+ end
707
+ class PaymentSettings < Stripe::RequestParams
708
+ class PaymentMethodOptions < Stripe::RequestParams
709
+ class AcssDebit < Stripe::RequestParams
710
+ class MandateOptions < Stripe::RequestParams
711
+ # Transaction type of the mandate.
712
+ sig { returns(T.nilable(String)) }
713
+ attr_accessor :transaction_type
714
+ sig { params(transaction_type: T.nilable(String)).void }
715
+ def initialize(transaction_type: nil); end
716
+ end
717
+ # Additional fields for Mandate creation
718
+ sig {
719
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
720
+ }
721
+ attr_accessor :mandate_options
722
+ # Verification method for the intent
723
+ sig { returns(T.nilable(String)) }
724
+ attr_accessor :verification_method
725
+ sig {
726
+ params(mandate_options: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
727
+ }
728
+ def initialize(mandate_options: nil, verification_method: nil); end
729
+ end
730
+ class Bancontact < Stripe::RequestParams
731
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
732
+ sig { returns(T.nilable(String)) }
733
+ attr_accessor :preferred_language
734
+ sig { params(preferred_language: T.nilable(String)).void }
735
+ def initialize(preferred_language: nil); end
736
+ end
737
+ class Card < Stripe::RequestParams
738
+ class MandateOptions < Stripe::RequestParams
739
+ # Amount to be charged for future payments.
740
+ sig { returns(T.nilable(Integer)) }
741
+ attr_accessor :amount
742
+ # 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.
743
+ sig { returns(T.nilable(String)) }
744
+ attr_accessor :amount_type
745
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
746
+ sig { returns(T.nilable(String)) }
747
+ attr_accessor :description
748
+ sig {
749
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
750
+ }
751
+ def initialize(amount: nil, amount_type: nil, description: nil); end
752
+ end
753
+ # Configuration options for setting up an eMandate for cards issued in India.
754
+ sig {
755
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
756
+ }
757
+ attr_accessor :mandate_options
758
+ # 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.
759
+ sig { returns(T.nilable(String)) }
760
+ attr_accessor :network
761
+ # 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.
762
+ sig { returns(T.nilable(String)) }
763
+ attr_accessor :request_three_d_secure
764
+ sig {
765
+ params(mandate_options: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
766
+ }
767
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
768
+ end
769
+ class CustomerBalance < Stripe::RequestParams
770
+ class BankTransfer < Stripe::RequestParams
771
+ class EuBankTransfer < Stripe::RequestParams
772
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
773
+ sig { returns(String) }
774
+ attr_accessor :country
775
+ sig { params(country: String).void }
776
+ def initialize(country: nil); end
777
+ end
778
+ # Configuration for eu_bank_transfer funding type.
779
+ sig {
780
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
781
+ }
782
+ attr_accessor :eu_bank_transfer
783
+ # 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`.
784
+ sig { returns(T.nilable(String)) }
785
+ attr_accessor :type
786
+ sig {
787
+ params(eu_bank_transfer: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
788
+ }
789
+ def initialize(eu_bank_transfer: nil, type: nil); end
790
+ end
791
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
792
+ sig {
793
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
794
+ }
795
+ attr_accessor :bank_transfer
796
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
797
+ sig { returns(T.nilable(String)) }
798
+ attr_accessor :funding_type
799
+ sig {
800
+ params(bank_transfer: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
801
+ }
802
+ def initialize(bank_transfer: nil, funding_type: nil); end
803
+ end
804
+ class Konbini < Stripe::RequestParams; end
805
+ class SepaDebit < Stripe::RequestParams; end
806
+ class UsBankAccount < Stripe::RequestParams
807
+ class FinancialConnections < Stripe::RequestParams
808
+ class Filters < Stripe::RequestParams
809
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
810
+ sig { returns(T.nilable(T::Array[String])) }
811
+ attr_accessor :account_subcategories
812
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
813
+ def initialize(account_subcategories: nil); end
814
+ end
815
+ # Provide filters for the linked accounts that the customer can select for the payment method.
816
+ sig {
817
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
818
+ }
819
+ attr_accessor :filters
820
+ # 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`.
821
+ sig { returns(T.nilable(T::Array[String])) }
822
+ attr_accessor :permissions
823
+ # List of data features that you would like to retrieve upon account creation.
824
+ sig { returns(T.nilable(T::Array[String])) }
825
+ attr_accessor :prefetch
826
+ sig {
827
+ params(filters: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
828
+ }
829
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
830
+ end
831
+ # Additional fields for Financial Connections Session creation
832
+ sig {
833
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
834
+ }
835
+ attr_accessor :financial_connections
836
+ # Verification method for the intent
837
+ sig { returns(T.nilable(String)) }
838
+ attr_accessor :verification_method
839
+ sig {
840
+ params(financial_connections: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
841
+ }
842
+ def initialize(financial_connections: nil, verification_method: nil); end
843
+ end
844
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
845
+ sig {
846
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
847
+ }
848
+ attr_accessor :acss_debit
849
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
850
+ sig {
851
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
852
+ }
853
+ attr_accessor :bancontact
854
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
855
+ sig {
856
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))))
857
+ }
858
+ attr_accessor :card
859
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
860
+ sig {
861
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
862
+ }
863
+ attr_accessor :customer_balance
864
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
865
+ sig {
866
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
867
+ }
868
+ attr_accessor :konbini
869
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
870
+ sig {
871
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
872
+ }
873
+ attr_accessor :sepa_debit
874
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
875
+ sig {
876
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
877
+ }
878
+ attr_accessor :us_bank_account
879
+ sig {
880
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
881
+ }
882
+ def initialize(
883
+ acss_debit: nil,
884
+ bancontact: nil,
885
+ card: nil,
886
+ customer_balance: nil,
887
+ konbini: nil,
888
+ sepa_debit: nil,
889
+ us_bank_account: nil
890
+ ); end
891
+ end
892
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
893
+ sig {
894
+ returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions))
895
+ }
896
+ attr_accessor :payment_method_options
897
+ # 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
898
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
899
+ attr_accessor :payment_method_types
900
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
901
+ sig { returns(T.nilable(String)) }
902
+ attr_accessor :save_default_payment_method
903
+ sig {
904
+ params(payment_method_options: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String]))), save_default_payment_method: T.nilable(String)).void
905
+ }
906
+ def initialize(
907
+ payment_method_options: nil,
908
+ payment_method_types: nil,
909
+ save_default_payment_method: nil
910
+ ); end
911
+ end
912
+ class PendingInvoiceItemInterval < Stripe::RequestParams
913
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
914
+ sig { returns(String) }
915
+ attr_accessor :interval
916
+ # 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).
917
+ sig { returns(T.nilable(Integer)) }
918
+ attr_accessor :interval_count
919
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
920
+ def initialize(interval: nil, interval_count: nil); end
921
+ end
922
+ class TransferData < Stripe::RequestParams
923
+ # 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.
924
+ sig { returns(T.nilable(Float)) }
925
+ attr_accessor :amount_percent
926
+ # ID of an existing, connected Stripe account.
927
+ sig { returns(String) }
928
+ attr_accessor :destination
929
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
930
+ def initialize(amount_percent: nil, destination: nil); end
931
+ end
932
+ class TrialSettings < Stripe::RequestParams
933
+ class EndBehavior < Stripe::RequestParams
934
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
935
+ sig { returns(String) }
936
+ attr_accessor :missing_payment_method
937
+ sig { params(missing_payment_method: String).void }
938
+ def initialize(missing_payment_method: nil); end
939
+ end
940
+ # Defines how the subscription should behave when the user's free trial ends.
941
+ sig { returns(::Stripe::Subscription::UpdateParams::TrialSettings::EndBehavior) }
942
+ attr_accessor :end_behavior
943
+ sig {
944
+ params(end_behavior: ::Stripe::Subscription::UpdateParams::TrialSettings::EndBehavior).void
945
+ }
946
+ def initialize(end_behavior: nil); end
947
+ end
948
+ # 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.
949
+ sig { returns(T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem])) }
950
+ attr_accessor :add_invoice_items
951
+ # 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).
952
+ sig { returns(T.nilable(T.nilable(T.any(String, Float)))) }
953
+ attr_accessor :application_fee_percent
954
+ # Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
955
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax)) }
956
+ attr_accessor :automatic_tax
957
+ # 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).
958
+ sig { returns(T.nilable(String)) }
959
+ attr_accessor :billing_cycle_anchor
960
+ # 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.
961
+ sig {
962
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::BillingThresholds))))
963
+ }
964
+ attr_accessor :billing_thresholds
965
+ # 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.
966
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
967
+ attr_accessor :cancel_at
968
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
969
+ sig { returns(T.nilable(T::Boolean)) }
970
+ attr_accessor :cancel_at_period_end
971
+ # Details about why this subscription was cancelled
972
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::CancellationDetails)) }
973
+ attr_accessor :cancellation_details
974
+ # 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`.
975
+ sig { returns(T.nilable(String)) }
976
+ attr_accessor :collection_method
977
+ # 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`.
978
+ sig { returns(T.nilable(Integer)) }
979
+ attr_accessor :days_until_due
980
+ # 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).
981
+ sig { returns(T.nilable(String)) }
982
+ attr_accessor :default_payment_method
983
+ # 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).
984
+ sig { returns(T.nilable(T.nilable(String))) }
985
+ attr_accessor :default_source
986
+ # 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.
987
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
988
+ attr_accessor :default_tax_rates
989
+ # 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.
990
+ sig { returns(T.nilable(T.nilable(String))) }
991
+ attr_accessor :description
992
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
993
+ sig {
994
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Discount]))))
995
+ }
996
+ attr_accessor :discounts
997
+ # Specifies which fields in the response should be expanded.
998
+ sig { returns(T.nilable(T::Array[String])) }
999
+ attr_accessor :expand
1000
+ # All invoices will be billed using the specified settings.
1001
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings)) }
1002
+ attr_accessor :invoice_settings
1003
+ # A list of up to 20 subscription items, each with an attached price.
1004
+ sig { returns(T.nilable(T::Array[::Stripe::Subscription::UpdateParams::Item])) }
1005
+ attr_accessor :items
1006
+ # 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`.
1007
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1008
+ attr_accessor :metadata
1009
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
1010
+ sig { returns(T.nilable(T::Boolean)) }
1011
+ attr_accessor :off_session
1012
+ # The account on behalf of which to charge, for each of the subscription's invoices.
1013
+ sig { returns(T.nilable(T.nilable(String))) }
1014
+ attr_accessor :on_behalf_of
1015
+ # 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).
1016
+ sig {
1017
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PauseCollection))))
1018
+ }
1019
+ attr_accessor :pause_collection
1020
+ # 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.
1021
+ #
1022
+ # 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.
1023
+ #
1024
+ # 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).
1025
+ #
1026
+ # 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://stripe.com/docs/upgrades#2019-03-14) to learn more.
1027
+ sig { returns(T.nilable(String)) }
1028
+ attr_accessor :payment_behavior
1029
+ # Payment settings to pass to invoices created by the subscription.
1030
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings)) }
1031
+ attr_accessor :payment_settings
1032
+ # 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.
1033
+ sig {
1034
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PendingInvoiceItemInterval))))
1035
+ }
1036
+ attr_accessor :pending_invoice_item_interval
1037
+ # 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`.
1038
+ sig { returns(T.nilable(String)) }
1039
+ attr_accessor :proration_behavior
1040
+ # 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.
1041
+ sig { returns(T.nilable(Integer)) }
1042
+ attr_accessor :proration_date
1043
+ # 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.
1044
+ sig {
1045
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::TransferData))))
1046
+ }
1047
+ attr_accessor :transfer_data
1048
+ # 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`.
1049
+ sig { returns(T.nilable(T.any(String, Integer))) }
1050
+ attr_accessor :trial_end
1051
+ # 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.
1052
+ sig { returns(T.nilable(T::Boolean)) }
1053
+ attr_accessor :trial_from_plan
1054
+ # Settings related to subscription trials.
1055
+ sig { returns(T.nilable(::Stripe::Subscription::UpdateParams::TrialSettings)) }
1056
+ attr_accessor :trial_settings
1057
+ sig {
1058
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::BillingThresholds))), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancellation_details: T.nilable(::Stripe::Subscription::UpdateParams::CancellationDetails), collection_method: T.nilable(String), days_until_due: T.nilable(Integer), default_payment_method: T.nilable(String), default_source: T.nilable(T.nilable(String)), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), description: T.nilable(T.nilable(String)), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::UpdateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), pause_collection: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::Subscription::UpdateParams::TrialSettings)).void
1059
+ }
1060
+ def initialize(
1061
+ add_invoice_items: nil,
1062
+ application_fee_percent: nil,
1063
+ automatic_tax: nil,
1064
+ billing_cycle_anchor: nil,
1065
+ billing_thresholds: nil,
1066
+ cancel_at: nil,
1067
+ cancel_at_period_end: nil,
1068
+ cancellation_details: nil,
1069
+ collection_method: nil,
1070
+ days_until_due: nil,
1071
+ default_payment_method: nil,
1072
+ default_source: nil,
1073
+ default_tax_rates: nil,
1074
+ description: nil,
1075
+ discounts: nil,
1076
+ expand: nil,
1077
+ invoice_settings: nil,
1078
+ items: nil,
1079
+ metadata: nil,
1080
+ off_session: nil,
1081
+ on_behalf_of: nil,
1082
+ pause_collection: nil,
1083
+ payment_behavior: nil,
1084
+ payment_settings: nil,
1085
+ pending_invoice_item_interval: nil,
1086
+ proration_behavior: nil,
1087
+ proration_date: nil,
1088
+ transfer_data: nil,
1089
+ trial_end: nil,
1090
+ trial_from_plan: nil,
1091
+ trial_settings: nil
1092
+ ); end
1093
+ end
1094
+ class DeleteDiscountParams < Stripe::RequestParams; end
1095
+ class ListParams < Stripe::RequestParams
1096
+ class AutomaticTax < Stripe::RequestParams
1097
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1098
+ sig { returns(T::Boolean) }
1099
+ attr_accessor :enabled
1100
+ sig { params(enabled: T::Boolean).void }
1101
+ def initialize(enabled: nil); end
1102
+ end
1103
+ class Created < Stripe::RequestParams
1104
+ # Minimum value to filter by (exclusive)
1105
+ sig { returns(T.nilable(Integer)) }
1106
+ attr_accessor :gt
1107
+ # Minimum value to filter by (inclusive)
1108
+ sig { returns(T.nilable(Integer)) }
1109
+ attr_accessor :gte
1110
+ # Maximum value to filter by (exclusive)
1111
+ sig { returns(T.nilable(Integer)) }
1112
+ attr_accessor :lt
1113
+ # Maximum value to filter by (inclusive)
1114
+ sig { returns(T.nilable(Integer)) }
1115
+ attr_accessor :lte
1116
+ sig {
1117
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1118
+ }
1119
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1120
+ end
1121
+ class CurrentPeriodEnd < Stripe::RequestParams
1122
+ # Minimum value to filter by (exclusive)
1123
+ sig { returns(T.nilable(Integer)) }
1124
+ attr_accessor :gt
1125
+ # Minimum value to filter by (inclusive)
1126
+ sig { returns(T.nilable(Integer)) }
1127
+ attr_accessor :gte
1128
+ # Maximum value to filter by (exclusive)
1129
+ sig { returns(T.nilable(Integer)) }
1130
+ attr_accessor :lt
1131
+ # Maximum value to filter by (inclusive)
1132
+ sig { returns(T.nilable(Integer)) }
1133
+ attr_accessor :lte
1134
+ sig {
1135
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1136
+ }
1137
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1138
+ end
1139
+ class CurrentPeriodStart < Stripe::RequestParams
1140
+ # Minimum value to filter by (exclusive)
1141
+ sig { returns(T.nilable(Integer)) }
1142
+ attr_accessor :gt
1143
+ # Minimum value to filter by (inclusive)
1144
+ sig { returns(T.nilable(Integer)) }
1145
+ attr_accessor :gte
1146
+ # Maximum value to filter by (exclusive)
1147
+ sig { returns(T.nilable(Integer)) }
1148
+ attr_accessor :lt
1149
+ # Maximum value to filter by (inclusive)
1150
+ sig { returns(T.nilable(Integer)) }
1151
+ attr_accessor :lte
1152
+ sig {
1153
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
1154
+ }
1155
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
1156
+ end
1157
+ # Filter subscriptions by their automatic tax settings.
1158
+ sig { returns(T.nilable(::Stripe::Subscription::ListParams::AutomaticTax)) }
1159
+ attr_accessor :automatic_tax
1160
+ # The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`.
1161
+ sig { returns(T.nilable(String)) }
1162
+ attr_accessor :collection_method
1163
+ # Only return subscriptions that were created during the given date interval.
1164
+ sig { returns(T.nilable(T.any(::Stripe::Subscription::ListParams::Created, Integer))) }
1165
+ attr_accessor :created
1166
+ # Only return subscriptions whose current_period_end falls within the given date interval.
1167
+ sig {
1168
+ returns(T.nilable(T.any(::Stripe::Subscription::ListParams::CurrentPeriodEnd, Integer)))
1169
+ }
1170
+ attr_accessor :current_period_end
1171
+ # Only return subscriptions whose current_period_start falls within the given date interval.
1172
+ sig {
1173
+ returns(T.nilable(T.any(::Stripe::Subscription::ListParams::CurrentPeriodStart, Integer)))
1174
+ }
1175
+ attr_accessor :current_period_start
1176
+ # The ID of the customer whose subscriptions will be retrieved.
1177
+ sig { returns(T.nilable(String)) }
1178
+ attr_accessor :customer
1179
+ # 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.
1180
+ sig { returns(T.nilable(String)) }
1181
+ attr_accessor :ending_before
1182
+ # Specifies which fields in the response should be expanded.
1183
+ sig { returns(T.nilable(T::Array[String])) }
1184
+ attr_accessor :expand
1185
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1186
+ sig { returns(T.nilable(Integer)) }
1187
+ attr_accessor :limit
1188
+ # The ID of the plan whose subscriptions will be retrieved.
1189
+ sig { returns(T.nilable(String)) }
1190
+ attr_accessor :plan
1191
+ # Filter for subscriptions that contain this recurring price ID.
1192
+ sig { returns(T.nilable(String)) }
1193
+ attr_accessor :price
1194
+ # 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.
1195
+ sig { returns(T.nilable(String)) }
1196
+ attr_accessor :starting_after
1197
+ # 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.
1198
+ sig { returns(T.nilable(String)) }
1199
+ attr_accessor :status
1200
+ # 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.
1201
+ sig { returns(T.nilable(String)) }
1202
+ attr_accessor :test_clock
1203
+ sig {
1204
+ params(automatic_tax: T.nilable(::Stripe::Subscription::ListParams::AutomaticTax), collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::Subscription::ListParams::Created, Integer)), current_period_end: T.nilable(T.any(::Stripe::Subscription::ListParams::CurrentPeriodEnd, Integer)), current_period_start: T.nilable(T.any(::Stripe::Subscription::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
1205
+ }
1206
+ def initialize(
1207
+ automatic_tax: nil,
1208
+ collection_method: nil,
1209
+ created: nil,
1210
+ current_period_end: nil,
1211
+ current_period_start: nil,
1212
+ customer: nil,
1213
+ ending_before: nil,
1214
+ expand: nil,
1215
+ limit: nil,
1216
+ plan: nil,
1217
+ price: nil,
1218
+ starting_after: nil,
1219
+ status: nil,
1220
+ test_clock: nil
1221
+ ); end
1222
+ end
1223
+ class CreateParams < Stripe::RequestParams
1224
+ class AddInvoiceItem < Stripe::RequestParams
1225
+ class Discount < Stripe::RequestParams
1226
+ # ID of the coupon to create a new discount for.
1227
+ sig { returns(T.nilable(String)) }
1228
+ attr_accessor :coupon
1229
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1230
+ sig { returns(T.nilable(String)) }
1231
+ attr_accessor :discount
1232
+ # ID of the promotion code to create a new discount for.
1233
+ sig { returns(T.nilable(String)) }
1234
+ attr_accessor :promotion_code
1235
+ sig {
1236
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1237
+ }
1238
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1239
+ end
1240
+ class PriceData < Stripe::RequestParams
1241
+ # 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).
1242
+ sig { returns(String) }
1243
+ attr_accessor :currency
1244
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1245
+ sig { returns(String) }
1246
+ attr_accessor :product
1247
+ # 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.
1248
+ sig { returns(T.nilable(String)) }
1249
+ attr_accessor :tax_behavior
1250
+ # 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.
1251
+ sig { returns(T.nilable(Integer)) }
1252
+ attr_accessor :unit_amount
1253
+ # 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.
1254
+ sig { returns(T.nilable(String)) }
1255
+ attr_accessor :unit_amount_decimal
1256
+ sig {
1257
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1258
+ }
1259
+ def initialize(
1260
+ currency: nil,
1261
+ product: nil,
1262
+ tax_behavior: nil,
1263
+ unit_amount: nil,
1264
+ unit_amount_decimal: nil
1265
+ ); end
1266
+ end
1267
+ # The coupons to redeem into discounts for the item.
1268
+ sig {
1269
+ returns(T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem::Discount]))
1270
+ }
1271
+ attr_accessor :discounts
1272
+ # The ID of the price object. One of `price` or `price_data` is required.
1273
+ sig { returns(T.nilable(String)) }
1274
+ attr_accessor :price
1275
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1276
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::AddInvoiceItem::PriceData)) }
1277
+ attr_accessor :price_data
1278
+ # Quantity for this item. Defaults to 1.
1279
+ sig { returns(T.nilable(Integer)) }
1280
+ attr_accessor :quantity
1281
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1282
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1283
+ attr_accessor :tax_rates
1284
+ sig {
1285
+ params(discounts: T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::Subscription::CreateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1286
+ }
1287
+ def initialize(
1288
+ discounts: nil,
1289
+ price: nil,
1290
+ price_data: nil,
1291
+ quantity: nil,
1292
+ tax_rates: nil
1293
+ ); end
1294
+ end
1295
+ class AutomaticTax < Stripe::RequestParams
1296
+ class Liability < Stripe::RequestParams
1297
+ # The connected account being referenced when `type` is `account`.
1298
+ sig { returns(T.nilable(String)) }
1299
+ attr_accessor :account
1300
+ # Type of the account referenced in the request.
1301
+ sig { returns(String) }
1302
+ attr_accessor :type
1303
+ sig { params(account: T.nilable(String), type: String).void }
1304
+ def initialize(account: nil, type: nil); end
1305
+ end
1306
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1307
+ sig { returns(T::Boolean) }
1308
+ attr_accessor :enabled
1309
+ # 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.
1310
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax::Liability)) }
1311
+ attr_accessor :liability
1312
+ sig {
1313
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax::Liability)).void
1314
+ }
1315
+ def initialize(enabled: nil, liability: nil); end
1316
+ end
1317
+ class BillingCycleAnchorConfig < Stripe::RequestParams
1318
+ # The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31.
1319
+ sig { returns(Integer) }
1320
+ attr_accessor :day_of_month
1321
+ # The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23.
1322
+ sig { returns(T.nilable(Integer)) }
1323
+ attr_accessor :hour
1324
+ # The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59.
1325
+ sig { returns(T.nilable(Integer)) }
1326
+ attr_accessor :minute
1327
+ # The month to start full cycle billing periods. Ranges from 1 to 12.
1328
+ sig { returns(T.nilable(Integer)) }
1329
+ attr_accessor :month
1330
+ # The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59.
1331
+ sig { returns(T.nilable(Integer)) }
1332
+ attr_accessor :second
1333
+ sig {
1334
+ params(day_of_month: Integer, hour: T.nilable(Integer), minute: T.nilable(Integer), month: T.nilable(Integer), second: T.nilable(Integer)).void
1335
+ }
1336
+ def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil); end
1337
+ end
1338
+ class BillingThresholds < Stripe::RequestParams
1339
+ # Monetary threshold that triggers the subscription to advance to a new billing period
1340
+ sig { returns(T.nilable(Integer)) }
1341
+ attr_accessor :amount_gte
1342
+ # 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.
1343
+ sig { returns(T.nilable(T::Boolean)) }
1344
+ attr_accessor :reset_billing_cycle_anchor
1345
+ sig {
1346
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
1347
+ }
1348
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
1349
+ end
1350
+ class Discount < Stripe::RequestParams
1351
+ # ID of the coupon to create a new discount for.
1352
+ sig { returns(T.nilable(String)) }
1353
+ attr_accessor :coupon
1354
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1355
+ sig { returns(T.nilable(String)) }
1356
+ attr_accessor :discount
1357
+ # ID of the promotion code to create a new discount for.
1358
+ sig { returns(T.nilable(String)) }
1359
+ attr_accessor :promotion_code
1360
+ sig {
1361
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1362
+ }
1363
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1364
+ end
1365
+ class InvoiceSettings < Stripe::RequestParams
1366
+ class Issuer < Stripe::RequestParams
1367
+ # The connected account being referenced when `type` is `account`.
1368
+ sig { returns(T.nilable(String)) }
1369
+ attr_accessor :account
1370
+ # Type of the account referenced in the request.
1371
+ sig { returns(String) }
1372
+ attr_accessor :type
1373
+ sig { params(account: T.nilable(String), type: String).void }
1374
+ def initialize(account: nil, type: nil); end
1375
+ end
1376
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
1377
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1378
+ attr_accessor :account_tax_ids
1379
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1380
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings::Issuer)) }
1381
+ attr_accessor :issuer
1382
+ sig {
1383
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), issuer: T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings::Issuer)).void
1384
+ }
1385
+ def initialize(account_tax_ids: nil, issuer: nil); end
1386
+ end
1387
+ class Item < Stripe::RequestParams
1388
+ class BillingThresholds < Stripe::RequestParams
1389
+ # 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))
1390
+ sig { returns(Integer) }
1391
+ attr_accessor :usage_gte
1392
+ sig { params(usage_gte: Integer).void }
1393
+ def initialize(usage_gte: nil); end
1394
+ end
1395
+ class Discount < Stripe::RequestParams
1396
+ # ID of the coupon to create a new discount for.
1397
+ sig { returns(T.nilable(String)) }
1398
+ attr_accessor :coupon
1399
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1400
+ sig { returns(T.nilable(String)) }
1401
+ attr_accessor :discount
1402
+ # ID of the promotion code to create a new discount for.
1403
+ sig { returns(T.nilable(String)) }
1404
+ attr_accessor :promotion_code
1405
+ sig {
1406
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1407
+ }
1408
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1409
+ end
1410
+ class PriceData < Stripe::RequestParams
1411
+ class Recurring < Stripe::RequestParams
1412
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1413
+ sig { returns(String) }
1414
+ attr_accessor :interval
1415
+ # 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).
1416
+ sig { returns(T.nilable(Integer)) }
1417
+ attr_accessor :interval_count
1418
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1419
+ def initialize(interval: nil, interval_count: nil); end
1420
+ end
1421
+ # 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).
1422
+ sig { returns(String) }
1423
+ attr_accessor :currency
1424
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1425
+ sig { returns(String) }
1426
+ attr_accessor :product
1427
+ # The recurring components of a price such as `interval` and `interval_count`.
1428
+ sig { returns(::Stripe::Subscription::CreateParams::Item::PriceData::Recurring) }
1429
+ attr_accessor :recurring
1430
+ # 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.
1431
+ sig { returns(T.nilable(String)) }
1432
+ attr_accessor :tax_behavior
1433
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1434
+ sig { returns(T.nilable(Integer)) }
1435
+ attr_accessor :unit_amount
1436
+ # 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.
1437
+ sig { returns(T.nilable(String)) }
1438
+ attr_accessor :unit_amount_decimal
1439
+ sig {
1440
+ params(currency: String, product: String, recurring: ::Stripe::Subscription::CreateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1441
+ }
1442
+ def initialize(
1443
+ currency: nil,
1444
+ product: nil,
1445
+ recurring: nil,
1446
+ tax_behavior: nil,
1447
+ unit_amount: nil,
1448
+ unit_amount_decimal: nil
1449
+ ); end
1450
+ end
1451
+ # 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.
1452
+ sig {
1453
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::Item::BillingThresholds))))
1454
+ }
1455
+ attr_accessor :billing_thresholds
1456
+ # The coupons to redeem into discounts for the subscription item.
1457
+ sig {
1458
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Item::Discount]))))
1459
+ }
1460
+ attr_accessor :discounts
1461
+ # 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`.
1462
+ sig { returns(T.nilable(T::Hash[String, String])) }
1463
+ attr_accessor :metadata
1464
+ # Plan ID for this item, as a string.
1465
+ sig { returns(T.nilable(String)) }
1466
+ attr_accessor :plan
1467
+ # The ID of the price object.
1468
+ sig { returns(T.nilable(String)) }
1469
+ attr_accessor :price
1470
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1471
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::Item::PriceData)) }
1472
+ attr_accessor :price_data
1473
+ # Quantity for this item.
1474
+ sig { returns(T.nilable(Integer)) }
1475
+ attr_accessor :quantity
1476
+ # 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.
1477
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1478
+ attr_accessor :tax_rates
1479
+ sig {
1480
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::Subscription::CreateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1481
+ }
1482
+ def initialize(
1483
+ billing_thresholds: nil,
1484
+ discounts: nil,
1485
+ metadata: nil,
1486
+ plan: nil,
1487
+ price: nil,
1488
+ price_data: nil,
1489
+ quantity: nil,
1490
+ tax_rates: nil
1491
+ ); end
1492
+ end
1493
+ class PaymentSettings < Stripe::RequestParams
1494
+ class PaymentMethodOptions < Stripe::RequestParams
1495
+ class AcssDebit < Stripe::RequestParams
1496
+ class MandateOptions < Stripe::RequestParams
1497
+ # Transaction type of the mandate.
1498
+ sig { returns(T.nilable(String)) }
1499
+ attr_accessor :transaction_type
1500
+ sig { params(transaction_type: T.nilable(String)).void }
1501
+ def initialize(transaction_type: nil); end
1502
+ end
1503
+ # Additional fields for Mandate creation
1504
+ sig {
1505
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
1506
+ }
1507
+ attr_accessor :mandate_options
1508
+ # Verification method for the intent
1509
+ sig { returns(T.nilable(String)) }
1510
+ attr_accessor :verification_method
1511
+ sig {
1512
+ params(mandate_options: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
1513
+ }
1514
+ def initialize(mandate_options: nil, verification_method: nil); end
1515
+ end
1516
+ class Bancontact < Stripe::RequestParams
1517
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1518
+ sig { returns(T.nilable(String)) }
1519
+ attr_accessor :preferred_language
1520
+ sig { params(preferred_language: T.nilable(String)).void }
1521
+ def initialize(preferred_language: nil); end
1522
+ end
1523
+ class Card < Stripe::RequestParams
1524
+ class MandateOptions < Stripe::RequestParams
1525
+ # Amount to be charged for future payments.
1526
+ sig { returns(T.nilable(Integer)) }
1527
+ attr_accessor :amount
1528
+ # 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.
1529
+ sig { returns(T.nilable(String)) }
1530
+ attr_accessor :amount_type
1531
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1532
+ sig { returns(T.nilable(String)) }
1533
+ attr_accessor :description
1534
+ sig {
1535
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
1536
+ }
1537
+ def initialize(amount: nil, amount_type: nil, description: nil); end
1538
+ end
1539
+ # Configuration options for setting up an eMandate for cards issued in India.
1540
+ sig {
1541
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
1542
+ }
1543
+ attr_accessor :mandate_options
1544
+ # 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.
1545
+ sig { returns(T.nilable(String)) }
1546
+ attr_accessor :network
1547
+ # 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.
1548
+ sig { returns(T.nilable(String)) }
1549
+ attr_accessor :request_three_d_secure
1550
+ sig {
1551
+ params(mandate_options: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
1552
+ }
1553
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
1554
+ end
1555
+ class CustomerBalance < Stripe::RequestParams
1556
+ class BankTransfer < Stripe::RequestParams
1557
+ class EuBankTransfer < Stripe::RequestParams
1558
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1559
+ sig { returns(String) }
1560
+ attr_accessor :country
1561
+ sig { params(country: String).void }
1562
+ def initialize(country: nil); end
1563
+ end
1564
+ # Configuration for eu_bank_transfer funding type.
1565
+ sig {
1566
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
1567
+ }
1568
+ attr_accessor :eu_bank_transfer
1569
+ # 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`.
1570
+ sig { returns(T.nilable(String)) }
1571
+ attr_accessor :type
1572
+ sig {
1573
+ params(eu_bank_transfer: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
1574
+ }
1575
+ def initialize(eu_bank_transfer: nil, type: nil); end
1576
+ end
1577
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1578
+ sig {
1579
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
1580
+ }
1581
+ attr_accessor :bank_transfer
1582
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1583
+ sig { returns(T.nilable(String)) }
1584
+ attr_accessor :funding_type
1585
+ sig {
1586
+ params(bank_transfer: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
1587
+ }
1588
+ def initialize(bank_transfer: nil, funding_type: nil); end
1589
+ end
1590
+ class Konbini < Stripe::RequestParams; end
1591
+ class SepaDebit < Stripe::RequestParams; end
1592
+ class UsBankAccount < Stripe::RequestParams
1593
+ class FinancialConnections < Stripe::RequestParams
1594
+ class Filters < Stripe::RequestParams
1595
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1596
+ sig { returns(T.nilable(T::Array[String])) }
1597
+ attr_accessor :account_subcategories
1598
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
1599
+ def initialize(account_subcategories: nil); end
1600
+ end
1601
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1602
+ sig {
1603
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
1604
+ }
1605
+ attr_accessor :filters
1606
+ # 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`.
1607
+ sig { returns(T.nilable(T::Array[String])) }
1608
+ attr_accessor :permissions
1609
+ # List of data features that you would like to retrieve upon account creation.
1610
+ sig { returns(T.nilable(T::Array[String])) }
1611
+ attr_accessor :prefetch
1612
+ sig {
1613
+ params(filters: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
1614
+ }
1615
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
1616
+ end
1617
+ # Additional fields for Financial Connections Session creation
1618
+ sig {
1619
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
1620
+ }
1621
+ attr_accessor :financial_connections
1622
+ # Verification method for the intent
1623
+ sig { returns(T.nilable(String)) }
1624
+ attr_accessor :verification_method
1625
+ sig {
1626
+ params(financial_connections: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1627
+ }
1628
+ def initialize(financial_connections: nil, verification_method: nil); end
1629
+ end
1630
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1631
+ sig {
1632
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1633
+ }
1634
+ attr_accessor :acss_debit
1635
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1636
+ sig {
1637
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1638
+ }
1639
+ attr_accessor :bancontact
1640
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1641
+ sig {
1642
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Card))))
1643
+ }
1644
+ attr_accessor :card
1645
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1646
+ sig {
1647
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1648
+ }
1649
+ attr_accessor :customer_balance
1650
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1651
+ sig {
1652
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1653
+ }
1654
+ attr_accessor :konbini
1655
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1656
+ sig {
1657
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1658
+ }
1659
+ attr_accessor :sepa_debit
1660
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1661
+ sig {
1662
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1663
+ }
1664
+ attr_accessor :us_bank_account
1665
+ sig {
1666
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1667
+ }
1668
+ def initialize(
1669
+ acss_debit: nil,
1670
+ bancontact: nil,
1671
+ card: nil,
1672
+ customer_balance: nil,
1673
+ konbini: nil,
1674
+ sepa_debit: nil,
1675
+ us_bank_account: nil
1676
+ ); end
1677
+ end
1678
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
1679
+ sig {
1680
+ returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions))
1681
+ }
1682
+ attr_accessor :payment_method_options
1683
+ # 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
1684
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1685
+ attr_accessor :payment_method_types
1686
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
1687
+ sig { returns(T.nilable(String)) }
1688
+ attr_accessor :save_default_payment_method
1689
+ sig {
1690
+ params(payment_method_options: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String]))), save_default_payment_method: T.nilable(String)).void
1691
+ }
1692
+ def initialize(
1693
+ payment_method_options: nil,
1694
+ payment_method_types: nil,
1695
+ save_default_payment_method: nil
1696
+ ); end
1697
+ end
1698
+ class PendingInvoiceItemInterval < Stripe::RequestParams
1699
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
1700
+ sig { returns(String) }
1701
+ attr_accessor :interval
1702
+ # 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).
1703
+ sig { returns(T.nilable(Integer)) }
1704
+ attr_accessor :interval_count
1705
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1706
+ def initialize(interval: nil, interval_count: nil); end
1707
+ end
1708
+ class TransferData < Stripe::RequestParams
1709
+ # 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.
1710
+ sig { returns(T.nilable(Float)) }
1711
+ attr_accessor :amount_percent
1712
+ # ID of an existing, connected Stripe account.
1713
+ sig { returns(String) }
1714
+ attr_accessor :destination
1715
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1716
+ def initialize(amount_percent: nil, destination: nil); end
1717
+ end
1718
+ class TrialSettings < Stripe::RequestParams
1719
+ class EndBehavior < Stripe::RequestParams
1720
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1721
+ sig { returns(String) }
1722
+ attr_accessor :missing_payment_method
1723
+ sig { params(missing_payment_method: String).void }
1724
+ def initialize(missing_payment_method: nil); end
1725
+ end
1726
+ # Defines how the subscription should behave when the user's free trial ends.
1727
+ sig { returns(::Stripe::Subscription::CreateParams::TrialSettings::EndBehavior) }
1728
+ attr_accessor :end_behavior
1729
+ sig {
1730
+ params(end_behavior: ::Stripe::Subscription::CreateParams::TrialSettings::EndBehavior).void
1731
+ }
1732
+ def initialize(end_behavior: nil); end
1733
+ end
1734
+ # 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.
1735
+ sig { returns(T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem])) }
1736
+ attr_accessor :add_invoice_items
1737
+ # 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).
1738
+ sig { returns(T.nilable(T.nilable(T.any(String, Float)))) }
1739
+ attr_accessor :application_fee_percent
1740
+ # Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
1741
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax)) }
1742
+ attr_accessor :automatic_tax
1743
+ # For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
1744
+ sig { returns(T.nilable(Integer)) }
1745
+ attr_accessor :backdate_start_date
1746
+ # 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.
1747
+ sig { returns(T.nilable(Integer)) }
1748
+ attr_accessor :billing_cycle_anchor
1749
+ # 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.
1750
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::BillingCycleAnchorConfig)) }
1751
+ attr_accessor :billing_cycle_anchor_config
1752
+ # 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.
1753
+ sig {
1754
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::BillingThresholds))))
1755
+ }
1756
+ attr_accessor :billing_thresholds
1757
+ # 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.
1758
+ sig { returns(T.nilable(Integer)) }
1759
+ attr_accessor :cancel_at
1760
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
1761
+ sig { returns(T.nilable(T::Boolean)) }
1762
+ attr_accessor :cancel_at_period_end
1763
+ # 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`.
1764
+ sig { returns(T.nilable(String)) }
1765
+ attr_accessor :collection_method
1766
+ # 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).
1767
+ sig { returns(T.nilable(String)) }
1768
+ attr_accessor :currency
1769
+ # The identifier of the customer to subscribe.
1770
+ sig { returns(String) }
1771
+ attr_accessor :customer
1772
+ # 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`.
1773
+ sig { returns(T.nilable(Integer)) }
1774
+ attr_accessor :days_until_due
1775
+ # 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).
1776
+ sig { returns(T.nilable(String)) }
1777
+ attr_accessor :default_payment_method
1778
+ # 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).
1779
+ sig { returns(T.nilable(String)) }
1780
+ attr_accessor :default_source
1781
+ # 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.
1782
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1783
+ attr_accessor :default_tax_rates
1784
+ # 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.
1785
+ sig { returns(T.nilable(String)) }
1786
+ attr_accessor :description
1787
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
1788
+ sig {
1789
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Discount]))))
1790
+ }
1791
+ attr_accessor :discounts
1792
+ # Specifies which fields in the response should be expanded.
1793
+ sig { returns(T.nilable(T::Array[String])) }
1794
+ attr_accessor :expand
1795
+ # All invoices will be billed using the specified settings.
1796
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings)) }
1797
+ attr_accessor :invoice_settings
1798
+ # A list of up to 20 subscription items, each with an attached price.
1799
+ sig { returns(T.nilable(T::Array[::Stripe::Subscription::CreateParams::Item])) }
1800
+ attr_accessor :items
1801
+ # 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`.
1802
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1803
+ attr_accessor :metadata
1804
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
1805
+ sig { returns(T.nilable(T::Boolean)) }
1806
+ attr_accessor :off_session
1807
+ # The account on behalf of which to charge, for each of the subscription's invoices.
1808
+ sig { returns(T.nilable(T.nilable(String))) }
1809
+ attr_accessor :on_behalf_of
1810
+ # Only applies to subscriptions with `collection_method=charge_automatically`.
1811
+ #
1812
+ # 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.
1813
+ #
1814
+ # 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.
1815
+ #
1816
+ # 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.
1817
+ #
1818
+ # `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription.
1819
+ #
1820
+ # Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status.
1821
+ sig { returns(T.nilable(String)) }
1822
+ attr_accessor :payment_behavior
1823
+ # Payment settings to pass to invoices created by the subscription.
1824
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings)) }
1825
+ attr_accessor :payment_settings
1826
+ # 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.
1827
+ sig {
1828
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PendingInvoiceItemInterval))))
1829
+ }
1830
+ attr_accessor :pending_invoice_item_interval
1831
+ # 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`.
1832
+ sig { returns(T.nilable(String)) }
1833
+ attr_accessor :proration_behavior
1834
+ # 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.
1835
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::TransferData)) }
1836
+ attr_accessor :transfer_data
1837
+ # 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.
1838
+ sig { returns(T.nilable(T.any(String, Integer))) }
1839
+ attr_accessor :trial_end
1840
+ # 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.
1841
+ sig { returns(T.nilable(T::Boolean)) }
1842
+ attr_accessor :trial_from_plan
1843
+ # 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.
1844
+ sig { returns(T.nilable(Integer)) }
1845
+ attr_accessor :trial_period_days
1846
+ # Settings related to subscription trials.
1847
+ sig { returns(T.nilable(::Stripe::Subscription::CreateParams::TrialSettings)) }
1848
+ attr_accessor :trial_settings
1849
+ sig {
1850
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::Subscription::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::Subscription::CreateParams::BillingCycleAnchorConfig), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::BillingThresholds))), cancel_at: T.nilable(Integer), 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.nilable(T.any(String, T::Array[String]))), description: T.nilable(String), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::Subscription::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::Subscription::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::Subscription::CreateParams::Item]), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String]))), off_session: T.nilable(T::Boolean), on_behalf_of: T.nilable(T.nilable(String)), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::Subscription::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::Subscription::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::Subscription::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::Subscription::CreateParams::TrialSettings)).void
1851
+ }
1852
+ def initialize(
1853
+ add_invoice_items: nil,
1854
+ application_fee_percent: nil,
1855
+ automatic_tax: nil,
1856
+ backdate_start_date: nil,
1857
+ billing_cycle_anchor: nil,
1858
+ billing_cycle_anchor_config: nil,
1859
+ billing_thresholds: nil,
1860
+ cancel_at: nil,
1861
+ cancel_at_period_end: nil,
1862
+ collection_method: nil,
1863
+ currency: nil,
1864
+ customer: nil,
1865
+ days_until_due: nil,
1866
+ default_payment_method: nil,
1867
+ default_source: nil,
1868
+ default_tax_rates: nil,
1869
+ description: nil,
1870
+ discounts: nil,
1871
+ expand: nil,
1872
+ invoice_settings: nil,
1873
+ items: nil,
1874
+ metadata: nil,
1875
+ off_session: nil,
1876
+ on_behalf_of: nil,
1877
+ payment_behavior: nil,
1878
+ payment_settings: nil,
1879
+ pending_invoice_item_interval: nil,
1880
+ proration_behavior: nil,
1881
+ transfer_data: nil,
1882
+ trial_end: nil,
1883
+ trial_from_plan: nil,
1884
+ trial_period_days: nil,
1885
+ trial_settings: nil
1886
+ ); end
1887
+ end
1888
+ class SearchParams < Stripe::RequestParams
1889
+ # Specifies which fields in the response should be expanded.
1890
+ sig { returns(T.nilable(T::Array[String])) }
1891
+ attr_accessor :expand
1892
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1893
+ sig { returns(T.nilable(Integer)) }
1894
+ attr_accessor :limit
1895
+ # 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.
1896
+ sig { returns(T.nilable(String)) }
1897
+ attr_accessor :page
1898
+ # 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).
1899
+ sig { returns(String) }
1900
+ attr_accessor :query
1901
+ sig {
1902
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
1903
+ }
1904
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
1905
+ end
1906
+ class ResumeParams < Stripe::RequestParams
1907
+ # 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).
1908
+ sig { returns(T.nilable(String)) }
1909
+ attr_accessor :billing_cycle_anchor
1910
+ # Specifies which fields in the response should be expanded.
1911
+ sig { returns(T.nilable(T::Array[String])) }
1912
+ attr_accessor :expand
1913
+ # 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`.
1914
+ sig { returns(T.nilable(String)) }
1915
+ attr_accessor :proration_behavior
1916
+ # 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.
1917
+ sig { returns(T.nilable(Integer)) }
1918
+ attr_accessor :proration_date
1919
+ sig {
1920
+ params(billing_cycle_anchor: T.nilable(String), expand: T.nilable(T::Array[String]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer)).void
1921
+ }
1922
+ def initialize(
1923
+ billing_cycle_anchor: nil,
1924
+ expand: nil,
1925
+ proration_behavior: nil,
1926
+ proration_date: nil
1927
+ ); end
1928
+ end
1929
+ # 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).
1930
+ #
1931
+ # 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.
1932
+ #
1933
+ # 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.
1934
+ sig {
1935
+ params(params: T.any(::Stripe::Subscription::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1936
+ }
1937
+ def cancel(params = {}, opts = {}); end
1938
+
1939
+ # 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).
1940
+ #
1941
+ # 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.
1942
+ #
1943
+ # 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.
1944
+ sig {
1945
+ params(subscription_exposed_id: String, params: T.any(::Stripe::Subscription::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1946
+ }
1947
+ def self.cancel(subscription_exposed_id, params = {}, opts = {}); end
1948
+
1949
+ # Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
1950
+ #
1951
+ # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
1952
+ # The payment_behavior parameter determines the exact behavior of the initial payment.
1953
+ #
1954
+ # 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.
1955
+ # Schedules provide the flexibility to model more complex billing configurations that change over time.
1956
+ sig {
1957
+ params(params: T.any(::Stripe::Subscription::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1958
+ }
1959
+ def self.create(params = {}, opts = {}); end
1960
+
1961
+ # Removes the currently applied discount on a subscription.
1962
+ sig {
1963
+ params(params: T.any(::Stripe::Subscription::DeleteDiscountParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Discount)
1964
+ }
1965
+ def delete_discount(params = {}, opts = {}); end
1966
+
1967
+ # Removes the currently applied discount on a subscription.
1968
+ sig {
1969
+ params(subscription_exposed_id: String, params: T.any(::Stripe::Subscription::DeleteDiscountParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Discount)
1970
+ }
1971
+ def self.delete_discount(subscription_exposed_id, params = {}, opts = {}); end
1972
+
1973
+ # By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
1974
+ sig {
1975
+ params(params: T.any(::Stripe::Subscription::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
1976
+ }
1977
+ def self.list(params = {}, opts = {}); end
1978
+
1979
+ # 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.
1980
+ sig {
1981
+ params(params: T.any(::Stripe::Subscription::ResumeParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1982
+ }
1983
+ def resume(params = {}, opts = {}); end
1984
+
1985
+ # 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.
1986
+ sig {
1987
+ params(subscription: String, params: T.any(::Stripe::Subscription::ResumeParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1988
+ }
1989
+ def self.resume(subscription, params = {}, opts = {}); end
1990
+
1991
+ sig {
1992
+ params(params: T.any(::Stripe::Subscription::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
1993
+ }
1994
+ def self.search(params = {}, opts = {}); end
1995
+
1996
+ sig {
1997
+ params(params: T.any(::Stripe::Subscription::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped, blk: T.untyped).returns(Stripe::SearchResultObject)
1998
+ }
1999
+ def self.search_auto_paging_each(params = {}, opts = {}, &blk); end
2000
+
2001
+ # Updates an existing subscription to match the specified parameters.
2002
+ # When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
2003
+ # To preview how the proration is calculated, use the [create preview](https://docs.stripe.com/docs/api/invoices/create_preview) endpoint.
2004
+ #
2005
+ # 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.
2006
+ #
2007
+ # Switching prices does not normally change the billing date or generate an immediate charge unless:
2008
+ #
2009
+ #
2010
+ # The billing interval is changed (for example, from monthly to yearly).
2011
+ # The subscription moves from free to paid.
2012
+ # A trial starts or ends.
2013
+ #
2014
+ #
2015
+ # 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).
2016
+ #
2017
+ # 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).
2018
+ #
2019
+ # 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.
2020
+ #
2021
+ # 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.
2022
+ sig {
2023
+ params(subscription_exposed_id: String, params: T.any(::Stripe::Subscription::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
2024
+ }
2025
+ def self.update(subscription_exposed_id, params = {}, opts = {}); end
2026
+ end
2027
+ end