stripe 14.1.0.pre.beta.1 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +689 -1512
  3. data/OPENAPI_VERSION +1 -1
  4. data/README.md +3 -3
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_operations/save.rb +2 -1
  7. data/lib/stripe/api_operations/singleton_save.rb +2 -1
  8. data/lib/stripe/api_requestor.rb +3 -29
  9. data/lib/stripe/api_resource.rb +10 -3
  10. data/lib/stripe/api_version.rb +1 -1
  11. data/lib/stripe/errors.rb +0 -54
  12. data/lib/stripe/event_types.rb +0 -75
  13. data/lib/stripe/object_types.rb +0 -48
  14. data/lib/stripe/request_options.rb +2 -1
  15. data/lib/stripe/resources/account.rb +1 -653
  16. data/lib/stripe/resources/account_session.rb +1 -247
  17. data/lib/stripe/resources/billing/credit_balance_summary.rb +0 -2
  18. data/lib/stripe/resources/billing/credit_balance_transaction.rb +0 -4
  19. data/lib/stripe/resources/billing/credit_grant.rb +0 -10
  20. data/lib/stripe/resources/billing_portal/session.rb +0 -6
  21. data/lib/stripe/resources/card.rb +0 -2
  22. data/lib/stripe/resources/cash_balance.rb +0 -2
  23. data/lib/stripe/resources/charge.rb +0 -1454
  24. data/lib/stripe/resources/checkout/session.rb +4 -260
  25. data/lib/stripe/resources/confirmation_token.rb +0 -234
  26. data/lib/stripe/resources/coupon.rb +1 -1
  27. data/lib/stripe/resources/credit_note.rb +0 -10
  28. data/lib/stripe/resources/credit_note_line_item.rb +0 -9
  29. data/lib/stripe/resources/customer.rb +0 -2
  30. data/lib/stripe/resources/customer_balance_transaction.rb +0 -2
  31. data/lib/stripe/resources/customer_cash_balance_transaction.rb +0 -2
  32. data/lib/stripe/resources/customer_session.rb +1 -6
  33. data/lib/stripe/resources/discount.rb +0 -2
  34. data/lib/stripe/resources/event.rb +0 -33
  35. data/lib/stripe/resources/financial_connections/account.rb +1 -20
  36. data/lib/stripe/resources/financial_connections/session.rb +2 -62
  37. data/lib/stripe/resources/identity/verification_session.rb +0 -10
  38. data/lib/stripe/resources/invoice.rb +16 -1176
  39. data/lib/stripe/resources/invoice_item.rb +2 -78
  40. data/lib/stripe/resources/invoice_line_item.rb +1 -55
  41. data/lib/stripe/resources/invoice_payment.rb +53 -2
  42. data/lib/stripe/resources/issuing/cardholder.rb +1 -2
  43. data/lib/stripe/resources/issuing/transaction.rb +0 -6
  44. data/lib/stripe/resources/line_item.rb +0 -37
  45. data/lib/stripe/resources/mandate.rb +0 -24
  46. data/lib/stripe/resources/payment_intent.rb +307 -5109
  47. data/lib/stripe/resources/payment_method.rb +1 -196
  48. data/lib/stripe/resources/payment_method_configuration.rb +0 -295
  49. data/lib/stripe/resources/payout.rb +0 -6
  50. data/lib/stripe/resources/price.rb +0 -30
  51. data/lib/stripe/resources/product.rb +0 -59
  52. data/lib/stripe/resources/promotion_code.rb +0 -10
  53. data/lib/stripe/resources/quote.rb +6 -2042
  54. data/lib/stripe/resources/refund.rb +0 -9
  55. data/lib/stripe/resources/setup_attempt.rb +0 -21
  56. data/lib/stripe/resources/setup_intent.rb +9 -596
  57. data/lib/stripe/resources/source.rb +1 -30
  58. data/lib/stripe/resources/subscription.rb +9 -292
  59. data/lib/stripe/resources/subscription_item.rb +3 -84
  60. data/lib/stripe/resources/subscription_schedule.rb +10 -1007
  61. data/lib/stripe/resources/tax_id.rb +2 -12
  62. data/lib/stripe/resources/terminal/reader.rb +0 -406
  63. data/lib/stripe/resources/treasury/financial_account.rb +3 -22
  64. data/lib/stripe/resources/treasury/financial_account_features.rb +0 -2
  65. data/lib/stripe/resources/treasury/outbound_transfer.rb +0 -37
  66. data/lib/stripe/resources/treasury/received_credit.rb +1 -38
  67. data/lib/stripe/resources/treasury/received_debit.rb +1 -40
  68. data/lib/stripe/resources.rb +0 -85
  69. data/lib/stripe/services/account_service.rb +1 -562
  70. data/lib/stripe/services/account_session_service.rb +1 -217
  71. data/lib/stripe/services/billing/credit_balance_summary_service.rb +1 -4
  72. data/lib/stripe/services/billing/credit_balance_transaction_service.rb +0 -4
  73. data/lib/stripe/services/billing/credit_grant_service.rb +0 -8
  74. data/lib/stripe/services/billing_portal/session_service.rb +0 -4
  75. data/lib/stripe/services/charge_service.rb +0 -1334
  76. data/lib/stripe/services/checkout/session_service.rb +2 -172
  77. data/lib/stripe/services/credit_note_service.rb +0 -4
  78. data/lib/stripe/services/customer_session_service.rb +1 -4
  79. data/lib/stripe/services/financial_connections/account_service.rb +2 -7
  80. data/lib/stripe/services/financial_connections/session_service.rb +2 -34
  81. data/lib/stripe/services/financial_connections_service.rb +1 -2
  82. data/lib/stripe/services/identity/verification_session_service.rb +0 -8
  83. data/lib/stripe/services/invoice_item_service.rb +2 -74
  84. data/lib/stripe/services/invoice_line_item_service.rb +1 -33
  85. data/lib/stripe/services/invoice_payment_service.rb +33 -5
  86. data/lib/stripe/services/invoice_service.rb +17 -1088
  87. data/lib/stripe/services/issuing/cardholder_service.rb +1 -2
  88. data/lib/stripe/services/issuing/transaction_service.rb +0 -4
  89. data/lib/stripe/services/issuing_service.rb +1 -5
  90. data/lib/stripe/services/payment_intent_service.rb +264 -4637
  91. data/lib/stripe/services/payment_method_configuration_service.rb +0 -210
  92. data/lib/stripe/services/payment_method_service.rb +1 -126
  93. data/lib/stripe/services/payout_service.rb +0 -4
  94. data/lib/stripe/services/price_service.rb +0 -19
  95. data/lib/stripe/services/product_service.rb +0 -38
  96. data/lib/stripe/services/promotion_code_service.rb +0 -8
  97. data/lib/stripe/services/quote_service.rb +7 -1726
  98. data/lib/stripe/services/setup_intent_service.rb +9 -556
  99. data/lib/stripe/services/subscription_item_service.rb +3 -75
  100. data/lib/stripe/services/subscription_schedule_service.rb +10 -911
  101. data/lib/stripe/services/subscription_service.rb +9 -253
  102. data/lib/stripe/services/tax_id_service.rb +2 -8
  103. data/lib/stripe/services/tax_service.rb +1 -3
  104. data/lib/stripe/services/terminal/reader_service.rb +0 -180
  105. data/lib/stripe/services/terminal_service.rb +1 -2
  106. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +0 -148
  107. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +0 -43
  108. data/lib/stripe/services/test_helpers/treasury/received_credit_service.rb +1 -25
  109. data/lib/stripe/services/test_helpers/treasury/received_debit_service.rb +1 -25
  110. data/lib/stripe/services/treasury/financial_account_features_service.rb +1 -4
  111. data/lib/stripe/services/treasury/financial_account_service.rb +2 -16
  112. data/lib/stripe/services/treasury/outbound_transfer_service.rb +0 -24
  113. data/lib/stripe/services/v1_services.rb +2 -10
  114. data/lib/stripe/services/v2/core/event_service.rb +5 -3
  115. data/lib/stripe/services/v2/core_service.rb +1 -4
  116. data/lib/stripe/services/v2_services.rb +2 -4
  117. data/lib/stripe/services.rb +0 -49
  118. data/lib/stripe/stripe_configuration.rb +1 -3
  119. data/lib/stripe/stripe_object.rb +14 -4
  120. data/lib/stripe/util.rb +12 -7
  121. data/lib/stripe/version.rb +1 -1
  122. data/lib/stripe.rb +0 -55
  123. data/rbi/stripe/resources/account.rbi +4840 -0
  124. data/rbi/stripe/resources/account_link.rbi +74 -0
  125. data/rbi/stripe/resources/account_session.rbi +894 -0
  126. data/rbi/stripe/resources/apple_pay_domain.rbi +90 -0
  127. data/rbi/stripe/resources/application.rbi +20 -0
  128. data/rbi/stripe/resources/application_fee.rbi +118 -0
  129. data/rbi/stripe/resources/application_fee_refund.rbi +37 -0
  130. data/rbi/stripe/resources/apps/secret.rbi +195 -0
  131. data/rbi/stripe/resources/balance.rbi +180 -0
  132. data/rbi/stripe/resources/balance_transaction.rbi +144 -0
  133. data/rbi/stripe/resources/bank_account.rbi +127 -0
  134. data/rbi/stripe/resources/billing/alert.rbi +201 -0
  135. data/rbi/stripe/resources/billing/alert_triggered.rbi +28 -0
  136. data/rbi/stripe/resources/billing/credit_balance_summary.rbi +63 -0
  137. data/rbi/stripe/resources/billing/credit_balance_transaction.rbi +147 -0
  138. data/rbi/stripe/resources/billing/credit_grant.rbi +291 -0
  139. data/rbi/stripe/resources/billing/meter.rbi +226 -0
  140. data/rbi/stripe/resources/billing/meter_event.rbi +64 -0
  141. data/rbi/stripe/resources/billing/meter_event_adjustment.rbi +64 -0
  142. data/rbi/stripe/resources/billing/meter_event_summary.rbi +35 -0
  143. data/rbi/stripe/resources/billing_portal/configuration.rbi +645 -0
  144. data/rbi/stripe/resources/billing_portal/session.rbi +345 -0
  145. data/rbi/stripe/resources/capability.rbi +125 -0
  146. data/rbi/stripe/resources/card.rbi +125 -0
  147. data/rbi/stripe/resources/cash_balance.rbi +32 -0
  148. data/rbi/stripe/resources/charge.rbi +2054 -0
  149. data/rbi/stripe/resources/checkout/session.rbi +3951 -0
  150. data/rbi/stripe/resources/climate/order.rbi +245 -0
  151. data/rbi/stripe/resources/climate/product.rbi +75 -0
  152. data/rbi/stripe/resources/climate/supplier.rbi +72 -0
  153. data/rbi/stripe/resources/confirmation_token.rbi +1793 -0
  154. data/rbi/stripe/resources/connect_collection_transfer.rbi +26 -0
  155. data/rbi/stripe/resources/country_spec.rbi +85 -0
  156. data/rbi/stripe/resources/coupon.rbi +252 -0
  157. data/rbi/stripe/resources/credit_note.rbi +747 -0
  158. data/rbi/stripe/resources/credit_note_line_item.rbi +101 -0
  159. data/rbi/stripe/resources/customer.rbi +1009 -0
  160. data/rbi/stripe/resources/customer_balance_transaction.rbi +56 -0
  161. data/rbi/stripe/resources/customer_cash_balance_transaction.rbi +151 -0
  162. data/rbi/stripe/resources/customer_session.rbi +200 -0
  163. data/rbi/stripe/resources/discount.rbi +53 -0
  164. data/rbi/stripe/resources/dispute.rbi +761 -0
  165. data/rbi/stripe/resources/entitlements/active_entitlement.rbi +58 -0
  166. data/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi +23 -0
  167. data/rbi/stripe/resources/entitlements/feature.rbi +117 -0
  168. data/rbi/stripe/resources/ephemeral_key.rbi +44 -0
  169. data/rbi/stripe/resources/event.rbi +146 -0
  170. data/rbi/stripe/resources/exchange_rate.rbi +66 -0
  171. data/rbi/stripe/resources/file.rbi +143 -0
  172. data/rbi/stripe/resources/file_link.rbi +141 -0
  173. data/rbi/stripe/resources/financial_connections/account.rbi +339 -0
  174. data/rbi/stripe/resources/financial_connections/account_owner.rbi +35 -0
  175. data/rbi/stripe/resources/financial_connections/account_ownership.rbi +23 -0
  176. data/rbi/stripe/resources/financial_connections/session.rbi +123 -0
  177. data/rbi/stripe/resources/financial_connections/transaction.rbi +124 -0
  178. data/rbi/stripe/resources/forwarding/request.rbi +216 -0
  179. data/rbi/stripe/resources/funding_instructions.rbi +437 -0
  180. data/rbi/stripe/resources/identity/verification_report.rbi +351 -0
  181. data/rbi/stripe/resources/identity/verification_session.rbi +517 -0
  182. data/rbi/stripe/resources/invoice.rbi +3733 -0
  183. data/rbi/stripe/resources/invoice_item.rbi +475 -0
  184. data/rbi/stripe/resources/invoice_line_item.rbi +432 -0
  185. data/rbi/stripe/resources/invoice_payment.rbi +114 -0
  186. data/rbi/stripe/resources/invoice_rendering_template.rbi +104 -0
  187. data/rbi/stripe/resources/issuing/authorization.rbi +1283 -0
  188. data/rbi/stripe/resources/issuing/card.rbi +741 -0
  189. data/rbi/stripe/resources/issuing/cardholder.rbi +744 -0
  190. data/rbi/stripe/resources/issuing/dispute.rbi +913 -0
  191. data/rbi/stripe/resources/issuing/personalization_design.rbi +338 -0
  192. data/rbi/stripe/resources/issuing/physical_bundle.rbi +79 -0
  193. data/rbi/stripe/resources/issuing/token.rbi +226 -0
  194. data/rbi/stripe/resources/issuing/transaction.rbi +1061 -0
  195. data/rbi/stripe/resources/line_item.rbi +72 -0
  196. data/rbi/stripe/resources/login_link.rbi +18 -0
  197. data/rbi/stripe/resources/mandate.rbi +187 -0
  198. data/rbi/stripe/resources/payment_intent.rbi +9731 -0
  199. data/rbi/stripe/resources/payment_link.rbi +1801 -0
  200. data/rbi/stripe/resources/payment_method.rbi +1822 -0
  201. data/rbi/stripe/resources/payment_method_configuration.rbi +3154 -0
  202. data/rbi/stripe/resources/payment_method_domain.rbi +212 -0
  203. data/rbi/stripe/resources/payout.rbi +300 -0
  204. data/rbi/stripe/resources/person.rbi +371 -0
  205. data/rbi/stripe/resources/plan.rbi +373 -0
  206. data/rbi/stripe/resources/price.rbi +694 -0
  207. data/rbi/stripe/resources/product.rbi +557 -0
  208. data/rbi/stripe/resources/product_feature.rbi +26 -0
  209. data/rbi/stripe/resources/promotion_code.rbi +261 -0
  210. data/rbi/stripe/resources/quote.rbi +1123 -0
  211. data/rbi/stripe/resources/radar/early_fraud_warning.rbi +98 -0
  212. data/rbi/stripe/resources/radar/value_list.rbi +170 -0
  213. data/rbi/stripe/resources/radar/value_list_item.rbi +131 -0
  214. data/rbi/stripe/resources/refund.rbi +516 -0
  215. data/rbi/stripe/resources/reporting/report_run.rbi +191 -0
  216. data/rbi/stripe/resources/reporting/report_type.rbi +57 -0
  217. data/rbi/stripe/resources/reserve_transaction.rbi +23 -0
  218. data/rbi/stripe/resources/reversal.rbi +51 -0
  219. data/rbi/stripe/resources/review.rbi +154 -0
  220. data/rbi/stripe/resources/setup_attempt.rbi +477 -0
  221. data/rbi/stripe/resources/setup_intent.rbi +3860 -0
  222. data/rbi/stripe/resources/shipping_rate.rbi +305 -0
  223. data/rbi/stripe/resources/sigma/scheduled_query_run.rbi +75 -0
  224. data/rbi/stripe/resources/source.rbi +1496 -0
  225. data/rbi/stripe/resources/source_mandate_notification.rbi +77 -0
  226. data/rbi/stripe/resources/source_transaction.rbi +127 -0
  227. data/rbi/stripe/resources/subscription.rbi +1964 -0
  228. data/rbi/stripe/resources/subscription_item.rbi +370 -0
  229. data/rbi/stripe/resources/subscription_schedule.rbi +1495 -0
  230. data/rbi/stripe/resources/tax/calculation.rbi +474 -0
  231. data/rbi/stripe/resources/tax/calculation_line_item.rbi +88 -0
  232. data/rbi/stripe/resources/tax/registration.rbi +2485 -0
  233. data/rbi/stripe/resources/tax/settings.rbi +141 -0
  234. data/rbi/stripe/resources/tax/transaction.rbi +351 -0
  235. data/rbi/stripe/resources/tax/transaction_line_item.rbi +54 -0
  236. data/rbi/stripe/resources/tax_code.rbi +44 -0
  237. data/rbi/stripe/resources/tax_deducted_at_source.rbi +23 -0
  238. data/rbi/stripe/resources/tax_id.rbi +167 -0
  239. data/rbi/stripe/resources/tax_rate.rbi +239 -0
  240. data/rbi/stripe/resources/terminal/configuration.rbi +1388 -0
  241. data/rbi/stripe/resources/terminal/connection_token.rbi +37 -0
  242. data/rbi/stripe/resources/terminal/location.rbi +224 -0
  243. data/rbi/stripe/resources/terminal/reader.rbi +587 -0
  244. data/rbi/stripe/resources/test_helpers/test_clock.rbi +134 -0
  245. data/rbi/stripe/resources/token.rbi +1217 -0
  246. data/rbi/stripe/resources/topup.rbi +222 -0
  247. data/rbi/stripe/resources/transfer.rbi +199 -0
  248. data/rbi/stripe/resources/treasury/credit_reversal.rbi +119 -0
  249. data/rbi/stripe/resources/treasury/debit_reversal.rbi +131 -0
  250. data/rbi/stripe/resources/treasury/financial_account.rbi +865 -0
  251. data/rbi/stripe/resources/treasury/financial_account_features.rbi +260 -0
  252. data/rbi/stripe/resources/treasury/inbound_transfer.rbi +295 -0
  253. data/rbi/stripe/resources/treasury/outbound_payment.rbi +592 -0
  254. data/rbi/stripe/resources/treasury/outbound_transfer.rbi +431 -0
  255. data/rbi/stripe/resources/treasury/received_credit.rbi +302 -0
  256. data/rbi/stripe/resources/treasury/received_debit.rbi +256 -0
  257. data/rbi/stripe/resources/treasury/transaction.rbi +215 -0
  258. data/rbi/stripe/resources/treasury/transaction_entry.rbi +192 -0
  259. data/rbi/stripe/resources/v2/amount.rbi +14 -0
  260. data/rbi/stripe/resources/v2/billing/meter_event.rbi +37 -0
  261. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +41 -0
  262. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +31 -0
  263. data/rbi/stripe/resources/v2/event.rbi +48 -0
  264. data/rbi/stripe/resources/v2/event_destination.rbi +91 -0
  265. data/rbi/stripe/resources/webhook_endpoint.rbi +170 -0
  266. data/rbi/stripe/services/account_capability_service.rbi +51 -0
  267. data/rbi/stripe/services/account_external_account_service.rbi +306 -0
  268. data/rbi/stripe/services/account_link_service.rbi +58 -0
  269. data/rbi/stripe/services/account_login_link_service.rbi +22 -0
  270. data/rbi/stripe/services/account_person_service.rbi +923 -0
  271. data/rbi/stripe/services/account_service.rbi +4143 -0
  272. data/rbi/stripe/services/account_session_service.rbi +572 -0
  273. data/rbi/stripe/services/apple_pay_domain_service.rbi +78 -0
  274. data/rbi/stripe/services/application_fee_refund_service.rbi +93 -0
  275. data/rbi/stripe/services/application_fee_service.rbi +78 -0
  276. data/rbi/stripe/services/apps/secret_service.rbi +151 -0
  277. data/rbi/stripe/services/apps_service.rbi +9 -0
  278. data/rbi/stripe/services/balance_service.rbi +21 -0
  279. data/rbi/stripe/services/balance_transaction_service.rbi +93 -0
  280. data/rbi/stripe/services/billing/alert_service.rbi +152 -0
  281. data/rbi/stripe/services/billing/credit_balance_summary_service.rbi +68 -0
  282. data/rbi/stripe/services/billing/credit_balance_transaction_service.rbi +59 -0
  283. data/rbi/stripe/services/billing/credit_grant_service.rbi +211 -0
  284. data/rbi/stripe/services/billing/meter_event_adjustment_service.rbi +42 -0
  285. data/rbi/stripe/services/billing/meter_event_service.rbi +42 -0
  286. data/rbi/stripe/services/billing/meter_event_summary_service.rbi +54 -0
  287. data/rbi/stripe/services/billing/meter_service.rbi +163 -0
  288. data/rbi/stripe/services/billing_portal/configuration_service.rbi +511 -0
  289. data/rbi/stripe/services/billing_portal/session_service.rbi +204 -0
  290. data/rbi/stripe/services/billing_portal_service.rbi +10 -0
  291. data/rbi/stripe/services/billing_service.rbi +15 -0
  292. data/rbi/stripe/services/charge_service.rbi +448 -0
  293. data/rbi/stripe/services/checkout/session_line_item_service.rbi +33 -0
  294. data/rbi/stripe/services/checkout/session_service.rbi +2585 -0
  295. data/rbi/stripe/services/checkout_service.rbi +9 -0
  296. data/rbi/stripe/services/climate/order_service.rbi +142 -0
  297. data/rbi/stripe/services/climate/product_service.rbi +46 -0
  298. data/{lib/stripe/services/financial_connections/institution_service.rb → rbi/stripe/services/climate/supplier_service.rbi} +25 -36
  299. data/rbi/stripe/services/climate_service.rbi +11 -0
  300. data/rbi/stripe/services/confirmation_token_service.rbi +20 -0
  301. data/rbi/stripe/services/country_spec_service.rbi +44 -0
  302. data/rbi/stripe/services/coupon_service.rbi +196 -0
  303. data/{lib/stripe/services/quote_preview_subscription_schedule_service.rb → rbi/stripe/services/credit_note_line_item_service.rbi} +16 -20
  304. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +167 -0
  305. data/rbi/stripe/services/credit_note_service.rbi +416 -0
  306. data/rbi/stripe/services/customer_balance_transaction_service.rbi +92 -0
  307. data/rbi/stripe/services/customer_cash_balance_service.rbi +45 -0
  308. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +44 -0
  309. data/rbi/stripe/services/customer_funding_instructions_service.rbi +59 -0
  310. data/rbi/stripe/services/customer_payment_method_service.rbi +57 -0
  311. data/rbi/stripe/services/customer_payment_source_service.rbi +232 -0
  312. data/rbi/stripe/services/customer_service.rbi +651 -0
  313. data/rbi/stripe/services/customer_session_service.rbi +116 -0
  314. data/rbi/stripe/services/customer_tax_id_service.rbi +72 -0
  315. data/rbi/stripe/services/dispute_service.rbi +424 -0
  316. data/rbi/stripe/services/entitlements/active_entitlement_service.rbi +55 -0
  317. data/rbi/stripe/services/entitlements/feature_service.rbi +107 -0
  318. data/rbi/stripe/services/entitlements_service.rbi +10 -0
  319. data/rbi/stripe/services/ephemeral_key_service.rbi +53 -0
  320. data/rbi/stripe/services/event_service.rbi +83 -0
  321. data/rbi/stripe/services/exchange_rate_service.rbi +44 -0
  322. data/rbi/stripe/services/file_link_service.rbi +124 -0
  323. data/rbi/stripe/services/file_service.rbi +116 -0
  324. data/rbi/stripe/services/financial_connections/account_owner_service.rbi +42 -0
  325. data/rbi/stripe/services/financial_connections/account_service.rbi +133 -0
  326. data/rbi/stripe/services/financial_connections/session_service.rbi +88 -0
  327. data/rbi/stripe/services/financial_connections/transaction_service.rbi +92 -0
  328. data/rbi/stripe/services/financial_connections_service.rbi +11 -0
  329. data/rbi/stripe/services/forwarding/request_service.rbi +134 -0
  330. data/rbi/stripe/services/forwarding_service.rbi +9 -0
  331. data/rbi/stripe/services/identity/verification_report_service.rbi +87 -0
  332. data/rbi/stripe/services/identity/verification_session_service.rbi +323 -0
  333. data/rbi/stripe/services/identity_service.rbi +10 -0
  334. data/rbi/stripe/services/invoice_item_service.rbi +368 -0
  335. data/rbi/stripe/services/invoice_line_item_service.rbi +259 -0
  336. data/rbi/stripe/services/invoice_payment_service.rbi +71 -0
  337. data/rbi/stripe/services/invoice_rendering_template_service.rbi +82 -0
  338. data/rbi/stripe/services/invoice_service.rbi +2920 -0
  339. data/rbi/stripe/services/issuing/authorization_service.rbi +146 -0
  340. data/rbi/stripe/services/issuing/card_service.rbi +495 -0
  341. data/rbi/stripe/services/issuing/cardholder_service.rbi +587 -0
  342. data/rbi/stripe/services/issuing/dispute_service.rbi +707 -0
  343. data/rbi/stripe/services/issuing/personalization_design_service.rbi +243 -0
  344. data/rbi/stripe/services/issuing/physical_bundle_service.rbi +59 -0
  345. data/rbi/stripe/services/issuing/token_service.rbi +99 -0
  346. data/rbi/stripe/services/issuing/transaction_service.rbi +105 -0
  347. data/rbi/stripe/services/issuing_service.rbi +16 -0
  348. data/rbi/stripe/services/mandate_service.rbi +20 -0
  349. data/rbi/stripe/services/payment_intent_service.rbi +7759 -0
  350. data/{lib/stripe/services/quote_line_service.rb → rbi/stripe/services/payment_link_line_item_service.rbi} +16 -20
  351. data/rbi/stripe/services/payment_link_service.rbi +1352 -0
  352. data/rbi/stripe/services/payment_method_configuration_service.rbi +2211 -0
  353. data/rbi/stripe/services/payment_method_domain_service.rbi +112 -0
  354. data/rbi/stripe/services/payment_method_service.rbi +840 -0
  355. data/rbi/stripe/services/payout_service.rbi +205 -0
  356. data/rbi/stripe/services/plan_service.rbi +284 -0
  357. data/rbi/stripe/services/price_service.rbi +546 -0
  358. data/rbi/stripe/services/product_feature_service.rbi +69 -0
  359. data/rbi/stripe/services/product_service.rbi +479 -0
  360. data/rbi/stripe/services/promotion_code_service.rbi +214 -0
  361. data/rbi/stripe/services/quote_computed_upfront_line_items_service.rbi +31 -0
  362. data/{lib/stripe/services/order_line_item_service.rb → rbi/stripe/services/quote_line_item_service.rbi} +16 -20
  363. data/rbi/stripe/services/quote_service.rbi +686 -0
  364. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +85 -0
  365. data/rbi/stripe/services/radar/value_list_item_service.rbi +111 -0
  366. data/rbi/stripe/services/radar/value_list_service.rbi +143 -0
  367. data/rbi/stripe/services/radar_service.rbi +11 -0
  368. data/rbi/stripe/services/refund_service.rbi +185 -0
  369. data/rbi/stripe/services/reporting/report_run_service.rbi +135 -0
  370. data/rbi/stripe/services/reporting/report_type_service.rbi +35 -0
  371. data/rbi/stripe/services/reporting_service.rbi +10 -0
  372. data/rbi/stripe/services/review_service.rbi +84 -0
  373. data/rbi/stripe/services/setup_attempt_service.rbi +65 -0
  374. data/rbi/stripe/services/setup_intent_service.rbi +3596 -0
  375. data/rbi/stripe/services/shipping_rate_service.rbi +241 -0
  376. data/rbi/stripe/services/sigma/scheduled_query_run_service.rbi +46 -0
  377. data/rbi/stripe/services/sigma_service.rbi +9 -0
  378. data/rbi/stripe/services/source_service.rbi +663 -0
  379. data/{lib/stripe/services/quote_preview_invoice_service.rb → rbi/stripe/services/source_transaction_service.rbi} +16 -20
  380. data/rbi/stripe/services/subscription_item_service.rbi +324 -0
  381. data/rbi/stripe/services/subscription_schedule_service.rbi +1192 -0
  382. data/rbi/stripe/services/subscription_service.rbi +1596 -0
  383. data/rbi/stripe/services/tax/calculation_line_item_service.rbi +33 -0
  384. data/rbi/stripe/services/tax/calculation_service.rbi +230 -0
  385. data/rbi/stripe/services/tax/registration_service.rbi +1689 -0
  386. data/rbi/stripe/services/tax/settings_service.rbi +93 -0
  387. data/{lib/stripe/services/financial_connections/account_inferred_balance_service.rb → rbi/stripe/services/tax/transaction_line_item_service.rbi} +17 -21
  388. data/rbi/stripe/services/tax/transaction_service.rbi +146 -0
  389. data/rbi/stripe/services/tax_code_service.rbi +44 -0
  390. data/rbi/stripe/services/tax_id_service.rbi +112 -0
  391. data/rbi/stripe/services/tax_rate_service.rbi +185 -0
  392. data/rbi/stripe/services/tax_service.rbi +12 -0
  393. data/rbi/stripe/services/terminal/configuration_service.rbi +1120 -0
  394. data/rbi/stripe/services/terminal/connection_token_service.rbi +25 -0
  395. data/rbi/stripe/services/terminal/location_service.rbi +184 -0
  396. data/rbi/stripe/services/terminal/reader_service.rbi +344 -0
  397. data/rbi/stripe/services/terminal_service.rbi +12 -0
  398. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +746 -0
  399. data/rbi/stripe/services/test_helpers/customer_service.rbi +33 -0
  400. data/rbi/stripe/services/test_helpers/issuing/authorization_service.rbi +848 -0
  401. data/rbi/stripe/services/test_helpers/issuing/card_service.rbi +76 -0
  402. data/rbi/stripe/services/test_helpers/issuing/personalization_design_service.rbi +69 -0
  403. data/rbi/stripe/services/test_helpers/issuing/transaction_service.rbi +711 -0
  404. data/rbi/stripe/services/test_helpers/issuing_service.rbi +14 -0
  405. data/rbi/stripe/services/test_helpers/refund_service.rbi +22 -0
  406. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +62 -0
  407. data/rbi/stripe/services/test_helpers/terminal_service.rbi +11 -0
  408. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +92 -0
  409. data/rbi/stripe/services/test_helpers/treasury/inbound_transfer_service.rbi +64 -0
  410. data/rbi/stripe/services/test_helpers/treasury/outbound_payment_service.rbi +125 -0
  411. data/rbi/stripe/services/test_helpers/treasury/outbound_transfer_service.rbi +125 -0
  412. data/rbi/stripe/services/test_helpers/treasury/received_credit_service.rbi +87 -0
  413. data/rbi/stripe/services/test_helpers/treasury/received_debit_service.rbi +87 -0
  414. data/rbi/stripe/services/test_helpers/treasury_service.rbi +15 -0
  415. data/rbi/stripe/services/test_helpers_service.rbi +15 -0
  416. data/rbi/stripe/services/token_service.rbi +1189 -0
  417. data/rbi/stripe/services/topup_service.rbi +176 -0
  418. data/rbi/stripe/services/transfer_reversal_service.rbi +101 -0
  419. data/rbi/stripe/services/transfer_service.rbi +152 -0
  420. data/rbi/stripe/services/treasury/credit_reversal_service.rbi +84 -0
  421. data/rbi/stripe/services/treasury/debit_reversal_service.rbi +88 -0
  422. data/rbi/stripe/services/treasury/financial_account_features_service.rbi +198 -0
  423. data/rbi/stripe/services/treasury/financial_account_service.rbi +562 -0
  424. data/rbi/stripe/services/treasury/inbound_transfer_service.rbi +117 -0
  425. data/rbi/stripe/services/treasury/outbound_payment_service.rbi +304 -0
  426. data/rbi/stripe/services/treasury/outbound_transfer_service.rbi +157 -0
  427. data/rbi/stripe/services/treasury/received_credit_service.rbi +72 -0
  428. data/rbi/stripe/services/treasury/received_debit_service.rbi +59 -0
  429. data/rbi/stripe/services/treasury/transaction_entry_service.rbi +111 -0
  430. data/rbi/stripe/services/treasury/transaction_service.rbi +122 -0
  431. data/rbi/stripe/services/treasury_service.rbi +18 -0
  432. data/rbi/stripe/services/v1_services.rbi +77 -0
  433. data/rbi/stripe/services/v2/billing/meter_event_adjustment_service.rbi +39 -0
  434. data/rbi/stripe/services/v2/billing/meter_event_service.rbi +42 -0
  435. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +20 -0
  436. data/rbi/stripe/services/v2/billing/meter_event_stream_service.rbi +55 -0
  437. data/rbi/stripe/services/v2/billing_service.rbi +14 -0
  438. data/rbi/stripe/services/v2/core/event_destination_service.rbi +200 -0
  439. data/rbi/stripe/services/v2/core/event_service.rbi +38 -0
  440. data/rbi/stripe/services/v2/core_service.rbi +12 -0
  441. data/rbi/stripe/services/v2_services.rbi +10 -0
  442. data/rbi/stripe/services/webhook_endpoint_service.rbi +131 -0
  443. data/stripe.gemspec +1 -4
  444. metadata +324 -140
  445. data/lib/stripe/events/v2_core_account_including_configuration_customer_capability_status_updated_event.rb +0 -23
  446. data/lib/stripe/events/v2_core_account_including_configuration_customer_updated_event.rb +0 -21
  447. data/lib/stripe/events/v2_core_account_including_configuration_merchant_capability_status_updated_event.rb +0 -23
  448. data/lib/stripe/events/v2_core_account_including_configuration_merchant_updated_event.rb +0 -21
  449. data/lib/stripe/events/v2_core_account_including_configuration_recipient_capability_status_updated_event.rb +0 -23
  450. data/lib/stripe/events/v2_core_account_including_configuration_recipient_updated_event.rb +0 -21
  451. data/lib/stripe/events/v2_core_account_including_identity_updated_event.rb +0 -21
  452. data/lib/stripe/events/v2_core_account_including_requirements_updated_event.rb +0 -21
  453. data/lib/stripe/events/v2_core_account_link_completed_event.rb +0 -13
  454. data/lib/stripe/events/v2_core_account_person_created_event.rb +0 -23
  455. data/lib/stripe/events/v2_core_account_person_deleted_event.rb +0 -23
  456. data/lib/stripe/events/v2_core_account_person_updated_event.rb +0 -23
  457. data/lib/stripe/events/v2_money_management_financial_account_created_event.rb +0 -21
  458. data/lib/stripe/events/v2_money_management_financial_address_activated_event.rb +0 -21
  459. data/lib/stripe/events/v2_money_management_financial_address_failed_event.rb +0 -21
  460. data/lib/stripe/events/v2_money_management_inbound_transfer_available_event.rb +0 -23
  461. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_failed_event.rb +0 -21
  462. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_processing_event.rb +0 -21
  463. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_queued_event.rb +0 -21
  464. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_returned_event.rb +0 -21
  465. data/lib/stripe/events/v2_money_management_inbound_transfer_bank_debit_succeeded_event.rb +0 -21
  466. data/lib/stripe/events/v2_money_management_outbound_payment_canceled_event.rb +0 -21
  467. data/lib/stripe/events/v2_money_management_outbound_payment_created_event.rb +0 -21
  468. data/lib/stripe/events/v2_money_management_outbound_payment_failed_event.rb +0 -21
  469. data/lib/stripe/events/v2_money_management_outbound_payment_posted_event.rb +0 -21
  470. data/lib/stripe/events/v2_money_management_outbound_payment_returned_event.rb +0 -21
  471. data/lib/stripe/events/v2_money_management_outbound_transfer_canceled_event.rb +0 -21
  472. data/lib/stripe/events/v2_money_management_outbound_transfer_created_event.rb +0 -21
  473. data/lib/stripe/events/v2_money_management_outbound_transfer_failed_event.rb +0 -21
  474. data/lib/stripe/events/v2_money_management_outbound_transfer_posted_event.rb +0 -21
  475. data/lib/stripe/events/v2_money_management_outbound_transfer_returned_event.rb +0 -21
  476. data/lib/stripe/events/v2_money_management_received_credit_available_event.rb +0 -23
  477. data/lib/stripe/events/v2_money_management_received_credit_failed_event.rb +0 -21
  478. data/lib/stripe/events/v2_money_management_received_credit_returned_event.rb +0 -21
  479. data/lib/stripe/events/v2_money_management_received_credit_succeeded_event.rb +0 -21
  480. data/lib/stripe/events/v2_money_management_received_debit_canceled_event.rb +0 -21
  481. data/lib/stripe/events/v2_money_management_received_debit_failed_event.rb +0 -21
  482. data/lib/stripe/events/v2_money_management_received_debit_pending_event.rb +0 -21
  483. data/lib/stripe/events/v2_money_management_received_debit_succeeded_event.rb +0 -21
  484. data/lib/stripe/events/v2_money_management_received_debit_updated_event.rb +0 -21
  485. data/lib/stripe/request_signing_authenticator.rb +0 -79
  486. data/lib/stripe/resources/account_notice.rb +0 -123
  487. data/lib/stripe/resources/balance_settings.rb +0 -101
  488. data/lib/stripe/resources/billing/meter_error_report.rb +0 -59
  489. data/lib/stripe/resources/capital/financing_offer.rb +0 -179
  490. data/lib/stripe/resources/capital/financing_summary.rb +0 -55
  491. data/lib/stripe/resources/capital/financing_transaction.rb +0 -114
  492. data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +0 -27
  493. data/lib/stripe/resources/financial_connections/institution.rb +0 -90
  494. data/lib/stripe/resources/gift_cards/card.rb +0 -208
  495. data/lib/stripe/resources/gift_cards/transaction.rb +0 -272
  496. data/lib/stripe/resources/issuing/credit_underwriting_record.rb +0 -602
  497. data/lib/stripe/resources/issuing/dispute_settlement_detail.rb +0 -82
  498. data/lib/stripe/resources/issuing/fraud_liability_debit.rb +0 -86
  499. data/lib/stripe/resources/issuing/settlement.rb +0 -53
  500. data/lib/stripe/resources/margin.rb +0 -115
  501. data/lib/stripe/resources/order.rb +0 -2859
  502. data/lib/stripe/resources/payment_attempt_record.rb +0 -1078
  503. data/lib/stripe/resources/payment_record.rb +0 -1607
  504. data/lib/stripe/resources/quote_line.rb +0 -274
  505. data/lib/stripe/resources/quote_preview_invoice.rb +0 -663
  506. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +0 -337
  507. data/lib/stripe/resources/tax/association.rb +0 -89
  508. data/lib/stripe/resources/tax/form.rb +0 -211
  509. data/lib/stripe/resources/terminal/reader_collected_data.rb +0 -31
  510. data/lib/stripe/resources/v2/core/account.rb +0 -1715
  511. data/lib/stripe/resources/v2/core/account_link.rb +0 -54
  512. data/lib/stripe/resources/v2/core/person.rb +0 -272
  513. data/lib/stripe/resources/v2/core/vault/gb_bank_account.rb +0 -72
  514. data/lib/stripe/resources/v2/core/vault/us_bank_account.rb +0 -37
  515. data/lib/stripe/resources/v2/financial_address_credit_simulation.rb +0 -18
  516. data/lib/stripe/resources/v2/financial_address_generated_microdeposits.rb +0 -20
  517. data/lib/stripe/resources/v2/money_management/adjustment.rb +0 -49
  518. data/lib/stripe/resources/v2/money_management/financial_account.rb +0 -56
  519. data/lib/stripe/resources/v2/money_management/financial_address.rb +0 -66
  520. data/lib/stripe/resources/v2/money_management/inbound_transfer.rb +0 -92
  521. data/lib/stripe/resources/v2/money_management/outbound_payment.rb +0 -127
  522. data/lib/stripe/resources/v2/money_management/outbound_payment_quote.rb +0 -74
  523. data/lib/stripe/resources/v2/money_management/outbound_setup_intent.rb +0 -43
  524. data/lib/stripe/resources/v2/money_management/outbound_transfer.rb +0 -115
  525. data/lib/stripe/resources/v2/money_management/payout_method.rb +0 -73
  526. data/lib/stripe/resources/v2/money_management/payout_methods_bank_account_spec.rb +0 -47
  527. data/lib/stripe/resources/v2/money_management/received_credit.rb +0 -134
  528. data/lib/stripe/resources/v2/money_management/received_debit.rb +0 -106
  529. data/lib/stripe/resources/v2/money_management/transaction.rb +0 -76
  530. data/lib/stripe/resources/v2/money_management/transaction_entry.rb +0 -66
  531. data/lib/stripe/services/account_notice_service.rb +0 -101
  532. data/lib/stripe/services/balance_settings_service.rb +0 -96
  533. data/lib/stripe/services/capital/financing_offer_service.rb +0 -112
  534. data/lib/stripe/services/capital/financing_summary_service.rb +0 -28
  535. data/lib/stripe/services/capital/financing_transaction_service.rb +0 -79
  536. data/lib/stripe/services/capital_service.rb +0 -15
  537. data/lib/stripe/services/external_account_service.rb +0 -206
  538. data/lib/stripe/services/gift_cards/card_service.rb +0 -170
  539. data/lib/stripe/services/gift_cards/transaction_service.rb +0 -209
  540. data/lib/stripe/services/gift_cards_service.rb +0 -14
  541. data/lib/stripe/services/issuing/credit_underwriting_record_service.rb +0 -504
  542. data/lib/stripe/services/issuing/dispute_settlement_detail_service.rb +0 -66
  543. data/lib/stripe/services/issuing/fraud_liability_debit_service.rb +0 -83
  544. data/lib/stripe/services/margin_service.rb +0 -119
  545. data/lib/stripe/services/order_service.rb +0 -2268
  546. data/lib/stripe/services/payment_attempt_record_service.rb +0 -49
  547. data/lib/stripe/services/payment_record_service.rb +0 -542
  548. data/lib/stripe/services/tax/association_service.rb +0 -31
  549. data/lib/stripe/services/tax/form_service.rb +0 -100
  550. data/lib/stripe/services/terminal/reader_collected_data_service.rb +0 -28
  551. data/lib/stripe/services/v2/core/account_link_service.rb +0 -76
  552. data/lib/stripe/services/v2/core/account_service.rb +0 -4130
  553. data/lib/stripe/services/v2/core/accounts/person_service.rb +0 -1040
  554. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -135
  555. data/lib/stripe/services/v2/core/vault/us_bank_account_service.rb +0 -109
  556. data/lib/stripe/services/v2/core/vault_service.rb +0 -18
  557. data/lib/stripe/services/v2/money_management/adjustment_service.rb +0 -75
  558. data/lib/stripe/services/v2/money_management/financial_account_service.rb +0 -44
  559. data/lib/stripe/services/v2/money_management/financial_address_service.rb +0 -81
  560. data/lib/stripe/services/v2/money_management/inbound_transfer_service.rb +0 -126
  561. data/lib/stripe/services/v2/money_management/outbound_payment_quote_service.rb +0 -80
  562. data/lib/stripe/services/v2/money_management/outbound_payment_service.rb +0 -202
  563. data/lib/stripe/services/v2/money_management/outbound_setup_intent_service.rb +0 -237
  564. data/lib/stripe/services/v2/money_management/outbound_transfer_service.rb +0 -174
  565. data/lib/stripe/services/v2/money_management/payout_method_service.rb +0 -95
  566. data/lib/stripe/services/v2/money_management/payout_methods_bank_account_spec_service.rb +0 -32
  567. data/lib/stripe/services/v2/money_management/received_credit_service.rb +0 -71
  568. data/lib/stripe/services/v2/money_management/received_debit_service.rb +0 -44
  569. data/lib/stripe/services/v2/money_management/transaction_entry_service.rb +0 -70
  570. data/lib/stripe/services/v2/money_management/transaction_service.rb +0 -74
  571. data/lib/stripe/services/v2/money_management_service.rb +0 -31
  572. data/lib/stripe/services/v2/test_helper_service.rb +0 -15
  573. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +0 -50
  574. data/rbi/stripe.rbi +0 -189274
