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
@@ -114,9 +114,9 @@ module Stripe
114
114
  class Receipt < Stripe::StripeObject
115
115
  # The type of account being debited or credited
116
116
  attr_reader :account_type
117
- # EMV tag 9F26, cryptogram generated by the integrated circuit chip.
117
+ # The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers.
118
118
  attr_reader :application_cryptogram
119
- # Mnenomic of the Application Identifier.
119
+ # The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip.
120
120
  attr_reader :application_preferred_name
121
121
  # Identifier for this transaction.
122
122
  attr_reader :authorization_code
@@ -124,11 +124,11 @@ module Stripe
124
124
  attr_reader :authorization_response_code
125
125
  # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`.
126
126
  attr_reader :cardholder_verification_method
127
- # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.
127
+ # Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84.
128
128
  attr_reader :dedicated_file_name
129
- # The outcome of a series of EMV functions performed by the card reader.
129
+ # A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95.
130
130
  attr_reader :terminal_verification_results
131
- # An indication of various EMV functions performed during the transaction.
131
+ # An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B.
132
132
  attr_reader :transaction_status_information
133
133
  end
134
134
 
@@ -180,7 +180,7 @@ module Stripe
180
180
  attr_reader :offline
181
181
  # Defines whether the authorized amount can be over-captured or not
182
182
  attr_reader :overcapture_supported
183
- # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
183
+ # The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip.
184
184
  attr_reader :preferred_locales
185
185
  # How card details were read in this transaction.
186
186
  attr_reader :read_method
@@ -407,7 +407,7 @@ module Stripe
407
407
  attr_reader :networks
408
408
  # Details about payment methods collected offline.
409
409
  attr_reader :offline
410
- # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
410
+ # The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip.
411
411
  attr_reader :preferred_locales
412
412
  # How card details were read in this transaction.
413
413
  attr_reader :read_method
@@ -422,6 +422,7 @@ module Stripe
422
422
  attr_reader :cashtag
423
423
  end
424
424
 
425
+ class Crypto < Stripe::StripeObject; end
425
426
  class CustomerBalance < Stripe::StripeObject; end
426
427
 
427
428
  class Eps < Stripe::StripeObject
@@ -440,7 +441,7 @@ module Stripe
440
441
  class Grabpay < Stripe::StripeObject; end
441
442
 
442
443
  class Ideal < Stripe::StripeObject
443
- # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
444
+ # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
444
445
  attr_reader :bank
445
446
  # The Bank Identifier Code of the customer's bank, if the bank was provided.
446
447
  attr_reader :bic
@@ -479,7 +480,7 @@ module Stripe
479
480
  attr_reader :last4
480
481
  # Contains information about card networks that can be used to process the payment.
481
482
  attr_reader :networks
482
- # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.
483
+ # The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip.
483
484
  attr_reader :preferred_locales
484
485
  # How card details were read in this transaction.
485
486
  attr_reader :read_method
@@ -826,6 +827,7 @@ module Stripe
826
827
  end
827
828
 
828
829
  class Cashapp < Stripe::RequestParams; end
830
+ class Crypto < Stripe::RequestParams; end
829
831
  class CustomerBalance < Stripe::RequestParams; end
830
832
 
831
833
  class Eps < Stripe::RequestParams
@@ -1046,6 +1048,8 @@ module Stripe
1046
1048
  attr_accessor :card
1047
1049
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
1048
1050
  attr_accessor :cashapp
1051
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
1052
+ attr_accessor :crypto
1049
1053
  # The `Customer` to whom the original PaymentMethod is attached.
1050
1054
  attr_accessor :customer
1051
1055
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
@@ -1144,6 +1148,7 @@ module Stripe
1144
1148
  boleto: nil,
1145
1149
  card: nil,
1146
1150
  cashapp: nil,
1151
+ crypto: nil,
1147
1152
  customer: nil,
1148
1153
  customer_balance: nil,
1149
1154
  eps: nil,
@@ -1201,6 +1206,7 @@ module Stripe
1201
1206
  @boleto = boleto
1202
1207
  @card = card
1203
1208
  @cashapp = cashapp
1209
+ @crypto = crypto
1204
1210
  @customer = customer
1205
1211
  @customer_balance = customer_balance
1206
1212
  @eps = eps
@@ -1427,6 +1433,8 @@ module Stripe
1427
1433
  attr_reader :cashapp
