stripe 15.0.0 → 15.3.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 (320) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -0
  3. data/CHANGELOG.md +129 -44
  4. data/CONTRIBUTING.md +25 -0
  5. data/Gemfile +1 -1
  6. data/OPENAPI_VERSION +1 -1
  7. data/README.md +28 -55
  8. data/VERSION +1 -1
  9. data/lib/stripe/api_operations/nested_resource.rb +35 -35
  10. data/lib/stripe/api_requestor.rb +1 -1
  11. data/lib/stripe/api_version.rb +2 -1
  12. data/lib/stripe/connection_manager.rb +1 -3
  13. data/lib/stripe/event_types.rb +1 -0
  14. data/lib/stripe/events/v1_billing_meter_error_report_triggered_event.rb +1 -1
  15. data/lib/stripe/events/v1_billing_meter_no_meter_found_event.rb +1 -1
  16. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +21 -0
  17. data/lib/stripe/oauth.rb +1 -1
  18. data/lib/stripe/resources/account.rb +198 -28
  19. data/lib/stripe/resources/account_session.rb +176 -72
  20. data/lib/stripe/resources/apple_pay_domain.rb +1 -2
  21. data/lib/stripe/resources/balance.rb +42 -0
  22. data/lib/stripe/resources/balance_transaction.rb +2 -0
  23. data/lib/stripe/resources/bank_account.rb +2 -2
  24. data/lib/stripe/resources/billing_portal/session.rb +3 -3
  25. data/lib/stripe/resources/capability.rb +1 -1
  26. data/lib/stripe/resources/charge.rb +43 -20
  27. data/lib/stripe/resources/checkout/session.rb +120 -19
  28. data/lib/stripe/resources/confirmation_token.rb +119 -100
  29. data/lib/stripe/resources/country_spec.rb +1 -1
  30. data/lib/stripe/resources/coupon.rb +2 -3
  31. data/lib/stripe/resources/credit_note.rb +21 -18
  32. data/lib/stripe/resources/customer.rb +4 -6
  33. data/lib/stripe/resources/customer_session.rb +5 -5
  34. data/lib/stripe/resources/dispute.rb +2 -2
  35. data/lib/stripe/resources/event.rb +3 -1
  36. data/lib/stripe/resources/file.rb +1 -1
  37. data/lib/stripe/resources/funding_instructions.rb +1 -1
  38. data/lib/stripe/resources/identity/verification_report.rb +6 -0
  39. data/lib/stripe/resources/identity/verification_session.rb +51 -11
  40. data/lib/stripe/resources/invoice.rb +146 -32
  41. data/lib/stripe/resources/invoice_item.rb +3 -7
  42. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  43. data/lib/stripe/resources/invoice_payment.rb +9 -2
  44. data/lib/stripe/resources/issuing/authorization.rb +8 -8
  45. data/lib/stripe/resources/issuing/card.rb +1 -1
  46. data/lib/stripe/resources/issuing/dispute.rb +3 -3
  47. data/lib/stripe/resources/login_link.rb +2 -1
  48. data/lib/stripe/resources/mandate.rb +3 -0
  49. data/lib/stripe/resources/payment_intent.rb +602 -325
  50. data/lib/stripe/resources/payment_method.rb +76 -117
  51. data/lib/stripe/resources/payment_method_configuration.rb +356 -2
  52. data/lib/stripe/resources/payment_method_domain.rb +15 -2
  53. data/lib/stripe/resources/payout.rb +4 -4
  54. data/lib/stripe/resources/person.rb +27 -3
  55. data/lib/stripe/resources/plan.rb +2 -3
  56. data/lib/stripe/resources/price.rb +1 -1
  57. data/lib/stripe/resources/product.rb +1 -2
  58. data/lib/stripe/resources/quote.rb +28 -3
  59. data/lib/stripe/resources/radar/value_list.rb +1 -2
  60. data/lib/stripe/resources/radar/value_list_item.rb +1 -2
  61. data/lib/stripe/resources/refund.rb +8 -1
  62. data/lib/stripe/resources/reversal.rb +1 -1
  63. data/lib/stripe/resources/review.rb +1 -1
  64. data/lib/stripe/resources/setup_attempt.rb +1 -1
  65. data/lib/stripe/resources/setup_intent.rb +414 -293
  66. data/lib/stripe/resources/source.rb +1 -1
  67. data/lib/stripe/resources/subscription.rb +149 -27
  68. data/lib/stripe/resources/subscription_item.rb +33 -0
  69. data/lib/stripe/resources/subscription_schedule.rb +141 -4
  70. data/lib/stripe/resources/tax/calculation.rb +6 -2
  71. data/lib/stripe/resources/tax/calculation_line_item.rb +2 -0
  72. data/lib/stripe/resources/tax/registration.rb +261 -1
  73. data/lib/stripe/resources/tax/transaction.rb +1 -1
  74. data/lib/stripe/resources/tax_id.rb +3 -4
  75. data/lib/stripe/resources/tax_rate.rb +2 -2
  76. data/lib/stripe/resources/terminal/configuration.rb +2 -2
  77. data/lib/stripe/resources/terminal/location.rb +2 -3
  78. data/lib/stripe/resources/terminal/reader.rb +426 -6
  79. data/lib/stripe/resources/test_helpers/test_clock.rb +1 -2
  80. data/lib/stripe/resources/token.rb +63 -2
  81. data/lib/stripe/resources/transfer.rb +1 -1
  82. data/lib/stripe/resources/treasury/financial_account.rb +5 -1
  83. data/lib/stripe/resources/v2/billing/meter_event.rb +2 -2
  84. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +2 -2
  85. data/lib/stripe/resources/v2/billing/meter_event_session.rb +2 -2
  86. data/lib/stripe/resources/v2/event.rb +2 -2
  87. data/lib/stripe/resources/v2/event_destination.rb +2 -2
  88. data/lib/stripe/resources/webhook_endpoint.rb +1 -2
  89. data/lib/stripe/resources.rb +1 -0
  90. data/lib/stripe/services/account_external_account_service.rb +3 -4
  91. data/lib/stripe/services/account_login_link_service.rb +1 -1
  92. data/lib/stripe/services/account_person_service.rb +85 -2
  93. data/lib/stripe/services/account_service.rb +169 -20
  94. data/lib/stripe/services/account_session_service.rb +115 -47
  95. data/lib/stripe/services/apple_pay_domain_service.rb +1 -2
  96. data/lib/stripe/services/application_fee_service.rb +1 -1
  97. data/lib/stripe/services/apps_service.rb +1 -1
  98. data/lib/stripe/services/balance_service.rb +1 -1
  99. data/lib/stripe/services/billing/meter_service.rb +1 -1
  100. data/lib/stripe/services/billing_portal/session_service.rb +1 -1
  101. data/lib/stripe/services/billing_portal_service.rb +1 -1
  102. data/lib/stripe/services/billing_service.rb +1 -1
  103. data/lib/stripe/services/charge_service.rb +4 -4
  104. data/lib/stripe/services/checkout/session_service.rb +94 -15
  105. data/lib/stripe/services/checkout_service.rb +1 -1
  106. data/lib/stripe/services/climate_service.rb +1 -1
  107. data/lib/stripe/services/coupon_service.rb +1 -2
  108. data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
  109. data/lib/stripe/services/credit_note_service.rb +14 -15
  110. data/lib/stripe/services/customer_balance_transaction_service.rb +3 -3
  111. data/lib/stripe/services/customer_cash_balance_transaction_service.rb +2 -2
  112. data/lib/stripe/services/customer_payment_method_service.rb +1 -1
  113. data/lib/stripe/services/customer_payment_source_service.rb +1 -1
  114. data/lib/stripe/services/customer_service.rb +5 -7
  115. data/lib/stripe/services/customer_session_service.rb +1 -1
  116. data/lib/stripe/services/customer_tax_id_service.rb +2 -3
  117. data/lib/stripe/services/dispute_service.rb +1 -1
  118. data/lib/stripe/services/entitlements_service.rb +1 -1
  119. data/lib/stripe/services/file_service.rb +1 -1
  120. data/lib/stripe/services/financial_connections/account_service.rb +1 -1
  121. data/lib/stripe/services/financial_connections_service.rb +1 -1
  122. data/lib/stripe/services/forwarding_service.rb +1 -1
  123. data/lib/stripe/services/identity/verification_session_service.rb +21 -5
  124. data/lib/stripe/services/identity_service.rb +1 -1
  125. data/lib/stripe/services/invoice_item_service.rb +1 -2
  126. data/lib/stripe/services/invoice_service.rb +122 -28
  127. data/lib/stripe/services/issuing/authorization_service.rb +4 -4
  128. data/lib/stripe/services/issuing/card_service.rb +1 -1
  129. data/lib/stripe/services/issuing/dispute_service.rb +2 -2
  130. data/lib/stripe/services/issuing_service.rb +1 -1
  131. data/lib/stripe/services/payment_intent_service.rb +563 -313
  132. data/lib/stripe/services/payment_link_service.rb +1 -1
  133. data/lib/stripe/services/payment_method_configuration_service.rb +254 -2
  134. data/lib/stripe/services/payment_method_domain_service.rb +1 -1
  135. data/lib/stripe/services/payment_method_service.rb +59 -105
  136. data/lib/stripe/services/payout_service.rb +2 -2
  137. data/lib/stripe/services/plan_service.rb +2 -3
  138. data/lib/stripe/services/price_service.rb +2 -2
  139. data/lib/stripe/services/product_feature_service.rb +1 -2
  140. data/lib/stripe/services/product_service.rb +3 -4
  141. data/lib/stripe/services/promotion_code_service.rb +1 -1
  142. data/lib/stripe/services/quote_service.rb +21 -4
  143. data/lib/stripe/services/radar/early_fraud_warning_service.rb +1 -1
  144. data/lib/stripe/services/radar/value_list_item_service.rb +1 -2
  145. data/lib/stripe/services/radar/value_list_service.rb +1 -2
  146. data/lib/stripe/services/radar_service.rb +1 -1
  147. data/lib/stripe/services/reporting_service.rb +1 -1
  148. data/lib/stripe/services/setup_intent_service.rb +403 -291
  149. data/lib/stripe/services/sigma_service.rb +1 -1
  150. data/lib/stripe/services/source_service.rb +2 -2
  151. data/lib/stripe/services/subscription_item_service.rb +26 -0
  152. data/lib/stripe/services/subscription_schedule_service.rb +106 -3
  153. data/lib/stripe/services/subscription_service.rb +121 -26
  154. data/lib/stripe/services/tax/calculation_service.rb +6 -2
  155. data/lib/stripe/services/tax/registration_service.rb +170 -1
  156. data/lib/stripe/services/tax/transaction_service.rb +1 -1
  157. data/lib/stripe/services/tax_id_service.rb +2 -3
  158. data/lib/stripe/services/tax_service.rb +1 -1
  159. data/lib/stripe/services/terminal/configuration_service.rb +1 -2
  160. data/lib/stripe/services/terminal/location_service.rb +2 -3
  161. data/lib/stripe/services/terminal/reader_service.rb +196 -2
  162. data/lib/stripe/services/terminal_service.rb +1 -1
  163. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +90 -91
  164. data/lib/stripe/services/test_helpers/issuing_service.rb +1 -1
  165. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  166. data/lib/stripe/services/test_helpers/terminal_service.rb +1 -1
  167. data/lib/stripe/services/test_helpers/test_clock_service.rb +1 -2
  168. data/lib/stripe/services/test_helpers/treasury_service.rb +1 -1
  169. data/lib/stripe/services/test_helpers_service.rb +1 -1
  170. data/lib/stripe/services/token_service.rb +62 -1
  171. data/lib/stripe/services/transfer_service.rb +2 -2
  172. data/lib/stripe/services/treasury/financial_account_service.rb +6 -2
  173. data/lib/stripe/services/treasury_service.rb +1 -1
  174. data/lib/stripe/services/v1_services.rb +1 -1
  175. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -2
  176. data/lib/stripe/services/v2/billing_service.rb +3 -3
  177. data/lib/stripe/services/v2/core/event_destination_service.rb +17 -23
  178. data/lib/stripe/services/v2/core/event_service.rb +1 -2
  179. data/lib/stripe/services/v2/core_service.rb +1 -1
  180. data/lib/stripe/services/v2_services.rb +1 -1
  181. data/lib/stripe/services/webhook_endpoint_service.rb +1 -2
  182. data/lib/stripe/version.rb +1 -1
  183. data/lib/stripe/webhook.rb +1 -1
  184. data/rbi/stripe/resources/account.rbi +190 -35
  185. data/rbi/stripe/resources/account_session.rbi +196 -77
  186. data/rbi/stripe/resources/apple_pay_domain.rbi +1 -3
  187. data/rbi/stripe/resources/balance.rbi +55 -0
  188. data/rbi/stripe/resources/balance_transaction.rbi +3 -0
  189. data/rbi/stripe/resources/bank_account.rbi +2 -2
  190. data/rbi/stripe/resources/billing/alert.rbi +2 -2
  191. data/rbi/stripe/resources/billing_portal/session.rbi +3 -3
  192. data/rbi/stripe/resources/capability.rbi +1 -1
  193. data/rbi/stripe/resources/charge.rbi +52 -20
  194. data/rbi/stripe/resources/checkout/session.rbi +133 -24
  195. data/rbi/stripe/resources/confirmation_token.rbi +140 -115
  196. data/rbi/stripe/resources/country_spec.rbi +1 -1
  197. data/rbi/stripe/resources/coupon.rbi +2 -4
  198. data/rbi/stripe/resources/credit_note.rbi +23 -18
  199. data/rbi/stripe/resources/customer.rbi +4 -8
  200. data/rbi/stripe/resources/customer_session.rbi +5 -5
  201. data/rbi/stripe/resources/dispute.rbi +2 -2
  202. data/rbi/stripe/resources/event.rbi +4 -1
  203. data/rbi/stripe/resources/file.rbi +1 -1
  204. data/rbi/stripe/resources/identity/verification_report.rbi +9 -0
  205. data/rbi/stripe/resources/identity/verification_session.rbi +59 -12
  206. data/rbi/stripe/resources/invoice.rbi +149 -40
  207. data/rbi/stripe/resources/invoice_item.rbi +3 -8
  208. data/rbi/stripe/resources/invoice_line_item.rbi +2 -2
  209. data/rbi/stripe/resources/invoice_payment.rbi +9 -2
  210. data/rbi/stripe/resources/issuing/authorization.rbi +8 -8
  211. data/rbi/stripe/resources/issuing/card.rbi +1 -1
  212. data/rbi/stripe/resources/issuing/dispute.rbi +3 -3
  213. data/rbi/stripe/resources/login_link.rbi +2 -1
  214. data/rbi/stripe/resources/mandate.rbi +4 -0
  215. data/rbi/stripe/resources/payment_intent.rbi +637 -381
  216. data/rbi/stripe/resources/payment_method.rbi +81 -133
  217. data/rbi/stripe/resources/payment_method_configuration.rbi +400 -4
  218. data/rbi/stripe/resources/payment_method_domain.rbi +18 -2
  219. data/rbi/stripe/resources/payout.rbi +4 -4
  220. data/rbi/stripe/resources/person.rbi +33 -3
  221. data/rbi/stripe/resources/plan.rbi +2 -4
  222. data/rbi/stripe/resources/price.rbi +1 -1
  223. data/rbi/stripe/resources/product.rbi +1 -3
  224. data/rbi/stripe/resources/quote.rbi +25 -3
  225. data/rbi/stripe/resources/radar/value_list.rbi +1 -3
  226. data/rbi/stripe/resources/radar/value_list_item.rbi +1 -3
  227. data/rbi/stripe/resources/refund.rbi +8 -1
  228. data/rbi/stripe/resources/reversal.rbi +1 -1
  229. data/rbi/stripe/resources/review.rbi +1 -1
  230. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  231. data/rbi/stripe/resources/setup_intent.rbi +464 -346
  232. data/rbi/stripe/resources/source.rbi +1 -1
  233. data/rbi/stripe/resources/subscription.rbi +150 -34
  234. data/rbi/stripe/resources/subscription_item.rbi +36 -2
  235. data/rbi/stripe/resources/subscription_schedule.rbi +161 -11
  236. data/rbi/stripe/resources/tax/calculation.rbi +7 -3
  237. data/rbi/stripe/resources/tax/calculation_line_item.rbi +4 -1
  238. data/rbi/stripe/resources/tax/registration.rbi +249 -2
  239. data/rbi/stripe/resources/tax/transaction.rbi +1 -1
  240. data/rbi/stripe/resources/tax_id.rbi +3 -5
  241. data/rbi/stripe/resources/tax_rate.rbi +2 -2
  242. data/rbi/stripe/resources/terminal/configuration.rbi +2 -3
  243. data/rbi/stripe/resources/terminal/location.rbi +4 -6
  244. data/rbi/stripe/resources/terminal/reader.rbi +415 -8
  245. data/rbi/stripe/resources/test_helpers/test_clock.rbi +1 -3
  246. data/rbi/stripe/resources/token.rbi +70 -4
  247. data/rbi/stripe/resources/transfer.rbi +1 -1
  248. data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
  249. data/rbi/stripe/resources/v2/billing/meter_event.rbi +3 -3
  250. data/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi +3 -3
  251. data/rbi/stripe/resources/v2/billing/meter_event_session.rbi +3 -3
  252. data/rbi/stripe/resources/v2/event.rbi +3 -3
  253. data/rbi/stripe/resources/v2/event_destination.rbi +3 -3
  254. data/rbi/stripe/resources/webhook_endpoint.rbi +1 -3
  255. data/rbi/stripe/services/account_external_account_service.rbi +3 -5
  256. data/rbi/stripe/services/account_login_link_service.rbi +1 -1
  257. data/rbi/stripe/services/account_person_service.rbi +93 -5
  258. data/rbi/stripe/services/account_service.rbi +166 -28
  259. data/rbi/stripe/services/account_session_service.rbi +126 -52
  260. data/rbi/stripe/services/apple_pay_domain_service.rbi +1 -3
  261. data/rbi/stripe/services/balance_service.rbi +1 -1
  262. data/rbi/stripe/services/billing/alert_service.rbi +2 -2
  263. data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
  264. data/rbi/stripe/services/charge_service.rbi +4 -4
  265. data/rbi/stripe/services/checkout/session_service.rbi +104 -19
  266. data/rbi/stripe/services/coupon_service.rbi +1 -3
  267. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
  268. data/rbi/stripe/services/credit_note_service.rbi +13 -14
  269. data/rbi/stripe/services/customer_balance_transaction_service.rbi +3 -3
  270. data/rbi/stripe/services/customer_cash_balance_transaction_service.rbi +2 -2
  271. data/rbi/stripe/services/customer_payment_method_service.rbi +1 -1
  272. data/rbi/stripe/services/customer_payment_source_service.rbi +1 -1
  273. data/rbi/stripe/services/customer_service.rbi +4 -8
  274. data/rbi/stripe/services/customer_session_service.rbi +1 -1
  275. data/rbi/stripe/services/customer_tax_id_service.rbi +2 -4
  276. data/rbi/stripe/services/dispute_service.rbi +1 -1
  277. data/rbi/stripe/services/file_service.rbi +1 -1
  278. data/rbi/stripe/services/identity/verification_session_service.rbi +22 -6
  279. data/rbi/stripe/services/invoice_item_service.rbi +1 -3
  280. data/rbi/stripe/services/invoice_service.rbi +126 -35
  281. data/rbi/stripe/services/issuing/authorization_service.rbi +4 -4
  282. data/rbi/stripe/services/issuing/card_service.rbi +1 -1
  283. data/rbi/stripe/services/issuing/dispute_service.rbi +2 -2
  284. data/rbi/stripe/services/payment_intent_service.rbi +599 -369
  285. data/rbi/stripe/services/payment_method_configuration_service.rbi +280 -4
  286. data/rbi/stripe/services/payment_method_domain_service.rbi +1 -1
  287. data/rbi/stripe/services/payment_method_service.rbi +62 -121
  288. data/rbi/stripe/services/payout_service.rbi +2 -2
  289. data/rbi/stripe/services/plan_service.rbi +2 -4
  290. data/rbi/stripe/services/price_service.rbi +2 -2
  291. data/rbi/stripe/services/product_feature_service.rbi +1 -3
  292. data/rbi/stripe/services/product_service.rbi +2 -4
  293. data/rbi/stripe/services/promotion_code_service.rbi +1 -1
  294. data/rbi/stripe/services/quote_service.rbi +16 -3
  295. data/rbi/stripe/services/radar/early_fraud_warning_service.rbi +1 -1
  296. data/rbi/stripe/services/radar/value_list_item_service.rbi +1 -3
  297. data/rbi/stripe/services/radar/value_list_service.rbi +1 -3
  298. data/rbi/stripe/services/setup_intent_service.rbi +457 -344
  299. data/rbi/stripe/services/source_service.rbi +1 -1
  300. data/rbi/stripe/services/subscription_item_service.rbi +28 -2
  301. data/rbi/stripe/services/subscription_schedule_service.rbi +119 -10
  302. data/rbi/stripe/services/subscription_service.rbi +121 -33
  303. data/rbi/stripe/services/tax/calculation_service.rbi +6 -2
  304. data/rbi/stripe/services/tax/registration_service.rbi +171 -2
  305. data/rbi/stripe/services/tax_id_service.rbi +2 -4
  306. data/rbi/stripe/services/terminal/configuration_service.rbi +1 -3
  307. data/rbi/stripe/services/terminal/location_service.rbi +4 -6
  308. data/rbi/stripe/services/terminal/reader_service.rbi +200 -4
  309. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +106 -106
  310. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +31 -0
  311. data/rbi/stripe/services/test_helpers/test_clock_service.rbi +1 -3
  312. data/rbi/stripe/services/token_service.rbi +71 -3
  313. data/rbi/stripe/services/transfer_service.rbi +1 -1
  314. data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
  315. data/rbi/stripe/services/v2/billing/meter_event_session_service.rbi +1 -3
  316. data/rbi/stripe/services/v2/billing_service.rbi +1 -1
  317. data/rbi/stripe/services/v2/core/event_destination_service.rbi +14 -22
  318. data/rbi/stripe/services/v2/core/event_service.rbi +1 -3
  319. data/rbi/stripe/services/webhook_endpoint_service.rbi +1 -3
  320. metadata +5 -2