@@ -3,11 +3,10 @@
3
3
 
4
4
  module Stripe
5
5
  class InvoiceService < StripeService
6
- attr_reader :payments, :line_items
6
+ attr_reader :line_items
7
7
 
8
8
  def initialize(requestor)
9
9
  super(requestor)
10
- @payments = Stripe::InvoicePaymentService.new(@requestor)
11
10
  @line_items = Stripe::InvoiceLineItemService.new(@requestor)
12
11
  end
13
12
 
@@ -24,24 +23,6 @@ module Stripe
24
23
  end
25
24
 
26
25
  class UpdateParams < Stripe::RequestParams
27
- class AmountsDue < Stripe::RequestParams
28
- # The amount in cents (or local equivalent).
29
- attr_accessor :amount
30
- # Number of days from when invoice is finalized until the payment is due.
31
- attr_accessor :days_until_due
32
- # An arbitrary string attached to the object. Often useful for displaying to users.
33
- attr_accessor :description
34
- # Date on which a payment plan’s payment is due.
35
- attr_accessor :due_date
36
-
37
- def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
38
- @amount = amount
39
- @days_until_due = days_until_due
40
- @description = description
41
- @due_date = due_date
42
- end
43
- end
44
-
45
26
  class AutomaticTax < Stripe::RequestParams
