stripe 15.3.0 → 15.4.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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +21 -1
  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/account.rb +5 -5
  8. data/lib/stripe/resources/account_link.rb +3 -1
  9. data/lib/stripe/resources/account_session.rb +51 -0
  10. data/lib/stripe/resources/billing/credit_grant.rb +1 -1
  11. data/lib/stripe/resources/billing_portal/configuration.rb +46 -2
  12. data/lib/stripe/resources/charge.rb +7 -5
  13. data/lib/stripe/resources/checkout/session.rb +32 -4
  14. data/lib/stripe/resources/confirmation_token.rb +3 -3
  15. data/lib/stripe/resources/customer.rb +1 -1
  16. data/lib/stripe/resources/dispute.rb +1 -1
  17. data/lib/stripe/resources/event.rb +14 -26
  18. data/lib/stripe/resources/invoice.rb +24 -8
  19. data/lib/stripe/resources/invoice_item.rb +1 -1
  20. data/lib/stripe/resources/payment_intent.rb +14 -4
  21. data/lib/stripe/resources/payment_link.rb +83 -5
  22. data/lib/stripe/resources/payment_method.rb +4 -4
  23. data/lib/stripe/resources/quote.rb +1 -1
  24. data/lib/stripe/resources/radar/value_list.rb +2 -2
  25. data/lib/stripe/resources/refund.rb +1 -1
  26. data/lib/stripe/resources/review.rb +2 -2
  27. data/lib/stripe/resources/setup_attempt.rb +1 -1
  28. data/lib/stripe/resources/subscription.rb +2 -2
  29. data/lib/stripe/resources/subscription_item.rb +2 -2
  30. data/lib/stripe/resources/subscription_schedule.rb +35 -3
  31. data/lib/stripe/resources/tax/registration.rb +408 -30
  32. data/lib/stripe/resources/terminal/configuration.rb +196 -0
  33. data/lib/stripe/services/account_link_service.rb +3 -1
  34. data/lib/stripe/services/account_service.rb +3 -3
  35. data/lib/stripe/services/account_session_service.rb +34 -0
  36. data/lib/stripe/services/billing/credit_grant_service.rb +1 -1
  37. data/lib/stripe/services/billing_portal/configuration_service.rb +36 -2
  38. data/lib/stripe/services/checkout/session_service.rb +19 -3
  39. data/lib/stripe/services/invoice_item_service.rb +1 -1
  40. data/lib/stripe/services/invoice_service.rb +24 -8
  41. data/lib/stripe/services/payment_intent_service.rb +8 -3
  42. data/lib/stripe/services/payment_link_service.rb +81 -5
  43. data/lib/stripe/services/payment_method_service.rb +1 -1
  44. data/lib/stripe/services/quote_service.rb +1 -1
  45. data/lib/stripe/services/radar/value_list_service.rb +1 -1
  46. data/lib/stripe/services/subscription_item_service.rb +2 -2
  47. data/lib/stripe/services/subscription_schedule_service.rb +35 -3
  48. data/lib/stripe/services/subscription_service.rb +2 -2
  49. data/lib/stripe/services/tax/registration_service.rb +360 -30
  50. data/lib/stripe/services/terminal/configuration_service.rb +152 -0
  51. data/lib/stripe/version.rb +1 -1
  52. data/rbi/stripe/resources/account.rbi +5 -5
  53. data/rbi/stripe/resources/account_link.rbi +3 -1
  54. data/rbi/stripe/resources/account_session.rbi +62 -1
  55. data/rbi/stripe/resources/billing/credit_grant.rbi +1 -1
  56. data/rbi/stripe/resources/billing_portal/configuration.rbi +62 -4
  57. data/rbi/stripe/resources/charge.rbi +8 -5
  58. data/rbi/stripe/resources/checkout/session.rbi +42 -7
  59. data/rbi/stripe/resources/confirmation_token.rbi +3 -3
  60. data/rbi/stripe/resources/customer.rbi +1 -1
  61. data/rbi/stripe/resources/dispute.rbi +1 -1
  62. data/rbi/stripe/resources/event.rbi +14 -26
  63. data/rbi/stripe/resources/invoice.rbi +27 -11
  64. data/rbi/stripe/resources/invoice_item.rbi +1 -1
  65. data/rbi/stripe/resources/payment_intent.rbi +14 -4
  66. data/rbi/stripe/resources/payment_link.rbi +101 -9
  67. data/rbi/stripe/resources/payment_method.rbi +4 -4
  68. data/rbi/stripe/resources/quote.rbi +1 -1
  69. data/rbi/stripe/resources/radar/value_list.rbi +2 -2
  70. data/rbi/stripe/resources/refund.rbi +1 -1
  71. data/rbi/stripe/resources/review.rbi +2 -2
  72. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  73. data/rbi/stripe/resources/subscription.rbi +6 -6
  74. data/rbi/stripe/resources/subscription_item.rbi +2 -2
  75. data/rbi/stripe/resources/subscription_schedule.rbi +33 -5
  76. data/rbi/stripe/resources/tax/registration.rbi +544 -60
  77. data/rbi/stripe/resources/terminal/configuration.rbi +210 -2
  78. data/rbi/stripe/services/account_link_service.rbi +3 -1
  79. data/rbi/stripe/services/account_service.rbi +3 -3
  80. data/rbi/stripe/services/account_session_service.rbi +40 -1
  81. data/rbi/stripe/services/billing/credit_grant_service.rbi +1 -1
  82. data/rbi/stripe/services/billing_portal/configuration_service.rbi +48 -4
  83. data/rbi/stripe/services/checkout/session_service.rbi +26 -6
  84. data/rbi/stripe/services/invoice_item_service.rbi +1 -1
  85. data/rbi/stripe/services/invoice_service.rbi +27 -11
  86. data/rbi/stripe/services/payment_intent_service.rbi +8 -3
  87. data/rbi/stripe/services/payment_link_service.rbi +98 -9
  88. data/rbi/stripe/services/payment_method_service.rbi +1 -1
  89. data/rbi/stripe/services/quote_service.rbi +1 -1
  90. data/rbi/stripe/services/radar/value_list_service.rbi +1 -1
  91. data/rbi/stripe/services/subscription_item_service.rbi +2 -2
  92. data/rbi/stripe/services/subscription_schedule_service.rbi +37 -5
  93. data/rbi/stripe/services/subscription_service.rbi +6 -6
  94. data/rbi/stripe/services/tax/registration_service.rbi +480 -60
  95. data/rbi/stripe/services/terminal/configuration_service.rbi +170 -2
  96. metadata +2 -2
