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
@@ -847,7 +847,7 @@ module Stripe
847
847
  # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
848
848
  # One of `month`.
849
849
  attr_reader :interval
850
- # Type of installment plan, one of `fixed_count`.
850
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
851
851
  attr_reader :type
852
852
  end
853
853
 
@@ -857,7 +857,7 @@ module Stripe
857
857
  # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
858
858
  # One of `month`.
859
859
  attr_reader :interval
860
- # Type of installment plan, one of `fixed_count`.
860
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
861
861
  attr_reader :type
862
862
  end
863
863
  # Installment plans that may be selected for this PaymentIntent.
@@ -890,7 +890,7 @@ module Stripe
890
890
  end
891
891
  # Controls when the funds will be captured from the customer's account.
892
892
  attr_reader :capture_method
893
- # Installment details for this payment (Mexico only).
893
+ # Installment details for this payment.
894
894
  #
895
895
  # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
896
896
  attr_reader :installments
@@ -950,6 +950,17 @@ module Stripe
950
950
  attr_reader :setup_future_usage
951
951
  end
952
952
 
953
+ class Crypto < Stripe::StripeObject
954
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
955
+ #
956
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
957
+ #
958
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
959
+ #
960
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
961
+ attr_reader :setup_future_usage
962
+ end
963
+
953
964
  class CustomerBalance < Stripe::StripeObject
954
965
  class BankTransfer < Stripe::StripeObject
955
966
  class EuBankTransfer < Stripe::StripeObject
@@ -1420,6 +1431,8 @@ module Stripe
1420
1431
  attr_reader :card_present
1421
1432
  # Attribute for field cashapp
1422
1433
  attr_reader :cashapp
1434
+ # Attribute for field crypto
1435
+ attr_reader :crypto
1423
1436
  # Attribute for field customer_balance
1424
1437
  attr_reader :customer_balance
1425
1438
  # Attribute for field eps
@@ -1764,6 +1777,7 @@ module Stripe
1764
1777
  end
1765
1778
 
1766
1779
  class Cashapp < Stripe::RequestParams; end
1780
+ class Crypto < Stripe::RequestParams; end
1767
1781
  class CustomerBalance < Stripe::RequestParams; end
1768
1782
 
1769
1783
  class Eps < Stripe::RequestParams
@@ -1982,6 +1996,8 @@ module Stripe
1982
1996
  attr_accessor :boleto
1983
1997
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
1984
1998
  attr_accessor :cashapp
1999
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
2000
+ attr_accessor :crypto
1985
2001
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
1986
2002
  attr_accessor :customer_balance
1987
2003
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -2073,6 +2089,7 @@ module Stripe
2073
2089
  blik: nil,
2074
2090
  boleto: nil,
2075
2091
  cashapp: nil,
2092
+ crypto: nil,
2076
2093
  customer_balance: nil,
2077
2094
  eps: nil,
2078
2095
  fpx: nil,
@@ -2126,6 +2143,7 @@ module Stripe
2126
2143
  @blik = blik
2127
2144
  @boleto = boleto
2128
2145
  @cashapp = cashapp
2146
+ @crypto = crypto
2129
2147
  @customer_balance = customer_balance
2130
2148
  @eps = eps
2131
2149
  @fpx = fpx
@@ -2461,7 +2479,7 @@ module Stripe
2461
2479
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
2462
2480
  # One of `month`.
2463
2481
  attr_accessor :interval
2464
- # Type of installment plan, one of `fixed_count`.
2482
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
2465
2483
  attr_accessor :type
2466
2484
 
2467
2485
  def initialize(count: nil, interval: nil, type: nil)
@@ -2739,6 +2757,23 @@ module Stripe
2739
2757
  end
2740
2758
  end
2741
2759
 
2760
+ class Crypto < Stripe::RequestParams
2761
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
2762
+ #
2763
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
2764
+ #
2765
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
2766
+ #
2767
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
2768
+ #
2769
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2770
+ attr_accessor :setup_future_usage
2771
+
2772
+ def initialize(setup_future_usage: nil)
2773
+ @setup_future_usage = setup_future_usage
2774
+ end
2775
+ end
2776
+
2742
2777
  class CustomerBalance < Stripe::RequestParams