46
27
  class Liability < Stripe::RequestParams
47
28
  # The connected account being referenced when `type` is `account`.
@@ -78,44 +59,16 @@ module Stripe
78
59
  end
79
60
 
80
61
  class Discount < Stripe::RequestParams
81
- class DiscountEnd < Stripe::RequestParams
82
- class Duration < Stripe::RequestParams
83
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
84
- attr_accessor :interval
85
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
86
- attr_accessor :interval_count
87
-
88
- def initialize(interval: nil, interval_count: nil)
89
- @interval = interval
90
- @interval_count = interval_count
91
- end
92
- end
93
- # Time span for the redeemed discount.
94
- attr_accessor :duration
95
- # A precise Unix timestamp for the discount to end. Must be in the future.
96
- attr_accessor :timestamp
97
- # The type of calculation made to determine when the discount ends.
98
- attr_accessor :type
99
-
100
- def initialize(duration: nil, timestamp: nil, type: nil)
101
- @duration = duration
102
- @timestamp = timestamp
103
- @type = type
104
- end
105
- end
106
62
  # ID of the coupon to create a new discount for.
107
63
  attr_accessor :coupon
108
64
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
109
65
  attr_accessor :discount
110
- # Details to determine how long the discount should be applied for.
111
- attr_accessor :discount_end
112
66
  # ID of the promotion code to create a new discount for.
