stripe 13.3.0 → 13.4.0.pre.beta.1

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