stripe 13.3.0 → 13.4.0.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (743) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1410 -650
  3. data/OPENAPI_VERSION +1 -1
  4. data/VERSION +1 -1
  5. data/lib/stripe/api_operations/request.rb +1 -0
  6. data/lib/stripe/api_requestor.rb +1 -0
  7. data/lib/stripe/object_types.rb +32 -0
  8. data/lib/stripe/request_params.rb +24 -0
  9. data/lib/stripe/request_signing_authenticator.rb +79 -0
  10. data/lib/stripe/resources/account.rb +5793 -0
  11. data/lib/stripe/resources/account_link.rb +64 -0
  12. data/lib/stripe/resources/account_notice.rb +154 -0
  13. data/lib/stripe/resources/account_session.rb +1002 -0
  14. data/lib/stripe/resources/apple_pay_domain.rb +73 -0
  15. data/lib/stripe/resources/application.rb +23 -0
  16. data/lib/stripe/resources/application_fee.rb +120 -0
  17. data/lib/stripe/resources/application_fee_refund.rb +24 -0
  18. data/lib/stripe/resources/apps/secret.rb +166 -0
  19. data/lib/stripe/resources/balance.rb +162 -0
  20. data/lib/stripe/resources/balance_transaction.rb +141 -0
  21. data/lib/stripe/resources/bank_account.rb +113 -2
  22. data/lib/stripe/resources/billing/alert.rb +166 -0
  23. data/lib/stripe/resources/billing/alert_triggered.rb +31 -0
  24. data/lib/stripe/resources/billing/credit_balance_summary.rb +89 -0
  25. data/lib/stripe/resources/billing/credit_balance_transaction.rb +140 -0
  26. data/lib/stripe/resources/billing/credit_grant.rb +235 -0
  27. data/lib/stripe/resources/billing/meter.rb +203 -0
  28. data/lib/stripe/resources/billing/meter_error_report.rb +70 -0
  29. data/lib/stripe/resources/billing/meter_event.rb +45 -0
  30. data/lib/stripe/resources/billing/meter_event_adjustment.rb +51 -0
  31. data/lib/stripe/resources/billing/meter_event_summary.rb +21 -0
  32. data/lib/stripe/resources/billing_portal/configuration.rb +639 -0
  33. data/lib/stripe/resources/billing_portal/session.rb +313 -0
  34. data/lib/stripe/resources/capability.rb +111 -0
  35. data/lib/stripe/resources/capital/financing_offer.rb +221 -0
  36. data/lib/stripe/resources/capital/financing_summary.rb +77 -0
  37. data/lib/stripe/resources/capital/financing_transaction.rb +147 -0
  38. data/lib/stripe/resources/card.rb +111 -0
  39. data/lib/stripe/resources/cash_balance.rb +22 -0
  40. data/lib/stripe/resources/charge.rb +3687 -0
  41. data/lib/stripe/resources/checkout/session.rb +4162 -0
  42. data/lib/stripe/resources/climate/order.rb +216 -0
  43. data/lib/stripe/resources/climate/product.rb +69 -0
  44. data/lib/stripe/resources/climate/supplier.rb +67 -0
  45. data/lib/stripe/resources/confirmation_token.rb +1855 -0
  46. data/lib/stripe/resources/connect_collection_transfer.rb +29 -0
  47. data/lib/stripe/resources/country_spec.rb +76 -0
  48. data/lib/stripe/resources/coupon.rb +237 -0
  49. data/lib/stripe/resources/credit_note.rb +798 -0
  50. data/lib/stripe/resources/credit_note_line_item.rb +89 -0
  51. data/lib/stripe/resources/customer.rb +995 -0
  52. data/lib/stripe/resources/customer_balance_transaction.rb +39 -0
  53. data/lib/stripe/resources/customer_cash_balance_transaction.rb +136 -0
  54. data/lib/stripe/resources/customer_session.rb +183 -0
  55. data/lib/stripe/resources/discount.rb +41 -0
  56. data/lib/stripe/resources/dispute.rb +767 -0
  57. data/lib/stripe/resources/entitlements/active_entitlement.rb +54 -0
  58. data/lib/stripe/resources/entitlements/active_entitlement_summary.rb +26 -0
  59. data/lib/stripe/resources/entitlements/feature.rb +107 -0
  60. data/lib/stripe/resources/ephemeral_key.rb +26 -0
  61. data/lib/stripe/resources/event.rb +157 -0
  62. data/lib/stripe/resources/exchange_rate.rb +38 -0
  63. data/lib/stripe/resources/file.rb +134 -0
  64. data/lib/stripe/resources/file_link.rb +134 -0
  65. data/lib/stripe/resources/financial_connections/account.rb +307 -0
  66. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +30 -0
  67. data/lib/stripe/resources/financial_connections/account_owner.rb +24 -0
  68. data/lib/stripe/resources/financial_connections/account_ownership.rb +12 -0
  69. data/lib/stripe/resources/financial_connections/institution.rb +112 -0
  70. data/lib/stripe/resources/financial_connections/session.rb +187 -0
  71. data/lib/stripe/resources/financial_connections/transaction.rb +122 -0
  72. data/lib/stripe/resources/forwarding/request.rb +196 -0
  73. data/lib/stripe/resources/funding_instructions.rb +415 -0
  74. data/lib/stripe/resources/gift_cards/card.rb +245 -0
  75. data/lib/stripe/resources/gift_cards/transaction.rb +313 -0
  76. data/lib/stripe/resources/identity/verification_report.rb +335 -0
  77. data/lib/stripe/resources/identity/verification_session.rb +430 -0
  78. data/lib/stripe/resources/invoice.rb +9348 -0
  79. data/lib/stripe/resources/invoice_item.rb +536 -0
  80. data/lib/stripe/resources/invoice_line_item.rb +409 -0
  81. data/lib/stripe/resources/invoice_payment.rb +72 -0
  82. data/lib/stripe/resources/invoice_rendering_template.rb +79 -0
  83. data/lib/stripe/resources/issuing/authorization.rb +1316 -2
  84. data/lib/stripe/resources/issuing/card.rb +794 -0
  85. data/lib/stripe/resources/issuing/cardholder.rb +768 -0
  86. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +693 -0
  87. data/lib/stripe/resources/issuing/dispute.rb +941 -0
  88. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +98 -0
  89. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +109 -0
  90. data/lib/stripe/resources/issuing/personalization_design.rb +333 -0
  91. data/lib/stripe/resources/issuing/physical_bundle.rb +76 -0
  92. data/lib/stripe/resources/issuing/settlement.rb +65 -0
  93. data/lib/stripe/resources/issuing/token.rb +221 -0
  94. data/lib/stripe/resources/issuing/transaction.rb +1098 -0
  95. data/lib/stripe/resources/line_item.rb +98 -0
  96. data/lib/stripe/resources/login_link.rb +9 -0
  97. data/lib/stripe/resources/mandate.rb +214 -0
  98. data/lib/stripe/resources/margin.rb +143 -0
  99. data/lib/stripe/resources/order.rb +3238 -0
  100. data/lib/stripe/resources/payment_attempt_record.rb +226 -0
  101. data/lib/stripe/resources/payment_intent.rb +14630 -0
  102. data/lib/stripe/resources/payment_link.rb +1761 -0
  103. data/lib/stripe/resources/payment_method.rb +1981 -0
  104. data/lib/stripe/resources/payment_method_configuration.rb +3137 -0
  105. data/lib/stripe/resources/payment_method_domain.rb +176 -0
  106. data/lib/stripe/resources/payment_record.rb +824 -0
  107. data/lib/stripe/resources/payout.rb +267 -0
  108. data/lib/stripe/resources/person.rb +353 -0
  109. data/lib/stripe/resources/plan.rb +386 -0
  110. data/lib/stripe/resources/price.rb +782 -0
  111. data/lib/stripe/resources/product.rb +636 -0
  112. data/lib/stripe/resources/product_feature.rb +16 -0
  113. data/lib/stripe/resources/promotion_code.rb +261 -0
  114. data/lib/stripe/resources/quote.rb +3404 -0
  115. data/lib/stripe/resources/quote_line.rb +340 -0
  116. data/lib/stripe/resources/quote_preview_invoice.rb +833 -0
  117. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +463 -0
  118. data/lib/stripe/resources/radar/early_fraud_warning.rb +93 -0
  119. data/lib/stripe/resources/radar/value_list.rb +151 -0
  120. data/lib/stripe/resources/radar/value_list_item.rb +113 -0
  121. data/lib/stripe/resources/refund.rb +489 -0
  122. data/lib/stripe/resources/reporting/report_run.rb +182 -0
  123. data/lib/stripe/resources/reporting/report_type.rb +44 -0
  124. data/lib/stripe/resources/reserve_transaction.rb +26 -0
  125. data/lib/stripe/resources/reversal.rb +30 -0
  126. data/lib/stripe/resources/review.rb +135 -0
  127. data/lib/stripe/resources/setup_attempt.rb +474 -0
  128. data/lib/stripe/resources/setup_intent.rb +4371 -0
  129. data/lib/stripe/resources/shipping_rate.rb +303 -0
  130. data/lib/stripe/resources/sigma/scheduled_query_run.rb +67 -0
  131. data/lib/stripe/resources/source.rb +1571 -0
  132. data/lib/stripe/resources/source_mandate_notification.rb +79 -0
  133. data/lib/stripe/resources/source_transaction.rb +114 -0
  134. data/lib/stripe/resources/subscription.rb +2395 -0
  135. data/lib/stripe/resources/subscription_item.rb +502 -0
  136. data/lib/stripe/resources/subscription_schedule.rb +2790 -0
  137. data/lib/stripe/resources/tax/association.rb +100 -0
  138. data/lib/stripe/resources/tax/calculation.rb +474 -0
  139. data/lib/stripe/resources/tax/calculation_line_item.rb +76 -0
  140. data/lib/stripe/resources/tax/form.rb +253 -0
  141. data/lib/stripe/resources/tax/registration.rb +2174 -0
  142. data/lib/stripe/resources/tax/settings.rb +146 -0
  143. data/lib/stripe/resources/tax/transaction.rb +332 -0
  144. data/lib/stripe/resources/tax/transaction_line_item.rb +43 -0
  145. data/lib/stripe/resources/tax_code.rb +41 -0
  146. data/lib/stripe/resources/tax_deducted_at_source.rb +26 -0
  147. data/lib/stripe/resources/tax_id.rb +147 -0
  148. data/lib/stripe/resources/tax_rate.rb +245 -0
  149. data/lib/stripe/resources/terminal/configuration.rb +1175 -0
  150. data/lib/stripe/resources/terminal/connection_token.rb +21 -0
  151. data/lib/stripe/resources/terminal/location.rb +208 -0
  152. data/lib/stripe/resources/terminal/reader.rb +911 -0
  153. data/lib/stripe/resources/terminal/reader_collected_data.rb +45 -0
  154. data/lib/stripe/resources/test_helpers/test_clock.rb +101 -0
  155. data/lib/stripe/resources/token.rb +1337 -0
  156. data/lib/stripe/resources/topup.rb +210 -0
  157. data/lib/stripe/resources/transfer.rb +188 -0
  158. data/lib/stripe/resources/treasury/credit_reversal.rb +113 -0
  159. data/lib/stripe/resources/treasury/debit_reversal.rb +126 -0
  160. data/lib/stripe/resources/treasury/financial_account.rb +766 -0
  161. data/lib/stripe/resources/treasury/financial_account_features.rb +237 -0
  162. data/lib/stripe/resources/treasury/inbound_transfer.rb +285 -0
  163. data/lib/stripe/resources/treasury/outbound_payment.rb +587 -0
  164. data/lib/stripe/resources/treasury/outbound_transfer.rb +428 -0
  165. data/lib/stripe/resources/treasury/received_credit.rb +335 -0
  166. data/lib/stripe/resources/treasury/received_debit.rb +298 -0
  167. data/lib/stripe/resources/treasury/transaction.rb +215 -0
  168. data/lib/stripe/resources/treasury/transaction_entry.rb +193 -0
  169. data/lib/stripe/resources/usage_record.rb +18 -0
  170. data/lib/stripe/resources/usage_record_summary.rb +28 -0
  171. data/lib/stripe/resources/v2/amount.rb +9 -0
  172. data/lib/stripe/resources/v2/billing/meter_event.rb +24 -0
  173. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +28 -0
  174. data/lib/stripe/resources/v2/billing/meter_event_session.rb +19 -0
  175. data/lib/stripe/resources/v2/event.rb +35 -0
  176. data/lib/stripe/resources/v2/event_destination.rb +78 -0
  177. data/lib/stripe/resources/webhook_endpoint.rb +148 -0
  178. data/lib/stripe/resources.rb +31 -0
  179. data/lib/stripe/services/account_capability_service.rb +33 -0
  180. data/lib/stripe/services/account_external_account_service.rb +293 -0
  181. data/lib/stripe/services/account_link_service.rb +53 -0
  182. data/lib/stripe/services/account_login_link_service.rb +9 -0
  183. data/lib/stripe/services/account_notice_service.rb +110 -0
  184. data/lib/stripe/services/account_person_service.rb +1014 -0
  185. data/lib/stripe/services/account_service.rb +4862 -0
  186. data/lib/stripe/services/account_session_service.rb +740 -0
  187. data/lib/stripe/services/apple_pay_domain_service.rb +56 -0
  188. data/lib/stripe/services/application_fee_refund_service.rb +60 -0
  189. data/lib/stripe/services/application_fee_service.rb +65 -0
  190. data/lib/stripe/services/apps/secret_service.rb +132 -0
  191. data/lib/stripe/services/balance_service.rb +9 -0
  192. data/lib/stripe/services/balance_transaction_service.rb +80 -0
  193. data/lib/stripe/services/billing/alert_service.rb +125 -0
  194. data/lib/stripe/services/billing/credit_balance_summary_service.rb +41 -0
  195. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +45 -0
  196. data/lib/stripe/services/billing/credit_grant_service.rb +167 -0
  197. data/lib/stripe/services/billing/meter_event_adjustment_service.rb +29 -0
  198. data/lib/stripe/services/billing/meter_event_service.rb +25 -0
  199. data/lib/stripe/services/billing/meter_event_summary_service.rb +46 -0
  200. data/lib/stripe/services/billing/meter_service.rb +142 -0
  201. data/lib/stripe/services/billing_portal/configuration_service.rb +492 -0
  202. data/lib/stripe/services/billing_portal/session_service.rb +192 -0
  203. data/lib/stripe/services/capital/financing_offer_service.rb +121 -0
  204. data/lib/stripe/services/capital/financing_summary_service.rb +28 -0
  205. data/lib/stripe/services/capital/financing_transaction_service.rb +86 -0
  206. data/lib/stripe/services/capital_service.rb +15 -0
  207. data/lib/stripe/services/charge_service.rb +2010 -0
  208. data/lib/stripe/services/checkout/session_line_item_service.rb +21 -0
  209. data/lib/stripe/services/checkout/session_service.rb +2736 -0
  210. data/lib/stripe/services/climate/order_service.rb +113 -0
  211. data/lib/stripe/services/climate/product_service.rb +30 -0
  212. data/lib/stripe/services/climate/supplier_service.rb +30 -0
  213. data/lib/stripe/services/confirmation_token_service.rb +9 -0
  214. data/lib/stripe/services/country_spec_service.rb +30 -0
  215. data/lib/stripe/services/coupon_service.rb +174 -0
  216. data/lib/stripe/services/credit_note_line_item_service.rb +21 -0
  217. data/lib/stripe/services/credit_note_preview_lines_service.rb +184 -0
  218. data/lib/stripe/services/credit_note_service.rb +434 -0
  219. data/lib/stripe/services/customer_balance_transaction_service.rb +72 -0
  220. data/lib/stripe/services/customer_cash_balance_service.rb +30 -0
  221. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +30 -0
  222. data/lib/stripe/services/customer_funding_instructions_service.rb +47 -0
  223. data/lib/stripe/services/customer_payment_method_service.rb +45 -0
  224. data/lib/stripe/services/customer_payment_source_service.rb +208 -0
  225. data/lib/stripe/services/customer_service.rb +684 -0
  226. data/lib/stripe/services/customer_session_service.rb +106 -0
  227. data/lib/stripe/services/customer_tax_id_service.rb +50 -0
  228. data/lib/stripe/services/dispute_service.rb +439 -0
  229. data/lib/stripe/services/entitlements/active_entitlement_service.rb +40 -0
  230. data/lib/stripe/services/entitlements/feature_service.rb +87 -0
  231. data/lib/stripe/services/ephemeral_key_service.rb +40 -0
  232. data/lib/stripe/services/event_service.rb +75 -0
  233. data/lib/stripe/services/exchange_rate_service.rb +30 -0
  234. data/lib/stripe/services/file_link_service.rb +108 -0
  235. data/lib/stripe/services/file_service.rb +102 -0
  236. data/lib/stripe/services/financial_connections/account_inferred_balance_service.rb +40 -0
  237. data/lib/stripe/services/financial_connections/account_owner_service.rb +31 -0
  238. data/lib/stripe/services/financial_connections/account_service.rb +108 -1
  239. data/lib/stripe/services/financial_connections/institution_service.rb +60 -0
  240. data/lib/stripe/services/financial_connections/session_service.rb +108 -0
  241. data/lib/stripe/services/financial_connections/transaction_service.rb +79 -0
  242. data/lib/stripe/services/financial_connections_service.rb +2 -1
  243. data/lib/stripe/services/forwarding/request_service.rb +120 -0
  244. data/lib/stripe/services/gift_cards/card_service.rb +183 -0
  245. data/lib/stripe/services/gift_cards/transaction_service.rb +225 -0
  246. data/lib/stripe/services/gift_cards_service.rb +14 -0
  247. data/lib/stripe/services/identity/verification_report_service.rb +75 -0
  248. data/lib/stripe/services/identity/verification_session_service.rb +261 -0
  249. data/lib/stripe/services/invoice_item_service.rb +454 -0
  250. data/lib/stripe/services/invoice_line_item_service.rb +277 -0
  251. data/lib/stripe/services/invoice_payment_service.rb +58 -0
  252. data/lib/stripe/services/invoice_rendering_template_service.rb +56 -0
  253. data/lib/stripe/services/invoice_service.rb +6375 -1
  254. data/lib/stripe/services/invoice_upcoming_lines_service.rb +2142 -0
  255. data/lib/stripe/services/issuing/authorization_service.rb +118 -0
  256. data/lib/stripe/services/issuing/card_service.rb +525 -0
  257. data/lib/stripe/services/issuing/cardholder_service.rb +599 -0
  258. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +560 -0
  259. data/lib/stripe/services/issuing/dispute_service.rb +731 -0
  260. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +70 -0
  261. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +90 -0
  262. data/lib/stripe/services/issuing/personalization_design_service.rb +222 -0
  263. data/lib/stripe/services/issuing/physical_bundle_service.rb +45 -0
  264. data/lib/stripe/services/issuing/token_service.rb +83 -0
  265. data/lib/stripe/services/issuing/transaction_service.rb +93 -0
  266. data/lib/stripe/services/issuing_service.rb +5 -1
  267. data/lib/stripe/services/mandate_service.rb +9 -0
  268. data/lib/stripe/services/margin_service.rb +130 -0
  269. data/lib/stripe/services/order_line_item_service.rb +38 -0
  270. data/lib/stripe/services/order_service.rb +2518 -0
  271. data/lib/stripe/services/payment_attempt_record_service.rb +50 -0
  272. data/lib/stripe/services/payment_intent_service.rb +12203 -0
  273. data/lib/stripe/services/payment_link_line_item_service.rb +21 -0
  274. data/lib/stripe/services/payment_link_service.rb +1343 -0
  275. data/lib/stripe/services/payment_method_configuration_service.rb +2148 -0
  276. data/lib/stripe/services/payment_method_domain_service.rb +84 -0
  277. data/lib/stripe/services/payment_method_service.rb +977 -0
  278. data/lib/stripe/services/payment_record_service.rb +610 -0
  279. data/lib/stripe/services/payout_service.rb +182 -0
  280. data/lib/stripe/services/plan_service.rb +296 -0
  281. data/lib/stripe/services/price_service.rb +603 -0
  282. data/lib/stripe/services/product_feature_service.rb +46 -0
  283. data/lib/stripe/services/product_service.rb +533 -0
  284. data/lib/stripe/services/promotion_code_service.rb +203 -0
  285. data/lib/stripe/services/quote_computed_upfront_line_items_service.rb +21 -0
  286. data/lib/stripe/services/quote_line_item_service.rb +21 -0
  287. data/lib/stripe/services/quote_line_service.rb +38 -0
  288. data/lib/stripe/services/quote_preview_invoice_service.rb +38 -0
  289. data/lib/stripe/services/quote_preview_subscription_schedule_service.rb +38 -0
  290. data/lib/stripe/services/quote_service.rb +2628 -1
  291. data/lib/stripe/services/radar/early_fraud_warning_service.rb +70 -0
  292. data/lib/stripe/services/radar/value_list_item_service.rb +90 -0
  293. data/lib/stripe/services/radar/value_list_service.rb +119 -0
  294. data/lib/stripe/services/refund_service.rb +158 -0
  295. data/lib/stripe/services/reporting/report_run_service.rb +122 -0
  296. data/lib/stripe/services/reporting/report_type_service.rb +18 -0
  297. data/lib/stripe/services/review_service.rb +63 -0
  298. data/lib/stripe/services/setup_attempt_service.rb +59 -0
  299. data/lib/stripe/services/setup_intent_service.rb +3923 -0
  300. data/lib/stripe/services/shipping_rate_service.rb +227 -0
  301. data/lib/stripe/services/sigma/scheduled_query_run_service.rb +30 -0
  302. data/lib/stripe/services/source_service.rb +693 -0
  303. data/lib/stripe/services/source_transaction_service.rb +21 -0
  304. data/lib/stripe/services/subscription_item_service.rb +439 -0
  305. data/lib/stripe/services/subscription_item_usage_record_service.rb +21 -0
  306. data/lib/stripe/services/subscription_item_usage_record_summary_service.rb +21 -0
  307. data/lib/stripe/services/subscription_schedule_service.rb +2343 -0
  308. data/lib/stripe/services/subscription_service.rb +1967 -0
  309. data/lib/stripe/services/tax/association_service.rb +32 -0
  310. data/lib/stripe/services/tax/calculation_line_item_service.rb +21 -0
  311. data/lib/stripe/services/tax/calculation_service.rb +235 -0
  312. data/lib/stripe/services/tax/form_service.rb +107 -0
  313. data/lib/stripe/services/tax/registration_service.rb +1398 -0
  314. data/lib/stripe/services/tax/settings_service.rb +82 -0
  315. data/lib/stripe/services/tax/transaction_line_item_service.rb +21 -0
  316. data/lib/stripe/services/tax/transaction_service.rb +128 -0
  317. data/lib/stripe/services/tax_code_service.rb +30 -0
  318. data/lib/stripe/services/tax_id_service.rb +90 -0
  319. data/lib/stripe/services/tax_rate_service.rb +182 -0
  320. data/lib/stripe/services/tax_service.rb +3 -1
  321. data/lib/stripe/services/terminal/configuration_service.rb +901 -0
  322. data/lib/stripe/services/terminal/connection_token_service.rb +13 -0
  323. data/lib/stripe/services/terminal/location_service.rb +165 -0
  324. data/lib/stripe/services/terminal/reader_collected_data_service.rb +28 -0
  325. data/lib/stripe/services/terminal/reader_service.rb +496 -0
  326. data/lib/stripe/services/terminal_service.rb +2 -1
  327. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +762 -0
  328. data/lib/stripe/services/test_helpers/customer_service.rb +21 -0
  329. data/lib/stripe/services/test_helpers/issuing/authorization_service.rb +844 -0
  330. data/lib/stripe/services/test_helpers/issuing/card_service.rb +45 -0
  331. data/lib/stripe/services/test_helpers/issuing/personalization_design_service.rb +43 -0
  332. data/lib/stripe/services/test_helpers/issuing/transaction_service.rb +723 -0
  333. data/lib/stripe/services/test_helpers/refund_service.rb +9 -0
  334. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +48 -0
  335. data/lib/stripe/services/test_helpers/test_clock_service.rb +63 -0
  336. data/lib/stripe/services/test_helpers/treasury/inbound_transfer_service.rb +39 -0
  337. data/lib/stripe/services/test_helpers/treasury/outbound_payment_service.rb +93 -0
  338. data/lib/stripe/services/test_helpers/treasury/outbound_transfer_service.rb +93 -0
  339. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +95 -0
  340. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +95 -0
  341. data/lib/stripe/services/token_service.rb +1301 -0
  342. data/lib/stripe/services/topup_service.rb +163 -0
  343. data/lib/stripe/services/transfer_reversal_service.rb +74 -0
  344. data/lib/stripe/services/transfer_service.rb +138 -0
  345. data/lib/stripe/services/treasury/credit_reversal_service.rb +67 -0
  346. data/lib/stripe/services/treasury/debit_reversal_service.rb +72 -0
  347. data/lib/stripe/services/treasury/financial_account_features_service.rb +179 -0
  348. data/lib/stripe/services/treasury/financial_account_service.rb +481 -0
  349. data/lib/stripe/services/treasury/inbound_transfer_service.rb +100 -0
  350. data/lib/stripe/services/treasury/outbound_payment_service.rb +296 -0
  351. data/lib/stripe/services/treasury/outbound_transfer_service.rb +147 -0
  352. data/lib/stripe/services/treasury/received_credit_service.rb +58 -0
  353. data/lib/stripe/services/treasury/received_debit_service.rb +45 -0
  354. data/lib/stripe/services/treasury/transaction_entry_service.rb +101 -0
  355. data/lib/stripe/services/treasury/transaction_service.rb +109 -0
  356. data/lib/stripe/services/v1_services.rb +8 -1
  357. data/lib/stripe/services/v2/billing/meter_event_adjustment_service.rb +25 -0
  358. data/lib/stripe/services/v2/billing/meter_event_service.rb +28 -0
  359. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +3 -0
  360. data/lib/stripe/services/v2/billing/meter_event_stream_service.rb +36 -0
  361. data/lib/stripe/services/v2/core/event_destination_service.rb +164 -0
  362. data/lib/stripe/services/v2/core/event_service.rb +20 -0
  363. data/lib/stripe/services/webhook_endpoint_service.rb +110 -0
  364. data/lib/stripe/services.rb +25 -0
  365. data/lib/stripe/stripe_client.rb +2 -2
  366. data/lib/stripe/stripe_configuration.rb +3 -1
  367. data/lib/stripe/stripe_object.rb +8 -3
  368. data/lib/stripe/util.rb +8 -2
  369. data/lib/stripe/version.rb +1 -1
  370. data/lib/stripe.rb +46 -0
  371. data/rbi/stripe/resources/account.rbi +6072 -0
  372. data/rbi/stripe/resources/account_link.rbi +87 -0
  373. data/rbi/stripe/resources/account_notice.rbi +166 -0
  374. data/rbi/stripe/resources/account_session.rbi +1173 -0
  375. data/rbi/stripe/resources/apple_pay_domain.rbi +111 -0
  376. data/rbi/stripe/resources/application.rbi +23 -0
  377. data/rbi/stripe/resources/application_fee.rbi +151 -0
  378. data/rbi/stripe/resources/application_fee_refund.rbi +44 -0
  379. data/rbi/stripe/resources/apps/secret.rbi +229 -0
  380. data/rbi/stripe/resources/balance.rbi +220 -0
  381. data/rbi/stripe/resources/balance_transaction.rbi +182 -0
  382. data/rbi/stripe/resources/bank_account.rbi +156 -0
  383. data/rbi/stripe/resources/billing/alert.rbi +237 -0
  384. data/rbi/stripe/resources/billing/alert_triggered.rbi +33 -0
  385. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +118 -0
  386. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +181 -0
  387. data/rbi/stripe/resources/billing/credit_grant.rbi +312 -0
  388. data/rbi/stripe/resources/billing/meter.rbi +268 -0
  389. data/rbi/stripe/resources/billing/meter_error_report.rbi +82 -0
  390. data/rbi/stripe/resources/billing/meter_event.rbi +76 -0
  391. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +75 -0
  392. data/rbi/stripe/resources/billing/meter_event_summary.rbi +39 -0
  393. data/rbi/stripe/resources/billing_portal/configuration.rbi +746 -0
  394. data/rbi/stripe/resources/billing_portal/session.rbi +396 -0
  395. data/rbi/stripe/resources/capability.rbi +152 -0
  396. data/rbi/stripe/resources/capital/financing_offer.rbi +228 -0
  397. data/rbi/stripe/resources/capital/financing_summary.rbi +89 -0
  398. data/rbi/stripe/resources/capital/financing_transaction.rbi +157 -0
  399. data/rbi/stripe/resources/card.rbi +159 -0
  400. data/rbi/stripe/resources/cash_balance.rbi +37 -0
  401. data/rbi/stripe/resources/charge.rbi +4216 -0
  402. data/rbi/stripe/resources/checkout/session.rbi +4627 -0
  403. data/rbi/stripe/resources/climate/order.rbi +298 -0
  404. data/rbi/stripe/resources/climate/product.rbi +98 -0
  405. data/rbi/stripe/resources/climate/supplier.rbi +95 -0
  406. data/rbi/stripe/resources/confirmation_token.rbi +2137 -0
  407. data/rbi/stripe/resources/connect_collection_transfer.rbi +31 -0
  408. data/rbi/stripe/resources/country_spec.rbi +108 -0
  409. data/rbi/stripe/resources/coupon.rbi +305 -0
  410. data/rbi/stripe/resources/credit_note.rbi +918 -0
  411. data/rbi/stripe/resources/credit_note_line_item.rbi +123 -0
  412. data/rbi/stripe/resources/customer.rbi +1188 -0
  413. data/rbi/stripe/resources/customer_balance_transaction.rbi +65 -0
  414. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +178 -0
  415. data/rbi/stripe/resources/customer_session.rbi +227 -0
  416. data/rbi/stripe/resources/discount.rbi +65 -0
  417. data/rbi/stripe/resources/dispute.rbi +926 -0
  418. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +76 -0
  419. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +26 -0
  420. data/rbi/stripe/resources/entitlements/feature.rbi +146 -0
  421. data/rbi/stripe/resources/ephemeral_key.rbi +51 -0
  422. data/rbi/stripe/resources/event.rbi +221 -0
  423. data/rbi/stripe/resources/exchange_rate.rbi +81 -0
  424. data/rbi/stripe/resources/file.rbi +177 -0
  425. data/rbi/stripe/resources/file_link.rbi +174 -0
  426. data/rbi/stripe/resources/financial_connections/account.rbi +414 -0
  427. data/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi +30 -0
  428. data/rbi/stripe/resources/financial_connections/account_owner.rbi +42 -0
  429. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +26 -0
  430. data/rbi/stripe/resources/financial_connections/institution.rbi +115 -0
  431. data/rbi/stripe/resources/financial_connections/session.rbi +221 -0
  432. data/rbi/stripe/resources/financial_connections/transaction.rbi +153 -0
  433. data/rbi/stripe/resources/forwarding/request.rbi +257 -0
  434. data/rbi/stripe/resources/funding_instructions.rbi +544 -0
  435. data/rbi/stripe/resources/gift_cards/card.rbi +242 -0
  436. data/rbi/stripe/resources/gift_cards/transaction.rbi +298 -0
  437. data/rbi/stripe/resources/identity/verification_report.rbi +427 -0
  438. data/rbi/stripe/resources/identity/verification_session.rbi +601 -0
  439. data/rbi/stripe/resources/invoice.rbi +10584 -0
  440. data/rbi/stripe/resources/invoice_item.rbi +621 -0
  441. data/rbi/stripe/resources/invoice_line_item.rbi +486 -0
  442. data/rbi/stripe/resources/invoice_payment.rbi +86 -0
  443. data/rbi/stripe/resources/invoice_rendering_template.rbi +131 -0
  444. data/rbi/stripe/resources/issuing/authorization.rbi +1511 -0
  445. data/rbi/stripe/resources/issuing/card.rbi +891 -0
  446. data/rbi/stripe/resources/issuing/cardholder.rbi +870 -0
  447. data/rbi/stripe/resources/issuing/credit_underwriting_record.rbi +731 -0
  448. data/rbi/stripe/resources/issuing/dispute.rbi +1077 -0
  449. data/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi +100 -0
  450. data/rbi/stripe/resources/issuing/fraud_liability_debit.rbi +108 -0
  451. data/rbi/stripe/resources/issuing/personalization_design.rbi +395 -0
  452. data/rbi/stripe/resources/issuing/physical_bundle.rbi +102 -0
  453. data/rbi/stripe/resources/issuing/settlement.rbi +78 -0
  454. data/rbi/stripe/resources/issuing/token.rbi +282 -0
  455. data/rbi/stripe/resources/issuing/transaction.rbi +1262 -0
  456. data/rbi/stripe/resources/line_item.rbi +131 -0
  457. data/rbi/stripe/resources/login_link.rbi +20 -0
  458. data/rbi/stripe/resources/mandate.rbi +266 -0
  459. data/rbi/stripe/resources/margin.rbi +151 -0
  460. data/rbi/stripe/resources/order.rbi +3505 -0
  461. data/rbi/stripe/resources/payment_attempt_record.rbi +260 -0
  462. data/rbi/stripe/resources/payment_intent.rbi +16064 -0
  463. data/rbi/stripe/resources/payment_link.rbi +1943 -0
  464. data/rbi/stripe/resources/payment_method.rbi +2287 -0
  465. data/rbi/stripe/resources/payment_method_configuration.rbi +3657 -0
  466. data/rbi/stripe/resources/payment_method_domain.rbi +246 -0
  467. data/rbi/stripe/resources/payment_record.rbi +856 -0
  468. data/rbi/stripe/resources/payout.rbi +357 -0
  469. data/rbi/stripe/resources/person.rbi +461 -0
  470. data/rbi/stripe/resources/plan.rbi +463 -0
  471. data/rbi/stripe/resources/price.rbi +884 -0
  472. data/rbi/stripe/resources/product.rbi +735 -0
  473. data/rbi/stripe/resources/product_feature.rbi +30 -0
  474. data/rbi/stripe/resources/promotion_code.rbi +316 -0
  475. data/rbi/stripe/resources/quote.rbi +3779 -0
  476. data/rbi/stripe/resources/quote_line.rbi +416 -0
  477. data/rbi/stripe/resources/quote_preview_invoice.rbi +1030 -0
  478. data/rbi/stripe/resources/quote_preview_subscription_schedule.rbi +575 -0
  479. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +121 -0
  480. data/rbi/stripe/resources/radar/value_list.rbi +207 -0
  481. data/rbi/stripe/resources/radar/value_list_item.rbi +157 -0
  482. data/rbi/stripe/resources/refund.rbi +615 -0
  483. data/rbi/stripe/resources/reporting/report_run.rbi +232 -0
  484. data/rbi/stripe/resources/reporting/report_type.rbi +75 -0
  485. data/rbi/stripe/resources/reserve_transaction.rbi +27 -0
  486. data/rbi/stripe/resources/reversal.rbi +60 -0
  487. data/rbi/stripe/resources/review.rbi +191 -0
  488. data/rbi/stripe/resources/setup_attempt.rbi +587 -0
  489. data/rbi/stripe/resources/setup_intent.rbi +4726 -0
  490. data/rbi/stripe/resources/shipping_rate.rbi +367 -0
  491. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +98 -0
  492. data/rbi/stripe/resources/source.rbi +1899 -0
  493. data/rbi/stripe/resources/source_mandate_notification.rbi +90 -0
  494. data/rbi/stripe/resources/source_transaction.rbi +156 -0
  495. data/rbi/stripe/resources/subscription.rbi +2739 -0
  496. data/rbi/stripe/resources/subscription_item.rbi +566 -0
  497. data/rbi/stripe/resources/subscription_schedule.rbi +3157 -0
  498. data/rbi/stripe/resources/tax/association.rbi +107 -0
  499. data/rbi/stripe/resources/tax/calculation.rbi +577 -0
  500. data/rbi/stripe/resources/tax/calculation_line_item.rbi +108 -0
  501. data/rbi/stripe/resources/tax/form.rbi +262 -0
  502. data/rbi/stripe/resources/tax/registration.rbi +2354 -0
  503. data/rbi/stripe/resources/tax/settings.rbi +174 -0
  504. data/rbi/stripe/resources/tax/transaction.rbi +428 -0
  505. data/rbi/stripe/resources/tax/transaction_line_item.rbi +66 -0
  506. data/rbi/stripe/resources/tax_code.rbi +60 -0
  507. data/rbi/stripe/resources/tax_deducted_at_source.rbi +27 -0
  508. data/rbi/stripe/resources/tax_id.rbi +206 -0
  509. data/rbi/stripe/resources/tax_rate.rbi +295 -0
  510. data/rbi/stripe/resources/terminal/configuration.rbi +1302 -0
  511. data/rbi/stripe/resources/terminal/connection_token.rbi +42 -0
  512. data/rbi/stripe/resources/terminal/location.rbi +271 -0
  513. data/rbi/stripe/resources/terminal/reader.rbi +1110 -0
  514. data/rbi/stripe/resources/terminal/reader_collected_data.rbi +48 -0
  515. data/rbi/stripe/resources/test_helpers/test_clock.rbi +159 -0
  516. data/rbi/stripe/resources/token.rbi +1405 -0
  517. data/rbi/stripe/resources/topup.rbi +269 -0
  518. data/rbi/stripe/resources/transfer.rbi +245 -0
  519. data/rbi/stripe/resources/treasury/credit_reversal.rbi +151 -0
  520. data/rbi/stripe/resources/treasury/debit_reversal.rbi +165 -0
  521. data/rbi/stripe/resources/treasury/financial_account.rbi +924 -0
  522. data/rbi/stripe/resources/treasury/financial_account_features.rbi +309 -0
  523. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +361 -0
  524. data/rbi/stripe/resources/treasury/outbound_payment.rbi +702 -0
  525. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +529 -0
  526. data/rbi/stripe/resources/treasury/received_credit.rbi +408 -0
  527. data/rbi/stripe/resources/treasury/received_debit.rbi +367 -0
  528. data/rbi/stripe/resources/treasury/transaction.rbi +261 -0
  529. data/rbi/stripe/resources/treasury/transaction_entry.rbi +234 -0
  530. data/rbi/stripe/resources/usage_record.rbi +37 -0
  531. data/rbi/stripe/resources/usage_record_summary.rbi +45 -0
  532. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  533. data/rbi/stripe/resources/v2/billing/meter_event.rbi +43 -0
  534. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +48 -0
  535. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +36 -0
  536. data/rbi/stripe/resources/v2/event.rbi +55 -0
  537. data/rbi/stripe/resources/v2/event_destination.rbi +109 -0
  538. data/rbi/stripe/resources/webhook_endpoint.rbi +208 -0
  539. data/rbi/stripe/services/account_capability_service.rbi +55 -0
  540. data/rbi/stripe/services/account_external_account_service.rbi +358 -0
  541. data/rbi/stripe/services/account_link_service.rbi +67 -0
  542. data/rbi/stripe/services/account_login_link_service.rbi +23 -0
  543. data/rbi/stripe/services/account_notice_service.rbi +103 -0
  544. data/rbi/stripe/services/account_person_service.rbi +1077 -0
  545. data/rbi/stripe/services/account_service.rbi +4948 -0
  546. data/rbi/stripe/services/account_session_service.rbi +873 -0
  547. data/rbi/stripe/services/apple_pay_domain_service.rbi +86 -0
  548. data/rbi/stripe/services/application_fee_refund_service.rbi +101 -0
  549. data/rbi/stripe/services/application_fee_service.rbi +85 -0
  550. data/rbi/stripe/services/apps/secret_service.rbi +175 -0
  551. data/rbi/stripe/services/apps_service.rbi +9 -0
  552. data/rbi/stripe/services/balance_service.rbi +22 -0
  553. data/rbi/stripe/services/balance_transaction_service.rbi +103 -0
  554. data/rbi/stripe/services/billing/alert_service.rbi +172 -0
  555. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +61 -0
  556. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +66 -0
  557. data/rbi/stripe/services/billing/credit_grant_service.rbi +217 -0
  558. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +45 -0
  559. data/rbi/stripe/services/billing/meter_event_service.rbi +47 -0
  560. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +62 -0
  561. data/rbi/stripe/services/billing/meter_service.rbi +184 -0
  562. data/rbi/stripe/services/billing_portal/configuration_service.rbi +573 -0
  563. data/rbi/stripe/services/billing_portal/session_service.rbi +233 -0
  564. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  565. data/rbi/stripe/services/billing_service.rbi +15 -0
  566. data/rbi/stripe/services/capital/financing_offer_service.rbi +108 -0
  567. data/rbi/stripe/services/capital/financing_summary_service.rbi +23 -0
  568. data/rbi/stripe/services/capital/financing_transaction_service.rbi +77 -0
  569. data/rbi/stripe/services/capital_service.rbi +11 -0
  570. data/rbi/stripe/services/charge_service.rbi +2162 -0
  571. data/rbi/stripe/services/checkout/session_line_item_service.rbi +37 -0
  572. data/rbi/stripe/services/checkout/session_service.rbi +2975 -0
  573. data/rbi/stripe/services/checkout_service.rbi +9 -0
  574. data/rbi/stripe/services/climate/order_service.rbi +158 -0
  575. data/rbi/stripe/services/climate/product_service.rbi +51 -0
  576. data/rbi/stripe/services/climate/supplier_service.rbi +51 -0
  577. data/rbi/stripe/services/climate_service.rbi +11 -0
  578. data/rbi/stripe/services/confirmation_token_service.rbi +21 -0
  579. data/rbi/stripe/services/country_spec_service.rbi +49 -0
  580. data/rbi/stripe/services/coupon_service.rbi +220 -0
  581. data/rbi/stripe/services/credit_note_line_item_service.rbi +35 -0
  582. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +200 -0
  583. data/rbi/stripe/services/credit_note_service.rbi +496 -0
  584. data/rbi/stripe/services/customer_balance_transaction_service.rbi +105 -0
  585. data/rbi/stripe/services/customer_cash_balance_service.rbi +49 -0
  586. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +49 -0
  587. data/rbi/stripe/services/customer_funding_instructions_service.rbi +67 -0
  588. data/rbi/stripe/services/customer_payment_method_service.rbi +64 -0
  589. data/rbi/stripe/services/customer_payment_source_service.rbi +265 -0
  590. data/rbi/stripe/services/customer_service.rbi +763 -0
  591. data/rbi/stripe/services/customer_session_service.rbi +126 -0
  592. data/rbi/stripe/services/customer_tax_id_service.rbi +80 -0
  593. data/rbi/stripe/services/dispute_service.rbi +500 -0
  594. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +61 -0
  595. data/rbi/stripe/services/entitlements/feature_service.rbi +122 -0
  596. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  597. data/rbi/stripe/services/ephemeral_key_service.rbi +59 -0
  598. data/rbi/stripe/services/event_service.rbi +94 -0
  599. data/rbi/stripe/services/exchange_rate_service.rbi +49 -0
  600. data/rbi/stripe/services/file_link_service.rbi +141 -0
  601. data/rbi/stripe/services/file_service.rbi +132 -0
  602. data/rbi/stripe/services/financial_connections/account_inferred_balance_service.rbi +37 -0
  603. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +47 -0
  604. data/rbi/stripe/services/financial_connections/account_service.rbi +148 -0
  605. data/rbi/stripe/services/financial_connections/institution_service.rbi +51 -0
  606. data/rbi/stripe/services/financial_connections/session_service.rbi +128 -0
  607. data/rbi/stripe/services/financial_connections/transaction_service.rbi +103 -0
  608. data/rbi/stripe/services/financial_connections_service.rbi +12 -0
  609. data/rbi/stripe/services/forwarding/request_service.rbi +152 -0
  610. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  611. data/rbi/stripe/services/gift_cards/card_service.rbi +162 -0
  612. data/rbi/stripe/services/gift_cards/transaction_service.rbi +198 -0
  613. data/rbi/stripe/services/gift_cards_service.rbi +10 -0
  614. data/rbi/stripe/services/identity/verification_report_service.rbi +98 -0
  615. data/rbi/stripe/services/identity/verification_session_service.rbi +360 -0
  616. data/rbi/stripe/services/identity_service.rbi +10 -0
  617. data/rbi/stripe/services/invoice_item_service.rbi +505 -0
  618. data/rbi/stripe/services/invoice_line_item_service.rbi +320 -0
  619. data/rbi/stripe/services/invoice_payment_service.rbi +49 -0
  620. data/rbi/stripe/services/invoice_rendering_template_service.rbi +91 -0
  621. data/rbi/stripe/services/invoice_service.rbi +7138 -0
  622. data/rbi/stripe/services/invoice_upcoming_lines_service.rbi +2397 -0
  623. data/rbi/stripe/services/issuing/authorization_service.rbi +160 -0
  624. data/rbi/stripe/services/issuing/card_service.rbi +568 -0
  625. data/rbi/stripe/services/issuing/cardholder_service.rbi +668 -0
  626. data/rbi/stripe/services/issuing/credit_underwriting_record_service.rbi +580 -0
  627. data/rbi/stripe/services/issuing/dispute_service.rbi +824 -0
  628. data/rbi/stripe/services/issuing/dispute_settlement_detail_service.rbi +61 -0
  629. data/rbi/stripe/services/issuing/fraud_liability_debit_service.rbi +83 -0
  630. data/rbi/stripe/services/issuing/personalization_design_service.rbi +271 -0
  631. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +66 -0
  632. data/rbi/stripe/services/issuing/token_service.rbi +109 -0
  633. data/rbi/stripe/services/issuing/transaction_service.rbi +119 -0
  634. data/rbi/stripe/services/issuing_service.rbi +19 -0
  635. data/rbi/stripe/services/mandate_service.rbi +21 -0
  636. data/rbi/stripe/services/margin_service.rbi +119 -0
  637. data/rbi/stripe/services/order_line_item_service.rbi +35 -0
  638. data/rbi/stripe/services/order_service.rbi +2669 -0
  639. data/rbi/stripe/services/payment_attempt_record_service.rbi +39 -0
  640. data/rbi/stripe/services/payment_intent_service.rbi +13193 -0
  641. data/rbi/stripe/services/payment_link_line_item_service.rbi +35 -0
  642. data/rbi/stripe/services/payment_link_service.rbi +1447 -0
  643. data/rbi/stripe/services/payment_method_configuration_service.rbi +2465 -0
  644. data/rbi/stripe/services/payment_method_domain_service.rbi +123 -0
  645. data/rbi/stripe/services/payment_method_service.rbi +1032 -0
  646. data/rbi/stripe/services/payment_record_service.rbi +613 -0
  647. data/rbi/stripe/services/payout_service.rbi +228 -0
  648. data/rbi/stripe/services/plan_service.rbi +337 -0
  649. data/rbi/stripe/services/price_service.rbi +657 -0
  650. data/rbi/stripe/services/product_feature_service.rbi +76 -0
  651. data/rbi/stripe/services/product_service.rbi +596 -0
  652. data/rbi/stripe/services/promotion_code_service.rbi +244 -0
  653. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +35 -0
  654. data/rbi/stripe/services/quote_line_item_service.rbi +35 -0
  655. data/rbi/stripe/services/quote_line_service.rbi +35 -0
  656. data/rbi/stripe/services/quote_preview_invoice_service.rbi +35 -0
  657. data/rbi/stripe/services/quote_preview_subscription_schedule_service.rbi +35 -0
  658. data/rbi/stripe/services/quote_service.rbi +2830 -0
  659. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +95 -0
  660. data/rbi/stripe/services/radar/value_list_item_service.rbi +122 -0
  661. data/rbi/stripe/services/radar/value_list_service.rbi +160 -0
  662. data/rbi/stripe/services/radar_service.rbi +11 -0
  663. data/rbi/stripe/services/refund_service.rbi +208 -0
  664. data/rbi/stripe/services/reporting/report_run_service.rbi +152 -0
  665. data/rbi/stripe/services/reporting/report_type_service.rbi +37 -0
  666. data/rbi/stripe/services/reporting_service.rbi +10 -0
  667. data/rbi/stripe/services/review_service.rbi +93 -0
  668. data/rbi/stripe/services/setup_attempt_service.rbi +73 -0
  669. data/rbi/stripe/services/setup_intent_service.rbi +4204 -0
  670. data/rbi/stripe/services/shipping_rate_service.rbi +274 -0
  671. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +51 -0
  672. data/rbi/stripe/services/sigma_service.rbi +9 -0
  673. data/rbi/stripe/services/source_service.rbi +766 -0
  674. data/rbi/stripe/services/source_transaction_service.rbi +35 -0
  675. data/rbi/stripe/services/subscription_item_service.rbi +496 -0
  676. data/rbi/stripe/services/subscription_item_usage_record_service.rbi +41 -0
  677. data/rbi/stripe/services/subscription_item_usage_record_summary_service.rbi +37 -0
  678. data/rbi/stripe/services/subscription_schedule_service.rbi +2613 -0
  679. data/rbi/stripe/services/subscription_service.rbi +2207 -0
  680. data/rbi/stripe/services/tax/association_service.rbi +27 -0
  681. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +37 -0
  682. data/rbi/stripe/services/tax/calculation_service.rbi +267 -0
  683. data/rbi/stripe/services/tax/form_service.rbi +96 -0
  684. data/rbi/stripe/services/tax/registration_service.rbi +1495 -0
  685. data/rbi/stripe/services/tax/settings_service.rbi +106 -0
  686. data/rbi/stripe/services/tax/transaction_line_item_service.rbi +37 -0
  687. data/rbi/stripe/services/tax/transaction_service.rbi +164 -0
  688. data/rbi/stripe/services/tax_code_service.rbi +49 -0
  689. data/rbi/stripe/services/tax_id_service.rbi +128 -0
  690. data/rbi/stripe/services/tax_rate_service.rbi +215 -0
  691. data/rbi/stripe/services/tax_service.rbi +14 -0
  692. data/rbi/stripe/services/terminal/configuration_service.rbi +976 -0
  693. data/rbi/stripe/services/terminal/connection_token_service.rbi +27 -0
  694. data/rbi/stripe/services/terminal/location_service.rbi +211 -0
  695. data/rbi/stripe/services/terminal/reader_collected_data_service.rbi +23 -0
  696. data/rbi/stripe/services/terminal/reader_service.rbi +591 -0
  697. data/rbi/stripe/services/terminal_service.rbi +13 -0
  698. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +892 -0
  699. data/rbi/stripe/services/test_helpers/customer_service.rbi +37 -0
  700. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +974 -0
  701. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +81 -0
  702. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +73 -0
  703. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +825 -0
  704. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  705. data/rbi/stripe/services/test_helpers/refund_service.rbi +23 -0
  706. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +69 -0
  707. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  708. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +100 -0
  709. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +69 -0
  710. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +137 -0
  711. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +137 -0
  712. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +130 -0
  713. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +130 -0
  714. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  715. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  716. data/rbi/stripe/services/token_service.rbi +1357 -0
  717. data/rbi/stripe/services/topup_service.rbi +200 -0
  718. data/rbi/stripe/services/transfer_reversal_service.rbi +111 -0
  719. data/rbi/stripe/services/transfer_service.rbi +174 -0
  720. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +95 -0
  721. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +100 -0
  722. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +226 -0
  723. data/rbi/stripe/services/treasury/financial_account_service.rbi +577 -0
  724. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +133 -0
  725. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +350 -0
  726. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +189 -0
  727. data/rbi/stripe/services/treasury/received_credit_service.rbi +79 -0
  728. data/rbi/stripe/services/treasury/received_debit_service.rbi +66 -0
  729. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +125 -0
  730. data/rbi/stripe/services/treasury/transaction_service.rbi +133 -0
  731. data/rbi/stripe/services/treasury_service.rbi +18 -0
  732. data/rbi/stripe/services/v1_services.rbi +83 -0
  733. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +43 -0
  734. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +46 -0
  735. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +20 -0
  736. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +60 -0
  737. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  738. data/rbi/stripe/services/v2/core/event_destination_service.rbi +228 -0
  739. data/rbi/stripe/services/v2/core/event_service.rbi +42 -0
  740. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  741. data/rbi/stripe/services/v2_services.rbi +10 -0
  742. data/rbi/stripe/services/webhook_endpoint_service.rbi +149 -0
  743. metadata +435 -4