113
67
  attr_accessor :promotion_code
114
68
 
115
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
69
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
116
70
  @coupon = coupon
117
71
  @discount = discount
118
- @discount_end = discount_end
119
72
  @promotion_code = promotion_code
120
73
  end
121
74
  end
@@ -235,9 +188,6 @@ module Stripe
235
188
  end
236
189
  end
237
190
 
238
- class IdBankTransfer < Stripe::RequestParams
239
- end
240
-
241
191
  class Konbini < Stripe::RequestParams
242
192
  end
243
193
 
@@ -249,12 +199,9 @@ module Stripe
249
199
  class Filters < Stripe::RequestParams
250
200
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
251
201
  attr_accessor :account_subcategories
252
- # ID of the institution to use to filter for selectable accounts.
253
- attr_accessor :institution
254
202
 
255
- def initialize(account_subcategories: nil, institution: nil)
203
+ def initialize(account_subcategories: nil)
256
204
  @account_subcategories = account_subcategories
257
- @institution = institution
258
205
  end
259
206
  end
260
207
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -288,8 +235,6 @@ module Stripe
288
235
  attr_accessor :card
289
236
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
290
237
  attr_accessor :customer_balance
291
- # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
292
- attr_accessor :id_bank_transfer
293
238
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
294
239
  attr_accessor :konbini
295
240
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
@@ -302,7 +247,6 @@ module Stripe
302
247
  bancontact: nil,
303
248
  card: nil,
304
249
  customer_balance: nil,
305
- id_bank_transfer: nil,
306
250
  konbini: nil,
307
251
  sepa_debit: nil,
308
252
  us_bank_account: nil
@@ -311,7 +255,6 @@ module Stripe
311
255
  @bancontact = bancontact
312
256
  @card = card
313
257
  @customer_balance = customer_balance
314
- @id_bank_transfer = id_bank_transfer
315
258
  @konbini = konbini
316
259
  @sepa_debit = sepa_debit
317
260
  @us_bank_account = us_bank_account
@@ -523,8 +466,6 @@ module Stripe
523
466
  end
524
467
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
525
468
  attr_accessor :account_tax_ids
526
- # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
527
- attr_accessor :amounts_due
528
469
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
529
470
  attr_accessor :application_fee_amount
530
471
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice.
@@ -539,8 +480,6 @@ module Stripe
539
480
  attr_accessor :custom_fields
540
481
  # The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
541
482
  attr_accessor :days_until_due
542
- # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
543
- attr_accessor :default_margins
544
483
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
545
484
  attr_accessor :default_payment_method
546
485
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -582,7 +521,6 @@ module Stripe
582
521
 
583
522
  def initialize(
584
523
  account_tax_ids: nil,
585
- amounts_due: nil,
586
524
  application_fee_amount: nil,
587
525
  auto_advance: nil,
588
526
  automatic_tax: nil,
@@ -590,7 +528,6 @@ module Stripe
590
528
  collection_method: nil,
591
529
  custom_fields: nil,
592
530
  days_until_due: nil,
593
- default_margins: nil,
594
531
  default_payment_method: nil,
595
532
  default_source: nil,
596
533
  default_tax_rates: nil,
@@ -612,7 +549,6 @@ module Stripe
612
549
  transfer_data: nil
613
550
  )
614
551
  @account_tax_ids = account_tax_ids
615
- @amounts_due = amounts_due
616
552
  @application_fee_amount = application_fee_amount
617
553
  @auto_advance = auto_advance
618
554
  @automatic_tax = automatic_tax
@@ -620,7 +556,6 @@ module Stripe
620
556
  @collection_method = collection_method
621
557
  @custom_fields = custom_fields
622
558
  @days_until_due = days_until_due
623
- @default_margins = default_margins
624
559
  @default_payment_method = default_payment_method
625
560
  @default_source = default_source
626
561
  @default_tax_rates = default_tax_rates
@@ -685,8 +620,6 @@ module Stripe
685
620
  attr_accessor :created
686
621
  # Only return invoices for the customer specified by this customer ID.
687
622
  attr_accessor :customer
688
- # Attribute for param field customer_account
689
- attr_accessor :customer_account
690
623
  # Attribute for param field due_date
691
624
  attr_accessor :due_date
692
625
  # 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.
@@ -706,7 +639,6 @@ module Stripe
706
639
  collection_method: nil,
707
640
  created: nil,
708
641
  customer: nil,
709
- customer_account: nil,
710
642
  due_date: nil,
711
643
  ending_before: nil,
712
644
  expand: nil,
@@ -718,7 +650,6 @@ module Stripe
718
650
  @collection_method = collection_method
719
651
  @created = created
720
652
  @customer = customer
721
- @customer_account = customer_account
722
653
  @due_date = due_date
723
654
  @ending_before = ending_before
724
655
  @expand = expand
@@ -730,24 +661,6 @@ module Stripe
730
661
  end
731
662
 
732
663
  class CreateParams < Stripe::RequestParams
733
- class AmountsDue < Stripe::RequestParams
734
- # The amount in cents (or local equivalent).
735
- attr_accessor :amount
736
- # Number of days from when invoice is finalized until the payment is due.
737
- attr_accessor :days_until_due
738
- # An arbitrary string attached to the object. Often useful for displaying to users.
739
- attr_accessor :description
740
- # Date on which a payment plan’s payment is due.
741
- attr_accessor :due_date
742
-
743
- def initialize(amount: nil, days_until_due: nil, description: nil, due_date: nil)
744
- @amount = amount
745
- @days_until_due = days_until_due
746
- @description = description
747
- @due_date = due_date
748
- end
749
- end
750
-
751
664
  class AutomaticTax < Stripe::RequestParams
752
665
  class Liability < Stripe::RequestParams
753
666
  # The connected account being referenced when `type` is `account`.
@@ -784,44 +697,16 @@ module Stripe
784
697
  end