@@ -143,7 +143,7 @@ module Stripe
143
143
  @plan = plan
144
144
  end
145
145
  end
146
- # Installment configuration for payments attempted on this invoice (Mexico Only).
146
+ # Installment configuration for payments attempted on this invoice.
147
147
  #
148
148
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
149
149
  attr_accessor :installments
@@ -468,7 +468,7 @@ module Stripe
468
468
  attr_accessor :auto_advance
469
469
  # Settings for automatic tax lookup for this invoice.
470
470
  attr_accessor :automatic_tax
471
- # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state. To turn off automatic finalization, set `auto_advance` to false.
471
+ # The time when this invoice should be scheduled to finalize (up to 5 years in the future). The invoice is finalized at this time if it's still in draft state. To turn off automatic finalization, set `auto_advance` to false.
472
472
  attr_accessor :automatically_finalizes_at
473
473
  # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
474
474
  attr_accessor :collection_method
@@ -790,7 +790,7 @@ module Stripe
790
790
  @plan = plan
791
791
  end
792
792
  end
793
- # Installment configuration for payments attempted on this invoice (Mexico Only).
793
+ # Installment configuration for payments attempted on this invoice.
794
794
  #
795
795
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
796
796
  attr_accessor :installments
@@ -1111,11 +1111,11 @@ module Stripe
1111
1111
  attr_accessor :account_tax_ids
1112
1112
  # A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
1113
1113
  attr_accessor :application_fee_amount
1114
- # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
1114
+ # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. Defaults to false.
1115
1115
  attr_accessor :auto_advance
1116
1116
  # Settings for automatic tax lookup for this invoice.
1117
1117
  attr_accessor :automatic_tax
1118
- # The time when this invoice should be scheduled to finalize. The invoice will be finalized at this time if it is still in draft state.
1118
+ # The time when this invoice should be scheduled to finalize (up to 5 years in the future). The invoice is finalized at this time if it's still in draft state.
1119
1119
  attr_accessor :automatically_finalizes_at
