stripe 15.4.0.pre.beta.2 → 15.5.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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -1
  3. data/CHANGELOG.md +61 -5
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +1 -1
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_version.rb +1 -1
  8. data/lib/stripe/event_types.rb +2 -2
  9. data/lib/stripe/events/{v2_core_account_link_completed_event.rb → v2_core_account_link_returned_event.rb} +2 -2
  10. data/lib/stripe/events/{v2_off_session_payment_requires_capture_event.rb → v2_money_management_payout_method_updated_event.rb} +3 -3
  11. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_failed_event.rb +1 -1
  12. data/lib/stripe/events/v2_payments_off_session_payment_authorization_attempt_started_event.rb +2 -1
  13. data/lib/stripe/events/v2_payments_off_session_payment_canceled_event.rb +1 -1
  14. data/lib/stripe/events/v2_payments_off_session_payment_created_event.rb +1 -1
  15. data/lib/stripe/events/v2_payments_off_session_payment_failed_event.rb +1 -1
  16. data/lib/stripe/events/v2_payments_off_session_payment_succeeded_event.rb +1 -1
  17. data/lib/stripe/object_types.rb +3 -0
  18. data/lib/stripe/resources/account.rb +5 -5
  19. data/lib/stripe/resources/account_link.rb +3 -1
  20. data/lib/stripe/resources/account_session.rb +51 -0
  21. data/lib/stripe/resources/balance_settings.rb +13 -13
  22. data/lib/stripe/resources/billing/credit_grant.rb +1 -1
  23. data/lib/stripe/resources/billing/meter_usage.rb +23 -0
  24. data/lib/stripe/resources/billing/meter_usage_row.rb +28 -0
  25. data/lib/stripe/resources/billing_portal/configuration.rb +46 -2
  26. data/lib/stripe/resources/charge.rb +7 -5
  27. data/lib/stripe/resources/checkout/session.rb +106 -6
  28. data/lib/stripe/resources/confirmation_token.rb +3 -3
  29. data/lib/stripe/resources/customer.rb +1 -1
  30. data/lib/stripe/resources/dispute.rb +10 -1
  31. data/lib/stripe/resources/event.rb +14 -26
  32. data/lib/stripe/resources/fx_quote.rb +6 -4
  33. data/lib/stripe/resources/invoice.rb +101 -8
  34. data/lib/stripe/resources/invoice_item.rb +1 -1
  35. data/lib/stripe/resources/payment_attempt_record.rb +6 -4
  36. data/lib/stripe/resources/payment_intent.rb +815 -4
  37. data/lib/stripe/resources/payment_link.rb +83 -5
  38. data/lib/stripe/resources/payment_method.rb +4 -4
  39. data/lib/stripe/resources/payment_record.rb +6 -4
  40. data/lib/stripe/resources/quote.rb +1 -1
  41. data/lib/stripe/resources/quote_preview_invoice.rb +17 -0
  42. data/lib/stripe/resources/radar/value_list.rb +2 -2
  43. data/lib/stripe/resources/refund.rb +1 -1
  44. data/lib/stripe/resources/review.rb +2 -2
  45. data/lib/stripe/resources/setup_attempt.rb +1 -1
  46. data/lib/stripe/resources/subscription.rb +79 -2
  47. data/lib/stripe/resources/subscription_item.rb +2 -2
  48. data/lib/stripe/resources/subscription_schedule.rb +35 -3
  49. data/lib/stripe/resources/tax/registration.rb +408 -30
  50. data/lib/stripe/resources/terminal/configuration.rb +196 -0
  51. data/lib/stripe/resources/terminal/onboarding_link.rb +84 -0
  52. data/lib/stripe/resources/v2/core/account.rb +11 -0
  53. data/lib/stripe/resources/v2/core/account_link.rb +18 -2
  54. data/lib/stripe/resources/v2/money_management/payout_method.rb +2 -0
  55. data/lib/stripe/resources/v2/payments/off_session_payment.rb +40 -23
  56. data/lib/stripe/resources.rb +5 -2
  57. data/lib/stripe/services/account_link_service.rb +3 -1
  58. data/lib/stripe/services/account_service.rb +3 -3
  59. data/lib/stripe/services/account_session_service.rb +34 -0
  60. data/lib/stripe/services/balance_settings_service.rb +10 -10
  61. data/lib/stripe/services/billing/credit_grant_service.rb +1 -1
  62. data/lib/stripe/services/billing/meter_usage_service.rb +76 -0
  63. data/lib/stripe/services/billing_portal/configuration_service.rb +36 -2
  64. data/lib/stripe/services/billing_service.rb +2 -1
  65. data/lib/stripe/services/checkout/session_service.rb +93 -5
  66. data/lib/stripe/services/invoice_item_service.rb +1 -1
  67. data/lib/stripe/services/invoice_service.rb +84 -8
  68. data/lib/stripe/services/payment_intent_service.rb +809 -3
  69. data/lib/stripe/services/payment_link_service.rb +81 -5
  70. data/lib/stripe/services/payment_method_service.rb +1 -1
  71. data/lib/stripe/services/quote_service.rb +1 -1
  72. data/lib/stripe/services/radar/value_list_service.rb +1 -1
  73. data/lib/stripe/services/subscription_item_service.rb +2 -2
  74. data/lib/stripe/services/subscription_schedule_service.rb +35 -3
  75. data/lib/stripe/services/subscription_service.rb +62 -2
  76. data/lib/stripe/services/tax/registration_service.rb +360 -30
  77. data/lib/stripe/services/terminal/configuration_service.rb +152 -0
  78. data/lib/stripe/services/terminal/onboarding_link_service.rb +56 -0
  79. data/lib/stripe/services/terminal_service.rb +2 -1
  80. data/lib/stripe/services/v2/core/account_link_service.rb +41 -3
  81. data/lib/stripe/services/v2/core/account_service.rb +38 -2
  82. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +34 -19
  83. data/lib/stripe/services/v2/test_helpers/financial_address_service.rb +4 -0
  84. data/lib/stripe/services.rb +2 -0
  85. data/lib/stripe/version.rb +1 -1
  86. data/rbi/stripe.rbi +4893 -390
  87. metadata +9 -4
