stripe 18.4.0.pre.alpha.2 → 18.4.0.pre.alpha.4

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +3 -3
  3. data/lib/stripe/object_types.rb +4 -0
  4. data/lib/stripe/params/invoice_create_preview_params.rb +14 -1
  5. data/lib/stripe/params/subscription_resume_params.rb +5 -1
  6. data/lib/stripe/params/v2/billing/cadences/spend_modifier_rule_list_params.rb +22 -0
  7. data/lib/stripe/params/v2/billing/cadences/spend_modifier_rule_retrieve_params.rb +12 -0
  8. data/lib/stripe/params/v2/billing/intent_create_params.rb +95 -2
  9. data/lib/stripe/params/v2/billing/one_time_item_create_params.rb +48 -0
  10. data/lib/stripe/params/v2/billing/one_time_item_list_params.rb +21 -0
  11. data/lib/stripe/params/v2/billing/one_time_item_retrieve_params.rb +10 -0
  12. data/lib/stripe/params/v2/billing/one_time_item_update_params.rb +48 -0
  13. data/lib/stripe/params/v2/billing/rate_cards/custom_pricing_unit_overage_rate_create_params.rb +33 -0
  14. data/lib/stripe/params/v2/billing/rate_cards/custom_pricing_unit_overage_rate_delete_params.rb +12 -0
  15. data/lib/stripe/params/v2/billing/rate_cards/custom_pricing_unit_overage_rate_list_params.rb +22 -0
  16. data/lib/stripe/params/v2/billing/rate_cards/custom_pricing_unit_overage_rate_retrieve_params.rb +12 -0
  17. data/lib/stripe/params.rb +10 -0
  18. data/lib/stripe/resources/application_fee.rb +2 -0
  19. data/lib/stripe/resources/fr_meal_vouchers_onboarding.rb +13 -3
  20. data/lib/stripe/resources/invoice_item.rb +22 -0
  21. data/lib/stripe/resources/invoice_line_item.rb +22 -0
  22. data/lib/stripe/resources/v2/billing/cadence_spend_modifier.rb +101 -0
  23. data/lib/stripe/resources/v2/billing/intent_action.rb +114 -2
  24. data/lib/stripe/resources/v2/billing/one_time_item.rb +60 -0
  25. data/lib/stripe/resources/v2/billing/rate_card_custom_pricing_unit_overage_rate.rb +48 -0
  26. data/lib/stripe/resources.rb +3 -0
  27. data/lib/stripe/services/fr_meal_vouchers_onboarding_service.rb +10 -3
  28. data/lib/stripe/services/v2/billing/cadence_service.rb +8 -0
  29. data/lib/stripe/services/v2/billing/cadences/spend_modifier_rule_service.rb +34 -0
  30. data/lib/stripe/services/v2/billing/one_time_item_service.rb +54 -0
  31. data/lib/stripe/services/v2/billing/rate_card_service.rb +3 -1
  32. data/lib/stripe/services/v2/billing/rate_cards/custom_pricing_unit_overage_rate_service.rb +56 -0
  33. data/lib/stripe/services/v2/billing_service.rb +2 -1
  34. data/lib/stripe/services.rb +3 -0
  35. data/lib/stripe/util.rb +4 -4
  36. data/lib/stripe/version.rb +1 -1
  37. data/rbi/stripe.rbi +1105 -198
  38. metadata +18 -2
@@ -287,6 +287,25 @@ module Stripe
287
287
  end
288
288
  end
289
289
 
290
+ class RateCardCustomPricingUnitOverageRateDetails < ::Stripe::StripeObject
291
+ # The ID of the custom pricing unit this item is associated with
292
+ attr_reader :custom_pricing_unit
293
+ # The ID of the custom pricing unit overage rate this item is associated with
294
+ attr_reader :custom_pricing_unit_overage_rate
295
+ # The ID of the one-time item this custom pricing unit overage rate is associated with
296
+ attr_reader :one_time_item
297
+ # The ID of the rate card this item is associated with
298
+ attr_reader :rate_card
299
+
300
+ def self.inner_class_types
301
+ @inner_class_types = {}
302
+ end
303
+
304
+ def self.field_remappings
305
+ @field_remappings = {}
306
+ end
307
+ end
308
+
290
309
  class RateCardRateDetails < ::Stripe::StripeObject
291
310
  # The ID of billable item this item is associated with
