stripe 5.38.0 → 15.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (708) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +742 -0
  3. data/CONTRIBUTING.md +25 -0
  4. data/Gemfile +12 -4
  5. data/Makefile +22 -0
  6. data/OPENAPI_VERSION +1 -0
  7. data/README.md +137 -27
  8. data/Rakefile +3 -6
  9. data/VERSION +1 -1
  10. data/examples/README.md +16 -0
  11. data/examples/example_template.rb +36 -0
  12. data/examples/meter_event_stream.rb +57 -0
  13. data/examples/thinevent_webhook_handler.rb +39 -0
  14. data/{bin → exe}/stripe-console +1 -1
  15. data/justfile +43 -0
  16. data/lib/data/ca-certificates.crt +1241 -1937
  17. data/lib/stripe/api_operations/create.rb +6 -2
  18. data/lib/stripe/api_operations/delete.rb +12 -7
  19. data/lib/stripe/api_operations/list.rb +6 -9
  20. data/lib/stripe/api_operations/nested_resource.rb +59 -31
  21. data/lib/stripe/api_operations/request.rb +30 -65
  22. data/lib/stripe/api_operations/save.rb +20 -10
  23. data/lib/stripe/api_operations/search.rb +21 -0
  24. data/lib/stripe/api_operations/singleton_save.rb +90 -0
  25. data/lib/stripe/api_requestor.rb +1136 -0
  26. data/lib/stripe/api_resource.rb +49 -34
  27. data/lib/stripe/api_resource_test_helpers.rb +53 -0
  28. data/lib/stripe/{resources/usage_record.rb → api_version.rb} +2 -2
  29. data/lib/stripe/connection_manager.rb +28 -11
  30. data/lib/stripe/errors.rb +11 -20
  31. data/lib/stripe/event_types.rb +15 -0
  32. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +23 -0
  33. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +13 -0
  34. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +21 -0
  35. data/lib/stripe/instrumentation.rb +37 -15
  36. data/lib/stripe/list_object.rb +5 -3
  37. data/lib/stripe/multipart_encoder.rb +7 -7
  38. data/lib/stripe/oauth.rb +14 -21
  39. data/lib/stripe/object_types.rb +157 -91
  40. data/lib/stripe/request_options.rb +129 -0
  41. data/lib/stripe/request_params.rb +24 -0
  42. data/lib/stripe/resources/account.rb +4854 -30
  43. data/lib/stripe/resources/account_link.rb +66 -0
  44. data/lib/stripe/resources/account_session.rb +868 -0
  45. data/lib/stripe/resources/alipay_account.rb +1 -1
  46. data/lib/stripe/resources/apple_pay_domain.rb +91 -0
  47. data/lib/stripe/resources/application.rb +20 -0
  48. data/lib/stripe/resources/application_fee.rb +96 -2
  49. data/lib/stripe/resources/application_fee_refund.rb +26 -2
  50. data/lib/stripe/resources/apps/secret.rb +196 -0
  51. data/lib/stripe/resources/balance.rb +178 -0
  52. data/lib/stripe/resources/balance_transaction.rb +124 -0
  53. data/lib/stripe/resources/bank_account.rb +137 -6
  54. data/lib/stripe/resources/billing/alert.rb +222 -0
  55. data/lib/stripe/resources/billing/alert_triggered.rb +26 -0
  56. data/lib/stripe/resources/billing/credit_balance_summary.rb +54 -0
  57. data/lib/stripe/resources/billing/credit_balance_transaction.rb +133 -0
  58. data/lib/stripe/resources/billing/credit_grant.rb +307 -0
  59. data/lib/stripe/resources/billing/meter.rb +254 -0
  60. data/lib/stripe/resources/billing/meter_event.rb +61 -0
  61. data/lib/stripe/resources/billing/meter_event_adjustment.rb +69 -0
  62. data/lib/stripe/resources/billing/meter_event_summary.rb +32 -0
  63. data/lib/stripe/resources/billing_portal/configuration.rb +587 -0
  64. data/lib/stripe/resources/billing_portal/session.rb +298 -0
  65. data/lib/stripe/resources/capability.rb +91 -2
  66. data/lib/stripe/resources/card.rb +111 -3
  67. data/lib/stripe/resources/cash_balance.rb +43 -0
  68. data/lib/stripe/resources/charge.rb +1682 -2
  69. data/lib/stripe/resources/checkout/session.rb +3666 -2
  70. data/lib/stripe/resources/climate/order.rb +234 -0
  71. data/lib/stripe/resources/climate/product.rb +74 -0
  72. data/lib/stripe/resources/climate/supplier.rb +71 -0
  73. data/lib/stripe/resources/confirmation_token.rb +1498 -0
  74. data/lib/stripe/resources/connect_collection_transfer.rb +24 -0
  75. data/lib/stripe/resources/country_spec.rb +68 -0
  76. data/lib/stripe/resources/coupon.rb +236 -0
  77. data/lib/stripe/resources/credit_note.rb +709 -9
  78. data/lib/stripe/resources/credit_note_line_item.rb +71 -0
  79. data/lib/stripe/resources/customer.rb +1015 -16
  80. data/lib/stripe/resources/customer_balance_transaction.rb +38 -1
  81. data/lib/stripe/resources/customer_cash_balance_transaction.rb +124 -0
  82. data/lib/stripe/resources/customer_session.rb +188 -0
  83. data/lib/stripe/resources/discount.rb +37 -0
  84. data/lib/stripe/resources/dispute.rb +650 -2
  85. data/lib/stripe/resources/entitlements/active_entitlement.rb +63 -0
  86. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +23 -0
  87. data/lib/stripe/resources/entitlements/feature.rb +130 -0
  88. data/lib/stripe/resources/ephemeral_key.rb +44 -0
  89. data/lib/stripe/resources/event.rb +130 -0
  90. data/lib/stripe/resources/exchange_rate.rb +58 -0
  91. data/lib/stripe/resources/file.rb +139 -15
  92. data/lib/stripe/resources/file_link.rb +129 -0
  93. data/lib/stripe/resources/financial_connections/account.rb +363 -0
  94. data/lib/stripe/resources/financial_connections/account_owner.rb +31 -0
  95. data/lib/stripe/resources/financial_connections/account_ownership.rb +23 -0
  96. data/lib/stripe/resources/financial_connections/session.rb +121 -0
  97. data/lib/stripe/resources/financial_connections/transaction.rb +118 -0
  98. data/lib/stripe/resources/forwarding/request.rb +208 -0
  99. data/lib/stripe/resources/funding_instructions.rb +332 -0
  100. data/lib/stripe/resources/identity/verification_report.rb +287 -0
  101. data/lib/stripe/resources/identity/verification_session.rb +474 -4
  102. data/lib/stripe/resources/invoice.rb +3525 -17
  103. data/lib/stripe/resources/invoice_item.rb +453 -0
  104. data/lib/stripe/resources/invoice_line_item.rb +372 -1
  105. data/lib/stripe/resources/invoice_payment.rb +112 -0
  106. data/lib/stripe/resources/invoice_rendering_template.rb +120 -0
  107. data/lib/stripe/resources/issuing/authorization.rb +1313 -4
  108. data/lib/stripe/resources/issuing/card.rb +785 -4
  109. data/lib/stripe/resources/issuing/cardholder.rb +684 -0
  110. data/lib/stripe/resources/issuing/dispute.rb +828 -2
  111. data/lib/stripe/resources/issuing/personalization_design.rb +395 -0
  112. data/lib/stripe/resources/issuing/physical_bundle.rb +80 -0
  113. data/lib/stripe/resources/issuing/token.rb +198 -0
  114. data/lib/stripe/resources/issuing/transaction.rb +991 -0
  115. data/lib/stripe/resources/line_item.rb +51 -0
  116. data/lib/stripe/resources/login_link.rb +12 -0
  117. data/lib/stripe/resources/mandate.rb +146 -0
  118. data/lib/stripe/resources/payment_intent.rb +8876 -6
  119. data/lib/stripe/resources/payment_link.rb +1692 -0
  120. data/lib/stripe/resources/payment_method.rb +1570 -4
  121. data/lib/stripe/resources/payment_method_configuration.rb +3189 -0
  122. data/lib/stripe/resources/payment_method_domain.rb +236 -0
  123. data/lib/stripe/resources/payout.rb +271 -4
  124. data/lib/stripe/resources/person.rb +295 -1
  125. data/lib/stripe/resources/plan.rb +352 -0
  126. data/lib/stripe/resources/price.rb +642 -0
  127. data/lib/stripe/resources/product.rb +534 -0
  128. data/lib/stripe/resources/product_feature.rb +25 -0
  129. data/lib/stripe/resources/promotion_code.rb +237 -0
  130. data/lib/stripe/resources/quote.rb +1015 -38
  131. data/lib/stripe/resources/radar/early_fraud_warning.rb +85 -0
  132. data/lib/stripe/resources/radar/value_list.rb +171 -0
  133. data/lib/stripe/resources/radar/value_list_item.rb +131 -0
  134. data/lib/stripe/resources/refund.rb +494 -0
  135. data/lib/stripe/resources/reporting/report_run.rb +172 -0
  136. data/lib/stripe/resources/reporting/report_type.rb +48 -1
  137. data/lib/stripe/resources/reserve_transaction.rb +22 -0
  138. data/lib/stripe/resources/reversal.rb +38 -2
  139. data/lib/stripe/resources/review.rb +122 -2
  140. data/lib/stripe/resources/setup_attempt.rb +380 -0
  141. data/lib/stripe/resources/setup_intent.rb +3432 -4
  142. data/lib/stripe/resources/shipping_rate.rb +287 -0
  143. data/lib/stripe/resources/sigma/scheduled_query_run.rb +62 -0
  144. data/lib/stripe/resources/source.rb +1250 -10
  145. data/lib/stripe/resources/source_mandate_notification.rb +66 -0
  146. data/lib/stripe/resources/source_transaction.rb +93 -0
  147. data/lib/stripe/resources/subscription.rb +1871 -3
  148. data/lib/stripe/resources/subscription_item.rb +399 -10
  149. data/lib/stripe/resources/subscription_schedule.rb +1455 -4
  150. data/lib/stripe/resources/tax/calculation.rb +430 -0
  151. data/lib/stripe/resources/tax/calculation_line_item.rb +71 -0
  152. data/lib/stripe/resources/tax/registration.rb +2667 -0
  153. data/lib/stripe/resources/tax/settings.rb +134 -0
  154. data/lib/stripe/resources/tax/transaction.rb +314 -0
  155. data/lib/stripe/resources/tax/transaction_line_item.rb +44 -0
  156. data/lib/stripe/resources/tax_code.rb +35 -0
  157. data/lib/stripe/resources/tax_deducted_at_source.rb +22 -0
  158. data/lib/stripe/resources/tax_id.rb +144 -11
  159. data/lib/stripe/resources/tax_rate.rb +217 -0
  160. data/lib/stripe/resources/terminal/configuration.rb +1328 -0
  161. data/lib/stripe/resources/terminal/connection_token.rb +34 -0
  162. data/lib/stripe/resources/terminal/location.rb +222 -0
  163. data/lib/stripe/resources/terminal/reader.rb +886 -0
  164. data/lib/stripe/resources/test_helpers/test_clock.rb +156 -0
  165. data/lib/stripe/resources/token.rb +1249 -0
  166. data/lib/stripe/resources/topup.rb +204 -2
  167. data/lib/stripe/resources/transfer.rb +173 -6
  168. data/lib/stripe/resources/treasury/credit_reversal.rb +120 -0
  169. data/lib/stripe/resources/treasury/debit_reversal.rb +131 -0
  170. data/lib/stripe/resources/treasury/financial_account.rb +833 -0
  171. data/lib/stripe/resources/treasury/financial_account_features.rb +204 -0
  172. data/lib/stripe/resources/treasury/inbound_transfer.rb +356 -0
  173. data/lib/stripe/resources/treasury/outbound_payment.rb +638 -0
  174. data/lib/stripe/resources/treasury/outbound_transfer.rb +493 -0
  175. data/lib/stripe/resources/treasury/received_credit.rb +284 -0
  176. data/lib/stripe/resources/treasury/received_debit.rb +243 -0
  177. data/lib/stripe/resources/treasury/transaction.rb +193 -0
  178. data/lib/stripe/resources/treasury/transaction_entry.rb +178 -0
  179. data/lib/stripe/resources/v2/amount.rb +9 -0
  180. data/lib/stripe/resources/v2/billing/meter_event.rb +34 -0
  181. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +36 -0
  182. data/lib/stripe/resources/v2/billing/meter_event_session.rb +29 -0
  183. data/lib/stripe/resources/v2/event.rb +41 -0
  184. data/lib/stripe/resources/v2/event_destination.rb +73 -0
  185. data/lib/stripe/resources/webhook_endpoint.rb +167 -0
  186. data/lib/stripe/resources.rb +70 -12
  187. data/lib/stripe/search_result_object.rb +89 -0
  188. data/lib/stripe/services/account_capability_service.rb +71 -0
  189. data/lib/stripe/services/account_external_account_service.rb +317 -0
  190. data/lib/stripe/services/account_link_service.rb +63 -0
  191. data/lib/stripe/services/account_login_link_service.rb +28 -0
  192. data/lib/stripe/services/account_person_service.rb +1019 -0
  193. data/lib/stripe/services/account_service.rb +4171 -0
  194. data/lib/stripe/services/account_session_service.rb +569 -0
  195. data/lib/stripe/services/apple_pay_domain_service.rb +100 -0
  196. data/lib/stripe/services/application_fee_refund_service.rb +114 -0
  197. data/lib/stripe/services/application_fee_service.rb +92 -0
  198. data/lib/stripe/services/apps/secret_service.rb +168 -0
  199. data/lib/stripe/services/apps_service.rb +13 -0
  200. data/lib/stripe/services/balance_service.rb +21 -0
  201. data/lib/stripe/services/balance_transaction_service.rb +101 -0
  202. data/lib/stripe/services/billing/alert_service.rb +187 -0
  203. data/lib/stripe/services/billing/credit_balance_summary_service.rb +67 -0
  204. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +70 -0
  205. data/lib/stripe/services/billing/credit_grant_service.rb +240 -0
  206. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +45 -0
  207. data/lib/stripe/services/billing/meter_event_service.rb +40 -0
  208. data/lib/stripe/services/billing/meter_event_summary_service.rb +58 -0
  209. data/lib/stripe/services/billing/meter_service.rb +211 -0
  210. data/lib/stripe/services/billing_portal/configuration_service.rb +496 -0
  211. data/lib/stripe/services/billing_portal/session_service.rb +192 -0
  212. data/lib/stripe/services/billing_portal_service.rb +14 -0
  213. data/lib/stripe/services/billing_service.rb +20 -0
  214. data/lib/stripe/services/charge_service.rb +471 -0
  215. data/lib/stripe/services/checkout/session_line_item_service.rb +37 -0
  216. data/lib/stripe/services/checkout/session_service.rb +2495 -0
  217. data/lib/stripe/services/checkout_service.rb +13 -0
  218. data/lib/stripe/services/climate/order_service.rb +170 -0
  219. data/lib/stripe/services/climate/product_service.rb +57 -0
  220. data/lib/stripe/services/climate/supplier_service.rb +57 -0
  221. data/lib/stripe/services/climate_service.rb +15 -0
  222. data/lib/stripe/services/confirmation_token_service.rb +26 -0
  223. data/lib/stripe/services/country_spec_service.rb +55 -0
  224. data/lib/stripe/services/coupon_service.rb +202 -0
  225. data/lib/stripe/services/credit_note_line_item_service.rb +35 -0
  226. data/lib/stripe/services/credit_note_preview_lines_service.rb +169 -0
  227. data/lib/stripe/services/credit_note_service.rb +457 -0
  228. data/lib/stripe/services/customer_balance_transaction_service.rb +113 -0
  229. data/lib/stripe/services/customer_cash_balance_service.rb +57 -0
  230. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +55 -0
  231. data/lib/stripe/services/customer_funding_instructions_service.rb +61 -0
  232. data/lib/stripe/services/customer_payment_method_service.rb +68 -0
  233. data/lib/stripe/services/customer_payment_source_service.rb +255 -0
  234. data/lib/stripe/services/customer_service.rb +664 -0
  235. data/lib/stripe/services/customer_session_service.rb +113 -0
  236. data/lib/stripe/services/customer_tax_id_service.rb +94 -0
  237. data/lib/stripe/services/dispute_service.rb +422 -0
  238. data/lib/stripe/services/entitlements/active_entitlement_service.rb +66 -0
  239. data/lib/stripe/services/entitlements/feature_service.rb +128 -0
  240. data/lib/stripe/services/entitlements_service.rb +14 -0
  241. data/lib/stripe/services/ephemeral_key_service.rb +64 -0
  242. data/lib/stripe/services/event_service.rb +87 -0
  243. data/lib/stripe/services/exchange_rate_service.rb +55 -0
  244. data/lib/stripe/services/file_link_service.rb +132 -0
  245. data/lib/stripe/services/file_service.rb +124 -0
  246. data/lib/stripe/services/financial_connections/account_owner_service.rb +46 -0
  247. data/lib/stripe/services/financial_connections/account_service.rb +177 -0
  248. data/lib/stripe/services/financial_connections/session_service.rb +98 -0
  249. data/lib/stripe/services/financial_connections/transaction_service.rb +100 -0
  250. data/lib/stripe/services/financial_connections_service.rb +15 -0
  251. data/lib/stripe/services/forwarding/request_service.rb +147 -0
  252. data/lib/stripe/services/forwarding_service.rb +13 -0
  253. data/lib/stripe/services/identity/verification_report_service.rb +95 -0
  254. data/lib/stripe/services/identity/verification_session_service.rb +337 -0
  255. data/lib/stripe/services/identity_service.rb +14 -0
  256. data/lib/stripe/services/invoice_item_service.rb +394 -0
  257. data/lib/stripe/services/invoice_line_item_service.rb +252 -0
  258. data/lib/stripe/services/invoice_payment_service.rb +83 -0
  259. data/lib/stripe/services/invoice_rendering_template_service.rb +101 -0
  260. data/lib/stripe/services/invoice_service.rb +2900 -0
  261. data/lib/stripe/services/issuing/authorization_service.rb +169 -0
  262. data/lib/stripe/services/issuing/card_service.rb +507 -0
  263. data/lib/stripe/services/issuing/cardholder_service.rb +577 -0
  264. data/lib/stripe/services/issuing/dispute_service.rb +696 -0
  265. data/lib/stripe/services/issuing/personalization_design_service.rb +245 -0
  266. data/lib/stripe/services/issuing/physical_bundle_service.rb +70 -0
  267. data/lib/stripe/services/issuing/token_service.rb +114 -0
  268. data/lib/stripe/services/issuing/transaction_service.rb +118 -0
  269. data/lib/stripe/services/issuing_service.rb +20 -0
  270. data/lib/stripe/services/mandate_service.rb +26 -0
  271. data/lib/stripe/services/oauth_service.rb +63 -0
  272. data/lib/stripe/services/payment_intent_service.rb +7202 -0
  273. data/lib/stripe/services/payment_link_line_item_service.rb +35 -0
  274. data/lib/stripe/services/payment_link_service.rb +1333 -0
  275. data/lib/stripe/services/payment_method_configuration_service.rb +2306 -0
  276. data/lib/stripe/services/payment_method_domain_service.rb +142 -0
  277. data/lib/stripe/services/payment_method_service.rb +843 -0
  278. data/lib/stripe/services/payout_service.rb +225 -0
  279. data/lib/stripe/services/plan_service.rb +297 -0
  280. data/lib/stripe/services/price_service.rb +545 -0
  281. data/lib/stripe/services/product_feature_service.rb +91 -0
  282. data/lib/stripe/services/product_service.rb +494 -0
  283. data/lib/stripe/services/promotion_code_service.rb +228 -0
  284. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +35 -0
  285. data/lib/stripe/services/quote_line_item_service.rb +35 -0
  286. data/lib/stripe/services/quote_service.rb +703 -0
  287. data/lib/stripe/services/radar/early_fraud_warning_service.rb +93 -0
  288. data/lib/stripe/services/radar/value_list_item_service.rb +130 -0
  289. data/lib/stripe/services/radar/value_list_service.rb +165 -0
  290. data/lib/stripe/services/radar_service.rb +15 -0
  291. data/lib/stripe/services/refund_service.rb +200 -0
  292. data/lib/stripe/services/reporting/report_run_service.rb +147 -0
  293. data/lib/stripe/services/reporting/report_type_service.rb +48 -0
  294. data/lib/stripe/services/reporting_service.rb +14 -0
  295. data/lib/stripe/services/review_service.rb +89 -0
  296. data/lib/stripe/services/setup_attempt_service.rb +68 -0
  297. data/lib/stripe/services/setup_intent_service.rb +3107 -0
  298. data/lib/stripe/services/shipping_rate_service.rb +250 -0
  299. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +57 -0
  300. data/lib/stripe/services/sigma_service.rb +13 -0
  301. data/lib/stripe/services/source_service.rb +665 -0
  302. data/lib/stripe/services/source_transaction_service.rb +35 -0
  303. data/lib/stripe/services/subscription_item_service.rb +372 -0
  304. data/lib/stripe/services/subscription_schedule_service.rb +1224 -0
  305. data/lib/stripe/services/subscription_service.rb +1590 -0
  306. data/lib/stripe/services/tax/calculation_line_item_service.rb +37 -0
  307. data/lib/stripe/services/tax/calculation_service.rb +246 -0
  308. data/lib/stripe/services/tax/registration_service.rb +1774 -0
  309. data/lib/stripe/services/tax/settings_service.rb +104 -0
  310. data/lib/stripe/services/tax/transaction_line_item_service.rb +37 -0
  311. data/lib/stripe/services/tax/transaction_service.rb +159 -0
  312. data/lib/stripe/services/tax_code_service.rb +49 -0
  313. data/lib/stripe/services/tax_id_service.rb +116 -0
  314. data/lib/stripe/services/tax_rate_service.rb +193 -0
  315. data/lib/stripe/services/tax_service.rb +16 -0
  316. data/lib/stripe/services/terminal/configuration_service.rb +1059 -0
  317. data/lib/stripe/services/terminal/connection_token_service.rb +31 -0
  318. data/lib/stripe/services/terminal/location_service.rb +207 -0
  319. data/lib/stripe/services/terminal/reader_service.rb +488 -0
  320. data/lib/stripe/services/terminal_service.rb +16 -0
  321. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +655 -0
  322. data/lib/stripe/services/test_helpers/customer_service.rb +37 -0
  323. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +832 -0
  324. data/lib/stripe/services/test_helpers/issuing/card_service.rb +110 -0
  325. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +84 -0
  326. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +675 -0
  327. data/lib/stripe/services/test_helpers/issuing_service.rb +19 -0
  328. data/lib/stripe/services/test_helpers/refund_service.rb +28 -0
  329. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +108 -0
  330. data/lib/stripe/services/test_helpers/terminal_service.rb +15 -0
  331. data/lib/stripe/services/test_helpers/test_clock_service.rb +119 -0
  332. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +81 -0
  333. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +141 -0
  334. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +141 -0
  335. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +81 -0
  336. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +81 -0
  337. data/lib/stripe/services/test_helpers/treasury_service.rb +19 -0
  338. data/lib/stripe/services/test_helpers_service.rb +19 -0
  339. data/lib/stripe/services/token_service.rb +1224 -0
  340. data/lib/stripe/services/topup_service.rb +191 -0
  341. data/lib/stripe/services/transfer_reversal_service.rb +122 -0
  342. data/lib/stripe/services/transfer_service.rb +166 -0
  343. data/lib/stripe/services/treasury/credit_reversal_service.rb +100 -0
  344. data/lib/stripe/services/treasury/debit_reversal_service.rb +104 -0
  345. data/lib/stripe/services/treasury/financial_account_features_service.rb +196 -0
  346. data/lib/stripe/services/treasury/financial_account_service.rb +554 -0
  347. data/lib/stripe/services/treasury/inbound_transfer_service.rb +140 -0
  348. data/lib/stripe/services/treasury/outbound_payment_service.rb +310 -0
  349. data/lib/stripe/services/treasury/outbound_transfer_service.rb +176 -0
  350. data/lib/stripe/services/treasury/received_credit_service.rb +82 -0
  351. data/lib/stripe/services/treasury/received_debit_service.rb +70 -0
  352. data/lib/stripe/services/treasury/transaction_entry_service.rb +117 -0
  353. data/lib/stripe/services/treasury/transaction_service.rb +125 -0
  354. data/lib/stripe/services/treasury_service.rb +22 -0
  355. data/lib/stripe/services/v1_services.rb +90 -0
  356. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +44 -0
  357. data/lib/stripe/services/v2/billing/meter_event_service.rb +46 -0
  358. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +23 -0
  359. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +56 -0
  360. data/lib/stripe/services/v2/billing_service.rb +18 -0
  361. data/lib/stripe/services/v2/core/event_destination_service.rb +235 -0
  362. data/lib/stripe/services/v2/core/event_service.rb +48 -0
  363. data/lib/stripe/services/v2/core_service.rb +16 -0
  364. data/lib/stripe/services/v2_services.rb +14 -0
  365. data/lib/stripe/services/webhook_endpoint_service.rb +156 -0
  366. data/lib/stripe/services.rb +180 -0
  367. data/lib/stripe/singleton_api_resource.rb +3 -3
  368. data/lib/stripe/stripe_client.rb +56 -1021
  369. data/lib/stripe/stripe_configuration.rb +63 -42
  370. data/lib/stripe/stripe_object.rb +75 -39
  371. data/lib/stripe/stripe_response.rb +1 -3
  372. data/lib/stripe/stripe_service.rb +32 -0
  373. data/lib/stripe/thin_event.rb +37 -0
  374. data/lib/stripe/util.rb +161 -39
  375. data/lib/stripe/v2_list_object.rb +84 -0
  376. data/lib/stripe/version.rb +1 -1
  377. data/lib/stripe/webhook.rb +3 -2
  378. data/lib/stripe.rb +44 -1
  379. data/rbi/stripe/resources/account.rbi +4926 -0
  380. data/rbi/stripe/resources/account_link.rbi +74 -0
  381. data/rbi/stripe/resources/account_session.rbi +1013 -0
  382. data/rbi/stripe/resources/apple_pay_domain.rbi +88 -0
  383. data/rbi/stripe/resources/application.rbi +20 -0
  384. data/rbi/stripe/resources/application_fee.rbi +118 -0
  385. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  386. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  387. data/rbi/stripe/resources/balance.rbi +235 -0
  388. data/rbi/stripe/resources/balance_transaction.rbi +147 -0
  389. data/rbi/stripe/resources/bank_account.rbi +127 -0
  390. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  391. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  392. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  393. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  394. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  395. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  396. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  397. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  398. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  399. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  400. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  401. data/rbi/stripe/resources/capability.rbi +125 -0
  402. data/rbi/stripe/resources/card.rbi +125 -0
  403. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  404. data/rbi/stripe/resources/charge.rbi +2069 -0
  405. data/rbi/stripe/resources/checkout/session.rbi +4004 -0
  406. data/rbi/stripe/resources/climate/order.rbi +245 -0
  407. data/rbi/stripe/resources/climate/product.rbi +75 -0
  408. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  409. data/rbi/stripe/resources/confirmation_token.rbi +1807 -0
  410. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  411. data/rbi/stripe/resources/country_spec.rbi +85 -0
  412. data/rbi/stripe/resources/coupon.rbi +250 -0
  413. data/rbi/stripe/resources/credit_note.rbi +752 -0
  414. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  415. data/rbi/stripe/resources/customer.rbi +1005 -0
  416. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  417. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  418. data/rbi/stripe/resources/customer_session.rbi +200 -0
  419. data/rbi/stripe/resources/discount.rbi +53 -0
  420. data/rbi/stripe/resources/dispute.rbi +761 -0
  421. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  422. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  423. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  424. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  425. data/rbi/stripe/resources/event.rbi +149 -0
  426. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  427. data/rbi/stripe/resources/file.rbi +143 -0
  428. data/rbi/stripe/resources/file_link.rbi +141 -0
  429. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  430. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  431. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  432. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  433. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  434. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  435. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  436. data/rbi/stripe/resources/identity/verification_report.rbi +360 -0
  437. data/rbi/stripe/resources/identity/verification_session.rbi +526 -0
  438. data/rbi/stripe/resources/invoice.rbi +3812 -0
  439. data/rbi/stripe/resources/invoice_item.rbi +473 -0
  440. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  441. data/rbi/stripe/resources/invoice_payment.rbi +121 -0
  442. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  443. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  444. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  445. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  446. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  447. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  448. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  449. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  450. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  451. data/rbi/stripe/resources/line_item.rbi +72 -0
  452. data/rbi/stripe/resources/login_link.rbi +19 -0
  453. data/rbi/stripe/resources/mandate.rbi +187 -0
  454. data/rbi/stripe/resources/payment_intent.rbi +9647 -0
  455. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  456. data/rbi/stripe/resources/payment_method.rbi +1761 -0
  457. data/rbi/stripe/resources/payment_method_configuration.rbi +3550 -0
  458. data/rbi/stripe/resources/payment_method_domain.rbi +228 -0
  459. data/rbi/stripe/resources/payout.rbi +300 -0
  460. data/rbi/stripe/resources/person.rbi +401 -0
  461. data/rbi/stripe/resources/plan.rbi +371 -0
  462. data/rbi/stripe/resources/price.rbi +694 -0
  463. data/rbi/stripe/resources/product.rbi +555 -0
  464. data/rbi/stripe/resources/product_feature.rbi +26 -0
  465. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  466. data/rbi/stripe/resources/quote.rbi +1126 -0
  467. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  468. data/rbi/stripe/resources/radar/value_list.rbi +168 -0
  469. data/rbi/stripe/resources/radar/value_list_item.rbi +129 -0
  470. data/rbi/stripe/resources/refund.rbi +523 -0
  471. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  472. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  473. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  474. data/rbi/stripe/resources/reversal.rbi +51 -0
  475. data/rbi/stripe/resources/review.rbi +154 -0
  476. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  477. data/rbi/stripe/resources/setup_intent.rbi +3655 -0
  478. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  479. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  480. data/rbi/stripe/resources/source.rbi +1496 -0
  481. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  482. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  483. data/rbi/stripe/resources/subscription.rbi +2027 -0
  484. data/rbi/stripe/resources/subscription_item.rbi +404 -0
  485. data/rbi/stripe/resources/subscription_schedule.rbi +1623 -0
  486. data/rbi/stripe/resources/tax/calculation.rbi +478 -0
  487. data/rbi/stripe/resources/tax/calculation_line_item.rbi +91 -0
  488. data/rbi/stripe/resources/tax/registration.rbi +2713 -0
  489. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  490. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  491. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  492. data/rbi/stripe/resources/tax_code.rbi +44 -0
  493. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  494. data/rbi/stripe/resources/tax_id.rbi +165 -0
  495. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  496. data/rbi/stripe/resources/terminal/configuration.rbi +1386 -0
  497. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  498. data/rbi/stripe/resources/terminal/location.rbi +222 -0
  499. data/rbi/stripe/resources/terminal/reader.rbi +847 -0
  500. data/rbi/stripe/resources/test_helpers/test_clock.rbi +132 -0
  501. data/rbi/stripe/resources/token.rbi +1283 -0
  502. data/rbi/stripe/resources/topup.rbi +222 -0
  503. data/rbi/stripe/resources/transfer.rbi +199 -0
  504. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  505. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  506. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  507. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  508. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  509. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  510. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  511. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  512. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  513. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  514. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  515. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  516. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  517. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  518. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  519. data/rbi/stripe/resources/v2/event.rbi +48 -0
  520. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  521. data/rbi/stripe/resources/webhook_endpoint.rbi +168 -0
  522. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  523. data/rbi/stripe/services/account_external_account_service.rbi +304 -0
  524. data/rbi/stripe/services/account_link_service.rbi +58 -0
  525. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  526. data/rbi/stripe/services/account_person_service.rbi +1011 -0
  527. data/rbi/stripe/services/account_service.rbi +4213 -0
  528. data/rbi/stripe/services/account_session_service.rbi +646 -0
  529. data/rbi/stripe/services/apple_pay_domain_service.rbi +76 -0
  530. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  531. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  532. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  533. data/{lib/stripe/resources/usage_record_summary.rb → rbi/stripe/services/apps_service.rbi} +4 -3
  534. data/rbi/stripe/services/balance_service.rbi +21 -0
  535. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  536. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  537. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  538. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  539. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  540. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  541. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  542. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  543. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  544. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  545. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  546. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  547. data/rbi/stripe/services/billing_service.rbi +15 -0
  548. data/rbi/stripe/services/charge_service.rbi +448 -0
  549. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  550. data/rbi/stripe/services/checkout/session_service.rbi +2614 -0
  551. data/rbi/stripe/services/checkout_service.rbi +9 -0
  552. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  553. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  554. data/rbi/stripe/services/climate/supplier_service.rbi +46 -0
  555. data/rbi/stripe/services/climate_service.rbi +11 -0
  556. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  557. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  558. data/rbi/stripe/services/coupon_service.rbi +194 -0
  559. data/rbi/stripe/services/credit_note_line_item_service.rbi +31 -0
  560. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  561. data/rbi/stripe/services/credit_note_service.rbi +415 -0
  562. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  563. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  564. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  565. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  566. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  567. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  568. data/rbi/stripe/services/customer_service.rbi +647 -0
  569. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  570. data/rbi/stripe/services/customer_tax_id_service.rbi +70 -0
  571. data/rbi/stripe/services/dispute_service.rbi +424 -0
  572. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  573. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  574. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  575. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  576. data/rbi/stripe/services/event_service.rbi +83 -0
  577. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  578. data/rbi/stripe/services/file_link_service.rbi +124 -0
  579. data/rbi/stripe/services/file_service.rbi +116 -0
  580. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  581. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  582. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  583. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  584. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  585. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  586. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  587. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  588. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  589. data/rbi/stripe/services/identity_service.rbi +10 -0
  590. data/rbi/stripe/services/invoice_item_service.rbi +366 -0
  591. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  592. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  593. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  594. data/rbi/stripe/services/invoice_service.rbi +2981 -0
  595. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  596. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  597. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  598. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  599. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  600. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  601. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  602. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  603. data/rbi/stripe/services/issuing_service.rbi +16 -0
  604. data/rbi/stripe/services/mandate_service.rbi +20 -0
  605. data/rbi/stripe/services/payment_intent_service.rbi +7659 -0
  606. data/rbi/stripe/services/payment_link_line_item_service.rbi +31 -0
  607. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  608. data/rbi/stripe/services/payment_method_configuration_service.rbi +2487 -0
  609. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  610. data/rbi/stripe/services/payment_method_service.rbi +776 -0
  611. data/rbi/stripe/services/payout_service.rbi +205 -0
  612. data/rbi/stripe/services/plan_service.rbi +282 -0
  613. data/rbi/stripe/services/price_service.rbi +546 -0
  614. data/rbi/stripe/services/product_feature_service.rbi +67 -0
  615. data/rbi/stripe/services/product_service.rbi +477 -0
  616. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  617. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  618. data/rbi/stripe/services/quote_line_item_service.rbi +31 -0
  619. data/rbi/stripe/services/quote_service.rbi +686 -0
  620. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  621. data/rbi/stripe/services/radar/value_list_item_service.rbi +109 -0
  622. data/rbi/stripe/services/radar/value_list_service.rbi +141 -0
  623. data/rbi/stripe/services/radar_service.rbi +11 -0
  624. data/rbi/stripe/services/refund_service.rbi +185 -0
  625. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  626. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  627. data/rbi/stripe/services/reporting_service.rbi +10 -0
  628. data/rbi/stripe/services/review_service.rbi +84 -0
  629. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  630. data/rbi/stripe/services/setup_intent_service.rbi +3391 -0
  631. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  632. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  633. data/rbi/stripe/services/sigma_service.rbi +9 -0
  634. data/rbi/stripe/services/source_service.rbi +663 -0
  635. data/rbi/stripe/services/source_transaction_service.rbi +31 -0
  636. data/rbi/stripe/services/subscription_item_service.rbi +350 -0
  637. data/rbi/stripe/services/subscription_schedule_service.rbi +1290 -0
  638. data/rbi/stripe/services/subscription_service.rbi +1648 -0
  639. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  640. data/rbi/stripe/services/tax/calculation_service.rbi +234 -0
  641. data/rbi/stripe/services/tax/registration_service.rbi +1845 -0
  642. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  643. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +33 -0
  644. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  645. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  646. data/rbi/stripe/services/tax_id_service.rbi +110 -0
  647. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  648. data/rbi/stripe/services/tax_service.rbi +12 -0
  649. data/rbi/stripe/services/terminal/configuration_service.rbi +1118 -0
  650. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  651. data/rbi/stripe/services/terminal/location_service.rbi +182 -0
  652. data/rbi/stripe/services/terminal/reader_service.rbi +455 -0
  653. data/rbi/stripe/services/terminal_service.rbi +12 -0
  654. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +739 -0
  655. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  656. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  657. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  658. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  659. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  660. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  661. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  662. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +93 -0
  663. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  664. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +90 -0
  665. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  666. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  667. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  668. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  669. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  670. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  671. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  672. data/rbi/stripe/services/token_service.rbi +1257 -0
  673. data/rbi/stripe/services/topup_service.rbi +176 -0
  674. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  675. data/rbi/stripe/services/transfer_service.rbi +152 -0
  676. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  677. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  678. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  679. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  680. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  681. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  682. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  683. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  684. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  685. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  686. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  687. data/rbi/stripe/services/treasury_service.rbi +18 -0
  688. data/rbi/stripe/services/v1_services.rbi +77 -0
  689. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  690. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  691. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +18 -0
  692. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  693. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  694. data/rbi/stripe/services/v2/core/event_destination_service.rbi +192 -0
  695. data/rbi/stripe/services/v2/core/event_service.rbi +36 -0
  696. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  697. data/rbi/stripe/services/v2_services.rbi +10 -0
  698. data/rbi/stripe/services/webhook_endpoint_service.rbi +129 -0
  699. data/stripe.gemspec +10 -7
  700. metadata +599 -18
  701. data/lib/stripe/resources/bitcoin_receiver.rb +0 -24
  702. data/lib/stripe/resources/bitcoin_transaction.rb +0 -16
  703. data/lib/stripe/resources/issuing/card_details.rb +0 -9
  704. data/lib/stripe/resources/order.rb +0 -33
  705. data/lib/stripe/resources/order_return.rb +0 -10
  706. data/lib/stripe/resources/recipient.rb +0 -14
  707. data/lib/stripe/resources/sku.rb +0 -13
  708. data/lib/stripe/resources/three_d_secure.rb +0 -14