@@ -15,6 +15,13 @@ module Stripe
15
15
  "subscription_schedule"
16
16
  end
17
17
 
18
+ class BillingMode < Stripe::StripeObject
19
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
20
+ attr_reader :type
21
+ # Details on when the current billing_mode was adopted.
22
+ attr_reader :updated_at
23
+ end
24
+
18
25
  class CurrentPhase < Stripe::StripeObject
19
26
  # The end of this phase of the subscription schedule.
20
27
  attr_reader :end_date
@@ -38,6 +45,13 @@ module Stripe
38
45
  attr_reader :liability
39
46
  end
40
47
 
48
+ class BillingThresholds < Stripe::StripeObject
49
+ # Monetary threshold that triggers the subscription to create an invoice
50
+ attr_reader :amount_gte
51
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
52
+ attr_reader :reset_billing_cycle_anchor
53
+ end
54
+
41
55
  class InvoiceSettings < Stripe::StripeObject
42
56
  class Issuer < Stripe::StripeObject
43
57
  # The connected account being referenced when `type` is `account`.
@@ -65,6 +79,8 @@ module Stripe
65
79
  attr_reader :automatic_tax
66
80
  # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
67
81
  attr_reader :billing_cycle_anchor
82
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
83
+ attr_reader :billing_thresholds
68
84
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
69
85
  attr_reader :collection_method
