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
@@ -189,7 +189,7 @@ module Stripe
189
189
  @plan = plan
190
190
  end
191
191
  end
192
- # Installment configuration for payments attempted on this invoice (Mexico Only).
192
+ # Installment configuration for payments attempted on this invoice.
193
193
  #
194
194
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
195
195
  attr_accessor :installments
@@ -237,6 +237,32 @@ module Stripe
237
237
  class Konbini < Stripe::RequestParams; end
238
238
  class SepaDebit < Stripe::RequestParams; end
239
239
 
240
+ class Upi < Stripe::RequestParams
241
+ class MandateOptions < Stripe::RequestParams
242
+ # Amount to be charged for future payments.
243
+ attr_accessor :amount
244
+ # 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.
245
+ attr_accessor :amount_type
246
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
247
+ attr_accessor :description
248
+ # 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.
249
+ attr_accessor :end_date
250
+
251
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
252
+ @amount = amount
253
+ @amount_type = amount_type
254
+ @description = description
255
+ @end_date = end_date
256
+ end
257
+ end
258
+ # Configuration options for setting up an eMandate
259
+ attr_accessor :mandate_options
260
+
261
+ def initialize(mandate_options: nil)
262
+ @mandate_options = mandate_options
263
+ end
264
+ end
265
+
240
266
  class UsBankAccount < Stripe::RequestParams
241
267
  class FinancialConnections < Stripe::RequestParams
242
268
  class Filters < Stripe::RequestParams
@@ -287,6 +313,8 @@ module Stripe
287
313
  attr_accessor :konbini
288
314
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
289
315
  attr_accessor :sepa_debit
316
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
317
+ attr_accessor :upi
290
318
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
291
319
  attr_accessor :us_bank_account
292
320
 
@@ -298,6 +326,7 @@ module Stripe
298
326
  id_bank_transfer: nil,
299
327
  konbini: nil,
300
328
  sepa_debit: nil,
329
+ upi: nil,
301
330
  us_bank_account: nil
302
331
  )
303
332
  @acss_debit = acss_debit
@@ -307,6 +336,7 @@ module Stripe
307
336
  @id_bank_transfer = id_bank_transfer
308
337
  @konbini = konbini
309
338
  @sepa_debit = sepa_debit
339
+ @upi = upi
310
340
  @us_bank_account = us_bank_account
311
341
  end
312
342
  end
@@ -524,7 +554,7 @@ module Stripe
524
554
  attr_accessor :auto_advance
525
555
  # Settings for automatic tax lookup for this invoice.
526
556
  attr_accessor :automatic_tax
527
- # 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.
557
+ # 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.
528
558
  attr_accessor :automatically_finalizes_at
529
559
  # Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices.
530
560
  attr_accessor :collection_method
@@ -902,7 +932,7 @@ module Stripe
902
932
  @plan = plan
903
933
  end
904
934
  end
905
- # Installment configuration for payments attempted on this invoice (Mexico Only).
935
+ # Installment configuration for payments attempted on this invoice.
906
936
  #
907
937
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
908
938
  attr_accessor :installments
@@ -950,6 +980,32 @@ module Stripe
950
980
  class Konbini < Stripe::RequestParams; end
951
981
  class SepaDebit < Stripe::RequestParams; end
952
982
 
983
+ class Upi < Stripe::RequestParams
984
+ class MandateOptions < Stripe::RequestParams
985
+ # Amount to be charged for future payments.
986
+ attr_accessor :amount
987
+ # 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.
988
+ attr_accessor :amount_type
989
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
990
+ attr_accessor :description
991
+ # 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.
992
+ attr_accessor :end_date
993
+
994
+ def initialize(amount: nil, amount_type: nil, description: nil, end_date: nil)
995
+ @amount = amount
996
+ @amount_type = amount_type
997
+ @description = description
998
+ @end_date = end_date
999
+ end
1000
+ end
1001
+ # Configuration options for setting up an eMandate
1002
+ attr_accessor :mandate_options
1003
+
1004
+ def initialize(mandate_options: nil)
1005
+ @mandate_options = mandate_options
1006
+ end
1007
+ end
1008
+
953
1009
  class UsBankAccount < Stripe::RequestParams
954
1010
  class FinancialConnections < Stripe::RequestParams
955
1011
  class Filters < Stripe::RequestParams
@@ -1000,6 +1056,8 @@ module Stripe
1000
1056
  attr_accessor :konbini
1001
1057
  # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent.
1002
1058
  attr_accessor :sepa_debit
