stripe 13.3.0 → 13.4.0.pre.beta.2

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