stripe 13.5.0.pre.beta.1 → 13.6.0.pre.beta.1

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -34
  3. data/Gemfile +4 -0
  4. data/OPENAPI_VERSION +1 -1
  5. data/VERSION +1 -1
  6. data/lib/stripe/api_version.rb +1 -1
  7. data/lib/stripe/resources/billing/credit_grant.rb +8 -2
  8. data/lib/stripe/resources/charge.rb +1 -1
  9. data/lib/stripe/resources/checkout/session.rb +30 -3
  10. data/lib/stripe/resources/identity/verification_session.rb +2 -2
  11. data/lib/stripe/resources/invoice_line_item.rb +1 -1
  12. data/lib/stripe/resources/order.rb +20 -2
  13. data/lib/stripe/resources/payment_intent.rb +89 -16
  14. data/lib/stripe/resources/product.rb +4 -0
  15. data/lib/stripe/resources/tax/calculation.rb +1 -1
  16. data/lib/stripe/resources/tax_rate.rb +1 -1
  17. data/lib/stripe/resources/terminal/reader.rb +61 -0
  18. data/lib/stripe/services/billing/credit_grant_service.rb +6 -2
  19. data/lib/stripe/services/checkout/session_service.rb +20 -3
  20. data/lib/stripe/services/identity/verification_session_service.rb +1 -1
  21. data/lib/stripe/services/order_service.rb +16 -2
  22. data/lib/stripe/services/payment_intent_service.rb +75 -12
  23. data/lib/stripe/services/product_service.rb +4 -0
  24. data/lib/stripe/services/test_helpers/terminal/reader_service.rb +43 -0
  25. data/lib/stripe/version.rb +1 -1
  26. data/rbi/stripe/resources/account.rbi +1 -1
  27. data/rbi/stripe/resources/billing/credit_grant.rbi +10 -3
  28. data/rbi/stripe/resources/charge.rbi +1 -1
  29. data/rbi/stripe/resources/checkout/session.rbi +40 -8
  30. data/rbi/stripe/resources/identity/verification_session.rbi +2 -2
  31. data/rbi/stripe/resources/invoice_line_item.rbi +130 -33
  32. data/rbi/stripe/resources/order.rbi +26 -6
  33. data/rbi/stripe/resources/payment_intent.rbi +94 -28
  34. data/rbi/stripe/resources/product.rbi +5 -1
  35. data/rbi/stripe/resources/tax/calculation.rbi +1 -1
  36. data/rbi/stripe/resources/tax_rate.rbi +1 -1
  37. data/rbi/stripe/resources/terminal/reader.rbi +17 -0
  38. data/rbi/stripe/services/billing/credit_grant_service.rbi +7 -3
  39. data/rbi/stripe/services/checkout/session_service.rbi +25 -8
  40. data/rbi/stripe/services/identity/verification_session_service.rbi +1 -1
  41. data/rbi/stripe/services/order_service.rbi +20 -6
  42. data/rbi/stripe/services/payment_intent_service.rbi +75 -24
  43. data/rbi/stripe/services/product_service.rbi +5 -1
  44. data/rbi/stripe/services/test_helpers/terminal/reader_service.rbi +29 -0
  45. metadata +2 -2
@@ -2,57 +2,70 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # typed: true
5
+
5
6
  module Stripe
6
7
  # Invoice Line Items represent the individual lines within an [invoice](https://stripe.com/docs/api/invoices) and only exist within the context of an invoice.
7
8
  #
8
9
  # Each line item is backed by either an [invoice item](https://stripe.com/docs/api/invoiceitems) or a [subscription item](https://stripe.com/docs/api/subscription_items).
9
- class InvoiceLineItem < StripeObject
10
+ class InvoiceLineItem < APIResource
10
11
  class DiscountAmount < Stripe::StripeObject
11
12
  # The amount, in cents (or local equivalent), of the discount.
12
13
  sig { returns(Integer) }
13
14
  attr_reader :amount
15
+
14
16
  # The discount that was applied to get this discount amount.
15
17
  sig { returns(T.any(String, Stripe::Discount)) }
16
18
  attr_reader :discount
17
19
  end