1059
+ # If paying by `upi`, this sub-hash contains details about the UPI payment method options to pass to the invoice’s PaymentIntent.
1060
+ attr_accessor :upi
1003
1061
  # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent.
1004
1062
  attr_accessor :us_bank_account
1005
1063
 
@@ -1011,6 +1069,7 @@ module Stripe
1011
1069
  id_bank_transfer: nil,
1012
1070
  konbini: nil,
1013
1071
  sepa_debit: nil,
1072
+ upi: nil,
1014
1073
  us_bank_account: nil
1015
1074
  )
1016
1075
  @acss_debit = acss_debit
@@ -1020,6 +1079,7 @@ module Stripe
1020
1079
  @id_bank_transfer = id_bank_transfer
1021
1080
  @konbini = konbini
1022
1081
  @sepa_debit = sepa_debit
1082
+ @upi = upi
1023
1083
  @us_bank_account = us_bank_account
1024
1084
  end
1025
1085
  end
@@ -1233,11 +1293,11 @@ module Stripe
1233
1293
  attr_accessor :amounts_due
1234
1294
  # 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).
1235
1295
  attr_accessor :application_fee_amount
1236
- # 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.
1296
+ # 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.
1237
1297
  attr_accessor :auto_advance
1238
1298
  # Settings for automatic tax lookup for this invoice.
1239
1299
  attr_accessor :automatic_tax
1240
- # 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.
1300
+ # 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.
1241
1301
  attr_accessor :automatically_finalizes_at
1242
1302
  # 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`.
1243
1303
  attr_accessor :collection_method
@@ -2860,7 +2920,7 @@ module Stripe
2860
2920
  end
2861
2921
 
2862
2922
  class BillingMode < Stripe::RequestParams
2863
- # Attribute for param field type
2923
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
2864
2924
  attr_accessor :type
2865
2925
 
2866
2926
  def initialize(type: nil)
@@ -3043,6 +3103,18 @@ module Stripe
3043
3103
  end
3044
3104
  end
3045
3105
 
3106
+ class Duration < Stripe::RequestParams
3107
+ # Specifies phase duration. Either `day`, `week`, `month` or `year`.
3108
+ attr_accessor :interval
3109
+ # The multiplier applied to the interval.
3110
+ attr_accessor :interval_count
3111
+
3112
+ def initialize(interval: nil, interval_count: nil)
3113
+ @interval = interval
3114
+ @interval_count = interval_count
3115
+ end
3116
+ end
3117
+
3046
3118
  class InvoiceSettings < Stripe::RequestParams
3047
3119
  class Issuer < Stripe::RequestParams
3048
3120
  # The connected account being referenced when `type` is `account`.
@@ -3276,13 +3348,15 @@ module Stripe
3276
3348
  attr_accessor :description
3277
3349
  # 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.
3278
3350
  attr_accessor :discounts
3351
+ # The number of intervals the phase should last. If set, `end_date` must not be set.
3352
+ attr_accessor :duration
3279
3353
  # The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
3280
3354
  attr_accessor :end_date
3281
3355
  # All invoices will be billed using the specified settings.
3282
3356
  attr_accessor :invoice_settings
3283
3357
  # List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.
3284
3358
  attr_accessor :items
3285
- # 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.
3359
+ # 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.
3286
3360
  attr_accessor :iterations
3287
3361
  # 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`.
3288
3362
  attr_accessor :metadata
@@ -3317,6 +3391,7 @@ module Stripe
3317
3391
  default_tax_rates: nil,
3318
3392
  description: nil,
3319
3393
  discounts: nil,
3394
+ duration: nil,
3320
3395
  end_date: nil,
3321
3396
  invoice_settings: nil,
3322
3397
  items: nil,
@@ -3343,6 +3418,7 @@ module Stripe
3343
3418
  @default_tax_rates = default_tax_rates
3344
3419
  @description = description
3345
3420
  @discounts = discounts
3421
+ @duration = duration
3346
3422
  @end_date = end_date
3347
3423
  @invoice_settings = invoice_settings
3348
3424
  @items = items
@@ -3444,7 +3520,7 @@ module Stripe
3444
3520
 
3445
3521
  class SubscriptionDetails < Stripe::RequestParams
3446
3522
  class BillingMode < Stripe::RequestParams
3447
- # Attribute for param field type
3523
+ # Controls the calculation and orchestration of prorations and invoices for subscriptions.
3448
3524
  attr_accessor :type
3449
3525
 
3450
3526
  def initialize(type: nil)