stripe 15.2.1 → 15.3.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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -0
  3. data/CHANGELOG.md +66 -39
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +14 -50
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_version.rb +2 -1
  8. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +1 -1
  9. data/lib/stripe/resources/account.rb +89 -5
  10. data/lib/stripe/resources/account_session.rb +79 -79
  11. data/lib/stripe/resources/billing_portal/session.rb +2 -2
  12. data/lib/stripe/resources/charge.rb +28 -15
  13. data/lib/stripe/resources/checkout/session.rb +57 -7
  14. data/lib/stripe/resources/confirmation_token.rb +19 -11
  15. data/lib/stripe/resources/credit_note.rb +9 -9
  16. data/lib/stripe/resources/customer_session.rb +2 -2
  17. data/lib/stripe/resources/event.rb +1 -1
  18. data/lib/stripe/resources/identity/verification_session.rb +34 -0
  19. data/lib/stripe/resources/invoice.rb +29 -4
  20. data/lib/stripe/resources/invoice_item.rb +1 -4
  21. data/lib/stripe/resources/mandate.rb +3 -0
  22. data/lib/stripe/resources/payment_intent.rb +331 -12
  23. data/lib/stripe/resources/payment_method.rb +17 -9
  24. data/lib/stripe/resources/quote.rb +26 -3
  25. data/lib/stripe/resources/setup_attempt.rb +1 -1
  26. data/lib/stripe/resources/setup_intent.rb +285 -3
  27. data/lib/stripe/resources/subscription.rb +68 -6
  28. data/lib/stripe/resources/subscription_schedule.rb +22 -0
  29. data/lib/stripe/resources/tax/registration.rb +20 -0
  30. data/lib/stripe/resources/terminal/configuration.rb +1 -0
  31. data/lib/stripe/resources/terminal/reader.rb +152 -4
  32. data/lib/stripe/resources/token.rb +1 -1
  33. data/lib/stripe/resources/treasury/financial_account.rb +5 -1
  34. data/lib/stripe/services/account_service.rb +83 -5
  35. data/lib/stripe/services/account_session_service.rb +48 -48
  36. data/lib/stripe/services/billing_portal/session_service.rb +1 -1
  37. data/lib/stripe/services/checkout/session_service.rb +57 -7
  38. data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
  39. data/lib/stripe/services/credit_note_service.rb +6 -6
  40. data/lib/stripe/services/customer_session_service.rb +1 -1
  41. data/lib/stripe/services/identity/verification_session_service.rb +16 -0
  42. data/lib/stripe/services/invoice_service.rb +29 -4
  43. data/lib/stripe/services/payment_intent_service.rb +315 -9
  44. data/lib/stripe/services/payment_method_service.rb +5 -0
  45. data/lib/stripe/services/quote_service.rb +20 -3
  46. data/lib/stripe/services/setup_intent_service.rb +275 -2
  47. data/lib/stripe/services/subscription_schedule_service.rb +13 -0
  48. data/lib/stripe/services/subscription_service.rb +48 -4
  49. data/lib/stripe/services/tax/registration_service.rb +13 -0
  50. data/lib/stripe/services/terminal/reader_service.rb +90 -0
  51. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +6 -1
  52. data/lib/stripe/services/token_service.rb +1 -1
  53. data/lib/stripe/services/treasury/financial_account_service.rb +5 -1
  54. data/lib/stripe/services/v2/billing_service.rb +2 -2
  55. data/lib/stripe/services/v2/core/event_destination_service.rb +16 -16
  56. data/lib/stripe/version.rb +1 -1
  57. data/rbi/stripe/resources/account.rbi +78 -9
  58. data/rbi/stripe/resources/account_session.rbi +79 -79
  59. data/rbi/stripe/resources/billing_portal/session.rbi +2 -2
  60. data/rbi/stripe/resources/charge.rbi +32 -15
  61. data/rbi/stripe/resources/checkout/session.rbi +65 -9
  62. data/rbi/stripe/resources/confirmation_token.rbi +23 -12
  63. data/rbi/stripe/resources/credit_note.rbi +9 -9
  64. data/rbi/stripe/resources/customer_session.rbi +2 -2
  65. data/rbi/stripe/resources/event.rbi +1 -1
  66. data/rbi/stripe/resources/identity/verification_session.rbi +39 -1
  67. data/rbi/stripe/resources/invoice.rbi +36 -6
  68. data/rbi/stripe/resources/invoice_item.rbi +1 -4
  69. data/rbi/stripe/resources/mandate.rbi +4 -0
  70. data/rbi/stripe/resources/payment_intent.rbi +361 -21
  71. data/rbi/stripe/resources/payment_method.rbi +19 -10
  72. data/rbi/stripe/resources/quote.rbi +22 -3
  73. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  74. data/rbi/stripe/resources/setup_intent.rbi +332 -9
  75. data/rbi/stripe/resources/subscription.rbi +60 -7
  76. data/rbi/stripe/resources/subscription_schedule.rbi +23 -1
  77. data/rbi/stripe/resources/tax/registration.rbi +20 -1
  78. data/rbi/stripe/resources/terminal/configuration.rbi +1 -0
  79. data/rbi/stripe/resources/terminal/location.rbi +2 -2
  80. data/rbi/stripe/resources/terminal/reader.rbi +151 -4
  81. data/rbi/stripe/resources/token.rbi +1 -1
  82. data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
  83. data/rbi/stripe/services/account_service.rbi +77 -9
  84. data/rbi/stripe/services/account_session_service.rbi +48 -48
  85. data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
  86. data/rbi/stripe/services/checkout/session_service.rbi +65 -9
  87. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
  88. data/rbi/stripe/services/credit_note_service.rbi +6 -6
  89. data/rbi/stripe/services/customer_session_service.rbi +1 -1
  90. data/rbi/stripe/services/identity/verification_session_service.rbi +17 -1
  91. data/rbi/stripe/services/invoice_service.rbi +36 -6
  92. data/rbi/stripe/services/payment_intent_service.rbi +348 -18
  93. data/rbi/stripe/services/payment_method_service.rbi +6 -1
  94. data/rbi/stripe/services/quote_service.rbi +16 -3
  95. data/rbi/stripe/services/setup_intent_service.rbi +326 -8
  96. data/rbi/stripe/services/subscription_schedule_service.rbi +12 -1
  97. data/rbi/stripe/services/subscription_service.rbi +41 -5
  98. data/rbi/stripe/services/tax/registration_service.rbi +14 -1
  99. data/rbi/stripe/services/terminal/location_service.rbi +2 -2
  100. data/rbi/stripe/services/terminal/reader_service.rbi +85 -0
  101. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +9 -2
  102. data/rbi/stripe/services/token_service.rbi +1 -1
  103. data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
  104. data/rbi/stripe/services/v2/billing_service.rbi +1 -1
  105. data/rbi/stripe/services/v2/core/event_destination_service.rbi +13 -13
  106. metadata +3 -2