70
86
  # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
@@ -114,6 +130,13 @@ module Stripe
114
130
  attr_reader :liability
115
131
  end
116
132
 
133
+ class BillingThresholds < Stripe::StripeObject
134
+ # Monetary threshold that triggers the subscription to create an invoice
135
+ attr_reader :amount_gte
136
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`.
137
+ attr_reader :reset_billing_cycle_anchor
138
+ end
139
+
117
140
  class Discount < Stripe::StripeObject
118
141
  # ID of the coupon to create a new discount for.
119
142
  attr_reader :coupon
@@ -139,6 +162,11 @@ module Stripe
139
162
  end
140
163
 
141
164
  class Item < Stripe::StripeObject
165
+ class BillingThresholds < Stripe::StripeObject
166
+ # Usage threshold that triggers the subscription to create an invoice
167
+ attr_reader :usage_gte
168
+ end
169
+
142
170
  class Discount < Stripe::StripeObject
143
171
  # ID of the coupon to create a new discount for.
144
172
  attr_reader :coupon
@@ -147,6 +175,8 @@ module Stripe
147
175
  # ID of the promotion code to create a new discount for.
148
176
  attr_reader :promotion_code
149
177
  end
178
+ # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
179
+ attr_reader :billing_thresholds
150
180
  # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount.
151
181
  attr_reader :discounts
152
182
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered.
@@ -175,6 +205,8 @@ module Stripe
175
205
  attr_reader :automatic_tax
176
206
  # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
177
207
  attr_reader :billing_cycle_anchor
208
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
209
+ attr_reader :billing_thresholds
178
210
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`.
179
211
  attr_reader :collection_method