292
311
  attr_reader :metered_item
@@ -313,12 +332,15 @@ module Stripe
313
332
  attr_reader :type
314
333
  # The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places.
315
334
  attr_reader :unit_amount_decimal
335
+ # Attribute for field rate_card_custom_pricing_unit_overage_rate_details
336
+ attr_reader :rate_card_custom_pricing_unit_overage_rate_details
316
337
 
317
338
  def self.inner_class_types
318
339
  @inner_class_types = {
319
340
  license_fee_details: LicenseFeeDetails,
320
341
  price_details: PriceDetails,
321
342
  rate_card_rate_details: RateCardRateDetails,
343
+ rate_card_custom_pricing_unit_overage_rate_details: RateCardCustomPricingUnitOverageRateDetails,
322
344
  }
323
345
  end
324
346
 
@@ -0,0 +1,101 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ # A Spend Modifier changes how spend is computed when billing for specific cadence.
8
+ class CadenceSpendModifier < APIResource
9
+ OBJECT_NAME = "v2.billing.cadence_spend_modifier"
10
+ def self.object_name
11
+ "v2.billing.cadence_spend_modifier"
12
+ end
13
+
14
+ class MaxBillingPeriodSpend < ::Stripe::StripeObject
15
+ class Amount < ::Stripe::StripeObject
16
+ class CustomPricingUnit < ::Stripe::StripeObject
17
+ # The decimal value of custom pricing units, represented as a string.
18
+ attr_reader :value
19
+
20
+ def self.inner_class_types
21
+ @inner_class_types = {}
22
+ end
23
+
24
+ def self.field_remappings
25
+ @field_remappings = {}
26
+ end
27
+ end
28
+ # The custom pricing unit amount. Present if type is `custom_pricing_unit`.
29
+ attr_reader :custom_pricing_unit
30
+ # The type of the spend modifier amount.
31
+ attr_reader :type
32
+
33
+ def self.inner_class_types
34
+ @inner_class_types = { custom_pricing_unit: CustomPricingUnit }
35
+ end
36
+
37
+ def self.field_remappings
38
+ @field_remappings = {}
39
+ end
40
+ end
41
+
42
+ class CustomPricingUnitOverageRate < ::Stripe::StripeObject
43
+ # ID of the custom pricing unit overage rate.
44
+ attr_reader :id
45
+
46
+ def self.inner_class_types
47
+ @inner_class_types = {}
48
+ end
49
+
50
+ def self.field_remappings
51
+ @field_remappings = {}
52
+ end
53
+ end
54
+ # The billing alert associated with the maximum spend threshold.
55
+ attr_reader :alert
56
+ # The maximum amount of invoice spend.
57
+ attr_reader :amount
58
+ # The configuration for the overage rate for the custom pricing unit.
59
+ attr_reader :custom_pricing_unit_overage_rate
60
+ # The timestamp from which this spend modifier is effective.
61
+ attr_reader :effective_from
62
+ # The timestamp until which this spend modifier is effective. If not set, the modifier is effective indefinitely.
63
+ attr_reader :effective_until
64
+
65
+ def self.inner_class_types
66
+ @inner_class_types = {
67
+ amount: Amount,
68
+ custom_pricing_unit_overage_rate: CustomPricingUnitOverageRate,
69
+ }
70
+ end
71
+
72
+ def self.field_remappings
73
+ @field_remappings = {}
74
+ end
75
+ end
76
+ # The ID of the Billing Cadence this spend modifier is associated with.
77
+ attr_reader :billing_cadence
78
+ # Timestamp of when the object was created.
79
+ attr_reader :created
80
+ # Unique identifier for the object.
81
+ attr_reader :id
82
+ # String representing the object's type. Objects of the same type share the same value of the object field.
83
+ attr_reader :object
84
+ # The type of the spend modifier.
85
+ attr_reader :type
86
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
87
+ attr_reader :livemode
88
+ # Max invoice spend details. Present if type is `max_billing_period_spend`.
89
+ attr_reader :max_billing_period_spend
90
+
91
+ def self.inner_class_types
92
+ @inner_class_types = { max_billing_period_spend: MaxBillingPeriodSpend }
93
+ end
94
+
95
+ def self.field_remappings
96
+ @field_remappings = {}
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
@@ -11,6 +11,19 @@ module Stripe
11
11
  end
12
12
 