20
+
18
21
  class MarginAmount < Stripe::StripeObject
19
22
  # The amount, in cents (or local equivalent), of the reduction in line item amount.
20
23
  sig { returns(Integer) }
21
24
  attr_reader :amount
25
+
22
26
  # The margin that was applied to get this margin amount.
23
27
  sig { returns(T.any(String, Stripe::Margin)) }
24
28
  attr_reader :margin
25
29
  end
30
+
26
31
  class Period < Stripe::StripeObject
27
32
  # The end of the period, which must be greater than or equal to the start. This value is inclusive.
28
33
  sig { returns(Integer) }
29
34
  attr_reader :end
35
+
30
36
  # The start of the period. This value is inclusive.
31
37
  sig { returns(Integer) }
32
38
  attr_reader :start
33
39
  end
40
+
34
41
  class PretaxCreditAmount < Stripe::StripeObject
35
42
  # The amount, in cents (or local equivalent), of the pretax credit amount.
36
43
  sig { returns(Integer) }
37
44
  attr_reader :amount
45
+
38
46
  # The credit balance transaction that was applied to get this pretax credit amount.
39
47
  sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) }
40
48
  attr_reader :credit_balance_transaction
49
+
41
50
  # The discount that was applied to get this pretax credit amount.
42
51
  sig { returns(T.any(String, Stripe::Discount)) }
43
52
  attr_reader :discount
53
+
44
54
  # The margin that was applied to get this pretax credit amount.
45
55
  sig { returns(T.any(String, Stripe::Margin)) }
46
56
  attr_reader :margin
57
+
47
58
  # Type of the pretax credit amount referenced.
48
59
  sig { returns(String) }
49
60
  attr_reader :type
50
61
  end
62
+
51
63
  class ProrationDetails < Stripe::StripeObject
52
64
  class CreditedItems < Stripe::StripeObject
53
65
  # Invoice containing the credited invoice line items
54
66
  sig { returns(String) }
55
67
  attr_reader :invoice
68
+
56
69
  # Credited invoice line items
57
70
  sig { returns(T::Array[String]) }
58
71
  attr_reader :invoice_line_items
@@ -61,19 +74,24 @@ module Stripe
61
74
  sig { returns(T.nilable(CreditedItems)) }
62
75
  attr_reader :credited_items
63
76
  end
77
+
64
78
  class TaxAmount < Stripe::StripeObject
65
79
  # The amount, in cents (or local equivalent), of the tax.
66
80
  sig { returns(Integer) }
67
81
  attr_reader :amount
82
+
68
83
  # Whether this tax amount is inclusive or exclusive.
69
84
  sig { returns(T::Boolean) }
70
85
  attr_reader :inclusive
86
+
71
87
  # The tax rate that was applied to get this tax amount.
72
88
  sig { returns(T.any(String, Stripe::TaxRate)) }
73
89
  attr_reader :tax_rate
90
+
74
91
  # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
75
92
  sig { returns(T.nilable(String)) }
76
93
  attr_reader :taxability_reason
94
+
77
95
  # The amount on which tax is calculated, in cents (or local equivalent).
78
96
  sig { returns(T.nilable(Integer)) }
79
97
  attr_reader :taxable_amount
@@ -81,87 +99,115 @@ module Stripe
81
99
  # The amount, in cents (or local equivalent).
82
100
  sig { returns(Integer) }
83
101
  attr_reader :amount
102
+
84
103
  # The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
85
104
  sig { returns(T.nilable(Integer)) }
86
105
  attr_reader :amount_excluding_tax
106
+
87
107
  # 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).
88
108
  sig { returns(String) }
89
109
  attr_reader :currency
110
+
90
111
  # An arbitrary string attached to the object. Often useful for displaying to users.
91
112
  sig { returns(T.nilable(String)) }
92
113
  attr_reader :description
114
+
93
115
  # The amount of discount calculated per discount for this line item.
94
116
  sig { returns(T.nilable(T::Array[DiscountAmount])) }
95
117
  attr_reader :discount_amounts
118
+
96
119
  # If true, discounts will apply to this line item. Always false for prorations.
97
120
  sig { returns(T::Boolean) }