785
698
 
786
699
  class Discount < Stripe::RequestParams
787
- class DiscountEnd < Stripe::RequestParams
788
- class Duration < Stripe::RequestParams
789
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
790
- attr_accessor :interval
791
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
792
- attr_accessor :interval_count
793
-
794
- def initialize(interval: nil, interval_count: nil)
795
- @interval = interval
796
- @interval_count = interval_count
797
- end
798
- end
799
- # Time span for the redeemed discount.
800
- attr_accessor :duration
801
- # A precise Unix timestamp for the discount to end. Must be in the future.
802
- attr_accessor :timestamp
803
- # The type of calculation made to determine when the discount ends.
804
- attr_accessor :type
805
-
806
- def initialize(duration: nil, timestamp: nil, type: nil)
807
- @duration = duration
808
- @timestamp = timestamp
809
- @type = type
810
- end
811
- end
812
700
  # ID of the coupon to create a new discount for.
813
701
  attr_accessor :coupon
814
702
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
815
703
  attr_accessor :discount
816
- # Details to determine how long the discount should be applied for.
817
- attr_accessor :discount_end
818
704
  # ID of the promotion code to create a new discount for.
819
705
  attr_accessor :promotion_code
820
706
 
821
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
707
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
822
708
  @coupon = coupon
823
709
  @discount = discount
824
- @discount_end = discount_end
825
710
  @promotion_code = promotion_code
826
711
  end
827
712
  end
@@ -953,9 +838,6 @@ module Stripe
953
838
  end
954
839
  end
955
840
 
956
- class IdBankTransfer < Stripe::RequestParams
957
- end
958
-
959
841
  class Konbini < Stripe::RequestParams
960
842
  end
961
843
 
@@ -967,12 +849,9 @@ module Stripe
967
849
  class Filters < Stripe::RequestParams
968
850
  # The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`.
969
851
  attr_accessor :account_subcategories
970
- # ID of the institution to use to filter for selectable accounts.
971
- attr_accessor :institution
972
852
 
973
- def initialize(account_subcategories: nil, institution: nil)
853
+ def initialize(account_subcategories: nil)
974
854
  @account_subcategories = account_subcategories
975
- @institution = institution
976
855
  end
977
856
  end
978
857
  # Provide filters for the linked accounts that the customer can select for the payment method.
@@ -1006,8 +885,6 @@ module Stripe
1006
885
  attr_accessor :card
1007
886
  # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent.
1008
887
  attr_accessor :customer_balance
1009
- # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent.
1010
- attr_accessor :id_bank_transfer
1011
888
  # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent.
1012
889
  attr_accessor :konbini
1013
890
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
@@ -1020,7 +897,6 @@ module Stripe
1020
897
  bancontact: nil,
1021
898
  card: nil,
1022
899
  customer_balance: nil,
1023
- id_bank_transfer: nil,
1024
900
  konbini: nil,
1025
901
  sepa_debit: nil,
1026
902
  us_bank_account: nil
@@ -1029,7 +905,6 @@ module Stripe
1029
905
  @bancontact = bancontact
1030
906
  @card = card
1031
907
  @customer_balance = customer_balance
1032
- @id_bank_transfer = id_bank_transfer
1033
908
  @konbini = konbini
1034
909
  @sepa_debit = sepa_debit
1035
910
  @us_bank_account = us_bank_account
@@ -1241,8 +1116,6 @@ module Stripe
1241
1116
  end
1242
1117
  # The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
1243
1118
  attr_accessor :account_tax_ids
1244
- # List of expected payments and corresponding due dates. Valid only for invoices where `collection_method=send_invoice`.
1245
- attr_accessor :amounts_due
1246
1119
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1247
1120
  attr_accessor :application_fee_amount
1248
1121
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
@@ -1259,12 +1132,8 @@ module Stripe
1259
1132
  attr_accessor :custom_fields
1260
1133
  # The ID of the customer who will be billed.
1261
1134
  attr_accessor :customer
1262
- # The ID of the account who will be billed.
1263
- attr_accessor :customer_account
1264
1135
  # The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`.
1265
1136
  attr_accessor :days_until_due
1266
- # The ids of the margins to apply to the invoice. Can be overridden by line item `margins`.
1267
- attr_accessor :default_margins
1268
1137
  # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
1269
1138
  attr_accessor :default_payment_method
1270
1139
  # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
@@ -1312,7 +1181,6 @@ module Stripe
1312
1181
 
1313
1182
  def initialize(
1314
1183
  account_tax_ids: nil,
1315
- amounts_due: nil,
1316
1184
  application_fee_amount: nil,
1317
1185
  auto_advance: nil,
1318
1186
  automatic_tax: nil,
@@ -1321,9 +1189,7 @@ module Stripe
1321
1189
  currency: nil,
1322
1190
  custom_fields: nil,
1323
1191
  customer: nil,
1324
- customer_account: nil,
1325
1192
  days_until_due: nil,
1326
- default_margins: nil,
1327
1193
  default_payment_method: nil,
1328
1194
  default_source: nil,
1329
1195
  default_tax_rates: nil,
@@ -1348,7 +1214,6 @@ module Stripe
1348
1214
  transfer_data: nil
1349
1215
  )
1350
1216
  @account_tax_ids = account_tax_ids
1351
- @amounts_due = amounts_due
1352
1217
  @application_fee_amount = application_fee_amount
1353
1218
  @auto_advance = auto_advance
1354
1219
  @automatic_tax = automatic_tax
@@ -1357,9 +1222,7 @@ module Stripe
1357
1222
  @currency = currency
1358
1223
  @custom_fields = custom_fields
1359
1224
  @customer = customer
1360
- @customer_account = customer_account
1361
1225
  @days_until_due = days_until_due
1362
- @default_margins = default_margins
1363
1226
  @default_payment_method = default_payment_method
1364
1227
  @default_source = default_source
1365
1228
  @default_tax_rates = default_tax_rates
@@ -1406,44 +1269,16 @@ module Stripe
1406
1269
  class AddLinesParams < Stripe::RequestParams
1407
1270
  class Line < Stripe::RequestParams
1408
1271
  class Discount < Stripe::RequestParams
1409
- class DiscountEnd < Stripe::RequestParams
1410
- class Duration < Stripe::RequestParams
1411
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1412
- attr_accessor :interval
1413
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1414
- attr_accessor :interval_count
1415
-
1416
- def initialize(interval: nil, interval_count: nil)
1417
- @interval = interval
1418
- @interval_count = interval_count
1419
- end
1420
- end
1421
- # Time span for the redeemed discount.
1422
- attr_accessor :duration
1423
- # A precise Unix timestamp for the discount to end. Must be in the future.
1424
- attr_accessor :timestamp
1425
- # The type of calculation made to determine when the discount ends.
1426
- attr_accessor :type
1427
-
1428
- def initialize(duration: nil, timestamp: nil, type: nil)
1429
- @duration = duration
1430
- @timestamp = timestamp
1431
- @type = type
1432
- end
1433
- end
1434
1272
  # ID of the coupon to create a new discount for.
1435
1273
  attr_accessor :coupon
1436
1274
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1437
1275
  attr_accessor :discount
1438
- # Details to determine how long the discount should be applied for.
1439
- attr_accessor :discount_end
1440
1276
  # ID of the promotion code to create a new discount for.
1441
1277
  attr_accessor :promotion_code
1442
1278
 
1443
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1279
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1444
1280
  @coupon = coupon
1445
1281
  @discount = discount
1446
- @discount_end = discount_end
1447
1282
  @promotion_code = promotion_code
1448
1283
  end
1449
1284
  end
@@ -1596,8 +1431,6 @@ module Stripe
1596
1431
  attr_accessor :discounts
1597
1432
  # ID of an unassigned invoice item to assign to this invoice. If not provided, a new item will be created.
1598
1433
  attr_accessor :invoice_item
1599
- # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
1600
- attr_accessor :margins
1601
1434
  # 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`.
1602
1435
  attr_accessor :metadata
1603
1436
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -1619,7 +1452,6 @@ module Stripe
1619
1452
  discountable: nil,
1620
1453
  discounts: nil,
1621
1454
  invoice_item: nil,
1622
- margins: nil,
1623
1455
  metadata: nil,
1624
1456
  period: nil,
1625
1457
  price_data: nil,
@@ -1633,7 +1465,6 @@ module Stripe
1633
1465
  @discountable = discountable
1634
1466
  @discounts = discounts
1635
1467
  @invoice_item = invoice_item
1636
- @margins = margins
1637
1468
  @metadata = metadata
1638
1469
  @period = period
1639
1470
  @price_data = price_data
@@ -1657,78 +1488,6 @@ module Stripe
1657
1488
  end
1658
1489
  end
1659
1490
 
1660
- class AttachPaymentParams < Stripe::RequestParams
1661
- class PaymentRecordData < Stripe::RequestParams
1662
- # The amount that was paid out of band.
1663
- attr_accessor :amount
1664
- # The currency that was paid out of band.
1665
- attr_accessor :currency
1666
- # 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`.
1667
- attr_accessor :metadata
1668
- # The type of money movement for this out of band payment record.
1669
- attr_accessor :money_movement_type
1670
- # The timestamp when this out of band payment was paid.
1671
- attr_accessor :paid_at
1672
- # The reference for this out of band payment record.
1673
- attr_accessor :payment_reference
1674
-
1675
- def initialize(
1676
- amount: nil,
1677
- currency: nil,
1678
- metadata: nil,
1679
- money_movement_type: nil,
1680
- paid_at: nil,
1681
- payment_reference: nil
1682
- )
1683
- @amount = amount
1684
- @currency = currency
1685
- @metadata = metadata
1686
- @money_movement_type = money_movement_type
1687
- @paid_at = paid_at
1688
- @payment_reference = payment_reference
1689
- end
1690
- end
1691
- # The portion of the `amount` on the PaymentIntent or out of band payment to apply to this invoice. It defaults to the entire amount.
1692
- attr_accessor :amount_requested
1693
- # Specifies which fields in the response should be expanded.
1694
- attr_accessor :expand
1695
- # The ID of the PaymentIntent to attach to the invoice.
1696
- attr_accessor :payment_intent
1697
- # The ID of the PaymentRecord to attach to the invoice.
1698
- attr_accessor :payment_record
1699
- # The PaymentRecord data for attaching an out of band payment to the invoice.
1700
- attr_accessor :payment_record_data
1701
-
1702
- def initialize(
1703
- amount_requested: nil,
1704
- expand: nil,
1705
- payment_intent: nil,
1706
- payment_record: nil,
1707
- payment_record_data: nil
1708
- )
1709
- @amount_requested = amount_requested
1710
- @expand = expand
1711
- @payment_intent = payment_intent
1712
- @payment_record = payment_record
1713
- @payment_record_data = payment_record_data
1714
- end
1715
- end
1716
-
1717
- class AttachPaymentIntentParams < Stripe::RequestParams
1718
- # The portion of the PaymentIntent’s `amount` that should be applied to thisinvoice. Defaults to the entire amount.
1719
- attr_accessor :amount_requested
1720
- # Specifies which fields in the response should be expanded.
1721
- attr_accessor :expand
1722
- # The ID of the PaymentIntent to attach to the invoice.
1723
- attr_accessor :payment_intent
1724
-
1725
- def initialize(amount_requested: nil, expand: nil, payment_intent: nil)
1726
- @amount_requested = amount_requested
1727
- @expand = expand
1728
- @payment_intent = payment_intent
1729
- end
1730
- end
1731
-
1732
1491
  class FinalizeInvoiceParams < Stripe::RequestParams
1733
1492
  # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1734
1493
  attr_accessor :auto_advance
@@ -1825,44 +1584,16 @@ module Stripe
1825
1584
  class UpdateLinesParams < Stripe::RequestParams
1826
1585
  class Line < Stripe::RequestParams
1827
1586
  class Discount < Stripe::RequestParams
1828
- class DiscountEnd < Stripe::RequestParams
1829
- class Duration < Stripe::RequestParams
1830
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
1831
- attr_accessor :interval
1832
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
1833
- attr_accessor :interval_count
1834
-
1835
- def initialize(interval: nil, interval_count: nil)
1836
- @interval = interval
1837
- @interval_count = interval_count
1838
- end
1839
- end
1840
- # Time span for the redeemed discount.
1841
- attr_accessor :duration
1842
- # A precise Unix timestamp for the discount to end. Must be in the future.
1843
- attr_accessor :timestamp
1844
- # The type of calculation made to determine when the discount ends.
1845
- attr_accessor :type
1846
-
1847
- def initialize(duration: nil, timestamp: nil, type: nil)
1848
- @duration = duration
1849
- @timestamp = timestamp
1850
- @type = type
1851
- end
1852
- end
1853
1587
  # ID of the coupon to create a new discount for.
1854
1588
  attr_accessor :coupon
1855
1589
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
1856
1590
  attr_accessor :discount
1857
- # Details to determine how long the discount should be applied for.
1858
- attr_accessor :discount_end
1859
1591
  # ID of the promotion code to create a new discount for.
1860
1592
  attr_accessor :promotion_code
1861
1593
 
1862
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1594
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
1863
1595
  @coupon = coupon
1864
1596
  @discount = discount
1865
- @discount_end = discount_end
1866
1597
  @promotion_code = promotion_code
1867
1598
  end
1868
1599
  end
@@ -2015,8 +1746,6 @@ module Stripe
2015
1746
  attr_accessor :discounts
