stripe 12.5.0 → 15.0.0

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