2743
2778
  class BankTransfer < Stripe::RequestParams
2744
2779
  class EuBankTransfer < Stripe::RequestParams
@@ -2896,12 +2931,78 @@ module Stripe
2896
2931
  end
2897
2932
 
2898
2933
  class Klarna < Stripe::RequestParams
2934
+ class OnDemand < Stripe::RequestParams
2935
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
2936
+ attr_accessor :average_amount
2937
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
2938
+ attr_accessor :maximum_amount
2939
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
2940
+ attr_accessor :minimum_amount
2941
+ # Interval at which the customer is making purchases
2942
+ attr_accessor :purchase_interval
2943
+ # The number of `purchase_interval` between charges
2944
+ attr_accessor :purchase_interval_count
2945
+
2946
+ def initialize(
2947
+ average_amount: nil,
2948
+ maximum_amount: nil,
2949
+ minimum_amount: nil,
2950
+ purchase_interval: nil,
2951
+ purchase_interval_count: nil
2952
+ )
2953
+ @average_amount = average_amount
2954
+ @maximum_amount = maximum_amount
2955
+ @minimum_amount = minimum_amount
2956
+ @purchase_interval = purchase_interval
2957
+ @purchase_interval_count = purchase_interval_count
2958
+ end
2959
+ end
2960
+
2961
+ class Subscription < Stripe::RequestParams
2962
+ class NextBilling < Stripe::RequestParams
2963
+ # The amount of the next charge for the subscription.
2964
+ attr_accessor :amount
2965
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
2966
+ attr_accessor :date
2967
+
2968
+ def initialize(amount: nil, date: nil)
2969
+ @amount = amount
2970
+ @date = date
2971
+ end
2972
+ end
2973
+ # Unit of time between subscription charges.
2974
+ attr_accessor :interval
2975
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
2976
+ attr_accessor :interval_count
2977
+ # Name for subscription.
2978
+ attr_accessor :name
2979
+ # Describes the upcoming charge for this subscription.
2980
+ attr_accessor :next_billing
2981
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
2982
+ attr_accessor :reference
2983
+
2984
+ def initialize(
2985
+ interval: nil,
2986
+ interval_count: nil,
2987
+ name: nil,
2988
+ next_billing: nil,
2989
+ reference: nil
2990
+ )
2991
+ @interval = interval
2992
+ @interval_count = interval_count
2993
+ @name = name
2994
+ @next_billing = next_billing
2995
+ @reference = reference
2996
+ end
2997
+ end
2899
2998
  # Controls when the funds are captured from the customer's account.
2900
2999
  #
2901
3000
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
2902
3001
  #
2903
3002
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
2904
3003
  attr_accessor :capture_method
3004
+ # On-demand details if setting up or charging an on-demand payment.
3005
+ attr_accessor :on_demand
2905
3006
  # Preferred language of the Klarna authorization page that the customer is redirected to
2906
3007
  attr_accessor :preferred_locale
2907
3008
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -2914,11 +3015,21 @@ module Stripe
2914
3015
  #
2915
3016
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
2916
3017
  attr_accessor :setup_future_usage
3018
+ # Subscription details if setting up or charging a subscription.
3019
+ attr_accessor :subscriptions
2917
3020
 
2918
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
3021
+ def initialize(
3022
+ capture_method: nil,
3023
+ on_demand: nil,
3024
+ preferred_locale: nil,
3025
+ setup_future_usage: nil,
3026
+ subscriptions: nil
3027
+ )
2919
3028
  @capture_method = capture_method
3029
+ @on_demand = on_demand
2920
3030
  @preferred_locale = preferred_locale
2921
3031
  @setup_future_usage = setup_future_usage
3032
+ @subscriptions = subscriptions
2922
3033
  end
2923
3034
  end
2924
3035
 
@@ -3527,6 +3638,8 @@ module Stripe
3527
3638
  attr_accessor :card_present