@@ -888,7 +888,7 @@ module Stripe
888
888
  # One of `month`.
889
889
  sig { returns(T.nilable(String)) }
890
890
  attr_accessor :interval
891
- # Type of installment plan, one of `fixed_count`.
891
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
892
892
  sig { returns(String) }
893
893
  attr_accessor :type
894
894
  sig {
@@ -1580,7 +1580,7 @@ module Stripe
1580
1580
  # One of `month`.
1581
1581
  sig { returns(T.nilable(String)) }
1582
1582
  attr_accessor :interval
1583
- # Type of installment plan, one of `fixed_count`.
1583
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
1584
1584
  sig { returns(String) }
1585
1585
  attr_accessor :type
1586
1586
  sig {
@@ -2981,6 +2981,13 @@ module Stripe
2981
2981
  def initialize(account: nil, type: nil); end
2982
2982
  end
2983
2983
  class ScheduleDetails < Stripe::RequestParams
2984
+ class BillingMode < Stripe::RequestParams
2985
+ # Attribute for param field type
2986
+ sig { returns(String) }
2987
+ attr_accessor :type
2988
+ sig { params(type: String).void }
2989
+ def initialize(type: nil); end
2990
+ end
2984
2991
  class Phase < Stripe::RequestParams
2985
2992
  class AddInvoiceItem < Stripe::RequestParams
2986
2993
  class Discount < Stripe::RequestParams
@@ -3361,6 +3368,11 @@ module Stripe
3361
3368
  trial_end: nil
3362
3369
  ); end
3363
3370
  end
3371
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3372
+ sig {
3373
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::BillingMode))
3374
+ }
3375
+ attr_accessor :billing_mode
3364
3376
  # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.
3365
3377
  sig { returns(T.nilable(String)) }
3366
3378
  attr_accessor :end_behavior
@@ -3373,11 +3385,23 @@ module Stripe
3373
3385
  sig { returns(T.nilable(String)) }
3374
3386
  attr_accessor :proration_behavior