1120
1120
  # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.
1121
1121
  attr_accessor :collection_method
@@ -2111,7 +2111,7 @@ module Stripe
2111
2111
 
2112
2112
  class ScheduleDetails < Stripe::RequestParams
2113
2113
  class BillingMode < Stripe::RequestParams
2114
- # Attribute for param field type
2114
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2115
2115
  attr_accessor :type
2116
2116
 
2117
2117
  def initialize(type: nil)
@@ -2238,6 +2238,18 @@ module Stripe
2238
2238
  end
2239
2239
  end
2240
2240
 
2241
+ class Duration < Stripe::RequestParams
2242
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
2243
+ attr_accessor :interval
2244
+ # The multiplier applied to the interval.
2245
+ attr_accessor :interval_count
2246
+
2247
+ def initialize(interval: nil, interval_count: nil)
2248
+ @interval = interval
2249
+ @interval_count = interval_count
2250
+ end
2251
+ end
2252
+
2241
2253
  class InvoiceSettings < Stripe::RequestParams
2242
2254
  class Issuer < Stripe::RequestParams
2243
2255
  # The connected account being referenced when `type` is `account`.
@@ -2401,13 +2413,15 @@ module Stripe
2401
2413
  attr_accessor :description
2402
2414
  # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
2403
2415
  attr_accessor :discounts
2416
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
2417
+ attr_accessor :duration
2404
2418
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
2405
2419
  attr_accessor :end_date
2406
2420
  # All invoices will be billed using the specified settings.
2407
2421
  attr_accessor :invoice_settings
2408
2422
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
2409
2423
  attr_accessor :items
2410
- # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
2424
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. This parameter is deprecated and will be removed in a future version. Use `duration` instead.
2411
2425
  attr_accessor :iterations
2412
2426
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
2413
2427
  attr_accessor :metadata
@@ -2436,6 +2450,7 @@ module Stripe
2436
2450
  default_tax_rates: nil,
2437
2451
  description: nil,
2438
2452
  discounts: nil,
2453
+ duration: nil,
2439
2454
  end_date: nil,
2440
2455
  invoice_settings: nil,
2441
2456
  items: nil,
@@ -2459,6 +2474,7 @@ module Stripe
2459
2474
  @default_tax_rates = default_tax_rates
2460
2475
  @description = description
2461
2476
  @discounts = discounts
2477
+ @duration = duration
2462
2478
  @end_date = end_date
2463
2479
  @invoice_settings = invoice_settings
2464
2480
  @items = items
@@ -2491,7 +2507,7 @@ module Stripe
2491
2507
 
2492
2508
  class SubscriptionDetails < Stripe::RequestParams
2493
2509
  class BillingMode < Stripe::RequestParams
2494
- # Attribute for param field type
2510
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2495
2511
  attr_accessor :type
2496
2512
 
2497
2513
  def initialize(type: nil)
@@ -1067,7 +1067,7 @@ module Stripe
1067
1067
  attr_accessor :capture_method
1068
1068
  # A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.
1069
1069
  attr_accessor :cvc_token
1070
- # Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
1070
+ # Installment configuration for payments attempted on this PaymentIntent.
1071
1071
  #
1072
1072
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
1073
1073
  attr_accessor :installments
@@ -3464,7 +3464,7 @@ module Stripe
3464
3464
  attr_accessor :capture_method
3465
3465
  # A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.
3466
3466
  attr_accessor :cvc_token
3467
- # Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
3467
+ # Installment configuration for payments attempted on this PaymentIntent.
3468
3468
  #
3469
3469
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
3470
3470
  attr_accessor :installments
@@ -5913,7 +5913,7 @@ module Stripe
5913
5913
  attr_accessor :capture_method
5914
5914
  # A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.
5915
5915
  attr_accessor :cvc_token
5916
- # Installment configuration for payments attempted on this PaymentIntent (Mexico Only).
5916
+ # Installment configuration for payments attempted on this PaymentIntent.
5917
5917
  #
5918
5918
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
5919
5919
  attr_accessor :installments
@@ -7351,6 +7351,7 @@ module Stripe
7351
7351
  # Confirm that your customer intends to pay with current or provided
7352
7352
  # payment method. Upon confirmation, the PaymentIntent will attempt to initiate
7353
7353
  # a payment.
