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