@@ -2,104 +2,1081 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Stripe
5
+ # A Quote is a way to model prices that you'd like to provide to a customer.
6
+ # Once accepted, it will automatically create an invoice, subscription or subscription schedule.
5
7
  class Quote < APIResource
6
8
  extend Stripe::APIOperations::Create
7
9
  extend Stripe::APIOperations::List
8
10
  include Stripe::APIOperations::Save
9
11
 
10
12
  OBJECT_NAME = "quote"
13
+ def self.object_name
14
+ "quote"
15
+ end
16
+
17
+ class AutomaticTax < Stripe::StripeObject
18
+ class Liability < Stripe::StripeObject
19
+ # The connected account being referenced when `type` is `account`.
20
+ attr_reader :account
21
+ # Type of the account referenced.
22
+ attr_reader :type
23
+ end
24
+ # Automatically calculate taxes
25
+ attr_reader :enabled
26
+ # 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.
27
+ attr_reader :liability
28
+ # The tax provider powering automatic tax.
29
+ attr_reader :provider
30
+ # The status of the most recent automated tax calculation for this quote.
31
+ attr_reader :status
32
+ end
33
+
34
+ class Computed < Stripe::StripeObject
35
+ class Recurring < Stripe::StripeObject
36
+ class TotalDetails < Stripe::StripeObject
37
+ class Breakdown < Stripe::StripeObject
38
+ class Discount < Stripe::StripeObject
39
+ # The amount discounted.
40
+ attr_reader :amount
41
+ # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
42
+ # It contains information about when the discount began, when it will end, and what it is applied to.
43
+ #
44
+ # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
45
+ attr_reader :discount
46
+ end
47
+
48
+ class Tax < Stripe::StripeObject
49
+ # Amount of tax applied for this rate.
50
+ attr_reader :amount
51
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
52
+ #
53
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
54
+ attr_reader :rate
55
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
56
+ attr_reader :taxability_reason
57
+ # The amount on which tax is calculated, in cents (or local equivalent).
58
+ attr_reader :taxable_amount
59
+ end
60
+ # The aggregated discounts.
61
+ attr_reader :discounts
62
+ # The aggregated tax amounts by rate.
63
+ attr_reader :taxes
64
+ end
65
+ # This is the sum of all the discounts.
66
+ attr_reader :amount_discount
67
+ # This is the sum of all the shipping amounts.
68
+ attr_reader :amount_shipping
69
+ # This is the sum of all the tax amounts.
70
+ attr_reader :amount_tax
71
+ # Attribute for field breakdown
72
+ attr_reader :breakdown
73
+ end
74
+ # Total before any discounts or taxes are applied.
75
+ attr_reader :amount_subtotal
76
+ # Total after discounts and taxes are applied.
77
+ attr_reader :amount_total
78
+ # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`.
79
+ attr_reader :interval
80
+ # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months.
81
+ attr_reader :interval_count
82
+ # Attribute for field total_details
83
+ attr_reader :total_details
84
+ end
85
+
86
+ class Upfront < Stripe::StripeObject
87
+ class TotalDetails < Stripe::StripeObject
88
+ class Breakdown < Stripe::StripeObject
89
+ class Discount < Stripe::StripeObject
90
+ # The amount discounted.
91
+ attr_reader :amount
92
+ # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
93
+ # It contains information about when the discount began, when it will end, and what it is applied to.
94
+ #
95
+ # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
96
+ attr_reader :discount
97
+ end
98
+
99
+ class Tax < Stripe::StripeObject
100
+ # Amount of tax applied for this rate.
101
+ attr_reader :amount
102
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
103
+ #
104
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
105
+ attr_reader :rate
106
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
107
+ attr_reader :taxability_reason
108
+ # The amount on which tax is calculated, in cents (or local equivalent).
109
+ attr_reader :taxable_amount
110
+ end
111
+ # The aggregated discounts.
112
+ attr_reader :discounts
113
+ # The aggregated tax amounts by rate.
114
+ attr_reader :taxes
115
+ end
116
+ # This is the sum of all the discounts.
117
+ attr_reader :amount_discount
118
+ # This is the sum of all the shipping amounts.
119
+ attr_reader :amount_shipping
120
+ # This is the sum of all the tax amounts.
121
+ attr_reader :amount_tax
122
+ # Attribute for field breakdown
123
+ attr_reader :breakdown
124
+ end
125
+ # Total before any discounts or taxes are applied.
126
+ attr_reader :amount_subtotal
127
+ # Total after discounts and taxes are applied.
128
+ attr_reader :amount_total
129
+ # The line items that will appear on the next invoice after this quote is accepted. This does not include pending invoice items that exist on the customer but may still be included in the next invoice.
130
+ attr_reader :line_items
131
+ # Attribute for field total_details
132
+ attr_reader :total_details
133
+ end
134
+ # The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices.
135
+ attr_reader :recurring
136
+ # Attribute for field upfront
137
+ attr_reader :upfront
138
+ end
139
+
140
+ class FromQuote < Stripe::StripeObject
141
+ # Whether this quote is a revision of a different quote.
142
+ attr_reader :is_revision
143
+ # The quote that was cloned.
144
+ attr_reader :quote
145
+ end
146
+
147
+ class InvoiceSettings < Stripe::StripeObject
148
+ class Issuer < Stripe::StripeObject
149
+ # The connected account being referenced when `type` is `account`.
150
+ attr_reader :account
151
+ # Type of the account referenced.
152
+ attr_reader :type
153
+ end
154
+ # Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.
155
+ attr_reader :days_until_due
156
+ # Attribute for field issuer
157
+ attr_reader :issuer
158
+ end
159
+
160
+ class StatusTransitions < Stripe::StripeObject
161
+ # The time that the quote was accepted. Measured in seconds since Unix epoch.
162
+ attr_reader :accepted_at
163
+ # The time that the quote was canceled. Measured in seconds since Unix epoch.
164
+ attr_reader :canceled_at
165
+ # The time that the quote was finalized. Measured in seconds since Unix epoch.
166
+ attr_reader :finalized_at
167
+ end
168
+
169
+ class SubscriptionData < Stripe::StripeObject
170
+ # 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.
171
+ attr_reader :description
172
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch.
173
+ attr_reader :effective_date
174
+ # 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.
175
+ attr_reader :metadata
176
+ # Integer representing the number of trial period days before the customer is charged for the first time.
177
+ attr_reader :trial_period_days
178
+ end
179
+
180
+ class TotalDetails < Stripe::StripeObject
181
+ class Breakdown < Stripe::StripeObject
182
+ class Discount < Stripe::StripeObject
183
+ # The amount discounted.
184
+ attr_reader :amount
185
+ # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
186
+ # It contains information about when the discount began, when it will end, and what it is applied to.
187
+ #
188
+ # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts)
189
+ attr_reader :discount
190
+ end
191
+
192
+ class Tax < Stripe::StripeObject
193
+ # Amount of tax applied for this rate.
194
+ attr_reader :amount
195
+ # Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
196
+ #
197
+ # Related guide: [Tax rates](/billing/taxes/tax-rates)
198
+ attr_reader :rate
199
+ # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
200
+ attr_reader :taxability_reason
201
+ # The amount on which tax is calculated, in cents (or local equivalent).
202
+ attr_reader :taxable_amount
203
+ end
204
+ # The aggregated discounts.
205
+ attr_reader :discounts
206
+ # The aggregated tax amounts by rate.
207
+ attr_reader :taxes
208
+ end
209
+ # This is the sum of all the discounts.
210
+ attr_reader :amount_discount
211
+ # This is the sum of all the shipping amounts.
212
+ attr_reader :amount_shipping
213
+ # This is the sum of all the tax amounts.
214
+ attr_reader :amount_tax
215
+ # Attribute for field breakdown
216
+ attr_reader :breakdown
217
+ end
218
+
219
+ class TransferData < Stripe::StripeObject
220
+ # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination.
221
+ attr_reader :amount
222
+ # 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 will be transferred to the destination.
223
+ attr_reader :amount_percent
224
+ # The account where funds from the payment will be transferred to upon payment success.
225
+ attr_reader :destination
226
+ end
227
+
228
+ class ListParams < Stripe::RequestParams
229
+ # The ID of the customer whose quotes will be retrieved.
230
+ attr_accessor :customer
231
+ # 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.
232
+ attr_accessor :ending_before
233
+ # Specifies which fields in the response should be expanded.
234
+ attr_accessor :expand
235
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
236
+ attr_accessor :limit
237
+ # 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.
238
+ attr_accessor :starting_after
239
+ # The status of the quote.
240
+ attr_accessor :status
241
+ # 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.
242
+ attr_accessor :test_clock
243
+
244
+ def initialize(
245
+ customer: nil,
246
+ ending_before: nil,
247
+ expand: nil,
248
+ limit: nil,
249
+ starting_after: nil,
250
+ status: nil,
251
+ test_clock: nil
252
+ )
253
+ @customer = customer
254
+ @ending_before = ending_before
255
+ @expand = expand
256
+ @limit = limit
257
+ @starting_after = starting_after
258
+ @status = status
259
+ @test_clock = test_clock
260
+ end
261
+ end
262
+
263
+ class CreateParams < Stripe::RequestParams
264
+ class AutomaticTax < Stripe::RequestParams
265
+ class Liability < Stripe::RequestParams
266
+ # The connected account being referenced when `type` is `account`.
267
+ attr_accessor :account
268
+ # Type of the account referenced in the request.
269
+ attr_accessor :type
270
+
271
+ def initialize(account: nil, type: nil)
272
+ @account = account
273
+ @type = type
274
+ end
275
+ end
276
+ # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
277
+ attr_accessor :enabled
278
+ # 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.
279
+ attr_accessor :liability
280
+
281
+ def initialize(enabled: nil, liability: nil)
282
+ @enabled = enabled
283
+ @liability = liability
284
+ end
285
+ end
286
+
287
+ class Discount < Stripe::RequestParams
288
+ # ID of the coupon to create a new discount for.
289
+ attr_accessor :coupon
290
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
291
+ attr_accessor :discount
292
+ # ID of the promotion code to create a new discount for.
293
+ attr_accessor :promotion_code
294
+
295
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
296
+ @coupon = coupon
297
+ @discount = discount
298
+ @promotion_code = promotion_code
299
+ end
300
+ end
301
+
302
+ class FromQuote < Stripe::RequestParams
303
+ # Whether this quote is a revision of the previous quote.
304
+ attr_accessor :is_revision
305
+ # The `id` of the quote that will be cloned.
306
+ attr_accessor :quote
307
+
308
+ def initialize(is_revision: nil, quote: nil)
309
+ @is_revision = is_revision
310
+ @quote = quote
311
+ end
312
+ end
313
+
314
+ class InvoiceSettings < Stripe::RequestParams
315
+ class Issuer < Stripe::RequestParams
316
+ # The connected account being referenced when `type` is `account`.
317
+ attr_accessor :account
318
+ # Type of the account referenced in the request.
319
+ attr_accessor :type
11
320
 