98
121
  attr_reader :discountable
122
+
99
123
  # The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount.
100
124
  sig { returns(T::Array[T.any(String, Stripe::Discount)]) }
101
125
  attr_reader :discounts
126
+
102
127
  # Unique identifier for the object.
103
128
  sig { returns(String) }
104
129
  attr_reader :id
130
+
105
131
  # The ID of the invoice that contains this line item.
106
132
  sig { returns(T.nilable(String)) }
107
133
  attr_reader :invoice
134
+
108
135
  # The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any.
109
136
  sig { returns(T.any(String, Stripe::InvoiceItem)) }
110
137
  attr_reader :invoice_item
138
+
111
139
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
112
140
  sig { returns(T::Boolean) }
113
141
  attr_reader :livemode
142
+
114
143
  # The amount of margin calculated per margin for this line item.
115
144
  sig { returns(T.nilable(T::Array[MarginAmount])) }
116
145
  attr_reader :margin_amounts
146
+
117
147
  # The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin.
118
148
  sig { returns(T.nilable(T::Array[T.any(String, Stripe::Margin)])) }
119
149
  attr_reader :margins
150
+
120
151
  # 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. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
121
152
  sig { returns(T::Hash[String, String]) }
122
153
  attr_reader :metadata
154
+
123
155
  # String representing the object's type. Objects of the same type share the same value.
124
156
  sig { returns(String) }
125
157
  attr_reader :object
158
+
126
159
  # Attribute for field period
127
160
  sig { returns(Period) }
128
161
  attr_reader :period
162
+
129
163
  # The plan of the subscription, if the line item is a subscription or a proration.
130
164
  sig { returns(T.nilable(Stripe::Plan)) }
131
165
  attr_reader :plan
166
+
132
167
  # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
133
168
  sig { returns(T.nilable(T::Array[PretaxCreditAmount])) }
134
169
  attr_reader :pretax_credit_amounts
170
+
135
171
  # The price of the line item.
136
172
  sig { returns(T.nilable(Stripe::Price)) }
137
173
  attr_reader :price
174
+
138
175
  # Whether this is a proration.
139
176
  sig { returns(T::Boolean) }
140
177
  attr_reader :proration
178
+
141
179
  # Additional details for proration line items
142
180
  sig { returns(T.nilable(ProrationDetails)) }
143
181
  attr_reader :proration_details
182
+
144
183
  # The quantity of the subscription, if the line item is a subscription or a proration.
145
184
  sig { returns(T.nilable(Integer)) }
146
185
  attr_reader :quantity
186
+
147
187
  # The subscription that the invoice item pertains to, if any.
148
188
  sig { returns(T.nilable(T.any(String, Stripe::Subscription))) }
149
189
  attr_reader :subscription
190
+
150
191
  # The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription.
151
192
  sig { returns(T.any(String, Stripe::SubscriptionItem)) }
152
193
  attr_reader :subscription_item
194
+
153
195
  # The amount of tax calculated per tax rate for this line item
154
196
  sig { returns(T::Array[TaxAmount]) }
155
197
  attr_reader :tax_amounts
198
+
156
199
  # The tax rates which apply to the line item.
157
200
  sig { returns(T::Array[Stripe::TaxRate]) }
158
201
  attr_reader :tax_rates
202
+
159
203
  # A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
160
204
  sig { returns(String) }
161
205
  attr_reader :type
206
+
162
207
  # The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts.
163
208
  sig { returns(T.nilable(String)) }
164
209
  attr_reader :unit_amount_excluding_tax
210
+
165
211
  class UpdateParams < Stripe::RequestParams
166
212
  class Discount < Stripe::RequestParams
167
213
  class DiscountEnd < Stripe::RequestParams
@@ -169,102 +215,124 @@ module Stripe
169
215
  # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
170
216
  sig { returns(String) }
171
217
  attr_accessor :interval
218
+
172
219
  # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
173
220
  sig { returns(Integer) }
174
221
  attr_accessor :interval_count
222
+
175
223
  sig { params(interval: String, interval_count: Integer).void }
176
224
  def initialize(interval: nil, interval_count: nil); end
177
225
  end