2016
1747
  # ID of an existing line item on the invoice.
2017
1748
  attr_accessor :id
2018
- # The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
2019
- attr_accessor :margins
2020
1749
  # 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`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
2021
1750
  attr_accessor :metadata
2022
1751
  # The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
@@ -2038,7 +1767,6 @@ module Stripe
2038
1767
  discountable: nil,
2039
1768
  discounts: nil,
2040
1769
  id: nil,
2041
- margins: nil,
2042
1770
  metadata: nil,
2043
1771
  period: nil,
2044
1772
  price_data: nil,
@@ -2052,7 +1780,6 @@ module Stripe
2052
1780
  @discountable = discountable
2053
1781
  @discounts = discounts
2054
1782
  @id = id
2055
- @margins = margins
2056
1783
  @metadata = metadata
2057
1784
  @period = period
2058
1785
  @price_data = price_data
@@ -2227,88 +1954,32 @@ module Stripe
2227
1954
  end
2228
1955
 
2229
1956
  class Discount < Stripe::RequestParams
2230
- class DiscountEnd < Stripe::RequestParams
2231
- class Duration < Stripe::RequestParams
2232
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2233
- attr_accessor :interval
2234
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2235
- attr_accessor :interval_count
2236
-
2237
- def initialize(interval: nil, interval_count: nil)
2238
- @interval = interval
2239
- @interval_count = interval_count
2240
- end
2241
- end
2242
- # Time span for the redeemed discount.
2243
- attr_accessor :duration
2244
- # A precise Unix timestamp for the discount to end. Must be in the future.
2245
- attr_accessor :timestamp
2246
- # The type of calculation made to determine when the discount ends.
2247
- attr_accessor :type
2248
-
2249
- def initialize(duration: nil, timestamp: nil, type: nil)
2250
- @duration = duration
2251
- @timestamp = timestamp
2252
- @type = type
2253
- end
2254
- end
2255
1957
  # ID of the coupon to create a new discount for.
2256
1958
  attr_accessor :coupon
2257
1959
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2258
1960
  attr_accessor :discount
2259
- # Details to determine how long the discount should be applied for.
2260
- attr_accessor :discount_end
2261
1961
  # ID of the promotion code to create a new discount for.
2262
1962
  attr_accessor :promotion_code
2263
1963
 
2264
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1964
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2265
1965
  @coupon = coupon
2266
1966
  @discount = discount
2267
- @discount_end = discount_end
2268
1967
  @promotion_code = promotion_code
2269
1968
  end
2270
1969
  end
2271
1970
 
2272
1971
  class InvoiceItem < Stripe::RequestParams
2273
1972
  class Discount < Stripe::RequestParams
2274
- class DiscountEnd < Stripe::RequestParams
2275
- class Duration < Stripe::RequestParams
2276
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2277
- attr_accessor :interval
2278
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2279
- attr_accessor :interval_count
2280
-
2281
- def initialize(interval: nil, interval_count: nil)
2282
- @interval = interval
2283
- @interval_count = interval_count
2284
- end
2285
- end
2286
- # Time span for the redeemed discount.
2287
- attr_accessor :duration
2288
- # A precise Unix timestamp for the discount to end. Must be in the future.
2289
- attr_accessor :timestamp
2290
- # The type of calculation made to determine when the discount ends.
2291
- attr_accessor :type
2292
-
2293
- def initialize(duration: nil, timestamp: nil, type: nil)
2294
- @duration = duration
2295
- @timestamp = timestamp
2296
- @type = type
2297
- end
2298
- end
2299
1973
  # ID of the coupon to create a new discount for.
2300
1974
  attr_accessor :coupon
2301
1975
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2302
1976
  attr_accessor :discount
2303
- # Details to determine how long the discount should be applied for.
2304
- attr_accessor :discount_end
2305
1977
  # ID of the promotion code to create a new discount for.
2306
1978
  attr_accessor :promotion_code
2307
1979
 
2308
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
1980
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2309
1981
  @coupon = coupon
2310
1982
  @discount = discount
2311
- @discount_end = discount_end
2312
1983
  @promotion_code = promotion_code
2313
1984
  end
2314
1985
  end
@@ -2434,499 +2105,19 @@ module Stripe
2434
2105
  end
2435
2106
 
2436
2107
  class ScheduleDetails < Stripe::RequestParams
2437
- class Amendment < Stripe::RequestParams
2438
- class AmendmentEnd < Stripe::RequestParams
2439
- class DiscountEnd < Stripe::RequestParams
2440
- # The ID of a specific discount.
2441
- attr_accessor :discount
2442
-
2443
- def initialize(discount: nil)
2444
- @discount = discount
2445
- end
2446
- end
2447
-
2448
- class Duration < Stripe::RequestParams
2449
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2450
- attr_accessor :interval
2451
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2452
- attr_accessor :interval_count
2453
-
2454
- def initialize(interval: nil, interval_count: nil)
2455
- @interval = interval
2456
- @interval_count = interval_count
2457
- end
2458
- end
2459
- # Use the `end` time of a given discount.
2460
- attr_accessor :discount_end
2461
- # Time span for the amendment starting from the `amendment_start`.
2462
- attr_accessor :duration
2463
- # A precise Unix timestamp for the amendment to end. Must be after the `amendment_start`.
2464
- attr_accessor :timestamp
2465
- # Select one of three ways to pass the `amendment_end`.
2466
- attr_accessor :type
2467
-
2468
- def initialize(discount_end: nil, duration: nil, timestamp: nil, type: nil)
2469
- @discount_end = discount_end
2470
- @duration = duration
2471
- @timestamp = timestamp
2472
- @type = type
2473
- end
2474
- end
2475
-
2476
- class AmendmentStart < Stripe::RequestParams
2477
- class AmendmentEnd < Stripe::RequestParams
2478
- # The position of the previous amendment in the `amendments` array after which this amendment should begin. Indexes start from 0 and must be less than the index of the current amendment in the array.
2479
- attr_accessor :index
2480
-
2481
- def initialize(index: nil)
2482
- @index = index
2483
- end
2484
- end
2485
-
2486
- class DiscountEnd < Stripe::RequestParams
2487
- # The ID of a specific discount.
2488
- attr_accessor :discount
2489
-
2490
- def initialize(discount: nil)
2491
- @discount = discount
2492
- end
2493
- end
2494
- # Details of another amendment in the same array, immediately after which this amendment should begin.
2495
- attr_accessor :amendment_end
2496
- # Use the `end` time of a given discount.
2497
- attr_accessor :discount_end
2498
- # A precise Unix timestamp for the amendment to start.
2499
- attr_accessor :timestamp
2500
- # Select one of three ways to pass the `amendment_start`.
2501
- attr_accessor :type
2502
-
2503
- def initialize(amendment_end: nil, discount_end: nil, timestamp: nil, type: nil)
2504
- @amendment_end = amendment_end
2505
- @discount_end = discount_end
2506
- @timestamp = timestamp
2507
- @type = type
2508
- end
2509
- end
2510
-
2511
- class DiscountAction < Stripe::RequestParams
2512
- class Add < Stripe::RequestParams
2513
- class DiscountEnd < Stripe::RequestParams
2514
- # The type of calculation made to determine when the discount ends.
2515
- attr_accessor :type
2516
-
2517
- def initialize(type: nil)
2518
- @type = type
2519
- end
2520
- end
2521
- # The coupon code to redeem.
2522
- attr_accessor :coupon
2523
- # An ID of an existing discount for a coupon that was already redeemed.
2524
- attr_accessor :discount
2525
- # Details to determine how long the discount should be applied for.
2526
- attr_accessor :discount_end
2527
- # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array.
2528
- attr_accessor :index
2529
- # The promotion code to redeem.
2530
- attr_accessor :promotion_code
2531
-
2532
- def initialize(
2533
- coupon: nil,
2534
- discount: nil,
2535
- discount_end: nil,
2536
- index: nil,
2537
- promotion_code: nil
2538
- )
2539
- @coupon = coupon
2540
- @discount = discount
2541
- @discount_end = discount_end
2542
- @index = index
2543
- @promotion_code = promotion_code
2544
- end
2545
- end
2546
-
2547
- class Remove < Stripe::RequestParams
2548
- # The coupon code to remove from the `discounts` array.
2549
- attr_accessor :coupon
2550
- # The ID of a discount to remove from the `discounts` array.
2551
- attr_accessor :discount
2552
- # The ID of a promotion code to remove from the `discounts` array.
2553
- attr_accessor :promotion_code
2554
-
2555
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2556
- @coupon = coupon
2557
- @discount = discount
2558
- @promotion_code = promotion_code
2559
- end
2560
- end
2561
-
2562
- class Set < Stripe::RequestParams
2563
- # The coupon code to replace the `discounts` array with.
2564
- attr_accessor :coupon
2565
- # An ID of an existing discount to replace the `discounts` array with.
2566
- attr_accessor :discount
2567
- # An ID of an existing promotion code to replace the `discounts` array with.
2568
- attr_accessor :promotion_code
2569
-
2570
- def initialize(coupon: nil, discount: nil, promotion_code: nil)
2571
- @coupon = coupon
2572
- @discount = discount
2573
- @promotion_code = promotion_code
2574
- end
2575
- end
2576
- # Details of the discount to add.
2577
- attr_accessor :add
2578
- # Details of the discount to remove.
2579
- attr_accessor :remove
2580
- # Details of the discount to replace the existing discounts with.
2581
- attr_accessor :set
2582
- # Determines the type of discount action.
2583
- attr_accessor :type
2584
-
2585
- def initialize(add: nil, remove: nil, set: nil, type: nil)
2586
- @add = add
2587
- @remove = remove
2588
- @set = set
2589
- @type = type
2590
- end
2591
- end
2592
-
2593
- class ItemAction < Stripe::RequestParams
2594
- class Add < Stripe::RequestParams
2595
- class Discount < Stripe::RequestParams
2596
- class DiscountEnd < Stripe::RequestParams
2597
- class Duration < Stripe::RequestParams
2598
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2599
- attr_accessor :interval
2600
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2601
- attr_accessor :interval_count
2602
-
2603
- def initialize(interval: nil, interval_count: nil)
2604
- @interval = interval
2605
- @interval_count = interval_count
2606
- end
2607
- end
2608
- # Time span for the redeemed discount.
2609
- attr_accessor :duration
2610
- # A precise Unix timestamp for the discount to end. Must be in the future.
2611
- attr_accessor :timestamp
2612
- # The type of calculation made to determine when the discount ends.
2613
- attr_accessor :type
2614
-
2615
- def initialize(duration: nil, timestamp: nil, type: nil)
2616
- @duration = duration
2617
- @timestamp = timestamp
2618
- @type = type
2619
- end
2620
- end
2621
- # ID of the coupon to create a new discount for.
2622
- attr_accessor :coupon
2623
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
2624
- attr_accessor :discount
2625
- # Details to determine how long the discount should be applied for.
2626
- attr_accessor :discount_end
2627
- # ID of the promotion code to create a new discount for.
2628
- attr_accessor :promotion_code
2629
-
2630
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2631
- @coupon = coupon
2632
- @discount = discount
2633
- @discount_end = discount_end
2634
- @promotion_code = promotion_code
2635
- end
2636
- end
2637
-
2638
- class Trial < Stripe::RequestParams
2639
- # 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.
2640
- attr_accessor :converts_to
2641
- # Determines the type of trial for this item.
2642
- attr_accessor :type
2643
-
2644
- def initialize(converts_to: nil, type: nil)
2645
- @converts_to = converts_to
2646
- @type = type
2647
- end
2648
- end
2649
- # The discounts applied to the item. Subscription item discounts are applied before subscription discounts.
2650
- attr_accessor :discounts
2651
- # 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`.
2652
- attr_accessor :metadata
2653
- # The ID of the price object.
2654
- attr_accessor :price
2655
- # Quantity for this item.
2656
- attr_accessor :quantity
2657
- # The tax rates that apply to this subscription item. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`.
2658
- attr_accessor :tax_rates
2659
- # Options that configure the trial on the subscription item.
2660
- attr_accessor :trial
2661
-
2662
- def initialize(
2663
- discounts: nil,
2664
- metadata: nil,
2665
- price: nil,
2666
- quantity: nil,
2667
- tax_rates: nil,
2668
- trial: nil
2669
- )
2670
- @discounts = discounts
2671
- @metadata = metadata
2672
- @price = price
2673
- @quantity = quantity
2674
- @tax_rates = tax_rates
2675
- @trial = trial
2676
- end
2677
- end
2678
-
2679
- class Remove < Stripe::RequestParams
2680
- # ID of a price to remove.
2681
- attr_accessor :price
2682
-
2683
- def initialize(price: nil)
2684
- @price = price
2685
- end
2686
- end
2687
-
2688
- class Set < Stripe::RequestParams
2689
- class Discount < Stripe::RequestParams
2690
- class DiscountEnd < Stripe::RequestParams
2691
- class Duration < Stripe::RequestParams
2692
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2693
- attr_accessor :interval
2694
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2695
- attr_accessor :interval_count
2696
-
2697
- def initialize(interval: nil, interval_count: nil)
2698
- @interval = interval
2699
- @interval_count = interval_count
2700
- end
2701
- end
2702
- # Time span for the redeemed discount.
2703
- attr_accessor :duration
2704
- # A precise Unix timestamp for the discount to end. Must be in the future.
2705
- attr_accessor :timestamp
2706
- # The type of calculation made to determine when the discount ends.
2707
- attr_accessor :type
2708
-
2709
- def initialize(duration: nil, timestamp: nil, type: nil)
2710
- @duration = duration
2711
- @timestamp = timestamp
2712
- @type = type
2713
- end
2714
- end
2715
- # ID of the coupon to create a new discount for.
2716
- attr_accessor :coupon
2717
- # ID of an existing discount on the object (or one of its ancestors) to reuse.
2718
- attr_accessor :discount
2719
- # Details to determine how long the discount should be applied for.
2720
- attr_accessor :discount_end
2721
- # ID of the promotion code to create a new discount for.
2722
- attr_accessor :promotion_code
2723
-
2724
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2725
- @coupon = coupon
2726
- @discount = discount
2727
- @discount_end = discount_end
2728
- @promotion_code = promotion_code
2729
- end
2730
- end
2731
-
2732
- class Trial < Stripe::RequestParams
2733
- # 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.
2734
- attr_accessor :converts_to
2735
- # Determines the type of trial for this item.
2736
- attr_accessor :type
2737
-
2738
- def initialize(converts_to: nil, type: nil)
2739
- @converts_to = converts_to
2740
- @type = type
2741
- end
2742
- end
2743
- # If an item with the `price` already exists, passing this will override the `discounts` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `discounts`.
2744
- attr_accessor :discounts
2745
- # If an item with the `price` already exists, passing this will override the `metadata` on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `metadata`.
2746
- attr_accessor :metadata
2747
- # The ID of the price object.
2748
- attr_accessor :price
2749
- # If an item with the `price` already exists, passing this will override the quantity on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `quantity`.
2750
- attr_accessor :quantity
2751
- # If an item with the `price` already exists, passing this will override the `tax_rates` array on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `tax_rates`.
2752
- attr_accessor :tax_rates
2753
- # If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`.
2754
- attr_accessor :trial
2755
-
2756
- def initialize(
2757
- discounts: nil,
2758
- metadata: nil,
2759
- price: nil,
2760
- quantity: nil,
2761
- tax_rates: nil,
2762
- trial: nil
2763
- )
2764
- @discounts = discounts
2765
- @metadata = metadata
2766
- @price = price
2767
- @quantity = quantity
2768
- @tax_rates = tax_rates
2769
- @trial = trial
2770
- end
2771
- end
2772
- # Details of the subscription item to add. If an item with the same `price` exists, it will be replaced by this new item. Otherwise, it adds the new item.
2773
- attr_accessor :add
2774
- # Details of the subscription item to remove.
2775
- attr_accessor :remove
2776
- # Details of the subscription item to replace the existing items with. If an item with the `set[price]` already exists, the `items` array is not cleared. Instead, all of the other `set` properties that are passed in this request will replace the existing values for the configuration item.
2777
- attr_accessor :set
2778
- # Determines the type of item action.
2779
- attr_accessor :type
2780
-
2781
- def initialize(add: nil, remove: nil, set: nil, type: nil)
2782
- @add = add
2783
- @remove = remove
2784
- @set = set
2785
- @type = type
2786
- end
2787
- end
2788
-
2789
- class MetadataAction < Stripe::RequestParams
2790
- # Key-value pairs to add to schedule phase metadata. These values will merge with existing schedule phase metadata.
2791
- attr_accessor :add
2792
- # Keys to remove from schedule phase metadata.
2793
- attr_accessor :remove
2794
- # Key-value pairs to set as schedule phase metadata. Existing schedule phase metadata will be overwritten.
2795
- attr_accessor :set
2796
- # Select one of three ways to update phase-level `metadata` on subscription schedules.
2797
- attr_accessor :type
2798
-
2799
- def initialize(add: nil, remove: nil, set: nil, type: nil)
2800
- @add = add
2801
- @remove = remove
2802
- @set = set
2803
- @type = type
2804
- end
2805
- end
2806
-
2807
- class SetPauseCollection < Stripe::RequestParams
2808
- class Set < Stripe::RequestParams
2809
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
2810
- attr_accessor :behavior
2811
-
2812
- def initialize(behavior: nil)
2813
- @behavior = behavior
2814
- end
2815
- end
2816
- # Details of the pause_collection behavior to apply to the amendment.
2817
- attr_accessor :set
2818
- # Determines the type of the pause_collection amendment.
2819
- attr_accessor :type
2820
-
2821
- def initialize(set: nil, type: nil)
2822
- @set = set
2823
- @type = type
2824
- end
2825
- end
2826
-
2827
- class TrialSettings < Stripe::RequestParams
2828
- class EndBehavior < Stripe::RequestParams
2829
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
2830
- attr_accessor :prorate_up_front
2831
-
2832
- def initialize(prorate_up_front: nil)
2833
- @prorate_up_front = prorate_up_front
2834
- end
2835
- end
2836
- # Defines how the subscription should behave when a trial ends.
2837
- attr_accessor :end_behavior
2838
-
2839
- def initialize(end_behavior: nil)
2840
- @end_behavior = end_behavior
2841
- end
2842
- end
2843
- # Details to identify the end of the time range modified by the proposed change. If not supplied, the amendment is considered a point-in-time operation that only affects the exact timestamp at `amendment_start`, and a restricted set of attributes is supported on the amendment.
2844
- attr_accessor :amendment_end
2845
- # Details to identify the earliest timestamp where the proposed change should take effect.
2846
- attr_accessor :amendment_start
2847
- # For point-in-time amendments (having no `amendment_end`), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the `amendment_start` timestamp.For time-span based amendments (having both `amendment_start` and `amendment_end`), the only value valid is `automatic`, which removes any previously configured billing cycle anchor resets scheduled to occur during the window of time spanned by the amendment.
2848
- attr_accessor :billing_cycle_anchor
2849
- # Changes to the coupons being redeemed or discounts being applied during the amendment time span.
2850
- attr_accessor :discount_actions
2851
- # Changes to the subscription items during the amendment time span.
2852
- attr_accessor :item_actions
2853
- # Instructions for how to modify phase metadata
2854
- attr_accessor :metadata_actions
2855
- # Changes to how Stripe handles prorations during the amendment time span. Affects if and how prorations are created when a future phase starts. In cases where the amendment changes the currently active phase, it is used to determine whether or how to prorate now, at the time of the request. Also supported as a point-in-time operation when `amendment_end` is `null`.
2856
- attr_accessor :proration_behavior
2857
- # Defines how to pause collection for the underlying subscription throughout the duration of the amendment.
2858
- attr_accessor :set_pause_collection
2859
- # Ends the subscription schedule early as dictated by either the accompanying amendment's start or end.
2860
- attr_accessor :set_schedule_end
2861
- # Settings related to subscription trials.
2862
- attr_accessor :trial_settings
2863
-
2864
- def initialize(
2865
- amendment_end: nil,
2866
- amendment_start: nil,
2867
- billing_cycle_anchor: nil,
2868
- discount_actions: nil,
2869
- item_actions: nil,
2870
- metadata_actions: nil,
2871
- proration_behavior: nil,
2872
- set_pause_collection: nil,
2873
- set_schedule_end: nil,
2874
- trial_settings: nil
2875
- )
2876
- @amendment_end = amendment_end
2877
- @amendment_start = amendment_start
2878
- @billing_cycle_anchor = billing_cycle_anchor
2879
- @discount_actions = discount_actions
2880
- @item_actions = item_actions
2881
- @metadata_actions = metadata_actions
2882
- @proration_behavior = proration_behavior
2883
- @set_pause_collection = set_pause_collection
2884
- @set_schedule_end = set_schedule_end
2885
- @trial_settings = trial_settings
2886
- end
2887
- end
2888
-
2889
2108
  class Phase < Stripe::RequestParams