13
13
  class Apply < ::Stripe::StripeObject
14
+ class EffectiveAt < ::Stripe::StripeObject
15
+ # When the apply action will take effect.
16
+ attr_reader :type
17
+
18
+ def self.inner_class_types
19
+ @inner_class_types = {}
20
+ end
21
+
22
+ def self.field_remappings
23
+ @field_remappings = {}
24
+ end
25
+ end
26
+
14
27
  class InvoiceDiscountRule < ::Stripe::StripeObject
15
28
  class PercentOff < ::Stripe::StripeObject
16
29
  class MaximumApplications < ::Stripe::StripeObject
@@ -55,13 +68,96 @@ module Stripe
55
68
  @field_remappings = {}
56
69
  end
57
70
  end
71
+
72
+ class SpendModifierRule < ::Stripe::StripeObject
73
+ class MaxBillingPeriodSpend < ::Stripe::StripeObject
74
+ class Amount < ::Stripe::StripeObject
75
+ class CustomPricingUnit < ::Stripe::StripeObject
76
+ # The value of the custom pricing unit.
77
+ attr_reader :value
78
+
79
+ def self.inner_class_types
80
+ @inner_class_types = {}
81
+ end
82
+
83
+ def self.field_remappings
84
+ @field_remappings = {}
85
+ end
86
+ end
87
+ # The type of the amount.
88
+ attr_reader :type
89
+ # The custom pricing unit amount.
90
+ attr_reader :custom_pricing_unit
91
+
92
+ def self.inner_class_types
93
+ @inner_class_types = { custom_pricing_unit: CustomPricingUnit }
94
+ end
95
+
96
+ def self.field_remappings
97
+ @field_remappings = {}
98
+ end
99
+ end
100
+
101
+ class CustomPricingUnitOverageRate < ::Stripe::StripeObject
102
+ # ID of the custom pricing unit overage rate.
103
+ attr_reader :id
104
+
105
+ def self.inner_class_types
106
+ @inner_class_types = {}
107
+ end
108
+
109
+ def self.field_remappings
110
+ @field_remappings = {}
111
+ end
112
+ end
113
+ # The maximum amount allowed for the billing period.
114
+ attr_reader :amount
115
+ # The configration for the overage rate for the custom pricing unit.
116
+ attr_reader :custom_pricing_unit_overage_rate
117
+
118
+ def self.inner_class_types
119
+ @inner_class_types = {
120
+ amount: Amount,
121
+ custom_pricing_unit_overage_rate: CustomPricingUnitOverageRate,
122
+ }
123
+ end
124
+
125
+ def self.field_remappings
126
+ @field_remappings = {}
127
+ end
128
+ end
129
+ # What the spend modifier applies to.
130
+ attr_reader :applies_to
131
+ # The ID of the spend modifier.
132
+ attr_reader :id
133
+ # Type of the spend modifier.
134
+ attr_reader :type
135
+ # Details for max billing period spend modifier. Only present if type is max_billing_period_spend.
136
+ attr_reader :max_billing_period_spend
137
+
138
+ def self.inner_class_types
139
+ @inner_class_types = { max_billing_period_spend: MaxBillingPeriodSpend }
140
+ end
141
+
142
+ def self.field_remappings
143
+ @field_remappings = {}
144
+ end
145
+ end
146
+ # When the apply action will take effect. Defaults to on_reserve if not specified.
147
+ attr_reader :effective_at
58
148
  # Type of the apply action details.
59
149
  attr_reader :type
60
150
  # Details for applying a discount rule to future invoices.
61
151
  attr_reader :invoice_discount_rule
152
+ # Details for applying a spend modifier rule. Only present if type is spend_modifier_rule.
153
+ attr_reader :spend_modifier_rule
62
154
 
63
155
  def self.inner_class_types
64
- @inner_class_types = { invoice_discount_rule: InvoiceDiscountRule }
156
+ @inner_class_types = {
157
+ effective_at: EffectiveAt,
158
+ invoice_discount_rule: InvoiceDiscountRule,
159
+ spend_modifier_rule: SpendModifierRule,
160
+ }
65
161
  end
66
162
 
67
163
  def self.field_remappings
@@ -294,13 +390,29 @@ module Stripe
294
390
  end
295
391
 
296
392
  class Remove < ::Stripe::StripeObject