180
212
  # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -197,7 +229,7 @@ module Stripe
197
229
  attr_reader :metadata
198
230
  # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details.
199
231
  attr_reader :on_behalf_of
200
- # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
232
+ # When transitioning phases, controls how prorations are handled (if any). Possible values are `create_prorations`, `none`, and `always_invoice`.
201
233
  attr_reader :proration_behavior
202
234
  # The start of this phase of the subscription schedule.
203
235
  attr_reader :start_date
@@ -326,6 +358,15 @@ module Stripe
326
358
  end
327
359
 
328
360
  class CreateParams < Stripe::RequestParams
361
+ class BillingMode < Stripe::RequestParams
362
+ # Attribute for param field type
363
+ attr_accessor :type
364
+
365
+ def initialize(type: nil)
366
+ @type = type
367
+ end
368
+ end
369
+
329
370
  class DefaultSettings < Stripe::RequestParams
330
371
  class AutomaticTax < Stripe::RequestParams
331
372
  class Liability < Stripe::RequestParams
@@ -350,6 +391,18 @@ module Stripe
350
391
  end
351
392
  end
352
393
 
394
+ class BillingThresholds < Stripe::RequestParams
395
+ # Monetary threshold that triggers the subscription to advance to a new billing period
396
+ attr_accessor :amount_gte
397
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
398
+ attr_accessor :reset_billing_cycle_anchor
399
+
400
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
401
+ @amount_gte = amount_gte
402
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
403
+ end
404
+ end
405
+
353
406
  class InvoiceSettings < Stripe::RequestParams
