stripe 13.3.0 → 13.4.0.pre.beta.1

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