2890
2109
  class AddInvoiceItem < Stripe::RequestParams
2891
2110
  class Discount < Stripe::RequestParams
2892
- class DiscountEnd < Stripe::RequestParams
2893
- class Duration < Stripe::RequestParams
2894
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
2895
- attr_accessor :interval
2896
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
2897
- attr_accessor :interval_count
2898
-
2899
- def initialize(interval: nil, interval_count: nil)
2900
- @interval = interval
2901
- @interval_count = interval_count
2902
- end
2903
- end
2904
- # Time span for the redeemed discount.
2905
- attr_accessor :duration
2906
- # A precise Unix timestamp for the discount to end. Must be in the future.
2907
- attr_accessor :timestamp
2908
- # The type of calculation made to determine when the discount ends.
2909
- attr_accessor :type
2910
-
2911
- def initialize(duration: nil, timestamp: nil, type: nil)
2912
- @duration = duration
2913
- @timestamp = timestamp
2914
- @type = type
2915
- end
2916
- end
2917
2111
  # ID of the coupon to create a new discount for.
2918
2112
  attr_accessor :coupon
2919
2113
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
2920
2114
  attr_accessor :discount
2921
- # Details to determine how long the discount should be applied for.
2922
- attr_accessor :discount_end
2923
2115
  # ID of the promotion code to create a new discount for.
2924
2116
  attr_accessor :promotion_code
2925
2117
 
2926
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2118
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
2927
2119
  @coupon = coupon
2928
2120
  @discount = discount
2929
- @discount_end = discount_end
2930
2121
  @promotion_code = promotion_code
2931
2122
  end
2932
2123
  end
@@ -3007,44 +2198,16 @@ module Stripe
3007
2198
  end
3008
2199
 
3009
2200
  class Discount < Stripe::RequestParams
3010
- class DiscountEnd < Stripe::RequestParams
3011
- class Duration < Stripe::RequestParams
3012
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3013
- attr_accessor :interval
3014
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3015
- attr_accessor :interval_count
3016
-
3017
- def initialize(interval: nil, interval_count: nil)
3018
- @interval = interval
3019
- @interval_count = interval_count
3020
- end
3021
- end
3022
- # Time span for the redeemed discount.
3023
- attr_accessor :duration
3024
- # A precise Unix timestamp for the discount to end. Must be in the future.
3025
- attr_accessor :timestamp
3026
- # The type of calculation made to determine when the discount ends.
3027
- attr_accessor :type
3028
-
3029
- def initialize(duration: nil, timestamp: nil, type: nil)
3030
- @duration = duration
3031
- @timestamp = timestamp
3032
- @type = type
3033
- end
3034
- end
3035
2201
  # ID of the coupon to create a new discount for.
3036
2202
  attr_accessor :coupon
3037
2203
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
3038
2204
  attr_accessor :discount
3039
- # Details to determine how long the discount should be applied for.
3040
- attr_accessor :discount_end
3041
2205
  # ID of the promotion code to create a new discount for.
3042
2206
  attr_accessor :promotion_code
3043
2207
 
3044
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2208
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3045
2209
  @coupon = coupon
3046
2210
  @discount = discount
3047
- @discount_end = discount_end
3048
2211
  @promotion_code = promotion_code
3049
2212
  end
3050
2213
  end
@@ -3077,44 +2240,16 @@ module Stripe
3077
2240
 
3078
2241
  class Item < Stripe::RequestParams
3079
2242
  class Discount < Stripe::RequestParams
3080
- class DiscountEnd < Stripe::RequestParams
3081
- class Duration < Stripe::RequestParams
3082
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3083
- attr_accessor :interval
3084
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3085
- attr_accessor :interval_count
3086
-
3087
- def initialize(interval: nil, interval_count: nil)
3088
- @interval = interval
3089
- @interval_count = interval_count
3090
- end
3091
- end
3092
- # Time span for the redeemed discount.
3093
- attr_accessor :duration
3094
- # A precise Unix timestamp for the discount to end. Must be in the future.
3095
- attr_accessor :timestamp
3096
- # The type of calculation made to determine when the discount ends.
3097
- attr_accessor :type
3098
-
3099
- def initialize(duration: nil, timestamp: nil, type: nil)
3100
- @duration = duration
3101
- @timestamp = timestamp
3102
- @type = type
3103
- end
3104
- end
3105
2243
  # ID of the coupon to create a new discount for.
3106
2244
  attr_accessor :coupon
3107
2245
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
3108
2246
  attr_accessor :discount
3109
- # Details to determine how long the discount should be applied for.
3110
- attr_accessor :discount_end
3111
2247
  # ID of the promotion code to create a new discount for.
3112
2248
  attr_accessor :promotion_code
3113
2249
 
3114
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2250
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3115
2251
  @coupon = coupon
3116
2252
  @discount = discount
3117
- @discount_end = discount_end
3118
2253
  @promotion_code = promotion_code
3119
2254
  end
3120
2255
  end
@@ -3160,18 +2295,6 @@ module Stripe
3160
2295
  @unit_amount_decimal = unit_amount_decimal
3161
2296
  end
3162
2297
  end
3163
-
3164
- class Trial < Stripe::RequestParams
3165
- # 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.
3166
- attr_accessor :converts_to
3167
- # Determines the type of trial for this item.
3168
- attr_accessor :type
3169
-
3170
- def initialize(converts_to: nil, type: nil)
3171
- @converts_to = converts_to
3172
- @type = type
3173
- end
3174
- end
3175
2298
  # The coupons to redeem into discounts for the subscription item.
3176
2299
  attr_accessor :discounts