178
226
  # Time span for the redeemed discount.
179
227
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd::Duration) }
180
228
  attr_accessor :duration
229
+
181
230
  # A precise Unix timestamp for the discount to end. Must be in the future.
182
231
  sig { returns(Integer) }
183
232
  attr_accessor :timestamp
233
+
184
234
  # The type of calculation made to determine when the discount ends.
185
235
  sig { returns(String) }
186
236
  attr_accessor :type
187
- sig {
188
- params(duration: ::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd::Duration, timestamp: Integer, type: String).void
189
- }
237
+
238
+ sig do
239
+ params(duration: ::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd::Duration,
240
+ timestamp: Integer, type: String).void
241
+ end
190
242
  def initialize(duration: nil, timestamp: nil, type: nil); end
191
243
  end
192
244
  # ID of the coupon to create a new discount for.
193
245
  sig { returns(String) }
194
246
  attr_accessor :coupon
247
+
195
248
  # ID of an existing discount on the object (or one of its ancestors) to reuse.
196
249
  sig { returns(String) }
197
250
  attr_accessor :discount
251
+
198
252
  # Details to determine how long the discount should be applied for.
199
253
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd) }
200
254
  attr_accessor :discount_end
255
+
201
256
  # ID of the promotion code to create a new discount for.
202
257
  sig { returns(String) }
203
258
  attr_accessor :promotion_code
204
- sig {
205
- params(coupon: String, discount: String, discount_end: ::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd, promotion_code: String).void
206
- }
259
+
260
+ sig do
261
+ params(coupon: String, discount: String,
262
+ discount_end: ::Stripe::InvoiceLineItem::UpdateParams::Discount::DiscountEnd, promotion_code: String).void
263
+ end
207
264
  def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil); end
208
265
  end
266
+
209
267
  class Period < Stripe::RequestParams
210
268
  # The end of the period, which must be greater than or equal to the start. This value is inclusive.
211
269
  sig { returns(Integer) }
212
270
  attr_accessor :end
271
+
213
272
  # The start of the period. This value is inclusive.
214
273
  sig { returns(Integer) }
215
274
  attr_accessor :start
275
+
216
276
  sig { params(end_: Integer, start: Integer).void }
217
277
  def initialize(end_: nil, start: nil); end
218
278
  end
279
+
219
280
  class PriceData < Stripe::RequestParams
220
281
  class ProductData < Stripe::RequestParams
221
282
  # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
222
283
  sig { returns(String) }
223
284
  attr_accessor :description
285
+
224
286
  # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
225
287
  sig { returns(T::Array[String]) }
226
288
  attr_accessor :images
289
+
227
290
  # 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`.
228
291
  sig { returns(T::Hash[String, String]) }
229
292
  attr_accessor :metadata
293
+
230
294
  # The product's name, meant to be displayable to the customer.
231
295
  sig { returns(String) }
232
296
  attr_accessor :name
297
+
233
298
  # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
234
299
  sig { returns(String) }
235
300
  attr_accessor :tax_code
236
- sig {
237
- params(description: String, images: T::Array[String], metadata: T::Hash[String, String], name: String, tax_code: String).void
238
- }
239
- def initialize(
240
- description: nil,
241
- images: nil,
242
- metadata: nil,
243
- name: nil,
244
- tax_code: nil
245
- ); end
301
+
302
+ sig do
303
+ params(description: String, images: T::Array[String], metadata: T::Hash[String, String], name: String,
304
+ tax_code: String).void
305
+ end
306
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil); end
246
307
  end
247
308
  # 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).
248
309
  sig { returns(String) }
249
310
  attr_accessor :currency
311
+
250
312
  # The ID of the product that this price will belong to. One of `product` or `product_data` is required.
251
313
  sig { returns(String) }
252
314
  attr_accessor :product
315
+
253
316
  # Data used to generate a new product object inline. One of `product` or `product_data` is required.
254
317
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::PriceData::ProductData) }
255
318
  attr_accessor :product_data
319
+
256
320
  # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
257
321
  sig { returns(String) }
258
322
  attr_accessor :tax_behavior
323
+
259
324
  # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
260
325
  sig { returns(Integer) }
