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