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
@@ -3,14 +3,2288 @@
3
3
 
4
4
  module Stripe
5
5
  class QuoteService < StripeService
6
- attr_reader :line_items, :computed_upfront_line_items
6
+ attr_reader :preview_invoices, :preview_subscription_schedules, :lines, :line_items, :computed_upfront_line_items
7
7
 
8
8
  def initialize(requestor)
9
9
  super(requestor)
10
+ @preview_invoices = Stripe::QuotePreviewInvoiceService.new(@requestor)
11
+ @preview_subscription_schedules = Stripe::QuotePreviewSubscriptionScheduleService
12
+ .new(@requestor)
13
+ @lines = Stripe::QuoteLineService.new(@requestor)
10
14
  @line_items = Stripe::QuoteLineItemService.new(@requestor)
11
15
  @computed_upfront_line_items = Stripe::QuoteComputedUpfrontLineItemsService.new(@requestor)
12
16
  end
13
17
 
18
+ class ListParams < Stripe::RequestParams
19
+ # The ID of the customer whose quotes will be retrieved.
20
+ attr_accessor :customer
21
+ # 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.
22
+ attr_accessor :ending_before
23
+ # Specifies which fields in the response should be expanded.
24
+ attr_accessor :expand
25
+ # The subscription which the quote updates.
26
+ attr_accessor :from_subscription
27
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
28
+ attr_accessor :limit
29
+ # 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.
30
+ attr_accessor :starting_after
31
+ # The status of the quote.
32
+ attr_accessor :status
33
+ # Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set.
34
+ attr_accessor :test_clock
35
+
36
+ def initialize(
37
+ customer: nil,
38
+ ending_before: nil,
39
+ expand: nil,
40
+ from_subscription: nil,
41
+ limit: nil,
42
+ starting_after: nil,
43
+ status: nil,
44
+ test_clock: nil
45
+ )
46
+ @customer = customer
47
+ @ending_before = ending_before
48
+ @expand = expand
49
+ @from_subscription = from_subscription
50
+ @limit = limit
51
+ @starting_after = starting_after
52
+ @status = status
53
+ @test_clock = test_clock
54
+ end
55
+ end
56
+
57
+ class CreateParams < Stripe::RequestParams
58
+ class AutomaticTax < Stripe::RequestParams
59
+ class Liability < Stripe::RequestParams
60
+ # The connected account being referenced when `type` is `account`.
61
+ attr_accessor :account
62
+ # Type of the account referenced in the request.
63
+ attr_accessor :type
64
+
65
+ def initialize(account: nil, type: nil)
66
+ @account = account
67
+ @type = type
68
+ end
69
+ end
70
+ # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
71
+ attr_accessor :enabled
72
+ # 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.
73
+ attr_accessor :liability
74
+
75
+ def initialize(enabled: nil, liability: nil)
76
+ @enabled = enabled
77
+ @liability = liability
78
+ end
79
+ end
80
+
81
+ class Discount < Stripe::RequestParams
82
+ class DiscountEnd < Stripe::RequestParams
83
+ class Duration < Stripe::RequestParams
84
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
85
+ attr_accessor :interval
86
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
87
+ attr_accessor :interval_count
88
+
89
+ def initialize(interval: nil, interval_count: nil)
90
+ @interval = interval
91
+ @interval_count = interval_count
92
+ end
93
+ end
94
+ # Time span for the redeemed discount.
95
+ attr_accessor :duration
96
+ # A precise Unix timestamp for the discount to end. Must be in the future.
97
+ attr_accessor :timestamp
98
+ # The type of calculation made to determine when the discount ends.
99
+ attr_accessor :type
100
+
101
+ def initialize(duration: nil, timestamp: nil, type: nil)
102
+ @duration = duration
103
+ @timestamp = timestamp
104
+ @type = type
105
+ end
106
+ end
107
+ # ID of the coupon to create a new discount for.
108
+ attr_accessor :coupon
109
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
110
+ attr_accessor :discount
111
+ # Details to determine how long the discount should be applied for.
112
+ attr_accessor :discount_end
113
+ # ID of the promotion code to create a new discount for.
114
+ attr_accessor :promotion_code
115
+
116
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
117
+ @coupon = coupon
118
+ @discount = discount
119
+ @discount_end = discount_end
120
+ @promotion_code = promotion_code
121
+ end
122
+ end
123
+
124
+ class FromQuote < Stripe::RequestParams
125
+ # Whether this quote is a revision of the previous quote.
126
+ attr_accessor :is_revision
127
+ # The `id` of the quote that will be cloned.
128
+ attr_accessor :quote
129
+
130
+ def initialize(is_revision: nil, quote: nil)
131
+ @is_revision = is_revision
132
+ @quote = quote
133
+ end
134
+ end
135
+
136
+ class InvoiceSettings < Stripe::RequestParams
137
+ class Issuer < Stripe::RequestParams
138
+ # The connected account being referenced when `type` is `account`.
139
+ attr_accessor :account
140
+ # Type of the account referenced in the request.
141
+ attr_accessor :type
142
+
143
+ def initialize(account: nil, type: nil)
144
+ @account = account
145
+ @type = type
146
+ end
147
+ end
148
+ # Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
149
+ attr_accessor :days_until_due
150
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
151
+ attr_accessor :issuer
152
+
153
+ def initialize(days_until_due: nil, issuer: nil)
154
+ @days_until_due = days_until_due
155
+ @issuer = issuer
156
+ end
157
+ end
158
+
159
+ class Line < Stripe::RequestParams
160
+ class Action < Stripe::RequestParams
161
+ class AddDiscount < Stripe::RequestParams
162
+ class DiscountEnd < Stripe::RequestParams
163
+ # The type of calculation made to determine when the discount ends.
164
+ attr_accessor :type
165
+
166
+ def initialize(type: nil)
167
+ @type = type
168
+ end
169
+ end
170
+ # The coupon code to redeem.
171
+ attr_accessor :coupon
172
+ # An ID of an existing discount for a coupon that was already redeemed.
173
+ attr_accessor :discount
174
+ # Details to determine how long the discount should be applied for.
175
+ attr_accessor :discount_end
176
+ # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
177
+ attr_accessor :index
178
+ # The promotion code to redeem.
179
+ attr_accessor :promotion_code
180
+
181
+ def initialize(
182
+ coupon: nil,
183
+ discount: nil,
184
+ discount_end: nil,
185
+ index: nil,
186
+ promotion_code: nil
187
+ )
188
+ @coupon = coupon
189
+ @discount = discount
190
+ @discount_end = discount_end
191
+ @index = index
192
+ @promotion_code = promotion_code
193
+ end
194
+ end
195
+
196
+ class AddItem < Stripe::RequestParams
197
+ class Discount < Stripe::RequestParams
198
+ class DiscountEnd < Stripe::RequestParams
199
+ class Duration < Stripe::RequestParams
200
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
201
+ attr_accessor :interval
202
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
203
+ attr_accessor :interval_count
204
+
205
+ def initialize(interval: nil, interval_count: nil)
206
+ @interval = interval
207
+ @interval_count = interval_count
208
+ end
209
+ end
210
+ # Time span for the redeemed discount.
211
+ attr_accessor :duration
212
+ # A precise Unix timestamp for the discount to end. Must be in the future.
213
+ attr_accessor :timestamp
214
+ # The type of calculation made to determine when the discount ends.
215
+ attr_accessor :type
216
+
217
+ def initialize(duration: nil, timestamp: nil, type: nil)
218
+ @duration = duration
219
+ @timestamp = timestamp
220
+ @type = type
221
+ end
222
+ end
223
+ # ID of the coupon to create a new discount for.
224
+ attr_accessor :coupon
225
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
226
+ attr_accessor :discount
227
+ # Details to determine how long the discount should be applied for.
228
+ attr_accessor :discount_end
229
+ # ID of the promotion code to create a new discount for.
230
+ attr_accessor :promotion_code
231
+
232
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
233
+ @coupon = coupon
234
+ @discount = discount
235
+ @discount_end = discount_end
236
+ @promotion_code = promotion_code
237
+ end
238
+ end
239
+
240
+ class Trial < Stripe::RequestParams
241
+ # 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.
242
+ attr_accessor :converts_to
243
+ # Determines the type of trial for this item.
244
+ attr_accessor :type
245
+
246
+ def initialize(converts_to: nil, type: nil)
247
+ @converts_to = converts_to
248
+ @type = type
249
+ end
250
+ end
251
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
252
+ attr_accessor :discounts
253
+ # 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`.
254
+ attr_accessor :metadata
255
+ # The ID of the price object.
256
+ attr_accessor :price
257
+ # Quantity for this item.
258
+ attr_accessor :quantity
259
+ # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
260
+ attr_accessor :tax_rates
261
+ # Options that configure the trial on the subscription item.
262
+ attr_accessor :trial
263
+
264
+ def initialize(
265
+ discounts: nil,
266
+ metadata: nil,
267
+ price: nil,
268
+ quantity: nil,
269
+ tax_rates: nil,
270
+ trial: nil
271
+ )
272
+ @discounts = discounts
273
+ @metadata = metadata
274
+ @price = price
275
+ @quantity = quantity
276
+ @tax_rates = tax_rates
277
+ @trial = trial
278
+ end
279
+ end
280
+
281
+ class RemoveDiscount < Stripe::RequestParams
282
+ # The coupon code to remove from the `discounts` array.
283
+ attr_accessor :coupon
284
+ # The ID of a discount to remove from the `discounts` array.
285
+ attr_accessor :discount
286
+ # The ID of a promotion code to remove from the `discounts` array.
287
+ attr_accessor :promotion_code
288
+
289
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
290
+ @coupon = coupon
291
+ @discount = discount
292
+ @promotion_code = promotion_code
293
+ end
294
+ end
295
+
296
+ class RemoveItem < Stripe::RequestParams
297
+ # ID of a price to remove.
298
+ attr_accessor :price
299
+
300
+ def initialize(price: nil)
301
+ @price = price
302
+ end
303
+ end
304
+
305
+ class SetDiscount < Stripe::RequestParams
306
+ # The coupon code to replace the `discounts` array with.
307
+ attr_accessor :coupon
308
+ # An ID of an existing discount to replace the `discounts` array with.
309
+ attr_accessor :discount
310
+ # An ID of an existing promotion code to replace the `discounts` array with.
311
+ attr_accessor :promotion_code
312
+
313
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
314
+ @coupon = coupon
315
+ @discount = discount
316
+ @promotion_code = promotion_code
317
+ end
318
+ end
319
+
320
+ class SetItem < Stripe::RequestParams
321
+ class Discount < Stripe::RequestParams
322
+ class DiscountEnd < Stripe::RequestParams
323
+ class Duration < Stripe::RequestParams
324
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
325
+ attr_accessor :interval
326
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
327
+ attr_accessor :interval_count
328
+
329
+ def initialize(interval: nil, interval_count: nil)
330
+ @interval = interval
331
+ @interval_count = interval_count
332
+ end
333
+ end
334
+ # Time span for the redeemed discount.
335
+ attr_accessor :duration
336
+ # A precise Unix timestamp for the discount to end. Must be in the future.
337
+ attr_accessor :timestamp
338
+ # The type of calculation made to determine when the discount ends.
339
+ attr_accessor :type
340
+
341
+ def initialize(duration: nil, timestamp: nil, type: nil)
342
+ @duration = duration
343
+ @timestamp = timestamp
344
+ @type = type
345
+ end
346
+ end
347
+ # ID of the coupon to create a new discount for.
348
+ attr_accessor :coupon
349
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
350
+ attr_accessor :discount
351
+ # Details to determine how long the discount should be applied for.
352
+ attr_accessor :discount_end
353
+ # ID of the promotion code to create a new discount for.
354
+ attr_accessor :promotion_code
355
+
356
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
357
+ @coupon = coupon
358
+ @discount = discount
359
+ @discount_end = discount_end
360
+ @promotion_code = promotion_code
361
+ end
362
+ end
363
+
364
+ class Trial < Stripe::RequestParams
365
+ # 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.
366
+ attr_accessor :converts_to
367
+ # Determines the type of trial for this item.
368
+ attr_accessor :type
369
+
370
+ def initialize(converts_to: nil, type: nil)
371
+ @converts_to = converts_to
372
+ @type = type
373
+ end
374
+ end
375
+ # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
376
+ attr_accessor :discounts
377
+ # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
378
+ attr_accessor :metadata
379
+ # The ID of the price object.
380
+ attr_accessor :price
381
+ # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
382
+ attr_accessor :quantity
383
+ # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
384
+ attr_accessor :tax_rates
385
+ # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
386
+ attr_accessor :trial
387
+
388
+ def initialize(
389
+ discounts: nil,
390
+ metadata: nil,
391
+ price: nil,
392
+ quantity: nil,
393
+ tax_rates: nil,
394
+ trial: nil
395
+ )
396
+ @discounts = discounts
397
+ @metadata = metadata
398
+ @price = price
399
+ @quantity = quantity
400
+ @tax_rates = tax_rates
401
+ @trial = trial
402
+ end
403
+ end
404
+ # Details for the `add_discount` type.
405
+ attr_accessor :add_discount
406
+ # Details for the `add_item` type.
407
+ attr_accessor :add_item
408
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
409
+ attr_accessor :add_metadata
410
+ # Details for the `remove_discount` type.
411
+ attr_accessor :remove_discount
412
+ # Details for the `remove_item` type.
413
+ attr_accessor :remove_item
414
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
415
+ attr_accessor :remove_metadata
416
+ # Details for the `set_discounts` type.
417
+ attr_accessor :set_discounts
418
+ # Details for the `set_items` type.
419
+ attr_accessor :set_items
420
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
421
+ attr_accessor :set_metadata
422
+ # The type of action the quote line performs.
423
+ attr_accessor :type
424
+
425
+ def initialize(
426
+ add_discount: nil,
427
+ add_item: nil,
428
+ add_metadata: nil,
429
+ remove_discount: nil,
430
+ remove_item: nil,
431
+ remove_metadata: nil,
432
+ set_discounts: nil,
433
+ set_items: nil,
434
+ set_metadata: nil,
435
+ type: nil
436
+ )
437
+ @add_discount = add_discount
438
+ @add_item = add_item
439
+ @add_metadata = add_metadata
440
+ @remove_discount = remove_discount
441
+ @remove_item = remove_item
442
+ @remove_metadata = remove_metadata
443
+ @set_discounts = set_discounts
444
+ @set_items = set_items
445
+ @set_metadata = set_metadata
446
+ @type = type
447
+ end
448
+ end
449
+
450
+ class AppliesTo < Stripe::RequestParams
451
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
452
+ attr_accessor :new_reference
453
+ # The ID of the schedule the line applies to.
454
+ attr_accessor :subscription_schedule
455
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
456
+ attr_accessor :type
457
+
458
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
459
+ @new_reference = new_reference
460
+ @subscription_schedule = subscription_schedule
461
+ @type = type
462
+ end
463
+ end
464
+
465
+ class CancelSubscriptionSchedule < Stripe::RequestParams
466
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
467
+ attr_accessor :cancel_at
468
+ # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
469
+ attr_accessor :invoice_now
470
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
471
+ attr_accessor :prorate
472
+
473
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
474
+ @cancel_at = cancel_at
475
+ @invoice_now = invoice_now
476
+ @prorate = prorate
477
+ end
478
+ end
479
+
480
+ class EndsAt < Stripe::RequestParams
481
+ class DiscountEnd < Stripe::RequestParams
482
+ # The ID of a specific discount.
483
+ attr_accessor :discount
484
+
485
+ def initialize(discount: nil)
486
+ @discount = discount
487
+ end
488
+ end
489
+
490
+ class Duration < Stripe::RequestParams
491
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
492
+ attr_accessor :interval
493
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
494
+ attr_accessor :interval_count
495
+
496
+ def initialize(interval: nil, interval_count: nil)
497
+ @interval = interval
498
+ @interval_count = interval_count
499
+ end
500
+ end
501
+ # Use the `end` time of a given discount.
502
+ attr_accessor :discount_end
503
+ # Time span for the quote line starting from the `starts_at` date.
504
+ attr_accessor :duration
505
+ # A precise Unix timestamp.
506
+ attr_accessor :timestamp
507
+ # Select a way to pass in `ends_at`.
508
+ attr_accessor :type
509
+
510
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
511
+ @discount_end = discount_end
512
+ @duration = duration
513
+ @timestamp = timestamp
514
+ @type = type
515
+ end
516
+ end
517
+
518
+ class SetPauseCollection < Stripe::RequestParams
519
+ class Set < Stripe::RequestParams
520
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
521
+ attr_accessor :behavior
522
+
523
+ def initialize(behavior: nil)
524
+ @behavior = behavior
525
+ end
526
+ end
527
+ # Details of the pause_collection behavior to apply to the amendment.
528
+ attr_accessor :set
529
+ # Determines the type of the pause_collection amendment.
530
+ attr_accessor :type
531
+
532
+ def initialize(set: nil, type: nil)
533
+ @set = set
534
+ @type = type
535
+ end
536
+ end
537
+
538
+ class StartsAt < Stripe::RequestParams
539
+ class DiscountEnd < Stripe::RequestParams
540
+ # The ID of a specific discount.
541
+ attr_accessor :discount
542
+
543
+ def initialize(discount: nil)
544
+ @discount = discount
545
+ end
546
+ end
547
+
548
+ class LineEndsAt < Stripe::RequestParams
549
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
550
+ attr_accessor :index
551
+
552
+ def initialize(index: nil)
553
+ @index = index
554
+ end
555
+ end
556
+ # Use the `end` time of a given discount.
557
+ attr_accessor :discount_end
558
+ # The timestamp the given line ends at.
559
+ attr_accessor :line_ends_at
560
+ # A precise Unix timestamp.
561
+ attr_accessor :timestamp
562
+ # Select a way to pass in `starts_at`.
563
+ attr_accessor :type
564
+
565
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
566
+ @discount_end = discount_end
567
+ @line_ends_at = line_ends_at
568
+ @timestamp = timestamp
569
+ @type = type
570
+ end
571
+ end
572
+
573
+ class TrialSettings < Stripe::RequestParams
574
+ class EndBehavior < Stripe::RequestParams
575
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
576
+ attr_accessor :prorate_up_front
577
+
578
+ def initialize(prorate_up_front: nil)
579
+ @prorate_up_front = prorate_up_front
580
+ end
581
+ end
582
+ # Defines how the subscription should behave when a trial ends.
583
+ attr_accessor :end_behavior
584
+
585
+ def initialize(end_behavior: nil)
586
+ @end_behavior = end_behavior
587
+ end
588
+ end
589
+ # An array of operations the quote line performs.
590
+ attr_accessor :actions
591
+ # Details to identify the subscription schedule the quote line applies to.
592
+ attr_accessor :applies_to
593
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
594
+ attr_accessor :billing_cycle_anchor
595
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
596
+ attr_accessor :cancel_subscription_schedule
597
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
598
+ attr_accessor :ends_at
599
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
600
+ attr_accessor :proration_behavior
601
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
602
+ attr_accessor :set_pause_collection
603
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
604
+ attr_accessor :set_schedule_end
605
+ # Details to identify the earliest timestamp where the proposed change should take effect.
606
+ attr_accessor :starts_at
607
+ # Settings related to subscription trials.
608
+ attr_accessor :trial_settings
609
+
610
+ def initialize(
611
+ actions: nil,
612
+ applies_to: nil,
613
+ billing_cycle_anchor: nil,
614
+ cancel_subscription_schedule: nil,
615
+ ends_at: nil,
616
+ proration_behavior: nil,
617
+ set_pause_collection: nil,
618
+ set_schedule_end: nil,
619
+ starts_at: nil,
620
+ trial_settings: nil
621
+ )
622
+ @actions = actions
623
+ @applies_to = applies_to
624
+ @billing_cycle_anchor = billing_cycle_anchor
625
+ @cancel_subscription_schedule = cancel_subscription_schedule
626
+ @ends_at = ends_at
627
+ @proration_behavior = proration_behavior
628
+ @set_pause_collection = set_pause_collection
629
+ @set_schedule_end = set_schedule_end
630
+ @starts_at = starts_at
631
+ @trial_settings = trial_settings
632
+ end
633
+ end
634
+
635
+ class LineItem < Stripe::RequestParams
636
+ class Discount < Stripe::RequestParams
637
+ class DiscountEnd < Stripe::RequestParams
638
+ class Duration < Stripe::RequestParams
639
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
640
+ attr_accessor :interval
641
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
642
+ attr_accessor :interval_count
643
+
644
+ def initialize(interval: nil, interval_count: nil)
645
+ @interval = interval
646
+ @interval_count = interval_count
647
+ end
648
+ end
649
+ # Time span for the redeemed discount.
650
+ attr_accessor :duration
651
+ # A precise Unix timestamp for the discount to end. Must be in the future.
652
+ attr_accessor :timestamp
653
+ # The type of calculation made to determine when the discount ends.
654
+ attr_accessor :type
655
+
656
+ def initialize(duration: nil, timestamp: nil, type: nil)
657
+ @duration = duration
658
+ @timestamp = timestamp
659
+ @type = type
660
+ end
661
+ end
662
+ # ID of the coupon to create a new discount for.
663
+ attr_accessor :coupon
664
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
665
+ attr_accessor :discount
666
+ # Details to determine how long the discount should be applied for.
667
+ attr_accessor :discount_end
668
+ # ID of the promotion code to create a new discount for.
669
+ attr_accessor :promotion_code
670
+
671
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
672
+ @coupon = coupon
673
+ @discount = discount
674
+ @discount_end = discount_end
675
+ @promotion_code = promotion_code
676
+ end
677
+ end
678
+
679
+ class PriceData < Stripe::RequestParams
680
+ class Recurring < Stripe::RequestParams
681
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
682
+ attr_accessor :interval
683
+ # 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).
684
+ attr_accessor :interval_count
685
+
686
+ def initialize(interval: nil, interval_count: nil)
687
+ @interval = interval
688
+ @interval_count = interval_count
689
+ end
690
+ end
691
+ # 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).
692
+ attr_accessor :currency
693
+ # The ID of the product that this price will belong to.
694
+ attr_accessor :product
695
+ # The recurring components of a price such as `interval` and `interval_count`.
696
+ attr_accessor :recurring
697
+ # 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.
698
+ attr_accessor :tax_behavior
699
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
700
+ attr_accessor :unit_amount
701
+ # 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.
702
+ attr_accessor :unit_amount_decimal
703
+
704
+ def initialize(
705
+ currency: nil,
706
+ product: nil,
707
+ recurring: nil,
708
+ tax_behavior: nil,
709
+ unit_amount: nil,
710
+ unit_amount_decimal: nil
711
+ )
712
+ @currency = currency
713
+ @product = product
714
+ @recurring = recurring
715
+ @tax_behavior = tax_behavior
716
+ @unit_amount = unit_amount
717
+ @unit_amount_decimal = unit_amount_decimal
718
+ end
719
+ end
720
+ # The discounts applied to this line item.
721
+ attr_accessor :discounts
722
+ # The ID of the price object. One of `price` or `price_data` is required.
723
+ attr_accessor :price
724
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
725
+ attr_accessor :price_data
726
+ # The quantity of the line item.
727
+ attr_accessor :quantity
728
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
729
+ attr_accessor :tax_rates
730
+
731
+ def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
732
+ @discounts = discounts
733
+ @price = price
734
+ @price_data = price_data
735
+ @quantity = quantity
736
+ @tax_rates = tax_rates
737
+ end
738
+ end
739
+
740
+ class SubscriptionData < Stripe::RequestParams
741
+ class BillOnAcceptance < Stripe::RequestParams
742
+ class BillFrom < Stripe::RequestParams
743
+ class LineStartsAt < Stripe::RequestParams
744
+ # The ID of a quote line.
745
+ attr_accessor :id
746
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
747
+ attr_accessor :index
748
+
749
+ def initialize(id: nil, index: nil)
750
+ @id = id
751
+ @index = index
752
+ end
753
+ end
754
+ # Details of a Quote line to start the bill period from.
755
+ attr_accessor :line_starts_at
756
+ # A precise Unix timestamp.
757
+ attr_accessor :timestamp
758
+ # The type of method to specify the `bill_from` time.
759
+ attr_accessor :type
760
+
761
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
762
+ @line_starts_at = line_starts_at
763
+ @timestamp = timestamp
764
+ @type = type
765
+ end
766
+ end
767
+
768
+ class BillUntil < Stripe::RequestParams
769
+ class Duration < Stripe::RequestParams
770
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
771
+ attr_accessor :interval
772
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
773
+ attr_accessor :interval_count
774
+
775
+ def initialize(interval: nil, interval_count: nil)
776
+ @interval = interval
777
+ @interval_count = interval_count
778
+ end
779
+ end
780
+
781
+ class LineEndsAt < Stripe::RequestParams
782
+ # The ID of a quote line.
783
+ attr_accessor :id
784
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
785
+ attr_accessor :index
786
+
787
+ def initialize(id: nil, index: nil)
788
+ @id = id
789
+ @index = index
790
+ end
791
+ end
792
+ # Details of the duration over which to bill.
793
+ attr_accessor :duration
794
+ # Details of a Quote line item from which to bill until.
795
+ attr_accessor :line_ends_at
796
+ # A precise Unix timestamp.
797
+ attr_accessor :timestamp
798
+ # The type of method to specify the `bill_until` time.
799
+ attr_accessor :type
800
+
801
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
802
+ @duration = duration
803
+ @line_ends_at = line_ends_at
804
+ @timestamp = timestamp
805
+ @type = type
806
+ end
807
+ end
808
+ # The start of the period to bill from when the Quote is accepted.
809
+ attr_accessor :bill_from
810
+ # The end of the period to bill until when the Quote is accepted.
811
+ attr_accessor :bill_until
812
+
813
+ def initialize(bill_from: nil, bill_until: nil)
814
+ @bill_from = bill_from
815
+ @bill_until = bill_until
816
+ end
817
+ end
818
+
819
+ class Prebilling < Stripe::RequestParams
820
+ # This is used to determine the number of billing cycles to prebill.
821
+ attr_accessor :iterations
822
+
823
+ def initialize(iterations: nil)
824
+ @iterations = iterations
825
+ end
826
+ end
827
+ # Describes the period to bill for upon accepting the quote.
828
+ attr_accessor :bill_on_acceptance
829
+ # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
830
+ attr_accessor :billing_behavior
831
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
832
+ attr_accessor :billing_cycle_anchor
833
+ # 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.
834
+ attr_accessor :description
835
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
836
+ attr_accessor :effective_date
837
+ # Behavior of the subscription schedule and underlying subscription when it ends.
838
+ attr_accessor :end_behavior
839
+ # The id of a subscription that the quote will update. By default, the quote will contain the state of the subscription (such as line items, collection method and billing thresholds) unless overridden.
840
+ attr_accessor :from_subscription
841
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
842
+ attr_accessor :metadata
843
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
844
+ attr_accessor :prebilling
845
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
846
+ #
847
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
848
+ #
849
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
850
+ #
851
+ # Prorations can be disabled by passing `none`.
852
+ attr_accessor :proration_behavior
853
+ # Integer representing the number of trial period days before the customer is charged for the first time.
854
+ attr_accessor :trial_period_days
855
+
856
+ def initialize(
857
+ bill_on_acceptance: nil,
858
+ billing_behavior: nil,
859
+ billing_cycle_anchor: nil,
860
+ description: nil,
861
+ effective_date: nil,
862
+ end_behavior: nil,
863
+ from_subscription: nil,
864
+ metadata: nil,
865
+ prebilling: nil,
866
+ proration_behavior: nil,
867
+ trial_period_days: nil
868
+ )
869
+ @bill_on_acceptance = bill_on_acceptance
870
+ @billing_behavior = billing_behavior
871
+ @billing_cycle_anchor = billing_cycle_anchor
872
+ @description = description
873
+ @effective_date = effective_date
874
+ @end_behavior = end_behavior
875
+ @from_subscription = from_subscription
876
+ @metadata = metadata
877
+ @prebilling = prebilling
878
+ @proration_behavior = proration_behavior
879
+ @trial_period_days = trial_period_days
880
+ end
881
+ end
882
+
883
+ class SubscriptionDataOverride < Stripe::RequestParams
884
+ class AppliesTo < Stripe::RequestParams
885
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
886
+ attr_accessor :new_reference
887
+ # The ID of the schedule the line applies to.
888
+ attr_accessor :subscription_schedule
889
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
890
+ attr_accessor :type
891
+
892
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
893
+ @new_reference = new_reference
894
+ @subscription_schedule = subscription_schedule
895
+ @type = type
896
+ end
897
+ end
898
+
899
+ class BillOnAcceptance < Stripe::RequestParams
900
+ class BillFrom < Stripe::RequestParams
901
+ class LineStartsAt < Stripe::RequestParams
902
+ # The ID of a quote line.
903
+ attr_accessor :id
904
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
905
+ attr_accessor :index
906
+
907
+ def initialize(id: nil, index: nil)
908
+ @id = id
909
+ @index = index
910
+ end
911
+ end
912
+ # Details of a Quote line to start the bill period from.
913
+ attr_accessor :line_starts_at
914
+ # A precise Unix timestamp.
915
+ attr_accessor :timestamp
916
+ # The type of method to specify the `bill_from` time.
917
+ attr_accessor :type
918
+
919
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
920
+ @line_starts_at = line_starts_at
921
+ @timestamp = timestamp
922
+ @type = type
923
+ end
924
+ end
925
+
926
+ class BillUntil < Stripe::RequestParams
927
+ class Duration < Stripe::RequestParams
928
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
929
+ attr_accessor :interval
930
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
931
+ attr_accessor :interval_count
932
+
933
+ def initialize(interval: nil, interval_count: nil)
934
+ @interval = interval
935
+ @interval_count = interval_count
936
+ end
937
+ end
938
+
939
+ class LineEndsAt < Stripe::RequestParams
940
+ # The ID of a quote line.
941
+ attr_accessor :id
942
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
943
+ attr_accessor :index
944
+
945
+ def initialize(id: nil, index: nil)
946
+ @id = id
947
+ @index = index
948
+ end
949
+ end
950
+ # Details of the duration over which to bill.
951
+ attr_accessor :duration
952
+ # Details of a Quote line item from which to bill until.
953
+ attr_accessor :line_ends_at
954
+ # A precise Unix timestamp.
955
+ attr_accessor :timestamp
956
+ # The type of method to specify the `bill_until` time.
957
+ attr_accessor :type
958
+
959
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
960
+ @duration = duration
961
+ @line_ends_at = line_ends_at
962
+ @timestamp = timestamp
963
+ @type = type
964
+ end
965
+ end
966
+ # The start of the period to bill from when the Quote is accepted.
967
+ attr_accessor :bill_from
968
+ # The end of the period to bill until when the Quote is accepted.
969
+ attr_accessor :bill_until
970
+
971
+ def initialize(bill_from: nil, bill_until: nil)
972
+ @bill_from = bill_from
973
+ @bill_until = bill_until
974
+ end
975
+ end
976
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
977
+ attr_accessor :applies_to
978
+ # Describes the period to bill for upon accepting the quote.
979
+ attr_accessor :bill_on_acceptance
980
+ # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
981
+ attr_accessor :billing_behavior
982
+ # The customer the Subscription Data override applies to. This is only relevant when `applies_to.type=new_reference`.
983
+ attr_accessor :customer
984
+ # 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.
985
+ attr_accessor :description
986
+ # Behavior of the subscription schedule and underlying subscription when it ends.
987
+ attr_accessor :end_behavior
988
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
989
+ #
990
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
991
+ #
992
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
993
+ #
994
+ # Prorations can be disabled by passing `none`.
995
+ attr_accessor :proration_behavior
996
+
997
+ def initialize(
998
+ applies_to: nil,
999
+ bill_on_acceptance: nil,
1000
+ billing_behavior: nil,
1001
+ customer: nil,
1002
+ description: nil,
1003
+ end_behavior: nil,
1004
+ proration_behavior: nil
1005
+ )
1006
+ @applies_to = applies_to
1007
+ @bill_on_acceptance = bill_on_acceptance
1008
+ @billing_behavior = billing_behavior
1009
+ @customer = customer
1010
+ @description = description
1011
+ @end_behavior = end_behavior
1012
+ @proration_behavior = proration_behavior
1013
+ end
1014
+ end
1015
+
1016
+ class TransferData < Stripe::RequestParams
1017
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
1018
+ attr_accessor :amount
1019
+ # 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. There must be at least 1 line item with a recurring price to use this field.
1020
+ attr_accessor :amount_percent
1021
+ # ID of an existing, connected Stripe account.
1022
+ attr_accessor :destination
1023
+
1024
+ def initialize(amount: nil, amount_percent: nil, destination: nil)
1025
+ @amount = amount
1026
+ @amount_percent = amount_percent
1027
+ @destination = destination
1028
+ end
1029
+ end
1030
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
1031
+ attr_accessor :allow_backdated_lines
1032
+ # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
1033
+ attr_accessor :application_fee_amount
1034
+ # 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. There must be at least 1 line item with a recurring price to use this field.
1035
+ attr_accessor :application_fee_percent
1036
+ # Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
1037
+ attr_accessor :automatic_tax
1038
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or 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`.
1039
+ attr_accessor :collection_method
1040
+ # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
1041
+ attr_accessor :customer
1042
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
1043
+ attr_accessor :default_tax_rates
1044
+ # A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
1045
+ attr_accessor :description
1046
+ # The discounts applied to the quote.
1047
+ attr_accessor :discounts
1048
+ # Specifies which fields in the response should be expanded.
1049
+ attr_accessor :expand
1050
+ # A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
1051
+ attr_accessor :expires_at
1052
+ # A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
1053
+ attr_accessor :footer
1054
+ # Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`.
1055
+ attr_accessor :from_quote
1056
+ # A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used.
1057
+ attr_accessor :header
1058
+ # All invoices will be billed using the specified settings.
1059
+ attr_accessor :invoice_settings
1060
+ # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
1061
+ attr_accessor :line_items
1062
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
1063
+ attr_accessor :lines
1064
+ # 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`.
1065
+ attr_accessor :metadata
1066
+ # The account on behalf of which to charge.
1067
+ attr_accessor :on_behalf_of
1068
+ # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
1069
+ attr_accessor :subscription_data
1070
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
1071
+ attr_accessor :subscription_data_overrides
1072
+ # ID of the test clock to attach to the quote.
1073
+ attr_accessor :test_clock
1074
+ # The data with which to automatically create a Transfer for each of the invoices.
1075
+ attr_accessor :transfer_data
1076
+
1077
+ def initialize(
1078
+ allow_backdated_lines: nil,
1079
+ application_fee_amount: nil,
1080
+ application_fee_percent: nil,
1081
+ automatic_tax: nil,
1082
+ collection_method: nil,
1083
+ customer: nil,
1084
+ default_tax_rates: nil,
1085
+ description: nil,
1086
+ discounts: nil,
1087
+ expand: nil,
1088
+ expires_at: nil,
1089
+ footer: nil,
1090
+ from_quote: nil,
1091
+ header: nil,
1092
+ invoice_settings: nil,
1093
+ line_items: nil,
1094
+ lines: nil,
1095
+ metadata: nil,
1096
+ on_behalf_of: nil,
1097
+ subscription_data: nil,
1098
+ subscription_data_overrides: nil,
1099
+ test_clock: nil,
1100
+ transfer_data: nil
1101
+ )
1102
+ @allow_backdated_lines = allow_backdated_lines
1103
+ @application_fee_amount = application_fee_amount
1104
+ @application_fee_percent = application_fee_percent
1105
+ @automatic_tax = automatic_tax
1106
+ @collection_method = collection_method
1107
+ @customer = customer
1108
+ @default_tax_rates = default_tax_rates
1109
+ @description = description
1110
+ @discounts = discounts
1111
+ @expand = expand
1112
+ @expires_at = expires_at
1113
+ @footer = footer
1114
+ @from_quote = from_quote
1115
+ @header = header
1116
+ @invoice_settings = invoice_settings
1117
+ @line_items = line_items
1118
+ @lines = lines
1119
+ @metadata = metadata
1120
+ @on_behalf_of = on_behalf_of
1121
+ @subscription_data = subscription_data
1122
+ @subscription_data_overrides = subscription_data_overrides
1123
+ @test_clock = test_clock
1124
+ @transfer_data = transfer_data
1125
+ end
1126
+ end
1127
+
1128
+ class RetrieveParams < Stripe::RequestParams
1129
+ # Specifies which fields in the response should be expanded.
1130
+ attr_accessor :expand
1131
+
1132
+ def initialize(expand: nil)
1133
+ @expand = expand
1134
+ end
1135
+ end
1136
+
1137
+ class UpdateParams < Stripe::RequestParams
1138
+ class AutomaticTax < Stripe::RequestParams
1139
+ class Liability < Stripe::RequestParams
1140
+ # The connected account being referenced when `type` is `account`.
1141
+ attr_accessor :account
1142
+ # Type of the account referenced in the request.
1143
+ attr_accessor :type
1144
+
1145
+ def initialize(account: nil, type: nil)
1146
+ @account = account
1147
+ @type = type
1148
+ end
1149
+ end
1150
+ # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
1151
+ attr_accessor :enabled
1152
+ # 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.
1153
+ attr_accessor :liability
1154
+
1155
+ def initialize(enabled: nil, liability: nil)
1156
+ @enabled = enabled
1157
+ @liability = liability
1158
+ end
1159
+ end
1160
+
1161
+ class Discount < Stripe::RequestParams
1162
+ class DiscountEnd < Stripe::RequestParams
1163
+ class Duration < Stripe::RequestParams
1164
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1165
+ attr_accessor :interval
1166
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1167
+ attr_accessor :interval_count
1168
+
1169
+ def initialize(interval: nil, interval_count: nil)
1170
+ @interval = interval
1171
+ @interval_count = interval_count
1172
+ end
1173
+ end
1174
+ # Time span for the redeemed discount.
1175
+ attr_accessor :duration
1176
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1177
+ attr_accessor :timestamp
1178
+ # The type of calculation made to determine when the discount ends.
1179
+ attr_accessor :type
1180
+
1181
+ def initialize(duration: nil, timestamp: nil, type: nil)
1182
+ @duration = duration
1183
+ @timestamp = timestamp
1184
+ @type = type
1185
+ end
1186
+ end
1187
+ # ID of the coupon to create a new discount for.
1188
+ attr_accessor :coupon
1189
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1190
+ attr_accessor :discount
1191
+ # Details to determine how long the discount should be applied for.
1192
+ attr_accessor :discount_end
1193
+ # ID of the promotion code to create a new discount for.
1194
+ attr_accessor :promotion_code
1195
+
1196
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1197
+ @coupon = coupon
1198
+ @discount = discount
1199
+ @discount_end = discount_end
1200
+ @promotion_code = promotion_code
1201
+ end
1202
+ end
1203
+
1204
+ class InvoiceSettings < Stripe::RequestParams
1205
+ class Issuer < Stripe::RequestParams
1206
+ # The connected account being referenced when `type` is `account`.
1207
+ attr_accessor :account
1208
+ # Type of the account referenced in the request.
1209
+ attr_accessor :type
1210
+
1211
+ def initialize(account: nil, type: nil)
1212
+ @account = account
1213
+ @type = type
1214
+ end
1215
+ end
1216
+ # Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
1217
+ attr_accessor :days_until_due
1218
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1219
+ attr_accessor :issuer
1220
+
1221
+ def initialize(days_until_due: nil, issuer: nil)
1222
+ @days_until_due = days_until_due
1223
+ @issuer = issuer
1224
+ end
1225
+ end
1226
+
1227
+ class Line < Stripe::RequestParams
1228
+ class Action < Stripe::RequestParams
1229
+ class AddDiscount < Stripe::RequestParams
1230
+ class DiscountEnd < Stripe::RequestParams
1231
+ # The type of calculation made to determine when the discount ends.
1232
+ attr_accessor :type
1233
+
1234
+ def initialize(type: nil)
1235
+ @type = type
1236
+ end
1237
+ end
1238
+ # The coupon code to redeem.
1239
+ attr_accessor :coupon
1240
+ # An ID of an existing discount for a coupon that was already redeemed.
1241
+ attr_accessor :discount
1242
+ # Details to determine how long the discount should be applied for.
1243
+ attr_accessor :discount_end
1244
+ # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
1245
+ attr_accessor :index
1246
+ # The promotion code to redeem.
1247
+ attr_accessor :promotion_code
1248
+
1249
+ def initialize(
1250
+ coupon: nil,
1251
+ discount: nil,
1252
+ discount_end: nil,
1253
+ index: nil,
1254
+ promotion_code: nil
1255
+ )
1256
+ @coupon = coupon
1257
+ @discount = discount
1258
+ @discount_end = discount_end
1259
+ @index = index
1260
+ @promotion_code = promotion_code
1261
+ end
1262
+ end
1263
+
1264
+ class AddItem < Stripe::RequestParams
1265
+ class Discount < Stripe::RequestParams
1266
+ class DiscountEnd < Stripe::RequestParams
1267
+ class Duration < Stripe::RequestParams
1268
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1269
+ attr_accessor :interval
1270
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1271
+ attr_accessor :interval_count
1272
+
1273
+ def initialize(interval: nil, interval_count: nil)
1274
+ @interval = interval
1275
+ @interval_count = interval_count
1276
+ end
1277
+ end
1278
+ # Time span for the redeemed discount.
1279
+ attr_accessor :duration
1280
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1281
+ attr_accessor :timestamp
1282
+ # The type of calculation made to determine when the discount ends.
1283
+ attr_accessor :type
1284
+
1285
+ def initialize(duration: nil, timestamp: nil, type: nil)
1286
+ @duration = duration
1287
+ @timestamp = timestamp
1288
+ @type = type
1289
+ end
1290
+ end
1291
+ # ID of the coupon to create a new discount for.
1292
+ attr_accessor :coupon
1293
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1294
+ attr_accessor :discount
1295
+ # Details to determine how long the discount should be applied for.
1296
+ attr_accessor :discount_end
1297
+ # ID of the promotion code to create a new discount for.
1298
+ attr_accessor :promotion_code
1299
+
1300
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1301
+ @coupon = coupon
1302
+ @discount = discount
1303
+ @discount_end = discount_end
1304
+ @promotion_code = promotion_code
1305
+ end
1306
+ end
1307
+
1308
+ class Trial < Stripe::RequestParams
1309
+ # 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.
1310
+ attr_accessor :converts_to
1311
+ # Determines the type of trial for this item.
1312
+ attr_accessor :type
1313
+
1314
+ def initialize(converts_to: nil, type: nil)
1315
+ @converts_to = converts_to
1316
+ @type = type
1317
+ end
1318
+ end
1319
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
1320
+ attr_accessor :discounts
1321
+ # 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`.
1322
+ attr_accessor :metadata
1323
+ # The ID of the price object.
1324
+ attr_accessor :price
1325
+ # Quantity for this item.
1326
+ attr_accessor :quantity
1327
+ # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
1328
+ attr_accessor :tax_rates
1329
+ # Options that configure the trial on the subscription item.
1330
+ attr_accessor :trial
1331
+
1332
+ def initialize(
1333
+ discounts: nil,
1334
+ metadata: nil,
1335
+ price: nil,
1336
+ quantity: nil,
1337
+ tax_rates: nil,
1338
+ trial: nil
1339
+ )
1340
+ @discounts = discounts
1341
+ @metadata = metadata
1342
+ @price = price
1343
+ @quantity = quantity
1344
+ @tax_rates = tax_rates
1345
+ @trial = trial
1346
+ end
1347
+ end
1348
+
1349
+ class RemoveDiscount < Stripe::RequestParams
1350
+ # The coupon code to remove from the `discounts` array.
1351
+ attr_accessor :coupon
1352
+ # The ID of a discount to remove from the `discounts` array.
1353
+ attr_accessor :discount
1354
+ # The ID of a promotion code to remove from the `discounts` array.
1355
+ attr_accessor :promotion_code
1356
+
1357
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1358
+ @coupon = coupon
1359
+ @discount = discount
1360
+ @promotion_code = promotion_code
1361
+ end
1362
+ end
1363
+
1364
+ class RemoveItem < Stripe::RequestParams
1365
+ # ID of a price to remove.
1366
+ attr_accessor :price
1367
+
1368
+ def initialize(price: nil)
1369
+ @price = price
1370
+ end
1371
+ end
1372
+
1373
+ class SetDiscount < Stripe::RequestParams
1374
+ # The coupon code to replace the `discounts` array with.
1375
+ attr_accessor :coupon
1376
+ # An ID of an existing discount to replace the `discounts` array with.
1377
+ attr_accessor :discount
1378
+ # An ID of an existing promotion code to replace the `discounts` array with.
1379
+ attr_accessor :promotion_code
1380
+
1381
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1382
+ @coupon = coupon
1383
+ @discount = discount
1384
+ @promotion_code = promotion_code
1385
+ end
1386
+ end
1387
+
1388
+ class SetItem < Stripe::RequestParams
1389
+ class Discount < Stripe::RequestParams
1390
+ class DiscountEnd < Stripe::RequestParams
1391
+ class Duration < Stripe::RequestParams
1392
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1393
+ attr_accessor :interval
1394
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1395
+ attr_accessor :interval_count
1396
+
1397
+ def initialize(interval: nil, interval_count: nil)
1398
+ @interval = interval
1399
+ @interval_count = interval_count
1400
+ end
1401
+ end
1402
+ # Time span for the redeemed discount.
1403
+ attr_accessor :duration
1404
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1405
+ attr_accessor :timestamp
1406
+ # The type of calculation made to determine when the discount ends.
1407
+ attr_accessor :type
1408
+
1409
+ def initialize(duration: nil, timestamp: nil, type: nil)
1410
+ @duration = duration
1411
+ @timestamp = timestamp
1412
+ @type = type
1413
+ end
1414
+ end
1415
+ # ID of the coupon to create a new discount for.
1416
+ attr_accessor :coupon
1417
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1418
+ attr_accessor :discount
1419
+ # Details to determine how long the discount should be applied for.
1420
+ attr_accessor :discount_end
1421
+ # ID of the promotion code to create a new discount for.
1422
+ attr_accessor :promotion_code
1423
+
1424
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1425
+ @coupon = coupon
1426
+ @discount = discount
1427
+ @discount_end = discount_end
1428
+ @promotion_code = promotion_code
1429
+ end
1430
+ end
1431
+
1432
+ class Trial < Stripe::RequestParams
1433
+ # 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.
1434
+ attr_accessor :converts_to
1435
+ # Determines the type of trial for this item.
1436
+ attr_accessor :type
1437
+
1438
+ def initialize(converts_to: nil, type: nil)
1439
+ @converts_to = converts_to
1440
+ @type = type
1441
+ end
1442
+ end
1443
+ # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
1444
+ attr_accessor :discounts
1445
+ # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
1446
+ attr_accessor :metadata
1447
+ # The ID of the price object.
1448
+ attr_accessor :price
1449
+ # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
1450
+ attr_accessor :quantity
1451
+ # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
1452
+ attr_accessor :tax_rates
1453
+ # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
1454
+ attr_accessor :trial
1455
+
1456
+ def initialize(
1457
+ discounts: nil,
1458
+ metadata: nil,
1459
+ price: nil,
1460
+ quantity: nil,
1461
+ tax_rates: nil,
1462
+ trial: nil
1463
+ )
1464
+ @discounts = discounts
1465
+ @metadata = metadata
1466
+ @price = price
1467
+ @quantity = quantity
1468
+ @tax_rates = tax_rates
1469
+ @trial = trial
1470
+ end
1471
+ end
1472
+ # Details for the `add_discount` type.
1473
+ attr_accessor :add_discount
1474
+ # Details for the `add_item` type.
1475
+ attr_accessor :add_item
1476
+ # Details for the `add_metadata` type: specify a hash of key-value pairs.
1477
+ attr_accessor :add_metadata
1478
+ # Details for the `remove_discount` type.
1479
+ attr_accessor :remove_discount
1480
+ # Details for the `remove_item` type.
1481
+ attr_accessor :remove_item
1482
+ # Details for the `remove_metadata` type: specify an array of metadata keys.
1483
+ attr_accessor :remove_metadata
1484
+ # Details for the `set_discounts` type.
1485
+ attr_accessor :set_discounts
1486
+ # Details for the `set_items` type.
1487
+ attr_accessor :set_items
1488
+ # Details for the `set_metadata` type: specify an array of key-value pairs.
1489
+ attr_accessor :set_metadata
1490
+ # The type of action the quote line performs.
1491
+ attr_accessor :type
1492
+
1493
+ def initialize(
1494
+ add_discount: nil,
1495
+ add_item: nil,
1496
+ add_metadata: nil,
1497
+ remove_discount: nil,
1498
+ remove_item: nil,
1499
+ remove_metadata: nil,
1500
+ set_discounts: nil,
1501
+ set_items: nil,
1502
+ set_metadata: nil,
1503
+ type: nil
1504
+ )
1505
+ @add_discount = add_discount
1506
+ @add_item = add_item
1507
+ @add_metadata = add_metadata
1508
+ @remove_discount = remove_discount
1509
+ @remove_item = remove_item
1510
+ @remove_metadata = remove_metadata
1511
+ @set_discounts = set_discounts
1512
+ @set_items = set_items
1513
+ @set_metadata = set_metadata
1514
+ @type = type
1515
+ end
1516
+ end
1517
+
1518
+ class AppliesTo < Stripe::RequestParams
1519
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1520
+ attr_accessor :new_reference
1521
+ # The ID of the schedule the line applies to.
1522
+ attr_accessor :subscription_schedule
1523
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1524
+ attr_accessor :type
1525
+
1526
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1527
+ @new_reference = new_reference
1528
+ @subscription_schedule = subscription_schedule
1529
+ @type = type
1530
+ end
1531
+ end
1532
+
1533
+ class CancelSubscriptionSchedule < Stripe::RequestParams
1534
+ # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`.
1535
+ attr_accessor :cancel_at
1536
+ # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`.
1537
+ attr_accessor :invoice_now
1538
+ # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`.
1539
+ attr_accessor :prorate
1540
+
1541
+ def initialize(cancel_at: nil, invoice_now: nil, prorate: nil)
1542
+ @cancel_at = cancel_at
1543
+ @invoice_now = invoice_now
1544
+ @prorate = prorate
1545
+ end
1546
+ end
1547
+
1548
+ class EndsAt < Stripe::RequestParams
1549
+ class DiscountEnd < Stripe::RequestParams
1550
+ # The ID of a specific discount.
1551
+ attr_accessor :discount
1552
+
1553
+ def initialize(discount: nil)
1554
+ @discount = discount
1555
+ end
1556
+ end
1557
+
1558
+ class Duration < Stripe::RequestParams
1559
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1560
+ attr_accessor :interval
1561
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1562
+ attr_accessor :interval_count
1563
+
1564
+ def initialize(interval: nil, interval_count: nil)
1565
+ @interval = interval
1566
+ @interval_count = interval_count
1567
+ end
1568
+ end
1569
+ # Use the `end` time of a given discount.
1570
+ attr_accessor :discount_end
1571
+ # Time span for the quote line starting from the `starts_at` date.
1572
+ attr_accessor :duration
1573
+ # A precise Unix timestamp.
1574
+ attr_accessor :timestamp
1575
+ # Select a way to pass in `ends_at`.
1576
+ attr_accessor :type
1577
+
1578
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
1579
+ @discount_end = discount_end
1580
+ @duration = duration
1581
+ @timestamp = timestamp
1582
+ @type = type
1583
+ end
1584
+ end
1585
+
1586
+ class SetPauseCollection < Stripe::RequestParams
1587
+ class Set < Stripe::RequestParams
1588
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1589
+ attr_accessor :behavior
1590
+
1591
+ def initialize(behavior: nil)
1592
+ @behavior = behavior
1593
+ end
1594
+ end
1595
+ # Details of the pause_collection behavior to apply to the amendment.
1596
+ attr_accessor :set
1597
+ # Determines the type of the pause_collection amendment.
1598
+ attr_accessor :type
1599
+
1600
+ def initialize(set: nil, type: nil)
1601
+ @set = set
1602
+ @type = type
1603
+ end
1604
+ end
1605
+
1606
+ class StartsAt < Stripe::RequestParams
1607
+ class DiscountEnd < Stripe::RequestParams
1608
+ # The ID of a specific discount.
1609
+ attr_accessor :discount
1610
+
1611
+ def initialize(discount: nil)
1612
+ @discount = discount
1613
+ end
1614
+ end
1615
+
1616
+ class LineEndsAt < Stripe::RequestParams
1617
+ # The ID of a quote line.
1618
+ attr_accessor :id
1619
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1620
+ attr_accessor :index
1621
+
1622
+ def initialize(id: nil, index: nil)
1623
+ @id = id
1624
+ @index = index
1625
+ end
1626
+ end
1627
+ # Use the `end` time of a given discount.
1628
+ attr_accessor :discount_end
1629
+ # The timestamp the given line ends at.
1630
+ attr_accessor :line_ends_at
1631
+ # A precise Unix timestamp.
1632
+ attr_accessor :timestamp
1633
+ # Select a way to pass in `starts_at`.
1634
+ attr_accessor :type
1635
+
1636
+ def initialize(discount_end: nil, line_ends_at: nil, timestamp: nil, type: nil)
1637
+ @discount_end = discount_end
1638
+ @line_ends_at = line_ends_at
1639
+ @timestamp = timestamp
1640
+ @type = type
1641
+ end
1642
+ end
1643
+
1644
+ class TrialSettings < Stripe::RequestParams
1645
+ class EndBehavior < Stripe::RequestParams
1646
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1647
+ attr_accessor :prorate_up_front
1648
+
1649
+ def initialize(prorate_up_front: nil)
1650
+ @prorate_up_front = prorate_up_front
1651
+ end
1652
+ end
1653
+ # Defines how the subscription should behave when a trial ends.
1654
+ attr_accessor :end_behavior
1655
+
1656
+ def initialize(end_behavior: nil)
1657
+ @end_behavior = end_behavior
1658
+ end
1659
+ end
1660
+ # An array of operations the quote line performs.
1661
+ attr_accessor :actions
1662
+ # Details to identify the subscription schedule the quote line applies to.
1663
+ attr_accessor :applies_to
1664
+ # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line.
1665
+ attr_accessor :billing_cycle_anchor
1666
+ # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings.
1667
+ attr_accessor :cancel_subscription_schedule
1668
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line.
1669
+ attr_accessor :ends_at
1670
+ # The ID of an existing line on the quote.
1671
+ attr_accessor :id
1672
+ # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts.
1673
+ attr_accessor :proration_behavior
1674
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
1675
+ attr_accessor :set_pause_collection
1676
+ # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date.
1677
+ attr_accessor :set_schedule_end
1678
+ # Details to identify the earliest timestamp where the proposed change should take effect.
1679
+ attr_accessor :starts_at
1680
+ # Settings related to subscription trials.
1681
+ attr_accessor :trial_settings
1682
+
1683
+ def initialize(
1684
+ actions: nil,
1685
+ applies_to: nil,
1686
+ billing_cycle_anchor: nil,
1687
+ cancel_subscription_schedule: nil,
1688
+ ends_at: nil,
1689
+ id: nil,
1690
+ proration_behavior: nil,
1691
+ set_pause_collection: nil,
1692
+ set_schedule_end: nil,
1693
+ starts_at: nil,
1694
+ trial_settings: nil
1695
+ )
1696
+ @actions = actions
1697
+ @applies_to = applies_to
1698
+ @billing_cycle_anchor = billing_cycle_anchor
1699
+ @cancel_subscription_schedule = cancel_subscription_schedule
1700
+ @ends_at = ends_at
1701
+ @id = id
1702
+ @proration_behavior = proration_behavior
1703
+ @set_pause_collection = set_pause_collection
1704
+ @set_schedule_end = set_schedule_end
1705
+ @starts_at = starts_at
1706
+ @trial_settings = trial_settings
1707
+ end
1708
+ end
1709
+
1710
+ class LineItem < Stripe::RequestParams
1711
+ class Discount < Stripe::RequestParams
1712
+ class DiscountEnd < Stripe::RequestParams
1713
+ class Duration < Stripe::RequestParams
1714
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1715
+ attr_accessor :interval
1716
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1717
+ attr_accessor :interval_count
1718
+
1719
+ def initialize(interval: nil, interval_count: nil)
1720
+ @interval = interval
1721
+ @interval_count = interval_count
1722
+ end
1723
+ end
1724
+ # Time span for the redeemed discount.
1725
+ attr_accessor :duration
1726
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1727
+ attr_accessor :timestamp
1728
+ # The type of calculation made to determine when the discount ends.
1729
+ attr_accessor :type
1730
+
1731
+ def initialize(duration: nil, timestamp: nil, type: nil)
1732
+ @duration = duration
1733
+ @timestamp = timestamp
1734
+ @type = type
1735
+ end
1736
+ end
1737
+ # ID of the coupon to create a new discount for.
1738
+ attr_accessor :coupon
1739
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1740
+ attr_accessor :discount
1741
+ # Details to determine how long the discount should be applied for.
1742
+ attr_accessor :discount_end
1743
+ # ID of the promotion code to create a new discount for.
1744
+ attr_accessor :promotion_code
1745
+
1746
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1747
+ @coupon = coupon
1748
+ @discount = discount
1749
+ @discount_end = discount_end
1750
+ @promotion_code = promotion_code
1751
+ end
1752
+ end
1753
+
1754
+ class PriceData < Stripe::RequestParams
1755
+ class Recurring < Stripe::RequestParams
1756
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1757
+ attr_accessor :interval
1758
+ # 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).
1759
+ attr_accessor :interval_count
1760
+
1761
+ def initialize(interval: nil, interval_count: nil)
1762
+ @interval = interval
1763
+ @interval_count = interval_count
1764
+ end
1765
+ end
1766
+ # 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).
1767
+ attr_accessor :currency
1768
+ # The ID of the product that this price will belong to.
1769
+ attr_accessor :product
1770
+ # The recurring components of a price such as `interval` and `interval_count`.
1771
+ attr_accessor :recurring
1772
+ # 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.
1773
+ attr_accessor :tax_behavior
1774
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1775
+ attr_accessor :unit_amount
1776
+ # 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.
1777
+ attr_accessor :unit_amount_decimal
1778
+
1779
+ def initialize(
1780
+ currency: nil,
1781
+ product: nil,
1782
+ recurring: nil,
1783
+ tax_behavior: nil,
1784
+ unit_amount: nil,
1785
+ unit_amount_decimal: nil
1786
+ )
1787
+ @currency = currency
1788
+ @product = product
1789
+ @recurring = recurring
1790
+ @tax_behavior = tax_behavior
1791
+ @unit_amount = unit_amount
1792
+ @unit_amount_decimal = unit_amount_decimal
1793
+ end
1794
+ end
1795
+ # The discounts applied to this line item.
1796
+ attr_accessor :discounts
1797
+ # The ID of an existing line item on the quote.
1798
+ attr_accessor :id
1799
+ # The ID of the price object. One of `price` or `price_data` is required.
1800
+ attr_accessor :price
1801
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1802
+ attr_accessor :price_data
1803
+ # The quantity of the line item.
1804
+ attr_accessor :quantity
1805
+ # The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item.
1806
+ attr_accessor :tax_rates
1807
+
1808
+ def initialize(
1809
+ discounts: nil,
1810
+ id: nil,
1811
+ price: nil,
1812
+ price_data: nil,
1813
+ quantity: nil,
1814
+ tax_rates: nil
1815
+ )
1816
+ @discounts = discounts
1817
+ @id = id
1818
+ @price = price
1819
+ @price_data = price_data
1820
+ @quantity = quantity
1821
+ @tax_rates = tax_rates
1822
+ end
1823
+ end
1824
+
1825
+ class SubscriptionData < Stripe::RequestParams
1826
+ class BillOnAcceptance < Stripe::RequestParams
1827
+ class BillFrom < Stripe::RequestParams
1828
+ class LineStartsAt < Stripe::RequestParams
1829
+ # The ID of a quote line.
1830
+ attr_accessor :id
1831
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1832
+ attr_accessor :index
1833
+
1834
+ def initialize(id: nil, index: nil)
1835
+ @id = id
1836
+ @index = index
1837
+ end
1838
+ end
1839
+ # Details of a Quote line to start the bill period from.
1840
+ attr_accessor :line_starts_at
1841
+ # A precise Unix timestamp.
1842
+ attr_accessor :timestamp
1843
+ # The type of method to specify the `bill_from` time.
1844
+ attr_accessor :type
1845
+
1846
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
1847
+ @line_starts_at = line_starts_at
1848
+ @timestamp = timestamp
1849
+ @type = type
1850
+ end
1851
+ end
1852
+
1853
+ class BillUntil < Stripe::RequestParams
1854
+ class Duration < Stripe::RequestParams
1855
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1856
+ attr_accessor :interval
1857
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1858
+ attr_accessor :interval_count
1859
+
1860
+ def initialize(interval: nil, interval_count: nil)
1861
+ @interval = interval
1862
+ @interval_count = interval_count
1863
+ end
1864
+ end
1865
+
1866
+ class LineEndsAt < Stripe::RequestParams
1867
+ # The ID of a quote line.
1868
+ attr_accessor :id
1869
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1870
+ attr_accessor :index
1871
+
1872
+ def initialize(id: nil, index: nil)
1873
+ @id = id
1874
+ @index = index
1875
+ end
1876
+ end
1877
+ # Details of the duration over which to bill.
1878
+ attr_accessor :duration
1879
+ # Details of a Quote line item from which to bill until.
1880
+ attr_accessor :line_ends_at
1881
+ # A precise Unix timestamp.
1882
+ attr_accessor :timestamp
1883
+ # The type of method to specify the `bill_until` time.
1884
+ attr_accessor :type
1885
+
1886
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
1887
+ @duration = duration
1888
+ @line_ends_at = line_ends_at
1889
+ @timestamp = timestamp
1890
+ @type = type
1891
+ end
1892
+ end
1893
+ # The start of the period to bill from when the Quote is accepted.
1894
+ attr_accessor :bill_from
1895
+ # The end of the period to bill until when the Quote is accepted.
1896
+ attr_accessor :bill_until
1897
+
1898
+ def initialize(bill_from: nil, bill_until: nil)
1899
+ @bill_from = bill_from
1900
+ @bill_until = bill_until
1901
+ end
1902
+ end
1903
+
1904
+ class Prebilling < Stripe::RequestParams
1905
+ # This is used to determine the number of billing cycles to prebill.
1906
+ attr_accessor :iterations
1907
+
1908
+ def initialize(iterations: nil)
1909
+ @iterations = iterations
1910
+ end
1911
+ end
1912
+ # Describes the period to bill for upon accepting the quote.
1913
+ attr_accessor :bill_on_acceptance
1914
+ # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
1915
+ attr_accessor :billing_behavior
1916
+ # When specified as `reset`, the subscription will always start a new billing period when the quote is accepted.
1917
+ attr_accessor :billing_cycle_anchor
1918
+ # 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.
1919
+ attr_accessor :description
1920
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
1921
+ attr_accessor :effective_date
1922
+ # Behavior of the subscription schedule and underlying subscription when it ends.
1923
+ attr_accessor :end_behavior
1924
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
1925
+ attr_accessor :metadata
1926
+ # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`.
1927
+ attr_accessor :prebilling
1928
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
1929
+ #
1930
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
1931
+ #
1932
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
1933
+ #
1934
+ # Prorations can be disabled by passing `none`.
1935
+ attr_accessor :proration_behavior
1936
+ # Integer representing the number of trial period days before the customer is charged for the first time.
1937
+ attr_accessor :trial_period_days
1938
+
1939
+ def initialize(
1940
+ bill_on_acceptance: nil,
1941
+ billing_behavior: nil,
1942
+ billing_cycle_anchor: nil,
1943
+ description: nil,
1944
+ effective_date: nil,
1945
+ end_behavior: nil,
1946
+ metadata: nil,
1947
+ prebilling: nil,
1948
+ proration_behavior: nil,
1949
+ trial_period_days: nil
1950
+ )
1951
+ @bill_on_acceptance = bill_on_acceptance
1952
+ @billing_behavior = billing_behavior
1953
+ @billing_cycle_anchor = billing_cycle_anchor
1954
+ @description = description
1955
+ @effective_date = effective_date
1956
+ @end_behavior = end_behavior
1957
+ @metadata = metadata
1958
+ @prebilling = prebilling
1959
+ @proration_behavior = proration_behavior
1960
+ @trial_period_days = trial_period_days
1961
+ end
1962
+ end
1963
+
1964
+ class SubscriptionDataOverride < Stripe::RequestParams
1965
+ class AppliesTo < Stripe::RequestParams
1966
+ # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule.
1967
+ attr_accessor :new_reference
1968
+ # The ID of the schedule the line applies to.
1969
+ attr_accessor :subscription_schedule
1970
+ # Describes whether the quote line is affecting a new schedule or an existing schedule.
1971
+ attr_accessor :type
1972
+
1973
+ def initialize(new_reference: nil, subscription_schedule: nil, type: nil)
1974
+ @new_reference = new_reference
1975
+ @subscription_schedule = subscription_schedule
1976
+ @type = type
1977
+ end
1978
+ end
1979
+
1980
+ class BillOnAcceptance < Stripe::RequestParams
1981
+ class BillFrom < Stripe::RequestParams
1982
+ class LineStartsAt < Stripe::RequestParams
1983
+ # The ID of a quote line.
1984
+ attr_accessor :id
1985
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
1986
+ attr_accessor :index
1987
+
1988
+ def initialize(id: nil, index: nil)
1989
+ @id = id
1990
+ @index = index
1991
+ end
1992
+ end
1993
+ # Details of a Quote line to start the bill period from.
1994
+ attr_accessor :line_starts_at
1995
+ # A precise Unix timestamp.
1996
+ attr_accessor :timestamp
1997
+ # The type of method to specify the `bill_from` time.
1998
+ attr_accessor :type
1999
+
2000
+ def initialize(line_starts_at: nil, timestamp: nil, type: nil)
2001
+ @line_starts_at = line_starts_at
2002
+ @timestamp = timestamp
2003
+ @type = type
2004
+ end
2005
+ end
2006
+
2007
+ class BillUntil < Stripe::RequestParams
2008
+ class Duration < Stripe::RequestParams
2009
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2010
+ attr_accessor :interval
2011
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2012
+ attr_accessor :interval_count
2013
+
2014
+ def initialize(interval: nil, interval_count: nil)
2015
+ @interval = interval
2016
+ @interval_count = interval_count
2017
+ end
2018
+ end
2019
+
2020
+ class LineEndsAt < Stripe::RequestParams
2021
+ # The ID of a quote line.
2022
+ attr_accessor :id
2023
+ # The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array.
2024
+ attr_accessor :index
2025
+
2026
+ def initialize(id: nil, index: nil)
2027
+ @id = id
2028
+ @index = index
2029
+ end
2030
+ end
2031
+ # Details of the duration over which to bill.
2032
+ attr_accessor :duration
2033
+ # Details of a Quote line item from which to bill until.
2034
+ attr_accessor :line_ends_at
2035
+ # A precise Unix timestamp.
2036
+ attr_accessor :timestamp
2037
+ # The type of method to specify the `bill_until` time.
2038
+ attr_accessor :type
2039
+
2040
+ def initialize(duration: nil, line_ends_at: nil, timestamp: nil, type: nil)
2041
+ @duration = duration
2042
+ @line_ends_at = line_ends_at
2043
+ @timestamp = timestamp
2044
+ @type = type
2045
+ end
2046
+ end
2047
+ # The start of the period to bill from when the Quote is accepted.
2048
+ attr_accessor :bill_from
2049
+ # The end of the period to bill until when the Quote is accepted.
2050
+ attr_accessor :bill_until
2051
+
2052
+ def initialize(bill_from: nil, bill_until: nil)
2053
+ @bill_from = bill_from
2054
+ @bill_until = bill_until
2055
+ end
2056
+ end
2057
+ # Whether the override applies to an existing Subscription Schedule or a new Subscription Schedule.
2058
+ attr_accessor :applies_to
2059
+ # Describes the period to bill for upon accepting the quote.
2060
+ attr_accessor :bill_on_acceptance
2061
+ # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
2062
+ attr_accessor :billing_behavior
2063
+ # The customer the Subscription Data override applies to.
2064
+ attr_accessor :customer
2065
+ # 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.
2066
+ attr_accessor :description
2067
+ # Behavior of the subscription schedule and underlying subscription when it ends.
2068
+ attr_accessor :end_behavior
2069
+ # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations). When creating a subscription, valid values are `create_prorations` or `none`.
2070
+ #
2071
+ # When updating a subscription, valid values are `create_prorations`, `none`, or `always_invoice`.
2072
+ #
2073
+ # Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
2074
+ #
2075
+ # Prorations can be disabled by passing `none`.
2076
+ attr_accessor :proration_behavior
2077
+
2078
+ def initialize(
2079
+ applies_to: nil,
2080
+ bill_on_acceptance: nil,
2081
+ billing_behavior: nil,
2082
+ customer: nil,
2083
+ description: nil,
2084
+ end_behavior: nil,
2085
+ proration_behavior: nil
2086
+ )
2087
+ @applies_to = applies_to
2088
+ @bill_on_acceptance = bill_on_acceptance
2089
+ @billing_behavior = billing_behavior
2090
+ @customer = customer
2091
+ @description = description
2092
+ @end_behavior = end_behavior
2093
+ @proration_behavior = proration_behavior
2094
+ end
2095
+ end
2096
+
2097
+ class TransferData < Stripe::RequestParams
2098
+ # The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.
2099
+ attr_accessor :amount
2100
+ # 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. There must be at least 1 line item with a recurring price to use this field.
2101
+ attr_accessor :amount_percent
2102
+ # ID of an existing, connected Stripe account.
2103
+ attr_accessor :destination
2104
+
2105
+ def initialize(amount: nil, amount_percent: nil, destination: nil)
2106
+ @amount = amount
2107
+ @amount_percent = amount_percent
2108
+ @destination = destination
2109
+ end
2110
+ end
2111
+ # Set to true to allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now.
2112
+ attr_accessor :allow_backdated_lines
2113
+ # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field.
2114
+ attr_accessor :application_fee_amount
2115
+ # 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. There must be at least 1 line item with a recurring price to use this field.
2116
+ attr_accessor :application_fee_percent
2117
+ # Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
2118
+ attr_accessor :automatic_tax
2119
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or 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`.
2120
+ attr_accessor :collection_method
2121
+ # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
2122
+ attr_accessor :customer
2123
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
2124
+ attr_accessor :default_tax_rates
2125
+ # A description that will be displayed on the quote PDF.
2126
+ attr_accessor :description
2127
+ # The discounts applied to the quote.
2128
+ attr_accessor :discounts
2129
+ # Specifies which fields in the response should be expanded.
2130
+ attr_accessor :expand
2131
+ # A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
2132
+ attr_accessor :expires_at
2133
+ # A footer that will be displayed on the quote PDF.
2134
+ attr_accessor :footer
2135
+ # A header that will be displayed on the quote PDF.
2136
+ attr_accessor :header
2137
+ # All invoices will be billed using the specified settings.
2138
+ attr_accessor :invoice_settings
2139
+ # A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost.
2140
+ attr_accessor :line_items
2141
+ # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
2142
+ attr_accessor :lines
2143
+ # 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`.
2144
+ attr_accessor :metadata
2145
+ # The account on behalf of which to charge.
2146
+ attr_accessor :on_behalf_of
2147
+ # When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
2148
+ attr_accessor :subscription_data
2149
+ # List representing overrides for `subscription_data` configurations for specific subscription schedules.
2150
+ attr_accessor :subscription_data_overrides
2151
+ # The data with which to automatically create a Transfer for each of the invoices.
2152
+ attr_accessor :transfer_data
2153
+
2154
+ def initialize(
2155
+ allow_backdated_lines: nil,
2156
+ application_fee_amount: nil,
2157
+ application_fee_percent: nil,
2158
+ automatic_tax: nil,
2159
+ collection_method: nil,
2160
+ customer: nil,
2161
+ default_tax_rates: nil,
2162
+ description: nil,
2163
+ discounts: nil,
2164
+ expand: nil,
2165
+ expires_at: nil,
2166
+ footer: nil,
2167
+ header: nil,
2168
+ invoice_settings: nil,
2169
+ line_items: nil,
2170
+ lines: nil,
2171
+ metadata: nil,
2172
+ on_behalf_of: nil,
2173
+ subscription_data: nil,
2174
+ subscription_data_overrides: nil,
2175
+ transfer_data: nil
2176
+ )
2177
+ @allow_backdated_lines = allow_backdated_lines
2178
+ @application_fee_amount = application_fee_amount
2179
+ @application_fee_percent = application_fee_percent
2180
+ @automatic_tax = automatic_tax
2181
+ @collection_method = collection_method
2182
+ @customer = customer
2183
+ @default_tax_rates = default_tax_rates
2184
+ @description = description
2185
+ @discounts = discounts
2186
+ @expand = expand
2187
+ @expires_at = expires_at
2188
+ @footer = footer
2189
+ @header = header
2190
+ @invoice_settings = invoice_settings
2191
+ @line_items = line_items
2192
+ @lines = lines
2193
+ @metadata = metadata
2194
+ @on_behalf_of = on_behalf_of
2195
+ @subscription_data = subscription_data
2196
+ @subscription_data_overrides = subscription_data_overrides
2197
+ @transfer_data = transfer_data
2198
+ end
2199
+ end
2200
+
2201
+ class AcceptParams < Stripe::RequestParams
2202
+ # Specifies which fields in the response should be expanded.
2203
+ attr_accessor :expand
2204
+
2205
+ def initialize(expand: nil)
2206
+ @expand = expand
2207
+ end
2208
+ end
2209
+
2210
+ class CancelParams < Stripe::RequestParams
2211
+ # Specifies which fields in the response should be expanded.
2212
+ attr_accessor :expand
2213
+
2214
+ def initialize(expand: nil)
2215
+ @expand = expand
2216
+ end
2217
+ end
2218
+
2219
+ class FinalizeQuoteParams < Stripe::RequestParams
2220
+ # Specifies which fields in the response should be expanded.
2221
+ attr_accessor :expand
2222
+ # A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
2223
+ attr_accessor :expires_at
2224
+
2225
+ def initialize(expand: nil, expires_at: nil)
2226
+ @expand = expand
2227
+ @expires_at = expires_at
2228
+ end
2229
+ end
2230
+
2231
+ class MarkDraftParams < Stripe::RequestParams
2232
+ # Specifies which fields in the response should be expanded.
2233
+ attr_accessor :expand
2234
+
2235
+ def initialize(expand: nil)
2236
+ @expand = expand
2237
+ end
2238
+ end
2239
+
2240
+ class MarkStaleParams < Stripe::RequestParams
2241
+ # Specifies which fields in the response should be expanded.
2242
+ attr_accessor :expand
2243
+ # Reason the Quote is being marked stale.
2244
+ attr_accessor :reason
2245
+
2246
+ def initialize(expand: nil, reason: nil)
2247
+ @expand = expand
2248
+ @reason = reason
2249
+ end
2250
+ end
2251
+
2252
+ class ReestimateParams < Stripe::RequestParams
2253
+ # Specifies which fields in the response should be expanded.
2254
+ attr_accessor :expand
2255
+
2256
+ def initialize(expand: nil)
2257
+ @expand = expand
2258
+ end
2259
+ end
2260
+
2261
+ class PdfParams < Stripe::RequestParams
2262
+ # Specifies which fields in the response should be expanded.
2263
+ attr_accessor :expand
2264
+
2265
+ def initialize(expand: nil)
2266
+ @expand = expand
2267
+ end
2268
+ end
2269
+
2270
+ class ListPreviewInvoiceLinesParams < Stripe::RequestParams
2271
+ # 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.
2272
+ attr_accessor :ending_before
2273
+ # Specifies which fields in the response should be expanded.
2274
+ attr_accessor :expand
2275
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2276
+ attr_accessor :limit
2277
+ # 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.
2278
+ attr_accessor :starting_after
2279
+
2280
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
2281
+ @ending_before = ending_before
2282
+ @expand = expand
2283
+ @limit = limit
2284
+ @starting_after = starting_after
2285
+ end
2286
+ end
2287
+
14
2288
  # Accepts the specified quote.