354
407
  class Issuer < Stripe::RequestParams
355
408
  # The connected account being referenced when `type` is `account`.
@@ -393,6 +446,8 @@ module Stripe
393
446
  attr_accessor :automatic_tax
394
447
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
395
448
  attr_accessor :billing_cycle_anchor
449
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
450
+ attr_accessor :billing_thresholds
396
451
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
397
452
  attr_accessor :collection_method
398
453
  # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
@@ -410,6 +465,7 @@ module Stripe
410
465
  application_fee_percent: nil,
411
466
  automatic_tax: nil,
412
467
  billing_cycle_anchor: nil,
468
+ billing_thresholds: nil,
413
469
  collection_method: nil,
414
470
  default_payment_method: nil,
415
471
  description: nil,
@@ -420,6 +476,7 @@ module Stripe
420
476
  @application_fee_percent = application_fee_percent
421
477
  @automatic_tax = automatic_tax
422
478
  @billing_cycle_anchor = billing_cycle_anchor
479
+ @billing_thresholds = billing_thresholds
423
480
  @collection_method = collection_method
424
481
  @default_payment_method = default_payment_method
425
482
  @description = description
@@ -515,6 +572,18 @@ module Stripe
515
572
  end
516
573
  end
517
574
 
575
+ class BillingThresholds < Stripe::RequestParams
576
+ # Monetary threshold that triggers the subscription to advance to a new billing period
577
+ attr_accessor :amount_gte
578
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
579
+ attr_accessor :reset_billing_cycle_anchor
580
+
581
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
582
+ @amount_gte = amount_gte
583
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
584
+ end
585
+ end
586
+
518
587
  class Discount < Stripe::RequestParams
