stripe 13.3.0 → 13.4.0.pre.beta.2

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