1428
1434
  # Time at which the object was created. Measured in seconds since the Unix epoch.
1429
1435
  attr_reader :created
1436
+ # Attribute for field crypto
1437
+ attr_reader :crypto
1430
1438
  # The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.
1431
1439
  attr_reader :customer
1432
1440
  # Attribute for field customer_balance
@@ -167,6 +167,12 @@ module Stripe
167
167
  end
168
168
 
169
169
  class SubscriptionData < Stripe::StripeObject
170
+ class BillingMode < Stripe::StripeObject
171
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
172
+ attr_reader :type
173
+ end
174
+ # The billing mode of the quote.
175
+ attr_reader :billing_mode
170
176
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
171
177
  attr_reader :description
172
178
  # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch.
@@ -412,16 +418,33 @@ module Stripe
412
418
  end
413
419
 
414
420
  class SubscriptionData < Stripe::RequestParams
421
+ class BillingMode < Stripe::RequestParams
422
+ # Attribute for param field type
423
+ attr_accessor :type
424
+
425
+ def initialize(type: nil)
426
+ @type = type
427
+ end
428
+ end
429
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
430
+ attr_accessor :billing_mode
415
431
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
416
432
  attr_accessor :description
417
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
433
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
418
434
  attr_accessor :effective_date
419
435
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
420
436
  attr_accessor :metadata
421
437
  # Integer representing the number of trial period days before the customer is charged for the first time.
422
438
  attr_accessor :trial_period_days
423
439
 
424
- def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
440
+ def initialize(
441
+ billing_mode: nil,
442
+ description: nil,
443
+ effective_date: nil,
444
+ metadata: nil,
445
+ trial_period_days: nil
446
+ )
447
+ @billing_mode = billing_mode
425
448
  @description = description
426
449
  @effective_date = effective_date
427
450
  @metadata = metadata
@@ -681,7 +704,7 @@ module Stripe
681
704
  class SubscriptionData < Stripe::RequestParams
682
705
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
683
706
  attr_accessor :description
684
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
707
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
685
708
  attr_accessor :effective_date
686
709
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
687
710
  attr_accessor :metadata
@@ -130,7 +130,7 @@ module Stripe
130
130
  class Cashapp < Stripe::StripeObject; end
131
131
 
132
132
  class Ideal < Stripe::StripeObject
133
- # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
133
+ # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
134
134
  attr_reader :bank
135
135
  # The Bank Identifier Code of the customer's bank.
136
136
  attr_reader :bic
@@ -229,6 +229,13 @@ module Stripe
229
229
 
230
230
  class CardPresent < Stripe::StripeObject; end
231
231
 
232
+ class Klarna < Stripe::StripeObject
233
+ # The currency of the setup intent. Three letter ISO currency code.
234
+ attr_reader :currency
235
+ # Preferred locale of the Klarna checkout page that the customer is redirected to.
236
+ attr_reader :preferred_locale
237
+ end
238
+
232
239
  class Link < Stripe::StripeObject
233
240
  # [Deprecated] This is a legacy parameter that no longer has any function.
234
241
  attr_reader :persistent_token
@@ -285,6 +292,8 @@ module Stripe
285
292
  attr_reader :card
286
293
  # Attribute for field card_present
287
294
  attr_reader :card_present
295
+ # Attribute for field klarna
296
+ attr_reader :klarna
288
297
  # Attribute for field link
289
298
  attr_reader :link
290
299
  # Attribute for field paypal
@@ -519,6 +528,7 @@ module Stripe
519
528
  end
520
529
 
521
530
  class Cashapp < Stripe::RequestParams; end
531
+ class Crypto < Stripe::RequestParams; end
522
532
  class CustomerBalance < Stripe::RequestParams; end
523
533
 
524
534
  class Eps < Stripe::RequestParams
@@ -737,6 +747,8 @@ module Stripe
737
747
  attr_accessor :boleto
738
748
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
739
749
  attr_accessor :cashapp
750
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
751
+ attr_accessor :crypto
740
752
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
741
753
  attr_accessor :customer_balance
742
754
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -828,6 +840,7 @@ module Stripe
828
840
  blik: nil,
829
841
  boleto: nil,
830
842
  cashapp: nil,
843
+ crypto: nil,
831
844
  customer_balance: nil,
832
845
  eps: nil,
833
846
  fpx: nil,
@@ -881,6 +894,7 @@ module Stripe
881
894
  @blik = blik
882
895
  @boleto = boleto