261
326
  attr_accessor :unit_amount
327
+
262
328
  # Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
263
329
  sig { returns(String) }
264
330
  attr_accessor :unit_amount_decimal
265
- sig {
266
- params(currency: String, product: String, product_data: ::Stripe::InvoiceLineItem::UpdateParams::PriceData::ProductData, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
267
- }
331
+
332
+ sig do
333
+ params(currency: String, product: String,
334
+ product_data: ::Stripe::InvoiceLineItem::UpdateParams::PriceData::ProductData, tax_behavior: String, unit_amount: Integer, unit_amount_decimal: String).void
335
+ end
268
336
  def initialize(
269
337
  currency: nil,
270
338
  product: nil,
@@ -274,35 +342,45 @@ module Stripe
274
342
  unit_amount_decimal: nil
275
343
  ); end
276
344
  end
345
+
277
346
  class TaxAmount < Stripe::RequestParams
278
347
  class TaxRateData < Stripe::RequestParams
279
348
  # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
280
349
  sig { returns(String) }
281
350
  attr_accessor :country
351
+
282
352
  # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
283
353
  sig { returns(String) }
284
354
  attr_accessor :description
355
+
285
356
  # The display name of the tax rate, which will be shown to users.
286
357
  sig { returns(String) }
287
358
  attr_accessor :display_name
359
+
288
360
  # This specifies if the tax rate is inclusive or exclusive.
289
361
  sig { returns(T::Boolean) }
290
362
  attr_accessor :inclusive
363
+
291
364
  # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
292
365
  sig { returns(String) }
293
366
  attr_accessor :jurisdiction
367
+
294
368
  # The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
295
369
  sig { returns(Float) }
296
370
  attr_accessor :percentage
371
+
297
372
  # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
298
373
  sig { returns(String) }
299
374
  attr_accessor :state
375
+
300
376
  # The high-level tax type, such as `vat` or `sales_tax`.
301
377
  sig { returns(String) }
302
378
  attr_accessor :tax_type
303
- sig {
304
- params(country: String, description: String, display_name: String, inclusive: T::Boolean, jurisdiction: String, percentage: Float, state: String, tax_type: String).void
305
- }
379
+
380
+ sig do
381
+ params(country: String, description: String, display_name: String, inclusive: T::Boolean,
382
+ jurisdiction: String, percentage: Float, state: String, tax_type: String).void
383
+ end
306
384
  def initialize(
307
385
  country: nil,
308
386
  description: nil,
@@ -317,61 +395,79 @@ module Stripe
317
395
  # The amount, in cents (or local equivalent), of the tax.
318
396
  sig { returns(Integer) }
319
397
  attr_accessor :amount
398
+
320
399
  # Data to find or create a TaxRate object.
321
400
  #
322
401
  # Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
323
402
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::TaxAmount::TaxRateData) }
324
403
  attr_accessor :tax_rate_data
404
+
325
405
  # The amount on which tax is calculated, in cents (or local equivalent).
326
406
  sig { returns(Integer) }
327
407
  attr_accessor :taxable_amount
328
- sig {
329
- params(amount: Integer, tax_rate_data: ::Stripe::InvoiceLineItem::UpdateParams::TaxAmount::TaxRateData, taxable_amount: Integer).void
330
- }
408
+
409
+ sig do
410
+ params(amount: Integer, tax_rate_data: ::Stripe::InvoiceLineItem::UpdateParams::TaxAmount::TaxRateData,
411
+ taxable_amount: Integer).void
412
+ end
331
413
  def initialize(amount: nil, tax_rate_data: nil, taxable_amount: nil); end
332
414
  end
333
415
  # The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
334
416
  sig { returns(Integer) }
335
417
  attr_accessor :amount
418
+
336
419
  # An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
337
420
  sig { returns(String) }
338
421
  attr_accessor :description
422
+
339
423
  # Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations.
340
424
  sig { returns(T::Boolean) }
341
425
  attr_accessor :discountable
426
+
342
427
  # The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
343
428
  sig { returns(T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::Discount])) }
344
429
  attr_accessor :discounts
430
+
345
431
  # Specifies which fields in the response should be expanded.