3177
2300
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`.
@@ -3186,8 +2309,6 @@ module Stripe
3186
2309
  attr_accessor :quantity
3187
2310
  # 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.
3188
2311
  attr_accessor :tax_rates
3189
- # Options that configure the trial on the subscription item.
3190
- attr_accessor :trial
3191
2312
 
3192
2313
  def initialize(
3193
2314
  discounts: nil,
@@ -3196,8 +2317,7 @@ module Stripe
3196
2317
  price: nil,
3197
2318
  price_data: nil,
3198
2319
  quantity: nil,
3199
- tax_rates: nil,
3200
- trial: nil
2320
+ tax_rates: nil
3201
2321
  )
3202
2322
  @discounts = discounts
3203
2323
  @metadata = metadata
@@ -3206,16 +2326,6 @@ module Stripe
3206
2326
  @price_data = price_data
3207
2327
  @quantity = quantity
3208
2328
  @tax_rates = tax_rates
3209
- @trial = trial
3210
- end
3211
- end
3212
-
3213
- class PauseCollection < Stripe::RequestParams
3214
- # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.
3215
- attr_accessor :behavior
3216
-
3217
- def initialize(behavior: nil)
3218
- @behavior = behavior
3219
2329
  end
3220
2330
  end
3221
2331
 
@@ -3230,23 +2340,6 @@ module Stripe
3230
2340
  @destination = destination
3231
2341
  end
3232
2342
  end
3233
-
3234
- class TrialSettings < Stripe::RequestParams
3235
- class EndBehavior < Stripe::RequestParams
3236
- # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`.
3237
- attr_accessor :prorate_up_front
3238
-
3239
- def initialize(prorate_up_front: nil)
3240
- @prorate_up_front = prorate_up_front
3241
- end
3242
- end
3243
- # Defines how the subscription should behave when a trial ends.
3244
- attr_accessor :end_behavior
3245
-
3246
- def initialize(end_behavior: nil)
3247
- @end_behavior = end_behavior
3248
- end
3249
- end
3250
2343
  # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.
3251
2344
  attr_accessor :add_invoice_items
3252
2345
  # 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).
@@ -3279,8 +2372,6 @@ module Stripe
3279
2372
  attr_accessor :metadata
3280
2373
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
3281
2374
  attr_accessor :on_behalf_of
3282
- # 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).
3283
- attr_accessor :pause_collection
3284
2375
  # Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase.
3285
2376
  attr_accessor :proration_behavior
3286
2377
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
@@ -3289,12 +2380,8 @@ module Stripe
3289
2380
  attr_accessor :transfer_data
3290
2381
  # If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.
3291
2382
  attr_accessor :trial
3292
- # Specify trial behavior when crossing phase boundaries
3293
- attr_accessor :trial_continuation
3294
2383
  # Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`
3295
2384
  attr_accessor :trial_end
3296
- # Settings related to subscription trials.
3297
- attr_accessor :trial_settings
3298
2385
 
3299
2386
  def initialize(
3300
2387
  add_invoice_items: nil,
@@ -3313,14 +2400,11 @@ module Stripe
3313
2400
  iterations: nil,
3314
2401
  metadata: nil,
3315
2402
  on_behalf_of: nil,
3316
- pause_collection: nil,
3317
2403
  proration_behavior: nil,
3318
2404
  start_date: nil,
3319
2405
  transfer_data: nil,
3320
2406
  trial: nil,
3321
- trial_continuation: nil,
3322
- trial_end: nil,
3323
- trial_settings: nil
2407
+ trial_end: nil
3324
2408
  )
3325
2409
  @add_invoice_items = add_invoice_items
3326
2410
  @application_fee_percent = application_fee_percent
@@ -3338,91 +2422,23 @@ module Stripe
3338
2422
  @iterations = iterations
3339
2423
  @metadata = metadata
3340
2424
  @on_behalf_of = on_behalf_of
3341
- @pause_collection = pause_collection
3342
2425
  @proration_behavior = proration_behavior
3343
2426
  @start_date = start_date
3344
2427
  @transfer_data = transfer_data
3345
2428
  @trial = trial
3346
- @trial_continuation = trial_continuation
3347
2429
  @trial_end = trial_end
3348
- @trial_settings = trial_settings
3349
- end
3350
- end
3351
-
3352
- class Prebilling < Stripe::RequestParams
3353
- class BillUntil < Stripe::RequestParams
3354
- class AmendmentEnd < Stripe::RequestParams
3355
- # The position of the amendment in the `amendments` array at which prebilling should end. Indexes start from 0 and must be less than the total number of supplied amendments.
3356
- attr_accessor :index
3357
-
3358
- def initialize(index: nil)
3359
- @index = index
3360
- end
3361
- end
3362
-
3363
- class Duration < Stripe::RequestParams
3364
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3365
- attr_accessor :interval
3366
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3367
- attr_accessor :interval_count
3368
-
3369
- def initialize(interval: nil, interval_count: nil)
3370
- @interval = interval
3371
- @interval_count = interval_count
3372
- end
3373
- end
3374
- # End the prebilled period when a specified amendment ends.
3375
- attr_accessor :amendment_end
3376
- # Time span for prebilling, starting from `bill_from`.
3377
- attr_accessor :duration
3378
- # End the prebilled period at a precise integer timestamp, starting from the Unix epoch.
3379
- attr_accessor :timestamp
3380
- # Select one of several ways to pass the `bill_until` value.
3381
- attr_accessor :type
3382
-
3383
- def initialize(amendment_end: nil, duration: nil, timestamp: nil, type: nil)
3384
- @amendment_end = amendment_end
3385
- @duration = duration
3386
- @timestamp = timestamp
3387
- @type = type
3388
- end
3389
- end
3390
- # The end of the prebilled time period.
3391
- attr_accessor :bill_until
3392
- # This is used to determine the number of billing cycles to prebill.
3393
- attr_accessor :iterations
3394
-
3395
- def initialize(bill_until: nil, iterations: nil)
3396
- @bill_until = bill_until
3397
- @iterations = iterations
3398
2430
  end
3399
2431
  end
3400
- # Changes to apply to the phases of the subscription schedule, in the order provided.
3401
- attr_accessor :amendments
3402
- # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.
3403
- attr_accessor :billing_behavior
3404
2432
  # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
3405
2433
  attr_accessor :end_behavior
3406
2434
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase.
3407
2435
  attr_accessor :phases
3408
- # Provide any time periods to bill in advance.
3409
- attr_accessor :prebilling
3410
2436
  # In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.
3411
2437
  attr_accessor :proration_behavior
3412
2438
 
3413
- def initialize(
3414
- amendments: nil,
3415
- billing_behavior: nil,
3416
- end_behavior: nil,
3417
- phases: nil,
3418
- prebilling: nil,
3419
- proration_behavior: nil
3420
- )
3421
- @amendments = amendments
3422
- @billing_behavior = billing_behavior
2439
+ def initialize(end_behavior: nil, phases: nil, proration_behavior: nil)
3423
2440
  @end_behavior = end_behavior
3424
2441
  @phases = phases
3425
- @prebilling = prebilling
3426
2442
  @proration_behavior = proration_behavior
3427
2443
  end
3428
2444
  end
@@ -3430,44 +2446,16 @@ module Stripe
3430
2446
  class SubscriptionDetails < Stripe::RequestParams
3431
2447
  class Item < Stripe::RequestParams
3432
2448
  class Discount < Stripe::RequestParams
3433
- class DiscountEnd < Stripe::RequestParams
3434
- class Duration < Stripe::RequestParams
3435
- # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
3436
- attr_accessor :interval
3437
- # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
3438
- attr_accessor :interval_count
3439
-
3440
- def initialize(interval: nil, interval_count: nil)
3441
- @interval = interval
3442
- @interval_count = interval_count
3443
- end
3444
- end
3445
- # Time span for the redeemed discount.
3446
- attr_accessor :duration
3447
- # A precise Unix timestamp for the discount to end. Must be in the future.
3448
- attr_accessor :timestamp
3449
- # The type of calculation made to determine when the discount ends.
3450
- attr_accessor :type
3451
-
3452
- def initialize(duration: nil, timestamp: nil, type: nil)
3453
- @duration = duration
3454
- @timestamp = timestamp
3455
- @type = type
3456
- end
3457
- end
3458
2449
  # ID of the coupon to create a new discount for.
3459
2450
  attr_accessor :coupon
3460
2451
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
3461
2452
  attr_accessor :discount
3462
- # Details to determine how long the discount should be applied for.
3463
- attr_accessor :discount_end
3464
2453
  # ID of the promotion code to create a new discount for.
3465
2454
  attr_accessor :promotion_code
3466
2455
 
3467
- def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
2456
+ def initialize(coupon: nil, discount: nil, promotion_code: nil)
3468
2457
  @coupon = coupon
3469
2458
  @discount = discount
3470
- @discount_end = discount_end
3471
2459
  @promotion_code = promotion_code
3472
2460
  end
3473
2461
  end
@@ -3558,15 +2546,6 @@ module Stripe
3558
2546
  @tax_rates = tax_rates
3559
2547
  end
3560
2548
  end
3561
-
3562
- class Prebilling < Stripe::RequestParams
3563
- # This is used to determine the number of billing cycles to prebill.
3564
- attr_accessor :iterations
3565
-
3566
- def initialize(iterations: nil)
3567
- @iterations = iterations
3568
- end
3569
- end
3570
2549
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
3571
2550
  attr_accessor :billing_cycle_anchor
3572
2551
  # 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.
@@ -3579,8 +2558,6 @@ module Stripe
3579
2558
  attr_accessor :default_tax_rates
3580
2559
  # A list of up to 20 subscription items, each with an attached price.
3581
2560
  attr_accessor :items
3582
- # The pre-billing to apply to the subscription as a preview.
3583
- attr_accessor :prebilling
3584
2561
  # 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`.
3585
2562
  attr_accessor :proration_behavior
3586
2563
  # If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'.
@@ -3599,7 +2576,6 @@ module Stripe
3599
2576
  cancel_now: nil,
3600
2577
  default_tax_rates: nil,
3601
2578
  items: nil,
3602
- prebilling: nil,
3603
2579
  proration_behavior: nil,
3604
2580
  proration_date: nil,
3605
2581
  resume_at: nil,
@@ -3612,7 +2588,6 @@ module Stripe
3612
2588
  @cancel_now = cancel_now
3613
2589
  @default_tax_rates = default_tax_rates
3614
2590
  @items = items
3615
- @prebilling = prebilling
3616
2591
  @proration_behavior = proration_behavior
3617
2592
  @proration_date = proration_date
3618
2593
  @resume_at = resume_at
@@ -3626,8 +2601,6 @@ module Stripe
3626
2601
  attr_accessor :currency
3627
2602
  # The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3628
2603
  attr_accessor :customer
3629
- # The identifier of the account whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.
3630
- attr_accessor :customer_account
3631
2604
  # Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3632
2605
  attr_accessor :customer_details
3633
2606
  # The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
@@ -3655,7 +2628,6 @@ module Stripe
3655
2628
  automatic_tax: nil,
3656
2629
  currency: nil,
3657
2630
  customer: nil,
3658
- customer_account: nil,
3659
2631
  customer_details: nil,
3660
2632
  discounts: nil,
3661
2633
  expand: nil,
@@ -3671,7 +2643,6 @@ module Stripe
3671
2643
  @automatic_tax = automatic_tax
3672
2644
  @currency = currency
3673
2645
  @customer = customer
3674
- @customer_account = customer_account
3675
2646
  @customer_details = customer_details
3676
2647
  @discounts = discounts
3677
2648
  @expand = expand
@@ -3697,54 +2668,12 @@ module Stripe
3697
2668
  )
3698
2669
  end
3699
2670
 
3700
- # Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments.
3701
- #
3702
- # For Out of Band Payment, the payment is credited to the invoice immediately, increasing the amount_paid
3703
- # of the invoice and subsequently transitioning the status of the invoice to paid if necessary.
3704
- #
3705
- # For the PaymentIntent, when the PaymentIntent's status changes to succeeded, the payment is credited
3706
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3707
- # invoice's status becomes paid.
3708
- #
3709
- # If the PaymentIntent's status is already succeeded when it's attached, it's
3710
- # credited to the invoice immediately.
3711
- #
3712
- # See: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) to learn more.
3713
- def attach_payment(invoice, params = {}, opts = {})
3714
- request(
3715
- method: :post,
3716
- path: format("/v1/invoices/%<invoice>s/attach_payment", { invoice: CGI.escape(invoice) }),
3717
- params: params,
3718
- opts: opts,
3719
- base_address: :api
3720
- )
3721
- end
3722
-
3723
- # Attaches a PaymentIntent to the invoice, adding it to the list of payments.
3724
- # When the PaymentIntent's status changes to succeeded, the payment is credited
3725
- # to the invoice, increasing its amount_paid. When the invoice is fully paid, the
3726
- # invoice's status becomes paid.
3727
- #
3728
- # If the PaymentIntent's status is already succeeded when it is attached, it is
3729
- # credited to the invoice immediately.
3730
- #
3731
- # Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
3732
- def attach_payment_intent(invoice, params = {}, opts = {})
3733
- request(
3734
- method: :post,
3735
- path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
3736
- params: params,
3737
- opts: opts,
3738
- base_address: :api
3739
- )
3740
- end
3741
-
3742
2671
  # This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
3743
2672
  def create(params = {}, opts = {})
3744
2673
  request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api)
3745
2674
  end
3746
2675
 
3747
- # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
2676
+ # At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
3748
2677
  #
3749
2678
  # Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
3750
2679
  #