883
896
  @cashapp = cashapp
897
+ @crypto = crypto
884
898
  @customer_balance = customer_balance
885
899
  @eps = eps
886
900
  @fpx = fpx
@@ -1133,6 +1147,88 @@ module Stripe
1133
1147
 
1134
1148
  class CardPresent < Stripe::RequestParams; end
1135
1149
 
1150
+ class Klarna < Stripe::RequestParams
1151
+ class OnDemand < Stripe::RequestParams
1152
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
1153
+ attr_accessor :average_amount
1154
+ # 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.
1155
+ attr_accessor :maximum_amount
1156
+ # 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.
1157
+ attr_accessor :minimum_amount
1158
+ # Interval at which the customer is making purchases
1159
+ attr_accessor :purchase_interval
1160
+ # The number of `purchase_interval` between charges
1161
+ attr_accessor :purchase_interval_count
1162
+
1163
+ def initialize(
1164
+ average_amount: nil,
1165
+ maximum_amount: nil,
1166
+ minimum_amount: nil,
1167
+ purchase_interval: nil,
1168
+ purchase_interval_count: nil
1169
+ )
1170
+ @average_amount = average_amount
1171
+ @maximum_amount = maximum_amount
1172
+ @minimum_amount = minimum_amount
1173
+ @purchase_interval = purchase_interval
1174
+ @purchase_interval_count = purchase_interval_count
1175
+ end
1176
+ end
1177
+
1178
+ class Subscription < Stripe::RequestParams
1179
+ class NextBilling < Stripe::RequestParams
1180
+ # The amount of the next charge for the subscription.
1181
+ attr_accessor :amount
1182
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
1183
+ attr_accessor :date
1184
+
1185
+ def initialize(amount: nil, date: nil)
1186
+ @amount = amount
1187
+ @date = date
1188
+ end
1189
+ end
1190
+ # Unit of time between subscription charges.
1191
+ attr_accessor :interval
1192
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
1193
+ attr_accessor :interval_count
1194
+ # Name for subscription.
1195
+ attr_accessor :name
1196
+ # Describes the upcoming charge for this subscription.
1197
+ attr_accessor :next_billing
1198
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
1199
+ attr_accessor :reference
1200
+
1201
+ def initialize(
1202
+ interval: nil,
1203
+ interval_count: nil,
1204
+ name: nil,
1205
+ next_billing: nil,
1206
+ reference: nil
1207
+ )
1208
+ @interval = interval
1209
+ @interval_count = interval_count
1210
+ @name = name
1211
+ @next_billing = next_billing
1212
+ @reference = reference
1213
+ end
1214
+ end
1215
+ # The currency of the SetupIntent. Three letter ISO currency code.
1216
+ attr_accessor :currency
1217
+ # On-demand details if setting up a payment method for on-demand payments.
1218
+ attr_accessor :on_demand
1219
+ # Preferred language of the Klarna authorization page that the customer is redirected to
1220
+ attr_accessor :preferred_locale
1221
+ # Subscription details if setting up or charging a subscription
1222
+ attr_accessor :subscriptions
1223
+
1224
+ def initialize(currency: nil, on_demand: nil, preferred_locale: nil, subscriptions: nil)
1225
+ @currency = currency
1226
+ @on_demand = on_demand
1227
+ @preferred_locale = preferred_locale
1228
+ @subscriptions = subscriptions
1229
+ end
1230
+ end
1231
+
1136
1232
  class Link < Stripe::RequestParams
1137
1233
  # [Deprecated] This is a legacy parameter that no longer has any function.
1138
1234
  attr_accessor :persistent_token
@@ -1243,6 +1339,8 @@ module Stripe
1243
1339
  attr_accessor :card
1244
1340
  # If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
1245
1341
  attr_accessor :card_present
1342
+ # If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
1343
+ attr_accessor :klarna
1246
1344
  # If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
1247
1345
  attr_accessor :link
1248
1346
  # If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
@@ -1258,6 +1356,7 @@ module Stripe
1258
1356
  bacs_debit: nil,
1259
1357
  card: nil,
1260
1358
  card_present: nil,
1359
+ klarna: nil,
1261
1360
  link: nil,
1262
1361
  paypal: nil,
1263
1362
  sepa_debit: nil,
@@ -1268,6 +1367,7 @@ module Stripe
1268
1367
  @bacs_debit = bacs_debit
1269
1368
  @card = card