15
2289
  def accept(quote, params = {}, opts = {})
16
2290
  request(
@@ -54,6 +2328,39 @@ module Stripe
54
2328
  request(method: :get, path: "/v1/quotes", params: params, opts: opts, base_address: :api)
55
2329
  end
56
2330
 
2331
+ # Preview the invoice line items that would be generated by accepting the quote.
2332
+ def list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
2333
+ request(
2334
+ method: :get,
2335
+ path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
2336
+ params: params,
2337
+ opts: opts,
2338
+ base_address: :api
2339
+ )
2340
+ end
2341
+
2342
+ # Converts a stale quote to draft.
2343
+ def mark_draft(quote, params = {}, opts = {})
2344
+ request(
2345
+ method: :post,
2346
+ path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
2347
+ params: params,
2348
+ opts: opts,
2349
+ base_address: :api
2350
+ )
2351
+ end
2352
+
2353
+ # Converts a draft or open quote to stale.
2354
+ def mark_stale(quote, params = {}, opts = {})
2355
+ request(
2356
+ method: :post,
2357
+ path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
2358
+ params: params,
2359
+ opts: opts,
2360
+ base_address: :api
2361
+ )
2362
+ end
2363
+
57
2364
  # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
58
2365
  def pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
59
2366
  opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
@@ -67,6 +2374,17 @@ module Stripe
67
2374
  )
68
2375
  end
69
2376
 
2377
+ # Recompute the upcoming invoice estimate for the quote.
2378
+ def reestimate(quote, params = {}, opts = {})
2379
+ request(
2380
+ method: :post,
2381
+ path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
2382
+ params: params,
2383
+ opts: opts,
2384
+ base_address: :api
2385
+ )
2386
+ end
2387
+
70
2388
  # Retrieves the quote with the given ID.
71
2389
  def retrieve(quote, params = {}, opts = {})
72
2390
  request(