3528
3639
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
3529
3640
  attr_accessor :cashapp
3641
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
3642
+ attr_accessor :crypto
3530
3643
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
3531
3644
  attr_accessor :customer_balance
3532
3645
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -3612,6 +3725,7 @@ module Stripe
3612
3725
  card: nil,
3613
3726
  card_present: nil,
3614
3727
  cashapp: nil,
3728
+ crypto: nil,
3615
3729
  customer_balance: nil,
3616
3730
  eps: nil,
3617
3731
  fpx: nil,
@@ -3662,6 +3776,7 @@ module Stripe
3662
3776
  @card = card
3663
3777
  @card_present = card_present
3664
3778
  @cashapp = cashapp
3779
+ @crypto = crypto
3665
3780
  @customer_balance = customer_balance
3666
3781
  @eps = eps
3667
3782
  @fpx = fpx
@@ -3833,7 +3948,7 @@ module Stripe
3833
3948
  attr_accessor :payment_method_data
3834
3949
  # Payment method-specific configuration for this PaymentIntent.
3835
3950
  attr_accessor :payment_method_options
3836
- # The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
3951
+ # The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
3837
3952
  attr_accessor :payment_method_types
3838
3953
  # Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
3839
3954
  attr_accessor :radar_options
@@ -4047,6 +4162,7 @@ module Stripe
4047
4162
  end
4048
4163
 
4049
4164
  class Cashapp < Stripe::RequestParams; end
4165
+ class Crypto < Stripe::RequestParams; end
4050
4166
  class CustomerBalance < Stripe::RequestParams; end
4051
4167
 
4052
4168
  class Eps < Stripe::RequestParams
@@ -4265,6 +4381,8 @@ module Stripe
4265
4381
  attr_accessor :boleto
4266
4382
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
4267
4383
  attr_accessor :cashapp
4384
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
4385
+ attr_accessor :crypto
4268
4386
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
4269
4387
  attr_accessor :customer_balance
4270
4388
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -4356,6 +4474,7 @@ module Stripe
4356
4474
  blik: nil,
4357
4475
  boleto: nil,
4358
4476
  cashapp: nil,
4477
+ crypto: nil,
4359
4478
  customer_balance: nil,
4360
4479
  eps: nil,
4361
4480
  fpx: nil,
@@ -4409,6 +4528,7 @@ module Stripe
4409
4528
  @blik = blik
4410
4529
  @boleto = boleto
4411
4530
  @cashapp = cashapp
4531
+ @crypto = crypto
4412
4532
  @customer_balance = customer_balance
4413
4533
  @eps = eps
4414
4534
  @fpx = fpx
@@ -4744,7 +4864,7 @@ module Stripe
4744
4864
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
4745
4865
  # One of `month`.
4746
4866
  attr_accessor :interval
4747
- # Type of installment plan, one of `fixed_count`.
4867
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
4748
4868
  attr_accessor :type
4749
4869
 
4750
4870
  def initialize(count: nil, interval: nil, type: nil)
@@ -5022,6 +5142,23 @@ module Stripe
5022
5142
  end
5023
5143
  end
5024
5144
 
5145
+ class Crypto < Stripe::RequestParams
5146
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
5147
+ #
5148
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
5149
+ #
5150
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
5151
+ #
5152
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
5153
+ #
5154
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5155
+ attr_accessor :setup_future_usage
5156
+
5157
+ def initialize(setup_future_usage: nil)
5158
+ @setup_future_usage = setup_future_usage
5159
+ end
5160
+ end
5161
+
5025
5162
  class CustomerBalance < Stripe::RequestParams
5026
5163
  class BankTransfer < Stripe::RequestParams
5027
5164
  class EuBankTransfer < Stripe::RequestParams
@@ -5179,12 +5316,78 @@ module Stripe
5179
5316
  end
5180
5317
 
5181
5318
  class Klarna < Stripe::RequestParams