12
- custom_method :accept, http_verb: :post
13
- custom_method :cancel, http_verb: :post
14
- custom_method :finalize_quote, http_verb: :post, http_path: "finalize"
15
- custom_method :list_computed_upfront_line_items, http_verb: :get, http_path: "computed_upfront_line_items"
16
- custom_method :list_line_items, http_verb: :get, http_path: "line_items"
321
+ def initialize(account: nil, type: nil)
322
+ @account = account
323
+ @type = type
324
+ end
325
+ end
326
+ # 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`.
327
+ attr_accessor :days_until_due
328
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
329
+ attr_accessor :issuer
17
330
 
331
+ def initialize(days_until_due: nil, issuer: nil)
332
+ @days_until_due = days_until_due
333
+ @issuer = issuer
334
+ end
335
+ end
336
+
337
+ class LineItem < Stripe::RequestParams
338
+ class Discount < Stripe::RequestParams
339
+ # ID of the coupon to create a new discount for.
340
+ attr_accessor :coupon
341
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
342
+ attr_accessor :discount
343
+ # ID of the promotion code to create a new discount for.
344
+ attr_accessor :promotion_code
345
+
346
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
347
+ @coupon = coupon
348
+ @discount = discount
349
+ @promotion_code = promotion_code
350
+ end
351
+ end
352
+
353
+ class PriceData < Stripe::RequestParams
354
+ class Recurring < Stripe::RequestParams
355
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
356
+ attr_accessor :interval
357
+ # 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).
358
+ attr_accessor :interval_count
359
+
360
+ def initialize(interval: nil, interval_count: nil)
361
+ @interval = interval
362
+ @interval_count = interval_count
363
+ end
364
+ end
365
+ # 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).
366
+ attr_accessor :currency
367
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
368
+ attr_accessor :product
369
+ # The recurring components of a price such as `interval` and `interval_count`.
370
+ attr_accessor :recurring
371
+ # 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.
372
+ attr_accessor :tax_behavior
373
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
374
+ attr_accessor :unit_amount
375
+ # 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.
376
+ attr_accessor :unit_amount_decimal
377
+
378
+ def initialize(
379
+ currency: nil,
380
+ product: nil,
381
+ recurring: nil,
382
+ tax_behavior: nil,
383
+ unit_amount: nil,
384
+ unit_amount_decimal: nil
385
+ )
386
+ @currency = currency
387
+ @product = product
388
+ @recurring = recurring
389
+ @tax_behavior = tax_behavior
390
+ @unit_amount = unit_amount
391
+ @unit_amount_decimal = unit_amount_decimal
392
+ end
393
+ end
394
+ # The discounts applied to this line item.
395
+ attr_accessor :discounts
396
+ # The ID of the price object. One of `price` or `price_data` is required.
397
+ attr_accessor :price
398
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
399
+ attr_accessor :price_data
400
+ # The quantity of the line item.
401
+ attr_accessor :quantity
402
+ # 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.
403
+ attr_accessor :tax_rates
404
+
405
+ def initialize(discounts: nil, price: nil, price_data: nil, quantity: nil, tax_rates: nil)
406
+ @discounts = discounts
407
+ @price = price
408
+ @price_data = price_data
409
+ @quantity = quantity
410
+ @tax_rates = tax_rates
411
+ end
412
+ end
413
+
414
+ class SubscriptionData < Stripe::RequestParams
415
+ # 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.
416
+ attr_accessor :description
417
+ # 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.
418
+ attr_accessor :effective_date
419
+ # 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.
420
+ attr_accessor :metadata
421
+ # Integer representing the number of trial period days before the customer is charged for the first time.
422
+ attr_accessor :trial_period_days
423
+
424
+ def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
425
+ @description = description
426
+ @effective_date = effective_date
427
+ @metadata = metadata
428
+ @trial_period_days = trial_period_days
429
+ end
430
+ end
431
+
432
+ class TransferData < Stripe::RequestParams
433
+ # 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.
434
+ attr_accessor :amount
435
+ # 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.
436
+ attr_accessor :amount_percent
437
+ # ID of an existing, connected Stripe account.
438
+ attr_accessor :destination
439
+
440
+ def initialize(amount: nil, amount_percent: nil, destination: nil)
441
+ @amount = amount
442
+ @amount_percent = amount_percent
443
+ @destination = destination
444
+ end
445
+ end
446
+ # 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.
447
+ attr_accessor :application_fee_amount
448
+ # 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.
449
+ attr_accessor :application_fee_percent
450
+ # Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
451
+ attr_accessor :automatic_tax
452
+ # 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`.
453
+ attr_accessor :collection_method
454
+ # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
455
+ attr_accessor :customer
456
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
457
+ attr_accessor :default_tax_rates
458
+ # 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.
459
+ attr_accessor :description
460
+ # The discounts applied to the quote.
461
+ attr_accessor :discounts
462
+ # Specifies which fields in the response should be expanded.
463
+ attr_accessor :expand
464
+ # 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.
465
+ attr_accessor :expires_at
466
+ # 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.
467
+ attr_accessor :footer
468
+ # 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`.
469
+ attr_accessor :from_quote
470
+ # 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.
471
+ attr_accessor :header
472
+ # All invoices will be billed using the specified settings.
473
+ attr_accessor :invoice_settings
474
+ # 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.
475
+ attr_accessor :line_items
476
+ # 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`.
477
+ attr_accessor :metadata
478
+ # The account on behalf of which to charge.
479
+ attr_accessor :on_behalf_of
480
+ # 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.
481
+ attr_accessor :subscription_data
482
+ # ID of the test clock to attach to the quote.
483
+ attr_accessor :test_clock
484
+ # The data with which to automatically create a Transfer for each of the invoices.
485
+ attr_accessor :transfer_data
486
+
487
+ def initialize(
488
+ application_fee_amount: nil,
489
+ application_fee_percent: nil,
490
+ automatic_tax: nil,
491
+ collection_method: nil,
492
+ customer: nil,
493
+ default_tax_rates: nil,
494
+ description: nil,
495
+ discounts: nil,
496
+ expand: nil,
497
+ expires_at: nil,
498
+ footer: nil,
499
+ from_quote: nil,
500
+ header: nil,
501
+ invoice_settings: nil,
502
+ line_items: nil,
503
+ metadata: nil,
504
+ on_behalf_of: nil,
505
+ subscription_data: nil,
506
+ test_clock: nil,
507
+ transfer_data: nil
508
+ )
509
+ @application_fee_amount = application_fee_amount
510
+ @application_fee_percent = application_fee_percent
511
+ @automatic_tax = automatic_tax
512
+ @collection_method = collection_method
513
+ @customer = customer
514
+ @default_tax_rates = default_tax_rates
515
+ @description = description
516
+ @discounts = discounts
517
+ @expand = expand
518
+ @expires_at = expires_at
519
+ @footer = footer
520
+ @from_quote = from_quote
521
+ @header = header
522
+ @invoice_settings = invoice_settings
523
+ @line_items = line_items
524
+ @metadata = metadata
525
+ @on_behalf_of = on_behalf_of
526
+ @subscription_data = subscription_data
527
+ @test_clock = test_clock
528
+ @transfer_data = transfer_data
529
+ end
530
+ end
531
+
532
+ class UpdateParams < Stripe::RequestParams
533
+ class AutomaticTax < Stripe::RequestParams
534
+ class Liability < Stripe::RequestParams
535
+ # The connected account being referenced when `type` is `account`.
536
+ attr_accessor :account
537
+ # Type of the account referenced in the request.
538
+ attr_accessor :type
539
+
540
+ def initialize(account: nil, type: nil)
541
+ @account = account
542
+ @type = type
543
+ end
544
+ end
545
+ # Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.
546
+ attr_accessor :enabled
547
+ # 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.
548
+ attr_accessor :liability
549
+
550
+ def initialize(enabled: nil, liability: nil)
551
+ @enabled = enabled
552
+ @liability = liability
553
+ end
554
+ end
555
+
556
+ class Discount < Stripe::RequestParams
557
+ # ID of the coupon to create a new discount for.
558
+ attr_accessor :coupon
559
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
560
+ attr_accessor :discount
561
+ # ID of the promotion code to create a new discount for.
562
+ attr_accessor :promotion_code
563
+
564
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
565
+ @coupon = coupon
566
+ @discount = discount
567
+ @promotion_code = promotion_code
568
+ end
569
+ end
570
+
571
+ class InvoiceSettings < Stripe::RequestParams
572
+ class Issuer < Stripe::RequestParams
573
+ # The connected account being referenced when `type` is `account`.
574
+ attr_accessor :account
575
+ # Type of the account referenced in the request.
576
+ attr_accessor :type
577
+
578
+ def initialize(account: nil, type: nil)
579
+ @account = account
580
+ @type = type
581
+ end
582
+ end
583
+ # 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`.
584
+ attr_accessor :days_until_due
585
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
586
+ attr_accessor :issuer
587
+
588
+ def initialize(days_until_due: nil, issuer: nil)
589
+ @days_until_due = days_until_due
590
+ @issuer = issuer
591
+ end
592
+ end
593
+
594
+ class LineItem < Stripe::RequestParams
595
+ class Discount < Stripe::RequestParams
596
+ # ID of the coupon to create a new discount for.
597
+ attr_accessor :coupon
598
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
599
+ attr_accessor :discount
600
+ # ID of the promotion code to create a new discount for.
601
+ attr_accessor :promotion_code
602
+
603
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
604
+ @coupon = coupon
605
+ @discount = discount
606
+ @promotion_code = promotion_code
607
+ end
608
+ end
609
+
610
+ class PriceData < Stripe::RequestParams
611
+ class Recurring < Stripe::RequestParams
612
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
613
+ attr_accessor :interval
614
+ # 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).
615
+ attr_accessor :interval_count
616
+
617
+ def initialize(interval: nil, interval_count: nil)
618
+ @interval = interval
619
+ @interval_count = interval_count
620
+ end
621
+ end
622
+ # 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).
623
+ attr_accessor :currency
624
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
625
+ attr_accessor :product
626
+ # The recurring components of a price such as `interval` and `interval_count`.
627
+ attr_accessor :recurring
628
+ # 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.
629
+ attr_accessor :tax_behavior
630
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
631
+ attr_accessor :unit_amount
632
+ # 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.
633
+ attr_accessor :unit_amount_decimal
634
+
635
+ def initialize(
636
+ currency: nil,
637
+ product: nil,
638
+ recurring: nil,
639
+ tax_behavior: nil,
640
+ unit_amount: nil,
641
+ unit_amount_decimal: nil
642
+ )
643
+ @currency = currency
644
+ @product = product
645
+ @recurring = recurring
646
+ @tax_behavior = tax_behavior
647
+ @unit_amount = unit_amount
648
+ @unit_amount_decimal = unit_amount_decimal
649
+ end
650
+ end
651
+ # The discounts applied to this line item.
652
+ attr_accessor :discounts
653
+ # The ID of an existing line item on the quote.
654
+ attr_accessor :id
655
+ # The ID of the price object. One of `price` or `price_data` is required.
656
+ attr_accessor :price
657
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
658
+ attr_accessor :price_data
659
+ # The quantity of the line item.
660
+ attr_accessor :quantity
661
+ # 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.
662
+ attr_accessor :tax_rates
663
+
664
+ def initialize(
665
+ discounts: nil,
666
+ id: nil,
667
+ price: nil,
668
+ price_data: nil,
669
+ quantity: nil,
670
+ tax_rates: nil
671
+ )
672
+ @discounts = discounts
673
+ @id = id
674
+ @price = price
675
+ @price_data = price_data
676
+ @quantity = quantity
677
+ @tax_rates = tax_rates
678
+ end
679
+ end
680
+
681
+ class SubscriptionData < Stripe::RequestParams
682
+ # 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.
683
+ attr_accessor :description
684
+ # 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.
685
+ attr_accessor :effective_date
686
+ # 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.
687
+ attr_accessor :metadata
688
+ # Integer representing the number of trial period days before the customer is charged for the first time.
689
+ attr_accessor :trial_period_days
690
+
691
+ def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
692
+ @description = description
693
+ @effective_date = effective_date
694
+ @metadata = metadata
695
+ @trial_period_days = trial_period_days
696
+ end
697
+ end
698
+
699
+ class TransferData < Stripe::RequestParams
700
+ # 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.
701
+ attr_accessor :amount
702
+ # 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.
703
+ attr_accessor :amount_percent
704
+ # ID of an existing, connected Stripe account.
705
+ attr_accessor :destination
706
+
707
+ def initialize(amount: nil, amount_percent: nil, destination: nil)
708
+ @amount = amount
709
+ @amount_percent = amount_percent
710
+ @destination = destination
711
+ end
712
+ end
713
+ # 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.
714
+ attr_accessor :application_fee_amount
715
+ # 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.
716
+ attr_accessor :application_fee_percent
717
+ # Settings for automatic tax lookup for this quote and resulting invoices and subscriptions.
718
+ attr_accessor :automatic_tax
719
+ # 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`.
720
+ attr_accessor :collection_method
721
+ # The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
722
+ attr_accessor :customer
723
+ # The tax rates that will apply to any line item that does not have `tax_rates` set.
724
+ attr_accessor :default_tax_rates
725
+ # A description that will be displayed on the quote PDF.
726
+ attr_accessor :description
727
+ # The discounts applied to the quote.
728
+ attr_accessor :discounts
729
+ # Specifies which fields in the response should be expanded.
730
+ attr_accessor :expand
731
+ # A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
732
+ attr_accessor :expires_at
733
+ # A footer that will be displayed on the quote PDF.
734
+ attr_accessor :footer
735
+ # A header that will be displayed on the quote PDF.
736
+ attr_accessor :header
737
+ # All invoices will be billed using the specified settings.
738
+ attr_accessor :invoice_settings
739
+ # 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.
740
+ attr_accessor :line_items
741
+ # 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`.
742
+ attr_accessor :metadata
743
+ # The account on behalf of which to charge.
744
+ attr_accessor :on_behalf_of
745
+ # 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.
746
+ attr_accessor :subscription_data
747
+ # The data with which to automatically create a Transfer for each of the invoices.
748
+ attr_accessor :transfer_data
749
+
750
+ def initialize(
751
+ application_fee_amount: nil,
752
+ application_fee_percent: nil,
753
+ automatic_tax: nil,
754
+ collection_method: nil,
755
+ customer: nil,
756
+ default_tax_rates: nil,
757
+ description: nil,
758
+ discounts: nil,
759
+ expand: nil,
760
+ expires_at: nil,
761
+ footer: nil,
762
+ header: nil,
763
+ invoice_settings: nil,
764
+ line_items: nil,
765
+ metadata: nil,
766
+ on_behalf_of: nil,
767
+ subscription_data: nil,
768
+ transfer_data: nil
769
+ )
770
+ @application_fee_amount = application_fee_amount
771
+ @application_fee_percent = application_fee_percent
772
+ @automatic_tax = automatic_tax
773
+ @collection_method = collection_method
774
+ @customer = customer
775
+ @default_tax_rates = default_tax_rates
776
+ @description = description
777
+ @discounts = discounts
778
+ @expand = expand
779
+ @expires_at = expires_at
780
+ @footer = footer
781
+ @header = header
782
+ @invoice_settings = invoice_settings
783
+ @line_items = line_items
784
+ @metadata = metadata
785
+ @on_behalf_of = on_behalf_of
786
+ @subscription_data = subscription_data
787
+ @transfer_data = transfer_data
788
+ end
789
+ end
790
+
791
+ class ListComputedUpfrontLineItemsParams < Stripe::RequestParams
792
+ # 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.
793
+ attr_accessor :ending_before
794
+ # Specifies which fields in the response should be expanded.
795
+ attr_accessor :expand
796
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
797
+ attr_accessor :limit
798
+ # 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.
799
+ attr_accessor :starting_after
800
+
801
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
802
+ @ending_before = ending_before
803
+ @expand = expand
804
+ @limit = limit
805
+ @starting_after = starting_after
806
+ end
807
+ end
808
+
809
+ class ListLineItemsParams < Stripe::RequestParams
810
+ # 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.
811
+ attr_accessor :ending_before
812
+ # Specifies which fields in the response should be expanded.
813
+ attr_accessor :expand
814
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
815
+ attr_accessor :limit
816
+ # 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.
817
+ attr_accessor :starting_after
818
+
819
+ def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
820
+ @ending_before = ending_before
821
+ @expand = expand
822
+ @limit = limit
823
+ @starting_after = starting_after
824
+ end
825
+ end
826
+
827
+ class AcceptParams < Stripe::RequestParams
828
+ # Specifies which fields in the response should be expanded.
829
+ attr_accessor :expand
830
+
831
+ def initialize(expand: nil)
832
+ @expand = expand
833
+ end
834
+ end
835
+
836
+ class CancelParams < Stripe::RequestParams
837
+ # Specifies which fields in the response should be expanded.
838
+ attr_accessor :expand
839
+
840
+ def initialize(expand: nil)
841
+ @expand = expand
842
+ end
843
+ end
844
+
845
+ class FinalizeQuoteParams < Stripe::RequestParams
846
+ # Specifies which fields in the response should be expanded.
847
+ attr_accessor :expand
848
+ # A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
849
+ attr_accessor :expires_at
850
+
851
+ def initialize(expand: nil, expires_at: nil)
852
+ @expand = expand
853
+ @expires_at = expires_at
854
+ end
855
+ end
856
+
857
+ class PdfParams < Stripe::RequestParams
858
+ # Specifies which fields in the response should be expanded.
859
+ attr_accessor :expand
860
+
861
+ def initialize(expand: nil)
862
+ @expand = expand
863
+ end
864
+ end
865
+ # Total before any discounts or taxes are applied.
866
+ attr_reader :amount_subtotal
867
+ # Total after discounts and taxes are applied.
868
+ attr_reader :amount_total
869
+ # ID of the Connect Application that created the quote.
870
+ attr_reader :application
871
+ # 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. Only applicable if there are no line items with recurring prices on the quote.
872
+ attr_reader :application_fee_amount
873
+ # 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. Only applicable if there are line items with recurring prices on the quote.
874
+ attr_reader :application_fee_percent
875
+ # Attribute for field automatic_tax
876
+ attr_reader :automatic_tax
877
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on 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`.
878
+ attr_reader :collection_method
879
+ # Attribute for field computed
880
+ attr_reader :computed
881
+ # Time at which the object was created. Measured in seconds since the Unix epoch.
882
+ attr_reader :created
883
+ # 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).
884
+ attr_reader :currency
885
+ # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed.
886
+ attr_reader :customer
887
+ # The tax rates applied to this quote.
888
+ attr_reader :default_tax_rates
889
+ # A description that will be displayed on the quote PDF.
890
+ attr_reader :description
891
+ # The discounts applied to this quote.
892
+ attr_reader :discounts
893
+ # The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch.
894
+ attr_reader :expires_at
895
+ # A footer that will be displayed on the quote PDF.
896
+ attr_reader :footer
897
+ # Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details.
898
+ attr_reader :from_quote
899
+ # A header that will be displayed on the quote PDF.
900
+ attr_reader :header
901
+ # Unique identifier for the object.
902
+ attr_reader :id
903
+ # The invoice that was created from this quote.
904
+ attr_reader :invoice
905
+ # Attribute for field invoice_settings
906
+ attr_reader :invoice_settings
907
+ # A list of items the customer is being quoted for.
908
+ attr_reader :line_items
909
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
910
+ attr_reader :livemode
911
+ # 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.
912
+ attr_reader :metadata
913
+ # A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize).
914
+ attr_reader :number
915
+ # String representing the object's type. Objects of the same type share the same value.
916
+ attr_reader :object
917
+ # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.
918
+ attr_reader :on_behalf_of
919
+ # The status of the quote.
920
+ attr_reader :status
921
+ # Attribute for field status_transitions
922
+ attr_reader :status_transitions
923
+ # The subscription that was created or updated from this quote.
924
+ attr_reader :subscription
925
+ # Attribute for field subscription_data
926
+ attr_reader :subscription_data
927
+ # The subscription schedule that was created or updated from this quote.
928
+ attr_reader :subscription_schedule
929
+ # ID of the test clock this quote belongs to.
930
+ attr_reader :test_clock
931
+ # Attribute for field total_details
932
+ attr_reader :total_details
933
+ # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices.
934
+ attr_reader :transfer_data
935
+
936
+ # Accepts the specified quote.
18
937
  def accept(params = {}, opts = {})
19
938
  request_stripe_object(
20
939
  method: :post,
21
- path: resource_url + "/accept",
940
+ path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(self["id"]) }),
22
941
  params: params,
23
942
  opts: opts
24
943
  )
25
944
  end
26
945
 
946
+ # Accepts the specified quote.
947
+ def self.accept(quote, params = {}, opts = {})
948
+ request_stripe_object(
949
+ method: :post,
950
+ path: format("/v1/quotes/%<quote>s/accept", { quote: CGI.escape(quote) }),
951
+ params: params,
952
+ opts: opts
953
+ )
954
+ end
955
+
956
+ # Cancels the quote.
27
957
  def cancel(params = {}, opts = {})
28
958
  request_stripe_object(
29
959
  method: :post,
30
- path: resource_url + "/cancel",
960
+ path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(self["id"]) }),
31
961
  params: params,
32
962
  opts: opts
33
963
  )
34
964
  end
35
965
 
966
+ # Cancels the quote.
967
+ def self.cancel(quote, params = {}, opts = {})
968
+ request_stripe_object(
969
+ method: :post,
970
+ path: format("/v1/quotes/%<quote>s/cancel", { quote: CGI.escape(quote) }),
971
+ params: params,
972
+ opts: opts
973
+ )
974
+ end
975
+
976
+ # A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote).
977
+ def self.create(params = {}, opts = {})
978
+ request_stripe_object(method: :post, path: "/v1/quotes", params: params, opts: opts)
979
+ end
980
+
981
+ # Finalizes the quote.
36
982
  def finalize_quote(params = {}, opts = {})
37
983
  request_stripe_object(
38
984
  method: :post,
39
- path: resource_url + "/finalize",
985
+ path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(self["id"]) }),
40
986
  params: params,
41
987
  opts: opts
42
988
  )
43
989
  end
44
990
 
991
+ # Finalizes the quote.
992
+ def self.finalize_quote(quote, params = {}, opts = {})
993
+ request_stripe_object(
994
+ method: :post,
995
+ path: format("/v1/quotes/%<quote>s/finalize", { quote: CGI.escape(quote) }),
996
+ params: params,
997
+ opts: opts
998
+ )
999
+ end
1000
+
1001
+ # Returns a list of your quotes.
1002
+ def self.list(params = {}, opts = {})
1003
+ request_stripe_object(method: :get, path: "/v1/quotes", params: params, opts: opts)
1004
+ end
1005
+
1006
+ # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
45
1007
  def list_computed_upfront_line_items(params = {}, opts = {})
46
1008
  request_stripe_object(
47
1009
  method: :get,
48
- path: resource_url + "/computed_upfront_line_items",
1010
+ path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(self["id"]) }),
49
1011
  params: params,
50
1012
  opts: opts
51
1013
  )
52
1014
  end
53
1015
 
54
- def list_line_items(params = {}, opts = {})
1016
+ # When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
1017
+ def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
55
1018
  request_stripe_object(
56
1019
  method: :get,
57
- path: resource_url + "/line_items",
1020
+ path: format("/v1/quotes/%<quote>s/computed_upfront_line_items", { quote: CGI.escape(quote) }),
58
1021
  params: params,
59
1022
  opts: opts
60
1023
  )
61
1024
  end
62
1025
 
63
- def pdf(params = {}, opts = {}, &read_body_chunk_block)
64
- unless block_given?
65
- raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
66
- end
1026
+ # When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
1027
+ def list_line_items(params = {}, opts = {})
1028
+ request_stripe_object(
1029
+ method: :get,
1030
+ path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(self["id"]) }),
1031
+ params: params,
1032
+ opts: opts
1033
+ )
1034
+ end
67
1035
 
68
- config = opts[:client]&.config || Stripe.config
1036
+ # When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
1037
+ def self.list_line_items(quote, params = {}, opts = {})
1038
+ request_stripe_object(
1039
+ method: :get,
1040
+ path: format("/v1/quotes/%<quote>s/line_items", { quote: CGI.escape(quote) }),
1041
+ params: params,
1042
+ opts: opts
1043
+ )
1044
+ end
69
1045
 
1046
+ # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
1047
+ def pdf(params = {}, opts = {}, &read_body_chunk_block)
1048
+ opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
70
1049
  request_stream(
71
1050
  method: :get,
72
- path: resource_url + "/pdf",
1051
+ path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
73
1052
  params: params,
74
- opts: {
75
- api_base: config.uploads_base,
76
- }.merge(opts),
1053
+ opts: opts,
1054
+ base_address: :files,
77
1055
  &read_body_chunk_block
78
1056
  )
79
1057
  end
80
1058
 
81
- def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
82
- unless id.is_a?(String)
83
- raise ArgumentError,
84
- "id should be a string representing the ID of an API resource"
85
- end
86
-
87
- unless block_given?
88
- raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
89
- end
90
-
91
- config = opts[:client]&.config || Stripe.config
92
-
93
- resp = execute_resource_request_stream(
1059
+ # Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf)
1060
+ def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
1061
+ opts = { api_base: APIRequestor.active_requestor.config.uploads_base }.merge(opts)
1062
+ execute_resource_request_stream(
94
1063
  :get,
95
- "#{resource_url}/#{CGI.escape(id)}/pdf",
1064
+ format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }),
1065
+ :files,
96
1066
  params,
97
- {
98
- api_base: config.uploads_base,
99
- }.merge(opts),
1067
+ opts,
100
1068
  &read_body_chunk_block
101
1069
  )
102
- resp
1070
+ end
1071
+
1072
+ # A quote models prices and services for a customer.
1073
+ def self.update(quote, params = {}, opts = {})
1074
+ request_stripe_object(
1075
+ method: :post,
1076
+ path: format("/v1/quotes/%<quote>s", { quote: CGI.escape(quote) }),
1077
+ params: params,
1078
+ opts: opts
1079
+ )
103
1080
  end
104
1081
  end
105
1082
  end