393
+ class EffectiveAt < ::Stripe::StripeObject
394
+ # When the remove action will take effect.
395
+ attr_reader :type
396
+
397
+ def self.inner_class_types
398
+ @inner_class_types = {}
399
+ end
400
+
401
+ def self.field_remappings
402
+ @field_remappings = {}
403
+ end
404
+ end
405
+ # When the remove action will take effect. Defaults to on_reserve if not specified.
406
+ attr_reader :effective_at
297
407
  # Type of the remove action.
298
408
  attr_reader :type
299
409
  # The ID of the discount rule to remove for future invoices.
300
410
  attr_reader :invoice_discount_rule
411
+ # The ID of the spend modifier rule removed.
412
+ attr_reader :spend_modifier_rule
301
413
 
302
414
  def self.inner_class_types
303
- @inner_class_types = {}
415
+ @inner_class_types = { effective_at: EffectiveAt }
304
416
  end
305
417
 
306
418
  def self.field_remappings
@@ -0,0 +1,60 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ # A one-time item represents a product that can be charged as a one-time line item,
8
+ # used for overage charges when custom pricing unit credits are exhausted.
9
+ class OneTimeItem < APIResource
10
+ OBJECT_NAME = "v2.billing.one_time_item"
11
+ def self.object_name
12
+ "v2.billing.one_time_item"
13
+ end
14
+
15
+ class TaxDetails < ::Stripe::StripeObject
16
+ # Product tax code (PTC).
17
+ attr_reader :tax_code
18
+
19
+ def self.inner_class_types
20
+ @inner_class_types = {}
21
+ end
22
+
23
+ def self.field_remappings
24
+ @field_remappings = {}
25
+ end
26
+ end
27
+ # Timestamp of when the object was created.
28
+ attr_reader :created
29
+ # Description that customers will see in the invoice line item.
30
+ # Maximum length of 250 characters.
31
+ attr_reader :display_name
32
+ # Unique identifier for the object.
33
+ attr_reader :id
34
+ # An internal key you can use to search for a particular one-time item.
35
+ # Maximum length of 200 characters.
36
+ attr_reader :lookup_key
37
+ # Set of [key-value pairs](/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.
38
+ attr_reader :metadata
39
+ # String representing the object's type. Objects of the same type share the same value of the object field.
40
+ attr_reader :object
41
+ # Stripe Tax details.
42
+ attr_reader :tax_details
43
+ # The unit to use when displaying prices for this one-time item. For example, set this field
44
+ # to "credit" for the display to show "(price) per credit".
45
+ # Maximum length of 100 characters.
46
+ attr_reader :unit_label
47
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
48
+ attr_reader :livemode
49
+
50
+ def self.inner_class_types
51
+ @inner_class_types = { tax_details: TaxDetails }
52
+ end
53
+
54
+ def self.field_remappings
55
+ @field_remappings = {}
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,48 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ # A rate card custom pricing unit overage rate defines the conversion rate from a custom pricing unit
8
+ # to fiat currency when credits are exhausted. This enables automatic overage charges
9
+ # at a configurable per-unit rate.
10
+ class RateCardCustomPricingUnitOverageRate < APIResource
11
+ OBJECT_NAME = "v2.billing.rate_card_custom_pricing_unit_overage_rate"
12
+ def self.object_name
13
+ "v2.billing.rate_card_custom_pricing_unit_overage_rate"
14
+ end
15
+
16
+ # Timestamp of when the object was created.
17
+ attr_reader :created
18
+ # The ID of the custom pricing unit this overage rate applies to.
19
+ attr_reader :custom_pricing_unit
20
+ # Unique identifier for the object.
21
+ attr_reader :id
22
+ # Set of [key-value pairs](/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.
23
+ attr_reader :metadata
24
+ # String representing the object's type. Objects of the same type share the same value of the object field.
25
+ attr_reader :object
26
+ # A one-time item represents a product that can be charged as a one-time line item,
27
+ # used for overage charges when custom pricing unit credits are exhausted.
28
+ attr_reader :one_time_item
29
+ # The ID of the Rate Card this overage rate belongs to.
30
+ attr_reader :rate_card
31
+ # The ID of the Rate Card Version this overage rate was created on.
32
+ attr_reader :rate_card_version
33
+ # The per-unit amount to charge for overages, represented as a decimal string in minor currency units with at most 12 decimal places.
34
+ attr_reader :unit_amount
35
+ # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
36
+ attr_reader :livemode
37
+
38
+ def self.inner_class_types
39
+ @inner_class_types = {}
40
+ end
41
+
42
+ def self.field_remappings
43
+ @field_remappings = {}
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -184,6 +184,7 @@ require "stripe/resources/treasury/transaction_entry"
184
184
  require "stripe/resources/v2/billing/bill_setting"