1270
1369
  @card_present = card_present
1370
+ @klarna = klarna
1271
1371
  @link = link
1272
1372
  @paypal = paypal
1273
1373
  @sepa_debit = sepa_debit
@@ -1325,7 +1425,7 @@ module Stripe
1325
1425
  attr_accessor :payment_method_data
1326
1426
  # Payment method-specific configuration for this SetupIntent.
1327
1427
  attr_accessor :payment_method_options
1328
- # The list of payment method types (for example, card) that this SetupIntent 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).
1428
+ # The list of payment method types (for example, card) that this SetupIntent 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).
1329
1429
  attr_accessor :payment_method_types
1330
1430
  # The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
1331
1431
  attr_accessor :return_url
@@ -1496,6 +1596,7 @@ module Stripe
1496
1596
  end
1497
1597
 
1498
1598
  class Cashapp < Stripe::RequestParams; end
1599
+ class Crypto < Stripe::RequestParams; end
1499
1600
  class CustomerBalance < Stripe::RequestParams; end
1500
1601
 
1501
1602
  class Eps < Stripe::RequestParams
@@ -1714,6 +1815,8 @@ module Stripe
1714
1815
  attr_accessor :boleto
1715
1816
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
1716
1817
  attr_accessor :cashapp
1818
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
1819
+ attr_accessor :crypto
1717
1820
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
1718
1821
  attr_accessor :customer_balance
1719
1822
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -1805,6 +1908,7 @@ module Stripe
1805
1908
  blik: nil,
1806
1909
  boleto: nil,
1807
1910
  cashapp: nil,
1911
+ crypto: nil,
1808
1912
  customer_balance: nil,
1809
1913
  eps: nil,
1810
1914
  fpx: nil,
@@ -1858,6 +1962,7 @@ module Stripe
1858
1962
  @blik = blik
1859
1963
  @boleto = boleto
1860
1964
  @cashapp = cashapp
1965
+ @crypto = crypto
1861
1966
  @customer_balance = customer_balance
1862
1967
  @eps = eps
1863
1968
  @fpx = fpx
@@ -2110,6 +2215,88 @@ module Stripe
2110
2215
 
2111
2216
  class CardPresent < Stripe::RequestParams; end
2112
2217
 
2218
+ class Klarna < Stripe::RequestParams
2219
+ class OnDemand < Stripe::RequestParams
2220
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
2221
+ attr_accessor :average_amount
2222
+ # 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.
2223
+ attr_accessor :maximum_amount
2224
+ # 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.
2225
+ attr_accessor :minimum_amount
2226
+ # Interval at which the customer is making purchases
2227
+ attr_accessor :purchase_interval
2228
+ # The number of `purchase_interval` between charges
2229
+ attr_accessor :purchase_interval_count
2230
+
2231
+ def initialize(
2232
+ average_amount: nil,
2233
+ maximum_amount: nil,
2234
+ minimum_amount: nil,
2235
+ purchase_interval: nil,
2236
+ purchase_interval_count: nil
2237
+ )
2238
+ @average_amount = average_amount
2239
+ @maximum_amount = maximum_amount
2240
+ @minimum_amount = minimum_amount
2241
+ @purchase_interval = purchase_interval
2242
+ @purchase_interval_count = purchase_interval_count
2243
+ end
2244
+ end
2245
+
2246
+ class Subscription < Stripe::RequestParams
2247
+ class NextBilling < Stripe::RequestParams
2248
+ # The amount of the next charge for the subscription.
2249
+ attr_accessor :amount
2250
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
2251
+ attr_accessor :date
2252
+
2253
+ def initialize(amount: nil, date: nil)
2254
+ @amount = amount
2255
+ @date = date
2256
+ end
2257
+ end
2258
+ # Unit of time between subscription charges.
2259
+ attr_accessor :interval
2260
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
2261
+ attr_accessor :interval_count
2262
+ # Name for subscription.
2263
+ attr_accessor :name
2264
+ # Describes the upcoming charge for this subscription.
2265
+ attr_accessor :next_billing
2266
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
2267
+ attr_accessor :reference
2268
+
2269
+ def initialize(
2270
+ interval: nil,
2271
+ interval_count: nil,
2272
+ name: nil,
2273
+ next_billing: nil,
2274
+ reference: nil
2275
+ )
2276
+ @interval = interval
2277
+ @interval_count = interval_count
2278
+ @name = name
2279
+ @next_billing = next_billing
2280
+ @reference = reference
2281
+ end
2282
+ end
2283
+ # The currency of the SetupIntent. Three letter ISO currency code.
2284
+ attr_accessor :currency
2285
+ # On-demand details if setting up a payment method for on-demand payments.
2286
+ attr_accessor :on_demand
2287
+ # Preferred language of the Klarna authorization page that the customer is redirected to
2288
+ attr_accessor :preferred_locale
2289
+ # Subscription details if setting up or charging a subscription
2290
+ attr_accessor :subscriptions
2291
+
2292
+ def initialize(currency: nil, on_demand: nil, preferred_locale: nil, subscriptions: nil)
2293
+ @currency = currency
2294
+ @on_demand = on_demand
2295
+ @preferred_locale = preferred_locale
2296
+ @subscriptions = subscriptions
2297
+ end
2298
+ end
2299
+
2113
2300
  class Link < Stripe::RequestParams