346
432
  sig { returns(T::Array[String]) }
347
433
  attr_accessor :expand
434
+
348
435
  # 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.
349
436
  sig { returns(T.nilable(T::Array[String])) }
350
437
  attr_accessor :margins
438
+
351
439
  # 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.
352
440
  sig { returns(T.nilable(T::Hash[String, String])) }
353
441
  attr_accessor :metadata
442
+
354
443
  # 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.
355
444
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::Period) }
356
445
  attr_accessor :period
446
+
357
447
  # The ID of the price object. One of `price` or `price_data` is required.
358
448
  sig { returns(String) }
359
449
  attr_accessor :price
450
+
360
451
  # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
361
452
  sig { returns(::Stripe::InvoiceLineItem::UpdateParams::PriceData) }
362
453
  attr_accessor :price_data
454
+
363
455
  # Non-negative integer. The quantity of units for the line item.
364
456
  sig { returns(Integer) }
365
457
  attr_accessor :quantity
458
+
366
459
  # A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
367
460
  sig { returns(T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::TaxAmount])) }
368
461
  attr_accessor :tax_amounts
462
+
369
463
  # The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates.
370
464
  sig { returns(T.nilable(T::Array[String])) }
371
465
  attr_accessor :tax_rates
372
- sig {
373
- params(amount: Integer, description: String, discountable: T::Boolean, discounts: T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::Discount]), expand: T::Array[String], margins: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), period: ::Stripe::InvoiceLineItem::UpdateParams::Period, price: String, price_data: ::Stripe::InvoiceLineItem::UpdateParams::PriceData, quantity: Integer, tax_amounts: T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::TaxAmount]), tax_rates: T.nilable(T::Array[String])).void
374
- }
466
+
467
+ sig do
468
+ params(amount: Integer, description: String, discountable: T::Boolean,
469
+ discounts: T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::Discount]), expand: T::Array[String], margins: T.nilable(T::Array[String]), metadata: T.nilable(T::Hash[String, String]), period: ::Stripe::InvoiceLineItem::UpdateParams::Period, price: String, price_data: ::Stripe::InvoiceLineItem::UpdateParams::PriceData, quantity: Integer, tax_amounts: T.nilable(T::Array[::Stripe::InvoiceLineItem::UpdateParams::TaxAmount]), tax_rates: T.nilable(T::Array[String])).void
470
+ end
375
471
  def initialize(
376
472
  amount: nil,
377
473
  description: nil,
@@ -392,9 +488,10 @@ module Stripe
392
488
  # so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
393
489
  # item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
394
490
  # Updating an invoice's line item is only possible before the invoice is finalized.
395
- sig {
396
- params(invoice: String, line_item_id: String, params: T.any(::Stripe::InvoiceLineItem::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::InvoiceLineItem)
397
- }
491
+ sig do
492
+ params(invoice: String, line_item_id: String,
493
+ params: T.any(::Stripe::InvoiceLineItem::UpdateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(Stripe::InvoiceLineItem)
494
+ end
398
495
  def self.update(invoice, line_item_id, params = {}, opts = {}); end
399
496
  end
400
- end
497
+ end
@@ -105,6 +105,9 @@ module Stripe
105
105
  # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
106
106
  sig { returns(String) }
107
107
  attr_reader :setup_future_usage
108
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
109
+ sig { returns(String) }
110
+ attr_reader :target_date
108
111
  # Bank account verification method.
109
112
  sig { returns(String) }
110
113
  attr_reader :verification_method
@@ -351,6 +354,9 @@ module Stripe
351
354
  # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
352
355
  sig { returns(String) }
353
356
  attr_reader :setup_future_usage
357
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
358
+ sig { returns(String) }
359
+ attr_reader :target_date
354
360
  end
355
361
  class Sofort < Stripe::StripeObject
356
362
  # Preferred language of the SOFORT authorization page that the customer is redirected to.
@@ -988,15 +994,19 @@ module Stripe
988
994
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
989
995
  sig { returns(T.nilable(String)) }
990
996
  attr_accessor :setup_future_usage
997
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
998
+ sig { returns(String) }
999
+ attr_accessor :target_date
991
1000
  # Bank account verification method.
992
1001
  sig { returns(String) }
993
1002
  attr_accessor :verification_method
994
1003
  sig {
995
- params(mandate_options: ::Stripe::Order::CreateParams::Payment::Settings::PaymentMethodOptions::AcssDebit::MandateOptions, setup_future_usage: T.nilable(String), verification_method: String).void
1004
+ params(mandate_options: ::Stripe::Order::CreateParams::Payment::Settings::PaymentMethodOptions::AcssDebit::MandateOptions, setup_future_usage: T.nilable(String), target_date: String, verification_method: String).void
996
1005
  }
997
1006
  def initialize(
998
1007
  mandate_options: nil,
999
1008
  setup_future_usage: nil,
1009
+ target_date: nil,
1000
1010
  verification_method: nil
1001
1011
  ); end
1002
1012
  end
@@ -1362,10 +1372,13 @@ module Stripe
1362
1372
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
1363
1373
  sig { returns(T.nilable(String)) }
1364
1374
  attr_accessor :setup_future_usage
1375
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
1376
+ sig { returns(String) }
1377
+ attr_accessor :target_date
1365
1378
  sig {
1366
- params(mandate_options: ::Stripe::Order::CreateParams::Payment::Settings::PaymentMethodOptions::SepaDebit::MandateOptions, setup_future_usage: T.nilable(String)).void
1379
+ params(mandate_options: ::Stripe::Order::CreateParams::Payment::Settings::PaymentMethodOptions::SepaDebit::MandateOptions, setup_future_usage: T.nilable(String), target_date: String).void
1367
1380
  }
1368
- def initialize(mandate_options: nil, setup_future_usage: nil); end
1381
+ def initialize(mandate_options: nil, setup_future_usage: nil, target_date: nil); end
1369
1382
  end
1370
1383
  class Sofort < Stripe::RequestParams
1371
1384
  # Language shown to the payer on redirect.
@@ -2091,15 +2104,19 @@ module Stripe
2091
2104
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2092
2105
  sig { returns(T.nilable(String)) }
2093
2106
  attr_accessor :setup_future_usage
2107
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
2108
+ sig { returns(String) }
2109
+ attr_accessor :target_date
2094
2110
  # Bank account verification method.
2095
2111
  sig { returns(String) }
2096
2112
  attr_accessor :verification_method
2097
2113
  sig {
2098
- params(mandate_options: ::Stripe::Order::UpdateParams::Payment::Settings::PaymentMethodOptions::AcssDebit::MandateOptions, setup_future_usage: T.nilable(String), verification_method: String).void
2114
+ params(mandate_options: ::Stripe::Order::UpdateParams::Payment::Settings::PaymentMethodOptions::AcssDebit::MandateOptions, setup_future_usage: T.nilable(String), target_date: String, verification_method: String).void
2099
2115
  }
2100
2116
  def initialize(
2101
2117
  mandate_options: nil,
2102
2118
  setup_future_usage: nil,
2119
+ target_date: nil,
2103
2120
  verification_method: nil
2104
2121
  ); end
2105
2122
  end
@@ -2465,10 +2482,13 @@ module Stripe
2465
2482
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2466
2483
  sig { returns(T.nilable(String)) }
2467
2484
  attr_accessor :setup_future_usage
2485
+ # Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now.
2486
+ sig { returns(String) }
2487
+ attr_accessor :target_date
2468
2488
  sig {
2469
- params(mandate_options: ::Stripe::Order::UpdateParams::Payment::Settings::PaymentMethodOptions::SepaDebit::MandateOptions, setup_future_usage: T.nilable(String)).void
2489
+ params(mandate_options: ::Stripe::Order::UpdateParams::Payment::Settings::PaymentMethodOptions::SepaDebit::MandateOptions, setup_future_usage: T.nilable(String), target_date: String).void
2470
2490
  }
2471
- def initialize(mandate_options: nil, setup_future_usage: nil); end
2491
+ def initialize(mandate_options: nil, setup_future_usage: nil, target_date: nil); end
2472
2492
  end
2473
2493
  class Sofort < Stripe::RequestParams
2474
2494
  # Language shown to the payer on redirect.