7354
+ #
7354
7355
  # If the selected payment method requires additional authentication steps, the
7355
7356
  # PaymentIntent will transition to the requires_action status and
7356
7357
  # suggest additional actions via next_action. If payment fails,
@@ -7358,18 +7359,22 @@ module Stripe
7358
7359
  # canceled status if the confirmation limit is reached. If
7359
7360
  # payment succeeds, the PaymentIntent will transition to the succeeded
7360
7361
  # status (or requires_capture, if capture_method is set to manual).
7362
+ #
7361
7363
  # If the confirmation_method is automatic, payment may be attempted
7362
7364
  # using our [client SDKs](https://docs.stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
7363
7365
  # and the PaymentIntent's [client_secret](https://docs.stripe.com/api#payment_intent_object-client_secret).
7364
7366
  # After next_actions are handled by the client, no additional
7365
7367
  # confirmation is required to complete the payment.
7368
+ #
7366
7369
  # If the confirmation_method is manual, all payment attempts must be
7367
7370
  # initiated using a secret key.
7371
+ #
7368
7372
  # If any actions are required for the payment, the PaymentIntent will
7369
7373
  # return to the requires_confirmation state
7370
7374
  # after those actions are completed. Your server needs to then
7371
7375
  # explicitly re-confirm the PaymentIntent to initiate the next payment
7372
7376
  # attempt.
7377
+ #
7373
7378
  # There is a variable upper limit on how many times a PaymentIntent can be confirmed.
7374
7379
  # After this limit is reached, any further calls to this endpoint will
7375
7380
  # transition the PaymentIntent to the canceled state.
@@ -302,9 +302,12 @@ module Stripe
302
302
  class RenderingOptions < Stripe::RequestParams
303
303
  # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
304
304
  attr_accessor :amount_tax_display
305
+ # ID of the invoice rendering template to use for this invoice.
306
+ attr_accessor :template
305
307
 
306
- def initialize(amount_tax_display: nil)
308
+ def initialize(amount_tax_display: nil, template: nil)
307
309
  @amount_tax_display = amount_tax_display
310
+ @template = template
308
311
  end
309
312
  end
310
313
  # The account tax IDs associated with the invoice.
@@ -355,7 +358,7 @@ module Stripe
355
358
  class AdjustableQuantity < Stripe::RequestParams
356
359
  # Set to true if the quantity can be adjusted to any non-negative Integer.
357
360
  attr_accessor :enabled
358
- # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
361
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999999.
359
362
  attr_accessor :maximum
360
363
  # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
361
364
  attr_accessor :minimum
@@ -366,16 +369,86 @@ module Stripe
366
369
  @minimum = minimum
367
370
  end
368
371
  end
372
+
373
+ class PriceData < Stripe::RequestParams
374
+ class ProductData < Stripe::RequestParams
375
+ # 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.
376
+ attr_accessor :description
377
+ # A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
378
+ attr_accessor :images
379
+ # 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`.
380
+ attr_accessor :metadata
381
+ # The product's name, meant to be displayable to the customer.
382
+ attr_accessor :name
383
+ # A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
384
+ attr_accessor :tax_code
385
+
386
+ def initialize(description: nil, images: nil, metadata: nil, name: nil, tax_code: nil)
387
+ @description = description
388
+ @images = images
389
+ @metadata = metadata
390
+ @name = name
391
+ @tax_code = tax_code
392
+ end
393
+ end
394
+
395
+ class Recurring < Stripe::RequestParams
396
+ # Specifies billing frequency. Either `day`, `week`, `month` or `year`.
397
+ attr_accessor :interval
398
+ # The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
399
+ attr_accessor :interval_count
400
+
401
+ def initialize(interval: nil, interval_count: nil)
402
+ @interval = interval
403
+ @interval_count = interval_count
404
+ end
405
+ end
406
+ # 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).
407
+ attr_accessor :currency
408
+ # The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
409
+ attr_accessor :product
410
+ # Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
411
+ attr_accessor :product_data
412
+ # The recurring components of a price such as `interval` and `interval_count`.
413
+ attr_accessor :recurring
414
+ # 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.
415
+ attr_accessor :tax_behavior
416
+ # A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.
417
+ attr_accessor :unit_amount
418
+ # 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.
419
+ attr_accessor :unit_amount_decimal
420
+
421
+ def initialize(
422
+ currency: nil,
423
+ product: nil,
424
+ product_data: nil,
425
+ recurring: nil,
426
+ tax_behavior: nil,
427
+ unit_amount: nil,
428
+ unit_amount_decimal: nil
429
+ )
430
+ @currency = currency
431
+ @product = product
432
+ @product_data = product_data
433
+ @recurring = recurring
434
+ @tax_behavior = tax_behavior
435
+ @unit_amount = unit_amount
436
+ @unit_amount_decimal = unit_amount_decimal
437
+ end
438
+ end
369
439
  # When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.