@@ -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
@@ -953,7 +953,7 @@ module Stripe
953
953
  )
954
954
  end
955
955
 
956
- # Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
956
+ # Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated.
957
957
  def update(payment_method, params = {}, opts = {})
958
958
  request(
959
959
  method: :post,
@@ -821,7 +821,7 @@ module Stripe
821
821
  end
822
822
 
823
823
  class BillingMode < Stripe::RequestParams
824
- # Attribute for param field type
824
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
825
825
  attr_accessor :type
826
826
 
827
827
  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
@@ -137,7 +137,7 @@ module Stripe
137
137
  #
138
138
  # 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).
139
139
  #
140
- # 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.
140
+ # 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.
141
141
  attr_accessor :payment_behavior
142
142
  # The identifier of the new plan for this subscription item.
143
143
  attr_accessor :plan
@@ -332,7 +332,7 @@ module Stripe
332
332
  #
333
333
  # 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).
334
334
  #
335
- # 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.
335
+ # 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.
336
336
  attr_accessor :payment_behavior
337
337
  # The identifier of the plan to add to the subscription.
338
338
  attr_accessor :plan
@@ -127,7 +127,7 @@ module Stripe
127
127
 
128
128
  class CreateParams < Stripe::RequestParams
129
129
  class BillingMode < Stripe::RequestParams
130
- # Attribute for param field type
130
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
131
131
  attr_accessor :type
132
132
 
133
133
  def initialize(type: nil)
@@ -423,6 +423,18 @@ module Stripe
423
423
  end
424
424
  end
425
425
 
426
+ class Duration < Stripe::RequestParams
427
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
428
+ attr_accessor :interval
429
+ # The multiplier applied to the interval.
430
+ attr_accessor :interval_count
431
+
432
+ def initialize(interval: nil, interval_count: nil)
433
+ @interval = interval
434
+ @interval_count = interval_count
435
+ end
436
+ end
437
+
426
438
  class InvoiceSettings < Stripe::RequestParams
427
439
  class Issuer < Stripe::RequestParams
428
440
  # The connected account being referenced when `type` is `account`.
@@ -656,13 +668,15 @@ module Stripe
656
668
  attr_accessor :description
657
669
  # 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.
658
670
  attr_accessor :discounts
671
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
672
+ attr_accessor :duration
659
673
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
660
674
  attr_accessor :end_date
661
675
  # All invoices will be billed using the specified settings.
662
676
  attr_accessor :invoice_settings
663
677
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
664
678
  attr_accessor :items
665
- # 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.
679
+ # 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.
666
680
  attr_accessor :iterations
667
681
  # 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`.
668
682
  attr_accessor :metadata
@@ -695,6 +709,7 @@ module Stripe
695
709
  default_tax_rates: nil,
696
710
  description: nil,
697
711
  discounts: nil,
712
+ duration: nil,
698
713
  end_date: nil,
699
714
  invoice_settings: nil,
700
715
  items: nil,
@@ -720,6 +735,7 @@ module Stripe
720
735
  @default_tax_rates = default_tax_rates
721
736
  @description = description
722
737
  @discounts = discounts
738
+ @duration = duration
723
739
  @end_date = end_date
724
740
  @invoice_settings = invoice_settings
725
741
  @items = items
@@ -1099,6 +1115,18 @@ module Stripe
1099
1115
  end
1100
1116
  end
1101
1117
 
1118
+ class Duration < Stripe::RequestParams
1119
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
1120
+ attr_accessor :interval
1121
+ # The multiplier applied to the interval.
1122
+ attr_accessor :interval_count
1123
+
1124
+ def initialize(interval: nil, interval_count: nil)
1125
+ @interval = interval
1126
+ @interval_count = interval_count
1127
+ end
1128
+ end
1129
+
1102
1130
  class InvoiceSettings < Stripe::RequestParams
1103
1131
  class Issuer < Stripe::RequestParams
1104
1132
  # The connected account being referenced when `type` is `account`.
@@ -1332,13 +1360,15 @@ module Stripe
1332
1360
  attr_accessor :description
1333
1361
  # 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.
1334
1362
  attr_accessor :discounts
1363
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
1364
+ attr_accessor :duration
1335
1365
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
1336
1366
  attr_accessor :end_date
1337
1367
  # All invoices will be billed using the specified settings.
1338
1368
  attr_accessor :invoice_settings
1339
1369
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
1340
1370
  attr_accessor :items
1341
- # 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.
1371
+ # 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.
1342
1372
  attr_accessor :iterations
1343
1373
  # 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`.
1344
1374
  attr_accessor :metadata
@@ -1373,6 +1403,7 @@ module Stripe
1373
1403
  default_tax_rates: nil,
1374
1404
  description: nil,
1375
1405
  discounts: nil,
1406
+ duration: nil,
1376
1407
  end_date: nil,
1377
1408
  invoice_settings: nil,
1378
1409
  items: nil,
@@ -1399,6 +1430,7 @@ module Stripe
1399
1430
  @default_tax_rates = default_tax_rates
1400
1431
  @description = description
1401
1432
  @discounts = discounts
1433
+ @duration = duration
1402
1434
  @end_date = end_date
1403
1435
  @invoice_settings = invoice_settings
1404
1436
  @items = items
@@ -496,6 +496,32 @@ module Stripe
496
496
  class Konbini < Stripe::RequestParams; end
497
497
  class SepaDebit < Stripe::RequestParams; end
498
498
 
499
+ class Upi < Stripe::RequestParams
500
+ class MandateOptions < Stripe::RequestParams
501
+ # Amount to be charged for future payments.
502
+ attr_accessor :amount
503
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
504
+ attr_accessor :amount_type
505
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
506
+ attr_accessor :description
507
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
508
+ attr_accessor :end_date
509
+
510
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
511
+ @amount = amount
512
+ @amount_type = amount_type
513
+ @description = description
514
+ @end_date = end_date
515
+ end
516
+ end
517
+ # Configuration options for setting up an eMandate
518
+ attr_accessor :mandate_options
519
+
520
+ def initialize(mandate_options: nil)
521
+ @mandate_options = mandate_options
522
+ end
523
+ end
524
+
499
525
  class UsBankAccount < Stripe::RequestParams
500
526
  class FinancialConnections < Stripe::RequestParams
501
527
  class Filters < Stripe::RequestParams
@@ -546,6 +572,8 @@ module Stripe
546
572
  attr_accessor :konbini
547
573
  # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
548
574
  attr_accessor :sepa_debit
575
+ # This sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
576
+ attr_accessor :upi
549
577
  # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
550
578
  attr_accessor :us_bank_account
551
579
 
@@ -557,6 +585,7 @@ module Stripe
557
585
  id_bank_transfer: nil,
558
586
  konbini: nil,
559
587
  sepa_debit: nil,
588
+ upi: nil,
560
589
  us_bank_account: nil
561
590
  )