5319
+ class OnDemand < Stripe::RequestParams
5320
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
5321
+ attr_accessor :average_amount
5322
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
5323
+ attr_accessor :maximum_amount
5324
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
5325
+ attr_accessor :minimum_amount
5326
+ # Interval at which the customer is making purchases
5327
+ attr_accessor :purchase_interval
5328
+ # The number of `purchase_interval` between charges
5329
+ attr_accessor :purchase_interval_count
5330
+
5331
+ def initialize(
5332
+ average_amount: nil,
5333
+ maximum_amount: nil,
5334
+ minimum_amount: nil,
5335
+ purchase_interval: nil,
5336
+ purchase_interval_count: nil
5337
+ )
5338
+ @average_amount = average_amount
5339
+ @maximum_amount = maximum_amount
5340
+ @minimum_amount = minimum_amount
5341
+ @purchase_interval = purchase_interval
5342
+ @purchase_interval_count = purchase_interval_count
5343
+ end
5344
+ end
5345
+
5346
+ class Subscription < Stripe::RequestParams
5347
+ class NextBilling < Stripe::RequestParams
5348
+ # The amount of the next charge for the subscription.
5349
+ attr_accessor :amount
5350
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
5351
+ attr_accessor :date
5352
+
5353
+ def initialize(amount: nil, date: nil)
5354
+ @amount = amount
5355
+ @date = date
5356
+ end
5357
+ end
5358
+ # Unit of time between subscription charges.
5359
+ attr_accessor :interval
5360
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
5361
+ attr_accessor :interval_count
5362
+ # Name for subscription.
5363
+ attr_accessor :name
5364
+ # Describes the upcoming charge for this subscription.
5365
+ attr_accessor :next_billing
5366
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
5367
+ attr_accessor :reference
5368
+
5369
+ def initialize(
5370
+ interval: nil,
5371
+ interval_count: nil,
5372
+ name: nil,
5373
+ next_billing: nil,
5374
+ reference: nil
5375
+ )
5376
+ @interval = interval
5377
+ @interval_count = interval_count
5378
+ @name = name
5379
+ @next_billing = next_billing
5380
+ @reference = reference
5381
+ end
5382
+ end
5182
5383
  # Controls when the funds are captured from the customer's account.
5183
5384
  #
5184
5385
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5185
5386
  #
5186
5387
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5187
5388
  attr_accessor :capture_method
5389
+ # On-demand details if setting up or charging an on-demand payment.
5390
+ attr_accessor :on_demand
5188
5391
  # Preferred language of the Klarna authorization page that the customer is redirected to
5189
5392
  attr_accessor :preferred_locale
5190
5393
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -5197,11 +5400,21 @@ module Stripe
5197
5400
  #
5198
5401
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
5199
5402
  attr_accessor :setup_future_usage
5403
+ # Subscription details if setting up or charging a subscription.
5404
+ attr_accessor :subscriptions
5200
5405
 
5201
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
5406
+ def initialize(
5407
+ capture_method: nil,
5408
+ on_demand: nil,
5409
+ preferred_locale: nil,
5410
+ setup_future_usage: nil,
5411
+ subscriptions: nil
5412
+ )
5202
5413
  @capture_method = capture_method
5414
+ @on_demand = on_demand
5203
5415
  @preferred_locale = preferred_locale
5204
5416
  @setup_future_usage = setup_future_usage
5417
+ @subscriptions = subscriptions
5205
5418
  end
5206
5419
  end
5207
5420
 
@@ -5810,6 +6023,8 @@ module Stripe
5810
6023
  attr_accessor :card_present
5811
6024
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
5812
6025
  attr_accessor :cashapp
6026
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
6027
+ attr_accessor :crypto
5813
6028
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
5814
6029
  attr_accessor :customer_balance
5815
6030
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -5895,6 +6110,7 @@ module Stripe
5895
6110
  card: nil,
5896
6111
  card_present: nil,
5897
6112
  cashapp: nil,
6113
+ crypto: nil,
5898
6114
  customer_balance: nil,
5899
6115
  eps: nil,
5900
6116
  fpx: nil,
@@ -5945,6 +6161,7 @@ module Stripe
5945
6161
  @card = card
5946
6162
  @card_present = card_present