370
440
  attr_accessor :adjustable_quantity
371
441
  # The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.
372
442
  attr_accessor :price
443
+ # Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
444
+ attr_accessor :price_data
373
445
  # The quantity of the line item being purchased.
374
446
  attr_accessor :quantity
375
447
 
376
- def initialize(adjustable_quantity: nil, price: nil, quantity: nil)
448
+ def initialize(adjustable_quantity: nil, price: nil, price_data: nil, quantity: nil)
377
449
  @adjustable_quantity = adjustable_quantity
378
450
  @price = price
451
+ @price_data = price_data
379
452
  @quantity = quantity
380
453
  end
381
454
  end
@@ -973,9 +1046,12 @@ module Stripe
973
1046
  class RenderingOptions < Stripe::RequestParams
974
1047
  # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
975
1048
  attr_accessor :amount_tax_display
1049
+ # ID of the invoice rendering template to use for this invoice.
1050
+ attr_accessor :template
976
1051
 
977
- def initialize(amount_tax_display: nil)
1052
+ def initialize(amount_tax_display: nil, template: nil)
978
1053
  @amount_tax_display = amount_tax_display
1054
+ @template = template
979
1055
  end
980
1056
  end
981
1057
  # The account tax IDs associated with the invoice.
@@ -1026,7 +1102,7 @@ module Stripe
1026
1102
  class AdjustableQuantity < Stripe::RequestParams
1027
1103
  # Set to true if the quantity can be adjusted to any non-negative Integer.
1028
1104
  attr_accessor :enabled
1029
- # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.
1105
+ # The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999999.
1030
1106
  attr_accessor :maximum
1031
1107
  # The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.
1032
1108
  attr_accessor :minimum
@@ -834,7 +834,7 @@ module Stripe
834
834
  )
835
835
  end
836
836
 
837
- # Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
837
+ # Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated.
838
838
  def update(payment_method, params = {}, opts = {})
