stripe 13.3.0 → 13.4.0.pre.beta.2

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