stripe 19.4.0.pre.alpha.2 → 19.4.0.pre.alpha.3

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_version.rb +1 -1
  3. data/lib/stripe/event_types.rb +15 -0
  4. data/lib/stripe/events/v2_billing_contract_activated_event.rb +44 -0
  5. data/lib/stripe/events/v2_billing_contract_canceled_event.rb +44 -0
  6. data/lib/stripe/events/v2_billing_contract_created_event.rb +44 -0
  7. data/lib/stripe/events/v2_billing_contract_ended_event.rb +44 -0
  8. data/lib/stripe/events/v2_billing_contract_updated_event.rb +44 -0
  9. data/lib/stripe/params/capital/financing_transaction_list_params.rb +2 -2
  10. data/lib/stripe/params/checkout/session_create_params.rb +1 -1
  11. data/lib/stripe/params/invoice_create_preview_params.rb +1 -1
  12. data/lib/stripe/params/payment_intent_confirm_params.rb +10 -1
  13. data/lib/stripe/params/payment_intent_create_params.rb +10 -1
  14. data/lib/stripe/params/payment_intent_update_params.rb +10 -1
  15. data/lib/stripe/params/promotion_code_create_params.rb +1 -1
  16. data/lib/stripe/params/promotion_code_update_params.rb +1 -1
  17. data/lib/stripe/params/subscription_schedule_create_params.rb +2 -2
  18. data/lib/stripe/params/subscription_schedule_list_params.rb +1 -1
  19. data/lib/stripe/params/subscription_schedule_update_params.rb +2 -2
  20. data/lib/stripe/params/terminal/reader_activate_gift_card_params.rb +35 -0
  21. data/lib/stripe/params/terminal/reader_cashout_gift_card_params.rb +21 -0
  22. data/lib/stripe/params/terminal/reader_check_gift_card_balance_params.rb +21 -0
  23. data/lib/stripe/params/terminal/reader_collect_payment_method_params.rb +4 -0
  24. data/lib/stripe/params/terminal/reader_process_payment_intent_params.rb +4 -0
  25. data/lib/stripe/params/terminal/reader_reload_gift_card_params.rb +27 -0
  26. data/lib/stripe/params/v2/billing/contract_cancel_params.rb +1 -1
  27. data/lib/stripe/params/v2/billing/contract_create_params.rb +13 -175
  28. data/lib/stripe/params/v2/billing/contract_list_params.rb +1 -1
  29. data/lib/stripe/params/v2/billing/contract_update_params.rb +48 -495
  30. data/lib/stripe/params/v2/core/account_list_params.rb +9 -1
  31. data/lib/stripe/params/v2/data/analytics/metric_query_create_params.rb +2 -2
  32. data/lib/stripe/params.rb +8 -0
  33. data/lib/stripe/resources/account.rb +55 -3
  34. data/lib/stripe/resources/bank_account.rb +2 -2
  35. data/lib/stripe/resources/billing/alert_recovered.rb +17 -1
  36. data/lib/stripe/resources/capability.rb +2 -2
  37. data/lib/stripe/resources/capital/financing_transaction.rb +1 -1
  38. data/lib/stripe/resources/charge.rb +1 -1
  39. data/lib/stripe/resources/checkout/session.rb +21 -3
  40. data/lib/stripe/resources/confirmation_token.rb +1 -1
  41. data/lib/stripe/resources/dispute.rb +4 -2
  42. data/lib/stripe/resources/financial_connections/session.rb +2 -0
  43. data/lib/stripe/resources/invoice.rb +3 -0
  44. data/lib/stripe/resources/issuing/authorization.rb +52 -1
  45. data/lib/stripe/resources/issuing/transaction.rb +47 -1
  46. data/lib/stripe/resources/payment_attempt_record.rb +2 -2
  47. data/lib/stripe/resources/payment_intent.rb +28 -0
  48. data/lib/stripe/resources/payment_method.rb +1 -1
  49. data/lib/stripe/resources/payment_record.rb +2 -2
  50. data/lib/stripe/resources/person.rb +2 -2
  51. data/lib/stripe/resources/quote.rb +22 -1
  52. data/lib/stripe/resources/quote_preview_invoice.rb +3 -0
  53. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +44 -2
  54. data/lib/stripe/resources/setup_attempt.rb +16 -0
  55. data/lib/stripe/resources/setup_intent.rb +3 -0
  56. data/lib/stripe/resources/shared_payment/granted_token.rb +1 -1
  57. data/lib/stripe/resources/subscription_schedule.rb +44 -2
  58. data/lib/stripe/resources/tax/registration.rb +32 -0
  59. data/lib/stripe/resources/terminal/reader.rb +173 -0
  60. data/lib/stripe/resources/v2/billing/contract.rb +47 -330
  61. data/lib/stripe/resources/v2/billing/contract_pricing_line_quantity_change.rb +2 -2
  62. data/lib/stripe/resources/v2/core/account.rb +18 -0
  63. data/lib/stripe/resources/v2/money_management/payout_method.rb +16 -0
  64. data/lib/stripe/resources/v2/money_management/received_credit.rb +30 -0
  65. data/lib/stripe/resources.rb +15 -0
  66. data/lib/stripe/services/account_service.rb +1 -1
  67. data/lib/stripe/services/dispute_service.rb +1 -1
  68. data/lib/stripe/services/terminal/reader_service.rb +44 -0
  69. data/lib/stripe/services/v2/billing/contract_service.rb +7 -7
  70. data/lib/stripe/stripe_event_notification_handler.rb +30 -0
  71. data/lib/stripe/version.rb +1 -1
  72. data/rbi/stripe.rbi +1039 -1148
  73. metadata +11 -2