519
588
  # ID of the coupon to create a new discount for.
520
589
  attr_accessor :coupon
@@ -557,6 +626,15 @@ module Stripe
557
626
  end
558
627
 
559
628
  class Item < Stripe::RequestParams
629
+ class BillingThresholds < Stripe::RequestParams
630
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
631
+ attr_accessor :usage_gte
632
+
633
+ def initialize(usage_gte: nil)
634
+ @usage_gte = usage_gte
635
+ end
636
+ end
637
+
560
638
  class Discount < Stripe::RequestParams
561
639
  # ID of the coupon to create a new discount for.
562
640
  attr_accessor :coupon
@@ -613,6 +691,8 @@ module Stripe
613
691
  @unit_amount_decimal = unit_amount_decimal
614
692
  end
615
693
  end
694
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
695
+ attr_accessor :billing_thresholds
616
696
  # The coupons to redeem into discounts for the subscription item.
617
697
  attr_accessor :discounts
618
698
  # 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`.
@@ -629,6 +709,7 @@ module Stripe
629
709
  attr_accessor :tax_rates
630
710
 
631
711
  def initialize(
712
+ billing_thresholds: nil,
632
713
  discounts: nil,
633
714
  metadata: nil,
634
715
  plan: nil,
@@ -637,6 +718,7 @@ module Stripe
637
718
  quantity: nil,
638
719
  tax_rates: nil
639
720
  )
721
+ @billing_thresholds = billing_thresholds
640
722
  @discounts = discounts
641
723
  @metadata = metadata
642
724
  @plan = plan
@@ -666,6 +748,8 @@ module Stripe
666
748
  attr_accessor :automatic_tax
667
749
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
668
750
  attr_accessor :billing_cycle_anchor
751
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
752
+ attr_accessor :billing_thresholds
669
753
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
670
754
  attr_accessor :collection_method
671
755
  # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -690,7 +774,7 @@ module Stripe
690
774
  attr_accessor :metadata