5947
6163
  @cashapp = cashapp
6164
+ @crypto = crypto
5948
6165
  @customer_balance = customer_balance
5949
6166
  @eps = eps
5950
6167
  @fpx = fpx
@@ -6071,7 +6288,7 @@ module Stripe
6071
6288
  attr_accessor :payment_method_data
6072
6289
  # Payment-method-specific configuration for this PaymentIntent.
6073
6290
  attr_accessor :payment_method_options
6074
- # The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
6291
+ # The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
6075
6292
  attr_accessor :payment_method_types
6076
6293
  # Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
6077
6294
  attr_accessor :receipt_email
@@ -6394,6 +6611,7 @@ module Stripe
6394
6611
  end
6395
6612
 
6396
6613
  class Cashapp < Stripe::RequestParams; end
6614
+ class Crypto < Stripe::RequestParams; end
6397
6615
  class CustomerBalance < Stripe::RequestParams; end
6398
6616
 
6399
6617
  class Eps < Stripe::RequestParams
@@ -6612,6 +6830,8 @@ module Stripe
6612
6830
  attr_accessor :boleto
6613
6831
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
6614
6832
  attr_accessor :cashapp
6833
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
6834
+ attr_accessor :crypto
6615
6835
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
6616
6836
  attr_accessor :customer_balance
6617
6837
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -6703,6 +6923,7 @@ module Stripe
6703
6923
  blik: nil,
6704
6924
  boleto: nil,
6705
6925
  cashapp: nil,
6926
+ crypto: nil,
6706
6927
  customer_balance: nil,
6707
6928
  eps: nil,
6708
6929
  fpx: nil,
@@ -6756,6 +6977,7 @@ module Stripe
6756
6977
  @blik = blik
6757
6978
  @boleto = boleto
6758
6979
  @cashapp = cashapp
6980
+ @crypto = crypto
6759
6981
  @customer_balance = customer_balance
6760
6982
  @eps = eps
6761
6983
  @fpx = fpx
@@ -7091,7 +7313,7 @@ module Stripe
7091
7313
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
7092
7314
  # One of `month`.
7093
7315
  attr_accessor :interval
7094
- # Type of installment plan, one of `fixed_count`.
7316
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
7095
7317
  attr_accessor :type
7096
7318
 
7097
7319
  def initialize(count: nil, interval: nil, type: nil)
@@ -7369,6 +7591,23 @@ module Stripe
7369
7591
  end
7370
7592
  end
7371
7593
 
7594
+ class Crypto < Stripe::RequestParams
7595
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
7596
+ #
7597
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
7598
+ #
7599
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
7600
+ #
7601
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
7602
+ #
7603
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7604
+ attr_accessor :setup_future_usage
7605
+
7606
+ def initialize(setup_future_usage: nil)
7607
+ @setup_future_usage = setup_future_usage
7608
+ end
7609
+ end
7610
+
7372
7611
  class CustomerBalance < Stripe::RequestParams
7373
7612
  class BankTransfer < Stripe::RequestParams
7374
7613
  class EuBankTransfer < Stripe::RequestParams
@@ -7526,12 +7765,78 @@ module Stripe
7526
7765
  end
7527
7766
 
7528
7767
  class Klarna < Stripe::RequestParams