185
185
  require "stripe/resources/v2/billing/bill_setting_version"
186
186
  require "stripe/resources/v2/billing/cadence"
187
+ require "stripe/resources/v2/billing/cadence_spend_modifier"
187
188
  require "stripe/resources/v2/billing/collection_setting"
188
189
  require "stripe/resources/v2/billing/collection_setting_version"
189
190
  require "stripe/resources/v2/billing/custom_pricing_unit"
@@ -197,6 +198,7 @@ require "stripe/resources/v2/billing/meter_event"
197
198
  require "stripe/resources/v2/billing/meter_event_adjustment"
198
199
  require "stripe/resources/v2/billing/meter_event_session"
199
200
  require "stripe/resources/v2/billing/metered_item"
201
+ require "stripe/resources/v2/billing/one_time_item"
200
202
  require "stripe/resources/v2/billing/pricing_plan"
201
203
  require "stripe/resources/v2/billing/pricing_plan_component"
202
204
  require "stripe/resources/v2/billing/pricing_plan_subscription"
@@ -204,6 +206,7 @@ require "stripe/resources/v2/billing/pricing_plan_subscription_components"
204
206
  require "stripe/resources/v2/billing/pricing_plan_version"
205
207
  require "stripe/resources/v2/billing/profile"
206
208
  require "stripe/resources/v2/billing/rate_card"
209
+ require "stripe/resources/v2/billing/rate_card_custom_pricing_unit_overage_rate"
207
210
  require "stripe/resources/v2/billing/rate_card_rate"
208
211
  require "stripe/resources/v2/billing/rate_card_subscription"
209
212
  require "stripe/resources/v2/billing/rate_card_version"
@@ -14,7 +14,7 @@ module Stripe
14
14
  )
15
15
  end
16
16
 
17
- # Lists French Meal Vouchers Onboarding objects
17
+ # Lists French Meal Vouchers Onboarding objects. The objects are returned in sorted order, with the most recently created objects appearing first.
18
18
  def list(params = {}, opts = {})
19
19
  request(
20
20
  method: :get,
@@ -25,7 +25,10 @@ module Stripe
25
25
  )
26
26
  end
27
27
 
28
- # Retrieves the details of a French Meal Vouchers Onboarding object
28
+ # Retrieves the details of a previously created French Meal Vouchers Onboarding object.
29
+ #
30
+ # Supply the unique French Meal Vouchers Onboarding ID that was returned from your previous request,
31
+ # and Stripe returns the corresponding onboarding information.
29
32
  def retrieve(id, params = {}, opts = {})
30
33
  request(
31
34
  method: :get,
@@ -36,7 +39,11 @@ module Stripe
36
39
  )
37
40
  end
38
41
 
39
- # Updates the details of a restaurant's French Meal Vouchers Onboarding object
42
+ # Updates the details of a restaurant's French Meal Vouchers Onboarding object by
43
+ # setting the values of the parameters passed. Any parameters not provided are left unchanged.
44
+ # After you update the object, the onboarding process automatically restarts.
45
+ #
46
+ # You can only update French Meal Vouchers Onboarding objects with the postal_code field requirement in past_due.
40
47
  def update(id, params = {}, opts = {})
