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,1648 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ # typed: true
5
+ module Stripe
6
+ class SubscriptionService < StripeService
7
+ class CancelParams < Stripe::RequestParams
8
+ class CancellationDetails < Stripe::RequestParams
9
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
10
+ sig { returns(T.nilable(T.nilable(String))) }
11
+ attr_accessor :comment
12
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
13
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
14
+ attr_accessor :feedback
15
+ sig {
16
+ params(comment: T.nilable(T.nilable(String)), feedback: T.nilable(T.nilable(T.any(String, String)))).void
17
+ }
18
+ def initialize(comment: nil, feedback: nil); end
19
+ end
20
+ # Details about why this subscription was cancelled
21
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CancelParams::CancellationDetails)) }
22
+ attr_accessor :cancellation_details
23
+ # Specifies which fields in the response should be expanded.
24
+ sig { returns(T.nilable(T::Array[String])) }
25
+ attr_accessor :expand
26
+ # Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `false`.
27
+ sig { returns(T.nilable(T::Boolean)) }
28
+ attr_accessor :invoice_now
29
+ # Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`.
30
+ sig { returns(T.nilable(T::Boolean)) }
31
+ attr_accessor :prorate
32
+ sig {
33
+ params(cancellation_details: T.nilable(::Stripe::SubscriptionService::CancelParams::CancellationDetails), expand: T.nilable(T::Array[String]), invoice_now: T.nilable(T::Boolean), prorate: T.nilable(T::Boolean)).void
34
+ }
35
+ def initialize(cancellation_details: nil, expand: nil, invoice_now: nil, prorate: nil); end
36
+ end
37
+ class RetrieveParams < Stripe::RequestParams
38
+ # Specifies which fields in the response should be expanded.
39
+ sig { returns(T.nilable(T::Array[String])) }
40
+ attr_accessor :expand
41
+ sig { params(expand: T.nilable(T::Array[String])).void }
42
+ def initialize(expand: nil); end
43
+ end
44
+ class UpdateParams < Stripe::RequestParams
45
+ class AddInvoiceItem < Stripe::RequestParams
46
+ class Discount < Stripe::RequestParams
47
+ # ID of the coupon to create a new discount for.
48
+ sig { returns(T.nilable(String)) }
49
+ attr_accessor :coupon
50
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
51
+ sig { returns(T.nilable(String)) }
52
+ attr_accessor :discount
53
+ # ID of the promotion code to create a new discount for.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_accessor :promotion_code
56
+ sig {
57
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
58
+ }
59
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
60
+ end
61
+ class PriceData < Stripe::RequestParams
62
+ # 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).
63
+ sig { returns(String) }
64
+ attr_accessor :currency
65
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
66
+ sig { returns(String) }
67
+ attr_accessor :product
68
+ # 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.
69
+ sig { returns(T.nilable(String)) }
70
+ attr_accessor :tax_behavior
71
+ # 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.
72
+ sig { returns(T.nilable(Integer)) }
73
+ attr_accessor :unit_amount
74
+ # 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.
75
+ sig { returns(T.nilable(String)) }
76
+ attr_accessor :unit_amount_decimal
77
+ sig {
78
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
79
+ }
80
+ def initialize(
81
+ currency: nil,
82
+ product: nil,
83
+ tax_behavior: nil,
84
+ unit_amount: nil,
85
+ unit_amount_decimal: nil
86
+ ); end
87
+ end
88
+ # The coupons to redeem into discounts for the item.
89
+ sig {
90
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Discount]))
91
+ }
92
+ attr_accessor :discounts
93
+ # The ID of the price object. One of `price` or `price_data` is required.
94
+ sig { returns(T.nilable(String)) }
95
+ attr_accessor :price
96
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
97
+ sig {
98
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::PriceData))
99
+ }
100
+ attr_accessor :price_data
101
+ # Quantity for this item. Defaults to 1.
102
+ sig { returns(T.nilable(Integer)) }
103
+ attr_accessor :quantity
104
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
105
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
106
+ attr_accessor :tax_rates
107
+ sig {
108
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
109
+ }
110
+ def initialize(
111
+ discounts: nil,
112
+ price: nil,
113
+ price_data: nil,
114
+ quantity: nil,
115
+ tax_rates: nil
116
+ ); end
117
+ end
118
+ class AutomaticTax < Stripe::RequestParams
119
+ class Liability < Stripe::RequestParams
120
+ # The connected account being referenced when `type` is `account`.
121
+ sig { returns(T.nilable(String)) }
122
+ attr_accessor :account
123
+ # Type of the account referenced in the request.
124
+ sig { returns(String) }
125
+ attr_accessor :type
126
+ sig { params(account: T.nilable(String), type: String).void }
127
+ def initialize(account: nil, type: nil); end
128
+ end
129
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
130
+ sig { returns(T::Boolean) }
131
+ attr_accessor :enabled
132
+ # 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.
133
+ sig {
134
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax::Liability))
135
+ }
136
+ attr_accessor :liability
137
+ sig {
138
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax::Liability)).void
139
+ }
140
+ def initialize(enabled: nil, liability: nil); end
141
+ end
142
+ class BillingThresholds < Stripe::RequestParams
143
+ # Monetary threshold that triggers the subscription to advance to a new billing period
144
+ sig { returns(T.nilable(Integer)) }
145
+ attr_accessor :amount_gte
146
+ # 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.
147
+ sig { returns(T.nilable(T::Boolean)) }
148
+ attr_accessor :reset_billing_cycle_anchor
149
+ sig {
150
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
151
+ }
152
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
153
+ end
154
+ class CancellationDetails < Stripe::RequestParams
155
+ # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user.
156
+ sig { returns(T.nilable(T.nilable(String))) }
157
+ attr_accessor :comment
158
+ # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user.
159
+ sig { returns(T.nilable(T.nilable(T.any(String, String)))) }
160
+ attr_accessor :feedback
161
+ sig {
162
+ params(comment: T.nilable(T.nilable(String)), feedback: T.nilable(T.nilable(T.any(String, String)))).void
163
+ }
164
+ def initialize(comment: nil, feedback: nil); end
165
+ end
166
+ class Discount < Stripe::RequestParams
167
+ # ID of the coupon to create a new discount for.
168
+ sig { returns(T.nilable(String)) }
169
+ attr_accessor :coupon
170
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
171
+ sig { returns(T.nilable(String)) }
172
+ attr_accessor :discount
173
+ # ID of the promotion code to create a new discount for.
174
+ sig { returns(T.nilable(String)) }
175
+ attr_accessor :promotion_code
176
+ sig {
177
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
178
+ }
179
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
180
+ end
181
+ class InvoiceSettings < Stripe::RequestParams
182
+ class Issuer < Stripe::RequestParams
183
+ # The connected account being referenced when `type` is `account`.
184
+ sig { returns(T.nilable(String)) }
185
+ attr_accessor :account
186
+ # Type of the account referenced in the request.
187
+ sig { returns(String) }
188
+ attr_accessor :type
189
+ sig { params(account: T.nilable(String), type: String).void }
190
+ def initialize(account: nil, type: nil); end
191
+ end
192
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
193
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
194
+ attr_accessor :account_tax_ids
195
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
196
+ sig {
197
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings::Issuer))
198
+ }
199
+ attr_accessor :issuer
200
+ sig {
201
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), issuer: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings::Issuer)).void
202
+ }
203
+ def initialize(account_tax_ids: nil, issuer: nil); end
204
+ end
205
+ class Item < Stripe::RequestParams
206
+ class BillingThresholds < Stripe::RequestParams
207
+ # 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))
208
+ sig { returns(Integer) }
209
+ attr_accessor :usage_gte
210
+ sig { params(usage_gte: Integer).void }
211
+ def initialize(usage_gte: nil); end
212
+ end
213
+ class Discount < Stripe::RequestParams
214
+ # ID of the coupon to create a new discount for.
215
+ sig { returns(T.nilable(String)) }
216
+ attr_accessor :coupon
217
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
218
+ sig { returns(T.nilable(String)) }
219
+ attr_accessor :discount
220
+ # ID of the promotion code to create a new discount for.
221
+ sig { returns(T.nilable(String)) }
222
+ attr_accessor :promotion_code
223
+ sig {
224
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
225
+ }
226
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
227
+ end
228
+ class PriceData < Stripe::RequestParams
229
+ class Recurring < Stripe::RequestParams
230
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
231
+ sig { returns(String) }
232
+ attr_accessor :interval
233
+ # 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).
234
+ sig { returns(T.nilable(Integer)) }
235
+ attr_accessor :interval_count
236
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
237
+ def initialize(interval: nil, interval_count: nil); end
238
+ end
239
+ # 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).
240
+ sig { returns(String) }
241
+ attr_accessor :currency
242
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
243
+ sig { returns(String) }
244
+ attr_accessor :product
245
+ # The recurring components of a price such as `interval` and `interval_count`.
246
+ sig { returns(::Stripe::SubscriptionService::UpdateParams::Item::PriceData::Recurring) }
247
+ attr_accessor :recurring
248
+ # 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.
249
+ sig { returns(T.nilable(String)) }
250
+ attr_accessor :tax_behavior
251
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
252
+ sig { returns(T.nilable(Integer)) }
253
+ attr_accessor :unit_amount
254
+ # 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.
255
+ sig { returns(T.nilable(String)) }
256
+ attr_accessor :unit_amount_decimal
257
+ sig {
258
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionService::UpdateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
259
+ }
260
+ def initialize(
261
+ currency: nil,
262
+ product: nil,
263
+ recurring: nil,
264
+ tax_behavior: nil,
265
+ unit_amount: nil,
266
+ unit_amount_decimal: nil
267
+ ); end
268
+ end
269
+ # 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.
270
+ sig {
271
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds))))
272
+ }
273
+ attr_accessor :billing_thresholds
274
+ # 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.
275
+ sig { returns(T.nilable(T::Boolean)) }
276
+ attr_accessor :clear_usage
277
+ # A flag that, if set to `true`, will delete the specified item.
278
+ sig { returns(T.nilable(T::Boolean)) }
279
+ attr_accessor :deleted
280
+ # The coupons to redeem into discounts for the subscription item.
281
+ sig {
282
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Item::Discount]))))
283
+ }
284
+ attr_accessor :discounts
285
+ # Subscription item to update.
286
+ sig { returns(T.nilable(String)) }
287
+ attr_accessor :id
288
+ # 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`.
289
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
290
+ attr_accessor :metadata
291
+ # Plan ID for this item, as a string.
292
+ sig { returns(T.nilable(String)) }
293
+ attr_accessor :plan
294
+ # 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.
295
+ sig { returns(T.nilable(String)) }
296
+ attr_accessor :price
297
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
298
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::Item::PriceData)) }
299
+ attr_accessor :price_data
300
+ # Quantity for this item.
301
+ sig { returns(T.nilable(Integer)) }
302
+ attr_accessor :quantity
303
+ # 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.
304
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
305
+ attr_accessor :tax_rates
306
+ sig {
307
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::Item::BillingThresholds))), clear_usage: T.nilable(T::Boolean), deleted: T.nilable(T::Boolean), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::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::SubscriptionService::UpdateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
308
+ }
309
+ def initialize(
310
+ billing_thresholds: nil,
311
+ clear_usage: nil,
312
+ deleted: nil,
313
+ discounts: nil,
314
+ id: nil,
315
+ metadata: nil,
316
+ plan: nil,
317
+ price: nil,
318
+ price_data: nil,
319
+ quantity: nil,
320
+ tax_rates: nil
321
+ ); end
322
+ end
323
+ class PauseCollection < Stripe::RequestParams
324
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
325
+ sig { returns(String) }
326
+ attr_accessor :behavior
327
+ # The time after which the subscription will resume collecting payments.
328
+ sig { returns(T.nilable(Integer)) }
329
+ attr_accessor :resumes_at
330
+ sig { params(behavior: String, resumes_at: T.nilable(Integer)).void }
331
+ def initialize(behavior: nil, resumes_at: nil); end
332
+ end
333
+ class PaymentSettings < Stripe::RequestParams
334
+ class PaymentMethodOptions < Stripe::RequestParams
335
+ class AcssDebit < Stripe::RequestParams
336
+ class MandateOptions < Stripe::RequestParams
337
+ # Transaction type of the mandate.
338
+ sig { returns(T.nilable(String)) }
339
+ attr_accessor :transaction_type
340
+ sig { params(transaction_type: T.nilable(String)).void }
341
+ def initialize(transaction_type: nil); end
342
+ end
343
+ # Additional fields for Mandate creation
344
+ sig {
345
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
346
+ }
347
+ attr_accessor :mandate_options
348
+ # Verification method for the intent
349
+ sig { returns(T.nilable(String)) }
350
+ attr_accessor :verification_method
351
+ sig {
352
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
353
+ }
354
+ def initialize(mandate_options: nil, verification_method: nil); end
355
+ end
356
+ class Bancontact < Stripe::RequestParams
357
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
358
+ sig { returns(T.nilable(String)) }
359
+ attr_accessor :preferred_language
360
+ sig { params(preferred_language: T.nilable(String)).void }
361
+ def initialize(preferred_language: nil); end
362
+ end
363
+ class Card < Stripe::RequestParams
364
+ class MandateOptions < Stripe::RequestParams
365
+ # Amount to be charged for future payments.
366
+ sig { returns(T.nilable(Integer)) }
367
+ attr_accessor :amount
368
+ # 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.
369
+ sig { returns(T.nilable(String)) }
370
+ attr_accessor :amount_type
371
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
372
+ sig { returns(T.nilable(String)) }
373
+ attr_accessor :description
374
+ sig {
375
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
376
+ }
377
+ def initialize(amount: nil, amount_type: nil, description: nil); end
378
+ end
379
+ # Configuration options for setting up an eMandate for cards issued in India.
380
+ sig {
381
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
382
+ }
383
+ attr_accessor :mandate_options
384
+ # 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.
385
+ sig { returns(T.nilable(String)) }
386
+ attr_accessor :network
387
+ # 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.
388
+ sig { returns(T.nilable(String)) }
389
+ attr_accessor :request_three_d_secure
390
+ sig {
391
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
392
+ }
393
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
394
+ end
395
+ class CustomerBalance < Stripe::RequestParams
396
+ class BankTransfer < Stripe::RequestParams
397
+ class EuBankTransfer < Stripe::RequestParams
398
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
399
+ sig { returns(String) }
400
+ attr_accessor :country
401
+ sig { params(country: String).void }
402
+ def initialize(country: nil); end
403
+ end
404
+ # Configuration for eu_bank_transfer funding type.
405
+ sig {
406
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
407
+ }
408
+ attr_accessor :eu_bank_transfer
409
+ # 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`.
410
+ sig { returns(T.nilable(String)) }
411
+ attr_accessor :type
412
+ sig {
413
+ params(eu_bank_transfer: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
414
+ }
415
+ def initialize(eu_bank_transfer: nil, type: nil); end
416
+ end
417
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
418
+ sig {
419
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
420
+ }
421
+ attr_accessor :bank_transfer
422
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
423
+ sig { returns(T.nilable(String)) }
424
+ attr_accessor :funding_type
425
+ sig {
426
+ params(bank_transfer: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
427
+ }
428
+ def initialize(bank_transfer: nil, funding_type: nil); end
429
+ end
430
+ class Konbini < Stripe::RequestParams; end
431
+ class SepaDebit < Stripe::RequestParams; end
432
+ class UsBankAccount < Stripe::RequestParams
433
+ class FinancialConnections < Stripe::RequestParams
434
+ class Filters < Stripe::RequestParams
435
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
436
+ sig { returns(T.nilable(T::Array[String])) }
437
+ attr_accessor :account_subcategories
438
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
439
+ def initialize(account_subcategories: nil); end
440
+ end
441
+ # Provide filters for the linked accounts that the customer can select for the payment method.
442
+ sig {
443
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
444
+ }
445
+ attr_accessor :filters
446
+ # 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`.
447
+ sig { returns(T.nilable(T::Array[String])) }
448
+ attr_accessor :permissions
449
+ # List of data features that you would like to retrieve upon account creation.
450
+ sig { returns(T.nilable(T::Array[String])) }
451
+ attr_accessor :prefetch
452
+ sig {
453
+ params(filters: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
454
+ }
455
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
456
+ end
457
+ # Additional fields for Financial Connections Session creation
458
+ sig {
459
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
460
+ }
461
+ attr_accessor :financial_connections
462
+ # Verification method for the intent
463
+ sig { returns(T.nilable(String)) }
464
+ attr_accessor :verification_method
465
+ sig {
466
+ params(financial_connections: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
467
+ }
468
+ def initialize(financial_connections: nil, verification_method: nil); end
469
+ end
470
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
471
+ sig {
472
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
473
+ }
474
+ attr_accessor :acss_debit
475
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
476
+ sig {
477
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
478
+ }
479
+ attr_accessor :bancontact
480
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
481
+ sig {
482
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))))
483
+ }
484
+ attr_accessor :card
485
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
486
+ sig {
487
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
488
+ }
489
+ attr_accessor :customer_balance
490
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
491
+ sig {
492
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
493
+ }
494
+ attr_accessor :konbini
495
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
496
+ sig {
497
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
498
+ }
499
+ attr_accessor :sepa_debit
500
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
501
+ sig {
502
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
503
+ }
504
+ attr_accessor :us_bank_account
505
+ sig {
506
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
507
+ }
508
+ def initialize(
509
+ acss_debit: nil,
510
+ bancontact: nil,
511
+ card: nil,
512
+ customer_balance: nil,
513
+ konbini: nil,
514
+ sepa_debit: nil,
515
+ us_bank_account: nil
516
+ ); end
517
+ end
518
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
519
+ sig {
520
+ returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions))
521
+ }
522
+ attr_accessor :payment_method_options
523
+ # 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
524
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
525
+ attr_accessor :payment_method_types
526
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
527
+ sig { returns(T.nilable(String)) }
528
+ attr_accessor :save_default_payment_method
529
+ sig {
530
+ params(payment_method_options: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String]))), save_default_payment_method: T.nilable(String)).void
531
+ }
532
+ def initialize(
533
+ payment_method_options: nil,
534
+ payment_method_types: nil,
535
+ save_default_payment_method: nil
536
+ ); end
537
+ end
538
+ class PendingInvoiceItemInterval < Stripe::RequestParams
539
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
540
+ sig { returns(String) }
541
+ attr_accessor :interval
542
+ # 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).
543
+ sig { returns(T.nilable(Integer)) }
544
+ attr_accessor :interval_count
545
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
546
+ def initialize(interval: nil, interval_count: nil); end
547
+ end
548
+ class TransferData < Stripe::RequestParams
549
+ # 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.
550
+ sig { returns(T.nilable(Float)) }
551
+ attr_accessor :amount_percent
552
+ # ID of an existing, connected Stripe account.
553
+ sig { returns(String) }
554
+ attr_accessor :destination
555
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
556
+ def initialize(amount_percent: nil, destination: nil); end
557
+ end
558
+ class TrialSettings < Stripe::RequestParams
559
+ class EndBehavior < Stripe::RequestParams
560
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
561
+ sig { returns(String) }
562
+ attr_accessor :missing_payment_method
563
+ sig { params(missing_payment_method: String).void }
564
+ def initialize(missing_payment_method: nil); end
565
+ end
566
+ # Defines how the subscription should behave when the user's free trial ends.
567
+ sig { returns(::Stripe::SubscriptionService::UpdateParams::TrialSettings::EndBehavior) }
568
+ attr_accessor :end_behavior
569
+ sig {
570
+ params(end_behavior: ::Stripe::SubscriptionService::UpdateParams::TrialSettings::EndBehavior).void
571
+ }
572
+ def initialize(end_behavior: nil); end
573
+ end
574
+ # 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.
575
+ sig {
576
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]))
577
+ }
578
+ attr_accessor :add_invoice_items
579
+ # 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).
580
+ sig { returns(T.nilable(T.nilable(T.any(String, Float)))) }
581
+ attr_accessor :application_fee_percent
582
+ # Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
583
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax)) }
584
+ attr_accessor :automatic_tax
585
+ # 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).
586
+ sig { returns(T.nilable(String)) }
587
+ attr_accessor :billing_cycle_anchor
588
+ # 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.
589
+ sig {
590
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::BillingThresholds))))
591
+ }
592
+ attr_accessor :billing_thresholds
593
+ # 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.
594
+ sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
595
+ attr_accessor :cancel_at
596
+ # 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.
597
+ sig { returns(T.nilable(T::Boolean)) }
598
+ attr_accessor :cancel_at_period_end
599
+ # Details about why this subscription was cancelled
600
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::CancellationDetails)) }
601
+ attr_accessor :cancellation_details
602
+ # 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`.
603
+ sig { returns(T.nilable(String)) }
604
+ attr_accessor :collection_method
605
+ # 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`.
606
+ sig { returns(T.nilable(Integer)) }
607
+ attr_accessor :days_until_due
608
+ # 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).
609
+ sig { returns(T.nilable(String)) }
610
+ attr_accessor :default_payment_method
611
+ # 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).
612
+ sig { returns(T.nilable(T.nilable(String))) }
613
+ attr_accessor :default_source
614
+ # 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.
615
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
616
+ attr_accessor :default_tax_rates
617
+ # 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.
618
+ sig { returns(T.nilable(T.nilable(String))) }
619
+ attr_accessor :description
620
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
621
+ sig {
622
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::UpdateParams::Discount]))))
623
+ }
624
+ attr_accessor :discounts
625
+ # Specifies which fields in the response should be expanded.
626
+ sig { returns(T.nilable(T::Array[String])) }
627
+ attr_accessor :expand
628
+ # All invoices will be billed using the specified settings.
629
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings)) }
630
+ attr_accessor :invoice_settings
631
+ # A list of up to 20 subscription items, each with an attached price.
632
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::Item])) }
633
+ attr_accessor :items
634
+ # 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`.
635
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
636
+ attr_accessor :metadata
637
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
638
+ sig { returns(T.nilable(T::Boolean)) }
639
+ attr_accessor :off_session
640
+ # The account on behalf of which to charge, for each of the subscription's invoices.
641
+ sig { returns(T.nilable(T.nilable(String))) }
642
+ attr_accessor :on_behalf_of
643
+ # 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).
644
+ sig {
645
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PauseCollection))))
646
+ }
647
+ attr_accessor :pause_collection
648
+ # 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.
649
+ #
650
+ # 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.
651
+ #
652
+ # 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).
653
+ #
654
+ # 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.
655
+ sig { returns(T.nilable(String)) }
656
+ attr_accessor :payment_behavior
657
+ # Payment settings to pass to invoices created by the subscription.
658
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings)) }
659
+ attr_accessor :payment_settings
660
+ # 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.
661
+ sig {
662
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval))))
663
+ }
664
+ attr_accessor :pending_invoice_item_interval
665
+ # 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`.
666
+ sig { returns(T.nilable(String)) }
667
+ attr_accessor :proration_behavior
668
+ # 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.
669
+ sig { returns(T.nilable(Integer)) }
670
+ attr_accessor :proration_date
671
+ # 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.
672
+ sig {
673
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData))))
674
+ }
675
+ attr_accessor :transfer_data
676
+ # 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`.
677
+ sig { returns(T.nilable(T.any(String, Integer))) }
678
+ attr_accessor :trial_end
679
+ # 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.
680
+ sig { returns(T.nilable(T::Boolean)) }
681
+ attr_accessor :trial_from_plan
682
+ # Settings related to subscription trials.
683
+ sig { returns(T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)) }
684
+ attr_accessor :trial_settings
685
+ sig {
686
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::UpdateParams::AutomaticTax), billing_cycle_anchor: T.nilable(String), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::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::SubscriptionService::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::SubscriptionService::UpdateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::UpdateParams::Item]), metadata: T.nilable(T.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::SubscriptionService::UpdateParams::PauseCollection))), payment_behavior: T.nilable(String), payment_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), transfer_data: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::UpdateParams::TransferData))), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_settings: T.nilable(::Stripe::SubscriptionService::UpdateParams::TrialSettings)).void
687
+ }
688
+ def initialize(
689
+ add_invoice_items: nil,
690
+ application_fee_percent: nil,
691
+ automatic_tax: nil,
692
+ billing_cycle_anchor: nil,
693
+ billing_thresholds: nil,
694
+ cancel_at: nil,
695
+ cancel_at_period_end: nil,
696
+ cancellation_details: nil,
697
+ collection_method: nil,
698
+ days_until_due: nil,
699
+ default_payment_method: nil,
700
+ default_source: nil,
701
+ default_tax_rates: nil,
702
+ description: nil,
703
+ discounts: nil,
704
+ expand: nil,
705
+ invoice_settings: nil,
706
+ items: nil,
707
+ metadata: nil,
708
+ off_session: nil,
709
+ on_behalf_of: nil,
710
+ pause_collection: nil,
711
+ payment_behavior: nil,
712
+ payment_settings: nil,
713
+ pending_invoice_item_interval: nil,
714
+ proration_behavior: nil,
715
+ proration_date: nil,
716
+ transfer_data: nil,
717
+ trial_end: nil,
718
+ trial_from_plan: nil,
719
+ trial_settings: nil
720
+ ); end
721
+ end
722
+ class DeleteDiscountParams < Stripe::RequestParams; end
723
+ class ListParams < Stripe::RequestParams
724
+ class AutomaticTax < Stripe::RequestParams
725
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
726
+ sig { returns(T::Boolean) }
727
+ attr_accessor :enabled
728
+ sig { params(enabled: T::Boolean).void }
729
+ def initialize(enabled: nil); end
730
+ end
731
+ class Created < Stripe::RequestParams
732
+ # Minimum value to filter by (exclusive)
733
+ sig { returns(T.nilable(Integer)) }
734
+ attr_accessor :gt
735
+ # Minimum value to filter by (inclusive)
736
+ sig { returns(T.nilable(Integer)) }
737
+ attr_accessor :gte
738
+ # Maximum value to filter by (exclusive)
739
+ sig { returns(T.nilable(Integer)) }
740
+ attr_accessor :lt
741
+ # Maximum value to filter by (inclusive)
742
+ sig { returns(T.nilable(Integer)) }
743
+ attr_accessor :lte
744
+ sig {
745
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
746
+ }
747
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
748
+ end
749
+ class CurrentPeriodEnd < Stripe::RequestParams
750
+ # Minimum value to filter by (exclusive)
751
+ sig { returns(T.nilable(Integer)) }
752
+ attr_accessor :gt
753
+ # Minimum value to filter by (inclusive)
754
+ sig { returns(T.nilable(Integer)) }
755
+ attr_accessor :gte
756
+ # Maximum value to filter by (exclusive)
757
+ sig { returns(T.nilable(Integer)) }
758
+ attr_accessor :lt
759
+ # Maximum value to filter by (inclusive)
760
+ sig { returns(T.nilable(Integer)) }
761
+ attr_accessor :lte
762
+ sig {
763
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
764
+ }
765
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
766
+ end
767
+ class CurrentPeriodStart < Stripe::RequestParams
768
+ # Minimum value to filter by (exclusive)
769
+ sig { returns(T.nilable(Integer)) }
770
+ attr_accessor :gt
771
+ # Minimum value to filter by (inclusive)
772
+ sig { returns(T.nilable(Integer)) }
773
+ attr_accessor :gte
774
+ # Maximum value to filter by (exclusive)
775
+ sig { returns(T.nilable(Integer)) }
776
+ attr_accessor :lt
777
+ # Maximum value to filter by (inclusive)
778
+ sig { returns(T.nilable(Integer)) }
779
+ attr_accessor :lte
780
+ sig {
781
+ params(gt: T.nilable(Integer), gte: T.nilable(Integer), lt: T.nilable(Integer), lte: T.nilable(Integer)).void
782
+ }
783
+ def initialize(gt: nil, gte: nil, lt: nil, lte: nil); end
784
+ end
785
+ # Filter subscriptions by their automatic tax settings.
786
+ sig { returns(T.nilable(::Stripe::SubscriptionService::ListParams::AutomaticTax)) }
787
+ attr_accessor :automatic_tax
788
+ # The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`.
789
+ sig { returns(T.nilable(String)) }
790
+ attr_accessor :collection_method
791
+ # Only return subscriptions that were created during the given date interval.
792
+ sig { returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::Created, Integer))) }
793
+ attr_accessor :created
794
+ # Only return subscriptions whose current_period_end falls within the given date interval.
795
+ sig {
796
+ returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodEnd, Integer)))
797
+ }
798
+ attr_accessor :current_period_end
799
+ # Only return subscriptions whose current_period_start falls within the given date interval.
800
+ sig {
801
+ returns(T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodStart, Integer)))
802
+ }
803
+ attr_accessor :current_period_start
804
+ # The ID of the customer whose subscriptions will be retrieved.
805
+ sig { returns(T.nilable(String)) }
806
+ attr_accessor :customer
807
+ # 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.
808
+ sig { returns(T.nilable(String)) }
809
+ attr_accessor :ending_before
810
+ # Specifies which fields in the response should be expanded.
811
+ sig { returns(T.nilable(T::Array[String])) }
812
+ attr_accessor :expand
813
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
814
+ sig { returns(T.nilable(Integer)) }
815
+ attr_accessor :limit
816
+ # The ID of the plan whose subscriptions will be retrieved.
817
+ sig { returns(T.nilable(String)) }
818
+ attr_accessor :plan
819
+ # Filter for subscriptions that contain this recurring price ID.
820
+ sig { returns(T.nilable(String)) }
821
+ attr_accessor :price
822
+ # 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.
823
+ sig { returns(T.nilable(String)) }
824
+ attr_accessor :starting_after
825
+ # 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.
826
+ sig { returns(T.nilable(String)) }
827
+ attr_accessor :status
828
+ # 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.
829
+ sig { returns(T.nilable(String)) }
830
+ attr_accessor :test_clock
831
+ sig {
832
+ params(automatic_tax: T.nilable(::Stripe::SubscriptionService::ListParams::AutomaticTax), collection_method: T.nilable(String), created: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::Created, Integer)), current_period_end: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodEnd, Integer)), current_period_start: T.nilable(T.any(::Stripe::SubscriptionService::ListParams::CurrentPeriodStart, Integer)), customer: T.nilable(String), ending_before: T.nilable(String), expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), plan: T.nilable(String), price: T.nilable(String), starting_after: T.nilable(String), status: T.nilable(String), test_clock: T.nilable(String)).void
833
+ }
834
+ def initialize(
835
+ automatic_tax: nil,
836
+ collection_method: nil,
837
+ created: nil,
838
+ current_period_end: nil,
839
+ current_period_start: nil,
840
+ customer: nil,
841
+ ending_before: nil,
842
+ expand: nil,
843
+ limit: nil,
844
+ plan: nil,
845
+ price: nil,
846
+ starting_after: nil,
847
+ status: nil,
848
+ test_clock: nil
849
+ ); end
850
+ end
851
+ class CreateParams < Stripe::RequestParams
852
+ class AddInvoiceItem < Stripe::RequestParams
853
+ class Discount < Stripe::RequestParams
854
+ # ID of the coupon to create a new discount for.
855
+ sig { returns(T.nilable(String)) }
856
+ attr_accessor :coupon
857
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
858
+ sig { returns(T.nilable(String)) }
859
+ attr_accessor :discount
860
+ # ID of the promotion code to create a new discount for.
861
+ sig { returns(T.nilable(String)) }
862
+ attr_accessor :promotion_code
863
+ sig {
864
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
865
+ }
866
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
867
+ end
868
+ class PriceData < Stripe::RequestParams
869
+ # 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).
870
+ sig { returns(String) }
871
+ attr_accessor :currency
872
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
873
+ sig { returns(String) }
874
+ attr_accessor :product
875
+ # 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.
876
+ sig { returns(T.nilable(String)) }
877
+ attr_accessor :tax_behavior
878
+ # 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.
879
+ sig { returns(T.nilable(Integer)) }
880
+ attr_accessor :unit_amount
881
+ # 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.
882
+ sig { returns(T.nilable(String)) }
883
+ attr_accessor :unit_amount_decimal
884
+ sig {
885
+ params(currency: String, product: String, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
886
+ }
887
+ def initialize(
888
+ currency: nil,
889
+ product: nil,
890
+ tax_behavior: nil,
891
+ unit_amount: nil,
892
+ unit_amount_decimal: nil
893
+ ); end
894
+ end
895
+ # The coupons to redeem into discounts for the item.
896
+ sig {
897
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Discount]))
898
+ }
899
+ attr_accessor :discounts
900
+ # The ID of the price object. One of `price` or `price_data` is required.
901
+ sig { returns(T.nilable(String)) }
902
+ attr_accessor :price
903
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
904
+ sig {
905
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::PriceData))
906
+ }
907
+ attr_accessor :price_data
908
+ # Quantity for this item. Defaults to 1.
909
+ sig { returns(T.nilable(Integer)) }
910
+ attr_accessor :quantity
911
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
912
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
913
+ attr_accessor :tax_rates
914
+ sig {
915
+ params(discounts: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::Discount]), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::AddInvoiceItem::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
916
+ }
917
+ def initialize(
918
+ discounts: nil,
919
+ price: nil,
920
+ price_data: nil,
921
+ quantity: nil,
922
+ tax_rates: nil
923
+ ); end
924
+ end
925
+ class AutomaticTax < Stripe::RequestParams
926
+ class Liability < Stripe::RequestParams
927
+ # The connected account being referenced when `type` is `account`.
928
+ sig { returns(T.nilable(String)) }
929
+ attr_accessor :account
930
+ # Type of the account referenced in the request.
931
+ sig { returns(String) }
932
+ attr_accessor :type
933
+ sig { params(account: T.nilable(String), type: String).void }
934
+ def initialize(account: nil, type: nil); end
935
+ end
936
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
937
+ sig { returns(T::Boolean) }
938
+ attr_accessor :enabled
939
+ # 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.
940
+ sig {
941
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax::Liability))
942
+ }
943
+ attr_accessor :liability
944
+ sig {
945
+ params(enabled: T::Boolean, liability: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax::Liability)).void
946
+ }
947
+ def initialize(enabled: nil, liability: nil); end
948
+ end
949
+ class BillingCycleAnchorConfig < Stripe::RequestParams
950
+ # The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31.
951
+ sig { returns(Integer) }
952
+ attr_accessor :day_of_month
953
+ # The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23.
954
+ sig { returns(T.nilable(Integer)) }
955
+ attr_accessor :hour
956
+ # The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59.
957
+ sig { returns(T.nilable(Integer)) }
958
+ attr_accessor :minute
959
+ # The month to start full cycle billing periods. Ranges from 1 to 12.
960
+ sig { returns(T.nilable(Integer)) }
961
+ attr_accessor :month
962
+ # The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59.
963
+ sig { returns(T.nilable(Integer)) }
964
+ attr_accessor :second
965
+ sig {
966
+ params(day_of_month: Integer, hour: T.nilable(Integer), minute: T.nilable(Integer), month: T.nilable(Integer), second: T.nilable(Integer)).void
967
+ }
968
+ def initialize(day_of_month: nil, hour: nil, minute: nil, month: nil, second: nil); end
969
+ end
970
+ class BillingThresholds < Stripe::RequestParams
971
+ # Monetary threshold that triggers the subscription to advance to a new billing period
972
+ sig { returns(T.nilable(Integer)) }
973
+ attr_accessor :amount_gte
974
+ # 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.
975
+ sig { returns(T.nilable(T::Boolean)) }
976
+ attr_accessor :reset_billing_cycle_anchor
977
+ sig {
978
+ params(amount_gte: T.nilable(Integer), reset_billing_cycle_anchor: T.nilable(T::Boolean)).void
979
+ }
980
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil); end
981
+ end
982
+ class Discount < Stripe::RequestParams
983
+ # ID of the coupon to create a new discount for.
984
+ sig { returns(T.nilable(String)) }
985
+ attr_accessor :coupon
986
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
987
+ sig { returns(T.nilable(String)) }
988
+ attr_accessor :discount
989
+ # ID of the promotion code to create a new discount for.
990
+ sig { returns(T.nilable(String)) }
991
+ attr_accessor :promotion_code
992
+ sig {
993
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
994
+ }
995
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
996
+ end
997
+ class InvoiceSettings < Stripe::RequestParams
998
+ class Issuer < Stripe::RequestParams
999
+ # The connected account being referenced when `type` is `account`.
1000
+ sig { returns(T.nilable(String)) }
1001
+ attr_accessor :account
1002
+ # Type of the account referenced in the request.
1003
+ sig { returns(String) }
1004
+ attr_accessor :type
1005
+ sig { params(account: T.nilable(String), type: String).void }
1006
+ def initialize(account: nil, type: nil); end
1007
+ end
1008
+ # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription.
1009
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1010
+ attr_accessor :account_tax_ids
1011
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1012
+ sig {
1013
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings::Issuer))
1014
+ }
1015
+ attr_accessor :issuer
1016
+ sig {
1017
+ params(account_tax_ids: T.nilable(T.nilable(T.any(String, T::Array[String]))), issuer: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings::Issuer)).void
1018
+ }
1019
+ def initialize(account_tax_ids: nil, issuer: nil); end
1020
+ end
1021
+ class Item < Stripe::RequestParams
1022
+ class BillingThresholds < Stripe::RequestParams
1023
+ # 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))
1024
+ sig { returns(Integer) }
1025
+ attr_accessor :usage_gte
1026
+ sig { params(usage_gte: Integer).void }
1027
+ def initialize(usage_gte: nil); end
1028
+ end
1029
+ class Discount < Stripe::RequestParams
1030
+ # ID of the coupon to create a new discount for.
1031
+ sig { returns(T.nilable(String)) }
1032
+ attr_accessor :coupon
1033
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1034
+ sig { returns(T.nilable(String)) }
1035
+ attr_accessor :discount
1036
+ # ID of the promotion code to create a new discount for.
1037
+ sig { returns(T.nilable(String)) }
1038
+ attr_accessor :promotion_code
1039
+ sig {
1040
+ params(coupon: T.nilable(String), discount: T.nilable(String), promotion_code: T.nilable(String)).void
1041
+ }
1042
+ def initialize(coupon: nil, discount: nil, promotion_code: nil); end
1043
+ end
1044
+ class PriceData < Stripe::RequestParams
1045
+ class Recurring < Stripe::RequestParams
1046
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1047
+ sig { returns(String) }
1048
+ attr_accessor :interval
1049
+ # 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).
1050
+ sig { returns(T.nilable(Integer)) }
1051
+ attr_accessor :interval_count
1052
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1053
+ def initialize(interval: nil, interval_count: nil); end
1054
+ end
1055
+ # 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).
1056
+ sig { returns(String) }
1057
+ attr_accessor :currency
1058
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
1059
+ sig { returns(String) }
1060
+ attr_accessor :product
1061
+ # The recurring components of a price such as `interval` and `interval_count`.
1062
+ sig { returns(::Stripe::SubscriptionService::CreateParams::Item::PriceData::Recurring) }
1063
+ attr_accessor :recurring
1064
+ # 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.
1065
+ sig { returns(T.nilable(String)) }
1066
+ attr_accessor :tax_behavior
1067
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1068
+ sig { returns(T.nilable(Integer)) }
1069
+ attr_accessor :unit_amount
1070
+ # 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.
1071
+ sig { returns(T.nilable(String)) }
1072
+ attr_accessor :unit_amount_decimal
1073
+ sig {
1074
+ params(currency: String, product: String, recurring: ::Stripe::SubscriptionService::CreateParams::Item::PriceData::Recurring, tax_behavior: T.nilable(String), unit_amount: T.nilable(Integer), unit_amount_decimal: T.nilable(String)).void
1075
+ }
1076
+ def initialize(
1077
+ currency: nil,
1078
+ product: nil,
1079
+ recurring: nil,
1080
+ tax_behavior: nil,
1081
+ unit_amount: nil,
1082
+ unit_amount_decimal: nil
1083
+ ); end
1084
+ end
1085
+ # 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.
1086
+ sig {
1087
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds))))
1088
+ }
1089
+ attr_accessor :billing_thresholds
1090
+ # The coupons to redeem into discounts for the subscription item.
1091
+ sig {
1092
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount]))))
1093
+ }
1094
+ attr_accessor :discounts
1095
+ # 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`.
1096
+ sig { returns(T.nilable(T::Hash[String, String])) }
1097
+ attr_accessor :metadata
1098
+ # Plan ID for this item, as a string.
1099
+ sig { returns(T.nilable(String)) }
1100
+ attr_accessor :plan
1101
+ # The ID of the price object.
1102
+ sig { returns(T.nilable(String)) }
1103
+ attr_accessor :price
1104
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1105
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData)) }
1106
+ attr_accessor :price_data
1107
+ # Quantity for this item.
1108
+ sig { returns(T.nilable(Integer)) }
1109
+ attr_accessor :quantity
1110
+ # 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.
1111
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1112
+ attr_accessor :tax_rates
1113
+ sig {
1114
+ params(billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::Item::BillingThresholds))), discounts: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Item::Discount]))), metadata: T.nilable(T::Hash[String, String]), plan: T.nilable(String), price: T.nilable(String), price_data: T.nilable(::Stripe::SubscriptionService::CreateParams::Item::PriceData), quantity: T.nilable(Integer), tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
1115
+ }
1116
+ def initialize(
1117
+ billing_thresholds: nil,
1118
+ discounts: nil,
1119
+ metadata: nil,
1120
+ plan: nil,
1121
+ price: nil,
1122
+ price_data: nil,
1123
+ quantity: nil,
1124
+ tax_rates: nil
1125
+ ); end
1126
+ end
1127
+ class PaymentSettings < Stripe::RequestParams
1128
+ class PaymentMethodOptions < Stripe::RequestParams
1129
+ class AcssDebit < Stripe::RequestParams
1130
+ class MandateOptions < Stripe::RequestParams
1131
+ # Transaction type of the mandate.
1132
+ sig { returns(T.nilable(String)) }
1133
+ attr_accessor :transaction_type
1134
+ sig { params(transaction_type: T.nilable(String)).void }
1135
+ def initialize(transaction_type: nil); end
1136
+ end
1137
+ # Additional fields for Mandate creation
1138
+ sig {
1139
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions))
1140
+ }
1141
+ attr_accessor :mandate_options
1142
+ # Verification method for the intent
1143
+ sig { returns(T.nilable(String)) }
1144
+ attr_accessor :verification_method
1145
+ sig {
1146
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit::MandateOptions), verification_method: T.nilable(String)).void
1147
+ }
1148
+ def initialize(mandate_options: nil, verification_method: nil); end
1149
+ end
1150
+ class Bancontact < Stripe::RequestParams
1151
+ # Preferred language of the Bancontact authorization page that the customer is redirected to.
1152
+ sig { returns(T.nilable(String)) }
1153
+ attr_accessor :preferred_language
1154
+ sig { params(preferred_language: T.nilable(String)).void }
1155
+ def initialize(preferred_language: nil); end
1156
+ end
1157
+ class Card < Stripe::RequestParams
1158
+ class MandateOptions < Stripe::RequestParams
1159
+ # Amount to be charged for future payments.
1160
+ sig { returns(T.nilable(Integer)) }
1161
+ attr_accessor :amount
1162
+ # 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.
1163
+ sig { returns(T.nilable(String)) }
1164
+ attr_accessor :amount_type
1165
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1166
+ sig { returns(T.nilable(String)) }
1167
+ attr_accessor :description
1168
+ sig {
1169
+ params(amount: T.nilable(Integer), amount_type: T.nilable(String), description: T.nilable(String)).void
1170
+ }
1171
+ def initialize(amount: nil, amount_type: nil, description: nil); end
1172
+ end
1173
+ # Configuration options for setting up an eMandate for cards issued in India.
1174
+ sig {
1175
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions))
1176
+ }
1177
+ attr_accessor :mandate_options
1178
+ # 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.
1179
+ sig { returns(T.nilable(String)) }
1180
+ attr_accessor :network
1181
+ # 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.
1182
+ sig { returns(T.nilable(String)) }
1183
+ attr_accessor :request_three_d_secure
1184
+ sig {
1185
+ params(mandate_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card::MandateOptions), network: T.nilable(String), request_three_d_secure: T.nilable(String)).void
1186
+ }
1187
+ def initialize(mandate_options: nil, network: nil, request_three_d_secure: nil); end
1188
+ end
1189
+ class CustomerBalance < Stripe::RequestParams
1190
+ class BankTransfer < Stripe::RequestParams
1191
+ class EuBankTransfer < Stripe::RequestParams
1192
+ # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
1193
+ sig { returns(String) }
1194
+ attr_accessor :country
1195
+ sig { params(country: String).void }
1196
+ def initialize(country: nil); end
1197
+ end
1198
+ # Configuration for eu_bank_transfer funding type.
1199
+ sig {
1200
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer))
1201
+ }
1202
+ attr_accessor :eu_bank_transfer
1203
+ # 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`.
1204
+ sig { returns(T.nilable(String)) }
1205
+ attr_accessor :type
1206
+ sig {
1207
+ params(eu_bank_transfer: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer::EuBankTransfer), type: T.nilable(String)).void
1208
+ }
1209
+ def initialize(eu_bank_transfer: nil, type: nil); end
1210
+ end
1211
+ # Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
1212
+ sig {
1213
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer))
1214
+ }
1215
+ attr_accessor :bank_transfer
1216
+ # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
1217
+ sig { returns(T.nilable(String)) }
1218
+ attr_accessor :funding_type
1219
+ sig {
1220
+ params(bank_transfer: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance::BankTransfer), funding_type: T.nilable(String)).void
1221
+ }
1222
+ def initialize(bank_transfer: nil, funding_type: nil); end
1223
+ end
1224
+ class Konbini < Stripe::RequestParams; end
1225
+ class SepaDebit < Stripe::RequestParams; end
1226
+ class UsBankAccount < Stripe::RequestParams
1227
+ class FinancialConnections < Stripe::RequestParams
1228
+ class Filters < Stripe::RequestParams
1229
+ # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
1230
+ sig { returns(T.nilable(T::Array[String])) }
1231
+ attr_accessor :account_subcategories
1232
+ sig { params(account_subcategories: T.nilable(T::Array[String])).void }
1233
+ def initialize(account_subcategories: nil); end
1234
+ end
1235
+ # Provide filters for the linked accounts that the customer can select for the payment method.
1236
+ sig {
1237
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters))
1238
+ }
1239
+ attr_accessor :filters
1240
+ # 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`.
1241
+ sig { returns(T.nilable(T::Array[String])) }
1242
+ attr_accessor :permissions
1243
+ # List of data features that you would like to retrieve upon account creation.
1244
+ sig { returns(T.nilable(T::Array[String])) }
1245
+ attr_accessor :prefetch
1246
+ sig {
1247
+ params(filters: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections::Filters), permissions: T.nilable(T::Array[String]), prefetch: T.nilable(T::Array[String])).void
1248
+ }
1249
+ def initialize(filters: nil, permissions: nil, prefetch: nil); end
1250
+ end
1251
+ # Additional fields for Financial Connections Session creation
1252
+ sig {
1253
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections))
1254
+ }
1255
+ attr_accessor :financial_connections
1256
+ # Verification method for the intent
1257
+ sig { returns(T.nilable(String)) }
1258
+ attr_accessor :verification_method
1259
+ sig {
1260
+ params(financial_connections: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount::FinancialConnections), verification_method: T.nilable(String)).void
1261
+ }
1262
+ def initialize(financial_connections: nil, verification_method: nil); end
1263
+ end
1264
+ # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent.
1265
+ sig {
1266
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))))
1267
+ }
1268
+ attr_accessor :acss_debit
1269
+ # This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent.
1270
+ sig {
1271
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))))
1272
+ }
1273
+ attr_accessor :bancontact
1274
+ # This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent.
1275
+ sig {
1276
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card))))
1277
+ }
1278
+ attr_accessor :card
1279
+ # This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1280
+ sig {
1281
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))))
1282
+ }
1283
+ attr_accessor :customer_balance
1284
+ # This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1285
+ sig {
1286
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))))
1287
+ }
1288
+ attr_accessor :konbini
1289
+ # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1290
+ sig {
1291
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))))
1292
+ }
1293
+ attr_accessor :sepa_debit
1294
+ # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1295
+ sig {
1296
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount))))
1297
+ }
1298
+ attr_accessor :us_bank_account
1299
+ sig {
1300
+ params(acss_debit: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::AcssDebit))), bancontact: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Bancontact))), card: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Card))), customer_balance: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::CustomerBalance))), konbini: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::Konbini))), sepa_debit: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::SepaDebit))), us_bank_account: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions::UsBankAccount)))).void
1301
+ }
1302
+ def initialize(
1303
+ acss_debit: nil,
1304
+ bancontact: nil,
1305
+ card: nil,
1306
+ customer_balance: nil,
1307
+ konbini: nil,
1308
+ sepa_debit: nil,
1309
+ us_bank_account: nil
1310
+ ); end
1311
+ end
1312
+ # Payment-method-specific configuration to provide to invoices created by the subscription.
1313
+ sig {
1314
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions))
1315
+ }
1316
+ attr_accessor :payment_method_options
1317
+ # 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
1318
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1319
+ attr_accessor :payment_method_types
1320
+ # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified.
1321
+ sig { returns(T.nilable(String)) }
1322
+ attr_accessor :save_default_payment_method
1323
+ sig {
1324
+ params(payment_method_options: T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings::PaymentMethodOptions), payment_method_types: T.nilable(T.nilable(T.any(String, T::Array[String]))), save_default_payment_method: T.nilable(String)).void
1325
+ }
1326
+ def initialize(
1327
+ payment_method_options: nil,
1328
+ payment_method_types: nil,
1329
+ save_default_payment_method: nil
1330
+ ); end
1331
+ end
1332
+ class PendingInvoiceItemInterval < Stripe::RequestParams
1333
+ # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.
1334
+ sig { returns(String) }
1335
+ attr_accessor :interval
1336
+ # 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).
1337
+ sig { returns(T.nilable(Integer)) }
1338
+ attr_accessor :interval_count
1339
+ sig { params(interval: String, interval_count: T.nilable(Integer)).void }
1340
+ def initialize(interval: nil, interval_count: nil); end
1341
+ end
1342
+ class TransferData < Stripe::RequestParams
1343
+ # 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.
1344
+ sig { returns(T.nilable(Float)) }
1345
+ attr_accessor :amount_percent
1346
+ # ID of an existing, connected Stripe account.
1347
+ sig { returns(String) }
1348
+ attr_accessor :destination
1349
+ sig { params(amount_percent: T.nilable(Float), destination: String).void }
1350
+ def initialize(amount_percent: nil, destination: nil); end
1351
+ end
1352
+ class TrialSettings < Stripe::RequestParams
1353
+ class EndBehavior < Stripe::RequestParams
1354
+ # Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
1355
+ sig { returns(String) }
1356
+ attr_accessor :missing_payment_method
1357
+ sig { params(missing_payment_method: String).void }
1358
+ def initialize(missing_payment_method: nil); end
1359
+ end
1360
+ # Defines how the subscription should behave when the user's free trial ends.
1361
+ sig { returns(::Stripe::SubscriptionService::CreateParams::TrialSettings::EndBehavior) }
1362
+ attr_accessor :end_behavior
1363
+ sig {
1364
+ params(end_behavior: ::Stripe::SubscriptionService::CreateParams::TrialSettings::EndBehavior).void
1365
+ }
1366
+ def initialize(end_behavior: nil); end
1367
+ end
1368
+ # 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.
1369
+ sig {
1370
+ returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]))
1371
+ }
1372
+ attr_accessor :add_invoice_items
1373
+ # 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).
1374
+ sig { returns(T.nilable(T.nilable(T.any(String, Float)))) }
1375
+ attr_accessor :application_fee_percent
1376
+ # Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.
1377
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax)) }
1378
+ attr_accessor :automatic_tax
1379
+ # 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.
1380
+ sig { returns(T.nilable(Integer)) }
1381
+ attr_accessor :backdate_start_date
1382
+ # 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.
1383
+ sig { returns(T.nilable(Integer)) }
1384
+ attr_accessor :billing_cycle_anchor
1385
+ # 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.
1386
+ sig {
1387
+ returns(T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig))
1388
+ }
1389
+ attr_accessor :billing_cycle_anchor_config
1390
+ # 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.
1391
+ sig {
1392
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::BillingThresholds))))
1393
+ }
1394
+ attr_accessor :billing_thresholds
1395
+ # 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.
1396
+ sig { returns(T.nilable(Integer)) }
1397
+ attr_accessor :cancel_at
1398
+ # 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.
1399
+ sig { returns(T.nilable(T::Boolean)) }
1400
+ attr_accessor :cancel_at_period_end
1401
+ # 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`.
1402
+ sig { returns(T.nilable(String)) }
1403
+ attr_accessor :collection_method
1404
+ # 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).
1405
+ sig { returns(T.nilable(String)) }
1406
+ attr_accessor :currency
1407
+ # The identifier of the customer to subscribe.
1408
+ sig { returns(String) }
1409
+ attr_accessor :customer
1410
+ # 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`.
1411
+ sig { returns(T.nilable(Integer)) }
1412
+ attr_accessor :days_until_due
1413
+ # 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).
1414
+ sig { returns(T.nilable(String)) }
1415
+ attr_accessor :default_payment_method
1416
+ # 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).
1417
+ sig { returns(T.nilable(String)) }
1418
+ attr_accessor :default_source
1419
+ # 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.
1420
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
1421
+ attr_accessor :default_tax_rates
1422
+ # 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.
1423
+ sig { returns(T.nilable(String)) }
1424
+ attr_accessor :description
1425
+ # The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer.
1426
+ sig {
1427
+ returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::SubscriptionService::CreateParams::Discount]))))
1428
+ }
1429
+ attr_accessor :discounts
1430
+ # Specifies which fields in the response should be expanded.
1431
+ sig { returns(T.nilable(T::Array[String])) }
1432
+ attr_accessor :expand
1433
+ # All invoices will be billed using the specified settings.
1434
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings)) }
1435
+ attr_accessor :invoice_settings
1436
+ # A list of up to 20 subscription items, each with an attached price.
1437
+ sig { returns(T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::Item])) }
1438
+ attr_accessor :items
1439
+ # 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`.
1440
+ sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
1441
+ attr_accessor :metadata
1442
+ # Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `false` (on-session).
1443
+ sig { returns(T.nilable(T::Boolean)) }
1444
+ attr_accessor :off_session
1445
+ # The account on behalf of which to charge, for each of the subscription's invoices.
1446
+ sig { returns(T.nilable(T.nilable(String))) }
1447
+ attr_accessor :on_behalf_of
1448
+ # Only applies to subscriptions with `collection_method=charge_automatically`.
1449
+ #
1450
+ # 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.
1451
+ #
1452
+ # 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.
1453
+ #
1454
+ # 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.
1455
+ #
1456
+ # `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription.
1457
+ #
1458
+ # Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status.
1459
+ sig { returns(T.nilable(String)) }
1460
+ attr_accessor :payment_behavior
1461
+ # Payment settings to pass to invoices created by the subscription.
1462
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::PaymentSettings)) }
1463
+ attr_accessor :payment_settings
1464
+ # 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.
1465
+ sig {
1466
+ returns(T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval))))
1467
+ }
1468
+ attr_accessor :pending_invoice_item_interval
1469
+ # 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`.
1470
+ sig { returns(T.nilable(String)) }
1471
+ attr_accessor :proration_behavior
1472
+ # 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.
1473
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::TransferData)) }
1474
+ attr_accessor :transfer_data
1475
+ # 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.
1476
+ sig { returns(T.nilable(T.any(String, Integer))) }
1477
+ attr_accessor :trial_end
1478
+ # 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.
1479
+ sig { returns(T.nilable(T::Boolean)) }
1480
+ attr_accessor :trial_from_plan
1481
+ # 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.
1482
+ sig { returns(T.nilable(Integer)) }
1483
+ attr_accessor :trial_period_days
1484
+ # Settings related to subscription trials.
1485
+ sig { returns(T.nilable(::Stripe::SubscriptionService::CreateParams::TrialSettings)) }
1486
+ attr_accessor :trial_settings
1487
+ sig {
1488
+ params(add_invoice_items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::AddInvoiceItem]), application_fee_percent: T.nilable(T.nilable(T.any(String, Float))), automatic_tax: T.nilable(::Stripe::SubscriptionService::CreateParams::AutomaticTax), backdate_start_date: T.nilable(Integer), billing_cycle_anchor: T.nilable(Integer), billing_cycle_anchor_config: T.nilable(::Stripe::SubscriptionService::CreateParams::BillingCycleAnchorConfig), billing_thresholds: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::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::SubscriptionService::CreateParams::Discount]))), expand: T.nilable(T::Array[String]), invoice_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::InvoiceSettings), items: T.nilable(T::Array[::Stripe::SubscriptionService::CreateParams::Item]), metadata: T.nilable(T.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::SubscriptionService::CreateParams::PaymentSettings), pending_invoice_item_interval: T.nilable(T.nilable(T.any(String, ::Stripe::SubscriptionService::CreateParams::PendingInvoiceItemInterval))), proration_behavior: T.nilable(String), transfer_data: T.nilable(::Stripe::SubscriptionService::CreateParams::TransferData), trial_end: T.nilable(T.any(String, Integer)), trial_from_plan: T.nilable(T::Boolean), trial_period_days: T.nilable(Integer), trial_settings: T.nilable(::Stripe::SubscriptionService::CreateParams::TrialSettings)).void
1489
+ }
1490
+ def initialize(
1491
+ add_invoice_items: nil,
1492
+ application_fee_percent: nil,
1493
+ automatic_tax: nil,
1494
+ backdate_start_date: nil,
1495
+ billing_cycle_anchor: nil,
1496
+ billing_cycle_anchor_config: nil,
1497
+ billing_thresholds: nil,
1498
+ cancel_at: nil,
1499
+ cancel_at_period_end: nil,
1500
+ collection_method: nil,
1501
+ currency: nil,
1502
+ customer: nil,
1503
+ days_until_due: nil,
1504
+ default_payment_method: nil,
1505
+ default_source: nil,
1506
+ default_tax_rates: nil,
1507
+ description: nil,
1508
+ discounts: nil,
1509
+ expand: nil,
1510
+ invoice_settings: nil,
1511
+ items: nil,
1512
+ metadata: nil,
1513
+ off_session: nil,
1514
+ on_behalf_of: nil,
1515
+ payment_behavior: nil,
1516
+ payment_settings: nil,
1517
+ pending_invoice_item_interval: nil,
1518
+ proration_behavior: nil,
1519
+ transfer_data: nil,
1520
+ trial_end: nil,
1521
+ trial_from_plan: nil,
1522
+ trial_period_days: nil,
1523
+ trial_settings: nil
1524
+ ); end
1525
+ end
1526
+ class SearchParams < Stripe::RequestParams
1527
+ # Specifies which fields in the response should be expanded.
1528
+ sig { returns(T.nilable(T::Array[String])) }
1529
+ attr_accessor :expand
1530
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
1531
+ sig { returns(T.nilable(Integer)) }
1532
+ attr_accessor :limit
1533
+ # 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.
1534
+ sig { returns(T.nilable(String)) }
1535
+ attr_accessor :page
1536
+ # 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).
1537
+ sig { returns(String) }
1538
+ attr_accessor :query
1539
+ sig {
1540
+ params(expand: T.nilable(T::Array[String]), limit: T.nilable(Integer), page: T.nilable(String), query: String).void
1541
+ }
1542
+ def initialize(expand: nil, limit: nil, page: nil, query: nil); end
1543
+ end
1544
+ class ResumeParams < Stripe::RequestParams
1545
+ # 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).
1546
+ sig { returns(T.nilable(String)) }
1547
+ attr_accessor :billing_cycle_anchor
1548
+ # Specifies which fields in the response should be expanded.
1549
+ sig { returns(T.nilable(T::Array[String])) }
1550
+ attr_accessor :expand
1551
+ # 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`.
1552
+ sig { returns(T.nilable(String)) }
1553
+ attr_accessor :proration_behavior
1554
+ # 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.
1555
+ sig { returns(T.nilable(Integer)) }
1556
+ attr_accessor :proration_date
1557
+ sig {
1558
+ params(billing_cycle_anchor: T.nilable(String), expand: T.nilable(T::Array[String]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer)).void
1559
+ }
1560
+ def initialize(
1561
+ billing_cycle_anchor: nil,
1562
+ expand: nil,
1563
+ proration_behavior: nil,
1564
+ proration_date: nil
1565
+ ); end
1566
+ end
1567
+ # 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).
1568
+ #
1569
+ # 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.
1570
+ #
1571
+ # 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.
1572
+ sig {
1573
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::CancelParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1574
+ }
1575
+ def cancel(subscription_exposed_id, params = {}, opts = {}); end
1576
+
1577
+ # Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
1578
+ #
1579
+ # When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
1580
+ # The payment_behavior parameter determines the exact behavior of the initial payment.
1581
+ #
1582
+ # 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.
1583
+ # Schedules provide the flexibility to model more complex billing configurations that change over time.
1584
+ sig {
1585
+ params(params: T.any(::Stripe::SubscriptionService::CreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1586
+ }
1587
+ def create(params = {}, opts = {}); end
1588
+
1589
+ # Removes the currently applied discount on a subscription.
1590
+ sig {
1591
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::DeleteDiscountParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Discount)
1592
+ }
1593
+ def delete_discount(subscription_exposed_id, params = {}, opts = {}); end
1594
+
1595
+ # By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
1596
+ sig {
1597
+ params(params: T.any(::Stripe::SubscriptionService::ListParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::ListObject)
1598
+ }
1599
+ def list(params = {}, opts = {}); end
1600
+
1601
+ # 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.
1602
+ sig {
1603
+ params(subscription: String, params: T.any(::Stripe::SubscriptionService::ResumeParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1604
+ }
1605
+ def resume(subscription, params = {}, opts = {}); end
1606
+
1607
+ # Retrieves the subscription with the given ID.
1608
+ sig {
1609
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::RetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1610
+ }
1611
+ def retrieve(subscription_exposed_id, params = {}, opts = {}); end
1612
+
1613
+ # Search for subscriptions you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
1614
+ # Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
1615
+ # conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
1616
+ # to an hour behind during outages. Search functionality is not available to merchants in India.
1617
+ sig {
1618
+ params(params: T.any(::Stripe::SubscriptionService::SearchParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::SearchResultObject)
1619
+ }
1620
+ def search(params = {}, opts = {}); end
1621
+
1622
+ # Updates an existing subscription to match the specified parameters.
1623
+ # When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
1624
+ # To preview how the proration is calculated, use the [create preview](https://docs.stripe.com/docs/api/invoices/create_preview) endpoint.
1625
+ #
1626
+ # 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.
1627
+ #
1628
+ # Switching prices does not normally change the billing date or generate an immediate charge unless:
1629
+ #
1630
+ #
1631
+ # The billing interval is changed (for example, from monthly to yearly).
1632
+ # The subscription moves from free to paid.
1633
+ # A trial starts or ends.
1634
+ #
1635
+ #
1636
+ # 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).
1637
+ #
1638
+ # 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).
1639
+ #
1640
+ # 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.
1641
+ #
1642
+ # 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.
1643
+ sig {
1644
+ params(subscription_exposed_id: String, params: T.any(::Stripe::SubscriptionService::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::Subscription)
1645
+ }
1646
+ def update(subscription_exposed_id, params = {}, opts = {}); end
1647
+ end
1648
+ end