691
775
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
692
776
  attr_accessor :on_behalf_of
693
- # 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.
777
+ # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. 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 (item price, quantity, etc.) of the current phase.
694
778
  attr_accessor :proration_behavior
695
779
  # The data with which to automatically create a Transfer for each of the associated subscription's invoices.
696
780
  attr_accessor :transfer_data
@@ -704,6 +788,7 @@ module Stripe
704
788
  application_fee_percent: nil,
705
789
  automatic_tax: nil,
706
790
  billing_cycle_anchor: nil,
791
+ billing_thresholds: nil,
707
792
  collection_method: nil,
708
793
  currency: nil,
709
794
  default_payment_method: nil,
@@ -725,6 +810,7 @@ module Stripe
725
810
  @application_fee_percent = application_fee_percent
726
811
  @automatic_tax = automatic_tax
727
812
  @billing_cycle_anchor = billing_cycle_anchor
813
+ @billing_thresholds = billing_thresholds
728
814
  @collection_method = collection_method
729
815
  @currency = currency
730
816
  @default_payment_method = default_payment_method
@@ -743,6 +829,8 @@ module Stripe
743
829
  @trial_end = trial_end
744
830
  end
745
831
  end
832
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
833
+ attr_accessor :billing_mode
746
834
  # The identifier of the customer to create the subscription schedule for.
747
835
  attr_accessor :customer
748
836
  # Object representing the subscription schedule's default settings.
@@ -761,6 +849,7 @@ module Stripe
761
849
  attr_accessor :start_date
762
850
 
763
851
  def initialize(
852
+ billing_mode: nil,
764
853
  customer: nil,
765
854
  default_settings: nil,
766
855
  end_behavior: nil,
@@ -770,6 +859,7 @@ module Stripe
770
859
  phases: nil,
771
860
  start_date: nil
772
861
  )
862
+ @billing_mode = billing_mode
773
863
  @customer = customer
774
864
  @default_settings = default_settings
775
865
  @end_behavior = end_behavior
@@ -806,6 +896,18 @@ module Stripe
806
896
  end
807
897
  end
808
898
 
899
+ class BillingThresholds < Stripe::RequestParams
900
+ # Monetary threshold that triggers the subscription to advance to a new billing period
901
+ attr_accessor :amount_gte
902
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
903
+ attr_accessor :reset_billing_cycle_anchor
904
+
905
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
906
+ @amount_gte = amount_gte
907
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
908
+ end
909
+ end
910
+
809
911
  class InvoiceSettings < Stripe::RequestParams
810
912
  class Issuer < Stripe::RequestParams
811
913
  # The connected account being referenced when `type` is `account`.
@@ -849,6 +951,8 @@ module Stripe
849
951
  attr_accessor :automatic_tax
850
952
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
851
953
  attr_accessor :billing_cycle_anchor
954
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
955
+ attr_accessor :billing_thresholds
852
956
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
853
957
  attr_accessor :collection_method
854
958
  # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
@@ -866,6 +970,7 @@ module Stripe
866
970
  application_fee_percent: nil,
867
971
  automatic_tax: nil,
868
972
  billing_cycle_anchor: nil,
973
+ billing_thresholds: nil,
869
974
  collection_method: nil,
870
975
  default_payment_method: nil,
871
976
  description: nil,
@@ -876,6 +981,7 @@ module Stripe
876
981
  @application_fee_percent = application_fee_percent
877
982
  @automatic_tax = automatic_tax
878
983
  @billing_cycle_anchor = billing_cycle_anchor
984
+ @billing_thresholds = billing_thresholds
879
985
  @collection_method = collection_method
880
986
  @default_payment_method = default_payment_method
881
987
  @description = description
@@ -971,6 +1077,18 @@ module Stripe
971
1077
  end
972
1078
  end
973
1079
 
1080
+ class BillingThresholds < Stripe::RequestParams
1081
+ # Monetary threshold that triggers the subscription to advance to a new billing period
1082
+ attr_accessor :amount_gte
1083
+ # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.
1084
+ attr_accessor :reset_billing_cycle_anchor
1085
+
1086
+ def initialize(amount_gte: nil, reset_billing_cycle_anchor: nil)
1087
+ @amount_gte = amount_gte
1088
+ @reset_billing_cycle_anchor = reset_billing_cycle_anchor
1089
+ end
1090
+ end
1091
+
974
1092
  class Discount < Stripe::RequestParams
975
1093
  # ID of the coupon to create a new discount for.
976
1094
  attr_accessor :coupon
@@ -1013,6 +1131,15 @@ module Stripe
1013
1131
  end
1014
1132
 
1015
1133
  class Item < Stripe::RequestParams
1134
+ class BillingThresholds < Stripe::RequestParams
1135
+ # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
1136
+ attr_accessor :usage_gte
1137
+
1138
+ def initialize(usage_gte: nil)
1139
+ @usage_gte = usage_gte
1140
+ end
1141
+ end
1142
+
1016
1143
  class Discount < Stripe::RequestParams
1017
1144
  # ID of the coupon to create a new discount for.
1018
1145
  attr_accessor :coupon
@@ -1069,6 +1196,8 @@ module Stripe
1069
1196
  @unit_amount_decimal = unit_amount_decimal