3375
3387
  sig {
3376
- params(end_behavior: T.nilable(String), phases: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]), proration_behavior: T.nilable(String)).void
3388
+ params(billing_mode: T.nilable(::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::BillingMode), end_behavior: T.nilable(String), phases: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::ScheduleDetails::Phase]), proration_behavior: T.nilable(String)).void
3377
3389
  }
3378
- def initialize(end_behavior: nil, phases: nil, proration_behavior: nil); end
3390
+ def initialize(
3391
+ billing_mode: nil,
3392
+ end_behavior: nil,
3393
+ phases: nil,
3394
+ proration_behavior: nil
3395
+ ); end
3379
3396
  end
3380
3397
  class SubscriptionDetails < Stripe::RequestParams
3398
+ class BillingMode < Stripe::RequestParams
3399
+ # Attribute for param field type
3400
+ sig { returns(String) }
3401
+ attr_accessor :type
3402
+ sig { params(type: String).void }
3403
+ def initialize(type: nil); end
3404
+ end
3381
3405
  class Item < Stripe::RequestParams
3382
3406
  class BillingThresholds < Stripe::RequestParams
3383
3407
  # Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
@@ -3503,10 +3527,15 @@ module Stripe
3503
3527
  # For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
3504
3528
  sig { returns(T.nilable(T.any(String, Integer))) }
3505
3529
  attr_accessor :billing_cycle_anchor
3530
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
3531
+ sig {
3532
+ returns(T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::BillingMode))
3533
+ }
3534
+ attr_accessor :billing_mode
3506
3535
  # A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
3507
3536
  sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
3508
3537
  attr_accessor :cancel_at
3509
- # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead.
3538
+ # Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
3510
3539
  sig { returns(T.nilable(T::Boolean)) }
3511
3540
  attr_accessor :cancel_at_period_end
3512
3541
  # This simulates the subscription being canceled or expired immediately.
@@ -3536,10 +3565,11 @@ module Stripe
3536
3565
  sig { returns(T.nilable(T.any(String, Integer))) }
3537
3566
  attr_accessor :trial_end
3538
3567
  sig {
3539
- params(billing_cycle_anchor: T.nilable(T.any(String, Integer)), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancel_now: T.nilable(T::Boolean), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), resume_at: T.nilable(String), start_date: T.nilable(Integer), trial_end: T.nilable(T.any(String, Integer))).void
3568
+ params(billing_cycle_anchor: T.nilable(T.any(String, Integer)), billing_mode: T.nilable(::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::BillingMode), cancel_at: T.nilable(T.nilable(T.any(String, Integer))), cancel_at_period_end: T.nilable(T::Boolean), cancel_now: T.nilable(T::Boolean), default_tax_rates: T.nilable(T.nilable(T.any(String, T::Array[String]))), items: T.nilable(T::Array[::Stripe::Invoice::CreatePreviewParams::SubscriptionDetails::Item]), proration_behavior: T.nilable(String), proration_date: T.nilable(Integer), resume_at: T.nilable(String), start_date: T.nilable(Integer), trial_end: T.nilable(T.any(String, Integer))).void
3540
3569
  }
3541
3570
  def initialize(
3542
3571
  billing_cycle_anchor: nil,
3572
+ billing_mode: nil,
3543
3573
  cancel_at: nil,
3544
3574
  cancel_at_period_end: nil,
3545
3575
  cancel_now: nil,
@@ -3,10 +3,7 @@
3
3
 
4
4
  # typed: true
5
5
  module Stripe
6
- # Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an
7
- # invoice by creating or updating it with an `invoice` field, at which point it will be included as
8
- # [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within
9
- # [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines).
6
+ # Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). When you create an invoice item with an `invoice` field, it is attached to the specified invoice and included as [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines).
10
7
  #
11
8
  # Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined
12
9
  # with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge
@@ -67,6 +67,7 @@ module Stripe
67
67
  class Card < Stripe::StripeObject; end
68
68
  class Cashapp < Stripe::StripeObject; end
69
69
  class KakaoPay < Stripe::StripeObject; end
70
+ class Klarna < Stripe::StripeObject; end
70
71
  class KrCard < Stripe::StripeObject; end
71
72
  class Link < Stripe::StripeObject; end
72
73
  class NaverPay < Stripe::StripeObject; end
@@ -114,6 +115,9 @@ module Stripe
114
115
  # Attribute for field kakao_pay
115
116
  sig { returns(KakaoPay) }
116
117
  attr_reader :kakao_pay
118
+ # Attribute for field klarna
119
+ sig { returns(Klarna) }
120
+ attr_reader :klarna
117
121
  # Attribute for field kr_card
118
122
  sig { returns(KrCard) }
119
123
  attr_reader :kr_card