41
48
  request(
42
49
  method: :post,
@@ -5,6 +5,14 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class CadenceService < StripeService
8
+ attr_reader :spend_modifier_rules
9
+
10
+ def initialize(requestor)
11
+ super
12
+ @spend_modifier_rules = Stripe::V2::Billing::Cadences::SpendModifierRuleService
13
+ .new(@requestor)
14
+ end
15
+
8
16
  # Cancel the Billing Cadence.
9
17
  def cancel(id, params = {}, opts = {})
10
18
  request(
@@ -0,0 +1,34 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ module Cadences
8
+ class SpendModifierRuleService < StripeService
9
+ # List all Spend Modifiers associated with a Billing Cadence.
10
+ def list(cadence_id, params = {}, opts = {})
11
+ request(
12
+ method: :get,
13
+ path: format("/v2/billing/cadences/%<cadence_id>s/spend_modifier_rules", { cadence_id: CGI.escape(cadence_id) }),
14
+ params: params,
15
+ opts: opts,
16
+ base_address: :api
17
+ )
18
+ end
19
+
20
+ # Retrieve a Spend Modifier associated with a Billing Cadence.
21
+ def retrieve(cadence_id, id, params = {}, opts = {})
22
+ request(
23
+ method: :get,
24
+ path: format("/v2/billing/cadences/%<cadence_id>s/spend_modifier_rules/%<id>s", { cadence_id: CGI.escape(cadence_id), id: CGI.escape(id) }),
25
+ params: params,
26
+ opts: opts,
27
+ base_address: :api
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,54 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ class OneTimeItemService < StripeService
8
+ # Create a One-Time Item object.
9
+ def create(params = {}, opts = {})
10
+ request(
11
+ method: :post,
12
+ path: "/v2/billing/one_time_items",
13
+ params: params,
14
+ opts: opts,
15
+ base_address: :api
16
+ )
17
+ end
18
+
19
+ # List all One-Time Item objects in reverse chronological order of creation.
20
+ def list(params = {}, opts = {})
21
+ request(
22
+ method: :get,
23
+ path: "/v2/billing/one_time_items",
24
+ params: params,
25
+ opts: opts,
26
+ base_address: :api
27
+ )
28
+ end
29
+
30
+ # Retrieve a One-Time Item object.
31
+ def retrieve(id, params = {}, opts = {})
32
+ request(
33
+ method: :get,
34
+ path: format("/v2/billing/one_time_items/%<id>s", { id: CGI.escape(id) }),
35
+ params: params,
36
+ opts: opts,
37
+ base_address: :api
38
+ )
39
+ end
40
+
41
+ # Update a One-Time Item object.
42
+ def update(id, params = {}, opts = {})
43
+ request(
44
+ method: :post,
45
+ path: format("/v2/billing/one_time_items/%<id>s", { id: CGI.escape(id) }),
46
+ params: params,
47
+ opts: opts,
48
+ base_address: :api
49
+ )
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -5,10 +5,12 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class RateCardService < StripeService
8
- attr_reader :rates, :versions
8
+ attr_reader :custom_pricing_unit_overage_rates, :rates, :versions
9
9
 
10
10
  def initialize(requestor)
11
11
  super
12
+ @custom_pricing_unit_overage_rates = Stripe::V2::Billing::RateCards::CustomPricingUnitOverageRateService
13
+ .new(@requestor)
12
14
  @rates = Stripe::V2::Billing::RateCards::RateService.new(@requestor)
13
15
  @versions = Stripe::V2::Billing::RateCards::VersionService.new(@requestor)
14
16
  end
@@ -0,0 +1,56 @@
1
+ # File generated from our OpenAPI spec
2
+ # frozen_string_literal: true
3
+
4
+ module Stripe
5
+ module V2
6
+ module Billing
7
+ module RateCards
8
+ class CustomPricingUnitOverageRateService < StripeService
9
+ # Create a Rate Card Custom Pricing Unit Overage Rate on a Rate Card.
10
+ def create(rate_card_id, params = {}, opts = {})
11
+ request(
12
+ method: :post,
13
+ path: format("/v2/billing/rate_cards/%<rate_card_id>s/custom_pricing_unit_overage_rates", { rate_card_id: CGI.escape(rate_card_id) }),
14
+ params: params,
15
+ opts: opts,
16
+ base_address: :api
17
+ )
18
+ end
19
+
20
+ # Delete a Rate Card Custom Pricing Unit Overage Rate from a Rate Card.
21
+ def delete(rate_card_id, id, params = {}, opts = {})
22
+ request(
23
+ method: :delete,
24
+ path: format("/v2/billing/rate_cards/%<rate_card_id>s/custom_pricing_unit_overage_rates/%<id>s", { rate_card_id: CGI.escape(rate_card_id), id: CGI.escape(id) }),
25
+ params: params,
26
+ opts: opts,
27
+ base_address: :api
28
+ )
29
+ end
30
+
31
+ # List all Rate Card Custom Pricing Unit Overage Rates on a Rate Card.
32
+ def list(rate_card_id, params = {}, opts = {})
33
+ request(
34
+ method: :get,
35
+ path: format("/v2/billing/rate_cards/%<rate_card_id>s/custom_pricing_unit_overage_rates", { rate_card_id: CGI.escape(rate_card_id) }),
36
+ params: params,
37
+ opts: opts,
38
+ base_address: :api
39
+ )
40
+ end
41
+
42
+ # Retrieve a Rate Card Custom Pricing Unit Overage Rate from a Rate Card.
43
+ def retrieve(rate_card_id, id, params = {}, opts = {})
44
+ request(
45
+ method: :get,
46
+ path: format("/v2/billing/rate_cards/%<rate_card_id>s/custom_pricing_unit_overage_rates/%<id>s", { rate_card_id: CGI.escape(rate_card_id), id: CGI.escape(id) }),
47
+ params: params,
48
+ opts: opts,
49
+ base_address: :api
50
+ )
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -4,7 +4,7 @@
4
4
  module Stripe
5
5
  module V2
6
6
  class BillingService < StripeService
7
- attr_reader :bill_settings, :cadences, :collection_settings, :custom_pricing_units, :intents, :license_fees, :license_fee_subscriptions, :licensed_items, :meter_events, :meter_event_adjustments, :meter_event_session, :meter_event_stream, :metered_items, :pricing_plans, :pricing_plan_subscriptions, :profiles, :rate_cards, :rate_card_subscriptions, :service_actions
7
+ attr_reader :bill_settings, :cadences, :collection_settings, :custom_pricing_units, :intents, :license_fees, :license_fee_subscriptions, :licensed_items, :meter_events, :meter_event_adjustments, :meter_event_session, :meter_event_stream, :metered_items, :one_time_items, :pricing_plans, :pricing_plan_subscriptions, :profiles, :rate_cards, :rate_card_subscriptions, :service_actions
8
8
 
9
9
  def initialize(requestor)
10
10
  super
@@ -22,6 +22,7 @@ module Stripe
22
22
  @meter_event_session = Stripe::V2::Billing::MeterEventSessionService.new(@requestor)
23
23
  @meter_event_stream = Stripe::V2::Billing::MeterEventStreamService.new(@requestor)
24
24
  @metered_items = Stripe::V2::Billing::MeteredItemService.new(@requestor)
25
+ @one_time_items = Stripe::V2::Billing::OneTimeItemService.new(@requestor)
25
26
  @pricing_plans = Stripe::V2::Billing::PricingPlanService.new(@requestor)
26
27
  @pricing_plan_subscriptions = Stripe::V2::Billing::PricingPlanSubscriptionService
27
28
  .new(@requestor)
@@ -223,6 +223,7 @@ require "stripe/services/v1_services"
223
223
  require "stripe/services/v2/billing/bill_setting_service"
224
224
  require "stripe/services/v2/billing/bill_settings/version_service"
225
225
  require "stripe/services/v2/billing/cadence_service"
226
+ require "stripe/services/v2/billing/cadences/spend_modifier_rule_service"
226
227
  require "stripe/services/v2/billing/collection_setting_service"
227
228
  require "stripe/services/v2/billing/collection_settings/version_service"
228
229
  require "stripe/services/v2/billing/custom_pricing_unit_service"
@@ -237,6 +238,7 @@ require "stripe/services/v2/billing/meter_event_service"
237
238
  require "stripe/services/v2/billing/meter_event_session_service"
238
239
  require "stripe/services/v2/billing/meter_event_stream_service"
239
240
  require "stripe/services/v2/billing/metered_item_service"
241
+ require "stripe/services/v2/billing/one_time_item_service"
240
242
  require "stripe/services/v2/billing/pricing_plan_service"
241
243
  require "stripe/services/v2/billing/pricing_plan_subscription_service"
242
244
  require "stripe/services/v2/billing/pricing_plan_subscriptions/component_service"
@@ -245,6 +247,7 @@ require "stripe/services/v2/billing/pricing_plans/version_service"
245
247
  require "stripe/services/v2/billing/profile_service"
246
248
  require "stripe/services/v2/billing/rate_card_service"
247
249
  require "stripe/services/v2/billing/rate_card_subscription_service"
250
+ require "stripe/services/v2/billing/rate_cards/custom_pricing_unit_overage_rate_service"
248
251
  require "stripe/services/v2/billing/rate_cards/rate_service"
249
252
  require "stripe/services/v2/billing/rate_cards/version_service"
250
253
  require "stripe/services/v2/billing/service_action_service"