839
839
  request(
840
840
  method: :post,
@@ -199,7 +199,7 @@ module Stripe
199
199
 
200
200
  class SubscriptionData < Stripe::RequestParams
201
201
  class BillingMode < Stripe::RequestParams
202
- # Attribute for param field type
202
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
203
203
  attr_accessor :type
204
204
 
205
205
  def initialize(type: nil)
@@ -90,7 +90,7 @@ module Stripe
90
90
  attr_accessor :alias
91
91
  # Specifies which fields in the response should be expanded.
92
92
  attr_accessor :expand
93
- # Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed.
93
+ # Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. Use `string` if the item type is unknown or mixed.
94
94
  attr_accessor :item_type
95
95
  # 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`.
96
96
  attr_accessor :metadata
@@ -109,7 +109,7 @@ module Stripe
109
109
  #
110
110
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
111
111
  #
112
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
112
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
113
113
  attr_accessor :payment_behavior
114
114
  # The identifier of the new plan for this subscription item.
115
115
  attr_accessor :plan
@@ -264,7 +264,7 @@ module Stripe
264
264
  #
265
265
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
266
266
  #
267
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
267
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
268
268
  attr_accessor :payment_behavior
269
269
  # The identifier of the plan to add to the subscription.
270
270
  attr_accessor :plan
@@ -123,7 +123,7 @@ module Stripe
123
123
 
124
124
  class CreateParams < Stripe::RequestParams
125
125
  class BillingMode < Stripe::RequestParams
126
- # Attribute for param field type
126
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
127
127
  attr_accessor :type
128
128
 
129
129
  def initialize(type: nil)
@@ -363,6 +363,18 @@ module Stripe
363
363
  end
364
364
  end
365
365
 
366
+ class Duration < Stripe::RequestParams
367
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
368
+ attr_accessor :interval
369
+ # The multiplier applied to the interval.
370
+ attr_accessor :interval_count
371
+
372
+ def initialize(interval: nil, interval_count: nil)
373
+ @interval = interval
374
+ @interval_count = interval_count
375
+ end
376
+ end
377
+
366
378
  class InvoiceSettings < Stripe::RequestParams
367
379
  class Issuer < Stripe::RequestParams
368
380
  # The connected account being referenced when `type` is `account`.
@@ -526,13 +538,15 @@ module Stripe
526
538
  attr_accessor :description
527
539
  # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
528
540
  attr_accessor :discounts
541
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
542
+ attr_accessor :duration
529
543
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
530
544
  attr_accessor :end_date
531
545
  # All invoices will be billed using the specified settings.
532
546
  attr_accessor :invoice_settings
533
547
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
534
548
  attr_accessor :items
535
- # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
549
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. This parameter is deprecated and will be removed in a future version. Use `duration` instead.
536
550
  attr_accessor :iterations
537
551
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
538
552
  attr_accessor :metadata
@@ -559,6 +573,7 @@ module Stripe
559
573
  default_tax_rates: nil,
560
574
  description: nil,
561
575
  discounts: nil,
576
+ duration: nil,
562
577
  end_date: nil,
563
578
  invoice_settings: nil,
564
579
  items: nil,
@@ -581,6 +596,7 @@ module Stripe
581
596
  @default_tax_rates = default_tax_rates
582
597
  @description = description
583
598
  @discounts = discounts
599
+ @duration = duration
584
600
  @end_date = end_date
585
601
  @invoice_settings = invoice_settings
586
602
  @items = items
@@ -877,6 +893,18 @@ module Stripe
877
893
  end
878
894
  end
879
895
 
896
+ class Duration < Stripe::RequestParams
897
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
898
+ attr_accessor :interval
899
+ # The multiplier applied to the interval.
900
+ attr_accessor :interval_count
901
+
902
+ def initialize(interval: nil, interval_count: nil)
903
+ @interval = interval
904
+ @interval_count = interval_count
905
+ end
906
+ end
907
+
880
908
  class InvoiceSettings < Stripe::RequestParams
881
909
  class Issuer < Stripe::RequestParams
882
910
  # The connected account being referenced when `type` is `account`.
@@ -1040,13 +1068,15 @@ module Stripe
1040
1068
  attr_accessor :description
1041
1069
  # The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts.
1042
1070
  attr_accessor :discounts
1071
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
1072
+ attr_accessor :duration
1043
1073
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1044
1074
  attr_accessor :end_date
1045
1075
  # All invoices will be billed using the specified settings.
1046
1076
  attr_accessor :invoice_settings
1047
1077
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1048
1078
  attr_accessor :items
1049
- # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.
1079
+ # Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. This parameter is deprecated and will be removed in a future version. Use `duration` instead.
1050
1080
  attr_accessor :iterations
1051
1081
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.
1052
1082
  attr_accessor :metadata
@@ -1075,6 +1105,7 @@ module Stripe
1075
1105
  default_tax_rates: nil,
1076
1106
  description: nil,
1077
1107
  discounts: nil,
1108
+ duration: nil,
1078
1109
  end_date: nil,
1079
1110
  invoice_settings: nil,
1080
1111
  items: nil,
@@ -1098,6 +1129,7 @@ module Stripe
1098
1129
  @default_tax_rates = default_tax_rates
1099
1130
  @description = description
1100
1131
  @discounts = discounts
1132
+ @duration = duration
1101
1133
  @end_date = end_date
1102
1134
  @invoice_settings = invoice_settings
1103
1135
  @items = items
@@ -585,7 +585,7 @@ module Stripe
585
585
  #
586
586
  # Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).
587
587
  #
588
- # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.
588
+ # Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://docs.stripe.com/changelog/2019-03-14) to learn more.
589
589
  attr_accessor :payment_behavior
590
590
  # Payment settings to pass to invoices created by the subscription.
591
591
  attr_accessor :payment_settings
@@ -906,7 +906,7 @@ module Stripe
906
906
  end
907
907
 
908
908
  class BillingMode < Stripe::RequestParams
909
- # Attribute for param field type
909
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
910
910
  attr_accessor :type
911
911
 
912
912
  def initialize(type: nil)