@@ -77,7 +77,7 @@ module Stripe
77
77
  @interval_count = interval_count
78
78
  end
79
79
  end
80
- # The number of time units before the invoice is past due.
80
+ # How long the customer has to pay the invoice before it's past due.
81
81
  attr_accessor :time_until_due
82
82
 
83
83
  def initialize(time_until_due: nil)
@@ -108,7 +108,7 @@ module Stripe
108
108
  end
109
109
 
110
110
  class CollectionSettingsDetails < ::Stripe::RequestParams
111
- # The collection method.
111
+ # How payment is collected for the contract.
112
112
  attr_accessor :collection_method
113
113
  # The payment method configuration.
114
114
  attr_accessor :payment_method_configuration
@@ -136,35 +136,6 @@ module Stripe
136
136
  end
137
137
  end
138
138
 
139
- class OneTimeFee < ::Stripe::RequestParams
140
- class BillAt < ::Stripe::RequestParams
141
- # The timestamp at which the entry should be billed. Required if `type` is `timestamp`.
142
- attr_accessor :timestamp
143
- # The type of the bill_at.
144
- attr_accessor :type
145
-
146
- def initialize(timestamp: nil, type: nil)
147
- @timestamp = timestamp
148
- @type = type
149
- end
150
- end
151
- # The amount to bill.
152
- attr_accessor :amount
153
- # When this fee should be billed.
154
- attr_accessor :bill_at
155
- # A user-provided lookup key.
156
- attr_accessor :lookup_key
157
- # The ID of the v1 Product for this fee.
158
- attr_accessor :product
159
-
160
- def initialize(amount: nil, bill_at: nil, lookup_key: nil, product: nil)
161
- @amount = amount
162
- @bill_at = bill_at
163
- @lookup_key = lookup_key
164
- @product = product
165
- end
166
- end
167
-
168
139
  class PricingLine < ::Stripe::RequestParams
169
140
  class EndsAt < ::Stripe::RequestParams
170
141
  # The timestamp when the item ends. Required if `type` is `timestamp`.
@@ -194,53 +165,12 @@ module Stripe
194
165
  end
195
166
 
196
167
  class OverwritePrice < ::Stripe::RequestParams
197
- class Tier < ::Stripe::RequestParams
198
- # Price for the entire tier, represented as a decimal string in minor currency units.
199
- attr_accessor :flat_amount
200
- # Per-unit price for units included in this tier, represented as a decimal string in minor currency units.
201
- attr_accessor :unit_amount
202
- # Up to and including this quantity will be contained in the tier.
203
- attr_accessor :up_to_decimal
204
- # No upper bound to this tier.
205
- attr_accessor :up_to_inf
206
-
207
- def initialize(
208
- flat_amount: nil,
209
- unit_amount: nil,
210
- up_to_decimal: nil,
211
- up_to_inf: nil
212
- )
213
- @flat_amount = flat_amount
214
- @unit_amount = unit_amount
215
- @up_to_decimal = up_to_decimal
216
- @up_to_inf = up_to_inf
217
- end
218
-
219
- def self.field_encodings
220
- @field_encodings = { up_to_decimal: :decimal_string }
221
- end
222
- end
223
- # Defines whether the tiered price should be graduated or volume-based.
224
- attr_accessor :tiering_mode
225
- # Each element represents a pricing tier.
226
- attr_accessor :tiers
227
168
  # The per-unit amount to be charged, represented as a decimal string in minor currency units.
