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