2114
2301
  # [Deprecated] This is a legacy parameter that no longer has any function.
2115
2302
  attr_accessor :persistent_token
@@ -2220,6 +2407,8 @@ module Stripe
2220
2407
  attr_accessor :card
2221
2408
  # If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
2222
2409
  attr_accessor :card_present
2410
+ # If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
2411
+ attr_accessor :klarna
2223
2412
  # If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
2224
2413
  attr_accessor :link
2225
2414
  # If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
@@ -2235,6 +2424,7 @@ module Stripe
2235
2424
  bacs_debit: nil,
2236
2425
  card: nil,
2237
2426
  card_present: nil,
2427
+ klarna: nil,
2238
2428
  link: nil,
2239
2429
  paypal: nil,
2240
2430
  sepa_debit: nil,
@@ -2245,6 +2435,7 @@ module Stripe
2245
2435
  @bacs_debit = bacs_debit
2246
2436
  @card = card
2247
2437
  @card_present = card_present
2438
+ @klarna = klarna
2248
2439
  @link = link
2249
2440
  @paypal = paypal
2250
2441
  @sepa_debit = sepa_debit
@@ -2278,7 +2469,7 @@ module Stripe
2278
2469
  attr_accessor :payment_method_data
2279
2470
  # Payment method-specific configuration for this SetupIntent.
2280
2471
  attr_accessor :payment_method_options
2281
- # The list of payment method types (for example, card) that this SetupIntent can set up. 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).
2472
+ # The list of payment method types (for example, card) that this SetupIntent can set up. 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).
2282
2473
  attr_accessor :payment_method_types
2283
2474
 