228
169
  attr_accessor :unit_amount
229
170
 
230
- def initialize(tiering_mode: nil, tiers: nil, unit_amount: nil)
231
- @tiering_mode = tiering_mode
232
- @tiers = tiers
171
+ def initialize(unit_amount: nil)
233
172
  @unit_amount = unit_amount
234
173
  end
235
-
236
- def self.field_encodings
237
- @field_encodings = {
238
- tiers: {
239
- kind: :array,
240
- element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
241
- },
242
- }
243
- end
244
174
  end
245
175
 
246
176
  class StartsAt < ::Stripe::RequestParams
@@ -266,7 +196,7 @@ module Stripe
266
196
  attr_accessor :priority
267
197
  # When the override starts. Defaults to the pricing line's start if not specified.
268
198
  attr_accessor :starts_at
269
- # The type of override. Currently only `overwrite_price` is supported.
199
+ # The type of override.
270
200
  attr_accessor :type
271
201
 
272
202
  def initialize(
@@ -286,20 +216,6 @@ module Stripe
286
216
  @starts_at = starts_at
287
217
  @type = type
288
218
  end
289
-
290
- def self.field_encodings
291
- @field_encodings = {
292
- overwrite_price: {
293
- kind: :object,
294
- fields: {
295
- tiers: {
296
- kind: :array,
297
- element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
298
- },
299
- },
300
- },
301
- }
302
- end
303
219
  end
304
220
 
305
221
  class QuantityChange < ::Stripe::RequestParams
@@ -328,12 +244,12 @@ module Stripe
328
244
  @field_encodings = { set: :decimal_string }
329
245
  end
330
246
  end
331
- # The ID of the V1 price.
247
+ # The id of the price.
332
248
  attr_accessor :price
333
249
  # Pricing overrides embedded directly on this pricing line.
334
250
  attr_accessor :pricing_overrides
335
251
  # Quantity changes for the pricing line. For now, at most one entry is allowed.
336
- # A quantity change clears all future quantity changes on this pricing line.
252
+ # A quantity change clears all future quantity changes on this pricing line. Defaults to 1.
337
253
  attr_accessor :quantity_changes
338
254
 
339
255
  def initialize(price: nil, pricing_overrides: nil, quantity_changes: nil)
@@ -344,23 +260,6 @@ module Stripe
344
260
 
345
261
  def self.field_encodings
346
262
  @field_encodings = {
347
- pricing_overrides: {
348
- kind: :array,
349
- element: {
350
- kind: :object,
351
- fields: {
352
- overwrite_price: {
353
- kind: :object,
354
- fields: {
355
- tiers: {
356
- kind: :array,
357
- element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
358
- },
359
- },
360
- },
361
- },
362
- },
363
- },
364
263
  quantity_changes: {
365
264
  kind: :array,
366
265
  element: { kind: :object, fields: { set: :decimal_string } },
@@ -383,23 +282,6 @@ module Stripe
383
282
  price_details: {
384
283
  kind: :object,
385
284
  fields: {
386
- pricing_overrides: {
387
- kind: :array,
388
- element: {
389
- kind: :object,
390
- fields: {
391
- overwrite_price: {
392
- kind: :object,
393
- fields: {
394
- tiers: {
395
- kind: :array,
396
- element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
397
- },
398
- },
399
- },
400
- },
401
- },
402
- },
403
285
  quantity_changes: {
404
286
  kind: :array,
405
287
  element: { kind: :object, fields: { set: :decimal_string } },
@@ -448,26 +330,6 @@ module Stripe
448
330
  price_details: {
449
331
  kind: :object,
450
332
  fields: {
451
- pricing_overrides: {
452
- kind: :array,
453
- element: {
454
- kind: :object,
455
- fields: {
456
- overwrite_price: {
457
- kind: :object,
458
- fields: {
459
- tiers: {
460
- kind: :array,
461
- element: {
462
- kind: :object,
463
- fields: { up_to_decimal: :decimal_string },
464
- },
465
- },
466
- },
467
- },
468
- },
469
- },
470
- },
471
333
  quantity_changes: {
472
334
  kind: :array,
473
335
  element: { kind: :object, fields: { set: :decimal_string } },
@@ -493,7 +355,7 @@ module Stripe
493
355
  end
494
356
  end
495
357
 
496
- class Multiplier < ::Stripe::RequestParams
358
+ class MultiplyPricing < ::Stripe::RequestParams
497
359
  class Criterion < ::Stripe::RequestParams
498
360
  # Filter by pricing line IDs.
499
361
  attr_accessor :pricing_line_ids
@@ -508,9 +370,9 @@ module Stripe
508
370
  @type = type
509
371
  end
510
372
  end
511
- # Criteria determining which rates the multiplier applies to.
373
+ # Criteria determining which rates the multiply_pricing override applies to.
512
374
  attr_accessor :criteria
513
- # The multiplier factor, represented as a decimal string. e.g. "0.8" for a 20% reduction.
375
+ # The multiply_pricing factor, represented as a decimal string. e.g. "0.8" for a 20% reduction.
514
376
  attr_accessor :factor
515
377
 
516
378
  def initialize(criteria: nil, factor: nil)
@@ -534,8 +396,8 @@ module Stripe
534
396
  attr_accessor :ends_at
535
397
  # A user-provided lookup key to reference this pricing override.
536
398
  attr_accessor :lookup_key
537
- # Parameters for a multiplier override. Required if `type` is `multiplier`.
538
- attr_accessor :multiplier
399
+ # Parameters for a multiply_pricing override. Required if `type` is `multiply_pricing`.
400
+ attr_accessor :multiply_pricing
539
401
  # The priority of this override relative to others. The highest priority is 0 and the lowest is 100.
540
402
  attr_accessor :priority
541
403
  # When the pricing override starts.
@@ -546,14 +408,14 @@ module Stripe
546
408
  def initialize(
547
409
  ends_at: nil,
548
410
  lookup_key: nil,
549
- multiplier: nil,
411
+ multiply_pricing: nil,
550
412
  priority: nil,
551
413
  starts_at: nil,
552
414
  type: nil
553
415
  )
554
416
  @ends_at = ends_at
555
417
  @lookup_key = lookup_key
556
- @multiplier = multiplier
418
+ @multiply_pricing = multiply_pricing
557
419
  @priority = priority
558
420
  @starts_at = starts_at
559
421
  @type = type
@@ -572,8 +434,6 @@ module Stripe
572
434
  attr_accessor :include
573
435
  # Set of key-value pairs that you can attach to an object.
574
436
  attr_accessor :metadata
575
- # A list of one-time fees to create with the contract. Each fee is billed as individual invoice items per its bill_schedule.
576
- attr_accessor :one_time_fees
577
437
  # A list of pricing lines to create with the contract.
578
438
  attr_accessor :pricing_lines
579
439
  # A list of pricing overrides to create with the contract.
@@ -586,7 +446,6 @@ module Stripe
586
446
  currency: nil,
587
447
  include: nil,
588
448
  metadata: nil,
589
- one_time_fees: nil,
590
449
  pricing_lines: nil,
591
450
  pricing_overrides: nil
592
451
  )
@@ -596,7 +455,6 @@ module Stripe
596
455
  @currency = currency
597
456
  @include = include
598
457
  @metadata = metadata
599
- @one_time_fees = one_time_fees
600
458
  @pricing_lines = pricing_lines
601
459
  @pricing_overrides = pricing_overrides
602
460
  end
@@ -614,26 +472,6 @@ module Stripe
614
472
  price_details: {
615
473
  kind: :object,
616
474
  fields: {
617
- pricing_overrides: {
618
- kind: :array,
619
- element: {
620
- kind: :object,
621
- fields: {
622
- overwrite_price: {
623
- kind: :object,
624
- fields: {
625
- tiers: {
626
- kind: :array,
627
- element: {
628
- kind: :object,
629
- fields: { up_to_decimal: :decimal_string },
630
- },
631
- },
632
- },
633
- },
634
- },
635
- },
636
- },
637
475
  quantity_changes: {
638
476
  kind: :array,
639
477
  element: { kind: :object, fields: { set: :decimal_string } },
@@ -5,7 +5,7 @@ module Stripe
5
5
  module V2
6
6
  module Billing
7
7
  class ContractListParams < ::Stripe::RequestParams
8
- # Filter by customer ID.
8
+ # Filter by customer id.
9
9
  attr_accessor :customer
10
10
  # Additional fields to include in the response.
11
11
  attr_accessor :include