1070
1197
  end
1071
1198
  end
1199
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1200
+ attr_accessor :billing_thresholds
1072
1201
  # The coupons to redeem into discounts for the subscription item.
1073
1202
  attr_accessor :discounts
1074
1203
  # 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`.
@@ -1085,6 +1214,7 @@ module Stripe
1085
1214
  attr_accessor :tax_rates
1086
1215
 
1087
1216
  def initialize(
1217
+ billing_thresholds: nil,
1088
1218
  discounts: nil,
1089
1219
  metadata: nil,
1090
1220
  plan: nil,
@@ -1093,6 +1223,7 @@ module Stripe
1093
1223
  quantity: nil,
1094
1224
  tax_rates: nil
1095
1225
  )
1226
+ @billing_thresholds = billing_thresholds
1096
1227
  @discounts = discounts
1097
1228
  @metadata = metadata
1098
1229
  @plan = plan
@@ -1122,6 +1253,8 @@ module Stripe
1122
1253
  attr_accessor :automatic_tax
1123
1254
  # Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
1124
1255
  attr_accessor :billing_cycle_anchor
1256
+ # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds.
1257
+ attr_accessor :billing_thresholds
1125
1258
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.
1126
1259
  attr_accessor :collection_method
1127
1260
  # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
@@ -1146,7 +1279,7 @@ module Stripe
1146
1279
  attr_accessor :metadata
1147
1280
  # The account on behalf of which to charge, for each of the associated subscription's invoices.
1148
1281
  attr_accessor :on_behalf_of
1149
- # 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.
1282
+ # Controls whether the subscription schedule should create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. 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 (item price, quantity, etc.) of the current phase.
1150
1283
  attr_accessor :proration_behavior
1151
1284
  # The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase.
1152
1285
  attr_accessor :start_date
@@ -1162,6 +1295,7 @@ module Stripe
1162
1295
  application_fee_percent: nil,
1163
1296
  automatic_tax: nil,
1164
1297
  billing_cycle_anchor: nil,
1298
+ billing_thresholds: nil,
1165
1299
  collection_method: nil,
1166
1300
  currency: nil,
1167
1301
  default_payment_method: nil,
@@ -1184,6 +1318,7 @@ module Stripe
1184
1318
  @application_fee_percent = application_fee_percent
1185
1319
  @automatic_tax = automatic_tax
1186
1320
  @billing_cycle_anchor = billing_cycle_anchor
1321
+ @billing_thresholds = billing_thresholds
1187
1322
  @collection_method = collection_method
1188
1323
  @currency = currency
1189
1324
  @default_payment_method = default_payment_method
@@ -1213,7 +1348,7 @@ module Stripe
1213
1348
  attr_accessor :metadata
1214
1349
  # List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted.
1215
1350
  attr_accessor :phases
1216
- # If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`.
1351
+ # If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`.
1217
1352
  attr_accessor :proration_behavior
1218
1353
 
1219
1354
  def initialize(
@@ -1261,6 +1396,8 @@ module Stripe
1261
1396
  end
1262
1397
  # ID of the Connect Application that created the schedule.
1263
1398
  attr_reader :application
1399
+ # The billing mode of the subscription.
1400
+ attr_reader :billing_mode
1264
1401
  # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
1265
1402
  attr_reader :canceled_at
1266
1403
  # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
@@ -31,7 +31,7 @@ module Stripe
31
31
  end
32
32
 
33
33
  class TaxId < Stripe::StripeObject
34
- # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, or `unknown`
34
+ # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown`
35
35
  attr_reader :type
36
36
  # The value of the tax ID.
37
37
  attr_reader :value
@@ -200,7 +200,7 @@ module Stripe
200
200
  end
201
201
 
202
202
  class TaxId < Stripe::RequestParams
203
- # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
203
+ # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
204
204
  attr_accessor :type
205
205
  # Value of the tax ID.
206
206
  attr_accessor :value
@@ -240,6 +240,8 @@ module Stripe
240
240
  # A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
241
241
  # If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount.
242
242
  attr_accessor :amount
243
+ # 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.
244
+ attr_accessor :metadata
243
245
  # If provided, the product's `tax_code` will be used as the line item's `tax_code`.
244
246
  attr_accessor :product
245
247
  # The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25.
@@ -253,6 +255,7 @@ module Stripe
253
255
 
254
256
  def initialize(
255
257
  amount: nil,
258
+ metadata: nil,
256
259
  product: nil,
257
260
  quantity: nil,
258
261
  reference: nil,
@@ -260,6 +263,7 @@ module Stripe
260
263
  tax_code: nil
261
264
  )
262
265
  @amount = amount
266
+ @metadata = metadata
263
267
  @product = product
264
268
  @quantity = quantity
265
269
  @reference = reference
@@ -50,6 +50,8 @@ module Stripe
50
50
  attr_reader :id
51
51
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
52
52
  attr_reader :livemode
53
+ # 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.
54
+ attr_reader :metadata
53
55
  # String representing the object's type. Objects of the same type share the same value.
54
56
  attr_reader :object
55
57
  # The ID of an existing [Product](https://stripe.com/docs/api/products/object).