2284
2475
  def initialize(
@@ -2472,6 +2663,7 @@ module Stripe
2472
2663
  end
2473
2664
 
2474
2665
  class Cashapp < Stripe::RequestParams; end
2666
+ class Crypto < Stripe::RequestParams; end
2475
2667
  class CustomerBalance < Stripe::RequestParams; end
2476
2668
 
2477
2669
  class Eps < Stripe::RequestParams
@@ -2690,6 +2882,8 @@ module Stripe
2690
2882
  attr_accessor :boleto
2691
2883
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
2692
2884
  attr_accessor :cashapp
2885
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
2886
+ attr_accessor :crypto
2693
2887
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
2694
2888
  attr_accessor :customer_balance
2695
2889
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -2781,6 +2975,7 @@ module Stripe
2781
2975
  blik: nil,
2782
2976
  boleto: nil,
2783
2977
  cashapp: nil,
2978
+ crypto: nil,
2784
2979
  customer_balance: nil,
2785
2980
  eps: nil,
2786
2981
  fpx: nil,
@@ -2834,6 +3029,7 @@ module Stripe
2834
3029
  @blik = blik
2835
3030
  @boleto = boleto
2836
3031
  @cashapp = cashapp
3032
+ @crypto = crypto
2837
3033
  @customer_balance = customer_balance
2838
3034
  @eps = eps
2839
3035
  @fpx = fpx
@@ -3086,6 +3282,88 @@ module Stripe
3086
3282
 
3087
3283
  class CardPresent < Stripe::RequestParams; end
3088
3284
 
3285
+ class Klarna < Stripe::RequestParams
3286
+ class OnDemand < Stripe::RequestParams
3287
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
3288
+ attr_accessor :average_amount
3289
+ # 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.
3290
+ attr_accessor :maximum_amount
3291
+ # 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.
3292
+ attr_accessor :minimum_amount
3293
+ # Interval at which the customer is making purchases
3294
+ attr_accessor :purchase_interval
3295
+ # The number of `purchase_interval` between charges
3296
+ attr_accessor :purchase_interval_count
3297
+
3298
+ def initialize(
3299
+ average_amount: nil,
3300
+ maximum_amount: nil,
3301
+ minimum_amount: nil,
3302
+ purchase_interval: nil,
3303
+ purchase_interval_count: nil
3304
+ )
3305
+ @average_amount = average_amount
3306
+ @maximum_amount = maximum_amount
3307
+ @minimum_amount = minimum_amount
3308
+ @purchase_interval = purchase_interval
3309
+ @purchase_interval_count = purchase_interval_count
3310
+ end
3311
+ end
3312
+
3313
+ class Subscription < Stripe::RequestParams
3314
+ class NextBilling < Stripe::RequestParams
3315
+ # The amount of the next charge for the subscription.
3316
+ attr_accessor :amount
3317
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
3318
+ attr_accessor :date
3319
+
3320
+ def initialize(amount: nil, date: nil)
3321
+ @amount = amount
3322
+ @date = date
3323
+ end
3324
+ end
3325
+ # Unit of time between subscription charges.
3326
+ attr_accessor :interval
3327
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
3328
+ attr_accessor :interval_count
3329
+ # Name for subscription.
3330
+ attr_accessor :name
3331
+ # Describes the upcoming charge for this subscription.
3332
+ attr_accessor :next_billing
3333
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
3334
+ attr_accessor :reference
3335
+
3336
+ def initialize(
3337
+ interval: nil,
3338
+ interval_count: nil,
3339
+ name: nil,
3340
+ next_billing: nil,
3341
+ reference: nil
3342
+ )
3343
+ @interval = interval
3344
+ @interval_count = interval_count
3345
+ @name = name
3346
+ @next_billing = next_billing
3347
+ @reference = reference
3348
+ end
3349
+ end
3350
+ # The currency of the SetupIntent. Three letter ISO currency code.
3351
+ attr_accessor :currency
3352
+ # On-demand details if setting up a payment method for on-demand payments.
3353
+ attr_accessor :on_demand
3354
+ # Preferred language of the Klarna authorization page that the customer is redirected to
3355
+ attr_accessor :preferred_locale
3356
+ # Subscription details if setting up or charging a subscription
3357
+ attr_accessor :subscriptions
3358
+
3359
+ def initialize(currency: nil, on_demand: nil, preferred_locale: nil, subscriptions: nil)
3360
+ @currency = currency
3361
+ @on_demand = on_demand
3362
+ @preferred_locale = preferred_locale
3363
+ @subscriptions = subscriptions
3364
+ end
3365
+ end
3366
+
3089
3367
  class Link < Stripe::RequestParams
3090
3368
  # [Deprecated] This is a legacy parameter that no longer has any function.
3091
3369
  attr_accessor :persistent_token
@@ -3196,6 +3474,8 @@ module Stripe
3196
3474
  attr_accessor :card
3197
3475
  # If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options.
3198
3476
  attr_accessor :card_present
3477
+ # If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.
3478
+ attr_accessor :klarna
3199
3479
  # If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.
3200
3480
  attr_accessor :link
3201
3481
  # If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.
@@ -3211,6 +3491,7 @@ module Stripe
3211
3491
  bacs_debit: nil,
3212
3492
  card: nil,
3213
3493
  card_present: nil,
3494
+ klarna: nil,
3214
3495
  link: nil,
3215
3496
  paypal: nil,
3216
3497
  sepa_debit: nil,
@@ -3221,6 +3502,7 @@ module Stripe
3221
3502
  @bacs_debit = bacs_debit
3222
3503
  @card = card
3223
3504
  @card_present = card_present
3505
+ @klarna = klarna
3224
3506
  @link = link
3225
3507
  @paypal = paypal
3226
3508
  @sepa_debit = sepa_debit
@@ -3334,7 +3616,7 @@ module Stripe
3334
3616
  attr_reader :payment_method_configuration_details
3335
3617
  # Payment method-specific configuration for this SetupIntent.
3336
3618
  attr_reader :payment_method_options
3337
- # The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.
3619
+ # The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
3338
3620
  attr_reader :payment_method_types
3339
3621
  # ID of the single_use Mandate generated by the SetupIntent.
3340
3622
  attr_reader :single_use_mandate