@@ -3,6 +3,2148 @@
3
3
 
4
4
  module Stripe
5
5
  class InvoiceUpcomingLinesService < StripeService
6
+ class ListParams < Stripe::RequestParams
7
+ class AutomaticTax < Stripe::RequestParams
8
+ class Liability < Stripe::RequestParams
9
+ # The connected account being referenced when `type` is `account`.
10
+ attr_accessor :account
11
+
12
+ # Type of the account referenced in the request.
13
+ attr_accessor :type
14
+
15
+ def initialize(account: nil, type: nil)
16
+ @account = account
17
+ @type = type
18
+ end
19
+ end
20
+ # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
21
+ attr_accessor :enabled
22
+
23
+ # 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.
24
+ attr_accessor :liability
25
+
26
+ def initialize(enabled: nil, liability: nil)
27
+ @enabled = enabled
28
+ @liability = liability
29
+ end
30
+ end
31
+
32
+ class CustomerDetails < Stripe::RequestParams
33
+ class Address < Stripe::RequestParams
34
+ # City, district, suburb, town, or village.
35
+ attr_accessor :city
36
+
37
+ # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
38
+ attr_accessor :country
39
+
40
+ # Address line 1 (e.g., street, PO Box, or company name).
41
+ attr_accessor :line1
42
+
43
+ # Address line 2 (e.g., apartment, suite, unit, or building).
44
+ attr_accessor :line2
45
+
46
+ # ZIP or postal code.
47
+ attr_accessor :postal_code
48
+
49
+ # State, county, province, or region.
50
+ attr_accessor :state
51
+
52
+ def initialize(
53
+ city: nil,
54
+ country: nil,
55
+ line1: nil,
56
+ line2: nil,
57
+ postal_code: nil,
58
+ state: nil
59
+ )
60
+ @city = city
61
+ @country = country
62
+ @line1 = line1
63
+ @line2 = line2
64
+ @postal_code = postal_code
65
+ @state = state
66
+ end
67
+ end
68
+
69
+ class Shipping < Stripe::RequestParams
70
+ class Address < Stripe::RequestParams
71
+ # City, district, suburb, town, or village.
72
+ attr_accessor :city
73
+
74
+ # A freeform text field for the country. However, in order to activate some tax features, the format should be a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
75
+ attr_accessor :country
76
+
77
+ # Address line 1 (e.g., street, PO Box, or company name).
78
+ attr_accessor :line1
79
+
80
+ # Address line 2 (e.g., apartment, suite, unit, or building).
81
+ attr_accessor :line2
82
+
83
+ # ZIP or postal code.
84
+ attr_accessor :postal_code
85
+
86
+ # State, county, province, or region.
87
+ attr_accessor :state
88
+
89
+ def initialize(
90
+ city: nil,
91
+ country: nil,
92
+ line1: nil,
93
+ line2: nil,
94
+ postal_code: nil,
95
+ state: nil
96
+ )
97
+ @city = city
98
+ @country = country
99
+ @line1 = line1
100
+ @line2 = line2
101
+ @postal_code = postal_code
102
+ @state = state
103
+ end
104
+ end
105
+ # Customer shipping address.
106
+ attr_accessor :address
107
+
108
+ # Customer name.
109
+ attr_accessor :name
110
+
111
+ # Customer phone (including extension).
112
+ attr_accessor :phone
113
+
114
+ def initialize(address: nil, name: nil, phone: nil)
115
+ @address = address
116
+ @name = name
117
+ @phone = phone
118
+ end
119
+ end
120
+
121
+ class Tax < Stripe::RequestParams
122
+ # A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
123
+ attr_accessor :ip_address
124
+
125
+ def initialize(ip_address: nil)
126
+ @ip_address = ip_address
127
+ end
128
+ end
129
+
130
+ class TaxId < Stripe::RequestParams
131
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
132
+ attr_accessor :type
133
+
134
+ # Value of the tax ID.
135
+ attr_accessor :value
136
+
137
+ def initialize(type: nil, value: nil)
138
+ @type = type
139
+ @value = value
140
+ end
141
+ end
142
+ # The customer's address.
143
+ attr_accessor :address
144
+
145
+ # The customer's shipping information. Appears on invoices emailed to this customer.
146
+ attr_accessor :shipping
147
+
148
+ # Tax details about the customer.
149
+ attr_accessor :tax
150
+
151
+ # The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
152
+ attr_accessor :tax_exempt
153
+
154
+ # The customer's tax IDs.
155
+ attr_accessor :tax_ids
156
+
157
+ def initialize(address: nil, shipping: nil, tax: nil, tax_exempt: nil, tax_ids: nil)
158
+ @address = address
159
+ @shipping = shipping
160
+ @tax = tax
161
+ @tax_exempt = tax_exempt
162
+ @tax_ids = tax_ids
163
+ end
164
+ end
165
+
166
+ class Discount < Stripe::RequestParams
167
+ class DiscountEnd < Stripe::RequestParams
168
+ class Duration < Stripe::RequestParams
169
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
170
+ attr_accessor :interval
171
+
172
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
173
+ attr_accessor :interval_count
174
+
175
+ def initialize(interval: nil, interval_count: nil)
176
+ @interval = interval
177
+ @interval_count = interval_count
178
+ end
179
+ end
180
+ # Time span for the redeemed discount.
181
+ attr_accessor :duration
182
+
183
+ # A precise Unix timestamp for the discount to end. Must be in the future.
184
+ attr_accessor :timestamp
185
+
186
+ # The type of calculation made to determine when the discount ends.
187
+ attr_accessor :type
188
+
189
+ def initialize(duration: nil, timestamp: nil, type: nil)
190
+ @duration = duration
191
+ @timestamp = timestamp
192
+ @type = type
193
+ end
194
+ end
195
+ # ID of the coupon to create a new discount for.
196
+ attr_accessor :coupon
197
+
198
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
199
+ attr_accessor :discount
200
+
201
+ # Details to determine how long the discount should be applied for.
202
+ attr_accessor :discount_end
203
+
204
+ # ID of the promotion code to create a new discount for.
205
+ attr_accessor :promotion_code
206
+
207
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
208
+ @coupon = coupon
209
+ @discount = discount
210
+ @discount_end = discount_end
211
+ @promotion_code = promotion_code
212
+ end
213
+ end
214
+
215
+ class InvoiceItem < Stripe::RequestParams
216
+ class Discount < Stripe::RequestParams
217
+ class DiscountEnd < Stripe::RequestParams
218
+ class Duration < Stripe::RequestParams
219
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
220
+ attr_accessor :interval
221
+
222
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
223
+ attr_accessor :interval_count
224
+
225
+ def initialize(interval: nil, interval_count: nil)
226
+ @interval = interval
227
+ @interval_count = interval_count
228
+ end
229
+ end
230
+ # Time span for the redeemed discount.
231
+ attr_accessor :duration
232
+
233
+ # A precise Unix timestamp for the discount to end. Must be in the future.
234
+ attr_accessor :timestamp
235
+
236
+ # The type of calculation made to determine when the discount ends.
237
+ attr_accessor :type
238
+
239
+ def initialize(duration: nil, timestamp: nil, type: nil)
240
+ @duration = duration
241
+ @timestamp = timestamp
242
+ @type = type
243
+ end
244
+ end
245
+ # ID of the coupon to create a new discount for.
246
+ attr_accessor :coupon
247
+
248
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
249
+ attr_accessor :discount
250
+
251
+ # Details to determine how long the discount should be applied for.
252
+ attr_accessor :discount_end
253
+
254
+ # ID of the promotion code to create a new discount for.
255
+ attr_accessor :promotion_code
256
+
257
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
258
+ @coupon = coupon
259
+ @discount = discount
260
+ @discount_end = discount_end
261
+ @promotion_code = promotion_code
262
+ end
263
+ end
264
+
265
+ class Period < Stripe::RequestParams
266
+ # The end of the period, which must be greater than or equal to the start. This value is inclusive.
267
+ attr_accessor :end
268
+
269
+ # The start of the period. This value is inclusive.
270
+ attr_accessor :start
271
+
272
+ def initialize(end_: nil, start: nil)
273
+ @end = end_
274
+ @start = start
275
+ end
276
+ end
277
+
278
+ class PriceData < Stripe::RequestParams
279
+ # 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).
280
+ attr_accessor :currency
281
+
282
+ # The ID of the product that this price will belong to.
283
+ attr_accessor :product
284
+
285
+ # 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.
286
+ attr_accessor :tax_behavior
287
+
288
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
289
+ attr_accessor :unit_amount
290
+
291
+ # 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.
292
+ attr_accessor :unit_amount_decimal
293
+
294
+ def initialize(
295
+ currency: nil,
296
+ product: nil,
297
+ tax_behavior: nil,
298
+ unit_amount: nil,
299
+ unit_amount_decimal: nil
300
+ )
301
+ @currency = currency
302
+ @product = product
303
+ @tax_behavior = tax_behavior
304
+ @unit_amount = unit_amount
305
+ @unit_amount_decimal = unit_amount_decimal
306
+ end
307
+ end
308
+ # The integer amount in cents (or local equivalent) of previewed invoice item.
309
+ attr_accessor :amount
310
+
311
+ # 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). Only applicable to new invoice items.
312
+ attr_accessor :currency
313
+
314
+ # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
315
+ attr_accessor :description
316
+
317
+ # Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
318
+ attr_accessor :discountable
319
+
320
+ # The coupons to redeem into discounts for the invoice item in the preview.
321
+ attr_accessor :discounts
322
+
323
+ # The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
324
+ attr_accessor :invoiceitem
325
+
326
+ # 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`.
327
+ attr_accessor :metadata
328
+
329
+ # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
330
+ attr_accessor :period
331
+
332
+ # The ID of the price object. One of `price` or `price_data` is required.
333
+ attr_accessor :price
334
+
335
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
336
+ attr_accessor :price_data
337
+
338
+ # Non-negative integer. The quantity of units for the invoice item.
339
+ attr_accessor :quantity
340
+
341
+ # 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.
342
+ attr_accessor :tax_behavior
343
+
344
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
345
+ attr_accessor :tax_code
346
+
347
+ # The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
348
+ attr_accessor :tax_rates
349
+
350
+ # The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
351
+ attr_accessor :unit_amount
352
+
353
+ # 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.
354
+ attr_accessor :unit_amount_decimal
355
+
356
+ def initialize(
357
+ amount: nil,
358
+ currency: nil,
359
+ description: nil,
360
+ discountable: nil,
361
+ discounts: nil,
362
+ invoiceitem: nil,
363
+ metadata: nil,
364
+ period: nil,
365
+ price: nil,
366
+ price_data: nil,
367
+ quantity: nil,
368
+ tax_behavior: nil,
369
+ tax_code: nil,
370
+ tax_rates: nil,
371
+ unit_amount: nil,
372
+ unit_amount_decimal: nil
373
+ )
374
+ @amount = amount
375
+ @currency = currency
376
+ @description = description
377
+ @discountable = discountable
378
+ @discounts = discounts
379
+ @invoiceitem = invoiceitem
380
+ @metadata = metadata
381
+ @period = period
382
+ @price = price
383
+ @price_data = price_data
384
+ @quantity = quantity
385
+ @tax_behavior = tax_behavior
386
+ @tax_code = tax_code
387
+ @tax_rates = tax_rates
388
+ @unit_amount = unit_amount
389
+ @unit_amount_decimal = unit_amount_decimal
390
+ end
391
+ end
392
+
393
+ class Issuer < Stripe::RequestParams
394
+ # The connected account being referenced when `type` is `account`.
395
+ attr_accessor :account
396
+
397
+ # Type of the account referenced in the request.
398
+ attr_accessor :type
399
+
400
+ def initialize(account: nil, type: nil)
401
+ @account = account
402
+ @type = type
403
+ end
404
+ end
405
+
406
+ class ScheduleDetails < Stripe::RequestParams
407
+ class Amendment < Stripe::RequestParams
408
+ class AmendmentEnd < Stripe::RequestParams
409
+ class DiscountEnd < Stripe::RequestParams
410
+ # The ID of a specific discount.
411
+ attr_accessor :discount
412
+
413
+ def initialize(discount: nil)
414
+ @discount = discount
415
+ end
416
+ end
417
+
418
+ class Duration < Stripe::RequestParams
419
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
420
+ attr_accessor :interval
421
+
422
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
423
+ attr_accessor :interval_count
424
+
425
+ def initialize(interval: nil, interval_count: nil)
426
+ @interval = interval
427
+ @interval_count = interval_count
428
+ end
429
+ end
430
+ # Use the `end` time of a given discount.
431
+ attr_accessor :discount_end
432
+
433
+ # Time span for the amendment starting from the `amendment_start`.
434
+ attr_accessor :duration
435
+
436
+ # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
437
+ attr_accessor :timestamp
438
+
439
+ # Select one of three ways to pass the `amendment_end`.
440
+ attr_accessor :type
441
+
442
+ def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
443
+ @discount_end = discount_end
444
+ @duration = duration
445
+ @timestamp = timestamp
446
+ @type = type
447
+ end
448
+ end
449
+
450
+ class AmendmentStart < Stripe::RequestParams
451
+ class AmendmentEnd < Stripe::RequestParams
452
+ # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
453
+ attr_accessor :index
454
+
455
+ def initialize(index: nil)
456
+ @index = index
457
+ end
458
+ end
459
+
460
+ class DiscountEnd < Stripe::RequestParams
461
+ # The ID of a specific discount.
462
+ attr_accessor :discount
463
+
464
+ def initialize(discount: nil)
465
+ @discount = discount
466
+ end
467
+ end
468
+ # Details of another amendment in the same array, immediately after which this amendment should begin.
469
+ attr_accessor :amendment_end
470
+
471
+ # Use the `end` time of a given discount.
472
+ attr_accessor :discount_end
473
+
474
+ # A precise Unix timestamp for the amendment to start.
475
+ attr_accessor :timestamp
476
+
477
+ # Select one of three ways to pass the `amendment_start`.
478
+ attr_accessor :type
479
+
480
+ def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
481
+ @amendment_end = amendment_end
482
+ @discount_end = discount_end
483
+ @timestamp = timestamp
484
+ @type = type
485
+ end
486
+ end
487
+
488
+ class DiscountAction < Stripe::RequestParams
489
+ class Add < Stripe::RequestParams
490
+ class DiscountEnd < Stripe::RequestParams
491
+ # The type of calculation made to determine when the discount ends.
492
+ attr_accessor :type
493
+
494
+ def initialize(type: nil)
495
+ @type = type
496
+ end
497
+ end
498
+ # The coupon code to redeem.
499
+ attr_accessor :coupon
500
+
501
+ # An ID of an existing discount for a coupon that was already redeemed.
502
+ attr_accessor :discount
503
+
504
+ # Details to determine how long the discount should be applied for.
505
+ attr_accessor :discount_end
506
+
507
+ # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
508
+ attr_accessor :index
509
+
510
+ # The promotion code to redeem.
511
+ attr_accessor :promotion_code
512
+
513
+ def initialize(
514
+ coupon: nil,
515
+ discount: nil,
516
+ discount_end: nil,
517
+ index: nil,
518
+ promotion_code: nil
519
+ )
520
+ @coupon = coupon
521
+ @discount = discount
522
+ @discount_end = discount_end
523
+ @index = index
524
+ @promotion_code = promotion_code
525
+ end
526
+ end
527
+
528
+ class Remove < Stripe::RequestParams
529
+ # The coupon code to remove from the `discounts` array.
530
+ attr_accessor :coupon
531
+
532
+ # The ID of a discount to remove from the `discounts` array.
533
+ attr_accessor :discount
534
+
535
+ # The ID of a promotion code to remove from the `discounts` array.
536
+ attr_accessor :promotion_code
537
+
538
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
539
+ @coupon = coupon
540
+ @discount = discount
541
+ @promotion_code = promotion_code
542
+ end
543
+ end
544
+
545
+ class Set < Stripe::RequestParams
546
+ # The coupon code to replace the `discounts` array with.
547
+ attr_accessor :coupon
548
+
549
+ # An ID of an existing discount to replace the `discounts` array with.
550
+ attr_accessor :discount
551
+
552
+ # An ID of an existing promotion code to replace the `discounts` array with.
553
+ attr_accessor :promotion_code
554
+
555
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
556
+ @coupon = coupon
557
+ @discount = discount
558
+ @promotion_code = promotion_code
559
+ end
560
+ end
561
+ # Details of the discount to add.
562
+ attr_accessor :add
563
+
564
+ # Details of the discount to remove.
565
+ attr_accessor :remove
566
+
567
+ # Details of the discount to replace the existing discounts with.
568
+ attr_accessor :set
569
+
570
+ # Determines the type of discount action.
571
+ attr_accessor :type
572
+
573
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
574
+ @add = add
575
+ @remove = remove
576
+ @set = set
577
+ @type = type
578
+ end
579
+ end
580
+
581
+ class ItemAction < Stripe::RequestParams
582
+ class Add < Stripe::RequestParams
583
+ class Discount < Stripe::RequestParams
584
+ class DiscountEnd < Stripe::RequestParams
585
+ class Duration < Stripe::RequestParams
586
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
587
+ attr_accessor :interval
588
+
589
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
590
+ attr_accessor :interval_count
591
+
592
+ def initialize(interval: nil, interval_count: nil)
593
+ @interval = interval
594
+ @interval_count = interval_count
595
+ end
596
+ end
597
+ # Time span for the redeemed discount.
598
+ attr_accessor :duration
599
+
600
+ # A precise Unix timestamp for the discount to end. Must be in the future.
601
+ attr_accessor :timestamp
602
+
603
+ # The type of calculation made to determine when the discount ends.
604
+ attr_accessor :type
605
+
606
+ def initialize(duration: nil, timestamp: nil, type: nil)
607
+ @duration = duration
608
+ @timestamp = timestamp
609
+ @type = type
610
+ end
611
+ end
612
+ # ID of the coupon to create a new discount for.
613
+ attr_accessor :coupon
614
+
615
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
616
+ attr_accessor :discount
617
+
618
+ # Details to determine how long the discount should be applied for.
619
+ attr_accessor :discount_end
620
+
621
+ # ID of the promotion code to create a new discount for.
622
+ attr_accessor :promotion_code
623
+
624
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
625
+ @coupon = coupon
626
+ @discount = discount
627
+ @discount_end = discount_end
628
+ @promotion_code = promotion_code
629
+ end
630
+ end
631
+
632
+ class Trial < Stripe::RequestParams
633
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
634
+ attr_accessor :converts_to
635
+
636
+ # Determines the type of trial for this item.
637
+ attr_accessor :type
638
+
639
+ def initialize(converts_to: nil, type: nil)
640
+ @converts_to = converts_to
641
+ @type = type
642
+ end
643
+ end
644
+ # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
645
+ attr_accessor :discounts
646
+
647
+ # 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`.
648
+ attr_accessor :metadata
649
+
650
+ # The ID of the price object.
651
+ attr_accessor :price
652
+
653
+ # Quantity for this item.
654
+ attr_accessor :quantity
655
+
656
+ # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
657
+ attr_accessor :tax_rates
658
+
659
+ # Options that configure the trial on the subscription item.
660
+ attr_accessor :trial
661
+
662
+ def initialize(
663
+ discounts: nil,
664
+ metadata: nil,
665
+ price: nil,
666
+ quantity: nil,
667
+ tax_rates: nil,
668
+ trial: nil
669
+ )
670
+ @discounts = discounts
671
+ @metadata = metadata
672
+ @price = price
673
+ @quantity = quantity
674
+ @tax_rates = tax_rates
675
+ @trial = trial
676
+ end
677
+ end
678
+
679
+ class Remove < Stripe::RequestParams
680
+ # ID of a price to remove.
681
+ attr_accessor :price
682
+
683
+ def initialize(price: nil)
684
+ @price = price
685
+ end
686
+ end
687
+
688
+ class Set < Stripe::RequestParams
689
+ class Discount < Stripe::RequestParams
690
+ class DiscountEnd < Stripe::RequestParams
691
+ class Duration < Stripe::RequestParams
692
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
693
+ attr_accessor :interval
694
+
695
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
696
+ attr_accessor :interval_count
697
+
698
+ def initialize(interval: nil, interval_count: nil)
699
+ @interval = interval
700
+ @interval_count = interval_count
701
+ end
702
+ end
703
+ # Time span for the redeemed discount.
704
+ attr_accessor :duration
705
+
706
+ # A precise Unix timestamp for the discount to end. Must be in the future.
707
+ attr_accessor :timestamp
708
+
709
+ # The type of calculation made to determine when the discount ends.
710
+ attr_accessor :type
711
+
712
+ def initialize(duration: nil, timestamp: nil, type: nil)
713
+ @duration = duration
714
+ @timestamp = timestamp
715
+ @type = type
716
+ end
717
+ end
718
+ # ID of the coupon to create a new discount for.
719
+ attr_accessor :coupon
720
+
721
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
722
+ attr_accessor :discount
723
+
724
+ # Details to determine how long the discount should be applied for.
725
+ attr_accessor :discount_end
726
+
727
+ # ID of the promotion code to create a new discount for.
728
+ attr_accessor :promotion_code
729
+
730
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
731
+ @coupon = coupon
732
+ @discount = discount
733
+ @discount_end = discount_end
734
+ @promotion_code = promotion_code
735
+ end
736
+ end
737
+
738
+ class Trial < Stripe::RequestParams
739
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
740
+ attr_accessor :converts_to
741
+
742
+ # Determines the type of trial for this item.
743
+ attr_accessor :type
744
+
745
+ def initialize(converts_to: nil, type: nil)
746
+ @converts_to = converts_to
747
+ @type = type
748
+ end
749
+ end
750
+ # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
751
+ attr_accessor :discounts
752
+
753
+ # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
754
+ attr_accessor :metadata
755
+
756
+ # The ID of the price object.
757
+ attr_accessor :price
758
+
759
+ # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
760
+ attr_accessor :quantity
761
+
762
+ # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
763
+ attr_accessor :tax_rates
764
+
765
+ # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
766
+ attr_accessor :trial
767
+
768
+ def initialize(
769
+ discounts: nil,
770
+ metadata: nil,
771
+ price: nil,
772
+ quantity: nil,
773
+ tax_rates: nil,
774
+ trial: nil
775
+ )
776
+ @discounts = discounts
777
+ @metadata = metadata
778
+ @price = price
779
+ @quantity = quantity
780
+ @tax_rates = tax_rates
781
+ @trial = trial
782
+ end
783
+ end
784
+ # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
785
+ attr_accessor :add
786
+
787
+ # Details of the subscription item to remove.
788
+ attr_accessor :remove
789
+
790
+ # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
791
+ attr_accessor :set
792
+
793
+ # Determines the type of item action.
794
+ attr_accessor :type
795
+
796
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
797
+ @add = add
798
+ @remove = remove
799
+ @set = set
800
+ @type = type
801
+ end
802
+ end
803
+
804
+ class MetadataAction < Stripe::RequestParams
805
+ # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
806
+ attr_accessor :add
807
+
808
+ # Keys to remove from schedule phase metadata.
809
+ attr_accessor :remove
810
+
811
+ # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
812
+ attr_accessor :set
813
+
814
+ # Select one of three ways to update phase-level `metadata` on subscription schedules.
815
+ attr_accessor :type
816
+
817
+ def initialize(add: nil, remove: nil, set: nil, type: nil)
818
+ @add = add
819
+ @remove = remove
820
+ @set = set
821
+ @type = type
822
+ end
823
+ end
824
+
825
+ class SetPauseCollection < Stripe::RequestParams
826
+ class Set < Stripe::RequestParams
827
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
828
+ attr_accessor :behavior
829
+
830
+ def initialize(behavior: nil)
831
+ @behavior = behavior
832
+ end
833
+ end
834
+ # Details of the pause_collection behavior to apply to the amendment.
835
+ attr_accessor :set
836
+
837
+ # Determines the type of the pause_collection amendment.
838
+ attr_accessor :type
839
+
840
+ def initialize(set: nil, type: nil)
841
+ @set = set
842
+ @type = type
843
+ end
844
+ end
845
+
846
+ class TrialSettings < Stripe::RequestParams
847
+ class EndBehavior < Stripe::RequestParams
848
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
849
+ attr_accessor :prorate_up_front
850
+
851
+ def initialize(prorate_up_front: nil)
852
+ @prorate_up_front = prorate_up_front
853
+ end
854
+ end
855
+ # Defines how the subscription should behave when a trial ends.
856
+ attr_accessor :end_behavior
857
+
858
+ def initialize(end_behavior: nil)
859
+ @end_behavior = end_behavior
860
+ end
861
+ end
862
+ # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
863
+ attr_accessor :amendment_end
864
+
865
+ # Details to identify the earliest timestamp where the proposed change should take effect.
866
+ attr_accessor :amendment_start
867
+
868
+ # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
869
+ attr_accessor :billing_cycle_anchor
870
+
871
+ # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
872
+ attr_accessor :discount_actions
873
+
874
+ # Changes to the subscription items during the amendment time span.
875
+ attr_accessor :item_actions
876
+
877
+ # Instructions for how to modify phase metadata
878
+ attr_accessor :metadata_actions
879
+
880
+ # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
881
+ attr_accessor :proration_behavior
882
+
883
+ # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
884
+ attr_accessor :set_pause_collection
885
+
886
+ # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
887
+ attr_accessor :set_schedule_end
888
+
889
+ # Settings related to subscription trials.
890
+ attr_accessor :trial_settings
891
+
892
+ def initialize(
893
+ amendment_end: nil,
894
+ amendment_start: nil,
895
+ billing_cycle_anchor: nil,
896
+ discount_actions: nil,
897
+ item_actions: nil,
898
+ metadata_actions: nil,
899
+ proration_behavior: nil,
900
+ set_pause_collection: nil,
901
+ set_schedule_end: nil,
902
+ trial_settings: nil
903
+ )
904
+ @amendment_end = amendment_end
905
+ @amendment_start = amendment_start
906
+ @billing_cycle_anchor = billing_cycle_anchor
907
+ @discount_actions = discount_actions
908
+ @item_actions = item_actions
909
+ @metadata_actions = metadata_actions
910
+ @proration_behavior = proration_behavior
911
+ @set_pause_collection = set_pause_collection
912
+ @set_schedule_end = set_schedule_end
913
+ @trial_settings = trial_settings
914
+ end
915
+ end
916
+
917
+ class Phase < Stripe::RequestParams
918
+ class AddInvoiceItem < Stripe::RequestParams
919
+ class Discount < Stripe::RequestParams
920
+ class DiscountEnd < Stripe::RequestParams
921
+ class Duration < Stripe::RequestParams
922
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
923
+ attr_accessor :interval
924
+
925
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
926
+ attr_accessor :interval_count
927
+
928
+ def initialize(interval: nil, interval_count: nil)
929
+ @interval = interval
930
+ @interval_count = interval_count
931
+ end
932
+ end
933
+ # Time span for the redeemed discount.
934
+ attr_accessor :duration
935
+
936
+ # A precise Unix timestamp for the discount to end. Must be in the future.
937
+ attr_accessor :timestamp
938
+
939
+ # The type of calculation made to determine when the discount ends.
940
+ attr_accessor :type
941
+
942
+ def initialize(duration: nil, timestamp: nil, type: nil)
943
+ @duration = duration
944
+ @timestamp = timestamp
945
+ @type = type
946
+ end
947
+ end
948
+ # ID of the coupon to create a new discount for.
949
+ attr_accessor :coupon
950
+
951
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
952
+ attr_accessor :discount
953
+
954
+ # Details to determine how long the discount should be applied for.
955
+ attr_accessor :discount_end
956
+
957
+ # ID of the promotion code to create a new discount for.
958
+ attr_accessor :promotion_code
959
+
960
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
961
+ @coupon = coupon
962
+ @discount = discount
963
+ @discount_end = discount_end
964
+ @promotion_code = promotion_code
965
+ end
966
+ end
967
+
968
+ class PriceData < Stripe::RequestParams
969
+ # 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).
970
+ attr_accessor :currency
971
+
972
+ # The ID of the product that this price will belong to.
973
+ attr_accessor :product
974
+
975
+ # 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.
976
+ attr_accessor :tax_behavior
977
+
978
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge or a negative integer representing the amount to credit to the customer.
979
+ attr_accessor :unit_amount
980
+
981
+ # 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.
982
+ attr_accessor :unit_amount_decimal
983
+
984
+ def initialize(
985
+ currency: nil,
986
+ product: nil,
987
+ tax_behavior: nil,
988
+ unit_amount: nil,
989
+ unit_amount_decimal: nil
990
+ )
991
+ @currency = currency
992
+ @product = product
993
+ @tax_behavior = tax_behavior
994
+ @unit_amount = unit_amount
995
+ @unit_amount_decimal = unit_amount_decimal
996
+ end
997
+ end
998
+ # The coupons to redeem into discounts for the item.
999
+ attr_accessor :discounts
1000
+
1001
+ # The ID of the price object. One of `price` or `price_data` is required.
1002
+ attr_accessor :price
1003
+
1004
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1005
+ attr_accessor :price_data
1006
+
1007
+ # Quantity for this item. Defaults to 1.
1008
+ attr_accessor :quantity
1009
+
1010
+ # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item.
1011
+ attr_accessor :tax_rates
1012
+
1013
+ def initialize(
1014
+ discounts: nil,
1015
+ price: nil,
1016
+ price_data: nil,
1017
+ quantity: nil,
1018
+ tax_rates: nil
1019
+ )
1020
+ @discounts = discounts
1021
+ @price = price
1022
+ @price_data = price_data
1023
+ @quantity = quantity
1024
+ @tax_rates = tax_rates
1025
+ end
1026
+ end
1027
+
1028
+ class AutomaticTax < Stripe::RequestParams
1029
+ class Liability < Stripe::RequestParams
1030
+ # The connected account being referenced when `type` is `account`.
1031
+ attr_accessor :account
1032
+
1033
+ # Type of the account referenced in the request.
1034
+ attr_accessor :type
1035
+
1036
+ def initialize(account: nil, type: nil)
1037
+ @account = account
1038
+ @type = type
1039
+ end
1040
+ end
1041
+ # Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.
1042
+ attr_accessor :enabled
1043
+
1044
+ # 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.
1045
+ attr_accessor :liability
1046
+
1047
+ def initialize(enabled: nil, liability: nil)
1048
+ @enabled = enabled
1049
+ @liability = liability
1050
+ end
1051
+ end
1052
+
1053
+ class BillingThresholds < Stripe::RequestParams
1054
+ # Monetary threshold that triggers the subscription to advance to a new billing period
1055
+ attr_accessor :amount_gte
1056
+
1057
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
1058
+ attr_accessor :reset_billing_cycle_anchor
1059
+
1060
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
1061
+ @amount_gte = amount_gte
1062
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
1063
+ end
1064
+ end
1065
+
1066
+ class Discount < Stripe::RequestParams
1067
+ class DiscountEnd < Stripe::RequestParams
1068
+ class Duration < Stripe::RequestParams
1069
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1070
+ attr_accessor :interval
1071
+
1072
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1073
+ attr_accessor :interval_count
1074
+
1075
+ def initialize(interval: nil, interval_count: nil)
1076
+ @interval = interval
1077
+ @interval_count = interval_count
1078
+ end
1079
+ end
1080
+ # Time span for the redeemed discount.
1081
+ attr_accessor :duration
1082
+
1083
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1084
+ attr_accessor :timestamp
1085
+
1086
+ # The type of calculation made to determine when the discount ends.
1087
+ attr_accessor :type
1088
+
1089
+ def initialize(duration: nil, timestamp: nil, type: nil)
1090
+ @duration = duration
1091
+ @timestamp = timestamp
1092
+ @type = type
1093
+ end
1094
+ end
1095
+ # ID of the coupon to create a new discount for.
1096
+ attr_accessor :coupon
1097
+
1098
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1099
+ attr_accessor :discount
1100
+
1101
+ # Details to determine how long the discount should be applied for.
1102
+ attr_accessor :discount_end
1103
+
1104
+ # ID of the promotion code to create a new discount for.
1105
+ attr_accessor :promotion_code
1106
+
1107
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1108
+ @coupon = coupon
1109
+ @discount = discount
1110
+ @discount_end = discount_end
1111
+ @promotion_code = promotion_code
1112
+ end
1113
+ end
1114
+
1115
+ class InvoiceSettings < Stripe::RequestParams
1116
+ class Issuer < Stripe::RequestParams
1117
+ # The connected account being referenced when `type` is `account`.
1118
+ attr_accessor :account
1119
+
1120
+ # Type of the account referenced in the request.
1121
+ attr_accessor :type
1122
+
1123
+ def initialize(account: nil, type: nil)
1124
+ @account = account
1125
+ @type = type
1126
+ end
1127
+ end
1128
+ # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule.
1129
+ attr_accessor :account_tax_ids
1130
+
1131
+ # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
1132
+ attr_accessor :days_until_due
1133
+
1134
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
1135
+ attr_accessor :issuer
1136
+
1137
+ def initialize(account_tax_ids: nil, days_until_due: nil, issuer: nil)
1138
+ @account_tax_ids = account_tax_ids
1139
+ @days_until_due = days_until_due
1140
+ @issuer = issuer
1141
+ end
1142
+ end
1143
+
1144
+ class Item < Stripe::RequestParams
1145
+ class BillingThresholds < Stripe::RequestParams
1146
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1147
+ attr_accessor :usage_gte
1148
+
1149
+ def initialize(usage_gte: nil)
1150
+ @usage_gte = usage_gte
1151
+ end
1152
+ end
1153
+
1154
+ class Discount < Stripe::RequestParams
1155
+ class DiscountEnd < Stripe::RequestParams
1156
+ class Duration < Stripe::RequestParams
1157
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1158
+ attr_accessor :interval
1159
+
1160
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1161
+ attr_accessor :interval_count
1162
+
1163
+ def initialize(interval: nil, interval_count: nil)
1164
+ @interval = interval
1165
+ @interval_count = interval_count
1166
+ end
1167
+ end
1168
+ # Time span for the redeemed discount.
1169
+ attr_accessor :duration
1170
+
1171
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1172
+ attr_accessor :timestamp
1173
+
1174
+ # The type of calculation made to determine when the discount ends.
1175
+ attr_accessor :type
1176
+
1177
+ def initialize(duration: nil, timestamp: nil, type: nil)
1178
+ @duration = duration
1179
+ @timestamp = timestamp
1180
+ @type = type
1181
+ end
1182
+ end
1183
+ # ID of the coupon to create a new discount for.
1184
+ attr_accessor :coupon
1185
+
1186
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1187
+ attr_accessor :discount
1188
+
1189
+ # Details to determine how long the discount should be applied for.
1190
+ attr_accessor :discount_end
1191
+
1192
+ # ID of the promotion code to create a new discount for.
1193
+ attr_accessor :promotion_code
1194
+
1195
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1196
+ @coupon = coupon
1197
+ @discount = discount
1198
+ @discount_end = discount_end
1199
+ @promotion_code = promotion_code
1200
+ end
1201
+ end
1202
+
1203
+ class PriceData < Stripe::RequestParams
1204
+ class Recurring < Stripe::RequestParams
1205
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1206
+ attr_accessor :interval
1207
+
1208
+ # 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).
1209
+ attr_accessor :interval_count
1210
+
1211
+ def initialize(interval: nil, interval_count: nil)
1212
+ @interval = interval
1213
+ @interval_count = interval_count
1214
+ end
1215
+ end
1216
+ # 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).
1217
+ attr_accessor :currency
1218
+
1219
+ # The ID of the product that this price will belong to.
1220
+ attr_accessor :product
1221
+
1222
+ # The recurring components of a price such as `interval` and `interval_count`.
1223
+ attr_accessor :recurring
1224
+
1225
+ # 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.
1226
+ attr_accessor :tax_behavior
1227
+
1228
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1229
+ attr_accessor :unit_amount
1230
+
1231
+ # 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.
1232
+ attr_accessor :unit_amount_decimal
1233
+
1234
+ def initialize(
1235
+ currency: nil,
1236
+ product: nil,
1237
+ recurring: nil,
1238
+ tax_behavior: nil,
1239
+ unit_amount: nil,
1240
+ unit_amount_decimal: nil
1241
+ )
1242
+ @currency = currency
1243
+ @product = product
1244
+ @recurring = recurring
1245
+ @tax_behavior = tax_behavior
1246
+ @unit_amount = unit_amount
1247
+ @unit_amount_decimal = unit_amount_decimal
1248
+ end
1249
+ end
1250
+
1251
+ class Trial < Stripe::RequestParams
1252
+ # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. Currently only supports at most 1 price ID.
1253
+ attr_accessor :converts_to
1254
+
1255
+ # Determines the type of trial for this item.
1256
+ attr_accessor :type
1257
+
1258
+ def initialize(converts_to: nil, type: nil)
1259
+ @converts_to = converts_to
1260
+ @type = type
1261
+ end
1262
+ end
1263
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1264
+ attr_accessor :billing_thresholds
1265
+
1266
+ # The coupons to redeem into discounts for the subscription item.
1267
+ attr_accessor :discounts
1268
+
1269
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
1270
+ attr_accessor :metadata
1271
+
1272
+ # The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.
1273
+ attr_accessor :plan
1274
+
1275
+ # The ID of the price object.
1276
+ attr_accessor :price
1277
+
1278
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
1279
+ attr_accessor :price_data
1280
+
1281
+ # Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.
1282
+ attr_accessor :quantity
1283
+
1284
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
1285
+ attr_accessor :tax_rates
1286
+
1287
+ # Options that configure the trial on the subscription item.
1288
+ attr_accessor :trial
1289
+
1290
+ def initialize(
1291
+ billing_thresholds: nil,
1292
+ discounts: nil,
1293
+ metadata: nil,
1294
+ plan: nil,
1295
+ price: nil,
1296
+ price_data: nil,
1297
+ quantity: nil,
1298
+ tax_rates: nil,
1299
+ trial: nil
1300
+ )
1301
+ @billing_thresholds = billing_thresholds
1302
+ @discounts = discounts
1303
+ @metadata = metadata
1304
+ @plan = plan
1305
+ @price = price
1306
+ @price_data = price_data
1307
+ @quantity = quantity
1308
+ @tax_rates = tax_rates
1309
+ @trial = trial
1310
+ end
1311
+ end
1312
+
1313
+ class PauseCollection < Stripe::RequestParams
1314
+ # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
1315
+ attr_accessor :behavior
1316
+
1317
+ def initialize(behavior: nil)
1318
+ @behavior = behavior
1319
+ end
1320
+ end
1321
+
1322
+ class TransferData < Stripe::RequestParams
1323
+ # 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.
1324
+ attr_accessor :amount_percent
1325
+
1326
+ # ID of an existing, connected Stripe account.
1327
+ attr_accessor :destination
1328
+
1329
+ def initialize(amount_percent: nil, destination: nil)
1330
+ @amount_percent = amount_percent
1331
+ @destination = destination
1332
+ end
1333
+ end
1334
+
1335
+ class TrialSettings < Stripe::RequestParams
1336
+ class EndBehavior < Stripe::RequestParams
1337
+ # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
1338
+ attr_accessor :prorate_up_front
1339
+
1340
+ def initialize(prorate_up_front: nil)
1341
+ @prorate_up_front = prorate_up_front
1342
+ end
1343
+ end
1344
+ # Defines how the subscription should behave when a trial ends.
1345
+ attr_accessor :end_behavior
1346
+
1347
+ def initialize(end_behavior: nil)
1348
+ @end_behavior = end_behavior
1349
+ end
1350
+ end
1351
+ # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
1352
+ attr_accessor :add_invoice_items
1353
+
1354
+ # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
1355
+ attr_accessor :application_fee_percent
1356
+
1357
+ # Automatic tax settings for this phase.
1358
+ attr_accessor :automatic_tax
1359
+
1360
+ # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
1361
+ attr_accessor :billing_cycle_anchor
1362
+
1363
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1364
+ attr_accessor :billing_thresholds
1365
+
1366
+ # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
1367
+ attr_accessor :collection_method
1368
+
1369
+ # The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
1370
+ attr_accessor :coupon
1371
+
1372
+ # 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).
1373
+ attr_accessor :currency
1374
+
1375
+ # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
1376
+ attr_accessor :default_payment_method
1377
+
1378
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
1379
+ attr_accessor :default_tax_rates
1380
+
1381
+ # Subscription 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.
1382
+ attr_accessor :description
1383
+
1384
+ # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
1385
+ attr_accessor :discounts
1386
+
1387
+ # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1388
+ attr_accessor :end_date
1389
+
1390
+ # All invoices will be billed using the specified settings.
1391
+ attr_accessor :invoice_settings
1392
+
1393
+ # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1394
+ attr_accessor :items
1395
+
1396
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
1397
+ attr_accessor :iterations
1398
+
1399
+ # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
1400
+ attr_accessor :metadata
1401
+
1402
+ # The account on behalf of which to charge, for each of the associated subscription's invoices.
1403
+ attr_accessor :on_behalf_of
1404
+
1405
+ # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment).
1406
+ attr_accessor :pause_collection
1407
+
1408
+ # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
1409
+ attr_accessor :proration_behavior
1410
+
1411
+ # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
1412
+ attr_accessor :start_date
1413
+
1414
+ # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
1415
+ attr_accessor :transfer_data
1416
+
1417
+ # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
1418
+ attr_accessor :trial
1419
+
1420
+ # Specify trial behavior when crossing phase boundaries
1421
+ attr_accessor :trial_continuation
1422
+
1423
+ # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
1424
+ attr_accessor :trial_end
1425
+
1426
+ # Settings related to subscription trials.
1427
+ attr_accessor :trial_settings
1428
+
1429
+ def initialize(
1430
+ add_invoice_items: nil,
1431
+ application_fee_percent: nil,
1432
+ automatic_tax: nil,
1433
+ billing_cycle_anchor: nil,
1434
+ billing_thresholds: nil,
1435
+ collection_method: nil,
1436
+ coupon: nil,
1437
+ currency: nil,
1438
+ default_payment_method: nil,
1439
+ default_tax_rates: nil,
1440
+ description: nil,
1441
+ discounts: nil,
1442
+ end_date: nil,
1443
+ invoice_settings: nil,
1444
+ items: nil,
1445
+ iterations: nil,
1446
+ metadata: nil,
1447
+ on_behalf_of: nil,
1448
+ pause_collection: nil,
1449
+ proration_behavior: nil,
1450
+ start_date: nil,
1451
+ transfer_data: nil,
1452
+ trial: nil,
1453
+ trial_continuation: nil,
1454
+ trial_end: nil,
1455
+ trial_settings: nil
1456
+ )
1457
+ @add_invoice_items = add_invoice_items
1458
+ @application_fee_percent = application_fee_percent
1459
+ @automatic_tax = automatic_tax
1460
+ @billing_cycle_anchor = billing_cycle_anchor
1461
+ @billing_thresholds = billing_thresholds
1462
+ @collection_method = collection_method
1463
+ @coupon = coupon
1464
+ @currency = currency
1465
+ @default_payment_method = default_payment_method
1466
+ @default_tax_rates = default_tax_rates
1467
+ @description = description
1468
+ @discounts = discounts
1469
+ @end_date = end_date
1470
+ @invoice_settings = invoice_settings
1471
+ @items = items
1472
+ @iterations = iterations
1473
+ @metadata = metadata
1474
+ @on_behalf_of = on_behalf_of
1475
+ @pause_collection = pause_collection
1476
+ @proration_behavior = proration_behavior
1477
+ @start_date = start_date
1478
+ @transfer_data = transfer_data
1479
+ @trial = trial
1480
+ @trial_continuation = trial_continuation
1481
+ @trial_end = trial_end
1482
+ @trial_settings = trial_settings
1483
+ end
1484
+ end
1485
+
1486
+ class Prebilling < Stripe::RequestParams
1487
+ class BillUntil < Stripe::RequestParams
1488
+ class AmendmentEnd < Stripe::RequestParams
1489
+ # The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
1490
+ attr_accessor :index
1491
+
1492
+ def initialize(index: nil)
1493
+ @index = index
1494
+ end
1495
+ end
1496
+
1497
+ class Duration < Stripe::RequestParams
1498
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1499
+ attr_accessor :interval
1500
+
1501
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1502
+ attr_accessor :interval_count
1503
+
1504
+ def initialize(interval: nil, interval_count: nil)
1505
+ @interval = interval
1506
+ @interval_count = interval_count
1507
+ end
1508
+ end
1509
+ # End the prebilled period when a specified amendment ends.
1510
+ attr_accessor :amendment_end
1511
+
1512
+ # Time span for prebilling, starting from `bill_from`.
1513
+ attr_accessor :duration
1514
+
1515
+ # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
1516
+ attr_accessor :timestamp
1517
+
1518
+ # Select one of several ways to pass the `bill_until` value.
1519
+ attr_accessor :type
1520
+
1521
+ def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
1522
+ @amendment_end = amendment_end
1523
+ @duration = duration
1524
+ @timestamp = timestamp
1525
+ @type = type
1526
+ end
1527
+ end
1528
+ # The end of the prebilled time period.
1529
+ attr_accessor :bill_until
1530
+
1531
+ # This is used to determine the number of billing cycles to prebill.
1532
+ attr_accessor :iterations
1533
+
1534
+ def initialize(bill_until: nil, iterations: nil)
1535
+ @bill_until = bill_until
1536
+ @iterations = iterations
1537
+ end
1538
+ end
1539
+ # Changes to apply to the phases of the subscription schedule, in the order provided.
1540
+ attr_accessor :amendments
1541
+
1542
+ # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
1543
+ attr_accessor :billing_behavior
1544
+
1545
+ # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
1546
+ attr_accessor :end_behavior
1547
+
1548
+ # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
1549
+ attr_accessor :phases
1550
+
1551
+ # Provide any time periods to bill in advance.
1552
+ attr_accessor :prebilling
1553
+
1554
+ # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
1555
+ attr_accessor :proration_behavior
1556
+
1557
+ def initialize(
1558
+ amendments: nil,
1559
+ billing_behavior: nil,
1560
+ end_behavior: nil,
1561
+ phases: nil,
1562
+ prebilling: nil,
1563
+ proration_behavior: nil
1564
+ )
1565
+ @amendments = amendments
1566
+ @billing_behavior = billing_behavior
1567
+ @end_behavior = end_behavior
1568
+ @phases = phases
1569
+ @prebilling = prebilling
1570
+ @proration_behavior = proration_behavior
1571
+ end
1572
+ end
1573
+
1574
+ class SubscriptionDetails < Stripe::RequestParams
1575
+ class Item < Stripe::RequestParams
1576
+ class BillingThresholds < Stripe::RequestParams
1577
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1578
+ attr_accessor :usage_gte
1579
+
1580
+ def initialize(usage_gte: nil)
1581
+ @usage_gte = usage_gte
1582
+ end
1583
+ end
1584
+
1585
+ class Discount < Stripe::RequestParams
1586
+ class DiscountEnd < Stripe::RequestParams
1587
+ class Duration < Stripe::RequestParams
1588
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1589
+ attr_accessor :interval
1590
+
1591
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1592
+ attr_accessor :interval_count
1593
+
1594
+ def initialize(interval: nil, interval_count: nil)
1595
+ @interval = interval
1596
+ @interval_count = interval_count
1597
+ end
1598
+ end
1599
+ # Time span for the redeemed discount.
1600
+ attr_accessor :duration
1601
+
1602
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1603
+ attr_accessor :timestamp
1604
+
1605
+ # The type of calculation made to determine when the discount ends.
1606
+ attr_accessor :type
1607
+
1608
+ def initialize(duration: nil, timestamp: nil, type: nil)
1609
+ @duration = duration
1610
+ @timestamp = timestamp
1611
+ @type = type
1612
+ end
1613
+ end
1614
+ # ID of the coupon to create a new discount for.
1615
+ attr_accessor :coupon
1616
+
1617
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1618
+ attr_accessor :discount
1619
+
1620
+ # Details to determine how long the discount should be applied for.
1621
+ attr_accessor :discount_end
1622
+
1623
+ # ID of the promotion code to create a new discount for.
1624
+ attr_accessor :promotion_code
1625
+
1626
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1627
+ @coupon = coupon
1628
+ @discount = discount
1629
+ @discount_end = discount_end
1630
+ @promotion_code = promotion_code
1631
+ end
1632
+ end
1633
+
1634
+ class PriceData < Stripe::RequestParams
1635
+ class Recurring < Stripe::RequestParams
1636
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1637
+ attr_accessor :interval
1638
+
1639
+ # 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).
1640
+ attr_accessor :interval_count
1641
+
1642
+ def initialize(interval: nil, interval_count: nil)
1643
+ @interval = interval
1644
+ @interval_count = interval_count
1645
+ end
1646
+ end
1647
+ # 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).
1648
+ attr_accessor :currency
1649
+
1650
+ # The ID of the product that this price will belong to.
1651
+ attr_accessor :product
1652
+
1653
+ # The recurring components of a price such as `interval` and `interval_count`.
1654
+ attr_accessor :recurring
1655
+
1656
+ # 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.
1657
+ attr_accessor :tax_behavior
1658
+
1659
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1660
+ attr_accessor :unit_amount
1661
+
1662
+ # 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.
1663
+ attr_accessor :unit_amount_decimal
1664
+
1665
+ def initialize(
1666
+ currency: nil,
1667
+ product: nil,
1668
+ recurring: nil,
1669
+ tax_behavior: nil,
1670
+ unit_amount: nil,
1671
+ unit_amount_decimal: nil
1672
+ )
1673
+ @currency = currency
1674
+ @product = product
1675
+ @recurring = recurring
1676
+ @tax_behavior = tax_behavior
1677
+ @unit_amount = unit_amount
1678
+ @unit_amount_decimal = unit_amount_decimal
1679
+ end
1680
+ end
1681
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1682
+ attr_accessor :billing_thresholds
1683
+
1684
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
1685
+ attr_accessor :clear_usage
1686
+
1687
+ # A flag that, if set to `true`, will delete the specified item.
1688
+ attr_accessor :deleted
1689
+
1690
+ # The coupons to redeem into discounts for the subscription item.
1691
+ attr_accessor :discounts
1692
+
1693
+ # Subscription item to update.
1694
+ attr_accessor :id
1695
+
1696
+ # 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`.
1697
+ attr_accessor :metadata
1698
+
1699
+ # Plan ID for this item, as a string.
1700
+ attr_accessor :plan
1701
+
1702
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
1703
+ attr_accessor :price
1704
+
1705
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1706
+ attr_accessor :price_data
1707
+
1708
+ # Quantity for this item.
1709
+ attr_accessor :quantity
1710
+
1711
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
1712
+ attr_accessor :tax_rates
1713
+
1714
+ def initialize(
1715
+ billing_thresholds: nil,
1716
+ clear_usage: nil,
1717
+ deleted: nil,
1718
+ discounts: nil,
1719
+ id: nil,
1720
+ metadata: nil,
1721
+ plan: nil,
1722
+ price: nil,
1723
+ price_data: nil,
1724
+ quantity: nil,
1725
+ tax_rates: nil
1726
+ )
1727
+ @billing_thresholds = billing_thresholds
1728
+ @clear_usage = clear_usage
1729
+ @deleted = deleted
1730
+ @discounts = discounts
1731
+ @id = id
1732
+ @metadata = metadata
1733
+ @plan = plan
1734
+ @price = price
1735
+ @price_data = price_data
1736
+ @quantity = quantity
1737
+ @tax_rates = tax_rates
1738
+ end
1739
+ end
1740
+
1741
+ class Prebilling < Stripe::RequestParams
1742
+ # This is used to determine the number of billing cycles to prebill.
1743
+ attr_accessor :iterations
1744
+
1745
+ def initialize(iterations: nil)
1746
+ @iterations = iterations
1747
+ end
1748
+ end
1749
+ # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
1750
+ attr_accessor :billing_cycle_anchor
1751
+
1752
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
1753
+ attr_accessor :cancel_at
1754
+
1755
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
1756
+ attr_accessor :cancel_at_period_end
1757
+
1758
+ # This simulates the subscription being canceled or expired immediately.
1759
+ attr_accessor :cancel_now
1760
+
1761
+ # If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
1762
+ attr_accessor :default_tax_rates
1763
+
1764
+ # A list of up to 20 subscription items, each with an attached price.
1765
+ attr_accessor :items
1766
+
1767
+ # The pre-billing to apply to the subscription as a preview.
1768
+ attr_accessor :prebilling
1769
+
1770
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
1771
+ attr_accessor :proration_behavior
1772
+
1773
+ # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
1774
+ attr_accessor :proration_date
1775
+
1776
+ # For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
1777
+ attr_accessor :resume_at
1778
+
1779
+ # Date a subscription is intended to start (can be future or past).
1780
+ attr_accessor :start_date
1781
+
1782
+ # If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required.
1783
+ attr_accessor :trial_end
1784
+
1785
+ def initialize(
1786
+ billing_cycle_anchor: nil,
1787
+ cancel_at: nil,
1788
+ cancel_at_period_end: nil,
1789
+ cancel_now: nil,
1790
+ default_tax_rates: nil,
1791
+ items: nil,
1792
+ prebilling: nil,
1793
+ proration_behavior: nil,
1794
+ proration_date: nil,
1795
+ resume_at: nil,
1796
+ start_date: nil,
1797
+ trial_end: nil
1798
+ )
1799
+ @billing_cycle_anchor = billing_cycle_anchor
1800
+ @cancel_at = cancel_at
1801
+ @cancel_at_period_end = cancel_at_period_end
1802
+ @cancel_now = cancel_now
1803
+ @default_tax_rates = default_tax_rates
1804
+ @items = items
1805
+ @prebilling = prebilling
1806
+ @proration_behavior = proration_behavior
1807
+ @proration_date = proration_date
1808
+ @resume_at = resume_at
1809
+ @start_date = start_date
1810
+ @trial_end = trial_end
1811
+ end
1812
+ end
1813
+
1814
+ class SubscriptionItem < Stripe::RequestParams
1815
+ class BillingThresholds < Stripe::RequestParams
1816
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1817
+ attr_accessor :usage_gte
1818
+
1819
+ def initialize(usage_gte: nil)
1820
+ @usage_gte = usage_gte
1821
+ end
1822
+ end
1823
+
1824
+ class Discount < Stripe::RequestParams
1825
+ class DiscountEnd < Stripe::RequestParams
1826
+ class Duration < Stripe::RequestParams
1827
+ # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1828
+ attr_accessor :interval
1829
+
1830
+ # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1831
+ attr_accessor :interval_count
1832
+
1833
+ def initialize(interval: nil, interval_count: nil)
1834
+ @interval = interval
1835
+ @interval_count = interval_count
1836
+ end
1837
+ end
1838
+ # Time span for the redeemed discount.
1839
+ attr_accessor :duration
1840
+
1841
+ # A precise Unix timestamp for the discount to end. Must be in the future.
1842
+ attr_accessor :timestamp
1843
+
1844
+ # The type of calculation made to determine when the discount ends.
1845
+ attr_accessor :type
1846
+
1847
+ def initialize(duration: nil, timestamp: nil, type: nil)
1848
+ @duration = duration
1849
+ @timestamp = timestamp
1850
+ @type = type
1851
+ end
1852
+ end
1853
+ # ID of the coupon to create a new discount for.
1854
+ attr_accessor :coupon
1855
+
1856
+ # ID of an existing discount on the object (or one of its ancestors) to reuse.
1857
+ attr_accessor :discount
1858
+
1859
+ # Details to determine how long the discount should be applied for.
1860
+ attr_accessor :discount_end
1861
+
1862
+ # ID of the promotion code to create a new discount for.
1863
+ attr_accessor :promotion_code
1864
+
1865
+ def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1866
+ @coupon = coupon
1867
+ @discount = discount
1868
+ @discount_end = discount_end
1869
+ @promotion_code = promotion_code
1870
+ end
1871
+ end
1872
+
1873
+ class PriceData < Stripe::RequestParams
1874
+ class Recurring < Stripe::RequestParams
1875
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
1876
+ attr_accessor :interval
1877
+
1878
+ # 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).
1879
+ attr_accessor :interval_count
1880
+
1881
+ def initialize(interval: nil, interval_count: nil)
1882
+ @interval = interval
1883
+ @interval_count = interval_count
1884
+ end
1885
+ end
1886
+ # 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).
1887
+ attr_accessor :currency
1888
+
1889
+ # The ID of the product that this price will belong to.
1890
+ attr_accessor :product
1891
+
1892
+ # The recurring components of a price such as `interval` and `interval_count`.
1893
+ attr_accessor :recurring
1894
+
1895
+ # 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.
1896
+ attr_accessor :tax_behavior
1897
+
1898
+ # A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
1899
+ attr_accessor :unit_amount
1900
+
1901
+ # 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.
1902
+ attr_accessor :unit_amount_decimal
1903
+
1904
+ def initialize(
1905
+ currency: nil,
1906
+ product: nil,
1907
+ recurring: nil,
1908
+ tax_behavior: nil,
1909
+ unit_amount: nil,
1910
+ unit_amount_decimal: nil
1911
+ )
1912
+ @currency = currency
1913
+ @product = product
1914
+ @recurring = recurring
1915
+ @tax_behavior = tax_behavior
1916
+ @unit_amount = unit_amount
1917
+ @unit_amount_decimal = unit_amount_decimal
1918
+ end
1919
+ end
1920
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
1921
+ attr_accessor :billing_thresholds
1922
+
1923
+ # Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached.
1924
+ attr_accessor :clear_usage
1925
+
1926
+ # A flag that, if set to `true`, will delete the specified item.
1927
+ attr_accessor :deleted
1928
+
1929
+ # The coupons to redeem into discounts for the subscription item.
1930
+ attr_accessor :discounts
1931
+
1932
+ # Subscription item to update.
1933
+ attr_accessor :id
1934
+
1935
+ # 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`.
1936
+ attr_accessor :metadata
1937
+
1938
+ # Plan ID for this item, as a string.
1939
+ attr_accessor :plan
1940
+
1941
+ # The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.
1942
+ attr_accessor :price
1943
+
1944
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
1945
+ attr_accessor :price_data
1946
+
1947
+ # Quantity for this item.
1948
+ attr_accessor :quantity
1949
+
1950
+ # A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
1951
+ attr_accessor :tax_rates
1952
+
1953
+ def initialize(
1954
+ billing_thresholds: nil,
1955
+ clear_usage: nil,
1956
+ deleted: nil,
1957
+ discounts: nil,
1958
+ id: nil,
1959
+ metadata: nil,
1960
+ plan: nil,
1961
+ price: nil,
1962
+ price_data: nil,
1963
+ quantity: nil,
1964
+ tax_rates: nil
1965
+ )
1966
+ @billing_thresholds = billing_thresholds
1967
+ @clear_usage = clear_usage
1968
+ @deleted = deleted
1969
+ @discounts = discounts
1970
+ @id = id
1971
+ @metadata = metadata
1972
+ @plan = plan
1973
+ @price = price
1974
+ @price_data = price_data
1975
+ @quantity = quantity
1976
+ @tax_rates = tax_rates
1977
+ end
1978
+ end
1979
+
1980
+ class SubscriptionPrebilling < Stripe::RequestParams
1981
+ # This is used to determine the number of billing cycles to prebill.
1982
+ attr_accessor :iterations
1983
+
1984
+ def initialize(iterations: nil)
1985
+ @iterations = iterations
1986
+ end
1987
+ end
1988
+ # Settings for automatic tax lookup for this invoice preview.
1989
+ attr_accessor :automatic_tax
1990
+
1991
+ # The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
1992
+ attr_accessor :coupon
1993
+
1994
+ # The currency to preview this invoice in. Defaults to that of `customer` if not specified.
1995
+ attr_accessor :currency
1996
+
1997
+ # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
1998
+ attr_accessor :customer
1999
+
2000
+ # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
2001
+ attr_accessor :customer_details
2002
+
2003
+ # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
2004
+ attr_accessor :discounts
2005
+
2006
+ # 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.
2007
+ attr_accessor :ending_before
2008
+
2009
+ # Specifies which fields in the response should be expanded.
2010
+ attr_accessor :expand
2011
+
2012
+ # List of invoice items to add or update in the upcoming invoice preview (up to 250).
2013
+ attr_accessor :invoice_items
2014
+
2015
+ # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
2016
+ attr_accessor :issuer
2017
+
2018
+ # A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
2019
+ attr_accessor :limit
2020
+
2021
+ # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
2022
+ attr_accessor :on_behalf_of
2023
+
2024
+ # Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified.
2025
+ attr_accessor :preview_mode
2026
+
2027
+ # The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
2028
+ attr_accessor :schedule
2029
+
2030
+ # The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields.
2031
+ attr_accessor :schedule_details
2032
+
2033
+ # 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.
2034
+ attr_accessor :starting_after
2035
+
2036
+ # The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
2037
+ attr_accessor :subscription
2038
+
2039
+ # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead.
2040
+ attr_accessor :subscription_billing_cycle_anchor
2041
+
2042
+ # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead.
2043
+ attr_accessor :subscription_cancel_at
2044
+
2045
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead.
2046
+ attr_accessor :subscription_cancel_at_period_end
2047
+
2048
+ # This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead.
2049
+ attr_accessor :subscription_cancel_now
2050
+
2051
+ # If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead.
2052
+ attr_accessor :subscription_default_tax_rates
2053
+
2054
+ # The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields.
2055
+ attr_accessor :subscription_details
2056
+
2057
+ # A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead.
2058
+ attr_accessor :subscription_items
2059
+
2060
+ # The pre-billing to apply to the subscription as a preview. This field has been deprecated and will be removed in a future API version. Use `subscription_details.prebilling` instead.
2061
+ attr_accessor :subscription_prebilling
2062
+
2063
+ # Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead.
2064
+ attr_accessor :subscription_proration_behavior
2065
+
2066
+ # If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead.
2067
+ attr_accessor :subscription_proration_date
2068
+
2069
+ # For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead.
2070
+ attr_accessor :subscription_resume_at
2071
+
2072
+ # Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead.
2073
+ attr_accessor :subscription_start_date
2074
+
2075
+ # If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead.
2076
+ attr_accessor :subscription_trial_end
2077
+
2078
+ # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
2079
+ attr_accessor :subscription_trial_from_plan
2080
+
2081
+ def initialize(
2082
+ automatic_tax: nil,
2083
+ coupon: nil,
2084
+ currency: nil,
2085
+ customer: nil,
2086
+ customer_details: nil,
2087
+ discounts: nil,
2088
+ ending_before: nil,
2089
+ expand: nil,
2090
+ invoice_items: nil,
2091
+ issuer: nil,
2092
+ limit: nil,
2093
+ on_behalf_of: nil,
2094
+ preview_mode: nil,
2095
+ schedule: nil,
2096
+ schedule_details: nil,
2097
+ starting_after: nil,
2098
+ subscription: nil,
2099
+ subscription_billing_cycle_anchor: nil,
2100
+ subscription_cancel_at: nil,
2101
+ subscription_cancel_at_period_end: nil,
2102
+ subscription_cancel_now: nil,
2103
+ subscription_default_tax_rates: nil,
2104
+ subscription_details: nil,
2105
+ subscription_items: nil,
2106
+ subscription_prebilling: nil,
2107
+ subscription_proration_behavior: nil,
2108
+ subscription_proration_date: nil,
2109
+ subscription_resume_at: nil,
2110
+ subscription_start_date: nil,
2111
+ subscription_trial_end: nil,
2112
+ subscription_trial_from_plan: nil
2113
+ )
2114
+ @automatic_tax = automatic_tax
2115
+ @coupon = coupon
2116
+ @currency = currency
2117
+ @customer = customer
2118
+ @customer_details = customer_details
2119
+ @discounts = discounts
2120
+ @ending_before = ending_before
2121
+ @expand = expand
2122
+ @invoice_items = invoice_items
2123
+ @issuer = issuer
2124
+ @limit = limit
2125
+ @on_behalf_of = on_behalf_of
2126
+ @preview_mode = preview_mode
2127
+ @schedule = schedule
2128
+ @schedule_details = schedule_details
2129
+ @starting_after = starting_after
2130
+ @subscription = subscription
2131
+ @subscription_billing_cycle_anchor = subscription_billing_cycle_anchor
2132
+ @subscription_cancel_at = subscription_cancel_at
2133
+ @subscription_cancel_at_period_end = subscription_cancel_at_period_end
2134
+ @subscription_cancel_now = subscription_cancel_now
2135
+ @subscription_default_tax_rates = subscription_default_tax_rates
2136
+ @subscription_details = subscription_details
2137
+ @subscription_items = subscription_items
2138
+ @subscription_prebilling = subscription_prebilling
2139
+ @subscription_proration_behavior = subscription_proration_behavior
2140
+ @subscription_proration_date = subscription_proration_date
2141
+ @subscription_resume_at = subscription_resume_at
2142
+ @subscription_start_date = subscription_start_date
2143
+ @subscription_trial_end = subscription_trial_end
2144
+ @subscription_trial_from_plan = subscription_trial_from_plan
2145
+ end
2146
+ end
2147
+
6
2148
  # When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
7
2149
  def list(params = {}, opts = {})
8
2150
  request(