562
591
  @acss_debit = acss_debit
@@ -566,6 +595,7 @@ module Stripe
566
595
  @id_bank_transfer = id_bank_transfer
567
596
  @konbini = konbini
568
597
  @sepa_debit = sepa_debit
598
+ @upi = upi
569
599
  @us_bank_account = us_bank_account
570
600
  end
571
601
  end
@@ -689,7 +719,7 @@ module Stripe
689
719
  #
690
720
  # 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).
691
721
  #
692
- # 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.
722
+ # 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.
693
723
  attr_accessor :payment_behavior
694
724
  # Payment settings to pass to invoices created by the subscription.
695
725
  attr_accessor :payment_settings
@@ -1046,7 +1076,7 @@ module Stripe
1046
1076
  end
1047
1077
 
1048
1078
  class BillingMode < Stripe::RequestParams
1049
- # Attribute for param field type
1079
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
1050
1080
  attr_accessor :type
1051
1081
 
1052
1082
  def initialize(type: nil)
@@ -1375,6 +1405,32 @@ module Stripe
1375
1405
  class Konbini < Stripe::RequestParams; end
1376
1406
  class SepaDebit < Stripe::RequestParams; end
1377
1407
 
1408
+ class Upi < Stripe::RequestParams
1409
+ class MandateOptions < Stripe::RequestParams
1410
+ # Amount to be charged for future payments.
1411
+ attr_accessor :amount
1412
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1413
+ attr_accessor :amount_type
1414
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1415
+ attr_accessor :description
1416
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1417
+ attr_accessor :end_date
1418
+
1419
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
1420
+ @amount = amount
1421
+ @amount_type = amount_type
1422
+ @description = description
1423
+ @end_date = end_date
1424
+ end
1425
+ end
1426
+ # Configuration options for setting up an eMandate
1427
+ attr_accessor :mandate_options
1428
+
1429
+ def initialize(mandate_options: nil)
1430
+ @mandate_options = mandate_options
1431
+ end
1432
+ end
1433
+
1378
1434
  class UsBankAccount < Stripe::RequestParams
1379
1435
  class FinancialConnections < Stripe::RequestParams
1380
1436
  class Filters < Stripe::RequestParams
@@ -1425,6 +1481,8 @@ module Stripe
1425
1481
  attr_accessor :konbini
1426
1482
  # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1427
1483
  attr_accessor :sepa_debit
1484
+ # This sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
1485
+ attr_accessor :upi
1428
1486
  # This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1429
1487
  attr_accessor :us_bank_account
1430
1488
 
@@ -1436,6 +1494,7 @@ module Stripe
1436
1494
  id_bank_transfer: nil,
1437
1495
  konbini: nil,
1438
1496
  sepa_debit: nil,
1497
+ upi: nil,
1439
1498
  us_bank_account: nil
1440
1499
  )
1441
1500
  @acss_debit = acss_debit
@@ -1445,6 +1504,7 @@ module Stripe
1445
1504
  @id_bank_transfer = id_bank_transfer
1446
1505
  @konbini = konbini
1447
1506
  @sepa_debit = sepa_debit
1507
+ @upi = upi
1448
1508
  @us_bank_account = us_bank_account
1449
1509
  end
1450
1510
  end