7768
+ class OnDemand < Stripe::RequestParams
7769
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
7770
+ attr_accessor :average_amount
7771
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
7772
+ attr_accessor :maximum_amount
7773
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
7774
+ attr_accessor :minimum_amount
7775
+ # Interval at which the customer is making purchases
7776
+ attr_accessor :purchase_interval
7777
+ # The number of `purchase_interval` between charges
7778
+ attr_accessor :purchase_interval_count
7779
+
7780
+ def initialize(
7781
+ average_amount: nil,
7782
+ maximum_amount: nil,
7783
+ minimum_amount: nil,
7784
+ purchase_interval: nil,
7785
+ purchase_interval_count: nil
7786
+ )
7787
+ @average_amount = average_amount
7788
+ @maximum_amount = maximum_amount
7789
+ @minimum_amount = minimum_amount
7790
+ @purchase_interval = purchase_interval
7791
+ @purchase_interval_count = purchase_interval_count
7792
+ end
7793
+ end
7794
+
7795
+ class Subscription < Stripe::RequestParams
7796
+ class NextBilling < Stripe::RequestParams
7797
+ # The amount of the next charge for the subscription.
7798
+ attr_accessor :amount
7799
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
7800
+ attr_accessor :date
7801
+
7802
+ def initialize(amount: nil, date: nil)
7803
+ @amount = amount
7804
+ @date = date
7805
+ end
7806
+ end
7807
+ # Unit of time between subscription charges.
7808
+ attr_accessor :interval
7809
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
7810
+ attr_accessor :interval_count
7811
+ # Name for subscription.
7812
+ attr_accessor :name
7813
+ # Describes the upcoming charge for this subscription.
7814
+ attr_accessor :next_billing
7815
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
7816
+ attr_accessor :reference
7817
+
7818
+ def initialize(
7819
+ interval: nil,
7820
+ interval_count: nil,
7821
+ name: nil,
7822
+ next_billing: nil,
7823
+ reference: nil
7824
+ )
7825
+ @interval = interval
7826
+ @interval_count = interval_count
7827
+ @name = name
7828
+ @next_billing = next_billing
7829
+ @reference = reference
7830
+ end
7831
+ end
7529
7832
  # Controls when the funds are captured from the customer's account.
7530
7833
  #
7531
7834
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
7532
7835
  #
7533
7836
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
7534
7837
  attr_accessor :capture_method
7838
+ # On-demand details if setting up or charging an on-demand payment.
7839
+ attr_accessor :on_demand
7535
7840
  # Preferred language of the Klarna authorization page that the customer is redirected to
7536
7841
  attr_accessor :preferred_locale
7537
7842
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -7544,11 +7849,21 @@ module Stripe
7544
7849
  #
7545
7850
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
7546
7851
  attr_accessor :setup_future_usage
7852
+ # Subscription details if setting up or charging a subscription.
7853
+ attr_accessor :subscriptions
7547
7854
 
7548
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
7855
+ def initialize(
7856
+ capture_method: nil,
7857
+ on_demand: nil,
7858
+ preferred_locale: nil,
7859
+ setup_future_usage: nil,
7860
+ subscriptions: nil
7861
+ )
7549
7862
  @capture_method = capture_method
7863
+ @on_demand = on_demand
7550
7864
  @preferred_locale = preferred_locale
7551
7865
  @setup_future_usage = setup_future_usage
7866
+ @subscriptions = subscriptions
7552
7867
  end
7553
7868
  end
7554
7869
 
@@ -8157,6 +8472,8 @@ module Stripe
8157
8472
  attr_accessor :card_present
8158
8473
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
8159
8474
  attr_accessor :cashapp
8475
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
8476
+ attr_accessor :crypto
8160
8477
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
8161
8478
  attr_accessor :customer_balance
8162
8479
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -8242,6 +8559,7 @@ module Stripe
8242
8559
  card: nil,
8243
8560
  card_present: nil,
8244
8561
  cashapp: nil,
8562
+ crypto: nil,
8245
8563
  customer_balance: nil,
8246
8564
  eps: nil,
8247
8565
  fpx: nil,
@@ -8292,6 +8610,7 @@ module Stripe
8292
8610
  @card = card
8293
8611
  @card_present = card_present
8294
8612
  @cashapp = cashapp
8613
+ @crypto = crypto
8295
8614
  @customer_balance = customer_balance
8296
8615
  @eps = eps
8297
8616
  @fpx = fpx
@@ -8413,7 +8732,7 @@ module Stripe
8413
8732
  attr_accessor :payment_method_data
8414
8733
  # Payment method-specific configuration for this PaymentIntent.
8415
8734
  attr_accessor :payment_method_options
8416
- # The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
8735
+ # The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
8417
8736
  attr_accessor :payment_method_types
8418
8737
  # Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
8419
8738
  attr_accessor :radar_options